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

using namespace std;

bool arr[1002][1002];
vector<pair<int, int>> q ,nq;

int main(){

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

    //freopen("input.txt", "r", stdin);

    int n, m;

    cin >> n >> m;

    for(int i = 0; i < n; ++i){
        string a;
        cin >> a;
        for(int j = 0; j < m; ++j){
            if(a[j] == '#'){
                arr[i][j] = 1;
                q.push_back(make_pair(i, j));
            }
        }
    }

    int dist = 0;

    while(true){

        nq.clear();

        for(pair<int, int> state : q){
            int i = state.first, j = state.second;
            for(int x = -1; x < 2; ++x){
                if(i + x >= n || i + x < 0) continue;
                for(int y = -1; y < 2; ++y){
                    if((x != 0 && y != 0) || j + y >= m || j + y < 0 || arr[i + x][j + y]) continue;
                    arr[i + x][j + y] = 1;
                    nq.push_back(make_pair(i + x, j + y));
                }
            }
        }

        if(nq.empty())
            break;
        else
            dist++;

        swap(q, nq);

    }

    cout << dist;

    return 0;
}


Measured memory_bytes: 14948
#include "bits/stdc++.h"
#define rep(i,n) for(int i=0;i<n;i++)
#define ALL(v) (v).begin(),(v).end()
typedef long long LL;
const int INF = 1 << 25;
const LL MOD = 1000000007LL;
using namespace std;
typedef pair<int, int> P;
int cnt[100001];
int main() {
	int N;
	cin >> N;
	rep(i, N) {
		int A;
		cin >> A;
		cnt[A]++;
	}
	int odd = 0, even = 0;
	for (int i = 1; i <= 100000; i++) {
		if (cnt[i] == 0) continue;
		if (cnt[i] % 2 == 0) even++;
		else odd++;
	}
	if (even % 2 == 0) {
		cout << odd + even << endl;
	}
	else {
		cout << odd + even - 1 << endl;
	}
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); i++)
#define ALL(v) (v).begin(),(v).end()
using ll = long long;
using P = pair<int, int>;
const int INF = 1e9;
const long long LINF = 1e18;
const long long MOD = 1e9 + 7;

signed main(){
    int h,w;
    cin >> h >> w;
    string s[h][w];
    rep(i,h){
        rep(j,w){
            cin >> s[i][j];
        }
    }
    rep(i,h){
        rep(j,w){
            if(s[i][j] == "snuke"){
                cout << char('A' + j) << i + 1 << endl;
                return 0;
            }
        }
    }
    return 0;
}

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

using namespace std;

int main()
{
  locale loc;
  string pattern, text;
  cin >> pattern;
  for (auto &n : pattern)
    n = tolower(n, loc);

  int count = 0;
  while (cin >> text && text != "END_OF_TEXT")
  {
    for (auto &n : text)
      n = tolower(n, loc);
    if (text == pattern)
      count++;
  }
  cout << count << endl;
  return 0;
}

Measured memory_bytes: 3152
#include<iostream>
#include<algorithm>
const int INF=(1<<22);
int dp[1000000],d[20],n,m;
int main(){
	std::cin>>n>>m;
	std::fill(dp,dp+n+1,INF);dp[0]=0;
	for(int i=0;i<m;++i)std::cin>>d[i];
	for(int i=0;i<m;++i)for(int j=d[i];j<=n;++j){
		dp[j]=std::min(dp[j],dp[j-d[i]]+1);
	}std::cout<<dp[n]<<std::endl;
}

Measured memory_bytes: 1356
#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
//#include <regex>

/* g++ -g -std=c++0x */
/* g++ -g -std=c++11 */

using namespace std;

// freopen("input.txt", "rt", stdin);
// freopen("output.txt", "wt", stdout);

#define ALL(c)          (c).begin(), (c).end()
#define ALLR(c)         (c).rbegin(), (c).rend()
#define FOR(i,a,b)      for (int i=(a); i < (b); ++i)
#define FORR(i,a,b)     for (int i=(a); i > (b); --i)
#define FOR_ALL(i,c)    for (__typeof((c).begin()) i=(c).begin();   \
                             i != (c).end(); ++i)
#define FOR_ALLR(i,c)   for (__typeof((c).rbegin()) i=(c).rbegin(); \
                             i != (c).rend(); ++i)
#define SZ(array)       (sizeof(array)/sizeof(array[0]))
#define lc(x)           (x<<1)     /* 2*x */
#define rc(x)           (x<<1 | 1) /* 2*x+1 */
#define lowbit(x)       (x & (-x)) /* 0b10100 -> 0b100 */

typedef long long       LL;
typedef map<int,int>    MII;
typedef pair<int,int>   PII;
typedef set<int>        SI;
typedef vector<bool>    VB;
typedef vector<double>  VD;
typedef vector<int>     VI;
typedef vector<string>  VS;

/* check if a key is in container C */
template <class C>
inline bool in_(const typename C::key_type& k, const C& A)
{ return A.find(k) != A.end(); }
inline bool in_(const string& s, const string& S)
{ return S.find(s) != string::npos; }


const int maxn = 510;

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


Measured memory_bytes: 256
#include <iostream>
#include <array>
#include <map>
#include <algorithm>
#include <cmath>
#include <vector>
#include <fstream>
#include <string>
#include <random>
#include <queue>
#include <iomanip>
#include <functional>
#include <climits>
#include <tuple>
#include <unordered_map>
#include <limits>
#include <functional>
#include <cassert>

#define FOR(x,n) for(int x = 0; x < n; x++)
#define PUT(x) cout << x << endl
#define DPUT(x) printf("%.15lf\n",x)
#define GET(x,y) std::get<x>(y)
#define CHMAX(x,y) x = std::max(x,y)
#define CHMIN(x,y) x = std::min(x,y)

using namespace std;

using ll = long long int;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vll = std::vector<ll>;
using vpll = std::vector<pll>;
using vpii = std::vector<pii>;
using vi = std::vector<int>;
using vvi = std::vector<vi>;
using vvpii = std::vector<vpii>;
using vch = std::vector<char>;
using vvch = std::vector<vch>;
using tiii = std::tuple<int, int, int>;

const ll mod197 = 1000000007LL;
const ll INF = 10000000000LL;

const double PI11 = 3.14159265359;

const int dis[5] = { 0,1,0,-1,0 };

const int disD[4] = { 0,1,1,0 };

ll a[100001] = {};

int main(void)
{
	ll k,left,right;
	cin >> k;

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

	reverse(a,a+k);

	if (a[0] == 2) {
		left = 2;
		right = 3;

		for (int i = 0; i < k; i++) {
			ll l = (left + a[i] - 1) / a[i] * a[i];
			ll r = (right) / a[i] * a[i];
			r += (a[i] - 1);

			if (!(left <= l / a[i] * a[i] && l / a[i] * a[i] <= right)) {
				cout << -1 << endl;
				return 0;
			}
			if (!(left <= r / a[i] * a[i] && r / a[i] * a[i] <= right)) {
				cout << -1 << endl;
				return 0;
			}

			left = l;
			right = r;
		}

		cout << left << " " << right << endl;

	}
	else {
		cout << -1 << endl;
	}

	return 0;
}



Measured memory_bytes: 1024
#pragma GCC optimize ("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse4")
#include"bits/stdc++.h"
using namespace std;
typedef long long ll;
#define int ll
#define all(x) x.begin(), x.end()
#define trav(i,a) for(auto &i:a) 
inline int in(){int x;scanf("%lld",&x);return x;}
int32_t main()
{
	int s=in();
	cout<<"0 0 ";
	int x2=1;
	int sq=sqrt(s);
	if(sq*sq==s)
	{
		cout<<"1 "<<sq<<" "<<sq<<" 0";
		return 0;
	}
	
	int y3=(sq+1)*(sq+1)-s;
	cout<<"1 "<<sq+1<<" "<<sq+1<<" "<<y3;
	
}


Measured memory_bytes: 3676
#include<stdio.h>
int main ()
{
      int a,b,d,r;
    double f;
    scanf("%d%d",&a,&b);
    d=a/b;
    r=a%b;
    f=(double)a/(double)b;
    printf("%d %d %.5f\n",d,r,f);
    }



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

int main(){
    string str;
    cin>>str;
    if(str[0] == str[1] && str[2]==str[3] && str[0] != str[2])
        cout<<"Yes"<<endl;
    else if(str[0] == str[2] && str[1]==str[3] && str[0]!=str[1])
        cout<<"Yes"<<endl;
    else if(str[0] == str[3] && str[1]==str[2] && str[0] != str[1])
        cout<<"Yes"<<endl;
    else 
        cout<<"No"<<endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define PI acos(-1)
typedef  long long ll;
ll gcd(ll x,ll y){
   if(y==0) return x;
   else return gcd(y,x%y);
}
ll lcm(ll x,ll y){
   return x/gcd(x,y)*y;
}
using namespace std;

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

  rep(i,3){
     cout<<s[i];
  }


return 0;
}


Measured memory_bytes: 3624
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <numeric>
#include <cmath>
#include <cassert>
#include <iomanip>
#include <bitset>


using namespace std;

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

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

const ll mod = 1e9+7;
const ll INF = 1e9;

ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

int main()
{
	int n,m;
	cin>>n>>m;
	vector<vector<int>> g(n,vector<int>());
	rep(i,m){
		int a,b;
		cin>>a>>b;
		a--;b--;
		g[a].push_back(b);
	}

	vector<int> ans;
	rep(i,n){
		queue<int> que;
		vector<int> prev(n),visited(n,0);
		que.push(i);
		visited[i]++;
		int last=-1;
		// cout<<"root = "<<i+1<<endl;
		bool flag=false;
		while(!que.empty()){
			int p = que.front();que.pop();
			// cout<<p+1<<" ";
			for(auto x:g[p]){
				if(visited[x]==0)que.push(x),prev[x]=p,visited[x]++;
				if(x==i){last=p,prev[x]=p,flag=true;}
			}
			if(flag)break;
		}
		// cout<<endl;
		if(last>=0){
			vector<int> path;
			set<int> s;
			int now = last;
			// cout<<"root = "<<i+1<<endl;
			while (1){
				// s.insert(now);
				path.push_back(now);
				// cout<<now+1<<" ";
				if(now==i)break;
				now = prev[now];
			}
			// cout<<endl;
			reverse(all(path));
			bool flag=true;
			for(auto v:path){
				// cout<<"v= "<<v<<endl;
				s.insert(v);
				for(auto u:g[v]){
					if(s.count(u)>0){
						if(v==last&&u!=i) flag=false;
						if(v!=last) flag=false;
					}
				}
			}
			// for(auto x:s)cout<<x+1<<" ";
			// cout<<endl;
			// for(auto x:s){
			// 	for(auto p:g[x]){
			// 		if(s.count(p)>0 &&p<x && p!=i){
			// 			flag=false;
			// 			// cout<<p+1<<" "<<x+1<<endl;
			// 		}
						
			// 	}
			// }
			if(flag){
				cout<<s.size()<<endl;
				for(auto x:s)cout<<x+1<<endl;
				return 0;
			}
		}
	}
	
	cout<<-1<<endl;
	return 0;
	// cout<<ans.size()<<endl;
	// for(auto x:ans)cout<<x+1<<endl;

	return 0;
}

Measured memory_bytes: 384
// time out
object Main extends App {
  val inputs: Seq[String] = scala.io.Source.stdin.getLines().toList
  val n = inputs.head.toInt

  println(solve(n))

  def solve(n: Int): Long = {
    val nums = scala.collection.mutable.ArrayBuffer.fill(0)(n+1)
    var ans = 0L

    (1 to n).foreach { i =>
      ans = ans + i * sumAll(n/i)
    }

    return ans
  }

  private def sumAll(n: Int): Long = {
    (n * (n + 1L)) / 2
  }
}

Measured memory_bytes: 58564
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class Main {
	static List<Integer> path;

	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] a = new int[n];
		String[] sa = br.readLine().split(" ");
		for (int i = 0; i < n; i++) {
			a[i] = Integer.parseInt(sa[i]);
		}
		br.close();

		Set<Integer> set = new HashSet<Integer>();
		for (int i = 0; i < n; i++) {
			set.add(a[i]);
		}

		int ans = set.size();
		if (ans % 2 == 0) {
			ans--;
		}
		System.out.println(ans);
	}
}


Measured memory_bytes: 43816
#include<stdio.h>
    #include<string.h>
    #define LENGTH 100005
    typedef struct pp{
        char name[100];
        int t;
        } P;

        P Q[LENGTH];
        int head,tail,n;
        void enqueue(P x){
            Q[tail] = x;
            tail = (tail + 1) % LENGTH;
        }

        P dequeue(){
            P x = Q[head];
            head = (head + 1) % LENGTH;
            return x;
        }

        int min(int a,int b){
            return a < b ? a : b;
        }

        int main(){
            int elaps = 0,c;
            int i,q;
            P u;
            scanf("%d %d",&n,&q);


        for(i = 1;i <= n;i++){
            scanf("%s",Q[i].name);
            scanf("%d",&Q[i].t);
        }
        head = 1;
        tail = n + 1;
        while(head != tail){
            u = dequeue();
            c = min(q,u.t);
            u.t -= c;
            elaps += c;
            if(u.t > 0)enqueue(u);
            else{
                printf("%s %d\n",u.name,elaps);
            }
        }
        return 0;
        }


Measured memory_bytes: 12012
#include "iostream"
#include <stdio.h>
#include <algorithm>
#include <stdlib.h>
#include <cstring>
#include <math.h>
#include <cctype>
#include <stack>
#include <vector>
#include <list>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <iomanip>
using namespace std;
using ll=long long;
#define MOD  1000000007


int main(int argc, char const *argv[]) {
  int n,p[15];
  std::cin >> n;
  for(int i=0; i<n; i++) std::cin >> p[i];
  sort(p,p+n);
  int ans=0;
  for(int i=0; i<n-1; i++) ans+=p[i];
  ans=ans+p[n-1]/2;
  std::cout << ans << '\n';
  return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
       System.out.println(lucas(n));
    }
    
    public static long lucas(int n){
        long ans = 0;
        long L_2 = 2;
        long L_1 = 1;
       if(n==0) return 2;
       else if(n==1) return 1;
       else{
           for (int i=0;i<n-1;i++){
               ans = L_2 + L_1;
               L_2 = L_1;
               L_1 = ans;
           }
           return ans;
       }
    }
}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << (x) << endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){
	return o<<"("<<p.fs<<","<<p.sc<<")";
}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){
	o<<"{";
	for(const T& v:vc) o<<v<<",";
	o<<"}";
	return o;
}
using ll = long long;
template<class T> using V = vector<T>;
template<class T> using VV = vector<vector<T>>;
bool B(int x,int i){return (x>>i)&1;}
int N;
ll a[16][16];
ll cost[1<<16];
ll dp[1<<16];
int main(){
	cin>>N;
	rep(i,N) rep(j,N) cin>>a[i][j];
	rep(b,1<<N){
		rep(i,N) if(B(b,i)){
			rep(j,i) if(B(b,j)){
				cost[b] += a[i][j];
			}
		}
	}
	rep(b,1<<N){
		int lef = (1<<N)-1-b;
		for(int s = lef;s!=0;s=(s-1)&lef){
			chmax(dp[b+s],dp[b] + cost[s]);
		}
	}
	cout<<dp[(1<<N)-1]<<endl;
}

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

int main()
{

        int N, M;
        cin >> N >> M;
        vector<vector<int>> G(N);
        for (int i = 0; i < M; ++i){
                int a, b;
                cin >> a >> b;
                G[a-1].push_back(b-1);
                G[b-1].push_back(a-1);
        }
#if 0
        for (int i = 0; i < N; ++i) {
                int len = G[i].size();
                for (int j = 0; j < len; ++j){
                        cout << G[i][j] << " ";
                }
                cout << endl;
        }
#endif
        vector<int> dist(N, -1);
        queue<int> que;

        dist[0] = 0;
        que.push(0);
        int num = 1;

        while (1) {
                if (que.empty()) break;

                int v = que.front();
                que.pop();

                int l = G[v].size();
                for (int i = 0; i < l; ++i) {
                        int nv = G[v][i];
                        if (dist[nv] != -1) continue;
                        dist[nv] = v+1;
                        que.push(nv);
                        num++;
                }
        }
        if (num != N) {
                cout << "No" << endl;
        }
        else {
                cout << "Yes" << endl;
                for (int i = 1; i < N; ++i) {
                        cout << dist[i] << endl;
                }
        }


}


Measured memory_bytes: 10260
#include <bits/stdc++.h>
//#pragma GCC optimize(2)
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
#define rep(i,a,b) for(int i = (a);i <= (b);i++)
#define pii pair<int,int>
#define pll pair<long long, long long>
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll mod = 1e9 + 7;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const int inf = 0x3f3f3f3f;
const int maxn = 2e5 + 5;
const double eps = 1e-8;
const double pi = acos(-1.0);	
ll gcd(ll a,ll b){return !b?a:gcd(b,a%b);}
ll lcm(ll a,ll b){return a * b / gcd(a,b);}
ll poww(ll x,ll y,ll p){ll ans = 1;while(y){if(y & 1) ans = ans * x % p;x = x * x % p;y >>= 1;}return ans % p;}
bool isp(ll x){if(x < 2) return 0; for(ll i = 2;i * i <= x;i++){if(x % i == 0) return 0;}return 1;}
int n,m,a[maxn],sum;
void solve(){
	if(sum > n) cout << -1 << endl;
	else cout << n - sum << endl;
}
int main(){
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	cin >> n >> m;
	rep(i,0,m-1){
		cin >> a[i];	
		sum += a[i];
	}
	solve();	
	return 0;
}
//do smt instead of nothing! never give up!

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

using namespace std;

const int maxN = 1003;
const int M = 1e9+7;

char C[maxN][maxN];
long long DP[maxN][maxN];

void solve() {
    int h, w;
    cin >> h >> w;
    for(int i = 0; i < h; i++)
    for(int j = 0; j < w; j++){
        cin >> C[i][j];
    }
    DP[0][0] = 1;
    for(int i = 0; i < h; i++){
        for(int j = 0; j < w; j++){
            if(C[i][j] == '#') continue;
            if(j > 0) DP[i][j] = (DP[i][j] + DP[i][j-1])%M;
            if(i > 0) DP[i][j] = (DP[i][j] + DP[i-1][j])%M;
        }
    }
    cout << DP[h-1][w-1] << "\n";
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

    bool multitest = false;
    //multitest = true;
    if (multitest) {
        int t; cin >> t;
        while (t--)
            solve();
    }
    else
        solve();
}


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

int main()
{
	int n;
	cin >> n;
	vector<pair<int,int>> vp(n);
	for(int i = 0;i<n;i++)
	{
		int x,y;
		cin >> x ;
		vp[i] = make_pair(x,i+1);
	}
	sort(vp.begin(),vp.end());
	for(int i = 0;i<n;i++)
	{
		if(i)cout<<' ';
		cout<<vp[i].second;
	}
	cout<<endl;
	return 0;
}

Measured memory_bytes: 1664
/*Ankon Ghosh
  KUET,ECE 2K16*/
#include<bits/stdc++.h>
/*#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
///#include <ext/pb_ds/detail/standard_policies.hpp>*/
///using namespace __gnu_pbds;
using namespace std;
using ll=long long;
#define inf 1e16
#define MAX 100005
#define mod 998244353
#define sf(a) scanf("%lld",&a)
#define sff(a,b) scanf("%lld %lld",&a,&b)
#define sfff(a,b,c) scanf("%lld %lld %lld",&a,&b,&c)
#define Case(i) printf("Case %lld: ",i)
#define setpre(number) cout<<fixed<<setprecision(10)<<number<<endl
#define pf(a) printf("%lld ",a)
#define pff(a,b) printf("%lld %lld\n",a,b)
#define FOR(i,n) for(ll i=0;i<n;i++)
#define FOR1(i,n) for(ll i=1;i<=n;i++)
#define LOOP(x,y) for(ll i=x;i<=y;i++)
#define RFOR(i,n) for(ll i=n-1;i>=0;i--)
#define RFOR1(i,n) for(ll i=n;i>0;i--)
#define RLOOP(x,y) for(ll i=y;i>=x;i--)
#define m_p make_pair
#define ff first
#define ss second
#define p_b push_back
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL)
#define output freopen("output.txt","w",stdout)
map<ll,ll>mp1,mp;
vector<pair<ll,pair<ll,ll> > >vpp1;
vector<pair<ll,ll> >vpp,vp1;
vector<ll>v,v1,v2,fin;
map<pair<ll,ll>,bool>mbb;
map<ll,bool>mb;
ll a,b,c,n,d,e,f,ta,sum=0,cnt=0,m,l,req,sz,maxi,k;
bool sortbysec(const pair<pair<ll,ll>,ll> &a,const pair<pair<ll,ll>,ll> &b)
{
    return (a.second < b.second);
}
int main()
{
    fast;
    cin>>n;
    map<string,ll>ss;
    FOR(i,n)
    {
        string s;
        cin>>s;
        ss[s]++;
    }
    cout<<"AC x "<<ss["AC"]<<endl;
    cout<<"WA x "<<ss["WA"]<<endl;
    cout<<"TLE x "<<ss["TLE"]<<endl;
    cout<<"RE x "<<ss["RE"]<<endl;
    //cout<<min(0LL,1000-(n%1000LL))<<endl;
    return 0;
}


Measured memory_bytes: 3664
#include<iostream>
using namespace std;
int main(){
    while(1){
    int H,W;
    cin>>H>>W;
    if(H==0&&W==0) break;
    
   
   for(size_t i = 0; i < H; i++)
   {
       
       for(size_t j = 0; j < W; j++)
       {
           cout<<"#";
       }
       cout<<endl;
       
   }
   cout<<endl;
    }
   
    
}


Measured memory_bytes: 3100
#include <bits/stdc++.h>
using namespace std;
//関数
const long INF=10000000000;

void display(long j,vector<long> x){
    cout<<"data "<<j<<" display_start"<<endl;
    for(int i=0;i<x.size();i++){
        cout<<x.at(i)<<" ";
    }
    cout<<endl<<"display_end"<<endl<<endl;
}


//main
int main() {
    
    //入力
    long A,B,K;
    cin>>A>>B>>K;
    
    
    //計算
    long G=__gcd(A,B);
    long count=1;
    long ans=G;
    while(count<K){
        ans--;
        if(G%ans==0) count++;
    }
    
    
    
    
    //出力
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;
char s[200001],c,d;
struct querys
{
    char c;
    int dir;
} v[200001];
int n,q,i,p,u,m,solst,soldr,mm;
int main()
{
    cin>>n>>q;
    cin>>s;
    for(i=1; i<=q; i++)
    {
        cin>>c>>d;
        v[i].c=c;
        if(d=='L')v[i].dir = 0;
        else v[i].dir = 1;
    }
    int p=1,u=n;
    while(p <= u)
    {
        m=(p+u)/2;
        mm=m;
        for(i=1; i<=q; i++)
        {
            if(1<=m&&m<=n)
            {
                if(v[i].c==s[m-1])
                {
                    if(v[i].dir==0)m--;
                    else m++;
                }
            }
            else i=q+1;
           // cout<<i<<" ";
        }



        if(m==0)
        {
            p=mm+1;
            solst=mm;
        }
        else u=mm-1;

    }

    p=1;
    u=n;
    while(p <= u)
    {
        m=(p+u)/2;
        mm=m;
        for(i=1; i<=q; i++)
        {
            if(1<=m&&m<=n)
            {
                if(v[i].c==s[m-1])
                {
                    if(v[i].dir==0)m--;
                    else m++;
                }
            }
            else i=q+1;

        }


        if(m==n+1)
        {
            u=mm-1;
            soldr=mm;
        }
        else p=mm+1;
        // cout<<p<<" "<<u<<" "<<m<<'\n';
    }
    if(solst==0)
    {
        cout<<soldr-1<<'\n';
    }
    else if(soldr==0)
    {
        cout<<n-solst<<'\n';
    }
    else if(solst>=soldr)cout<<0<<'\n';
    else cout<<soldr-solst-1<<'\n';
    return 0;
}


Measured memory_bytes: 2048
/*
 ▓█████▄  ▄████▄  ▓██   ██▓ ██▓███   ██░ ██ ▓█████  ██▀███
▒██▀ ██▌▒██▀ ▀█   ▒██  ██▒▓██░  ██▒▓██░ ██▒▓█   ▀ ▓██ ▒ ██▒
 ░██   █▌▒▓█    ▄   ▒██ ██░▓██░ ██▓▒▒██▀▀██░▒███   ▓██ ░▄█ ▒
 ░▓█▄   ▌▒▓▓▄ ▄██▒  ░ ▐██▓░▒██▄█▓▒ ▒░▓█ ░██ ▒▓█  ▄ ▒██▀▀█▄
 ░▒████▓ ▒ ▓███▀ ░  ░ ██▒▓░▒██▒ ░  ░░▓█▒░██▓░▒████▒░██▓ ▒██▒
  ▒▒▓  ▒ ░ ░▒ ▒  ░   ██▒▒▒ ▒▓▒░ ░  ░ ▒ ░░▒░▒░░ ▒░ ░░ ▒▓ ░▒▓░
  ░ ▒  ▒   ░  ▒    ▓██ ░▒░ ░▒ ░      ▒ ░▒░ ░ ░ ░  ░  ░▒ ░ ▒░
  ░ ░  ░ ░         ▒ ▒ ░░  ░░        ░  ░░ ░   ░     ░░   ░
    ░    ░ ░       ░ ░               ░  ░  ░   ░  ░   ░
  ░      ░         ░ ░
*/
//focus less on how much problem you should solve within a fixed time and focus more on getting the problem solved and
//learning something from it
#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;
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define rep(i,a,b) for(ll i=a; i<b; i++)
#define per(i,a,b) for(ll i=a; i>=b; i--)
#define ll unsigned long long int
#define ld long double
#define vi vector<ll>
#define vii vector <pair<ll,ll> >
#define sedes set <ll, greater <ll> >
#define seasc set <ll>
#define pb push_back
#define mkp make_pair
#define ff first
#define ss second
#define MOD 1000000007
#define prec(n) fixed<<setprecision(n)
#define maxpq priority_queue<int>
#define minpq priority_queue<int, vector<int>, greater<int> >
#define umap unordered_map<ll, ll>
#define map map<ll, ll>
#define autoit(x,it) for(auto it = x.begin(); it != x.end(); it++)
#define mems(a, i) memset(a, i, sizeof(a))
#define endl '\n'
#define all(v) v.begin(),v.end()
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) ((a)*(b))/gcd((a),(b))
#define deba(a) cout << #a << " " << a << endl;
ll mod(ll x) {return ((x % MOD + MOD) % MOD);}
ll modadd(ll a, ll b) {return mod(mod(a) + mod(b));}
ll modmul(ll a, ll b) {return mod(mod(a) * mod(b));}

int main()
{
	fast;
#ifndef ONLINE_JUDGE
	freopen("/home/kushagra/Desktop/Kushagra/input.txt", "r", stdin);
	freopen("/home/kushagra/Desktop/Kushagra/output.txt", "w", stdout);
#endif
	int t = 1;
	// cin >> t;
	while (t--)
	{
		ll n;
		cin >> n;
		ll a[n];
		rep(i, 0, n)
		cin >> a[i];

		vi suff(n + 1);
		for (int i = n - 1; i >= 0; i--)
		{
			suff[i] = suff[i + 1] + a[i];
		}

		// rep(i, 0, n)
		// cout << suff[i] << " ";

		ll ans = 0;
		for (int i = 0; i < n; i++)
		{
			ans = modadd(ans, modmul(a[i], suff[i + 1]));
		}
		cout << ans;
	}
	return 0;
}


Measured memory_bytes: 6312
# region header
import sys
import math
from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, deque, Counter
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from heapq import heappop, heappush
from itertools import accumulate, groupby, product, permutations, combinations, combinations_with_replacement
from math import ceil, floor, factorial, log, sqrt, sin, cos
from operator import itemgetter
from string import ascii_lowercase, ascii_uppercase, digits
sys.setrecursionlimit(10**7)
rs = lambda: sys.stdin.readline().rstrip()
ri = lambda: int(rs())
rf = lambda: float(rs())
rs_ = lambda: [_ for _ in rs().split()]
ri_ = lambda: [int(_) for _ in rs().split()]
rf_ = lambda: [float(_) for _ in rs().split()]
INF = float('inf')
MOD = 10 ** 9 + 7
PI = math.pi
# endregion
A, B = ri_()
S = rs()
f = 0
if len(S) == A + B + 1 and S[A] == '-' and all([i in digits for i in S[:A]+S[A+1:]]):
    f = 1
print('Yes' if f else 'No')

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

using namespace std;

int C(int N, vector<int>& X) {
	int s, d;
	s = 0;
	d = round((double) accumulate(X.begin(), X.end(), 0) / N);

	for (int& x: X)
		s += (x - d) * (x - d);
	
	return s;
}

int main() {
	int N;
	cin >> N;
	vector<int> X(N);
	for (int i = 0; i < N; i++)
		cin >> X[i];
	cout << C(N, X);
	return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-

def io_generator():
	return input()

#+++++++++++++++++++

def main(io):
	n,m,c= map(int, io().split())
	bs= list(map(int, io().split()))
	ret=0
	for _ in range(n):
		a_s= list(map(int, io().split()))
		ll=[a*b for a,b in zip(a_s,bs)]
		if sum(ll)+c>0:
			ret +=1
		
	return ret

#++++++++++++++++++++

if __name__ == "__main__":
	io= lambda : io_generator()
	print (main(io))

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) FOR(i,0,n)
typedef long long ll;
int main(){

	string s;
	cin >> s;

	bool flag = true;

	if (s[5] == '1') {
		flag = false;
	} else if (s[6] == '5' || s[6] == '6' || s[6] == '7' || s[6] == '8'||s[6] == '9') {
		flag = false;
	} 
	if (flag) {
		cout << "Heisei" << endl;
	} else {
		cout << "TBD" << endl;
	}
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int n,ans;
string s1,s2;
void dfs(int x,int d){
  if(s1==s2)ans=min(ans,x);
  else if(d==n)return;
  else{
    if(s1[d]==s2[d])dfs(x,d+1);
    else{
      int a;
      for(int i=1;i<10;i++){
        int q=s1[d]-'0',w=s2[d]-'0';
        if((q+i)%10==w){
          a=i;
          break;
        }
      }
      for(int i=1;i<=n-d;i++){
        string pp=s1;
        for(int j=d;j<d+i;j++){
          s1[j]+=a;
          if(s1[j]>'9')s1[j]-=10;
        }
        dfs(x+1,d+1);
        s1=pp;
      }
    }
  }
}
int main(){
  while(cin>>n,n){
    cin>>s1>>s2;
    ans=1e9;
    dfs(0,0);
    cout<<ans<<endl;
  }
}

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

int main(){
    ll h,w;
    cin>>h>>w;
    ll ans=LONG_LONG_MAX;
    rep(i,h-1){
        ll a=w*(i+1);
        ll nh=h-(i+1);
        ll b1=((nh+1)/2)*w,c1=(nh/2)*w;
        ll b2=((w+1)/2)*nh,c2=(w/2)*nh;
        ll d1=max({a,b1,c1})-min({a,b1,c1});
        ll d2=max({a,b2,c2})-min({a,b2,c2});
        ans=min({ans,d1,d2});
    }
    rep(i,w-1){
        ll a=h*(i+1);
        ll nw=w-(i+1);
        ll b1=((nw+1)/2)*h,c1=(nw/2)*h;
        ll b2=((h+1)/2)*nw,c2=(h/2)*nw;
        ll d1=max({a,b1,c1})-min({a,b1,c1});
        ll d2=max({a,b2,c2})-min({a,b2,c2});
        ans=min({ans,d1,d2});
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 3608
import itertools
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush
from fractions import gcd
from copy import deepcopy
import math
import queue
#import numpy as np
#import sympy as syp(素因数分解とか)
Mod = 1000000007
import sys

sys.setrecursionlimit(100000) 
  
def sieve_of_eratosthenes(n):
    if not isinstance(n,int):
        raise TypeError("n is not int")
    if n<2:
        raise ValueError("n is not effective")
    prime = [1]*(n+1)
    for i in range(2,int(math.sqrt(n))+1):
        if prime[i] == 1:
            for j in range(2*i,n+1):
                if j%i == 0:
                    prime[j] = 0
    res = []
    for i in range(2,n+1):
        if prime[i] == 1:
            res.append(i)
    return res

def factorial(i):
    if i == 1:
        return 1
    else:
        return i*factorial(i-1)
 
class UnionFind:
    def __init__(self,n):
        self.parent = [i for i in range(n+1)]
        self.rank = [0 for i in range(n+1)]
    
    def findroot(self,x):
        if x == self.parent[x]:
            return x
        else:
            y = self.parent[x]
            y = self.findroot(self.parent[x])
            return y
    
    def union(self,x,y):
        px = self.findroot(x)
        py = self.findroot(y)
        if px < py:
            self.parent[py] = px
        else:
            self.parent[px] = py
 
    def same_group_or_no(self,x,y):
        return self.findroot(x) == self.findroot(y)




def main(): #startline--------------------------------------------
    a,b = input().split()
    p = [a*int(b),b*int(a)]
    p.sort()
    print(p[0])
if __name__ == "__main__":
    main() #endline===============================================
    

Measured memory_bytes: 5684
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned int u32;
typedef pair<int, int> p;
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; }
int Inf = (1<<30);
ll inf = (1LL<<60);
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
int main() {
	int n;
	cin >> n;
	int count = 0;
	int subcount = 0;
	for (int i = 0; i < n; i++) {
		int a;
		cin >> a;
		if (a % 4 == 0) count++;
		else if (a % 2 == 0) subcount++;
	}
	count += subcount / 2;
	if (n / 2 <= count) cout << "Yes";
	else cout << "No";
	return 0;
}

Measured memory_bytes: 256
n, m = map(int, input().split())
route = [[] for _ in range(n)]
check = [0]*n
for _ in range(m):
    a, b = map(int, input().split())
    route[a-1].append(b-1)
pos = [0]
for i in range(2):
    # print(pos)
    tmp = list()
    for p in pos:
        for r in route[p]:
            if r == n-1:
                print('POSSIBLE')
                exit()
            if check[r-1] == 0:
                tmp.append(r)
                check[r-1] == 1
    pos = tmp

print('IMPOSSIBLE')


Measured memory_bytes: 35800
#include<bits/stdc++.h>
#define MOD 1000000007
using namespace std;

int n,m,mul=1;

int f(int num) {
  int res=1;
  for(int i=2;i<=num;i++) {
    res=1ll*res*i%MOD;
  }
  return res;
}

int main() {
  scanf("%d %d",&n,&m);
  if(n<m) swap(n,m);
  if(n-m>1) {
    printf("0");
    return 0;
  }
  if(n==m) mul=2;
  printf("%d",1ll*f(n)*f(m)%MOD*mul%MOD);
}


Measured memory_bytes: 256
package main

import (
	"bufio"
	"bytes"
	"fmt"
	"log"
	"os"
	"strconv"
)

// const abcd = "abcdefghijklmnopqrstuvwxyz"
// const ABCD = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
var dr = [...]int{0, 1, 1, 1, 0, -1, -1, -1, 0}
var dc = [...]int{1, 1, 0, -1, -1, -1, 0, 1, 0}

func main() {
	log.SetFlags(log.Lshortfile)
	nextReader = NewScanner()
	N := nextInt()
	i := nextInt()
	fmt.Println(max(1, N-i+1))
}

func max(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r < a[i] {
			r = a[i]
		}
	}
	return r
}
func min(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r > a[i] {
			r = a[i]
		}
	}
	return r
}
func sum(a []int) (r int) {
	for i := range a {
		r += a[i]
	}
	return r
}
func minmax(a, b int) (int, int) {
	if a > b {
		return b, a
	}
	return a, b
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func printInts(out []int, str string) {
	var bb bytes.Buffer
	for i := range out {
		bb.WriteString(strconv.Itoa(out[i]))
		bb.WriteString(str)
	}
	fmt.Println(bb.String())
}

var nextReader func() string

func NewScanner() func() string {
	r := bufio.NewScanner(os.Stdin)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)
	return func() string {
		r.Scan()
		return r.Text()
	}
}
func nextString() string {
	return nextReader()
}
func nextInt64() int64 {
	v, _ := strconv.ParseInt(nextReader(), 10, 64)
	return v
}
func nextInt() int {
	v, _ := strconv.Atoi(nextReader())
	return v
}
func nextInts(n int) []int {
	r := make([]int, n)
	for i := 0; i < n; i++ {
		r[i] = nextInt()
	}
	return r
}
func nextFloat64() float64 {
	f, _ := strconv.ParseFloat(nextReader(), 64)
	return f
}

Measured memory_bytes: 640
from itertools import combinations_with_replacement
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

def main():
    N,M,Q = map(int, readline().split())
    abcd = []
    for _ in range(Q):
        a,b,c,d = map(int, readline().split())
        abcd.append((a,b,c,d))

    C = combinations_with_replacement(range(1,M+1), N)
    
    ans = 0
    for A in C:
        tmp = 0
        for a,b,c,d in abcd:
            if A[b-1] - A[a-1] == c:
                tmp += d
        ans = max(ans, tmp)

    print(ans)
    

if __name__ == "__main__":
    main()


Measured memory_bytes: 9212
#include <iostream>
#include <vector>

using namespace std;

int findGroup(int N){
    for(int i=2;;i++){
        int sum = i*(i-1)/2;
        if(sum == N) return i;
        if(sum > N) return -1;
    }
    return -1;
}

vector<vector<int>> solve(int N){
    int group = findGroup(N);
    if(group == -1 || 2*N%group != 0) return vector<vector<int>>();
    vector<vector<int>> res(group, vector<int>(group-1, 0));
    int v = 1;
    for(int i=0;i<group-1;i++){
        for(int j=i;j<group-1;j++){
            res[i][j] = res[j+1][i] = v;
            ++v;
        }
    }
    return res;
}

int main(){
    int N;
    while(cin >> N){
        auto res = solve(N);
        if(res.empty()){
            cout << "No" << endl;
        } else {
            cout << "Yes" << endl;
            cout << res.size() << endl;
            for(auto& v : res){
                cout << v.size();
                for(auto& t : v) cout << " " << t;
                cout << endl;
            }
        }
    }
}

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

int main() {
    int N; cin >> N;
    vector<string> S(N);
    vector<int> T(N);
    rep(i, N) {
        cin >> S[i] >> T[i];
    }
    int ans = accumulate(T.begin(), T.end(), 0);
    string x; cin >> x;
    rep(i, N) {
        ans -= T[i];
        if(S[i] == x) {
            cout << ans << '\n';
            return 0;
        }
    }
    return 0;
}


Measured memory_bytes: 256
n=int(input())
h=list(map(int, input().split()))

count = [0] * (n+1)

for i in range(1,n):
    if h[i-1] >= h[i]:
        count[i] = count[i-1] + 1
    else:
        count[i] = 0
print(max(count))

Measured memory_bytes: 14224
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
#include<cmath>
#include<bitset>
#include<queue>
#define ll long long
#define itn int
#define co(ans) cout<<ans<<endl;
#define COYE cout<<"YES"<<endl;
#define COYe cout<<"Yes"<<endl;
#define COye cout<<"yes"<<endl;
#define CONO cout<<"NO"<<endl;
#define CONo cout<<"No"<<endl;
#define COno cout<<"no"<<endl;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n)  FFOR(i,1,n)
#define SORT(V) sort((V).begin(),(V).end())
#define REVERSE(V) reverse((V).begin(),(V).end())
#define INF ((1LL<<62)-(1LL<<31))
#define MOD 1000000007
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; }
using namespace std;


int main(){
  ll N,ans=INF,L=INF,sum=0;
  cin>>N;
  ll A[N];
  REP(i,N){
    cin>>A[i];
    sum+=A[i];
  }
  
  ll t=0,n=0;
  for(int i=0; i<N; ++i){
    t+=A[i];
    if(L>abs(2*t-sum)){
      L=abs(2*t-sum);
      ans=min(ans,L);
    }
  }
  
  co(ans);
}

Measured memory_bytes: 1792
#include "bits/stdc++.h"
using namespace std;

#define ASC(vec) vec.begin(), vec.end()		// 昇順ソート 例：sort(ASC(vec));
#define DESC(vec) vec.rbegin(), vec.rend()	// 降順ソート 例:sort(DESC(vec));
#define rep(i, n) for(int i = 0; i < n; i++)
#define Rep(i, n) for(int i = 1; i < n; i++)
#define In(vec) rep(i, n) cin>>vec[i];
#define Ans(s) cout << s << endl

const int mod = 1000000007;
const int inf = (int)1e9 + 7;
const long long INF = 1LL << 60;

typedef long long ll;
typedef vector<int> inv;

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

ll GCD(ll a, ll b) { return b ? GCD(b, a % b) : a; }
int round_int(int a, int b) { return (a + (b - 1)) / b; }


// 4,8方向に探索する際に用いる配列
//int dx[4] = { 0,  0, 1, -1 };
//int dy[4] = { 1, -1, 0,  0 };
int dx[8] = { 1, 0, -1,  0, 1, -1, -1,  1 };
int dy[8] = { 0, 1,  0, -1, 1,  1, -1, -1 };

constexpr auto MAX = 100010;

// ────────────────────────────────────────────────────

int main()
{
	ll ans = INF;

	int d, g;
	cin >> d >> g;

	vector<int> p(d);
	vector<int> c(d);

	rep(i, d) cin >> p[i] >> c[i];

	rep(bit, (1 << d))
	{
		ll cnt = 0;
		ll score = 0;

		rep(i, d)
		{
			if ((bit >> i) & 1)
			{
				score += (i + 1) * p[i] * 100 + c[i];
				cnt += p[i];
			}
		}

		if (score >= g) ans = min(ans, cnt);
		
		bool ok = false;

		for (int i = d - 1; i >= 0; i--)
		{
			if (ok) break;
			if ((bit >> i) & 1) continue;

			for (int j = 0; j < p[i]; j++)
			{
				score += (i + 1) * 100;
				cnt++;

				if (score >= g)
				{
					ans = min(ans, cnt);
					ok = true;
					break;
				}
			}
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void){
    
    int a,b,k,count;
    count=0;
    scanf("%d %d %d",&a,&b,&k);
    
    for(int i=a; i>0; i--){
        if(a%i==0 && b%i==0){
            count++;
            
            if(count==k){
                printf("%d",i);
                return 0;
            }
        }
    }
}

Measured memory_bytes: 128
#include <algorithm>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <vector>

const int MOD = 1e9 + 7;
const int iINF = 2147483647 / 2;
const long long int llINF = 9223372036854775807 / 2;

using namespace std;
using ll = long long int;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vvvl = vector<vector<vector<ll>>>;

typedef pair<ll, ll> pll;
bool paircomp(const pll &a, const pll &b) {
  if (a.first == b.first)
    return a.second < b.second;
  return a.first < b.first;
}

#define REP(i, n) for (ll i = 0; i < (n); i++)
#define RREP(i, n) for (ll i = (n)-1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define AUTO(i, m) for (auto &i : m)
#define ALL(a) (a).begin(), (a).end()
#define MAX(vec) *std::max_element(vec.begin(), vec.end())
#define MIN(vec) *std::min_element(vec.begin(), vec.end())
#define ARGMAX(vec)                                                            \
  std::distance(vec.begin(), std::max_element(vec.begin(), vec.end()))
#define ARGMIN(vec)                                                            \
  std::distance(vec.begin(), std::min_element(vec.begin(), vec.end()))
#define REV(T) greater<T>()
#define PQ(T) priority_queue<T, vector<T>, greater<T>>
#define VVL(a, b, c) vector<vector<ll>>(a, vector<ll>(b, c))
#define VVVL(a, b, c, d)                                                       \
  vector<vector<vector<ll>>>(a, vector<vector<ll>>(b, vector<ll>(c, d)))
#define SP(a) setprecision(a)
#define SQRT(a) sqrt((long double)(a))
#define DPOW(a, b) pow((long double)(a), (long double)(b))
#define UNIQUE(vec)                                                            \
  do {                                                                         \
    sort(ALL((vec)));                                                          \
    (vec).erase(std::unique(ALL((vec))), (vec).end());                         \
  } while (0)

ll POW(ll n, ll m) {
  if (m == 0) {
    return 1;
  } else if (m % 2 == 0) {
    ll tmp = POW(n, m / 2);
    return (tmp * tmp);
  } else {
    return (n * POW(n, m - 1));
  }
}

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

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll N;
  cin >> N;
  vl H(N);
  REP(i, N) cin >> H[i];
  ll po = H[0];
  ll count = 0;
  ll ans = 0;
  FOR(i, 1, N) {
    if (po >= H[i]) {
      count++;
      po = H[i];
    } else {
      ans = max(ans, count);
      count = 0;
      po = H[i];
    }
  }
  cout << max(ans, count) << endl;

  return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
#include <map>
using namespace std;

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

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n; cin>>n;
	int a[n][2];
	for(int i=0;i<n;i++)
	{
		cin>>a[i][0]>>a[i][1];
	}
	string ans="No";
	for(int i=0;i<n-2;i++)
	{
		if((a[i][0]==a[i][1]) && (a[i+1][0]==a[i+1][1]) && (a[i+2][0]==a[i+2][1]))
		ans="Yes";
	}
	cout<<ans<<endl;
	return 0;
}

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

using namespace std;
string a,b;
int x,o;
int main()
{
	getline(cin,a);
	getline(cin,b);
	int xx=a.size(),oo=b.size();
	for(int i=1;i<=xx+oo;i++)
	{
		if(i%2==1)
		{
			cout<<a[x];
			x++;
		}
		else
		{
			cout<<b[o];
			o++;
		}
	}
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <ctime>
#include <algorithm>
#include <sstream>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <cstdlib>
#include <cstdio>
#include <iterator>
#include <functional>
#include <bitset>
#include <numeric>

#ifdef LOCAL
#define eprintf(...) fprintf(stderr,__VA_ARGS__)
#else
#define eprintf(...)
#endif

#define TIMESTAMP(x) eprintf("["#x"] Time : %.3lf s.\n", clock()*1.0/CLOCKS_PER_SEC)
#define TIMESTAMPf(x,...) eprintf("[" x "] Time : %.3lf s.\n", __VA_ARGS__, clock()*1.0/CLOCKS_PER_SEC)

using namespace std;

#ifdef LOCAL
static struct __timestamper {
  string what;
  __timestamper(const char* what) : what(what){};
  __timestamper(const string& what) : what(what){};
  ~__timestamper(){
    TIMESTAMPf("%s", what.data());
	}
} __TIMESTAMPER("end");
#else 
struct __timestamper {};
#endif

typedef long long ll;
typedef long double ld;

int main() {
#ifdef LOCAL
  freopen("b.in", "r", stdin);
  freopen("b.out", "w", stdout);
#endif

  int n;
  while (scanf("%d", &n) == 1) {
    vector<int> a(n), b(n);
    for (int &x : a) {
      scanf("%d", &x);
    }
    for (int &x : b) {
      scanf("%d", &x);
    }

    ll opsb, opsa;
    opsb = opsa = 0;

    for (int i = 0; i < n; i++) {
      if (a[i] > b[i]) {
        opsb += a[i] - b[i];
      } else {
        if (a[i] % 2 == b[i] % 2) {
          opsa += (b[i] - a[i]) / 2;
        } else {
          opsb++;
          b[i]++;
          opsa += (b[i] - a[i]) / 2;
        }
      }
    }

//    eprintf("%lld %lld\n", opsa, opsb);

    if (opsa < opsb) {
      printf("No\n");
    } else {
      printf("Yes\n");
    }
  }

  return 0;
}


Measured memory_bytes: 384
N,M,C=map(int,input().split())
B=list(map(int,input().split()))
ans=0
for i in range(N):
    A=list(map(int,input().split()))
    x=C
    for j in range(len(B)):
        x+=A[j]*B[j]
    if x>0:
        ans+=1
print(ans)

Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <stack>
#include <numeric>




typedef long long ll;
#define PI 3.14159265359
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define mp make_pair
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define decp(n) cout<<fixed<<setprecision((int)n)
#define _GLIBCXX_DEBAC
#include <functional>
/*map<Keyの型, Valueの型> 変数名;
queue<型> 変数名;
priority_queue<型> 変数名;
priority_queue<型, vector<型>, greater<型>> 変数名;*/
//copy(v1.begin(), v1.end(), back_inserter(v2));
using namespace std;

ll gcd(ll a, ll b) {
	ll c;
	if (a < b) {
		c = a; a = b; b = c;
	}
	while (b != 0) {
		c = a % b; a = b; b = c;
	}
	return a;
}

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

int sort_greater(int m, int n) {
	vector<int> a(m);
	for (int i = 0; i < m; i++) {
		cin >> a[i];
	}
	sort(a.begin(), a.end(), greater<int>());
	for (int i = 0; i < n; i++) {
		cout << a[i];
	}
	return 0;
}

int bubblesort(int a[], int n) {
	int sw = 0;
	bool flag = 1;
	for (int i = 0; flag; i++) {
		flag = 0;
		for (int j = n - 1; j >= i + 1; j--) {
			if (a[j] < a[j - 1]) {
				swap(a[j], a[j - 1]);
				flag = 1;
				sw += 1;
			}
		}
	}
	return sw;
}

int a_z()
{
	for (int i = 0; i <= ('Z' - 'A'); i++) {
		cout << (char)('A' + i);
	}
	return 0;
}

int selecttionsort(int a[], int n) {
	int t, sw = 0, minj;
	for (int i = 0; i < n - 1; i++) {
		minj = i;
		for (int j = 0; j < n - 1; j++) {
			if (a[j] < a[minj]) {
				minj = j;
			}
		}
		t = a[i]; a[i] = a[minj]; a[minj] = t;
		if (i != minj) sw += 1;

	}
	return sw;
}

bool is_prime(int x) {
	if (x <= 1) return false;
	for (int i = 2; i * i <= x; i++) {
		if (x % i == 0) return false;
	}
	return true;
}

const ll mod = 1000000007;

map<string, int> memo;

using P=pair<ll,ll>;

/*void dfs(int v, int p = -1) {
	for (int u : to[v]) {
		if (u == p) continue;
		ans[u] += ans[v];
		dfs(u, v);
	}
}*/
ll findIndex(int value, vector<ll> a)
{

	for (ll i = 0; i < (ll)a.size(); i++) {
		if (a[i] == value) {
			return i;
		}
	}
	return -1;
}

ll nCr(ll n, ll r) {
	ll a = 1;
	for (ll i = n; i > n - r; --i) {
		a = a * i;
	}
	for (ll i = 1; i < r + 1; ++i) {
		a = a / i;
	}
	return a;
}



const int INF = 1001001001;



int main() {
	int n;
	cin >> n;
	if (n <= 999)cout << "ABC" << endl;
	else cout << "ABD" << endl;
	return 0;
}













Measured memory_bytes: 3596