akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define rrep(i,n) for (int i = n-1; i >= 0; i--)
#define rep2(i,s,n) for (int i = s; i < n; ++i)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define tmax(a,b,c) max(a,max(b,c))
#define tmin(a,b,c) min(a,min(b,c))
#define pb push_back
using namespace std;
using ll = long long;
using P = pair<int,int>;
using LP = pair<ll,ll>;
template<class T> inline bool chmin(T& a,T b) {if(a > b){a = b; return true;} return false;}
template<class T> inline bool chmax(T& a,T b) {if(a < b){a = b; return true;} return false;}
const int inf = 1001001001;
const ll linf = 1001001001001001001;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll n,k;
    cin >> n >> k;
    vector<ll> oa(n);
    rep(i,n) cin >> oa[i];
    vector<vector<ll>> a(50,vector<ll>(2,0));
    vector<vector<ll>> dp(50,vector<ll>(2,0));
    rep(i,n) rep(j,50) {
        if(oa[i]>>j&1) a[j][0]++;
        else a[j][1]++;
    }
    vector<ll> pow2(50,1);
    rep2(i,1,50) pow2[i] = pow2[i-1]*2;
    int sz = 0;
    ll kk = k;
    while(kk > 0) {
        sz++;
        kk /= 2;
    }
    rrep(i,49) {
        int now = k>>i&1;
        rep(j,2) {
            if(j == 0){
                dp[i][j] = dp[i+1][j]+a[i][now]*pow2[i];
            } else {
                if(i < sz-1) dp[i][j] = dp[i+1][j]+max(a[i][0],a[i][1])*pow2[i];
                if(now == 1) chmax(dp[i][j],dp[i+1][0]+a[i][0]*pow2[i]);
            }
        }
    }
//    rep(i,50) cout << i << " " << a[i][0] << " " << a[i][1] << endl;
    cout << max(dp[0][0],dp[0][1]) << endl;
}


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

#define pb push_back
#define rb  pop_back
#define rf  pop_front
#define ins insert
#define f   first
#define s   second
#define um  unordered_map
#define us  unordered_set
#define pq  priority_queue

typedef vector< int > vi;
typedef vector< vi > vvi;
typedef pair< int,int > ii;
typedef pair< long long int ,long long int > iil;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef vector< ll > vl;
typedef vector< vl > vvl;
typedef vector<double> vd;
typedef pair<double,double> pd;
typedef queue<int> qi;
typedef queue<double> qd;
typedef queue<ll> qll;
typedef us<int> si;
typedef us<double> sd;
typedef us<ll> sll;
typedef vector<vd> md;


const int MAX = 1e6;
const int N = 200043;
const int MOD = 998244353;

#define IO ios_base::sync_with_stdio(false); cin.tie(NULL);
#define sz(a) int((a).size())
#define all(c) (c).begin(),(c).end()
#define tr(c,i) for( auto i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define EE endl
#define PI 3.14159265
#define g(a,b) a>b?a:b
#define l(a,b) a<b?a:b
#define SOT(A) sort(A.begin(),A.end())
#define SOTR(A) sort(A.rbegin(),A.rend())
#define REV(a) reverse(ALL(a))

// LOOP Control Statements
#define forn(i,j,n) for ( auto i=j ; i<n ; i++ )
#define fornd(i,j,n) for ( auto i=j ; i>n ; i-- )
#define FORE(i, b) for(auto &i:b)


#define SQ(i) (i*i)
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define IN(a, b) (a.find(b) != a.end())
#define BACK(a) a.back(); a.RB()
#define QBACK(a) a.top(); a.pop()
#define PRINT(a) FORE(i, a) cout << i << " "; cout << endl

#define tcase(term) int tc;cin>>tc;for(int term=0; cout<<"CASE "<<term+1<<EE,term<tc;term++)

ll pos(ld a, ld tar){
	if(a==tar) return  0;
	if(a>tar) return 1e9;
	else return 1+min(pos((a+1)/2,tar/2),pos(a+1.0,tar));
}

int main()
{
	// #ifndef ONLINE_JUDGE
	// freopen("input.txt","r",stdin);
	// freopen("output.txt","w",stdout);
	// #endif
 //    tcase(terms)
    {
    	ll a,b,n;
    	cin>>a>>b>>n;
    	if(n>b-1){
    		ll x=(floor((a*(b-1.0))/b)-a*floor((b-1.0)/b));
    		cout<<x<<endl;
    	}
    	else{
    		ll x=(floor((a*(n*1.0))/b)-a*floor((n*1.0)/b));
    		cout<<x<<endl;
    	}

    	
	}
}


Measured memory_bytes: 3732
/**
 *  author: mahfuzz
 *  created: 30.04.2020
**/
 
#include <iostream>
#include <map>
using namespace std;
typedef long long ll;

#define trace(x) cout << #x << ':' << x << "\n"

int main(int argc, char* argv[]){
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    
    int n, m, c; cin >> n >> m >> c;
    int arr[21], sol[101][101], cnt = 0;
    
    for(int i = 0; i < m; i++)
        cin >> arr[i];
    
    for(int i = 0; i < n; i++){
        int x = 0;
        for(int j = 0; j < m; j++){
            cin >> sol[i][j];
            x += (sol[i][j] * arr[j]); 
        }
        
        x += c;
        if(x > 0)
            ++cnt;
    }
    
    cout << cnt << "\n";
     
    
    return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main{
     static int dp[];
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;


        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

    public static void main(String[] args) {
        FastReader sc = new FastReader();
        int N=sc.nextInt(),M=sc.nextInt();
        int arr[]=new int[N];
        for (int i=0;i<M;i++) arr[i]=sc.nextInt();
        int sum=0;
        for (int i=0;i<M;i++)
        {
            sum+=arr[i];
        }
        if ( sum<=N ) System.out.println(N-sum);
        else System.out.println(-1);
    }
}
/*

 */

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

int main(){
  int A, B, H, M;
  cin >> A >> B >> H >> M;
  double ra=30*H+0.5*M-6*M;
  double c = cos(ra*M_PI/180);
  double ans = pow(A,2.0)+pow(B,2.0)-2.0*A*B*c;
  printf("%.10lf\n", sqrt(ans));
  return 0;
}


Measured memory_bytes: 4204
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main
{

  static boolean[][] z = new boolean[22][22];
  static boolean[][] zz = new boolean[22][22];
  public static void main(String[] args) throws IOException
  {
    BufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1);
    String s;
    String sl[];

    s = r.readLine();
    sl = s.split(" ");

    int n = Integer.parseInt(sl[0]);
    long v = 0;

    for(int i = 0; i <= n; i++)
    {
      if(i % 3 != 0 && i % 5 != 0)
      {
        v += i;
      }
    }

    System.out.println(v);
  }

}

class RemRing
{
  long module;

  public RemRing(long module)
  {
    this.module = module;
  }

  public long sum(long a, long b)
  {
    return (a + b + module) % module;
  }

  public long sub(long a, long b)
  {
    return (a - b + module) % module;
  }

  public long prod(long a, long b)
  {
    return (a * b) % module;
  }

  public long div(long a, long b)
  {
    return (a * inv(b)) % module;
  }

  public long inv(long a)
  {
    long b = this.module;
    long u = 1;
    long v = 0;
    while (b > 0)
    {
      long t = a / b;
      a -= t * b;
      u -= t * v;
      long z = a;
      a = b;
      b = z;
      z = u;
      u = v;
      v = z;
    }
    u %= this.module;
    if (u < 0)
      u += this.module;
    return u;
  }
}

Measured memory_bytes: 32588
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; i++)
using namespace std;
int main() {
    int N; cin >> N;
    int res = 0;
        for (int j = 1; j <= N; j++) {
            if (j % 2 == 0) continue;
            int div = 0;
            for(int k = 1; k <=j; k++) {
                if(j % k == 0) div++;
            }
            if(div == 8) res++;
        }
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
//mt19937 mrand(random_device{}()); 
const ll mod=1000000007;
//int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// head

int main() {
	int n;
	scanf("%d",&n);
	while(n){
		int t=n%10;
		if(t==7){
			printf("Yes");
			return 0;
		}
		n/=10;
	}
	printf("No");
} 

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

#define N 8000

string s;
int x, y;

vector<int> xv;
vector<int> yv;
bool dpx[2][2*N+1];
bool dpy[2][2*N+1];


int main()
{
	int ans = 0;

	cin >> s;
	cin >> x >> y;

	int tcnt = 0, fcnt = 0;
	int n = s.size();
	for( int i = 0; i < n; i++ ) {
		if( s[i] == 'T' ) {
			if( (tcnt % 2) == 0 ) {
				xv.push_back(fcnt);
			}
			else {
				yv.push_back(fcnt);
			}
			fcnt = 0;
			tcnt++;
		}
		else {
			fcnt++;
		}
	}
	if( fcnt > 0 ) {
		if( (tcnt % 2) == 0 ) {
			xv.push_back(fcnt);
		}
		else {
			yv.push_back(fcnt);
		}
	}

	dpx[0][N] = true;
	int sz = xv.size();
	for( int i = 0; i < sz; i++ ) {
		for( int j = 0; j < 2*N+1; j++ ) {
			if( dpx[i % 2][j] == true ) {
				dpx[(i+1) % 2][j + xv[i]] = true;
				if( i > 0 ) {
					dpx[(i+1) % 2][j - xv[i]] = true;
				}
				dpx[i % 2][j] = false;
			}
		}
	}

	dpy[0][N] = true;
	sz = yv.size();
	for( int i = 0; i < sz; i++ ) {
		for( int j = 0; j < 2*N+1; j++ ) {
			if( dpy[i % 2][j] == true ) {
				dpy[(i+1) % 2][j + yv[i]] = true;
				dpy[(i+1) % 2][j - yv[i]] = true;
				dpy[i % 2][j] = false;
			}
		}
	}

	if( dpx[xv.size() % 2][x + N] == true && dpy[yv.size() % 2][y + N] == true ) {
		ans = 1;
	}

	if( ans == 1 ) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}

	return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    else return c+i_7;
}
typedef pair<ll,ll> l_l;
ll inf=(ll)1E17;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
long double EPS=1E-9;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
////////////////////////////////////////



int main(){fastio;
    ll n;cin>>n;
    rep(a,1,3500){
        rep(b,1,3500){
            if((4*a*b-n*a-n*b)==0)continue;
            if((n*a*b)%(4*a*b-n*a-n*b)==0&&(n*a*b)/(4*a*b-n*a-n*b)>0){
                cout<<a<<" "<<b<<" "<<(n*a*b)/(4*a*b-n*a-n*b)<<endl;
                return 0;
            }
        }
    }
    return 0;
}





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

bool dp[100001];

int main() {
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  rep(i, n) cin >> a[i];
  rep(i, k+1) dp[i] = false;
  rep(i, k+1) {
    if (i < a[0]) dp[i] = false;
    else rep(j, n) {
      if ((i >= a[j]) && (dp[i-a[j]] == false)) {dp[i] = true; break;}
    }
  }
  if (dp[k] == false) cout << "Second" << endl;
  else cout << "First" << endl;
}


Measured memory_bytes: 384
#include "bits/stdc++.h"
using namespace std;
///////////////////////////////////////////
const long long int INF = 1LL<<60;
const long long int Mod = 1000000007;
using ll = long long int; using ci = const int;
using vi = vector<int>;  using Vi = vector<long long int>;
using P = pair<int, int>;  using PLL = pair<ll, ll>;
using matrix = vector<vector<ll>>;
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define rep(i,N) for(ll i = 0; i < (ll)N; i++)
#define repi(i,a,b) for(ll i = ll(a); i < ll(b); ++i)
template<class T>bool chmax(T &former, const T &b) { if (former<b) { former=b; return true; } return false; }
template<class T>bool chmin(T &former, const T &b) { if (b<former) { former=b; return true; } return false; }
template<class T>T sqar(T x){ return x*x; }//sqrt(x)は平方根;
#define Sort(v) std::sort(v.begin(), v.end(), std::greater<decltype(v[0])>()) //降順でVをソート
#define p_queue(v) priority_queue<v, vector<v>, greater<v> >
template<class T> inline void princ(T x){cout<<x<<" ";}; 
template<class T> inline void print(T x){cout<<x<<"\n";};
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
///////////////////////////////////////////////////////////////////////////////////

ll h,w;
vector<string> vs;

bool ck(ll x,ll y){
	if(x<0 || x>=w)return false;
	if(y<0 || y>=h)return false;
	return true;
}

ll ct(ll x,ll y){
	if(!ck(x,y))return 0;
	else{
		if(vs[y][x]=='#')return 1;
		else return 0;
	}
}
ll bx[3]={1,-1,0};
ll by[3]={0,1,-1};

vector<string> ans;

ll calc(ll x,ll y){
	ll as = 0;
	if(vs[y][x]=='#')return -1;
	rep(i,3){
		rep(j,3){
			if(bx[i]==0 && by[j]==0)continue;
			as += ct(x+bx[i],y+by[j]);
		}
	}
	return as;
}

int main(){
	cin.tie(0);ios::sync_with_stdio(false);
	std::cout<<std::fixed<<std::setprecision(30);
	cin>>h>>w;
	vs.resize(h);
	rep(i,h){
		cin>>vs[i];
	}
	ans=vs;
	rep(i,h){
		rep(j,w){
			ll tmp = calc(j,i);
			if(tmp==-1){
			}else{
				ans[i][j] = '0'+tmp;
			}
		}
	}
	rep(i,h){
		print(ans[i]);
	}
	return 0;
}

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

typedef long long ll;
typedef pair<ll,ll> pi;
typedef vector <ll> vi;
typedef vector <pi> vpi;
#define f first
#define s second
#define FOR(i,s,e) for(ll i=s;i<=ll(e);++i)
#define DEC(i,s,e) for(ll i=s;i>=ll(e);--i)
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define lbd(x, y) lower_bound(all(x), y)
#define ubd(x, y) upper_bound(all(x), y)
#define aFOR(i,x) for (auto i: x)
#define mem(x,i) memset(x,i,sizeof x)
#define fast ios_base::sync_with_stdio(false),cin.tie(0)

const double PI = 3.1415926535;
double A,B,H,M;

int main(){
	fast;
	
	cin>>A>>B>>H>>M;

	double Aang = ((H + M / 60) / 12) * 2 * PI;
	double Bang = (M / 60) * 2 * PI;
	
	double theta = abs(Aang - Bang);

	double C = sqrt(A*A + B * B - 2 * A * B * cos(theta));
	
	cout<<setprecision(10)<<C;
}




Measured memory_bytes: 4244
#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <numeric>
#include <algorithm>
#include <cmath>
#include <functional>
#include <map>
#include <set>
#include <stack>
#include <deque>

#define INF 1000000000;
#define MOD 1000000007;
#define LIMIT 1000000000000000000;
typedef long long ll;
using namespace std;
typedef pair<int, int> P;

int main()
{
    int N, M; cin >> N >> M;
    vector<map<int,int>> prefecture(N);
    vector<P> input_order(M);
    for (int i = 0; i < M; i++) {
        int p_no, year; cin >> p_no >> year; p_no--;
        prefecture[p_no][year] = 0;
        input_order[i].first = p_no; input_order[i].second = year;
    }

    for (int i = 0; i < N; i++) {
        auto& dict = prefecture[i];
        int order = 1;
        for (auto& p : dict) {
            p.second = order;
            order++;
        }
    }

    for (int i = 0; i < M; i++) {
        int p_no = input_order[i].first;
        int year = input_order[i].second;
        int order = prefecture[p_no][year];
        printf("%06d%06d\n", p_no + 1, order);
    }
}

Measured memory_bytes: 11648
import java.util.*;

class Main {

	public static void main(String args[]){
		Scanner in = new Scanner(System.in);
		for(;;){
			int n = in.nextInt(), m = in.nextInt();
			if( n==0 && m==0 ) break;
			int ts[] = new int [n+m+1], difs[] = new int [n+m];
			for(int i=0; i<n+m; i++) ts[i] = in.nextInt();
			ts[n+m] = 0;
			Arrays.sort(ts);
			for(int i=0; i<n+m; i++) difs[i] = ts[i+1] - ts[i];
			Arrays.sort(difs);
			System.out.println(difs[n+m-1]);
		}
	}

}

Measured memory_bytes: 13000
//It doesn't matter how slow you go, Unless you don't stop.
#include<iostream>
#include<algorithm>
#include<bitset>
 
#include<cmath>
#include<cstring>
#include<climits>
 
#include<deque>
#include<queue>
#include<vector>
#include<set>
#include<map>
#include<unordered_set>
#include<unordered_map>
 
#include<fstream>
#include<chrono>
using namespace std;
 
typedef long long LL;
typedef pair<LL,LL> p64;
typedef vector<LL> v64;
typedef map<LL,LL> mp64;
 
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define rep(i,s,e) for(long long i=s;i<=e;i++)
#define brep(i,s,e) for(long long i=s;i>=e;i--)
#define all(x) x.begin(),x.end()
#define mem(x,y) memset(x,y,sizeof(x))
#define DANGER std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
 
void solve()
{
     string s,t;
     cin>>s>>t;
     for(int i=0;i<s.length();i++)
     {
         if(s[i]!=t[i])
         {
             cout<<"No"<<endl;
             return;
         }
     }
     cout<<"Yes"<<endl;
}
 
int main()
{
    DANGER;
    ofstream out("output.txt");
 
    auto start = chrono::high_resolution_clock::now();
    
    LL t = 1;
    // cin>>t;
    rep(test,1,t)
    {
        solve();
    }
    
    auto stop = chrono::high_resolution_clock::now();
    // auto duration = chrono::duration_cast<chrono::milliseconds>(stop - start); 
    // cout << "Time taken by function: " << duration.count() << " milliseconds" << endl;
}

Measured memory_bytes: 3648
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main(){
	int l,r,d;
	cin>>l>>r>>d;
	int res  = 0;
	for (int i=l;i<=r;++i){
		if (i%d == 0){
			++res;
		}
	}
	cout << res << endl;
	return 0;
}









Measured memory_bytes: 3616
import static java.lang.System.out;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        while (scan.hasNext()) {
            int H = scan.nextInt();
            int W = scan.nextInt();
            if (H == 0 && W == 0) {
                break;
            }

            for (int i = 0; i < H; i += 1) {
                for (int j = 0; j < W; j += 1) {
                    out.print("#");
                }
                out.println();
            }
            out.println();                                             
        }
    }   
}

Measured memory_bytes: 33068
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<deque>
#include<numeric>
#include<queue>
#include<stack>
#include<cstring>
#include<limits>
#include<functional>
#include<unordered_set>
#include<iomanip>
#include<cassert>
#include<regex>
#include<bitset>
#include<complex>
#include<chrono>
#include<random>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(),x.end()
using ll=long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 60;

ll gcd(ll n, ll m) {
	ll tmp;
	while (m!=0) {
		tmp = n % m;
		n = m;
		m = tmp;
	}
	return n;
}

ll lcm(ll n, ll m) {
	return abs(n * m) / gcd(n, m);//gl=xy
}
 
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
 
using namespace std;
//ここから

void solve(){
  string s;
  cin>>s;
  set<char>st;
  int n=s.size();
  bool ng=false;
  rep(i,n){
    if(st.count(s[i]))ng=true;
    st.emplace(s[i]);
  }
  if(ng)cout<<"no";
  else cout<<"yes";
}

int main(){
	ios::sync_with_stdio(false);
  cin.tie(0);
	cout<<fixed<<setprecision(15);
  solve();
	return 0;
}


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

#define  SZ(items) (int)items.size()
#define  CLR(a)  memset(a,0,sizeof(a))
#define  SET(a)  memset(a,-1,sizeof(a))


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

template <class T> inline T gcd(T a, T b) { while (b) { a = a%b; swap(a, b); } return a; }

using namespace std;

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

	int mx = 0;
	int res = 0;

	for (int i = 0; i< n; i++)
	{
		int it;
		cin >> it;

		if (i == 0)
		{
			mx = it;
		}
		else
		{
			mx = max(mx, it);
		}
		if (it >= mx)
			res++;
	}

	cout << res << endl;


	return 0;
}

Measured memory_bytes: 256
/*************************************************************************
  > File Name: a.cpp
  > Author: Samuel
  > Mail: enminghuang21119@gmail.com
  > Created Time: Tue Mar 17 19:04:27 2020
*************************************************************************/

#include <bits/stdc++.h>
using namespace std;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int a, b;
    cin >> a >> b;
    int t = a / b;
    t += a % b != 0;
    cout << t << '\n';
    return 0;
}


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

typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pll;
typedef vector<bool> vb;
const ll oo = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-9;
#define sz(c) ll((c).size())
#define all(c) begin(c), end(c)
#define FOR(i,a,b) for (ll i = (a); i < (b); i++)
#define FORD(i,a,b) for (ll i = (b)-1; i >= (a); i--)
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define xx first
#define yy second
#define TR(X) ({ if(1) cerr << "TR: " << (#X) << " = " << (X) << endl; })

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	ll n, m;
	cin >> n >> m;

	vvl adj(n);
	while (m--) {
		ll a, b;
		cin >> a >> b;
		a--, b--;
		adj[a].pb(b);
	}
	
	vl res;
	FOR(s,0,n) {
		vl pred(n,-1);
		queue<ll> q;
		q.push(s);

		while (sz(q)) {
			ll i = q.front();
			q.pop();
			for (ll j: adj[i]) {
				if (j == s) {
					vl cur = {i};
					while (i != s) i = pred[i], cur.pb(i);
					if (sz(res) == 0 || sz(cur) < sz(res)) res = cur;
					while (sz(q)) q.pop();
					break;
				}
				if (pred[j] != -1) continue;
				pred[j] = i;
				q.push(j);
			}
		}
	}

	if (sz(res)) {
		cout << sz(res) << endl;
		for (ll x: res) cout << x+1 << endl;
	} else {
		cout << -1 << endl;
	}
}



Measured memory_bytes: 384
#include<iostream>
using namespace std;
int main(){
	int n,a,b,c;
	cin>>n;
	for(int i=0;i<n;i++){
	cin>>a>>b>>c;
	if(a*a==b*b+c*c){
		cout<<"YES"<<endl;
	}
		else if(b*b==a*a+c*c){
		cout<<"YES"<<endl;
	}
		else if(c*c==b*b+a*a){
		cout<<"YES"<<endl;
	}
	else{
		cout<<"NO"<<endl;
	}
	}
}

Measured memory_bytes: 1156
import java.util.*;

public class Main{
  public static void main(String[] args) {
    Scanner sc=new Scanner(System.in);
    String x=sc.next();
    String y=sc.next();
    int x1=(int)x.charAt(0);
    int y1=(int)y.charAt(0);
    // System.out.println(x1+" "+y1);
    if(x1>y1) System.out.println(">");
    if(x1==y1) System.out.println("=");
    if(x1<y1) System.out.println("<");
  }
}


Measured memory_bytes: 25044
#include <cstdio>

int main()
{
  char a[11], b[11], c[11];
  scanf("%s %s %s", a, b, c);
  printf("%c%c%c\n", *a - 'a' + 'A', *b - 'a' + 'A', *c - 'a' + 'A');
  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
 
char moji(int n){
  switch(n){
    case 1:
      return 'a';
      break;
    case 2:
      return 'b';
      break;
    case 3:
      return 'c';
      break;
    case 4:
      return 'd';
      break;
    case 5:
      return 'e';
      break;
    case 6:
      return 'f';
      break;
    case 7:
      return 'g';
      break;
    case 8:
      return 'h';
      break;
    case 9:
      return 'i';
      break;
    case 10:
      return 'j';
      break;
  }
}

int main(){
  int n,ima,imb,k;
  string ims;
  cin>>n;
  queue<int> a,b;
  queue<string> s;
  a.push(1);
  b.push(1);
  s.push("a");
  for(;a.empty()==0;){
    ima=a.front();
    imb=b.front();
    ims=s.front();
    if(ima==n){
      cout<<ims<<endl;
    }else{
      for(k=1;k<=imb+1;k++){
        a.push(ima+1);
        b.push(max(imb,k));
        s.push(ims+moji(k));
      }
    }
    a.pop();
    b.pop();
    s.pop();
  }
}


Measured memory_bytes: 8832
#include<bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0; i<N; i++)
#define lint long long
#define square_vector(name,N,M) vector<vector<lint>>name(N,vector<lint>(M,0))
#define sort(V) sort(V.begin(),V.end())

lint gcd(lint A,lint B) {
  if (A > B) {
    swap(A,B);
  }
  if (B % A == 0) {
    return A;
  }
  else {
    return gcd(A,B%A);
  }
}

int main() {
  lint N;
  cin >> N;
  
  if (N % 2 == 1) {
    cout << 0 << endl;
    return 0;
  }
  
  N /= 2;
  lint ans = 0;
  lint n5 = 5;
  
  while (n5 <= 500000000000000000) {
    ans += (N/n5);
    n5 *= 5;
  }
  
  cout << ans << endl;
  
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<utility>
#include<deque>
#include<iomanip>
#include<ctime>
using namespace std;

int main()
{
	vector<vector<pair<int, bool>>> bingo;

	for (int i = 0; i < 3; i++)	
	{
		vector<pair<int,bool>> number;
		for (int j = 0; j < 3; j++)
		{
			pair<int, bool> a;
			cin >> a.first;
			a.second = false;
			number.push_back(a);
		}
		bingo.push_back(number);
	}

	int N;
	cin >> N;

	for (int i = 0; i < N; i++)
	{
		int a;
		cin >> a;

		for (int i = 0; i < 3; i++)
		{
			for (int j = 0; j < 3; j++)
			{
				if (bingo[i][j].first == a)
				{
					bingo[i][j].second = true;
				}
				//cout << bingo[i][j].first << " " << bingo[i][j].second << endl;
			}
		}
	}

	for (int i = 0; i < 3; i++)
	{
		if (bingo[i][0].second && bingo[i][1].second && bingo[i][2].second)
		{
			cout << "Yes" << endl;
			exit(0);
		}
		else if (bingo[0][i].second && bingo[1][i].second && bingo[2][i].second)
		{
			cout << "Yes" << endl;
			exit(0);
		}
	}

	if (bingo[0][0].second && bingo[1][1].second && bingo[2][2].second)
	{
		cout << "Yes" << endl;
		exit(0);
	}
	else if (bingo[0][2].second && bingo[1][1].second && bingo[2][0].second)
	{
		cout << "Yes" << endl;
		exit(0);
	}

	cout << "No" << endl;

	return 0;
}

Measured memory_bytes: 256
class UnionFind(object):
    """
    query: O(Ack^-1(n,n)) (amortize)
    """
    def __init__(self,n):
        """
        param n: number of nodes
        """
        self.__par=list(range(n))
        self.__rank=[0]*n
        self.__size=[1]*n

    def __root(self,k):
        if self.__par[k]==k: return k
        else:
            self.__par[k]=self.__root(self.__par[k])
            return self.__par[k]

    def is_same(self,i,j):
        return self.__root(i)==self.__root(j)

    def unite(self,i,j):
        i=self.__root(i)
        j=self.__root(j)
        if i==j: return
        if self.__rank[i]>self.__rank[j]:
            self.__par[j]=i
            self.__size[i]+=self.__size[j]
        else:
            self.__par[i]=j
            self.__size[j]+=self.__size[i]
            if self.__rank[i]==self.__rank[j]: self.__rank[j]+=1

    def size(self,k):
        return self.__size[self.__root(k)]

import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
# input=sys.stdin.readline
def resolve():
    n,m=map(int,input().split())
    ab=[map(int,input().split()) for _ in range(m)]
    tree=UnionFind(n)
    ans=[0]*m
    score=n*(n-1)//2
    ans[m-1]=score
    for i in range(m-1,0,-1):
        a,b=ab[i]
        a,b=a-1,b-1
        if not tree.is_same(a,b):
            score-=tree.size(a)*tree.size(b)
            tree.unite(a,b)
        ans[i-1]=score
    print(*ans,sep='\n')

resolve()

Measured memory_bytes: 122456
import java.util.*;
public class Main {
  public static void main(String[] args ) throws Exception {
    Scanner sc = new Scanner(System.in);
      int D = sc.nextInt();
      int T = sc.nextInt();
      int S = sc.nextInt();
      int time = D/S;
      String anser = "";
      //余りがある場合は繰り上げ
      int amari = D%S;
    if(amari>0){
      time += 1;
    }else{

    }
    
    if(time<=T){
      anser = "Yes";
    }else{
      anser = "No";
    }
      System.out.println(anser);   
  }
}

Measured memory_bytes: 35448
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <string>
#include <map>
#include <queue>
#include <set>

#define ll long long
#define REP(i,n) for(int i = 0; i < n; i++)
#define PI 3.141592653589
#define MOD 1000000007

using namespace std;

template<typename T> T gcd(T a, T b){return (a % b)? gcd(b, a % b) : b;}
template<typename T> T lcm(T a, T b){return a * b / gcd(a, b);}

int main(void){
    string s;
    cin >> s;
    int ans = 0;
    if(s[0] == 'R'){
        ans ++;
        if(s[1] == 'R'){
            ans++;
            if(s[2] == 'R') ans++;
        }
    } else{
        if(s[1] == 'R'){
            ans++;
            if(s[2] == 'R') ans++;
        } else if(s[2] == 'R') ans++;
    }
    cout << ans << endl;
    
    
    return 0;
}

Measured memory_bytes: 3624
package main

import (
	"fmt"
	"sort"
)

func main() {
	var n, a, output int
	ali, bob := 0, 0
	fmt.Scanf("%d", &n)
	var tmp []int
	for i := 0; i < n; i++ {
		fmt.Scanf("%d", &a)
		tmp = append(tmp, a)
	}
	sort.Sort(sort.Reverse(sort.IntSlice(tmp)))
	for i := 0; i < n; i += 2 {
		ali += tmp[i]
	}
	for i := 1; i < n; i += 2 {
		bob += tmp[i]
	}
	output = ali - bob
	fmt.Println(output)
}


Measured memory_bytes: 512
#include "bits/stdc++.h"
#define ed cout<<"\n";
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long int
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define All(obj) (obj).begin(),(obj).end()

using namespace std;


int main() {
	speed;
	vector<int >a;
	rep(i, 3) {
		int b;
		cin >> b;
		a.push_back(b);
	}

	sort(All(a));
	int ans = a.at(0) + a.at(1);
	cout << ans;
	ed;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
typedef long long int ll;
using namespace std;

ll gcd(ll x, ll y) {return y ? gcd(y, x % y) : x;}
template <typename T> string to_string(const vector<T> &xs) {string s="["; for(int i=0;i<xs.size();i++) s += (i>0 ? " " : "") + to_string(xs[i]); return s + "]";}

vector<ll> factor(ll x){
  // returns: [p0, e0, p1, e1, ...]
  vector<ll> ret;
  for(ll p=2;p*p<=x;p++){
    ll e = 0;
    for(;x%p==0;e++){
      x /= p;
    }
    if (e > 0){ret.pb(p); ret.pb(e);}
  }
  if (x > 1) {ret.pb(x); ret.pb(1);}
  return ret;
}

int main(){
  ll a, b;
  cin >> a >> b;
  ll g = gcd(a, b);
  cout << factor(g).size()/2 + 1 << endl;
  
  
  return 0;
}
  

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using p = pair<int, int>;
#define INF 1001001001
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define repX(i, n ,x) for (int i = x; i < (int)(n); ++i)
#define repBack(i, n) for (int i = n; i >= 0; --i)
#define dup(x,y) (((x)+(y)-1)/(y))

int main() {
    string S;
    cin >> S;
    string AA = S.substr(0,2),BB = S.substr(2);
    bool flagA = false,flagB = false;
    int zero = 0;
    if (atoi(AA.c_str())<=12){
        flagA = true;
        if (atoi(AA.c_str())==0){
            flagA=false;
            zero ++;
        }
    }
    if (atoi(BB.c_str())<=12){
        flagB = true;
        if (atoi(BB.c_str())==0){
            flagB = false;
            zero ++;
        }
    }
    if(zero == 2 || !flagA&&!flagB){
        cout << "NA" << endl;
        return 0;
    }
    if(flagA&&flagB)cout << "AMBIGUOUS" << endl;
    else if(flagA)cout << "MMYY" << endl;
    else cout << "YYMM" << endl;

    return 0;
}

Measured memory_bytes: 256
///Prochnost
#include<bits/stdc++.h>
#define pb push_back
#define task "test"
#define MOD 1000000007
#define mx 1000005
#define EPS 1e-6
#define bit(x,i) (x>>(i-1)&1ll)
#define on(x,i) (x|(1ll<<(i-1)))
#define off(x,i) (x&~(1ll<<(i-1)))
using namespace std;
///mt19937 rd(chrono::steady_clock::now().time_since_epoch().count());
///int rnd(int l,int r){return l+rd()%(r-l+1);}
vector<int> a[mx],b[mx];
bool tr[mx];
int in[mx], out[mx], h[mx];
long long res = 0;
queue<int> q;
void bfs()
{
    while(!q.empty())
    {
        int u = q.front();
        q.pop();
        for(int v : b[u])
        {
            if(h[v] >  h[u] + 1)continue;
            q.push(v);
            h[v] = h[u] + 1;
        }
    }
    return;
}
int n;
string s;
void nhap()
{
    cin >> s;
    n = s.length();
    for(int i = 1; i <= n; i++)
    {
        char x = s[i-1];
        if(x == '<')
        {
            a[i+1].pb(i);
            b[i].pb(i+1);
            out[i+1]++;
        }
        else
        {
            a[i].pb(i+1);
            b[i+1].pb(i);
            out[i]++;
        }
    }
    n++;
}
void solve()
{
    for(int i = 1; i <= n; i++)
    {
        if(out[i] == 0)q.push(i),tr[i] = 1;

    }
    bfs();
    for(int i = 1; i <= n; i++)
        res += 1ll * h[i];
    cout << res;
}
int main()
{
/// neu a[i] > a[i+1] thi cung i -> i + 1;
/// neu a[i] < a[i+1] thi cung i <- i + 1;
/// neu i co bac ra va khong co bac vao gan = 0 -> xoa tat ca cac nut nay di
/// f[u] la do dai duong di dai nhat tu i thi (a[i] >= f[u]) f[u]]r
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    nhap();
    solve();
}


Measured memory_bytes: 87452
#include <bits/stdc++.h>
using namespace std;
  
int main() {
    int n;
  	cin >> n;
    int min;
    cin >> min;
    int max = -1000000001;

	for(int k =1;k<n;k++){
	  int x;
      cin >> x;	
      if(max < x- min){
        max = x - min;
      }
      if(x < min){
        min = x;
      }

    }
    cout << max << endl;
}


Measured memory_bytes: 3120
import unittest


class TestC(unittest.TestCase):
    def test_1(self):
        self.assertEqual(think([1, 4]), 5)

    def test_2(self):
        self.assertEqual(think([14, 14, 2, 13, 56, 2, 37]), 2354)


def solve():
    x = read()
    result = think(x)
    write(result)


def read():
    n = read_int(1)[0]
    return read_int(n)


def read_int(n):
    return read_type(int, n, sep=' ')


def read_float(n):
    return read_type(float, n, sep=' ')


def read_type(t, n, sep):
    return list(map(lambda x: t(x), read_line().split(sep)))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(x):
    left = min(x)
    right = max(x)
    min_cost = 1e20
    for p in range(left, right + 1):
        min_cost = min(min_cost, calc_cost(x, p))
    return min_cost


def write(result):
    print(result)


def calc_cost(x, p):
    return sum(map(lambda x: abs(x - p) ** 2, x))


if __name__ == '__main__':
    # unittest.main()
    solve()

Measured memory_bytes: 51052
X,N = map(int,input().split())
P = list(map(int,input().split()))

Q = list()
for i in range(200):
    Q.append(i+1)
for j in P:
    Q.remove(j)

Q_len = len(Q)
swich = True

if N == 0:
    print(X)
else:
        for i in range(Q_len+1):
            if swich == True:
                xm = X-i
                xp = X+i
                for j in range(Q_len):
                    if xm == 0:
                        print(0)
                        swich = False
                        break
                    elif xm == Q[j]:
                        print(xm)
                        swich = False
                        break
                    elif xp == Q[j]:
                        print(xp)
                        swich = False
                        break
            else:
                break
            

Measured memory_bytes: 8980
X, Y = input().split()

dict_ = {'A': 10, 'B': 11, 'C': 12, 'D': 13, 'E': 14, 'F': 15}

if dict_[X] < dict_[Y]:
    print('<')
elif dict_[X] > dict_[Y]:
    print('>')
else:
    print('=')


Measured memory_bytes: 2940
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <queue>
using namespace std;
#define rep(i,n) for(int i = 0;i<n;i++)
const long long MOD = 1000000007LL;
int main(){
    int n,k;
    cin >> n >> k;
    long long h[n];
    rep(i,n){
        cin >> h[i];
    }
    //入力は終了
    sort(h,h+n);
    long long tem = h[k-1] - h[0];
    for(int i = k;i<n;i++){
        tem = min(tem,h[i] - h[i-k+1]);
    }
    cout << tem << endl;
}

Measured memory_bytes: 1024
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author tatsumack
 */

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>

#define int long long
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
#define CLR(a, b) memset((a), (b), sizeof(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define INF 1001001001001001001ll
#define fcout cout << fixed << setprecision(12)

using namespace std;

typedef pair<int, int> P;

class AStationAndBus {
public:
    void solve(std::istream& cin, std::ostream& cout) {
        string s;
        cin >> s;
        set<char> set;
        for (auto c : s) {
            set.insert(c);
        }
        cout << (set.size() == 1 ? "No" : "Yes") << endl;
    }
};


signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    std::istream& in(std::cin);
    std::ostream& out(std::cout);

    AStationAndBus solver;
    solver.solve(in, out);
    return 0;
}


Measured memory_bytes: 768
#include<stdio.h>
int main(void)
{
    int n,a,b,c,i;
    scanf("%d",&n);
    for(i=0;i<n;i++){
     scanf("%d %d %d",&a,&b,&c);
     if(a*a+b*b==c*c||a*a+c*c==b*b||b*b+c*c==a*a){
        printf("YES\n");
     }else{
        printf("NO\n");
     }
    }
    return 0;
}

Measured memory_bytes: 580
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>

using namespace std;

int main()
{
	int n;
	vector<int> nums;

	while ( cin >> n )
	{
		nums.push_back( n );
	}

	sort( nums.begin(), nums.end(), greater<int>() );
	
	for ( vector<int>::iterator it = nums.begin(); it != nums.end(); )
	{
		cout << *( it++ );

		if ( it != nums.end() )
		{
			cout << ' ';
		}
	}
	cout << endl;

	return 0;
}

Measured memory_bytes: 0
using static System.Math;
using static System.Console;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;

namespace AtCoder
{
    class Program
    {
        private static long mod = 1000000007;
        private static long[] fac;
        private static long[] inv;
        private static long[] facInv;
        static void Main(string[] args)
        {
            //var n = int.Parse(ReadLine());
            var line = ReadLine().Split(' ').Select(value => long.Parse(value)).ToArray();

            var a = line[0];
            var b = line[1];
            var c = line[2];

            for(var i = 1; i <= b; i++)
            {
                if(a * i % b == c)
                {
                    WriteLine("YES");
                    return;
                }
            }

            WriteLine("NO");
        }
    }
}


Measured memory_bytes: 28192
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// ここにコードを挿入
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String t = null;
		for (int i = 0; i < 3; i++) {
			char a = s.charAt(i);
			char b = s.charAt(i + 1);
			if (a == b) {
				t = "Bad";
				break;
			} else {
				t = "Good";
			}
		}
		System.out.println(t);
	}

}


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

int main() {
  string s;
  cin >> s;
  int res = 0;
  bool flag;
  for (int i = 0; i < (int)s.size(); i++) {
    for (int j = i; j < (int)s.size(); j++) {
      flag = true;
      for (int k = i; k <= j; k++) {
        if (s.at(k) == 'A' || s.at(k) == 'T' || s.at(k) == 'G' || s.at(k) == 'C') {
          continue;
        }
        else {
          flag = false;
        }
      }
      if (flag) {
        res = max(res, j - i + 1);
      }
    }
  }
  cout << res << endl;
}


Measured memory_bytes: 256
from collections import Counter,defaultdict,deque
import sys
import bisect
import math
import itertools
import string
import queue
import copy
# import numpy as np
# import scipy
from itertools import permutations, combinations
from heapq import heappop, heappush
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
 
def inp(): # n=1
    return int(input())
def inpm(): # x=1,y=2
    return map(int,input().split())
def inpl(): # a=[1,2,3,4,5,...,n]
    return list(map(int, input().split()))
def inpls(): # a=['1','2','3',...,'n']
    return list(input().split())
def inplm(n): # x=[] 複数行
    return list(int(input()) for _ in range(n))
def inpll(n): # [[1,1,1,1],[2,2,2,2],[3,3,3,3]]
    return [list(map(int, input().split())) for _ in range(n)]

def main():
    a = inp()
    b=inp()
    for i in range(1,4):
        if i!=a and i!=b:
            print(i)
            return
            

if __name__ == "__main__":
    main()

Measured memory_bytes: 39020
N = gets.to_i
A = N.times.map { gets.to_i }

ans = 0

if A[0] > 0
  puts -1
  exit
end

1.upto(N - 1) do |i|
  if A[i] - A[i - 1] > 1
    puts -1
    exit
  end

  if A[i] == A[i - 1] + 1
    ans += 1
  else
    ans += A[i]
  end
end

puts ans


Measured memory_bytes: 5812
#include <iostream>

#define MIN(X, Y) ((X) < (Y) ? (X) : (Y))

using namespace std;

int f(int a);

int main()
{
    int minv = 1 << 27;

    int n;
    int a, b;

    cin >> n;
    for (int i = 1; i < n; i++) {

        int sum = 0;

        sum += f(i) + f(n - i);

        minv = MIN(sum, minv);
    }

    cout << minv << endl;

    return 0;
}

int f(int a)
{
    int rec = 0;

    while (a != 0) {
        rec += a % 10;
        a /= 10;
    }

    return rec;
}


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

int main(void) {
	int n, k;
	cin >> n >> k;
	int ans = 1;
	for (int i = 0; i < n; i++)
	{
		if (ans * 2 > ans + k)
			ans += k;

		else
			ans += ans;



	}
	cout << ans << endl;
}

Measured memory_bytes: 256
N, H = map(int, input().split())
a = [0] * N
b = [0] * N
for i in range(N):
    a[i], b[i] = map(int, input().split())
max_a = max(a)
sorted_b = sorted(b, reverse=True)
index = 0
for num in sorted_b:
    if num < max_a:
        break
    index += 1
todome_point = sum(sorted_b[:index])
ans = 0
#先に投げる方を考える
sorted_b = sorted_b[:index]
for num in sorted_b:
    H -= num
    ans += 1
    if H <= 0:
        break
#殴り回数
if H > 0:
    ans += H // max_a
    if H % max_a != 0:
        ans += 1
print(ans)

Measured memory_bytes: 79436
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in)) {
			int n = sc.nextInt();
			long min = sc.nextLong();
			long ans = 0;
			for (int i = 1; i < n; i++) {
				long tmp = sc.nextLong();
				if (min > tmp) {
					ans += min - tmp;
				}
				min = Math.max(min, tmp);
			}
			System.out.println(ans);
		}
	}
}

Measured memory_bytes: 58236
#include <iostream>

using ll = long long;
using namespace std;

int main(void) {
  ll n; cin >> n;
  ll d; cin >> d;
  int res = 0;
  for (int i = 0; i < n; i++) {
    ll x, y; cin >> x >> y;
    if (x*x + y*y <= d*d) {
      res ++;
    }
  }
  cout << res << endl;
}

Measured memory_bytes: 3596
#include <stdio.h>
#include <string.h>

char s[20];
long long dp[20][2][6];
int main(){
	int len;
	scanf("%s",s);
	len=strlen(s);
	dp[0][0][0]=1;
	for(int n=0;n<len;n++)for(int k=0;k<6;k++)for(int d=0;d<10;d++){
		int f;
		if(k==0&&d==5)f=1;
		else if(k==1&&d==1)f=2;
		else if(k==1&&d==5)f=1;
		else if(k==2&&d==5)f=5;
		else if(k==2&&d!=5)f=3;
		else if(k==3&&d==3)f=4;
		else if(k==3&&d==5)f=1;
		else if(k==4)f=4;
		else if(k==5&&d==3)f=4;
		else if(k==5&&d==1)f=2;
		else if(k==5&&d==5)f=1;
		else f=0;
		dp[n+1][1][f]+=dp[n][1][k];
		if(d<=s[n]-'0')dp[n+1][d<s[n]-'0'][f]+=dp[n][0][k];
	}
	printf("%lld\n",dp[len][0][4]+dp[len][1][4]);
}


Measured memory_bytes: 2108
n = int(input())

l = []
for i in range(n):
    tmp = list(input())
    tmp.sort()
    tmp = ''.join(tmp)
    l.append(tmp)

from collections import Counter
c = Counter(l)
num = sorted(list(c.values()), reverse = 1)

from math import factorial
def combinations_count(n, r):
    return factorial(n) // (factorial(n - r) * factorial(r))

ans = 0
for i in num:
    if i == 1:
        break
    else:
        ans += combinations_count(i, 2)

print(ans)


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

const int mod = 1000000007;
struct mint {
    ll x; // typedef long long ll;
    mint(ll x = 0)
        : x((x % mod + mod) % mod) {}
    mint operator-() const {
        return mint(-x);
    }
    mint &operator+=(const mint a) {
        if ((x += a.x) >= mod)
            x -= mod;
        return *this;
    }
    mint &operator-=(const mint a) {
        if ((x += mod - a.x) >= mod)
            x -= mod;
        return *this;
    }
    mint &operator*=(const mint a) {
        (x *= a.x) %= mod;
        return *this;
    }
    mint operator+(const mint a) const {
        return mint(*this) += a;
    }
    mint operator-(const mint a) const {
        return mint(*this) -= a;
    }
    mint operator*(const mint a) const {
        return mint(*this) *= a;
    }
    mint pow(ll t) const {
        if (!t)
            return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1)
            a *= *this;
        return a;
    }

    // for prime mod
    mint inv() const {
        return pow(mod - 2);
    }
    mint &operator/=(const mint a) {
        return *this *= a.inv();
    }
    mint operator/(const mint a) const {
        return mint(*this) /= a;
    }
};
istream &operator>>(istream &is, const mint &a) {
    return is >> a.x;
}
ostream &operator<<(ostream &os, const mint &a) {
    return os << a.x;
}

struct combination {
    vector<mint> fact, ifact;
    combination(int n)
        : fact(n + 1), ifact(n + 1) {
        assert(n < mod);
        fact[0] = 1;
        for (int i = 1; i <= n; i++)
            fact[i] = fact[i - 1] * i;
        ifact[n] = fact[n].inv();
        for (int i = n; i >= 1; --i)
            ifact[i - 1] = ifact[i] * i;
    }
    mint operator()(int n, int k) {
        if (k < 0 || k > n)
            return 0;
        k = min(k, n - k);
        return fact[n] * ifact[k] * ifact[n - k];
    }
};

int main(){
    int K;
    string S;
    cin >> K >> S;
    int n = S.length();

    mint ans = 0;
    combination c(n + K);
    rep(i, K + 1) {
        mint x = mint(25).pow(i);
        x *= c(i + n - 1, n - 1);
        x *= mint(26).pow(K - i);
        ans += x;
    }
    cout << ans << endl;
}

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

int main(void) {
  double n, k;
  cin >> n >> k;
  double ans = 0;
  for (int i = 1; i <= n; i++) {
    long double x = 1.0 / n;
    int cnt = i;
    while (k > cnt) {
      cnt *= 2;
      x /= 2;
    }
    ans += x;
  }
  cout << fixed << setprecision(11);
  cout << ans << '\n';
  return 0;
}

Measured memory_bytes: 3724