akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
 
using namespace std;
 
#define ll long long int
#define pb push_back
#define mp make_pair
#define INF (ll)(1e18)
#define inf 0x7fffffff
#define inff 100000
#define ff first
#define ss second
#define sz(x) ((int) (x).size())
#define fast cin.sync_with_stdio(0);cin.tie(0)
#define rep(i,N) for(int i = 0;i < N;i++)
#define frep(i,a,b) for(int i = a;i <= b;i++)
#define pii pair<int , int>
#define pll pair<ll , ll>
#define vii vector<int>
#define vpii vector< pii >
#define fill(A,v) memset(A,v,sizeof(A))
#define setbits(x) __builtin_popcountll(x)
#define print(A,j,k) for(int ii=j;ii<k;ii++)cout<<A[ii]<<" ";cout<<"\n"
#define all(x) (x).begin(), (x).end()
#define gcd __gcd
#define SQRT 350
#define CASES int t;cin>>t;while(t--)
#define FILE freopen("inp.txt" , "r" , stdin);
#define ld long double

const int MOD = 1e9 + 7;
const int N = 1e6 + 5;

int A[N];

int main(int argc, char const *argv[])
{
	fast;

	int n;
	cin >> n;

	rep(i , n) {
		cin >> A[i];
	}

	int ans = inf;

	for(int i = -100;i <= 100;i++) {
		int cost = 0;
		for(int j = 0;j < n;j++) {
			cost += abs(A[j] - i) * abs(A[j] - i);
		}
		ans = min(ans , cost);
	}

	cout << ans << '\n';

	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<queue>
const int N=2e5+3,K=18;
int n,fn[2][N][K],a[N],lg[N];
struct node{
	int l,r,p,f;
	bool operator<(const node&b)const{return a[p]>a[b.p];}
};
std::priority_queue<node> q;
inline int Min(int l,int r,int k){
	int t=lg[r-l];
	if(a[fn[k][l][t]]<a[fn[k][r-(1<<t)][t]])
	  return fn[k][l][t];
	return fn[k][r-(1<<t)][t];
}
int main(){
	node u;int b;
	scanf("%d",&n);
	for(int i=2;i<=n;i++)lg[i]=lg[i>>1]+1;
	a[n]=n+1;
	for(int i=0;i<n;i++){
	  scanf("%d",a+i);
	  fn[i&1][i][0]=i;
	  fn[~i&1][i][0]=n;
	}
	for(int k=0;k<2;k++)
	  for(int j=1;j<K;j++)
		for(int i=0;i+(1<<j)<=n;i++)
		  if(a[fn[k][i][j-1]]<a[fn[k][i+(1<<j-1)][j-1]])
			fn[k][i][j]=fn[k][i][j-1];
		  else fn[k][i][j]=fn[k][i+(1<<j-1)][j-1];
	q.push((node){0,n,Min(0,n,0),0});
	for(;!q.empty();){
	  u=q.top(),q.pop();
	  b=Min(u.p+1,u.r,u.f^1);
	  printf("%d %d ",a[u.p],a[b]);
	  if(u.l<u.p)q.push((node){u.l,u.p,Min(u.l,u.p,u.f),u.f});
	  if(u.p+1<b)q.push((node){u.p+1,b,Min(u.p+1,b,u.f^1),u.f^1});
	  if(b+1<u.r)q.push((node){b+1,u.r,Min(b+1,u.r,u.f),u.f});
	}
	return 0;
}

Measured memory_bytes: 31988
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
//#include <stack>
//#include <queue>
//#include <cstdio>
#include <cmath>
#include <iterator>
#include <map>
//#include <list>
#include <iomanip>

using namespace std;

#define IOS ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define prec std::cout << std::fixed << std::setprecision(15);
#define endl "\n"
#define MOD 1000000007
#define Int int64_t
#define PI 3.14159265358979
#define ssort(z) sort(z.begin(), z.end())
#define rsort(z) sort(z.rbegin(), z.rend())
#define eerase(z) z.erase(unique(z.begin(), z.end()), z.end())
#define ccnt(z, w) count(z.begin(), z.end(), w)
#define rep(i,a,n) for(Int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(Int (i)=(a); (i)<=(n); (i)++)
const int MAX_N = 1000000;
const Int MAX_N_Int = 1000000000000;

template <typename T>
void printV(const std::vector<T>& v, const char * const separator = " ")
{
    if(!v.empty())
    {
        std::copy(v.begin(),
                  --v.end(),
                  std::ostream_iterator<T>(std::cout, separator));
        std::cout << v.back() << "\n";
    }
}

bool isPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            // 素数ではない
            return false;
        }
    }

    // 素数である
    return true;
}
Int gcd(Int a, Int b) {
    return b != 0 ? gcd(b, a % b) : a;
}

Int lcm(Int a, Int b) {
    return a / gcd(a, b) * b;
    //a*bは64bit integer overflow
}

int Max(int a, int b, int c) {
    int temp = max(a, b);
    return max(temp, c);
}

int Min(int a, int b, int c) {
    int temp = min(a, b);
    return min(temp, c);
}

bool integer(double num) {
    return floor(num) == num;
}

Int fact(int num) {
    if (num == 0)
        return 1;
    else
        return num * fact(num - 1);
}

Int yakusu(int n) {
    int cnt = 0;
    for (int i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            cnt++;
            if (i * i != n) cnt++;
        }
    }
    return cnt;
}


Int fact_mod(Int n, Int mod) {
    Int f = 1; repq(i,2,n) f = f * (i % MOD) % MOD;
    return f;
}

// 繰り返し二乗法 (modの世界での累乗)
Int mod_pow(Int x, Int n, Int mod) {
    Int res = 1;
    while(n > 0) {
        if(n & 1) res = (res * x) % mod;
        x = (x * x) % mod;
        n >>= 1;
    }
    return res;
}

// 組み合わせ nCr を求める
Int combination_mod(Int n, Int r, Int mod) {
    if(r > n-r) r = n-r;
    if(r == 0) return 1;
    Int a = 1;
    rep(i, 0, r) a = a * ((n-i) % mod) % mod;
    Int b = mod_pow(fact_mod(r, mod), mod-2, mod);
    return (a % mod) * (b % mod) % mod;
}

int main() {
    //COMinit();
    IOS;
    prec;
    Int a,b,c,n,m,k,x,y=0,ans=1;
    string str,s="hon",t,u;
    long double z;
    cin>>a>>s;

    x=(s[0]-'0')*100+(s[2]-'0')*10+(s[3]-'0');
    y=x*a;
    y/=100;
    cout<<y;


    cout<<endl;
    return 0;
}




Measured memory_bytes: 3668
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
using llong = long long;
using P = pair<int, int>;
const int inf = 1 << 20;
const int mod = 1e9 + 7;

int main() {
   string str;
   cin >> str;
   int q;
   cin >> q;
   rep(i, q) {
      string ord;
      cin >> ord;
      int a, b;
      cin >> a >> b;
      if (ord == "print")
         cout << str.substr(a, b - a + 1) << endl;
      else if (ord == "reverse") {
         reverse(str.begin() + a, str.begin() + b + 1);
      } else if (ord == "replace") {
         string p;
         cin >> p;
         str.replace(a, b - a + 1, p);
      }
   }
   return 0;
}


Measured memory_bytes: 3216
#include<bits/stdc++.h>
using namespace std;
const int MOD=1e9+7;
int main()
{
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n,m;
  cin>>n>>m;
  vector<string>s(n);
  for(int i=0;i<n;i++)
    cin>>s[i];
  vector<vector<int>>a(n,vector<int>(m));
  a[0][0]=1;
  for(int i=0;i<n;i++)
  {
	for(int j=0;j<m;j++)
    {
      	if(s[i][j]=='#')
          	continue;
         if(i==0 && j==0)
           continue;
         if(i==0)
            a[i][j]=a[i][j-1];
         else if(j==0)
            a[i][j]=a[i-1][j];
         else
            a[i][j]=(a[i][j]%MOD + a[i-1][j]%MOD + a[i][j-1]%MOD)%MOD;
     }
    }
  cout<<a[n-1][m-1];
  return 0;
 }


Measured memory_bytes: 5248
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main() {
	string s, t;
	cin >> s >> t;

	int ans = 1e9;
	for (int i = 0; i <= s.length() - t.length(); ++i) {
		int k = 0;
		for (int j = 0; j < t.length(); ++j) {
			if (s[i + j] != t[j]) {
				++k;
			}
		}
		ans = min(ans, k);
	}

	cout << ans;
	
	return 0;
}


Measured memory_bytes: 3560
import Data.Set (fromList)

main :: IO ()
main = do
    l1 <- getLine
    l2 <- getLine
    let n = read l1
    let as = (map read . words) l2 :: [Int]
    putStrLn $ solve n as

solve :: Int -> [Int] -> String
solve n as = show . removeDup $ (dup, uniq)
    where
        uniq = length $ fromList as
        dup = n - uniq

removeDup :: (Int, Int) -> Int
removeDup (0, uni) = uni
removeDup (1, uni) = uni - 1
removeDup (x, uni) = removeDup (x-2, uni)


Measured memory_bytes: 31100
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
	    int p = sc.nextInt();
		int p1 = sc.nextInt();
		int p2 = sc.nextInt();
		int j = sc.nextInt();
		int j1 = sc.nextInt();
		int pmin = p,jmin = j;
		if(p1 < pmin){
			pmin = p1;
			if(p2 < pmin){
				pmin = p2;
			}
		}else if(p2 < pmin){
			pmin = p2;
		}
		if(j1 < jmin){
			jmin = j1;
		}
		System.out.println((pmin+jmin)-50);
	}

}

Measured memory_bytes: 26072
#include<bits/stdc++.h>
#include <array>
using namespace std;
using ULL = unsigned long long;
using UL = unsigned;
using LL = long long;
#define rep(i, n) for(UL i = 0; i < (n); i++)

template<class Ty>
using passive_queue = priority_queue<Ty, vector<Ty>, greater<Ty>>;

struct Problem {

	ULL dp[501][512] = {};
	static const ULL M = 998244353;

	void Solve() {
		dp[0][0] = 1;
		UL N, X; cin >> N >> X;
		rep(x, X + 1) {
			rep(i, N) {
				rep(p, 512) {
					dp[i + 1][p ^ x] += dp[i][p];
					dp[i + 1][p ^ x] %= M;
				}
			}
		}
		ULL ans = dp[N][X];
		cout << ans << endl;
	}

	Problem();
};
int main() {
	unique_ptr<Problem> p(new Problem());
	p->Solve();
	return 0;
}
Problem::Problem() {
	cout << fixed << setprecision(10);
}



Measured memory_bytes: 4820
// https://atcoder.jp/contests/abc175/tasks/abc175_c
#include <iostream>
#include <vector>
#include <deque>
#include <tuple>
#include <algorithm>
#include <iterator> // std::back_inserter
#include <climits>
#include <sstream>

using namespace std;

typedef long ll;

int main()
{
    ll a,b,c,d;
    cin >> a >> b >> c >> d;
    /*
    if (b>= 0&& d >= 0) {
        cout << b*d <<endl;
    }
    else if (a<0 && c < 0) {
        cout << a * c << endl;
    }
    else if (b>= 0 && c < 0) {
        cout << b*-c << endl;
    }
    else if (a < 0 && d >= 0) {
        cout << -a * d << endl;        
    }
//    cout << "error" << endl;
    */
    ll m = LLONG_MIN;
    m =  max(m, a*c);
    m =  max(m, a*d);
    m =  max(m, b*c);
    m =  max(m, b*d);

    cout << m << endl; 
}


Measured memory_bytes: 3616
#include <iostream>
using namespace std;
int main()
{
	int l, m, n, s, r, i;
	while (cin >> l && l)
	{
		s = 0;
		r = 0;
		for (i = 0; i < 12; i++)
		{
			cin >> m >> n;
			s += m-n;
			if (!r && s >= l)
				r = i+1;
		}
		if (r == 0)
			cout << "NA" << endl;
		else
			cout << r << endl;
	}
}

Measured memory_bytes: 0
import Control.Applicative
import Control.Monad
import Control.Monad.ST
import qualified Data.ByteString as BS
import Data.Functor
import Data.Function
import Data.Monoid
import Data.Maybe
import Data.List
import qualified Data.Foldable as Foldable
import qualified Data.Set as Set
--import qualified Data.Sequence as Sequence
import Data.List.Split
import Data.Bits
import Data.Char
import Data.Ix
import Data.Ratio
import Data.Ord
import Data.Tuple
import Data.Array
--import Data.Array.Unboxed
--import Data.Array.IArray
import Data.Array.MArray
import Data.Array.IO
import Data.Array.ST
import Data.IORef
import Data.STRef
import GHC.ST
-- import System.IO.Unsafe

-- templete
readInt = read :: String -> Int
readInteger = read :: String -> Integer
readDouble = read :: String -> Double
getInt = readLn :: IO Int
getInts = map readInt . words <$> getLine
getInteger = readLn :: IO Integer
getIntegers = map readInteger . words <$> getLine
getDouble = readLn :: IO Double
getDoubles = map readDouble . words <$> getLine
sjoin :: (Show a) => [a] -> String
sjoin = unwords . map show
tjoin :: (Show a, Show b) => (a, b) -> String
tjoin (x, y) = show x ++ (' ' : show y)
cond :: a -> a -> Bool -> a
cond t f c = if c then t else f
apply2 :: (a -> a -> b) -> [a] -> b
apply2 f [x,y] = f x y
apply3 :: (a -> a -> a -> b) -> [a] -> b
apply3 f [x,y,z] = f x y z
apply4 :: (a -> a -> a -> a -> b) -> [a] -> b
apply4 f [x,y,z,w] = f x y z w
fnTuple :: (a -> b, a -> c) -> a -> (b, c)
fnTuple (f,g) a = (f a, g a)
replace :: (Eq a) => a -> a -> [a] -> [a]
replace x y = map (\z -> if z==x then y else z)
binMap :: (a -> a -> b) -> [a] -> [b]
binMap f (x:xs@(y:_)) = f x y : binMap f xs
binMap _ _ = []
splitRec :: Int -> [a] -> [[a]]
splitRec _ [] = []
splitRec n xs = let (y,ys) = splitAt n xs in y : splitRec n ys
infixl 7 `divCeil`
divCeil :: Integral a => a -> a -> a
x `divCeil` y = (x+y-1) `div` y
coverC :: Ord a => (a, a) -> a -> Bool
coverC (l,r) x = l<=x && x<=r
coverH :: Ord a => (a, a) -> a -> Bool
coverH (l,r) x = l<=x && x<r
ibsearch :: (Int -> Bool) -> (Int,Int) -> Int
ibsearch f (ok,ng) = if abs (ok-ng) <= 1 then ok else let mid = (ok + ng) `div` 2 in ibsearch f (if f mid then (mid,ng) else (ok,mid))
-- templete




main = do
    n <- getInt
    unless (n==0) $ do
        ls <- map (fnTuple (negate . length, head)) . group . sort . concat . map words <$> replicateM n getLine
        k <- head <$> getLine
        let ds = take 5 . sort . takeWhile ((==k) . head . snd) . dropWhile ((/=k) . head . snd) $ ls
        putStrLn $ cond "NA" (unwords . map snd $ ds) $ null ds
        main


Measured memory_bytes: 5612
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(void)
{
	int N=0,M=0,sum=0,a=0;
	scanf("%d %d",&N,&M);
	int N1[N]={0},M1[M]={0},A[N]={0};
	for(int i=0;i<N;i++)
	{
		cin>>N1[i];
	}
	for(int i=0;i<M;i++)
	{
		cin>>M1[i];
		for(int j=0;j<N;j++)
		{
			if(N1[j]<=M1[i]){A[j]++;break;}
		}
	}
	for(int j=0;j<N;j++)
	{
		if(A[j]>sum)
		{
			sum=A[j];
			a=j+1;
		}
	}
	cout<<a<<endl;
	return 0;
}
//7:53.198途中


Measured memory_bytes: 3180
#include <bits/stdc++.h>
using namespace std;

int main()
{
	int N;
	cin >> N;
	vector<int> A( N );
	for( int i = 0;i < N; i++ ) {
		cin >> A[i];
	}

	bool big = true;
	int a = A[0];
	vector<int> mai;
	mai.push_back( a );
	for( int i = 1;i < N; i++ ) {
		if( big ) {
			if( A[i] > a ) a = A[i];
			else if( A[i] < a ) {
				big = false;
				mai.push_back( a );
				a = A[i];
			}
		}
		else {
			if( A[i] < a ) a = A[i];
			else if( A[i] > a ) {
				big = true;
				mai.push_back( a );
				a = A[i];
			}
		}
	}
	if( big && mai[mai.size() - 1] < a ) mai.push_back( a );
	long long ans1 = 1000;
	for( int i = 0;i < mai.size(); i += 2 ) {
		int mi = mai[i];
		if( (i + 1 ) >= mai.size() ) break;
		int ma = mai[i + 1];
		long long n = ans1 / mi;
		int re = ans1 % mi;
		ans1 = ma * n + re;
	}
	big = false;
	a = A[0];
	vector<int> mia;
	for( int i = 1;i < N; i++ ) {
		if( big ) {
			if( A[i] > a ) a = A[i];
			else if( A[i] < a ) {
				big = false;
				mia.push_back( a );
				a = A[i];
			}
		}
		else {
			if( A[i] < a ) a = A[i];
			else if( A[i] > a ) {
				big = true;
				mia.push_back( a );
				a = A[i];
			}
		}
	}
	if( big && mia[mai.size() - 1] < a ) mia.push_back( a );
	long long ans2 = 1000;
	for( int i = 0;i < mia.size(); i += 2 ) {
		int mi = mia[i];
		if( (i + 1 ) >= mia.size() ) break;
		int ma = mia[i + 1];
		long long n = ans2 / mi;
		int re = ans2 % mi;
		ans2 = ma * n + re;
	}
	long long ans = max( ans1, ans2 );

	cout << ans << endl;
}


Measured memory_bytes: 3628
#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#include <cassert>
#include <fstream>
#include <iomanip>

using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;

const ll mod = 1e9 + 7;

vector<vector<P>> g;

int main() {

    
    ll n;
    cin >> n;
    
    vector<pair<P, ll>> vp(n);
    vector<pair<P, ll>> vp2(n);
    for (int i = 0; i < n; ++i)
    {
        ll x, y;
        cin >> x >> y;
        vp[i] = make_pair(P(x, y), i);
        vp2[i] = make_pair(P(y, x), i);
    }
    
    sort(vp.begin(), vp.end());
    sort(vp2.begin(), vp2.end());
    
    g = vector<vector<P>>(n, vector<P>());
    
    for (int i = 0; i < n - 1; ++i)
    {
        ll cost1 = min(abs(vp[i].first.first - vp[i + 1].first.first), abs(vp[i].first.second - vp[i + 1].first.second));
        ll cost2 = min(abs(vp2[i].first.first - vp2[i + 1].first.first), abs(vp2[i].first.second - vp2[i + 1].first.second));
        g[vp[i].second].push_back(make_pair(vp[i + 1].second, cost1));
        g[vp[i + 1].second].push_back(make_pair(vp[i].second, cost1));
        g[vp2[i].second].push_back(make_pair(vp2[i + 1].second, cost2));
        g[vp2[i + 1].second].push_back(make_pair(vp2[i].second, cost2));
    }
    
    priority_queue<P, vector<P>, greater<>> q;
    q.push(P(0, 0));
    
    ll count = 0;
    ll ret = 0;
    vector<bool> used(n);
    while (count < n)
    {
        P cur = q.top();
        q.pop();
        if (used[cur.second])
        {
            continue;
        }
        used[cur.second] = 1;
        ret += cur.first;
        for (int i = 0; i < g[cur.second].size(); ++i)
        {
            if (!used[g[cur.second][i].first])
            {
                P next = g[cur.second][i];
                swap(next.first, next.second);
                q.push(next);
            }
        }
        count++;
    }
    
    cout << ret << endl;
    
    return 0;
}

Measured memory_bytes: 18036
#include<iostream>
using namespace std;

int main() {
	int n, a[100];
	cin >> n;
	for (int i = 0; i < n; i++)
		cin >> a[i];
	for (int i = n - 1; i >= 0; i--) {
		cout << a[i];
		if (i == 0)
			cout << endl;
		else
			cout << ' ';
	}
}


Measured memory_bytes: 3068
N,M=map(int,input().split())
tree=[[]for i in range(N)]
ischecked=[0]*N
ans=0
for i in range(M):
    X,Y,Z=map(int,input().split())
    tree[X-1].append(Y-1)
    tree[Y-1].append(X-1)
for i in range(N):
    if ischecked[i]==1:
        continue
    ischecked[i]=1
    q=tree[i]
    while q:
        a=q.pop()
        if ischecked[a]==1:
            continue
        ischecked[a]=1
        q.extend(tree[a])
    ans=ans+1
print(ans)

Measured memory_bytes: 23428
#include<iostream>
using namespace std;

int main(){
    int a,b;
    cin >> a >> b;
    if(a < b){
        cout << "a < b" << endl;
    }else if(a == b){
        cout << "a == b" << endl;
    }else{
        cout << "a > b" << endl;
    }
}


Measured memory_bytes: 3136
#include <bits/stdc++.h>
#define ull unsigned long long int
#define ll long long int
#define LL_MAX 9223372036854775807
#define pb push_back
#define pf push_front
#define mp make_pair
#define popb pop_back
#define vl vector<ll>
#define bs(v, x) binary_search(v.begin(), v.end(), x)
#define popf pop_front
#define p() cout << '\n'
#define p0(x) cout << x << " "
#define p1(x) cout << x << '\n'
#define p2(x, y) cout << x << " " << y << '\n'
#define p3(x, y, z) cout << x << " " << y << " " << z << '\n'
#define printv(v)                   \
  for (ll i = 0; i < v.size(); ++i) \
    cout << v[i] << " ";            \
  cout << '\n'
#define pr1(x) cout << fixed << setprecision(15) << x << '\n'
#define mod 1000000007
#define mod1 998244353
#define fio                         \
  ios_base::sync_with_stdio(false); \
  cin.tie(NULL)
#define get(n) \
  ll n;        \
  cin >> n
#define getvec(v, n)         \
  vector<ll> v(n);           \
  for (ll i = 0; i < n; i++) \
    cin >> v[i];
#define getstr(s) \
  string s;       \
  cin >> s
#define all(x) x.begin(), x.end()
#define countBits(x) __builtin_popcount(x)
using namespace std;

void mainSolve()
{
  get(n);
  getvec(v, n);
  ll ans = 0;
  for (int i = 1; i < n; i++)
  {
    ans += (max(0ll, v[i - 1] - v[i]));
    v[i] = max(v[i], v[i - 1]);
  }
  p1(ans);
}

int main()
{
  fio;
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  //get(t);
  ll t = 1;
  while (t--)
  {
    mainSolve();
  }
  return 0;
}


Measured memory_bytes: 4784
n = gets.to_i
h = gets.split.map(&:to_i)
if n == 1
  puts "Yes"
elsif n == 2
  puts (h[1] - h[0] >= -1) ? "Yes" : "No"
else
  possible = true
  operatable = true
  for i in 1...n do
    diff = h[i] - h[i - 1]
    case diff
    when -1
      if !operatable
        possible = false
        break
      else
        operatable = false
      end
    when -1000000000..-2
      possible = false
      break
    when 1..1000000000
      operatable = true
    end
  end
  puts possible ? "Yes" : "No"
end


Measured memory_bytes: 8580
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

ll gcd(ll a, ll b){
   if (a%b == 0){
       return(b);
   }
   else{
       return(gcd(b, a%b));
   }
}

ll lcm(ll a, ll b){
   return a * b / gcd(a, b);
}

int main() {
    ll a,b;
    cin >> a >> b;
    ll ans = lcm(a,b);
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;

int main(){
/*
#ifndef ONLINE_JUDGE
	    freopen("input.txt","r",stdin);
	    freopen("output.txt","w",stdout);
#endif 
*/


int n;
cin>>n;

int rem = (n % 1000);

int change;
if(rem == 0){
	change = 0;
}
else {
	change = 1000 - rem;
}

cout<<change;




	
}

Measured memory_bytes: 3200
#include <stdio.h>
#include <stdlib.h>

int main()
{
  int a,b,c;
  scanf("%d %d %d" ,&a,&b,&c);

  if(a==b+c){
    printf("Yes\n");
  }
 else if(b==a+c){
    printf("Yes\n");
  }
 else if(c==a+b){
    printf("Yes\n");
  }
  else
    printf("No\n");


    return 0;
}


Measured memory_bytes: 128
#include "bits/stdc++.h"
#define long int64_t
using namespace std;

struct Solver {
	void solve() {
		int N;
		cin >> N;
		vector<int> A( N );
		for( int i = 0; i < N; ++i ) { cin >> A[i]; }

		long ans = 0;
		for( int i = 1; i < N; ++i ) {
			if( A[i] < A[i-1] ) {
				ans += A[i-1] - A[i];
				A[i] += A[i-1] - A[i];
			}
		}

		cout << ans << endl;
	}
};

int main() {
	ios::sync_with_stdio( false );
	cout << fixed << setprecision( 10 );
	Solver().solve();
	return 0;
}


Measured memory_bytes: 4044
#include <bits/stdc++.h>
#define REP(i,n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i,a,b) for (ll i=(a);i<(ll)b; i++)
#define ALL(obj) (obj).begin(),(obj).end()
#define INF 1000000000
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
typedef pair<ll,ll> p;
const int MOD = 1000000007;

// vector<p> cut(M);
// cut[i].second
// cut[i].first;
// REP(i,M){
//     int a,b;cin>>a>>b;
//     cut[i] = make_pair(b,a);//last first の順番
// }
// for(int i=0; i<N;i++){
// }
// sort(cut.begin(),cut.end()); //sort
// char '' str ""
int main(void)
{
    str S;cin>>S;
    int l = S.size();
    int ans=0;

    for(int i=(l/2)-1; i>=1;i--){
      str sub = S.substr(0, i);
      str s= S.substr(i, i);
      if(sub==s) ans = max(ans, 2*i);
    }

    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 764
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using ll = long long;
using namespace std;

int main(){
    int n,m;cin>>n>>m;
    vector<vector<int>>a(n),b(n);
    rep(i,m){
        int x,y;
        cin>>x>>y;
        x--;y--;
        a[x].push_back(y);
        a[y].push_back(x);
    }
    vector<bool> vb(n);
    int ans=0;
    rep(i,n){
        if(vb[i]) continue;
        vb[i]=true;
        int friendsum=1;
        stack<int> sta;
        sta.push(i);
        while(!sta.empty()){
            int top=sta.top();
            sta.pop();
            for(auto x:a[top]){
                if(vb[x]==0){
                    friendsum++;
                    sta.push(x);
                    vb[x]=true;
                }
            }
        }
        ans=max(ans,friendsum);
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 19140
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; ++i)
#define REPP(i, n) for(int i = 1; i <= n; ++i)
#define REPR(i, n) for(int i = n; i >= 0; --i)
#define FOR(i, m, n) for(int i = m; i < n; ++i)
#define ALL(v) v.begin(), v.end()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end());
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1000000007;
const ll INF = 1000000000;

map<ll, ll> primeFactor(ll N) {
    map<ll,ll> res;
    for(ll i = 2; i*i<=N; ++i) {
        while(N%i==0) {
            res[i] ++;
            N /= i;
        }
    }
    if(N != 1) res[N] = 1;
    return res;
}

int main() {
    ll n,p; cin >> n >> p;
    ll ans = 1;
    for(auto P : primeFactor(p)) {
        REP(i,P.second/n) ans *= P.first;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<map>
#include<string>

using namespace std;

int max(int a,int b)
{
	return a*(a > b) + b*(a <= b);
}

int main()
{
	int N,M,ans = 0;
	map<string,int> S;
	map<string,int> T;

	cin >> N;

	for(int i=0;i<N;i++)
	{
		string s;
		cin >> s;
		S[s]++;
	}

	cin >> M;

	for(int i=0;i<M;i++)
	{
		string t;
		cin >> t;
		T[t]++;
	}

	for(auto key : S)
	{
		int tmp = S[key.first] - T[key.first];
		ans = max(tmp,ans);
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
main()
{
    int t,a,b[100],c,d,e=0,i,j;
    cin>>t;
    for(i=1;i<=t;i++)
    {
        cin>>b[i];
        if(b[i]!=i)
            e++;

    }
    if(e==2||e==0)
        cout<<"YES"<<endl;
    else
        cout<<"NO"<<endl;
    return 0;
}


Measured memory_bytes: 256
while true do
    n = gets.to_i
    exit if n==0

    a=b=0;
    n.times do 
        t = gets.split.map{|x|x.to_i}
        if t[0] > t[1] then
            a+=t[0]+t[1]
        elsif t[1] > t[0] then
            b+=t[0]+t[1]
        else
            a+=t[0];b+=t[1];
        end
    end
    print "%d %d\n"%[a,b]
end

Measured memory_bytes: 5672
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define REP(i, b, n) for (int i = b; i < (b)+(n); i++)
using namespace std;
using ll = long long;

int main() {
	int n, k;
	cin >> n >> k;
	vector<int> a(n + 1);
	rep(i, n) cin >> a[i];
	rep(i, n - k) {
		if (a[i] < a[i + k]) cout << "Yes\n";
		else cout << "No\n";
	}
}

Measured memory_bytes: 4044
#define _USE_MATH_DEFINES

#include <iostream>
#include <iomanip>
#include <stdio.h>

#include <sstream>
#include <algorithm>
#include <iterator>
#include <cmath>
#include <complex>

#include <string>
#include <cstring>
#include <vector>
#include <bitset>

#include <queue>
#include <set>
#include <map>
#include <stack>
#include <list>

#include <ctime>
////
//#include <random>//
/////////

typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;

////定数
const int INF = (int)1e9 + 10;
const LL MOD = (LL)1e9 + 7;
const LL LINF = (LL)4e18 + 20;
const LD PI = acos(-1.0);
const double EPS = 1e-9; 
/////////
using namespace::std;
template<typename T>
void chmax(T& a, T b) {
	a = max(a, b);
}

template<typename T>
void chmin(T& a, T b) {
	a = min(a, b);
}

template<typename T>
void IN(vector<T> &A,int N=-1) {
	if (N == -1) {
		N = A.size();
	}
	for (int i = 0; i < N; ++i) {
		cin >> A[i];
	}
}

template<typename T>
void SO(vector<T> &A,bool F=false) {
	sort(A.begin(), A.end());
	if (F) {
		reverse(A.begin(), A.end());
	}
}
//////////////

void solve() {
	int A, B, C;
	cin >> A >> B >> C;
	vector<vector<vector<int>>> dp(54, vector<vector<int>>(54, vector<int>(54, INF)));
	dp[A][B][C] = 0;
	//52
	for (int i = A + B + C;i<51*3; ++i) {
		for (int a = 0; a <= min(i,51); ++a) {
			for (int b = 0; b <= min(i,51); ++b) {
				int c = i - a - b;
				if (c < 0 )break;
				if (c > 51)continue;
				//dp[a][b][c];
				if (dp[a][b][c] == INF)continue;
				chmin(dp[a + 2][b][c],dp[a][b][c]+1);
				chmin(dp[a][b + 2][c],dp[a][b][c]+1);
				chmin(dp[a][b][c + 2],dp[a][b][c]+1);
				chmin(dp[a + 1][b + 1][c],dp[a][b][c]+1);
				chmin(dp[a][b + 1][c + 1],dp[a][b][c]+1);
				chmin(dp[a + 1][b][c + 1],dp[a][b][c]+1);
			}
		}
	}
	int ans = INF;
	for (int i = 0; i < 52; ++i) {
		chmin(ans, dp[i][i][i]);
	}
	cout << ans << endl;
}

signed main(void) {
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	std::cout << std::fixed;//小数を10進数表示
	cout << setprecision(16);//小数点以下の桁数を指定//coutとcerrで別	

	solve();
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
#define _GLIBCXX_DEBUG
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for(int i = (s); i < (int)(n); i++)
#define chmin(x, y) x = min(x, y)
typedef long long ll;
const int INF = 1001001001;
const int mod = 1000000007;

void dfs(int x, int y) {}

int main() {
    string w;
    cin >> w;
    map<char, int> mp;
    rep(i, w.size()){
        if(mp.count(w[i])){
            mp[w[i]]++;
        }
        else{
            mp[w[i]] = 1;
        }
    }
    for(auto key : mp){
        if(key.second % 2 == 1){
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" <<endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

int main() {
  int A,B,C,D;
  cin >> A >> B >> C >> D;

  if ( A+B == C+D )
    cout << "Balanced" << endl;

  else if ( A+B > C+D )
    cout << "Left" << endl;
  
  else
    cout << "Right" << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm> 
using namespace std; 

int main()
{
    long long n,m,a[10005],sum=0,s;
    cin>>n>>m;
    for(int i=0;i<m;i++)
    {
    	cin>>a[i];
    	sum+=a[i];
    }
    s=n-sum;
    if(s<0)cout<<"-1";
    else cout<<s;

    
    return 0;
}

Measured memory_bytes: 3716
#include <bits/stdc++.h>
#define gi get_int()
#define INF 0x3f3f3f3f
const int MAXN = 1e5 + 10;
int get_int() {
	int x = 0, y = 1; char ch = getchar();
	while (!isdigit(ch) && ch != '-') ch = getchar();
	if (ch == '-') y = -1, ch = getchar();
	while (isdigit(ch))
		x = x * 10 + ch - '0',
		ch = getchar();
	return x * y;
}

int dp[MAXN], f[MAXN], v[MAXN], n;

class Edge {
	public:
		int next, to;
} edges[MAXN << 1];
int edgesNum, head[MAXN];
void addEdge(int from, int to) {
	edges[edgesNum] = (Edge) {head[from], to};
	head[from] = edgesNum++;
}

void getAns(int now) {
	for (int i = head[now]; i != -1; i = edges[i].next) {
		int to = edges[i].to;
		getAns(to);
	}
	dp[0] = 0;
	for (int i = head[now]; i != -1; i = edges[i].next) {
		for (int j = v[now]; j >= 0; j--) {
			int to = edges[i].to, temp = INF;
			temp = std :: min(j >= f[to] ? dp[j - f[to]] + v[to] : INF, temp);
			temp = std :: min(j >= v[to] ? dp[j - v[to]] + f[to] : INF, temp);
			dp[j] = temp;
		}
	}
	int min = INF;
	for (int i = 0; i <= v[now]; i++)
		min = std :: min(min, dp[i]);
	if (min >= INF) {
		std::cout << "IMPOSSIBLE";
		exit(0);
	}
	f[now] = min;
}

int main() {
	memset(head, -1, sizeof(head));
	memset(f, 0x3f, sizeof(f));
	
	n = gi;
	for (int i = 1; i < n; i++) 
		addEdge(gi - 1, i);
	for (int i = 0; i < n; i++)
		v[i] = gi;
	
	getAns(0);
	std::cout << "POSSIBLE";
	
	return 0;
}

Measured memory_bytes: 1024
N, M = map(int, input().split())
H = list(map(int, input().split()))
Q = []
for _ in range(M):
    Q.append(list(map(int, input().split())))

check = [True] * N
for q in Q:
    if H[q[0] - 1] < H[q[1] - 1]:
        check[q[0] - 1] = False
    elif H[q[0] - 1] > H[q[1] - 1]:
        check[q[1] - 1] = False
    else:
        check[q[0] - 1] = False
        check[q[1] - 1] = False





print(sum(check))



Measured memory_bytes: 93300
BINF = -(10**12)
N = gets.to_i
robots = []
N.times do
  s, t = gets.split.map(&:to_i)
  robots << [s + t, s - t]
end
robots.sort!
# p robots
t = BINF
count = 0
# binding.pry
robots.each do |robo|
  if t > robo[1]
    count += 1
    next
  end
  t = robo[0]
end
puts N - count

Measured memory_bytes: 10488
import math
def is_prime(n):
    t=True
    for i in range(2,int(math.sqrt(n))+1):
        if(n%i)==0:
            t=False
            break
    return t
j=int(input())
while True:
    if(is_prime(j)):
        print(j)
        exit()
    j+=1

Measured memory_bytes: 3060
#include<iostream>
using namespace std;

int main(){
while(1){
	int cost[100+2][100+2];
	int n,k,a,b,c,d,e,INF=1000000000;
	scanf("%d%d",&n,&k);
if(n==0&&k==0)break;
	for(int i=1;i<n+1;i++){
		for(int j=i;j<n+1;j++){
			if(i==j)cost[i][j]=0;
			if(i!=j)cost[i][j]=INF;
		}
	}
	for(int i=0;i<k;i++){
		scanf("%d",&a);
		if(a==0){
			scanf("%d%d",&b,&c);
			if(b>c){e=b; b=c;c=e;} 
			if(cost[b][c]!=INF)printf("%d\n",cost[b][c]);
			else printf("%d\n",-1);
		}
		if(a==1){
			scanf("%d%d%d",&b,&c,&d);
			if(b>c){e=b; b=c;c=e;} 
			if(cost[b][c]>d){
				cost[b][c]=d;
				for(int i=1;i<n+1;i++){
					for(int j=i+1;j<n+1;j++){
						if(cost[i][j]>min(cost[min(i,b)][max(i,b)]+cost[b][c]+cost[min(c,j)][max(c,j)],cost[min(i,c)][max(c,i)]+cost[b][c]+cost[min(b,j)][max(b,j)]))cost[i][j]=min(cost[min(i,b)][max(i,b)]+cost[b][c]+cost[min(c,j)][max(c,j)],cost[min(i,c)][max(c,i)]+cost[b][c]+cost[min(b,j)][max(b,j)]);
					}
				}
			}
		}
	}
}
}

Measured memory_bytes: 1212
#include<bits/stdc++.h>
using namespace std;
#define ll long long                                    // long long省略
#define pb push_back                                    // push_back省略
#define mp make_pair                                    // make_pair省略
#define fi first                                        // first省略
#define se second                                       // second省略
#define itn int                                         // int誤字保険
#define count cout                                      // cout誤字保険
#define vecotr vector                                   // vector誤字保険
#define ednl endl                                       // endl誤字保険
#define opt() cin.tie(0); ios::sync_with_stdio(false)   // 入出力速度改善

#define rep(i,l,r) for(ll i=(l);i<(r);i++)               // 範囲[l, r)で刻み1のfor文(順方向)
#define repp(i,l,r,k) for(ll i=(l);i<(r);i+=(k))         // 範囲[l, r)で刻みkのfor文(順方向)
#define rrep(i,l,r) for(ll i=(r-1);i>=(l);i--)           // 範囲[l, r)で刻み1のfor文(逆方向)
#define rrepp(i,l,r,k) for(ll i=(r-1);i>=(l);i-=(k))     // 範囲[l, r)で刻みkのfor文(逆方向)
#define all(x) (x).begin(), (x).end()                   // vectorのポインタ位置指定用
#define max(p,q)((p)>(q)?(p):(q))                       // max拡張
#define min(p,q)((p)<(q)?(p):(q))                       // min拡張
#define bit(n,m)(((n)>>(m))&1)                          // 変数nのm番目のbitを取り出す

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int dy[]={0, 1, 0, -1};                                 // 4方向近傍
int dx[]={1, 0, -1, 0};                                 // 4方向近傍

int main(){
    ll n,m;cin>>n>>m;
    ll p[m],y[m];rep(i,0,m)cin>>p[i]>>y[i], p[i]--;
    vector<ll> v[n];rep(i,0,m)v[p[i]].pb(y[i]);
    rep(i,0,n){
		sort(all(v[i]));
    	v[i].erase(unique(all(v[i])),v[i].end());
    }
    rep(i,0,m){
        ll id = lower_bound(all(v[p[i]]),y[i]) - v[p[i]].begin();
        cout << setfill('0') << right << setw(6) << p[i]+1;
      	cout << setfill('0') << right << setw(6) << id+1 << ednl;
    }
}


Measured memory_bytes: 8576
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <functional>
#include <climits>
#include <cstring>

using namespace std;

#define int long long
#define rep(i, n) for (int i=0;i<(int)n;++i)
#define rep1(i, n) for (int i=1;i<=(int)n;++i)
#define unless(a) if(!(a))
#define all(a) begin(a),end(a)
#define fst first
#define scd second
#define PB emplace_back
#define PPB pop_back

using vi=vector<int>;
using pii=pair<int, int>;

bool chmin(int&a,int b){return a>b?(a=b,true):false;}
bool chmax(int&a,int b){return a<b?(a=b,true):false;}
int read(){int a;scanf("%lld",&a);return a;}

int dy[] = {-1, 1, 0, 0};
int dx[] = {0, 0, -1, 1};

int N;

signed main()
{
	cin >> N;

	vi A(N),B(N),C(N);
	
	rep(i,N)cin>>A[i];
	rep(i,N)cin>>B[i];
	rep(i,N)cin>>C[i];

	sort(all(A));
	sort(all(B));
	sort(all(C));

	int ans = 0;

	rep(i, N) {
		int l = lower_bound(all(A), B[i]) - begin(A);
		int r = N - (upper_bound(all(C), B[i]) - begin(C));

		ans += l * r;
	}

	cout << ans << endl;
}



Measured memory_bytes: 2560
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <unordered_map>
#include <functional>
#include <utility>
#include <tuple>
#include <cctype>
#include <bitset>
#include <complex>
#include <cmath>
#include <array>
#include <numeric>
using namespace std;
#define INF 0x3f3f3f3f
#define INFLL 0x3f3f3f3f3f3f3f3fLL
//#define mod 998244353
#define MOD 1000000007
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pint;
typedef pair<ll,ll> pll;
typedef tuple<int,int,int> tint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<ull> vull;
typedef vector<pint> vpint;
int dx[8]={0,0,-1,1,1,1,-1,-1};
int dy[8]={-1,1,0,0,1,-1,1,-1};
const int SIZE=100050;
//↑templete
//↓整数をpopcount orderで生成するセット
int next_perm(int v){
	//v=0を入れると0除算が発生して停止するので注意！！
	int t=(v|(v-1))+1;
	int w=t|((((t&(-t))/(v&(-v)))>>1)-1);
	return w;
}
int element_0(int c){
	return (1<<c)-1;
}
//↑整数をpopcount orderで生成するセット
int main() {
	int N,M;
	cin>>N>>M;
	vll key[SIZE];
	for(int i=0;i<M;i++){
		int a,b;
		cin>>a>>b;
		int state=0;
		for(int j=0;j<b;j++){
			int c;
			cin>>c;
			c--;
			state|=(1LL<<c);
		}
		key[state].pb(a);
	}
	for(int i=0;i<SIZE;i++)
		sort(key[i].begin(),key[i].end());

	ll DP[SIZE]={};	//DP[state]=stateの宝箱を開けられる最小のコスト
	for(int i=0;i<SIZE;i++)
		DP[i]=INFLL;
	DP[0]=0;
	for(int bit=0;bit<N;bit++){
		int v=element_0(bit);
		while(1){
			for(int state=0;state<(1<<(N+1));state++)
				if(key[state].size())
					DP[v|state]=min(DP[v|state], DP[v]+key[state][0]);
			if(v!=0)	
				v=next_perm(v);
			if(v==0)
				break;
			if(v&(1<<N))
				break;
		}
	}

	if(DP[(1<<(N))-1]==INFLL)
		cout<<-1<<endl;
	else
		cout<<DP[(1<<(N))-1]<<endl;
	return 0;
}

Measured memory_bytes: 3456
n,m=map(int, input().split())
alist=[0]*(n+10)
for i in range(m):
  alist[int(input())]=-1
ans=True
alist[0]=1
for i in range(n):
  if alist[i]!=-1:
    if alist[i+1]!=-1 and alist[i+2]!=-1:
      alist[i+1]+=alist[i]
      alist[i+2]+=alist[i]
    elif alist[i+2]!=-1:
      alist[i+2]+=alist[i]
    elif alist[i+1]!=-1:
      alist[i+1]+=alist[i]
    else:
      ans=False
if ans:
  print(alist[n]%(10**9+7))
else:
  print(0)

Measured memory_bytes: 468580
import sys

N = int(input())
a = list(map(int, input().split()))

for i in range(0,N):
	if N-1-i*2 >= 0:
		sys.stdout.write(str(a[N-1-i*2]))
		sys.stdout.write(" ")
	elif (N % 2) == 1:
		sys.stdout.write(str(a[int((i-(N-1)/2)*2-1)]))
		sys.stdout.write(" ")
	else:
		sys.stdout.write(str(a[int((i-N/2)*2)]))
		sys.stdout.write(" ")


Measured memory_bytes: 26180
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
//3234566667 1
//3234566666 1
//3234566665 2
//3234566656 1
//3234566655 1
//3234566654 3
//3234566567
//3234566633
//2111110000
//2111101234
//2111111110
//2999999987
//2999999899
//1下げて10と隣か、
//10下げて100と隣か、

ll lank(ll a){
  ll cnt=0;
  ll tmp=a;
  ll b=tmp%10;
  tmp/=10;
  cnt++;
  ll c=tmp%10;
  while(b==0 || b-c>1 || b-c<0){
    b=c;
    tmp/=10;
    cnt++;
    if(tmp==0) break;
    c=tmp%10;
  }
  return cnt;
}

int main(){
  ll K; cin>>K;
  if(K==1) cout<<1<<endl;
  if(K==2) cout<<2<<endl;
  if(K==3) cout<<3<<endl;
  if(K==4) cout<<4<<endl;
  if(K==5) cout<<5<<endl;
  if(K==6) cout<<6<<endl;
  if(K==7) cout<<7<<endl;
  if(K==8) cout<<8<<endl;
  if(K<9) return 0;
  ll a=3234566667;
  ll n=100000-K;
  for(int i=0; i<n; i++){
    ll cnt=lank(a);
    ll tmp=cnt;
    while(tmp>1){
      a/=10;
      tmp--;
    }
    a--;
    if(a==0) a=9,cnt--;
    while(cnt>1){
      ll b=min(a%10+1,9LL);
      a*=10;
      a+=b;
      cnt--;      
    }
  }
  cout<<a<<endl;
}

Measured memory_bytes: 256
main=list(map(int,input().split()))
k=int(input())
for i in range(k):
    if(main[0]>=main[1]):
        main[1]=main[1]*2
    elif(main[1]>=main[2]):
        main[2]=main[2]*2
if(main[1]>main[0] and main[2]>main[1]): print('Yes')
else: print('No')

Measured memory_bytes: 9088
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define all(obj) (obj).begin(),(obj).end() 
#define dump(x)  cout << #x << " = " << (x) << endl;
typedef long long lint;
using namespace std;
lint powint(lint x,lint y){
	if(y==0)return 1;
	if(y%2)return x*powint(x,y-1);
	lint a = powint(x,y/2);
	return a*a;
}
int main(){
	int d,n;
	cin>>d>>n;
	if(n==100){
	cout<<101;
	}else{
	cout<<n;
	}
	rep(i,d)cout<<"00";
	cout<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;

int main() {
  string s; cin >> s;
  int n = s.size();
  int ans = 0;
  for(int i = 0; i < n/2; i++) {
    if(s[i] != s[n-1-i]) ans++;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
N, M = map(int, input().split())

import math

def divisor(M):
    divisor_list = []
    for num in range(1, math.ceil(math.sqrt(M)) + 1):
        if M % num == 0:
            divisor_list.append(num)
    return divisor_list
  
candidate = []
for num in divisor(M):
    M_k, M_sigmaB = num, M // num
    M_k2, M_sigmaB2 = M // num, num
    
    if M_sigmaB >= N:
        candidate.append(M_k)
    if M_sigmaB2 >= N:
        candidate.append(M_k2)
    
print(max(candidate))

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

void solve()
{
    int n; cin >> n;
    string ar[100] = { "AC", "WA", "TLE", "RE" };
    int a[100] = {};
    for(int i = 1; i <= n; i++)
    {
        string st; cin >> st;
        if(st.compare("AC") == 0)
        {
            a[0]++;
        }
        else if(st.compare("WA") == 0)
        {
            a[1]++;
        }
        else if(st.compare("TLE") == 0)
        {
            a[2]++;
        }
        else
        {
            a[3]++;
        }
    }
    for(int i = 0; i < 4; i++)
    {
        cout << ar[i] << " x " << a[i] << endl;
    }
}
int main()
{
    solve();
    return 0;
}


Measured memory_bytes: 3624
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
using ll = long long;

int main(){
  string s,t;
  cin >> s >> t;

  //whileでｔを検索、無ければcnt++して検索を繰り返す
  bool searchingT = true;
  int cnt = 1000;
  for (int i = 0; i < s.size() - t.size() + 1; i++)
  {
    int temp = 0;
    int k = 0;
    //ここでサイズを入れ替える回数をtempにカウント
    for (int j = i; j < i+t.size();j++){
      if(s[j]!=t[k])
        temp++;
      k++;
    }
    cnt = min(cnt, temp);
  }

  cout << cnt << endl;

  return 0;
}

Measured memory_bytes: 3616
#include <algorithm>
#include <iostream>
#include <vector>
#include <set>
using namespace std;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); }; } fast_ios_;
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define REP(i, n) FOR(i,0,n)


int main()
{
    int N;
    cin >> N;
    multiset<int> S;
    REP(_, 1 << N)
    {
        int t;
        cin >> t;
        S.insert(t);
    }
    vector<int> T{*max_element(S.begin(), S.end())};
    S.erase(prev(S.end()));

    REP(_, N)
    {
        int n = T.size();
        REP(i, n)
        {
            auto itr = S.lower_bound(T[i]);
            if (itr == S.begin())
            {
                cout << "No" << endl;
                return 0;
            }
            itr = prev(itr);
            T.push_back(*itr);
            S.erase(itr);
        }
    }
    cout << "Yes" << endl;
}


Measured memory_bytes: 14848
#include<iostream>
using namespace std;
int main(){
    int h,w,i,j;
    cin>>h>>w;
    char arr[h][w];
    for(i=0;i<h;i++){
        for(j=0;j<w;j++)
            cin>>arr[i][j];
    }
    int dp[h][w];
    for(i=h-1;i>=0;i--){
        for(j=w-1;j>=0;j--){
            if(arr[i][j]=='.'){
                if(i==h-1 && j==w-1)
                    dp[i][j] = 1;
                else if(i==h-1){
                    dp[i][j] = dp[i][j+1];
                }
                else if(j==w-1)
                    dp[i][j] = dp[i+1][j];
                else
                    dp[i][j] = (dp[i+1][j] + dp[i][j+1])%1000000007;
            }
            else
            {
                dp[i][j] = 0;
            }
        }
    }
    cout<<dp[0][0];
}

Measured memory_bytes: 5120
from collections import defaultdict
import sys
input = lambda: sys.stdin.readline().rstrip()

M = 998244353
B = pow(10, 18, M)
N = int(input())

def geometric_mod(a, r, m, n):
  x = a
  for i in range(n):
    yield x
    x = (x*r)%m

BB = list(geometric_mod(1, B, M, N+2))

def ext_euc(a, b):
  x1, y1, z1 = 1, 0, a
  x2, y2, z2 = 0, 1, b
  while z1 != 1:
    d, m = divmod(z2,z1)
    x1, x2 = x2-d*x1, x1
    y1, y2 = y2-d*y1, y1
    z1, z2 = m, z1
  return x1, y1

def inv_mod(a, b, m):
  x, y = ext_euc(a, m)
  return (x * b % m)

def mex(s):
  for i in range(N+1):
    if i not in s:
      return i

def calc_grundy(e):
  g = {}
  sum_g = defaultdict(int)
  for i in range(N, 0, -1):
    if i not in e:
      continue
    m = mex({g.get(j, 0) for j in set(e[i])})
    if m:
      g[i] = m
      sum_g[g[i]] = (sum_g[g[i]] + BB[i]) % M
  sum_g[0] = (inv_mod(B-1, pow(B, N+1, M)-B, M) - sum(sum_g.values())) % M
  return sum_g

def read_edge():
  M = int(input())
  e = defaultdict(list)
  for i in range(M):
    a, b = sorted(map(int, input().split()))
    e[a].append(b)
  return e

def solve(N, edge):
  sum_g = list(map(calc_grundy, edge))
  ret = 0
  for gx, sx in sum_g[0].items():
    for gy, sy in sum_g[1].items():
      gz = gx^gy
      sz = sum_g[2][gz]
      if sz:
        ret = (ret + sx*sy*sz) % M
  return ret


edge = [read_edge() for i in range(3)]

print(solve(N, edge))

Measured memory_bytes: 93216
#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long long ll;
typedef pair<ll, ll> PLL;
typedef vector<int> VI;
typedef vector<char> VC;
typedef vector<double> VD;
typedef vector<string> VS;
typedef vector<ll> VLL;
typedef vector<PLL> VP;
const static int INF = 1000000000;
const static int MOD = 1000000007;
const int dx[4]={1, 0, -1, 0};
const int dy[4]={0, 1, 0, -1};
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
#define rep(i,n) for (ll i=0; i<(ll)(n); i++)
#define repd(i,n) for (ll i=n-1; i>=0; i--)
#define rept(i,m,n) for(ll i=m; i<n; i++)
#define stl_rep(itr, x) for (auto itr = x.begin(); itr != x.end(); ++itr)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define PF push_front
#define PB push_back
#define SORT(V) sort((V).begin(), (V).end())
#define RVERSE(V) reverse((V).begin(), (V).end())
#define paired make_pair
#define PRINT(V) for(auto v : (V)) cout << v << " "
//charを整数に
int ctoi(char c) { if (c >= '0' && c <= '9') { return c - '0'; } return 0; }
// 累積和 for (int i = 0; i < N; ++i) s[i+1] = s[i] + a[i]; 
void cum_sum(int N,vector<double> a, vector<double> &s){ for(int i=0; i<N; i++){ s[i+1]=s[i]+a[i];}}
//ユークリッドの控除法
ll gcd(ll a,ll b){
    if(b == 0) return a;
    return gcd(b,a%b);
}
//最小公倍数
ll lcm(ll a,ll b){
    ll g = gcd(a,b);
    return a / g * b; // Be careful not to overflow
}
//素数判定
bool is_prime(long long n) {
    if (n <= 1) return false;
    for (long long p = 2; p * p <= n; ++p) {
        if (n % p == 0) return false;
    }
    return true;
}
int getdigit(ll num){
    unsigned digit=0;
    while(num!=0){
        num /= 10;
        digit++;
    }
    return digit;
}
//空白文字も入力 getline(cin, S);
//桁数指定 setprecision

int main()
{
    ios::sync_with_stdio(0); 
    cin.tie(0); 
    cout.tie(0);
    ll X;
    cin >> X;
    if(X>=30){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
}

Measured memory_bytes: 3648
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<cmath>
#include<cstdio>
#include<time.h>
#include<vector>
#include<cstring>
#include<stdlib.h>
#include<iostream>
#include<algorithm>
#define R register
#define LL long long
using namespace std;
const int N=2e5+10;
const int mod=1e9+7;
const int inf=0x3f3f3f3f;

int n,a[N];

namespace FastIO {
	template<typename tp> inline void read(tp &x) {
		x=0; register char c=getchar(); register bool f=0;
		for(;c<'0'||c>'9';f|=(c=='-'),c = getchar());
		for(;c>='0'&&c<='9';x=(x<<3)+(x<<1)+c-'0',c = getchar());
		if(f) x=-x;
	}
	template<typename tp> inline void write(tp x) {
	  if (x==0) return (void) (putchar('0'));
     if (x<0) putchar('-'),x=-x;
     int pr[20]; register int cnt=0;
     for (;x;x/=10) pr[++cnt]=x%10;
     while (cnt) putchar(pr[cnt--]+'0');
	}
	template<typename tp> inline void writeln(tp x) {
		write(x);
		putchar('\n');
	}
}
using namespace FastIO;

int main() {
	read(n);
	for (int i=1;i<=n;i++) {
		read(a[i]);
		if (a[i]>=i) return 0*puts("-1");
	}
	LL ans=0;
	a[n+1]=0;
	for (int i=n;i>=1;i--) {
		if (a[i]<a[i+1]-1) return 0*puts("-1");
		else if (a[i]>a[i+1]-1) ans+=a[i];
	}
	cout<<ans;
	return 0;
}
/*
6
0 1 2 3 0 4
*/

Measured memory_bytes: 1024