akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;

#define int long long
#define pb push_back 
#define pf push_front 
#define mp make_pair
#define fr first
#define sc second
#define Rep(i, n) for ( int i = 0 ; i < (n); i++ )
#define All(v) v.begin(), v.end()

typedef pair<int, int> Pii; typedef pair<int, Pii> Pip;
const int INF = 1107110711071107;
int dx[6] = {0, 1, 1, 0, -1, -1}, dy[6] = {1, 1, 0, -1, -1, 0};

signed main() {
  int t, n;
  while ( cin >> t >> n, t | n ) {
    int mas[200][200] = {{0}};
    int sx, sy;
    Rep(i, n) {
      int x, y;
      cin >> x >> y;
      x += 100; y += 100;
      mas[y][x] = 1;
    }
    cin >> sx >> sy;
    sx += 100; sy += 100;

    int ans = 0;
    bool used[200][200] = {{0}};
    queue<Pip> q;
    q.push(Pip(t, Pii(sy, sx)));
    while ( !q.empty() ) {
      Pip p = q.front(); q.pop();
      int nt = p.fr, y = p.sc.fr, x = p.sc.sc;

      if ( used[y][x] ) continue;
      ans++;
      used[y][x] = true;
      if ( nt == 0 ) continue;

      Rep(i, 6) {
	int ny = y + dy[i], nx = x + dx[i];
	if ( mas[ny][nx] == 1 ) continue;
	q.push(Pip(nt-1, Pii(ny, nx)));
      }
    }

    cout << ans << endl;
  }
}

Measured memory_bytes: 3424
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner stdIn = new Scanner(System.in);

		int R = stdIn.nextInt();

		if(R < 1200) {
			System.out.println("ABC");
		}
		else if(R < 2800)
		{
			System.out.println("ARC");
		}
		else
		{
			System.out.println("AGC");
		}


	}

}


Measured memory_bytes: 35740
#include <bits/stdc++.h>

#ifndef LOCAL_
#define fprintf if( false ) fprintf
#endif // LOCAL_
#define dump() fprintf(stderr, "#%s.%d\n", __func__, __LINE__);
#define dumpl(x1) fprintf(stderr, "#%s.%d (%s) = (%ld)\n", __func__, __LINE__, #x1, x1);
#define dumpll(x1, x2) fprintf(stderr, "#%s.%d (%s, %s) = (%ld, %ld)\n", __func__, __LINE__, #x1, #x2, x1, x2);
#define dumplll(x1, x2, x3) fprintf(stderr, "#%s.%d (%s, %s, %s) = (%ld, %ld, %ld)\n", __func__, __LINE__, #x1, #x2, #x3, x1, x2, x3);
#define dumpd(x1) fprintf(stderr, "#%s.%d (%s) = (%lf)\n", __func__, __LINE__, #x1, x1);
#define dumpdd(x1, x2) fprintf(stderr, "#%s.%d (%s, %s) = (%lf, %lf)\n", __func__, __LINE__, #x1, #x2, x1, x2);
#define loop for(;;)
typedef std::vector<long> LI;
typedef std::queue<long> QI;
#define rep(i,n) for(long i = 0; i < (long)n; ++i)
const double pi = M_PI;
const long mod = 1000000007;

template<typename T> void scan1(T& x) { fprintf(stderr, "unknown type\n"); }
template<> void scan1(long& x) { if( scanf("%ld", &x) < 0 ) exit(0); }
template<> void scan1(std::string& x) { if( not ( std::cin >> x ) ) exit(0); }
void scan() {}
template<typename Head, typename... Tail>
void scan(Head& x, Tail&... xs) {
  scan1(x); scan(xs...);
}

struct N001 {
   long n;
   std::vector<long> parents;
   std::vector<long> numbers;
   N001(long n_) : n(n_), parents(n+1, -1), numbers(n+1, -1) {
   }
};
long find(N001& s, long x) {
   if( s.parents[x] == -1 ) return x;
   return s.parents[x] = find(s, s.parents[x]);
}
bool same(N001& s, long x, long y) {
   return find(s, x) == find(s, y);
}
void unite(N001& s, long x, long y) {
   long x2 = find(s, x);
   long y2 = find(s, y);
   if( x2 == y2 ) return;
   if( not ( s.numbers[x2] <= s.numbers[y2] ) )
      std::swap(x2, y2);
   s.parents[x2] = y2;
   s.numbers[y2] += s.numbers[x2];
}

struct Solver {
   Solver() { fprintf(stderr, "--------Solver begin--------\n"); }
   ~Solver() { fprintf(stderr, "--------Solver end--------\n"); }
   void solve() {
      long n, k, l; scan(n, k, l);
      N001 uf1(n), uf2(n);
      for(long i = 0; i < k; ++i) {
         long a, b; scan(a, b);
         unite(uf1, a, b);
      }
      for(long i = 0; i < l; ++i) {
         long a, b; scan(a, b);
         unite(uf2, a, b);
      }
      std::map<std::pair<int, int>, int> map;
      for(long i = 1; i <= n; ++i) {
         map[std::make_pair(find(uf1, i), find(uf2, i))] += 1;
      }
      std::vector<long> rs;
      for(long i = 1; i <= n; ++i) {
         long res = map[std::make_pair(find(uf1, i), find(uf2, i))];
         rs.push_back(res);
      }
      printf("%ld", rs[0]);
      for(long i = 1; i < (long)rs.size(); ++i) {
         printf(" %ld", rs[i]);
      }
      putchar('\n');
   }
};

int main() {
   loop std::unique_ptr<Solver>(new Solver())->solve();
}



Measured memory_bytes: 20088
from math import gcd

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

# 解説AC(a*loga)
ans = 0
cnt = [0] * (max(a) + 1)
for ai in a:
    ans = gcd(ans, ai)
    cnt[ai] += 1

if ans != 1:
    print('not coprime')
elif any(sum(cnt[i::i]) > 1 for i in range(2, max(a) + 1)):
    print('setwise coprime')
else:
    print('pairwise coprime')


Measured memory_bytes: 194812
#include <iostream>

using namespace std;

int main(void) {
     long smallest = 1e10;
     long largest_diff = -1e10;
     long in;
     int n;
     cin >> n;
     for (int i = 0; i < n; i++) {
        cin >> in;
        largest_diff = max(largest_diff, in - smallest);
        smallest = min(smallest, in);
     }
     cout << largest_diff << endl;

    return 0;
}



Measured memory_bytes: 3104
#57b
n,m = map(int,input().split())
a=[list(map(int,input().split())) for _ in range(n)]
b=[list(map(int,input().split())) for _ in range(m)]

for i in range(n):
    ans=[]
    for j in range(m):
        ans.append(abs(a[i][0]-b[j][0])+abs(a[i][1]-b[j][1]))
    print(ans.index(min(ans))+1)

Measured memory_bytes: 3064
#include<stdio.h>



int main( void )
{
	int N ;

	while( 1 )
	{
		scanf( "%d" ,&N ) ;

		if( N == 0 )
		{
			return 0 ;
		}

		int begin[ 10000 + 2 ] = { 0 } ;

		int p = 0 ;

		int maxy = 0 ;

		char RBY[ 10000 + 2 ] = { 0 } ;
		char color[ 10000 + 2 ] = { 0 } ;

		color[ 0 ] = 4 ;
		
		int rby[ 10000 + 2 ] = { 0 } ;

		int i ,j ;
		for( i = 1 ; i <= N ; ++i )
		{
			scanf( "%*c%c" ,color + i ) ;
		}

		for( i = 1 ; i <= N ; ++i )
		{
			if( color[ i ] == color[ i - 1 ] || color[ i ] == color[ i + 1 ] )
			{
				if( color[ i ] != RBY[ p ] )
				{
					++p ;
				}

				++rby[ p ] ;
			}

			else
			{
				++p ;

				if( rby[ p ] == 0 )
				{
					rby[ p ] = 1 ;
				}

				begin[ p ] = i ;
			}

			RBY[ p ] = color[ i ] ;
		}

		for( i = 1 ; i <= p ; ++i )
		{
			int next ;
			int prev ;

			int kale = 0 ;

			if( rby[ i ] == 1 && i != 1 && i != p )
			{
				for( j = 1 ; ; ++j )
				{
					next = i + j ;
					prev = i - j ;

					if( prev < 1 || next > p )
					{
						break ;
					}

					if( RBY[ prev ] == RBY[ next ] && rby[ prev ] + rby[ next ] > 3 )
					{
						kale += rby[ prev ] + rby[ next ] ;					}

					else if( kale > 0 )
					{
						maxy = maxy < kale + rby[ i ] ? kale + rby[ i ] : maxy ;

						break ;
					}
				}
			}

			else if( rby[ i ] > 2 )
			{
				if( i == 1 || i == p )
				{
					maxy = maxy < rby[ i ] + 1 ? rby[ i ] + 1 : maxy ;
				}


				else
				{
					prev = i - 1 ;
					next = i + 1 ;

					for( j = 1 ; ; ++j )
					{
						if( j == 1 )
						{
							if( RBY[ prev ] == RBY[ next ] && rby[ prev ] + rby[ next ] > 3 )
							{
								kale += rby[ i ] + rby[ prev ] + rby[ next ] ;

								++next ;
								--prev ;
							}

							else
							{
								break ;
							}
						}

						else if( RBY[ prev ] == RBY[ next ] && rby[ prev ] + rby[ next ] > 3 )
						{
							kale += rby[ prev ] + rby[ next ] ;

							++next ;
							--prev ;
						}

						else
						{
							maxy = maxy < kale ? kale : maxy ;

							break ;
						}
					}
				}
			}
		}

		printf( "%d\n" ,N - maxy ) ;
	}
}

Measured memory_bytes: 1912
#include<cmath>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	int N;
	int cnt=0;
	cin>>N;
	int N1=N;
	while(N1){
		cnt++;
		N1/=10;
	}
	//cout<<cnt<<endl;
	long long ans=0;
	for(int i=1;i<cnt;i++){
		
		if(i%2==0)
			continue;
		if(i==1)
			ans+=9;
		else
			ans+=pow(10,i)-pow(10,i-1);
		
	}
	if(cnt%2==0)
		cout<<ans<<endl;
	else{
		ans+=N-pow(10,cnt-1)+1;
		cout<<ans;
	}
	
	return 0;
}

Measured memory_bytes: 256
# https://atcoder.jp/contests/arc091/tasks/arc091_b

n, k = map(int, input().split())
ans = 0
for i in range(1, n + 1):
    #divmod: 割り算の商と余りを同時に取得
    p, r = divmod(n, i)
    ans += p * max(0, i - k) + max(0, r - k + 1)
print(ans if k != 0 else ans - n)


Measured memory_bytes: 66768
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define FOR(i,a,b) for(int i=(a); i<(b); i++)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
typedef long long ll;

ll solve(ll a, ll b) {
    if(a<b) swap(a, b);
    vector<ll> res;
    for (long long p = 2; p * p <= a; ++p) {
        if (a % p != 0) continue;
        while (a % p == 0) { a /= p; }
        if(b % p == 0) res.push_back(p);
    }
    if (a != 1){
        if(b % a == 0) res.push_back(a);
    } 
    ll ans = (ll)res.size() + 1;
    return ans;
}

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


Measured memory_bytes: 256
from collections import deque

N = int(input())
edge = [[] for i in range(N)]
color = [-1] * N

for i in range(N-1):
    u, v, w = map(int, input().split())
    edge[u-1].append((v-1, w))
    edge[v-1].append((u-1, w))

q = deque([])
q.append((0,0))

while(q):
    cur, col = q.popleft()
    color[cur] = col
    for next, weight in edge[cur]:
        if color[next] != -1:
            continue

        if weight % 2:
            q.append((next, 1-col))
            color[next] = 1-col
        else:
            q.append((next, col))
            color[next] = col

print(*color, sep="\n")

Measured memory_bytes: 40716
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const ll MOD = 1000000007LL;
ll x[100000];
int main() {
	int N, K;
	cin >> N >> K;
	for (int i = 0; i < N; i++) {
		cin >> x[i];
	}
	ll ans = 1LL << 60;
	for (int i = 0; i + K <= N; i++) {
		ans = min(ans, x[i + K - 1] - x[i] + min(abs(x[i]), abs(x[i + K - 1])));
	}
	cout << ans << endl;
}


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

int main() {
    int n;
    cin >> n;
    vector<int>a(n);
    vector<vector<pair<int, bool>>>q(n,vector<pair<int,bool>>(0));
    rep(i, n){
        cin >> a[i];
        rep(j, a[i]){
            int X;
            bool Y;
            cin >> X >> Y;
            X--;
            q[i].push_back(make_pair(X, Y));
        }
    }
    
    int ans = 0;
    for (int bit = 0; bit < (1<<n); ++bit) {
        bool ok = true;
        int num = 0;
        int f = bit;  //正直者
        rep(i, n){
            if (f & (1<<i)) { //iが正直者なら
                num++;
                for (pair<int,bool> p : q[i]) {
                    if (((f & (1 << p.first)) ^ (p.second << p.first)) != 0) {
                        ok = false;
                    }
                }
            }
        }
        if (ok) {
            ans = max(ans, num);
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3552
#include<stdio.h>

int main(){
  int i=1,j,k;
  int X,Y,Z;
  
  scanf("%d %d %d",&X,&Y,&Z);
  
  while(1){
    if(X < Y*i+(i+1)*Z){
      printf("%d\n",i-1);
      return 0;
    }
    i++;
  }
  
  return 0;
}

Measured memory_bytes: 128
H = int(input()) # 初めのモンスターのヒットポイント
atCount = 0 # 攻撃回数
n = 0 # 指数

# ２の何乗に近い数字かを計算
while H > 1:
  H = int(H / 2)
  n = n + 1

print(2 ** (n + 1) - 1)

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

using i64 = long long;
using P = pair<i64, i64>;

#define overload3(_1, _2, _3, name, ...) name
#define rep1(i, n) for(i64 i = 0LL; i < (n); ++i)
#define rep2(i, a, b) for(i64 i = (a); i < (b); ++i)
#define rep(...) overload3(__VA_ARGS__, rep2, rep1)(__VA_ARGS__)
#define all(v) v.begin(), v.end()

using int64 = long long;

map< int64, int > prime_factor(int64 n)
{
  map< int64, int > ret;
  for(int64 i = 2; i * i <= n; i++){
    while(n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if(n != 1) ret[n] = 1;
  return(ret);
}

using int64 = long long;

vector< int64 > divisor(int64 n)
{
  vector< int64 > ret;
  for(int64 i = 1; i * i <= n; i++) {
    if(n % i == 0) {
      ret.push_back(i);
      if(i * i != n) ret.push_back(n / i);
    }
  }
  sort(begin(ret), end(ret));
  return(ret);
}

using int64 = long long;

int64 mod_pow(int64 x, int64 n)
{
  int64 ret = 1;
  while(n > 0) {
    if(n & 1) ret *= x;
    x *= x;
    n >>= 1;
  }
  return ret;
}

void solve(long long N){
    auto f = prime_factor(N - 1);
    i64 ans = 0;
    i64 cnt = 1;
    for(auto x : f){
        cnt *= (x.second + 1);
    }
    ans += cnt - 1;
    auto d = divisor(N);
    for(auto x : d){
        if(x == 1) continue;
        i64 b = N;
        i64 c = x;
        while(b % x == 0){
            b /= x;
        }
        if((b - 1) % x == 0) ++ans;
    }
    cout << ans << endl;
}

struct IoSetup {
    IoSetup() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(10);
        cerr << fixed << setprecision(10);
    }
} iosetup;

int main(){
    long long N;
    scanf("%lld",&N);
    solve(N);
    return 0;
}


Measured memory_bytes: 384
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author anand.oza
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        ETrBBnsformBBtion solver = new ETrBBnsformBBtion();
        solver.solve(1, in, out);
        out.close();
    }

    static class ETrBBnsformBBtion {
        static final char A = 'A';
        static final String YES = "YES";
        static final String NO = "NO";

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            char[] s = in.next().toCharArray();
            char[] t = in.next().toCharArray();

            int[] sA = new int[s.length + 1];
            for (int i = 0; i < s.length; i++) {
                sA[i + 1] = sA[i];
                if (s[i] == A) {
                    sA[i + 1]++;
                }
            }
            int[] tA = new int[t.length + 1];
            for (int i = 0; i < t.length; i++) {
                tA[i + 1] = tA[i];
                if (t[i] == A) {
                    tA[i + 1]++;
                }
            }

            int q = in.nextInt();
            for (int query = 0; query < q; query++) {
                int a = in.nextInt() - 1;
                int b = in.nextInt() - 1;
                int c = in.nextInt() - 1;
                int d = in.nextInt() - 1;

                int sScore = (sA[b + 1] - sA[a]) * 2 - (b + 1 - a);
                int tScore = (tA[d + 1] - tA[c]) * 2 - (d + 1 - c);

                if ((sScore - tScore) % 3 == 0) {
                    out.println(YES);
                } else {
                    out.println(NO);
                }
            }
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}



Measured memory_bytes: 56044
#include<bits/stdc++.h>
using namespace std;
int main(){
    int r,c;
    cin>>r>>c;
    vector<vector<int>> a(r+1,vector<int>(c+1,0));
    for(int i=0;i<r;i++){
        int sum=0;
        for(int j=0;j<c;j++){
            cin>>a[i][j];
            a[i][c]+=a[i][j];
            a[r][j]+=a[i][j];
            cout<<a[i][j]<<" ";
        }
        a[r][c]+=a[i][c];
        cout<<a[i][c]<<endl;
    } 
    for(int i=0;i<c;i++) cout<<a[r][i]<<" ";
    cout<<a[r][c]<<endl;
}


Measured memory_bytes: 3108
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>   
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
using namespace std;
#define i64  long long
#define int  long long
 
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
#define MEM_SIZE 10000
#define DEBUG_OUT true
#define ALL(x) (x).begin(),(x).end()
// int DP[MEM_SIZE][MEM_SIZE] = {0};
// int GMEM[MEM_SIZE][MEM_SIZE] = {0};
template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return;std::cout << e << std::endl;}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == false)return;for(const auto& v : vv){ DEBUG(v); } }
template<class T,class X> void DEBUG(X d, T e){if(DEBUG_OUT == false)return;std::cout <<d<<" ";DEBUG(e);};
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }

//CODE

void solve(void)
{
  int N;
  cin>>N;
  vector<vector<int> > SHOP(N,vector<int>(10,0));
  for (int i = 0; i < N; i++)
  {
    for (int j = 0; j < 10; j++)
    {
      cin>>SHOP[i][j];
    }
    
  }
  vector<vector<int> > P(N,vector<int>(11,0));
  for (int i = 0; i < N; i++)
  {
    for (int j = 0; j < 11; j++)
    {
      cin>>P[i][j];
    }
    
  }
  int ANS = -1*INF;
  for (int b = 1; b < (1<<10); b++)
  {
    int cc =0;
    for (int i = 0; i < N; i++)
    {
      int c = 0;
      for (int j = 0; j < 10; j++)
      {
        if(((b>>j)&1)&&(bool)SHOP[i][j])c++;
      }
        cc += P[i][c];      
    }
    chmax(ANS,cc);
  }
  
  cout<<ANS<<endl;
  
  return;
}


int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(9);
  solve();
  

 
  return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <vector>
#include <algorithm>
#include <functional>	
#include <utility>
#include <cinttypes>
#include <string>
#include <iostream>
#include <cmath>
#include<iomanip>
using namespace std;

int main(){
    cout<<std::fixed<<setprecision(10);
    cin.tie(0);
   	ios::sync_with_stdio(false);
    int a,b;
    cin>>a;
    cin>>b;
    if (a<=5){
        cout<<0<<"\n";
    } else if(a<=12){
        cout<<b/2<<"\n";
    } else {
        cout<<b<<"\n";
    }
}

Measured memory_bytes: 256
#include<stdio.h>
int main(){
	int n,a,b;
	scanf("%d",&a);
	if(a<105){
		printf("0\n");
	}
	else if(a>=105&&a<135){
		printf("1\n");
	}
	else if(a>=135&&a<165){
		printf("2\n");
	}
	else if(a>=165&&a<189){
		printf("3\n");
	}
	else if(a>=189&&a<195){
		printf("4\n");
	}
	else{
		printf("5\n");
	}
	return 0;
}

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

int main(){
	int R;
  	cin >> R;
  	if( R < 1200 ){
      cout << "ABC" << endl;
    }else if( 1200 <= R && R < 2800 ){
      cout << "ARC" << endl;
    }else if( 2800 <= R ){
      cout <<  "AGC" << endl;
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <vector>
#include <cstring>
#include <math.h>
#include <map>
#include <set>
#include <algorithm> // sort

#define REP(i, n) for (long long i = 0; i < (n); i++) 
typedef long long ll;
static const ll INF = 1000000000000000000LL;
using namespace std;

const int MOD = 1000000007;


int main(){
    map <int,int> m;
    for(int i = 0;i < 3; ++i)
    {
        int a;
        cin >> a;
        m[a] = 1;
    }
    int res;
    res = m.size();

    cout << res << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <cmath>
#include <iomanip>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cassert>
#include <cstring>
#include <climits>

using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) FOR(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define INF (ll)1e18
#define MOD (ll)1e9 + 7
#define pb push_back

typedef long long ll;
typedef long long int llt;
typedef pair<int, int> P;
typedef vector<int> V;
typedef map<int, int> M;

char dif = 'A' - 'a';
int mod = 1e9 + 7;
ll inf = 1e18;

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

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

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vector<ll> t(n);
    rep(i, n) cin >> t[i];
    ll x = t[0];
    for (int i = 0; i < n;i++){
        x = lcm(t[i], x);
    }
    cout << x << endl;
    return 0;
}

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

//type
#define ll long long
typedef pair<int, int> P;
//定数
#define INF 1000000000000 //10^12:∞
#define MOD 1000000007    //10^9+7:合同式の法
#define MAXR 100000       //10^5:配列の最大のrange
//略記
#define PB push_back //挿入
#define MP make_pair //pairのコンストラクタ
#define F first      //pairの一つ目の要素
#define S second     //pairの二つ目の要素
#define Z class
// OTHER
// xの二乗を返す (関数テンプレート版)
template <typename T>
T square(T x) { return x * x; }
#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))
// loop
#define rep(i, n) for (int i = 0; i < (n); i++)
#define REPD(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i <= ll(b); i++)
#define FORD(i, a, b) for (ll i = a; i >= ll(b); i--)
#define FORA(i, I) for (const auto &i : I)

// vector
#define ALL(x) x.begin(), x.end()

// output
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define isYES(x) printf("%s\n", (x) ? "YES" : "NO")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define ln cout << '\n'
template <Z A>
void pr(A a)
{
  cout << a;
  ln;
}
template <Z A, Z B>
void pr(A a, B b)
{
  cout << a << ' ';
  pr(b);
}

int ans = 0;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

int main()
{

  char c;
  cin >> c;
  if (c == 'A')
    pr('T');
  else if (c == 'T')
    pr('A');
  else if (c == 'C')
    pr('G');
  else
    pr('C');
  return 0;
}


Measured memory_bytes: 3556
N, K, Q = [int(x) for x in input().split()]
judge = [0 for _ in range(N)]

for _ in range(Q):
	judge[int(input())-1] += 1

for i in range(N):
	if K + judge[i] - Q > 0:
		print("Yes")
	else:
		print("No")

Measured memory_bytes: 4604
#include<stdio.h> 
#include<iostream> 
#include<string.h>
#include<cstring>
#include<string>
#include<math.h>
#include<algorithm>
#include<map>
#include<vector>
#include<cmath>
#include<queue>
#include<set>
#define cuttime ios::sync_with_stdio(false)
#define swap(x, y) x ^= y, y ^= x, x^= y
#define INF 0x3f3f3f3f
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
#define dep(i,a,b) for(int i=(a);i>=(b);--i)
#define scan1(x) scanf("%d",&x)
#define scan2(x,y) scanf("%d%d",&x,&y)
#define scan3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define scanll1(x) scanf("%lld",&x)
#define scanll2(x,y) scanf("%lld%lld",&x,&y)
#define scanll3(x,y,z) scanf("%lld%lld%lld",&x,&y,&z)
#define lowbit(x) (x&(-x))
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
#define debug(x) cout <<#x<<": "<<x<<endl
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
const int N=1e6+10;
const int MAX=10000007;
inline ll read() {
    char c=getchar();ll x=0,f=1;
    while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
    while(c>='0'&&c<='9'){x=x*10+c-'0',c=getchar();}
    return x*f;
}
inline void out(ll x) {   
    if(x>9) out(x/10);   
    putchar(x%10+'0'); 
}
const int mod=1e9+7;
ll p[200000],c[200000];
int main(){
    int a;
    a=read();
    cout<<a+a*a+a*a*a;
    return 0;
}

Measured memory_bytes: 3632
#include<stdio.h>
int main(void)
{
	int n,x,y,b,p,a,i,max,j,k;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		max=12001;
		scanf("%d %d %d %d",&x,&y,&b,&p);
		for(j=b;j<=6;j++){
			for(k=p;k<=6;k++){
				a=x*j+y*k;
				if(j>=5&&k>=2){
					a=a*0.8;
				}
				if(a<max){
					max=a;
				}
			}
		}
		printf("%d\n",max);
	}
	return 0;
}


Measured memory_bytes: 2072
#include <iostream>
#include <cmath>
#include <vector>
#include <bitset>
#include <algorithm>
#include <stack>
#include <queue>
#include <map>
#include <climits>
#include <set>
#include <map>
#include <iomanip>
#include <cassert>
#include <functional>
#include <cstring>

using namespace std;

typedef pair<int, int> P;
#define mp make_pair
#define FOR(i, a, b) for(int (i)=a;(i)<(b);++(i))
#define rep(i, n)  FOR(i,0,n)
#define rrep(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define vsort(v) sort((v).begin(), (v).end());					//小さい順
#define rvsort(v) sort(v.begin(), v.end(),greater<int>());		//大きい順
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl  
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define all(c) (c).begin(),(c).end()
#define ll long long
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define vs vector<string>
#define vc vector<char>
#define vvc vector<vector<char>>
#define Print(p) cout<<(p)<<endl
#define F first
#define S second
#define pb push_back
#define mod 1000000007LL
#define INF 1234567890

const int maxn = 2e5 + 10;


//initialization here
//


//
//initialization finish


// your function is here
//



//
// your function finished



int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	// your code is here
	//
	
	ll a, b, x; cin >> a >> b >> x;

	ll start = ((a + x -1) / x)*x;

	Print((b - start+x) / x);
	
	//
	// your code finished

	return 0;
}

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


#define li          long long int
#define rep(i,to)   for(li i=0;i<((li)(to));i++)
#define repp(i,start,to)    for(li i=(li)(start);i<((li)(to));i++)
#define pb          push_back
#define sz(v)       ((li)(v).size())
#define bgn(v)      ((v).begin())
#define eend(v)     ((v).end())
#define allof(v)    (v).begin(), (v).end()
#define dodp(v,n)       memset(v,(li)n,sizeof(v))
#define bit(n)      (1ll<<(li)(n))
#define mp(a,b)     make_pair(a,b)
#define rin rep(i,n)
#define EPS 1e-12
#define ETOL 1e-8
#define MOD 1000000007
typedef pair<li, li> PI;

#define INF bit(60)

#define DBGP 1


#define idp if(DBGP)
#define F first
#define S second
#define p2(a,b)     idp cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)       idp cout<<a<<"\t"<<b<<"\t"<<c<<endl
#define p4(a,b,c,d)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<endl
#define p5(a,b,c,d,e)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<endl
#define p6(a,b,c,d,e,f)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<endl
#define p7(a,b,c,d,e,f,g)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<endl
#define p8(a,b,c,d,e,f,g,h)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<endl
#define p9(a,b,c,d,e,f,g,h,i)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<endl
#define p10(a,b,c,d,e,f,g,h,i,j)        idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<"\t"<<j<<endl
#define foreach(it,v)   for(__typeof((v).begin()) it=(v).begin(); it!=(v).end(); ++it)
#define p2p(x)      idp p2((x).F, (x).S)
#define dump(x,n)   idp{rep(i,n){cout<<x[i]<<" ";}puts("");}
#define dump2(x,n)  idp{rep(i,n){cout<<"["<<x[i].F<<" , "<<x[i].S<<"] ";}puts("");}
#define dumpi(x)    idp{foreach(it, x){cout<<(*it)<<" ";}puts("");}
#define dumpi2(x)   idp{foreach(it, x){cout<<"["<<(it)->F<<" , "<<(it)->S<<"] ";}puts("");}

#define read2d(a,w,h)   rep(i,h)rep(j,w)cin>>a[i][j]
#define dump2d(a,w,h)   rep(i,h){rep(j,w)cout<<a[i][j]<<" ";puts("");}

typedef pair<li, li> PI;

li n;
li a[100100];


int main() {
    cin >> n;
    li yon = 0, ni = 0, one = 0;
    rin{
        cin >> a[i];
        if (a[i] % 4 == 0) {
            ++yon;
        } else if (a[i] % 2 == 0) {
            ++ni;
        } else{
            ++one;
        }
    }
    if (yon >= one) {
        puts("Yes");
        return 0;
    }
    if (yon == one - 1) {
        if (ni > 0)puts("No");
        else puts("Yes");
        return 0;
    }
    puts("No");

    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define rep0(i,n) for(ll (i) = 0; (i) < (n); ++(i))
#define rrep0(i,n) for(ll (i) = (n) - 1; (i) >= 0; --(i))
#define rep1(i,n) for(ll (i) = 1; (i) <= (n); ++(i))
#define rrep1(i,n) for(ll (i) = (n); (i) >= 1; --(i))
#define nfor(i,a,b) for(ll (i) = (a); (i) < (b); ++(i))
#define rfor(i,a,b) for(ll (i) = (a); (i) > (b); --(i))
#define ll long long
#define mod (1000000007)
#define pf(a) cout << (a) << endl;
#define all(x) (x).begin(),(x).end()

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;
}

ll factorial(ll n){
    ll t = 1;
    rep1(i, n)t *= i;
    return t;
}

ll combinations(ll n, ll k) {
    ll r = 1;
    for (ll d = 1; d <= k; ++d) {
        r *= n--;
        r /= d;
    }
    return r;
}

int main()
{
    double a,b,c,d,e,f,anss = 0,answ = 0,ansc = 0;
    cin >> a >> b >> c >> d >> e >> f;
    answ = a * 100;
    vector<bool> w(31,false),s(3001,false);
    for (int i = 0; i * a <= 30; ++i) {
        for (int j = 0; i * a + j * b <= 30; ++j) {
            w[i * a + b * j] = true;
        }
    }
    
    for (int i = 0; i * c <= 3000; ++i) {
        for (int j = 0; i * c + d * j <= 3000; ++j) {
            s[i * c + j * d] = true;
        }
    }
    
    rep0(i, 30){
        if(w[i]){
            for (double j = min(i * e, f - i * 100); j >= 0; --j) {
                if(s[j] && ansc < (100 * j) / (100 * i + j) && i * e >= j){
                    anss = j;
                    answ = i * 100;
                    ansc = (100 * j) / (100 * i + j);
                }
            }
        }
    }
    pf(anss + answ)
    pf(anss)
    return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;
public static class P
{
    public static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        var a = Console.ReadLine().Split().Select(x => int.Parse(x) - 1).ToArray();
        int[] res = new int[n];
        for (int i = a.Length - 1; i >= 0; i--)
        {
            res[a[i]] += 1;
        }
        Console.WriteLine(string.Join("\n", res));
    }
}

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

int main(){
  int n;
  string s;
  
  cin >> n >> s;
  
  if(n%2!=0){
      cout << "No";
      return 0;
  }
  
  for(int i=0;i<n/2;i++){
    if(s[i]!=s[n/2+i]){
      cout << "No";
      return 0;
    }
  }
  
  cout << "Yes";
  
  return 0;
}

Measured memory_bytes: 256
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10**9)
mod = 10**9+7

N = list(s())
n = int(''.join(N))
cnt = 0
for i in N:
    cnt += int(i)
print('Yes' if n%cnt == 0 else 'No')

Measured memory_bytes: 77192
#define _USE_MATH_DEFINES
#include <algorithm>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define MOD 1000000007
typedef long long int LL;
typedef pair<int,int> P;

int n;
int a[100010],b[100010];
LL ans;
int main() {
	cin >> n;
	for(int i = 0;i < n+1;i++) cin >> a[i];
	for(int i = 0;i < n;i++) cin >> b[i];
	for(int i = 0;i < n;i++) {
		for(int j = 0;j < 2;j++) {
			if(a[i+j]<=b[i]) {
				ans += a[i+j];
				b[i] -= a[i+j];
				a[i+j] = 0;
			} else {
				ans += b[i];
				a[i+j] -= b[i];
				b[i] = 0;
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define sz(a) int(a.size())
const int N=2e6+10;

int gi() {
	int x=0,o=1;char ch=getchar();
	while((ch<'0'||ch>'9')&&ch!='-') ch=getchar();
	if(ch=='-') o=-1,ch=getchar();
	while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
	return x*o;
}

struct dat {
	int t,x,y;
};

int n,m,k,s[N],t[N];

void read(int *a,int n) {
	static char s[N];
	scanf("%s",s);
	for(int i=0;i<n;i++) a[n-i-1]=s[i]-'0';
}

void print(int *a) {
	int p=N-1;
	while(!a[p]) --p;
	for(int i=p;~i;i--) putchar(a[i]+'0');
	cout<<'\n';
}

int main() {
	cin>>n>>m>>k;
	read(s,n);read(t,m);
	vector<dat> eve;
	for(int i=0;i<n||i<m||!eve.empty();i++) {
		int cur_t=1;
		vector<dat> new_eve;
		for(auto x:eve) {
			if(cur_t<x.t&&s[i]&&t[i]) {
				int new_s=s[i]+1,new_t=t[i]+1;
				s[i]=new_s&1;t[i]=new_t&1;
				new_eve.pb((dat){cur_t,new_s>>1,new_t>>1});
			}
			cur_t=x.t;int v=s[i]&t[i];
			int new_s=s[i]+v+x.x,new_t=t[i]+v+x.y;
			s[i]=new_s&1;t[i]=new_t&1;
			if(new_s>=2||new_t>=2) new_eve.pb((dat){cur_t,new_s>>1,new_t>>1});
			++cur_t;
		}
		if(cur_t<=k&&s[i]&&t[i]) {
			int new_s=s[i]+1,new_t=t[i]+1;
			s[i]=new_s&1;t[i]=new_t&1;
			new_eve.pb((dat){cur_t,new_s>>1,new_t>>1});		
		}
		swap(eve,new_eve);
		/*fl=0;
		for(int j=1;j<=k;j++) {
			//and
			int v=s[i]&t[i];
			//add
			int new_s=s[i]+v+jw[j].fi,new_t=t[i]+v+jw[j].se;
			s[i]=new_s&1;t[i]=new_t&1;
			jw[j].fi=new_s>>1;jw[j].se=new_t>>1;
			if(jw[j].fi||jw[j].se) fl=1;
			}*/
	}
	print(s);print(t);
	return 0;
}


Measured memory_bytes: 20736
#include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
#include <set>
#include <stack>
#include <map>
#include <iomanip>
#include <cmath>
#include <queue>
#include <bitset>
#include <numeric>
#include <array>
#include <cstring>
#include <random>
#include <chrono>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
typedef long long ll;
typedef long double ld;
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int main() {

  ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

  int n = 0;

  cin >> n;

  map<string, int> am;

  while(n--) {
    string s;
    cin >> s;
    am[s]++;
  }

  string ans[4] = {"AC", "WA", "TLE", "RE"};

  for(int i = 0; i < 4; i++)
    cout << ans[i] << " x " << am[ans[i]] << endl;

  return 0;
}
/*

*/


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

int main() { 
    int a, b, m, mina = 1000000, minb = 1000000, ans;
    cin >> a >> b >> m;
    int aa[a], bb[b];

    for(int i = 0; i < a; i++) {
        cin >> aa[i];
        mina = min(aa[i], mina);
    }
    for(int i = 0; i < b; i++) {
        cin >> bb[i];
        minb = min(bb[i], minb);
    }
    ans = mina + minb;
    int x, y, c;
    for(int i = 0; i < m; i++) {
        cin >> x >> y >> c;
        ans = min(ans, aa[x-1]+bb[y-1]-c);
    }

    cout << ans << '\n';

    return 0;
}


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

int main() {
    long long int m,i,n,min,max,sum =0;
    min=1000001;
    max=-1000001;
    cin >> m;
    for (i=1;i<=m;i++){
        cin >>n;
        sum=sum+n;
        if (n<min)
            min=n;
        if (n>max)
            max=n;
    }
    cout << min << ' ' << max << ' ' << sum << endl;
    return 0;
}


Measured memory_bytes: 3092
x = 0
y = 0
d = 90

loop do
    a,b=gets.split(",").map(&:to_i)
    break if a==0 and b==0
    
    rad = d/180.0*Math::PI
    x += a*Math.cos(rad)
    y += a*Math.sin(rad)
    d -= b
end

puts [x,y].map(&:to_i).join("\n")

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

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long int

using namespace __gnu_pbds;

typedef tree<pair<ll,pair<ll,ll> >, null_type, less<pair<ll,pair<ll,ll> > >, rb_tree_tag, tree_order_statistics_node_update>ordered_set;


#define me BOSS
#define bug() cout<<"AIkahne aise"<<endl
#define PI acos(-1)
#define mod 1000000007
/* Precode Start Here *\


power of 2 less than or equal to N

ll largest_power(ll N)
{
    //changing all right side bits to 1.
    N = N (N>>1);
    N = N| (N>>2);
    N = N| (N>>4);
    N = N| (N>>8);


//as now the number is 2 * x-1, where x is required answer, so adding 1 and dividing it by
 2.
            return (N+1)>>1;

}


     Sieve
void sieve()
{
    for(ll i=3; i<=2000; i+=2)
    {
        for(ll j=i*i; j<=4000000; j+=i)
            A[j]=1;
    }
    v.push_back(2);
    for(ll i=3; i<=4000000; i+=2)
        if(A[i]==0)
            v.push_back(i);
}

     Power Function Modulo P

ll modPow(ll a, ll x, ll p) {
    //calculates a^x mod p in logarithmic time.
    long res = 1;
    while(x > 0) {
        if( x % 2 != 0) {
            res = (res * a) % p;
        }
        a = (a * a) % p;
        x /= 2;
    }
    return res;
}


   factorial

ll fact(ll n)
{
    ll ans=1;
    for(ll i=1;i<=n;i++)
    {
        ans=(ans*i)%mod;
    }
    return ans;
}
     Calculating nCr using Fermats law Theorem

ll modInverse(ll a, ll p) {
    //calculates the modular multiplicative of a mod m.
    //(assuming p is prime).
    return modPow(a, p-2, p);
}


ll modBinomial(ll n, ll k, ll p) {
// calculates C(n,k) mod p (assuming p is prime).

    ll numerator = 1; // n * (n-1) * ... * (n-k+1)
    for (ll i=0; i<k; i++) {
        numerator = (numerator * (n-i) ) % p;
    }

    ll denominator = 1; // k!
    for (ll i=1; i<=k; i++) {
        denominator = (denominator * i) % p;
    }

    // numerator / denominator mod p.
    return ( numerator* modInverse(denominator,p) ) % p;
}
     num of divisor and euler totient

ll phi[1000001],mark[1000001],divi[1000001];;
void divisorPhi(ll n)
{
    for(int i=1;i<=n;i++)
        phi[i]=i;
    for(int i=2;i<=n;i++)
    {
        if(!mark[i])
        {
            for(int j=i;j<=n;j+=i)
            {
                mark[j]=1;
                phi[j]*=(1-1/(double)i);
            }
        }
    }
    for(ll i=1;i<=n;i++)
    {
        for(ll j=i;j<=n;j+=i)
            divi[j]++;
    }
}




/* Precode Ends */
ll A[5000001],B[5000001];
vector<ll>v;
map<ll,ll>myMap;
set<ll>mySet;
vector<pair<ll,ll> >vp;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);

 ll n;
 cin>>n;
 if(n%2==1)
 {
     cout<<0<<endl;
 }
 else
 {
     ll d=5,ans=0;
     while(d<=n)
     {
         ans+=(n/d)/2;
         d*=5;
     }
     cout<<ans<<endl;
 }

return 0;
}



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

int main(){
    int D, N;
    cin >> D >> N;
    
    if(N == 100){
        N++;
    }
    
    for(int i = 0; i < D; i++){
        N *= 100;
    }

    

    cout << N << endl;
}



Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>    
#include<cmath>
#include<map>
#include<vector>
#include<math.h>
#include<stdio.h>
#include<queue>
#define int long long
using namespace std;
int usi[213456];
string uiop[213456];
signed main() {
	int n, m, k, a, ans = 0; string s, t; cin >> n >> m;
	if (n >= 10) { cout << m << endl; }
	else { cout << 100 * (10 - n) + m << endl; }
}

Measured memory_bytes: 1920
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<cstring>
#include<map>
#include<vector>
#include<queue>
#include<stack>
#include<climits>
#include<set>
#include<utility>
#include<typeinfo>
#include<random>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
typedef set<int> S;
#define rep(i, n) for(int i=0; i<n; i++)
const ll MOD=1e9+7;

int main(){

  int x, y, z;
  cin >> x >> y >> z;
  cout << z <<" "<< x <<" "<< y << endl;

	return 0;
}

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

using ll = long long;

ll gcd(ll a, ll b) {
  return b == 0 ? a : gcd(b, a%b);
}

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

int main() {
  ll a, b;
  string s, t;
  cin >> a >> b >> s >> t;
  ll l = lcm(a, b);
  ll lb = l/b;
  ll la = l/a;
  lb /= gcd(lb, la);
  la /= gcd(lb, la);
  bool ok = true;
  for (int i = 0, j = 0; i < a; i+=lb, j+=la) {
    if (s[i] != t[j]) {
      ok = false;
    }
  }
  if (ok) cout << l << endl;
  else cout << -1 << endl;
  return 0;
}


Measured memory_bytes: 512
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(1000000)


# Debug output
def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))


# Binary converter
def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v


# Width First Search (+ Distance)
def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk


# Depth First Search (+Distance)
def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


def comb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def bisearch(L, target):
    low = 0
    high = len(L) - 1
    
    while low <= high:
        mid = (low + high) // 2
        guess = L[mid]
        if guess == target:
            return True
        elif guess < target:
            low = mid + 1
        elif guess > target:
            high = mid - 1
    if guess != target:
        return False

# --------------------------------------------

dp = None


def main():
    N = int(input())

    p = 1
    for i in range(1, N+1):
        p = (p * i) % (10 ** 9 + 7)

    print(p)

main()


Measured memory_bytes: 5024
//  Copyright © 2020 Diego Garcia Rodriguez del Campo. All rights reserved.
#include<bits/stdc++.h>
#define MAX 200005
#define optimiza_io cin.tie(0); ios_base::sync_with_stdio(0);
#define what_is(x) cerr << #x << " is " << x << endl;
#define pii pair < ll , ll >
#define fi first
#define se second
using namespace std;
typedef long long ll;

const ll MOD = 1e9 + 7;
ll N, c00, c01, c10;
pii a[MAX];
ll pw[MAX];
map < pii , bool > dead;
map < pii , ll > mp;

int main()
{
    optimiza_io
    cin >> N;
    pw[0] = 1;
    for( ll i = 1; i <= N; i ++ )
        pw[i] = ( pw[i - 1] * 2 ) % MOD;
    for( ll i = 1; i <= N; i ++ ) {
        cin >> a[i].fi >> a[i].se;
        if( ! a[i].fi && ! a[i].se ) {
            c00++;
            continue;
        }
        if( ! a[i].fi ) {
            c01++;
            continue;
        }
        if( ! a[i].se ) {
            c10++;
            continue;
        }
        ll g = __gcd( a[i].fi , a[i].se );
        a[i].fi /= g;
        a[i].se /= g;
        mp[a[i]]++;
    }
    sort( a + 1 , a + N + 1 );
    
    ll ans = 1;
    ll l = 1;
    while( l <= N ) {
        ll r = l;
        while( r + 1 <= N && a[l].fi == a[r + 1].fi && a[l].se == a[r + 1].se )
            r++;
        if( dead[a[l]] or ! a[l].fi or ! a[l].se ) {
            l = r + 1;
            continue;
        }
        ll tam = r - l + 1;
        dead[a[l]] = 1;
        pii nxt = a[l];
        swap( nxt.fi , nxt.se );
        nxt.fi *= -1;
        ll g = __gcd( nxt.fi , nxt.se );
        nxt.fi /= g;
        nxt.se /= g;
        ll tam2 = mp[nxt];
        dead[nxt] = 1;
        ll man = pw[tam];
        if( tam2 > 0 )
            man = ( man + pw[tam2] - 1 ) % MOD;
        ans = ( ans * man ) % MOD;
        l = r + 1;
    }
    if( c01 > 0 or c10 > 0 )
        ans = ( ans * ( pw[c01] + pw[c10] - 1 ) ) % MOD;
    ans = ( ans + c00 ) % MOD; 
    
    ans = ( ans - 1 + MOD ) % MOD;
    cout << ans << "\n";
    
    return 0;
}

// CHECAR LIMITES 

/*

9
1 2
-2 1
4 -2
2 0
3 0
0 5
0 -3 
0 10
0 0

*/

Measured memory_bytes: 58240