akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <cassert>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <unordered_map>
#include <vector>
#include <string.h>

using namespace std;

#define rep(i, n) for(int i = 0; i < n; ++i)
#define all(s) s.begin(), s.end()

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

typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> triple;

int gcd(int a, int b) {
  if (a < b) { swap(a, b); }
  if (b == 0) { return a; }
  return gcd(b, a % b);
}

bool prime(int n) {
  for (int i = 2; i <= sqrt(n); ++i) {
    if (n % i == 0) { return false; }
  }
  return n != 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; }

const ll INF = 1e9;
const ll MOD = 1000000007;  // 1e9 + 7

ll powmod(ll x, ll y) {
  ll r = 1;
  while (y) {
    if (y & 1) {
      r = r * x % MOD;
    }
    x = x * x % MOD;
    y >>= 1;
  }
  return r;
}

const int COM_MAX = 500010;
ll fac[COM_MAX], facinv[COM_MAX], inv[COM_MAX];
void COMinit() {
  fac[0] = fac[1] = 1;
  facinv[0] = facinv[1] = 1;
  inv[1] = 1;
  for(int i = 2; i < COM_MAX; ++i) {
    fac[i] = fac[i-1] * i % MOD;
    inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
    facinv[i] = facinv[i-1] * inv[i] % MOD;
  }
}

ll COM(ll n, ll k) {
  return (fac[n] * facinv[k] % MOD) * facinv[n-k] % MOD;
}

ll PERM(ll n, ll k) {
  return (fac[n] * facinv[k] % MOD);
}

void getZarr(string& str, int Z[]) {
  int n = str.length();
  int L, R, k;

  L = R = 0;
  for (int i = 1; i < n; ++i) {
    if (i > R) {
      L = R = i;
      while (R < n && str[R - L] == str[R]) {
        R++;
      }
      Z[i] = R - L;
      R--;
    } else {
      k = i - L;

      if (Z[k] < R - i + 1) {
        Z[i] = Z[k];
      } else {
        L = i;
        while (R < n && str[R - L] == str[R]) {
          R++;
        }
        Z[i] = R - L;
        R--;
      }
    }
  }
}


int main(int argc, char** argv) {
  int N;
  cin >> N;

  string S;
  cin >> S;

  int ans = 0;

  for (int i = 0; i < N-1; ++i) {  // str[i+1..N-1] + str[0..i]
    string pre = S.substr(0, i+1);
    string suf = S.substr(i+1, N-i-1);
    string s = suf + "$" + pre;

    int Z[N+1];
    getZarr(s, Z);

    rep(j, i+1) {
      ans = max(ans, Z[N-j]);
    }
  }

  cout << ans << endl;
}


Measured memory_bytes: 384
#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

int main(){
    int n,m,x,y;
    cin >> n >> m >> x >> y;
    //vector<int> xs(n), ys(n);
    int max = x, min = y;

    for(int i = 0; i < n; i++){
        int tmp;
        cin >> tmp;
        if(tmp > max) max = tmp;
    }
    for(int i = 0; i < m; i++){
        int tmp;
        cin >> tmp;
        if(tmp < min) min = tmp;
    }

    if(max < min) cout << "No War" << endl;
    else          cout << "War" << endl;
    

    

}

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

int dist(int x0, int y0, int x1, int y1)
{
    int dx = abs(x0 - x1);
    int dy = abs(y0 - y1);
    return (dx + dy);
}

int main( )
{
    int n, m;
    pair<int, int> stu[55];
    pair<int, int> chk[55];
    cin >> n >> m;
    for (int i = 1; i <= n; i++) {
        cin >> stu[i].first >> stu[i].second;
    }
    for (int i = 1; i <= m; i++) {
        cin >> chk[i].first >> chk[i].second;
    }
    for (int i = 1; i <= n; i++) {
        int d = 1e9, k;
        for (int j = 1; j <= m; j++) {
            int l = dist(stu[i].first, stu[i].second, chk[j].first, chk[j].second);
            if (l < d) {
                d = l;
                k = j;
            }
        }
        cout << k << '\n';
    }
    return 0;
}


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

typedef long long ll;
typedef pair<int,int> pii;
typedef map<int,int> mkmap;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<pii> vp;
typedef vector<vi> vv;

#define fast ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
const ll mod=1000000007;
const int sz=1000001;
#define endl "\n"
#define all(a) (a).begin(),(a).end()
#define rep(i,a,b) for(i=a;i<b;++i)
#define rrep(i,a,b) for(i=a;i>=b;--i)
#define F first
#define S second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define db(x) cout << (#x) << " = " << x << endl;

inline ll mult(ll a, ll b) {return (((a % mod) * (b % mod)) % mod);}



int main(){
    fast;
    int t,tt,tti,n,m,x,y,z,i,j,k,temp,count,o,e,f,ans,sum,l,r,mx,mn;
    ll lx,ly,lz,ltemp;
    double fx,fy,fz;
    string s;
    
    cin>>n>>m;
    vi a(n);
    z=y=0;
    while(m--){
        cin>>x>>s;
        x--;
        if(a[x]==1) continue;
        if(s=="AC"){
            y+=-1*a[x];
            a[x]=1;
            z++;
        }
        else{
            a[x]--;
        }
    }
    // for(auto p:a){
    //     y+=p.F;
    //     x+=p.S;
    // }
    cout<<z<<" "<<y;
}

/*
    
*/

Measured memory_bytes: 3668
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main( void )
{
	while ( !cin.eof() )
	{
		vector <int> A(4);
		vector <int> B(4);

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

		for ( int i = 0; i < 4; i++ )
		{
			cin >> B[i];
		}

		if ( cin.eof() )
			break;

		int blow = 0;
		for ( vector <int>::iterator it = B.begin(); it != B.end(); it++ )
		{
			if ( find( A.begin(), A.end(), *it ) != A.end() )
			{
				blow ++;
			}
		}

		vector <int>::iterator it_a = A.begin();
		vector <int>::iterator it_b = B.begin();

		int hit = 0;
		while ( it_a != A.end() )
		{
			if ( *it_a == *it_b )
				hit++;
			it_a++;
			it_b++;
		}

		blow -= hit;

		cout << hit << " " << blow << endl;

	}

	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
 
#define ll long long
#define ar array
 
const int mxN=2e5;
int n, a[mxN];
ll c[mxN], ans;
 
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
 
	cin >> n;
	for(int i=0; i<n; ++i) {
		cin >> a[i], --a[i];
		++c[a[i]];
	}
	for(int i=0; i<n; ++i)
		ans+=c[i]*(c[i]-1)/2;
	for(int i=0; i<n; ++i) {
		ans-=c[a[i]]*(c[a[i]]-1)/2;
		--c[a[i]]*(c[a[i]]-1)/2;
		ans+=c[a[i]]*(c[a[i]]-1)/2;
		cout << ans << "\n";
		ans-=c[a[i]]*(c[a[i]]-1)/2;
		++c[a[i]]*(c[a[i]]-1)/2;
		ans+=c[a[i]]*(c[a[i]]-1)/2;
	}
}

Measured memory_bytes: 5972
import java.util.*;
public class Main {

  public static void main(String[] args) { 
      Scanner sc = new Scanner(System.in);
      long a = sc.nextLong();
      long b = sc.nextLong();
      long res = 0;
      if(a % 2 == 0) {
        if(b % 2 == 0)
            res = (b - a) / 2 % 2 ^ b;
        else
            res = (b - a + 1) / 2 % 2;
      } else {
         if(b % 2 == 0)
            res = (b - a) / 2 % 2 ^ a ^ b;
         else
            res = (b - a) / 2 % 2 ^ a;
      }
      System.out.println(res);
  }
}

Measured memory_bytes: 22740
# import math
# from collections import Counter

# N = int(input()) # 1行, 単数
# arg = list(map(int, input().split())) # 1行, 配列
# D = Counter(arg) # 出現数カウント

# print('Yes')
# print('No')
# print()
N,K = list(map(int, input().split())) # 1行, 配列
p = list(map(int, input().split())) # 1行, 配列

p.sort()
cnt =0

for i in range(0,K):
  cnt = cnt + p[i]

print(cnt)

Measured memory_bytes: 62256
#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main(){
  string s,t;
  cin >> s >> t;
  sort(s.begin(),s.end());
  sort(t.begin(),t.end());
  reverse(t.begin(),t.end());
  if(s<t){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int x = in.nextInt();
		int[] l = new int[n];
		for(int i=0;i<n;i++) {
			l[i] = in.nextInt();
		}
		int count = 0;
		while(x>=0 && count<n) {
			x -= l[count];
			count++;
		}
		System.out.println(x<0?count:n+1);
		in.close();
	}

}


Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<ll> vll;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define Sort(a) sort(a.begin(), a.end())
#define fin(ans) cout << (ans) << endl
const int INF = 1<<30;
const ll MOD = 1000000007;

int main() {
  string s;
  int a=1;
  cin >> s;
  //cin >> s >> t >> u;
  if(s.length()%2!=0) a=0;
  for (int i = 0; i < s.length(); i++)
  {
    if(i%2==0){
      if(s[i]!='h'){
        a=0;
        break;
      }
    }
    else{
      if(s[i]!='i'){
        a=0;
        break;
      }
    }
  }
  
  if(a==1) cout <<  "Yes" << endl; 
  else cout <<  "No" << endl; 
  
}

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

int main()
{
    int t,c=0, b, ans=123456789;
    cin >> t;
    int arr[t+1];
    for(int i=0; i<t; i++)
    {
        cin >> b;
        if(b%2 == 1)return cout<<"0"<<endl, 0;
        while(b%2 == 0)c++, b/=2;
        ans=min(c, ans);
        c=0;
    }

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


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll                      long long int
#define pb                      push_back
#define mp                      make_pair
#define in                      insert
#define all(x)                  (x).begin(),(x).end() 
#define rep(i,a,n)              for(int i=0;i<n;++i)
#define per(i,a,n)              for(int i=n-1;i>=0;--i)
#define mod                     1000000007
#define pie						3.14159265358979323846
using namespace std;

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

    float r;
    cin>>r;
    cout<<fixed<<setprecision(20)<<(2*pie*r)<<'\n';
    
    return 0;
}


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

typedef long long ll;
const int maxn=1e6+7;
const int inf=INT_MAX;
const ll inff=1e18;
const ll mod=1e9+7;
#define pii pair<int,int>
#define mkp make_pair
#define F first
#define S second
#define pb push_back
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(),(v).end()
//#define int ll

#ifdef HNO2
#define IOS
#else
#define endl '\n'
#define IOS ios::sync_with_stdio(0); cin.tie(0);
#endif // HNO2

int n;
long double a[57];

int32_t main()
{
    IOS
    cin>>n;
    for (int i=1;i<=n;i++) cin>>a[i];
    sort(a+1,a+n+1);
    for (int i=2;i<=n;i++) a[i]=(a[i]+a[i-1])/2.0;
    cout<<fixed<<setprecision(15)<<a[n]<<endl;
}



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

using namespace std;

long int getSumOfDigit(long int num)
{
    if(num == 0)
        return 0;

    return num%10 + getSumOfDigit(num/10);
}

int main()
{
    long int num;
    scanf("%ld",&num);
    long int result=getSumOfDigit(num);
    //printf("%ld\n",result);
    if(num%result == 0)
        printf("Yes\n");
    else
        printf("No\n");
}






Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
int asc(const void *a, const void *b) {
  return *(int *)a - *(int *)b;
}

int main(){

int A[200000],N,i=0,i2=0,t;


/*数を入力*/
scanf("%d", &N);
for(i=0;i<N;i++)scanf("%d",A+i);

qsort(A, N, sizeof(int), asc);
for (i=0;i<N-1;i++){
	/* code */
	if(A[i]==A[i+1]){
			printf("NO\n"); return 0;
		}
}
/*配列数を比較し、同じならYes 違うならNo*/
	printf("YES\n");
	return 0;
}

Measured memory_bytes: 1788
N, M = map(int, input().split())
A = [0 for i in range(N + 2)]
A[0] = 0
A[1] = 1
for i in range(M):
    a = int(input()) + 1
    A[a] = -1
for i in range(2, N+2):
    if A[i] ==  -1:
        A[i] = 0
    else:
        A[i] = A[i-1]+ A[i-2]
        A[i] = A[i] % 1000000007
    #print(A)
print(A[N + 1])





Measured memory_bytes: 7064
N = gets.to_i
ary = gets.split.map(&:to_i)
# 奇数番をマイナスにするケース
cnt1 = 0
sum = 0
ary.each_with_index do |n, i|
    diff = 0
    sum += n
    if i.odd?
        if sum >= 0
            diff = -sum - 1
        end
    else
        if sum <= 0
            diff = -sum + 1
        end
    end
    cnt1 += diff.abs
    sum += diff
end
# 偶数番をマイナスにするケース
cnt2 = 0
sum = 0
ary.each_with_index do |n, i|
    diff = 0
    sum += n
    if i.even?
        if sum >= 0
            diff = -sum - 1
        end
    else
        if sum <= 0
            diff = -sum + 1
        end
    end
    cnt2 += diff.abs
    sum += diff
end
# プラスとマイナスで操作数の小さいほうを採用
puts [cnt1, cnt2].min

Measured memory_bytes: 8588
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <map>

using namespace std;

int main(void)
{
    int n;
    cin >>n;

    vector<int> vt;
    for(int i = 0; i < n; i++){
        int tmp;
        cin >>tmp;
        vt.push_back(tmp);
    }

    int ans = 0;

    for(int i = 1; i < n-1; i++){
        if((vt[i-1] < vt[i] && vt[i] < vt[i+1])||
            (vt[i-1] > vt[i] && vt[i] > vt[i+1])){
            ans++;
        }
    }

    printf("%d\n", ans);

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
  int N, D;
  cin >> N >> D;
  double X[200000];
  double Y[200000];
  int cnt = 0;
  for (int i = 0; i < N; i++)
  {
    cin >> X[i] >> Y[i];
    if (sqrt(X[i] * X[i] + Y[i] * Y[i]) <= D)
    {
      cnt++;
    }
  }
  cout << cnt << endl;
}


Measured memory_bytes: 6964
#include <bits/stdc++.h>
 
#pragma GCC optimize("O2")
using namespace std;
#define ll long long
#define ull unsigned long long
#define rep(i,n,N) for(ll i=n;i<=N;++i)
#define rap(i,n,N) for(ll i=n;i>=N;--i)
#define pb push_back
#define pob pop_back
#define pf push_front
#define pof pop_front
#define fi first
#define se second
#define ff fi.fi
#define fs fi.se
#define sf se.fi
#define ss se.se
#define lc (id<<1)
#define rc ((id<<1)|1)
#define db(x) cout << ">>>>>> " << #x << " -> " << x << endl;
#define all(x) x.begin(),x.end()
#define pii pair<int,int> 
#define pll pair<ll,ll>
#define piii pair<int,pii>
#define plll pair<ll,pii>
#define piiii pair<pii,pii>
#define psi pair<string,int>
//#define endl "\n"
const int MAX = 1e3+5;
const ll MAX2 = 11;
const ll MOD = 1000000007;
const ll INF = 1e18;
const int dr[]={1,0,-1,0,1,1,-1,-1,0};
const int dc[]={0,1,0,-1,1,-1,1,-1,0};
const double pi = acos(-1);
const double EPS = 1e-9;
const int block = 450;

int n,x,z;

int main(){
//	cout<<fixed<<setprecision(15);
//    freopen("output.txt", "r", stdin);
//	freopen("output.txt","w",stdout);
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    cin>>n;
    if(n==1)return cout<<"YES\n",0;
    while(n--){
    	cin>>x;;
    	if(x&1)z++;
	};
	if(z&1)cout<<"NO\n";
	else cout<<"YES\n";
	return 0;
}

Measured memory_bytes: 256
/* Author : tushar3105 */

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;

typedef pair<long long int,long long int> ii;					// Pair of integers
typedef vector<long long int> vi;                   				// Vector of integers
typedef vector<vector<long long int>> vvi;                 			// Vector of vi
typedef vector<pair<long long int, long long int>> vii;				// Vector of ii

#define pb push_back								// Push back to vectors
#define mp make_pair								// For pairs
#define ff first								// For pairs
#define ss second								// For pairs
#define all(c) (c).begin(),(c).end()						// Use in sorting
#define sz(a) ((long long int)(a).size())
#define lli long long int
#define ull unsigned long long int
#define ld long double
#define ref(i,x,y) for(long long int i=(x);i<=(y);++i)				// Loop to go forward
#define reb(i,x,y) for(long long int i=(x);i>=(y);--i)				// Loop to go backward
#define trf(c,it) for(auto it = (c).begin(); it != (c).end(); it++)		// Remember it is an iterator
#define trb(c,it) for(auto it = (c).end()-1; it != (c).begin()-1; it--)		// Remember it is an iterator
#define tc(t) long long int (t); cin>>(t);while((t)--)				// Test cases
//fill (dist,dist+110000,pinf);							// For setting default

const long long int mod = 1e9+7;
const long long int pinf = 9223372036854775807;
const long long int ninf = -9223372036854775807;

/*-----------------------------Code begins----------------------------------*/

int main (void)
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	
	lli cnt=0,a,b,c,k;
	
	cin>>a>>b>>c>>k;
	
	while (a>=b)
	{
		b=b*2;
		cnt++;
	}
	
	while (b>=c)
	{
		c=c*2;
		cnt++;
	}
	
	if (cnt>k)
		cout<<"No\n";
		
	else
		cout<<"Yes\n";

	return 0;
}


Measured memory_bytes: 3648
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
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; }
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void _main()
{
    string N;
    cin >> N;
    rep(i, 0, N.size() / 2)
    {
        if (N[i] != N[N.size() - 1 - i])
        {
            cout << "No" << endl;
            return;
        }
    }
    cout << "Yes" << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <utility>
#include <algorithm>
#include <cstdio>
#include <iomanip>
#include <queue>
#include <deque>
#include <stack>
#include <fstream>
#include <cmath>
#include <random>

#define ll int64_t
#define Rep(i, n) for (ll i = 0; i < n; i++)
using namespace std;
typedef vector<ll> vec;
typedef vector<vec> mat;

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

    string S;
    cin >> S;
    ll n = S.size();

    ll ans = 0;
    for (ll i = 0; i < n/2; i++) {
        if (S[i] != S[n-1-i]) ans++;
    }

    cout << ans << "\n";
}

Measured memory_bytes: 256
//AnkitCode99 (DP)....
//every ups and downs matter!

#include<bits/stdc++.h>

#define fast ios_base::sync_with_stdio(0);cin.tie(nullptr);cout.tie(nullptr)
typedef long long int ll;

using namespace std;

const ll sz=1e5+5;
const ll MOD=1e9+7;

ll n,m,cache[1005][1005];
char ch[1005][1005];

ll dp(ll r,ll c)
{
    if(r<1 or c<1)
        return 0;

    if(ch[r][c]=='#')
        return 0;

    if(r==1 and c==1)
        return 1;

    ll &ans=cache[r][c];
    if(ans!=-1)
        return ans;

    ans=dp(r-1,c)+dp(r,c-1);
    ans%=MOD;
    return ans;
}

int main()
{
    fast;
    

    memset(cache,-1,sizeof cache);
    cin>>n>>m;
    for (int i = 1;i<=n; ++i)
    {
        for (int j= 1; j <= m; ++j)
        {
            cin>>ch[i][j];
        }
    }

    cout<<dp(n,m)<<endl;

    
}//Goodbye...

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

int main(){
int x,y,z, a,b,c;
cin>>x>>y>>z;
a=x;
b=y;
c=z;

a=b;
b=x;

int tmp = a;
a=c;
c=tmp;

cout<<a<<" "<<b<<" "<<c<<endl;
}

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

int main()
{

        int a;
        int b;

        cin >> a >> b;
        int c;
        int n;
        if (a < b) {
                c = a;
                n = b;
        }
        else {
                c = b;
                n = a;
        }
        for (int i = 0; i < n; ++i) {
                cout << c;
        }
        cout << endl;



}


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

int N,K,a[100];
LL dp[101][100001] = {};
LL wa[101][100002] = {};
const LL MOD = 1000000007;

int main(){
	cin >> N >> K;
	for(int i=0; i<N; i++) cin >> a[i];

	dp[0][0] = 1;
	for(int i=0; i<=K; i++) wa[0][i+1] = 1;
	for(int i=1; i<=N; i++){
		for(int j=0; j<=K; j++){
			dp[i][j] = wa[i-1][j+1] - wa[i-1][max(0,j-a[i-1])] + MOD;
			dp[i][j] %= MOD;
			wa[i][j+1] = wa[i][j] + dp[i][j];
			wa[i][j+1] %= MOD;
		}
	}
	cout << dp[N][K] << endl;

	return 0;
}

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

bool x[200010] = {false}, y[200010] = {false};

int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    if (a == 1) {
      x[b] = true;
    }
    if (b == n) {
      y[a] = true;
    }
  }
  bool flag = false;
  for (int i = 1; i <= 200000; i++) {
    if (x[i] && y[i]) {
      flag = true;
    }
  }
  if (flag) {
    cout << "POSSIBLE" << endl;
  }
  else {
    cout << "IMPOSSIBLE" << endl;
  }
  return 0;
}

Measured memory_bytes: 640
#include <iostream>
#include <vector>
#include <utility>
#include <algorithm>
#include <queue>
typedef long long ll;
using namespace std;

vector<vector<pair<int, bool>>> vec;
int color[100000];

int main() {
    int n, u, v;
    ll w;
    cin >> n;
    vec.resize(n);
    for(int i=0; i<n-1; i++) {
        cin >> u >> v >> w;
        vec[u-1].push_back(make_pair(v-1, w%2==1));
        vec[v-1].push_back(make_pair(u-1, w%2==1));
    }

    for(int i=0; i<n; i++) color[i] = -1;
    color[0] = 0;

    queue<int> q;
    q.push(0);
    while(!q.empty()) {
        int now = q.front();
        q.pop();
        for(int i=0; i<vec[now].size(); i++) {
            int next = vec[now][i].first;
            bool len = vec[now][i].second;
            if(color[next]!=-1) continue;
            else {
                if(len) color[next] = abs(color[now]-1);
                else color[next] = color[now];
                q.push(next);
            }
        }
    }

    for(int i=0; i<n; i++) cout << color[i] << endl;

    return 0;
}


Measured memory_bytes: 6784
#include <algorithm>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <vector>

#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)

using namespace std;
typedef long long int ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int, int> PI;
const ll mod = 1e9 + 7;



int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  cout <<(s.substr(0,4) == "YAKI" ? "Yes" : "No") << "\n";
}


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

using ll = long long;
using namespace std;
const int INFint = 1e9+1;
const ll INFll = (ll)1e18+1;
ll MOD=1e9+7;
ll gcd(ll a, ll b) { return __gcd(a,b); } //最大公約数
ll lcm(ll a, ll b) { return a/gcd(a,b)*b; } //最小公倍数
int main(){
  int X;
  cin>>X;
  cout << lcm(X,360)/X << endl;
  return 0;
}


Measured memory_bytes: 3624
import java.util.*;
class Main {
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int m = scan.nextInt();
        int[] h = new int[n];
        boolean[] judge = new boolean[n];
        int ans = 0;
        for (int i = 0 ; i <n ; i++){
            h[i]= scan.nextInt();
        }
        for (int i = 0 ; i <m ; i++){
            int a = scan.nextInt()-1;
            int b = scan.nextInt()-1;
            if (h[a]<=h[b]){
                judge[a] = true;
            }
            if (h[a]>=h[b]){
                judge[b] = true;
            }
        }
        for (int i = 0; i<judge.length ; i++){
            if (!judge[i]){
                ans ++;
            }
        }
        System.out.println(ans);
            }
        }

Measured memory_bytes: 59264
//yukicoder@cpp14
//author:luckYrat(twitter:@luckYrat_)
//<ここに一言>

//せんげん！
#include <iostream>

#include <cmath>
#include <algorithm>
#include <iomanip>

#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <bitset>

#include <cctype>
#include <utility>
#include <climits>


//なまえくーかん！
using namespace std;
using ll = long long;
using P = pair<ll,ll>;

//てーすう！
const int mod = 1000000007;
const int inf = (1<<30)-1;
const ll linf = (1LL<<62LL)-1;
const double EPS = (1e-10);

//でふぁいん！
#define anyfill(n,s) setw(n) << setfill(s)
#define loop(s) for(int i = 0; s > i; i++)
#define rep(i,q) for(int i = 0; (q) > i; i++)
#define repp(i,n,q) for(int i = n; (q) > i; i++)
#define dep(i,q) for(int i = (q); 0 < i; i--)

//みじかく！
#define pb push_back
#define fir first
#define scn second
#define ednl endl

//いぇすのー！
#define YesNo(a) (a?"Yes":"No")
#define YESNO(a) (a?"YES":"NO")
#define yesno(a) (a?"yes":"no")

//きんぼーnほーこー！！
P ar4[4] = {{0,1},{0,-1},{1,0},{-1,0}};
P ar8[8] = {{-1,-1},{-1,0},{-1,1},{0,-1},{0,1},{1,-1},{1,0},{1,1}};
/*
確認ポイント
cout << fixed << setprecision(n) << 小数計算//n桁の小数表記になる

計算量は変わらないが楽できるシリーズ
min(max)_element(iter,iter)で一番小さい(大きい)値のポインタが帰ってくる
count(iter,iter,int)でintがiterからiterの間にいくつあったかを取得できる
*/
template <typename T>
T gcd(T a,T b){
  if(a%b==0)return b;
  else return gcd(b,a%b);
}
template <typename T>
T lcm(T a,T b){
  return a/gcd(a,b)*b;
}
int dp[200][200];
struct z{
	int a,b,c;
};
__attribute__((constructor))
void initial() {
 cin.tie(0);
 ios::sync_with_stdio(false);
}
int main(){
	int a,b;cin>>a>>b;
	cout << abs(a-b) << endl;
	
}


Measured memory_bytes: 3160
#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

int main(){
	int N, P=0;
	cin>>N;
	vector<int> V(N);
	for(int i=0;i<N;i++){
		cin>>V[i];
		P+=V[i];
	}
	double ans1=0, p1, ans2=0, p2;
	p1 = ceil(double(P)/double(N));
	p2 = floor(double(P)/double(N));
	for(int i=0;i<N;i++){
		ans1+=(p1-V[i])*(p1-V[i]);
		ans2+=(p2-V[i])*(p2-V[i]);
	}
	cout<<min(ans1, ans2)<<endl;
	return 0;
}


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

int ri() {
	int n;
	scanf("%d", &n);
	return n;
}
std::random_device rnd_dev;
std::mt19937 rnd(rnd_dev() ^ time(NULL));

std::vector<int> init(int n, const std::vector<int> &c, const std::vector<std::vector<int> > &val) {
	(void) val;
	double par[26];
	for (int i = 0; i < 26; i++) par[i] = std::sqrt(c[i]);
	double sum = std::accumulate(par, par + 26, 0.0);
	int times[26];
	double acc = 0;
	for (int i = 0; i < 26; i++) {
		acc += par[i];
		times[i] = (acc + 0.00001) / sum * n;
	}
	for (int i = 25; i--; ) times[i + 1] -= times[i];
	// for (auto &i : times) i--;
	//for (auto i : times) std::cerr << i << std::endl;
	std::vector<int> res;
	for (int i = 0; i < 26; i++) for (int j = 0; j < times[i]; j++) res.push_back(i);
	std::shuffle(res.begin(), res.end(), rnd);
	assert(res.size() == n);
	return res;
}


std::vector<int> solve(int n, const std::vector<int> &c, const std::vector<std::vector<int> > &val) {
	auto score = [&] (const std::vector<int> &all) {
		int last[26];
		for (auto &i : last) i = -1;
		int res = 0;
		for (int i = 0; i < n; i++) {
			int cur = all[i];
			last[cur] = i;
			for (int j = 0; j < 26; j++) res -= c[j] * (i - last[j]);
			res += val[i][cur];
		}
		return res;
	};
	clock_t start = clock();
	
	auto r26 = init(n, c, val);
	
	std::vector<int> cur = r26;
	int cur_score = score(cur);
	int best_score = -1000000000;
	std::vector<int> best;
	
	while (1) {
		clock_t cur_time = clock();
		if (cur_time - start > 1.95 * CLOCKS_PER_SEC) break;
		int r0 = std::uniform_int_distribution<>(0, n - 1)(rnd);
		int r1 = std::uniform_int_distribution<>(0, n - 1)(rnd);
		std::swap(cur[r0], cur[r1]);
		// double threshold = 1.95 - (double) (cur_time - start) / CLOCKS_PER_SEC;
		// std::cerr << threshold << std::endl;
		int new_score = score(cur);
		if (new_score > best_score * 0.9999) cur_score = new_score;
		else std::swap(cur[r0], cur[r1]);
		if (best_score < cur_score) best_score = cur_score, best = cur;
	}
	
	return best;
}

void input() {
	int n = ri();
	std::vector<int> c(26);
	for (auto &i : c) i = ri();
	std::vector<std::vector<int> > val(n, std::vector<int>(26));
	for (auto &i : val) for (auto &j : i) j = ri();
	for (auto i : solve(n, c, val)) printf("%d\n", i + 1);
}

void random_test() {
	int n = 365;
	std::vector<int> c(26);
	for (auto &i : c) i = std::uniform_int_distribution<>(0, 100)(rnd);
	std::vector<std::vector<int> > val(n, std::vector<int>(26));
	for (auto &i : val) for (auto &j : i) j = std::uniform_int_distribution<>(0, 20000)(rnd);
	
	auto res = solve(n, c, val);
	
	
	int last[26];
	for (auto &i : last) i = -1;
	int score = 0;
	for (int i = 0; i < n; i++) {
		last[res[i]] = i;
		for (int j = 0; j < 26; j++) score -= c[j] * (i - last[j]);
		score += val[i][res[i]];
	}
	printf("%d\n", score);
}

int main() {
#	ifdef LOCAL
	random_test();
#	else
	input();
#	endif
	return 0;
}



Measured memory_bytes: 3908
#include<bits/stdc++.h>
constexpr long long INFL = 1LL << 60;
constexpr int INF = 1e9;

using namespace std;

using ll = long long;
using P = pair<int, int>;

int main()
{
    int N;
    cin >> N;
    P sit[100000];
    for(int i = 0; i < N; ++i) cin >> sit[i].first >> sit[i].second;
    int ans = 0;
    for(int i = 0; i < N; ++i){
        ans += sit[i].second - sit[i].first + 1;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1024
import java.util.*;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		/*
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		
		int[] bambooLengths = new int[N];
		for (int i = 0; i < N; i++) {
			bambooLengths[i] = sc.nextInt();
		}
		*/
		int A = sc.nextInt();
		int B = sc.nextInt();
		int Q = sc.nextInt();
		long[] AMarks = new long[A];
		long[] BMarks = new long[B];
		long[] QMarks = new long[Q];
		for (int i = 0; i < A; i++) {
			AMarks[i] = sc.nextLong();
		}
		for (int i = 0; i < B; i++) {
			BMarks[i] = sc.nextLong();
		}
		for (int i = 0; i < Q; i++) {
			QMarks[i] = sc.nextLong();
		}
		
		long Alo = AMarks[0];
		long Ahi = AMarks[A-1];
		long Blo = BMarks[0];
		long Bhi = BMarks[B-1];
		for (int i = 0; i < Q; i++) {
			long query = QMarks[i];
			int[] closestA = getClosestIndex(AMarks, query, 0, A-1);
			int[] closestB = getClosestIndex(BMarks, query, 0, B-1);
			//System.out.println("Closest A: " + closestA[0] + ", " + closestA[1]);
			//System.out.println("Closest B: " + closestB[0] + ", " + closestB[1]);
			long min = 0;
			for (int k = 0; k < 2; k++) {
				for (int l = 0; l < 2; l++) {
					long distance = Math.abs(AMarks[closestA[k]]-query)+Math.abs(BMarks[closestB[l]]-AMarks[closestA[k]]);
					if (distance < min || min == 0) {
						min = distance;
					}
				}
			}
			for (int k = 0; k < 2; k++) {
				for (int l = 0; l < 2; l++) {
					long distance = Math.abs(BMarks[closestB[k]]-query)+Math.abs(AMarks[closestA[l]]-BMarks[closestB[k]]);
					if (distance < min) {
						min = distance;
					}
				}
			}
			System.out.println(min);
		}
    }
	
	public static int[] getClosestIndex(long[] marks, long query, int low, int high) {
		if (query > marks[high]) {
			if (high == marks.length-1) {
				return new int[]{high, high};
			}
			return new int[]{high, high+1};
		} else if (query < marks[low]) {
			if (low == 0) {
				return new int[]{low, low};
			}
			return new int[]{low-1, low};
		}
		int mid = (high+low)/2;
		if (query > marks[mid]) {
			return getClosestIndex(marks, query, mid+1, high);
		} else {
			return getClosestIndex(marks, query, low, mid-1);
		}
	}
  
}


Measured memory_bytes: 105760
#include<bits/stdc++.h>
using namespace std;
double ans=0;
inline int read(){
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=(x<<3)+(x<<1)+ch-'0';ch=getchar();}
	return x*f;
}
int main(){
	int n=read();
	for(int i=1;i<=n;i++){
		double x=read();
		ans+=1.0/x;
	}
	ans=1/ans; 
	printf("%.6lf\n",ans);
	return 0;
} 

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <cstdint>
#include <map>
#define MOD 1000000007
using namespace std;
typedef long long ll;

int main(){

int n;
cin >> n;

char c;

for(int i = 0; i<n; i++){
cin >> c;
if(c == 'Y') {
 cout << "Four" << endl; return 0;
 }
}

cout << "Three" << endl;

return 0;
}

Measured memory_bytes: 256
import java.util.*;
import java.lang.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long m = sc.nextLong();
		if (n == 1 && m == 1) {
			System.out.println(1);
		} else if (n == 1) {
			System.out.println(m - 2);
		} else if (m == 1) {
			System.out.println(n - 2);
		} else {
			System.out.println((n - 2) * (m - 2));
		}
	}
}

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

using namespace std;

int main(){
	int n = 3;
	
	vector<vector<int>> a(3,vector<int>(3));


	for(int i = 0; i < n; i++)
		for(int j = 0; j < n; j++)
			cin >> a[i][j];
	
	int x;
	
	cin >> x;
	
	for(int t = 0; t < x; t++){
		int y;
		
		cin >> y;
		for(int i = 0; i < n; i++)
			for(int j = 0; j < n; j++){
				if (a[i][j] == y){
					a[i][j] = -1;
				}
			}
	}
	
	bool ok = true;
	for(int i = 0; i < 3; i++){
		if (a[i][i] != -1){
			ok = false;
		}
	}
	if (ok){
		cout << "Yes" << endl;
		return 0;
	}
	
	ok = true;
	for(int i = 0; i < 3; i++){
		if (a[i][3 - i - 1] != -1){
			ok = false;
		}
	}
	
	if (ok){
		cout << "Yes" << endl;
		return 0;
	}
	
	
	for(int i = 0; i < n; i++){
		int t = 0;
		for(int j = 0; j < n; j++){
			if (a[i][j] == -1){
				t++;
			}				
		}
		if (t == 3){
			cout << "Yes" << endl;
			return 0;
		}
	}
	
	
	for(int i = 0; i < n; i++){
		int t = 0;
		for(int j = 0; j < n; j++){
			if (a[j][i] == -1){
				t++;
			}				
		}
		if (t == 3){
			cout << "Yes" << endl;
			return 0;
		}
	}
	
	cout << "No" << endl;
	
	return 0;
}

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

ol = []


def zeros(x):
    xt = str(x)
    k = 6 - len(xt)
    return "0" * k + xt

for i in range(M):
    p,y = map(int, input().split())
    ol.append((p,y))

l = sorted(ol)


res = {}

t=0
for i in range(M):
    if l[i][0] == l[i-1][0]:
        t+=1
    else:
        t=1
    res[l[i]] = zeros(l[i][0])+ zeros(t)

for i in ol:
    print(res[i])



Measured memory_bytes: 36780
x1, y1, x2, y2 = map(int, input().split())

xdiff = x2 - x1
ydiff = y2 - y1

x3 = x2 - ydiff
x4 = x1 - ydiff
y3 = y2 + xdiff
y4 = y1 + xdiff

print(x3, y3, x4, y4)

Measured memory_bytes: 2940
#include <stdio.h>

int main(void){
  int K,S;
  scanf("%d%d",&K,&S);
  int counter = 0;
  int i,j;
  for(i=0;i<=K;i++){
    for(j=0;j<=K;j++){
      if(S-i-j >= 0 && S-i-j <= K){
        counter ++;
      }
    }
  }
  printf("%d\n",counter);

}


Measured memory_bytes: 128
#include <iostream>
#include <cstdio>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <cmath>
#include <complex>
#include <map>
#include <climits>
#include <cstdio>
using namespace std;

#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define EPS 1e-8
#define F first
#define S second
#define mkp make_pair

static const double PI=6*asin(0.5);
typedef long long ll;
typedef complex<double> CP;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vint;
static const int INF=1<<24;

template <class T>
void initvv(vector<vector<T> > &v,int a,int b, const T  &t = T()){
	v.assign(a,vector<T>(b,t));
}
int re=1,bl=2,ye=3;
int solve(ll x,ll y){
	if(x>y) swap(x,y);
	int ans=(x+2)%3+1;
	return ans;
}

int main(){
	ll n;
	cin>>n;
	ll k;
	cin>>k;
	rep(i,k){
		ll a,b;
		cin>>a>>b;
		a=min(a,n-a+1);
		b=min(b,n-b+1);
		cout<<solve(a,b)<<endl;
	}
}

Measured memory_bytes: 1160
///mAAria...
#include<bits/stdc++.h>
 
using namespace std;
 
#define int long long
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(v) v.begin(),v.end()
#define allr(v) v.begin(),v.end()
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define pii pair<int,int>
#define pi 3.1415926535897932384626433832
#define mod 1000000007
//#define mod 998244353
#define inf 1000000000
#define pr1(a) cout << a << endl
#define pr2(a,b)cout << a <<  " " <<b<< endl
#define pr3(a,b,c) cout << a <<" " << b << " " << c << endl

const long double PI = acos(-1);

int powm(int a, int b) {
    int res=1;
    while(b) {
        if(b&1)
            res=(res*a)%mod;
        a=(a*a)%mod;
        b>>=1;
    }
    return res;
}

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

bool p(int n){
    return ((n&(n-1))==0);

}
void solve(){
    
    string s, t;
    cin >> s >> t;

    int ans = 0;

    for(int i = 0; i<s.size(); i++){
        if(s[i]!=t[i])ans++;
    }
    cout << ans<< endl;
   
} 

signed main() 
{   
    IOS;
    int t = 1;
    // cin >> t;

    for(int i = 1;i<=t;i++){
        solve();
    }
    return 0;
} 

 


Measured memory_bytes: 3820
#include <bits/stdc++.h>
using namespace std;
#define ull unsigned long long
#define MOD (int)(1e9+7)
#define ceil(x, y) (x%y==0? (x/y) : (x/y+1))
#define FOR(i, N) for(int i = 0; i < N; ++i)
#define FOR1(i, N) for(int i = 1; i <= N; ++i)
#define vi vector <int>
#define pii pair <int, int>
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define mset(a, v) memset(a, v, sizeof(a))
#define all(v) (v).begin(), (v).end()
#define INF 2e9
#define EPS 1e-9
#define MAX 200009
#define PI 3.141592653589793238
#define int long long
/*#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
typedef cc_hash_table<int, int, hash<int>> ht; // while using, comment #define int long long  */

void __print(int x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define dbg(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define dbg(x...)
#endif
using namespace std;

long long power(long long x, unsigned long long y, unsigned int m){
    if(y == 0) return 1;
    unsigned long long p = power(x, y/2, m) % m;
    p = (p * p) % m;
    
    if(y & 1)
        return  ((x % m)*p) % m;
    else 
        return p;
}


int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #ifndef ONLINE_JUDGE
    	freopen("in2.txt", "r", stdin);
    	freopen("out.txt", "w", stdout);
    #endif

	int T=1;
	//cin >> T;
	FOR1(tp, T)
	{
		//cout << "Case #" << tp << ": ";
		
		int n, k; cin >> n >> k;
		int m[n+1]; mset(m, 0);
		FOR1(i, k){
			int d; cin >> d;
			FOR1(j, d){
				int a; cin >> a;
				m[a]++;
			}
		}
		int cnt = 0;
		FOR1(i, n){
			if(m[i] == 0) cnt++;
		}
		cout << cnt;
		cout << '\n';
	}
	return 0;
}


Measured memory_bytes: 3656
input_line = input().split(" ")
W = int(input_line[0])
H = int(input_line[1])
x = int(input_line[2])
y = int(input_line[3])
r = int(input_line[4])

if x-r >= 0 and x+r <= W and y-r >= 0 and y+r <= H:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 5596
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
using P = pair<int,int>;
using pq = priority_queue<int>;
typedef long long ll;
string yes = "Yes\n";
string no = "No\n";

int  main()
{
	int a,b, c; cin >> a >> b >> c;

	set<int> st;
	st.insert(a);
	st.insert(b);
	st.insert(c);
	cout << st.size() << endl;
	return (0);
}


Measured memory_bytes: 256
program lunlun_number
  implicit none
  integer :: k, l(10) = 0, i, j, m, n = 9
  integer(8), allocatable :: a(:,:)
  read(*,*) k
  if (k < 10) then
    write(*,'(i0)') k
    stop
  end if
  allocate(a(10,k))
  a = 0_8
  a(1,1:9) = (/1_8, 2_8, 3_8, 4_8, 5_8, 6_8, 7_8, 8_8, 9_8 /)
  l(1) = 9
  do
    do i = 1, 9
      m = 0
      do j = 1, l(i)
        if (mod(a(i,j),10_8) /= 0_8) then
          m = m+1
          a(i+1,m) = a(i,j)*10_8+mod(a(i,j),10_8)-1_8
          n = n+1
          if (n == k) then
            write(*,'(i0)') a(i+1,m)
            stop
          end if
        end if
        m = m+1
        a(i+1,m) = a(i,j)*10_8+mod(a(i,j),10_8)
        n = n+1
        if (n == k) then
          write(*,'(i0)') a(i+1,m)
          stop
        end if
        if (mod(a(i,j),10_8) /= 9_8) then
          m = m+1
          a(i+1,m) = a(i,j)*10_8+mod(a(i,j),10_8)+1_8
          n = n+1
          if (n == k) then
            write(*,'(i0)') a(i+1,m)
            stop
          end if
        end if
      end do
      l(i+1) = m
    end do
  end do
end program lunlun_number

Measured memory_bytes: 8064
#include <iostream>
#include <algorithm>
#include <math.h>

using namespace std;

int main(){
	/*input*/
	int n;
    cin >> n;
    int d;
    cin >> d;
    int x[10][10];
    for(int i = 0; i < n; i++){
    	for (int j = 0; j < d; j++){
        	cin >> x[i][j];
    	}
    }

    /*calc*/
    double ans_tmp;
    double ans;
    int ans_count= 0;
    //i;head_y軸,k:tail_y軸:j:x軸
    for (int i = 0;i < n-1; i++){
    	for(int k = i+1; k<n; k++){
        	ans_tmp = 0;
        	ans = 0;
    		for (int j = 0; j < d; j++){
				ans_tmp += (x[i][j] - x[k][j])*(x[i][j] - x[k][j]);
//				cout << ans_tmp<< " ";
			}
//			cout<<endl;
			ans = sqrt(ans_tmp);
//			cout << ans << endl;
			if (ceil(ans) == floor(ans)) {
				ans_count++;
			}
    	}
    }

    cout << ans_count <<endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<assert.h>
#include<set>
using namespace std;
#define ll long long
#define MAXN 100005

struct nibab {
    ll x,y,z;
} A[MAXN];

ll x,y,z,p[MAXN],q[MAXN],t,u[MAXN],v[MAXN],ans;

multiset <ll> s;

bool comp(nibab a, nibab b) {
    return (a.x - a.y) > (b.x - b.y);
}

int main(void) {
    int i,j;
    cin >>  x >> y >> z;
    int n = x+y+z;
    for (i=0; i<n; i++) {
        cin >> A[i].x >> A[i].y >> A[i].z;
    }
    sort(A,A+n,comp);
    for (i=0; i<n; i++) {
        p[i] = A[i].x - A[i].z;
        q[i] = A[i].y - A[i].z;
    }
    for (i=0; i<x; i++) {
        s.insert(p[i]);
        p[i] += p[i-1];
        u[i] = u[i-1] + A[i].z;
    }
    for (i=x; i<n; i++) {
        t=*(s.begin());
        if (p[i] <= t) {
            p[i] = p[i-1];
        } else {
            s.erase(s.begin());
            s.insert(p[i]);
            p[i] += p[i-1] - t;
        }
        u[i] = u[i-1] + A[i].z;
    }
    s.clear();
    for (i=1; i<=y; i++) {
        s.insert(q[n-i]);
        q[n-i] += q[n-i+1];
        v[n-i] = v[n-i+1] + A[n-i].z;
    }
    for (i=y+1; i<=n; i++) {
        t=*(s.begin());
        if (q[n-i] <= t) {
            q[n-i] = q[n-i+1];
        } else {
            s.erase(s.begin());
            s.insert(q[n-i]);
            q[n-i] += q[n-i+1] - t;
        }
        v[n-i] = v[n-i+1] + A[n-i].z;
    }
    for (i=x-1; i<=x-1+z; i++) {
        ans = max(ans, p[i] + u[i] + q[i+1] + v[i+1]);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 10112
n,m=map(int,input().split())
import bisect
l=[[] for _ in range(n)]
l2=[]

for i in range(m):
  p,y=map(int,input().split())
  bisect.insort_left(l[p-1],y)
  l2.append([p,y])

for m in l2:
  print("{:06d}".format(m[0]) +"{:06d}".format(bisect.bisect_left(l[m[0]-1],m[1])+1))


Measured memory_bytes: 34264
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1000000007;
const ll LINF=1LL<<60;
const int INF=1<<30;

//nもrも10^5くらいのときにはこれ使うと良き
//二項係数の計算
const ll MAX = 510000;
ll fac[MAX],finv[MAX],inv[MAX];

//テーブルの初期化
void COMinit(){
	fac[0] = fac[1] = 1;//階乗
	finv[0] = finv[1] = 1;//階乗の逆元
	inv[1] = 1;//逆元(1の逆元は1)
	for(ll i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % mod;//累積積的な感じ
		inv[i] = mod - inv[mod % i] * (mod / i) % mod;//inv[i] = iの逆元(mod mod)
		finv[i] = finv[i - 1] * inv[i] % mod;//階乗の逆元の計算
	}
}



ll COM(ll n,ll k){//二項係数の計算
	if(n < k){
		return 0;
	}
	if (n < 0 || k < 0){
		return 0;
	} 
	return fac[n] * (finv[k] * finv[n - k] % mod) % mod;
}

int main(){
	ll n,p;cin>>n>>p;
	vector<ll> a(n);
	ll odd = 0;
	ll even = 0;
	for(ll i = 0; i < n; i++) {
		cin>>a[i];
		if(a[i] % 2 == 0){
			even++;
		}
		else{
			odd++;
		}
	}
	COMinit();
	if(p == 1){
		ll sum = 0;
		for(ll i = 1; i <= n; i+= 2) {
			sum += COM(odd,i);
		}
		cout << ll(pow(2,even)) * sum << endl;
	}
	else{
		ll sum = 0;
		for(ll i = 0; i <= n; i+= 2) {
			sum += COM(odd,i);
		}
		cout <<  ll(pow(2,even)) * sum << endl;
	}

	return 0;
}

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

using namespace std;
int n;
map<int,int>m;
int main()
{
    scanf("%d",&n);
    int flag=0;
    for(int i=1;i<=n;i++)
    {
        int x;
        scanf("%d",&x);
        if(m[x]>=1)
            flag=1;
        m[x]++;
    }
    if(flag)
        printf("NO");
    else
        printf("YES");
    return 0;
}


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

int mud_num = 1e9 + 7;

int main(){
    std::string S;
    std::cin >> S;
    
    int digit = 1;
    std::vector< int > cnt(13, 0);
    cnt[0] = 1;
    
    for(int i=S.size() - 1; i>=0; i--){
        std::vector< int > cur_cnt(13, 0);
        std::vector< int > num;
        if(S[i] == '?'){
            for(int j=0; j<10; j++){
                num.push_back(j);
            }
        }else{
            num.push_back(S[i] - '0');
        }
        
        for(int j=0; j<num.size(); j++){
            int div_re = (digit * num[j]) % 13;
            cur_cnt[div_re]++;
        }
        
        std::vector< int > new_cnt(13, 0);
        for(int a=0; a<13; a++){
            for(int b=0; b<13; b++){
                new_cnt[(a + b) % 13] = (new_cnt[(a + b) % 13] + cnt[a] * cur_cnt[b]) % mud_num;
            }
        }
        cnt = new_cnt;
        digit = (digit * 10) % 13;
    }
    
    
    std::cout << cnt[5] << std::endl;
    
    return 0;
}



Measured memory_bytes: 512
#include <bits/stdc++.h>
#include<iomanip>
#define ll long long
#define pb push_back
#define mp make_pair
#define MOD 1000000007
using namespace std;

ll p[1000005];
vector<ll> prime;

void soe() {
	ll i,j;
	for(i=2;i<1000005;i++) p[i]=1;
	for(i=2;i<=sqrt(1000005);i++) {
		for(j=i*i;j<1000005;j+=i) p[j]=0;
	}
	for(i=2;i<1000005;i++) {
		if(p[i]) prime.pb(i);
	}
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    soe();
    ll x;
    cin >> x;
    cout << *lower_bound(prime.begin(), prime.end(),x) << "\n";
    return 0;
}



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

#define pb push_back
bool prime(int m){
  if(m==1) return 0;
  for(int i=2;i<m;i++){
    if(m%i==0) return 0;
  }
  return 1;
}
void solve(){
   vector<int>v(1001,0);
   int n; cin>>n;
   for(int i=2;i<=n;i++){
      int k=i;
      for(int j=2;j<=k;j++){
          if(k%j==0 && prime(j)){
            int l=k;
            while(l%j==0 && l>0){
              v[j]++;
              l=l/j;
            }
           

          }
      }

   }
   ll prod=1;
   ll mod=1000000007;
   
   for(int i: v) {
    if(i!=0)
    prod=((prod%mod)*(i+1)%mod)%mod;
   }
   cout<<prod<<endl;
}


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

 ios_base::sync_with_stdio(0);
 cin.tie(0);

int t=1 ;  while(t--)
 solve();

return 0;
}


Measured memory_bytes: 3536
#include<bits/stdc++.h>
#define int long long
using namespace std;
constexpr int mod=1e9+7;
int arr[]={0,1,1,2,2,2,3,3,3,3,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8};
signed main(){
    int n;
    cin>>n;
    map<int,int>mp;
    for(int i=2;i<=1e6;i++){
        while(n%i==0){
            n/=i;
            mp[i]++;
        }
    }
    if(n!=1)
        mp[n]++;
    int ans=0;
    for(auto x:mp)
        ans+=arr[x.second];
    cout<<ans<<endl;
}

Measured memory_bytes: 3636