akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
int main() 
{
	int n,k,mod=1000000007;
	cin>>n>>k;
	vector<int> A(n, 0);
	for(int i=0;i<n;i++)
	    cin>>A[i];
	
	vector<vector<long long int>> dp(n,vector<long long int>(k+1, 0));
	vector<vector<long long int>> prefix(n,vector<long long int>(k+1, 0));
	
	for(int i=0;i<n;i++)
	{
	    dp[i][0] = 1;
	    prefix[i][0] = 1;
	}
	
	for(int i=0;i<n;i++)
	{
	    for(int j=1;j<=k;j++)
	    {
	        if(i==0)
	        {
	            if(j<=A[i])
	                dp[i][j] = 1;
	        }
	        else
	        {
	            int index = max(0, j-A[i]);
	            if(index==0)
	                dp[i][j] = prefix[i-1][j];
	            else
	                dp[i][j] = ((prefix[i-1][j]-prefix[i-1][index-1])%mod + mod)%mod;
	        }
	        prefix[i][j] = (prefix[i][j-1]+dp[i][j])%mod;
	    }
	} 
	cout<<dp[n-1][k]; 
}

Measured memory_bytes: 157552
import java.util.Scanner;
class Main {
	public static void main(String[] args){
		final int Number=100;
		try(Scanner sc = new Scanner(System.in)){
			int N = Integer.parseInt(sc.next());
			int M = Integer.parseInt(sc.next());
			int c =gcd(N,M);
			System.out.println(c);
		}
	}
	public static int gcd(int N, int M){
		int max=Math.max(N, M);
		int min=Math.min(N, M);
		
		if(max%min==0){
			return min;
		}else{
			return gcd(max%min,min);
		}
	}
}

Measured memory_bytes: 26240
#include<iostream>
using namespace std;
typedef long long int ll;
int main(){
	int n;
	int a[100000];
	cin >> n;
	for(int i = 0; i < n; i++) cin >> a[i];
	int max_a = 0;
	for(int i = 0; i < n; i++){
		if(a[i] > max_a) max_a = a[i];
	}
	int min_diff = 1000000002;
	int r;
	for(int i = 0; i < n; i++){
		if(a[i] == max_a) continue;
		int a1 = a[i], a2 = max_a - a[i];
		if(a1 > a2) swap(a1, a2);
		if(max_a % 2 == 1){
			if(max_a / 2 + 1 - a1 < min_diff){
				min_diff = max_a / 2 + 1 - a1;
				r = a[i];
			}else if(a2 - max_a / 2 - 1 < min_diff){
				min_diff = a2 - max_a / 2 - 1;
				r = a[i];
			}
		}else{
			if(max_a / 2 - 1 - a1 < min_diff){
				min_diff = max_a / 2 - 1 - a1;
				r = a[i];
			}else if(a2 - max_a / 2 < min_diff){
				min_diff = a2 - max_a / 2;
				r = a[i];
			}
		}
	}
	cout << max_a << " " << r << endl;
	return 0;
}

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

using namespace std;
#define int long long
const int N = 3e3 + 5, MOD = 998244353;
int dp[N][N], a[N];

int32_t main()
{
    int n, s, ans = 0; cin >> n >> s;
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
        dp[i][a[i]] = i;
        for (int j = a[i]; j <= s; j++) dp[i][j] += dp[i - 1][j - a[i]], dp[i][j] %= MOD;
        ans += (n - i + 1) * dp[i][s] % MOD, ans %= MOD;
        for (int j = 1; j <= s; j++) dp[i][j] += dp[i - 1][j], dp[i][j] %= MOD;
    }
    cout << ans << "\n";
}


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

int main()
{
    long long n,k,q;
    cin>>n;
    long long h[n+1],dp1[n+1],dp2[n+1],dp3[n+1],a[n+1],b[n+1],c[n+1],last;
    
    for (int i = 1; i <= n; ++i)
    {
        cin>>a[i]>>b[i]>>c[i];
    }
    dp1[1]=a[1];
    dp2[1]=b[1];
    dp3[1]=c[1];
    last=a[1];
    for (int i = 2; i <= n; ++i)
    {
        dp1[i]=a[i]+max(dp2[i-1],dp3[i-1]);
        dp2[i]=b[i]+max(dp1[i-1],dp3[i-1]);
        dp3[i]=c[i]+max(dp1[i-1],dp2[i-1]);
    }
    cout<<max(max(dp1[n],dp2[n]),dp3[n]);
    

    
}

/*int main()
{
    long long t;
    cin>>t;
    string s1,s2;
    for (int i = 0; i < 2*k; ++i)
    {
        cin>>s1>>s2;
    }
    for (int i = s1.length(); i > 0; --i)
    {
        
    }
}*/

Measured memory_bytes: 4864
#include<bits/stdc++.h>
#define fast ios::sync_with_stdio(false);cin.tie(NULL)
using namespace std;
#define int long long
#define MOD 1000000007
typedef vector<int> vi;
typedef pair<int,int> pi;
#define inf 1e18
#define For(i,a,b) for (int i = a; i < b; i++)
#define Rep(i,a,b) for (int i = a; i <= b; i++)
#define ps(x,y) fixed << setprecision(y) << x 
#define pb push_back 
#define mp make_pair 

vector<pi> a, c;
 
int32_t main()
{
    fast;
    int n, m; cin >> n >> m;
    For(i, 0, n) {
        int x, y; cin >> x >> y;
        a.pb({x, y});
    }
    For(i, 0, m) {
        int x, y; cin >> x >> y;
        c.pb({x, y});
    }
    
    For(i, 0, n) {
        vector<pi> ans;
        For(j, 0, m) {
            int val = abs(a[i].first - c[j].first) + abs(a[i].second - c[j].second);
            ans.pb({val, j+1});
        }
        
        sort(ans.begin(), ans.end());
        
        int val = ans[0].first, val2 = ans[0].second;
        
        for(auto v : ans) {
            if(v.first == val and v.second < val2) val2 = v.second;
        }
        cout << val2 << endl;
        
    }
    
    
    
    
    return 0;
}

Measured memory_bytes: 3672
#include<cstdio>
#include<cmath>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<iostream>
#include<iomanip>
#include<queue>
#include<vector>
#define LL long long
#define ULL unsigned long long
#define For(i,a,b) for(int i=(a);i<=(b);i++)
#define itn int
#define pritnf printf
#define mp make_pair
#define pb push_back
using namespace std;

string n;

int main(){
	cin>>n;
	For(i,0,n.size()-1){
		if (n[i]=='1') printf("9");
		else printf("1");
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int N = 2e6 + 5;
#define rep(i , j , n) for(long long i = j ; i <= n ; i++)
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int c , d;
    cin >> c >> d;
    if((c * d) % 2) {
        cout << "Odd" << endl;
    }
    else {
        cout << "Even" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>

#define int long long
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(a) (a).begin(), (a).end()
#define PB push_back
#define MP make_pair
#define FST first
#define SND second
#define SZ(a) (signed)((a).size())
#define EACH(i, c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort((c).begin(), (c).end())

using namespace std;

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;

const int MOD = 1000000007;
const char ENDL = '\n';

#define dump(x) cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")"  << " " << __FILE__ << endl;

bool df[10];

bool fn(int n) {
    while (n > 0) {
        if (df[n % 10]) {
            return false;
        }
        n /= 10;
    }
    return true;
}

signed main(void) {
    ios::sync_with_stdio(false);
    cout.setf(ios::fixed, ios::floatfield);
    cout.precision(10);
    cin.tie(0);

    int n, k;
    cin >> n >> k;
    VI d(k);
    REP(i, k) {
        cin >> d[i];
    }

    REP(i, 10) {
        df[i] = false;
    }
    REP(i, k) {
        df[d[i]] = true;
    }

    while (fn(n)==false){
        n++;
    }

    cout << n << ENDL;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define MOD 1000000007
#define len(x) x.size()
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
#define all(v) v.begin(), v.end()
#define alla(a,n) a, a + n
using namespace std;

typedef long long int ll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<pll> vpll;
typedef vector<vll> vvll;
typedef vector<string> vs;
using namespace std;

int n;
int main() {
    //freopen("input.txt", "r", stdin) ;
    //freopen("output.txt", "w", stdout) ;
    ios_base::sync_with_stdio(false);
    cin.tie(NULL) ; cout.tie(NULL) ;
    cin>>n;
    vector<int> lists(n);
    lists.clear();
    for(int i=0;i<n;i++){
        cin>>lists[i];
    }
    int ans=0;
    for(int i=0;i<n-2;i++){
        for(int j=i+1;j<n-1;j++){
            for(int k=j+1;k<n;k++){
                if(lists[i]==lists[j] || lists[i]==lists[k] || lists[j]==lists[k]) continue;
                if(lists[i]+lists[j]>lists[k] && lists[j]+lists[k]>lists[i] && lists[i]+lists[k]>lists[j]){
                        ans++;
                }
            }
        }
    }
    cout<<ans;
    return 0;
}




Measured memory_bytes: 3660
import java.util.Scanner;

public class Main {
	void run() {
		Scanner scan = new Scanner(System.in);
		String str = scan.nextLine();
		String[] strarray = str.split(" ");
		for(int i = 0; i < strarray.length; i++) {
			char[] carray = strarray[i].toCharArray();
			for (char c : carray) {
				if (Character.isUpperCase(c)) {
					c = Character.toLowerCase(c);
				} else if (Character.isLowerCase(c)) {
					c = Character.toUpperCase(c);
				}
				System.out.print(c);
			}
			if (i != strarray.length - 1)System.out.print(" ");
		}
		System.out.println();
	}
	public static void main(String[] args) {
		new Main().run();
	}
}

Measured memory_bytes: 26620
a = str(input()).split(' ')
calc = []
for i in range(len(a)):
    if a[i] == '+':
        p = calc.pop()
        q = calc.pop()
        calc.append(p + q)
    elif a[i] == '-':
        p = calc.pop()
        q = calc.pop()
        calc.append(q - p)
    elif a[i] == '*':
        p = calc.pop()
        q = calc.pop()
        calc.append(p * q)
    else:
        calc.append(int(a[i]))
print(calc[0])



Measured memory_bytes: 5604
#include<bits/stdc++.h>
using namespace std;
constexpr int64_t mod=1e9+7;

int main()
{
  int n,d,x;
  cin>>n>>d>>x;
  vector<int> a(n);
  for(auto&& e: a) 
  {
    cin>>e;
  }
  vector<int> dp(d,0);
  for (int i = 0; i < d; ++i)
  {
    for(auto&& e: a) 
    {
      if(i%e==0)
      {
        dp[i]++;
      }
    }
  }
  cout<<accumulate(dp.begin(), dp.end(),x);
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<stack>
using namespace std;
int main(){
    int n;
    while(cin>>n,n!=-1){
        stack<int>S;
        do{
            S.push(n%4);
            n/=4;
        }while(n>0);

        while(S.size()){
            int a=S.top();S.pop();
            cout<<a;
        }
        cout<<endl;
    }
}

Measured memory_bytes: 1200
#include <stdio.h>

int main(void)
{
	double s, l;
	
	while (scanf("%lf %lf", &s, &l) != EOF){
		if (s < 35.50 && l < 71.00){
			printf("AAA\n");
		}
		else if (s < 37.50 && l < 77.00){
			printf("AA\n");
		}
		else if (s < 40.00 && l < 83.00){
			printf("A\n");
		}
		else if (s < 43.00 && l < 89.00){
			printf("B\n");
		}
		else if (s < 50.00 && l < 105.00){
			printf("C\n");
		}
		else if (s < 55.00 && l < 116.00){
			printf("D\n");
		}
		else if (s < 70.00 && l < 148.00){
			printf("E\n");
		}
		else {
			printf("NA\n");
		}
	}
	return (0);
}

Measured memory_bytes: 608
#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int w,h;
char a[100][100]={{0}};
void check(int h,int w);
int main(void){
	int n,x,y;
	cin>>n;
	for(int i=1;i<=n;i++){
        for(int j=0;j<8;j++){
            cin>>a[j];
        }
        cin>>w>>h;
        w--,h--;
        a[h][w]='0';
        check(h,w);
        cout<<"Data "<<i<<":"<<endl;
        for(int j=0;j<8;j++){
            cout<<a[j]<<endl;
        }
	}
	return 0;
}

void check(int h,int w){
    for(int i=w-3;i<=w+3;i++){

        if(i>-1&&i<8)if(a[h][i]=='1')a[h][i]='0',check(h,i);
    }
    for(int i=h-3;i<=h+3;i++){
        if(i>-1&&i<8)if(a[i][w]=='1')a[i][w]='0',check(i,w);
    }
    return;
}

Measured memory_bytes: 1172
#include<bits/stdc++.h>
#define int long long
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define sz(a) a.size()
#define re return 
#define MP make_pair
#define pb push_back
#define pii pair<int,int>
#define se second
#define fi first
using namespace std;
 
signed main(){
	ios_base::sync_with_stdio(0);
	double t,x;
	cin>>t>>x;
	cout<<fixed<<setprecision(10)<<t/x;	
	re 0;
}

Measured memory_bytes: 3776
#include <iostream>
#include <vector>
#include <map>
#include <stack>
#include <list>
#include <queue>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <math.h>

#define NITENKAN(a, b) sqrt(((a.first - b.first) * (a.first - b.first)) + ((a.second - b.second) * (a.second - b.second)))
using namespace std;

bool checkTriIn(pair<double, double> vA, pair<double, double> vB, pair<double, double> vC, pair<double, double> P){
	pair<double, double> center(((vA.first + vB.first + vC.first) / 3), ((vA.second + vB.second + vC.second) / 3));

	vector<pair<double, double> > triangleLine;
	vector<pair<double, double> > centerToVertex;
	pair<double, double> vAvB(vB.first - vA.first, vB.second - vA.second);
	pair<double, double> vBvC(vC.first - vB.first, vC.second - vB.second);
	pair<double, double> vCvA(vA.first - vC.first, vA.second - vC.second);

	triangleLine.push_back(vAvB);
	triangleLine.push_back(vBvC);
	triangleLine.push_back(vCvA);

	pair<double, double> centerP(P.first - center.first, P.second - center.second);
	pair<double, double> centerA(vA.first - center.first, vA.second - center.second);
	pair<double, double> centerB(vB.first - center.first, vB.second - center.second);
	pair<double, double> centerC(vC.first - center.first, vC.second - center.second);

	centerToVertex.push_back(centerA);
	centerToVertex.push_back(centerB);
	centerToVertex.push_back(centerC);

	for(int i = 0; i < 3; i++){
		double cross = triangleLine[i].first * centerP.second - centerP.first * triangleLine[i].second;
		if(cross == 0) continue;
		double r = triangleLine[i].first * centerToVertex[i].second - centerToVertex[i].first * triangleLine[i].second;
		r /= cross;
		double s = centerP.first * centerToVertex[i].second - centerToVertex[i].first * centerP.second;
		s /= cross;

		if(r > 0 && r <= 1 && s > 0 && s <= 1){
			return false;
		}
	}
	return true;
}

int main(){
	pair<double, double> vA, vB, vC, P;

	while(cin >> vA.first >> vA.second >> vB.first >> vB.second >> vC.first >> vC.second >> P.first >> P.second){
		if(checkTriIn(vA, vB, vC, P)){
			cout << "YES" << endl;
		}
		else{
			cout << "NO" << endl;
		}
	}
}

Measured memory_bytes: 1220
#![allow(
    non_snake_case,
    unused_variables,
    unused_assignments,
    unused_mut,
    unused_imports,
    dead_code
)]
//use permutohedron::LexicalPermutation as _;
use proconio::input;
//use proconio::marker::*;
use std::collections::*;
//use std::cmp::*;
//use std::num;
//use petgraph::unionfind::UnionFind;
fn main() {
    input! {
        N:usize,mut A:[i64;N]
    }

    A.sort();
    A.reverse();
    let mut ans = 0;
    //println!("{:?}", A);
    for i in 1..N {
        //println!("{}", A[i / 2]);
        ans += A[i / 2];
    }
    println!("{}", ans);
}


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

using namespace std;


int mod = 1e9 + 7;

int n, c[22][22], dp[22][1 << 22];

int f(int idx, int mask) {
    if(idx == -1)
        return !mask;
    if(~dp[idx][mask])
        return dp[idx][mask];
    int res = 0;
    for(int i = 0; (1 << i) <= mask; i++)
        if((mask >> i) & 1 && c[idx][i])
            res = (res + f(idx - 1, mask ^ (1 << i))) % mod;
    return dp[idx][mask] = res;
}



int32_t main() {
    memset(dp, -1, sizeof dp);
    int n; scanf("%d", &n);
    for(int i = 0; i < n; i++)
        for(int j = 0; j < n; j++)
            scanf("%d", &c[i][j]);
    printf("%d\n", f(n - 1, (1 << n) - 1));

}


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

int main(){
  char c;
  cin >> c;
  
  string ans;
  if (c=='a' || c=='i' || c=='u' || c=='e' ||c=='o') ans = "vowel";
  else ans = "consonant";
    
  cout <<ans<< endl;
}

Measured memory_bytes: 256
x = int(input())
ans = 0
if x <= 6:
    print(1)
    
elif 7<=x<=11:
    print(2)
    
else:
    t = (x%11)
    if  1<=t<=6:
        print(2*(x//11)+1)
    elif t==0:
        print(2*(x//11))
    elif 7 <= t <= 10:
        print(2*(x//11)+2)

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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef complex<double> P;
typedef pair<int,int> pii;
#define REP(i,n) for(ll i=0;i<n;++i)
#define REPR(i,n) for(ll i=1;i<n;++i)
#define FOR(i,a,b) for(ll i=a;i<b;++i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define MOD (ll)(1e9+7)
#define ADD(a,b) a=((a)+(b))%MOD
#define FIX(a) ((a)%MOD+MOD)%MOD

int n;
int s[252521];

bool check(int t){
  REP(i,n-t){
    if(s[i]!=s[i+t])return false;
  }
  return true;
}

int main(){
  scanf("%d",&n);
  REP(i,n)scanf("%d",s+i);
  // ?´???°??¨??????
  vi yakusuu;
  for(int i=1;i*i<=n;++i){
    if(n%i!=0)continue;
    yakusuu.push_back(i);
    if(i*i!=n)yakusuu.push_back(n/i);
  }
  sort(ALL(yakusuu));
  REP(i,yakusuu.size()-1){
    int t = yakusuu[i];
    if(check(t)){
      int ans = n/t;
      printf("%d\n",ans);
      return 0;
    }
  }
  puts("1");
  return 0;
}

Measured memory_bytes: 1992
#include <iostream>
using namespace std;
int main(void){
    int M[2],D[2];
    for(int i = 0;i < 2;i++){
        cin >> M[i] >> D[i];
    }
    if(M[0] != M[1]){
        cout << 1 << endl;
    }else{
        cout << 0 << endl;
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);

const int N = 2e5+5, M = 1e6+6, OO = 0x3f3f3f3f;
int tc;
int a[N], b[N];
int main()
{
    FIO
    int n; 
    cin>>n;
    for (int i = 0; i < n; i++)
    {
        cin>>a[i]>>b[i];
    }
    sort(a, a + n);
    sort(b, b + n);
    if(n%2)
        cout<< b[n/2] - a[n/2] + 1 <<endl;
    else
        cout<<b[n/2] + b[(n/2) - 1] - a[n/2] - a[n/2 - 1] + 1;
    return 0;
}

Measured memory_bytes: 5156
from collections import deque
h,w=map(int,input().split())
a=[input() for _ in range(h)]
inf=10**10
dist=[[inf if c=='.' else 0 for c in r] for r in a]
dq=deque()
for i in range(h):
    for j in range(w):
        if dist[i][j]==0:
            dq.append([i,j])
diff=[[1,0],[0,1],[-1,0],[0,-1]]
ans=0
while(dq):
    y,x=dq.popleft()
    for dy,dx in diff:
        y2=y+dy
        x2=x+dx
        if 0<=y2<h and 0<=x2<w and dist[y2][x2]>dist[y][x]+1:
            dq.append([y2,x2])
            dist[y2][x2]=dist[y][x]+1
            ans=max(ans,dist[y2][x2])
print(ans)

Measured memory_bytes: 142428
#include<bits/stdc++.h>
#define XX first
#define YY second
#define pb emplace_back
#define FOR(i,a,b) for(int (i)=(a);i<(b);++(i))
#define EFOR(i,a,b) for(int (i)=(a);i<=(b);++(i))
#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#define REP rep
#define rrep(X,Y) for (int (X) = (Y)-1;(X) >=0;--(X))
#define all(X) (X).begin(),(X).end()
#define eb emplace_back

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef ll LL;
typedef pii PII;
typedef pll PLL;
const ll MOD=1e9+7;

#define rall(X) (X).rbegin(),(X).rend()
#define UNIQUE(X) (X).erase(unique(all(X)),(X).end())
#define reps(X,S,Y) for (int (X) = S;(X) < (Y);++(X))
#define rreps(X,S,Y) for (int (X) = (Y)-1;(X) >= (S);--(X))
template<class T> inline bool MX(T &l,const T &r){return l<r?l=r,1:0;}
template<class T> inline bool MN(T &l,const T &r){return l>r?l=r,1:0;}

int N;
LL T;
LL A[214514];
LL B[214514];
LL dp[214514][114];
vector<vector<int>> clss;

signed main(){
  ios_base::sync_with_stdio(false);
  cout<<fixed<<setprecision(0);

  cin >> N >> T;

  vector<int> ps, qs;
  rep(i, N) {
    cin >> A[i] >> B[i];
    if (A[i] > 0) ps.eb(i);
    else qs.eb(i);
  }
  sort(all(ps), [](int i, int j) {
    return (B[i]+1)*A[j] < (B[j]+1)*A[i];
  });
  sort(all(qs), [](int i, int j) {
    return B[i] < B[j];
  });
  
  vector<LL> cuml;
  for (int i : qs) {
    LL t = 0;
    if (!cuml.empty()) t = cuml.back()+1;
    cuml.eb(t+B[i]);
  }
  auto Find = [&cuml](LL t) {
    LL rem = T-t-1;
    auto itr = upper_bound(all(cuml), rem);
    return int(itr - cuml.begin());
  };

  LL INF = 1LL << 34;
  fill(dp[0], dp[ps.size()+1], INF);
  dp[0][0] = 0;
  rep(i, ps.size()) { 
    int idx = ps[i];
    rep(j, 34) {
      if (dp[i][j] >= INF) continue;
      MN(dp[i+1][j], dp[i][j]);
    }
    rep(j, 34) {
      if (dp[i][j] >= INF) continue;
      LL t = dp[i][j]+1;
      MN(dp[i+1][j+1], t + t*A[idx] + B[idx]);
    }
  }

  int ans = 0;
  rep(j, 34) {
    LL t = dp[ps.size()][j];
    if (t >= INF) continue;
    //cout << j << ": " << t << endl;
    if (t > T) continue;
    int cand = j + Find(t);
    MX(ans, cand);
  }
  cout << ans << endl;
}


Measured memory_bytes: 183028
#include <iostream>
using namespace std;
int main(){
     int n,cnt=0;
     cin>>n;
     int a[n];
     for(int i=0;i<n;i++){
     	cin>>a[i];
	}
	for(int i=0;i<n;i++){
		for(int j=i+1;j<n;j++){
			cnt+=a[i]*a[j];
		}
	}
	cout<<cnt;
}
	


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define pb push_back
#define mp make_pair
using namespace std;
const int inf = 1e18 + 7;
const int N = 1e6 + 7;
const int md = 1e9 + 7;
int mul(int a, int b) {
  return ((a%md) * (b%md))%md;
}
int add(int a, int b) {
  return ((a%md) + (b%md))%md;
}
int comp(int arr[], int n) 
{ 
  int sm = 0; 
  for (int i = 0; i < 60; i++)  
  { 
    int zc = 0, oc = 0;  
    int idsm = 0;  
    for (int j = 0; j < n; j++) 
    { 
      if (arr[j] % 2 == 0) 
          zc++; 
      else
          oc++; 
      arr[j] /= 2; 
    } 
    int p = (int)pow(2LL, i) % md;
    idsm = mul(mul(oc, zc), (long long)(p));  
    sm = add(sm, idsm);  
  } 
  return sm; 
} 
void sol() {
  int n, a[N];
  cin >> n;
  for(int i=0; i<n; i++) {
    cin >> a[i];
  }
  int ans = comp(a, n);
  cout << ans << "\n";
}

int32_t main() 
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int T = 1;
  //cin >> T; while(T--) 
  sol();
  return 0;
}


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

using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using WGraph = vector<vector<pair<int, ll>>>;

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

constexpr int dx[4] = {-1, 0, 0, 1}, dy[4] = {0, -1, 1, 0};
constexpr int INF = 1e9;
constexpr int MOD = 1e9 + 7;
constexpr long long LINF = 1e18;
constexpr double EPS = 1e-10;
constexpr double PI = M_PI;

void solve() {
    string s;
    cin >> s;

    if (s == "RRR") {
        cout << 3 << '\n';
    } else if (s == "RRS" || s == "SRR") {
        cout << 2 << '\n';
    } else if (s == "SSS") {
        cout << 0 << '\n';
    } else {
        cout << 1 << '\n';
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(20);

    solve();

    return 0;
}


Measured memory_bytes: 3648
#include "bits/stdc++.h"
#define MOD 1000000007
#define INF 11234567890
#define in std::cin
#define out std::cout
#define rep(i,N) for(int i=0;i<N;++i)
typedef long long int LL;

int N, a[112345];
std::vector<int>path;
int pos = 1, ans;

int main()
{
	in >> N;
	rep(i, N) { in >> a[i]; }
	
	while (pos != 2)
	{
		if (ans > N)
		{
			ans = -1;
			break;
		}
		pos = a[pos - 1];
		++ans;
	}

	out << ans << std::endl;
	return 0;
}

Measured memory_bytes: 640
#include <stdio.h>
typedef long long ll;

int main()
{
    ll r, d, x;

    scanf("%lld %lld %lld", &r, &d, &x);

    for (int i = 0; i < 10; i++) {
        x = (r * x) - d;

        printf("%lld\n", x);
    }

    return 0;
}


Measured memory_bytes: 128
import sys


def int1(x): return int(x) - 1
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def mi1(): return map(int1, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def lli(rows_number): return [li() for _ in range(rows_number)]


if __name__ == "__main__":
    n = ii()
    one = int(str(n)[-1])
    if one in [2,4,5,7,9]:
        print('hon')
    elif one in [0,1,6,8]:
        print('pon')
    else:
        print('bon')

Measured memory_bytes: 9144
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in);) {
            solve(sc);
        }
    }

    public static void solve(Scanner sc) {
        int n = sc.nextInt();
        int[] times = new int[n];
        int sum = 0;
        for (int i = 0; i < n; i++) {
            times[i] = sc.nextInt();
            sum += times[i];
        }
        int m = sc.nextInt();
        for (int i = 0; i < m; i++) {
            int p = sc.nextInt();
            int x = sc.nextInt();
            System.out.println(sum - times[p - 1] + x);
        }
    }
}

Measured memory_bytes: 23764
s = input()
binary = {}
alphabet = "abcdefghijklmnopqrstuvwxyz"
flag = False
for i in alphabet:
    binary[i] = 0
for j in s:
    binary[j] = 1
for k in alphabet:
    if binary[k] == 0:
        print(k)
        break
    if "z" == k:
        print("None")

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

#define fi first
#define se second
#define FOR(a, b, c) for(int a = b; a <= c; ++a)
#define pb push_back

typedef pair<int, int> ii;

const int N = 2e5 + 10;

int n, row, col;
int pr[N], dx[] = {0, 0, -1, 1}, dy[] = {-1, 1, 0, 0};
string s[405];
bool visit[N];
ii sz[N];

bool check(int x, int y) { return (x >= 1 && x <= row && y >= 1 && y <= col); }
int find(int x) { return x == pr[x] ? x : (pr[x] = find(pr[x])); }
void add(int x1, int y1, int x2, int y2)    {
    int pr1 = x1 * col + y1 - col, pr2 = x2 * col - col + y2;
    if(find(pr1) == find(pr2)) return;
//    cout << x1 << y1 << x2 << y2 << '\n';
    sz[find(pr1)].fi += sz[find(pr2)].fi;
    sz[find(pr1)].se += sz[find(pr2)].se;
    pr[find(pr2)] = find(pr1);
}
signed main()   {
//    freopen("test.inp", "r", stdin);
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);

    cin >> row >> col;
    FOR(i, 1, row)  cin >> s[i];
    FOR(i, 1, row) FOR(j, 1, col) {
        int idx = i * col - col + j;
        pr[idx] = idx;
        sz[idx].fi += (s[i][j - 1] == '.');
        sz[idx].se += (s[i][j - 1] == '#');
    }
    FOR(i, 1, row) FOR(j, 1, col)   {
        FOR(t, 0, 3) {
            int ix = i + dx[t], iy = j + dy[t];
            if(check(ix, iy) && s[ix][iy - 1] != s[i][j - 1]) add(ix, iy, i, j);
        }
    }
    long long ans = 0LL;
    FOR(i, 1, row) FOR(j, 1, col) {
        int idx = find(i * col - col + j);
        if(!visit[idx]) {
            visit[idx] = 1;
            ans += 1ll * sz[idx].fi * sz[idx].se;
        }
    }
    cout << ans;
}


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

using namespace std;

vector<int> l;
int a, b;

int main() {
    int k;
    cin >> a >> b >> k;

    for (int i = min(a, b); i >= 1; i--) {
        if (a % i == 0 && b % i == 0) l.emplace_back(i);
    }

    cout << l[k - 1] << endl;
}

Measured memory_bytes: 256
/* Generated by powerful Codeforces Tool
 * You can download the binary file in here https://github.com/xalanq/cf-tool (win, osx, linux)
 * Author: step_by_step
 * Time: 2020-03-19 17:35:03
**/

//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("unroll-loops")
  
#include <iostream>
#include <stdlib.h>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <assert.h>
#include <memory.h>
#include <time.h>
#include <bitset>

#define uint unsigned int
#define ll long long
#define ull unsigned long long
#define ld long double
#define rep(i, l, r) for (int i = (l); i < (r); i++)
#define repb(i, r, l) for (int i = (r); i > (l); i--)
#define sz(a) (int)a.size()
#define fi first
#define se second
#define mp(a, b) make_pair(a, b)
#define rank qwertyuio
#define next dfghjk
#define prev fhsgfhjf
#define plus fsghsf
#define minus ytryr
  
using namespace std;
  
inline bool setmin(int &x, int y) { return (y < x) ? x = y, 1 : 0; }
inline bool setmax(int &x, int y) { return (y > x) ? x = y, 1 : 0; }
inline bool setmin(ll &x, ll y) { return (y < x) ? x = y, 1 : 0; }
inline bool setmax(ll &x, ll y) { return (y > x) ? x = y, 1 : 0; }
  
const int N = 100000;
const int inf = (int)1e9 + 1;
const ll big = (ll)1e18 + 1;
const int P = 239;
const int P1 = 31;
const int P2 = 57;
const int MOD = (int)1e9 + 7;
const int MOD1 = (int)1e9 + 9;
const int MOD2 = 998244353;
const ld eps = 1e-9;
const double pi = atan2(0, -1);
const int ABC = 26;

int main()
{
    //freopen("a.in", "r", stdin);
    //freopen("a.out", "w", stdout);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.precision(20);
    cout << fixed;
    //ll TL = 10.95 * CLOCKS_PER_SEC;
    //clock_t time = clock();
    int n;
    cin >> n;
    string s;
    cin >> s;
    rep(i, 0, n) {
        s[i]--;
    }
    bool two = true;
    rep(i, 0, n) {
        if (s[i] == '1') {
            two = false;
        }
    }
    if (two) {
        rep(i, 0, n) {
            if (s[i] == '2') {
                s[i] = '1';
            }
        }
    } else {
        rep(i, 0, n) {
            if (s[i] == '2') {
                s[i] = '0';
            }
        }
    }
    int c = 0;
    rep(i, 0, n) {
        if (s[i] == '1') {
            if (!(i & (n - i - 1))) {
                c ^= 1;
            }
        }
    }
    if (two) {
        c *= 2;
    }
    cout << c << "\n";
    return 0;
}

Measured memory_bytes: 1948
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

// modint: mod 計算を int を扱うように扱える構造体
template<int MOD> struct Fp {
    long long val;
    constexpr Fp(long long v = 0) noexcept : val(v % MOD) {
        if (val < 0) val += MOD;
    }
    constexpr int getmod() { return MOD; }
    constexpr Fp operator - () const noexcept {
        return val ? MOD - val : 0;
    }
    constexpr Fp operator + (const Fp& r) const noexcept { return Fp(*this) += r; }
    constexpr Fp operator - (const Fp& r) const noexcept { return Fp(*this) -= r; }
    constexpr Fp operator * (const Fp& r) const noexcept { return Fp(*this) *= r; }
    constexpr Fp operator / (const Fp& r) const noexcept { return Fp(*this) /= r; }
    constexpr Fp& operator += (const Fp& r) noexcept {
        val += r.val;
        if (val >= MOD) val -= MOD;
        return *this;
    }
    constexpr Fp& operator -= (const Fp& r) noexcept {
        val -= r.val;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr Fp& operator *= (const Fp& r) noexcept {
        val = val * r.val % MOD;
        return *this;
    }
    constexpr Fp& operator /= (const Fp& r) noexcept {
        long long a = r.val, b = MOD, u = 1, v = 0;
        while (b) {
            long long t = a / b;
            a -= t * b; swap(a, b);
            u -= t * v; swap(u, v);
        }
        val = val * u % MOD;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr bool operator == (const Fp& r) const noexcept {
        return this->val == r.val;
    }
    constexpr bool operator != (const Fp& r) const noexcept {
        return this->val != r.val;
    }
    friend constexpr ostream& operator << (ostream &os, const Fp<MOD>& x) noexcept {
        return os << x.val;
    }
    friend constexpr Fp<MOD> modpow(const Fp<MOD> &a, long long n) noexcept {
        if (n == 0) return 1;
        auto t = modpow(a, n / 2);
        t = t * t;
        if (n & 1) t = t * a;
        return t;
    }
};

const int MOD = 1000000007;
using mint = Fp<MOD>;

int N;
vector<long long> c;

mint solve() {
    if (N == 1) return mint(c[0]) * 2;
    sort(c.begin(), c.end(), greater<long long>()); 
    mint res = 0;
    mint n2 = modpow(mint(2), N-2);
    mint n1 = modpow(mint(2), N-1);
    for (int n = 0; n < N; ++n) {
        mint fac = n2 * n + n1;
        res += fac * c[n];
    }
    return res * modpow(mint(2), N);
}

int main() {
    while (cin >> N) {
        c.resize(N);
        for (int i = 0; i < N; ++i) cin >> c[i];
        cout << solve() << endl;
    }
}


Measured memory_bytes: 1792
import math

S = int(input())
X1, Y1 = 0, 0

x = 1
N = math.ceil(S**0.5)
diff = N**2 - S

X2, Y3 = N, N

if N**2 == S:
    X3, Y2 = 0, 0
else:
    X3, Y2 = diff, 1

ans = [X1, Y1, X2, Y2, X3, Y3]
print(*ans)

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

using namespace std;

int main() {
    int a,b[100010],c[100010]={0},d=0;
    cin >> a;
  
    for(int i=0;i<a;i++)
         cin >> b[i];
      
    
  
  for(int i=0;i<a;i++){
    
      c[b[i]]++; 
      c[b[i]+1]++; 
      c[b[i]+2]++;
    }
  
    for(int i=0;i<=100000;i++){
        d = max(d, c[i]);
    }
  
    cout << d << endl;
}


Measured memory_bytes: 1024
import java.io.PrintWriter
import java.math.BigInteger
import kotlin.math.pow

fun next() = readLine()!!
fun nextInt() = next().toInt()
fun nextLong() = next().toLong()
fun nextDouble() = next().toDouble()
fun nextList() = next().split(" ")
fun nextIntList() = nextList().map(String::toInt)
fun nextLongList() = nextList().map(String::toLong)
fun nextDoubleList() = nextList().map(String::toDouble)

val pw = PrintWriter(System.out)
fun print(s: Any = "") = pw.print(s)
fun println(s: Any = "") = pw.println(s)

fun <T> Iterable<T>.join(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "") = joinToString(separator, prefix, postfix)
fun <T> Array<T>.join(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "") = joinToString(separator, prefix, postfix)
fun Int.pow(n: Int) = pow(n.toLong())
fun Int.pow(n: Long) = toDouble().pow(n.toDouble()).toLong()
fun Long.pow(n: Int) = pow(n.toLong())
fun Long.pow(n: Long) = toDouble().pow(n.toDouble()).toLong()

fun main(args: Array<String>) {
    main()
    pw.flush()
}

fun main() {
    val A = BigInteger(next())
    val B = BigInteger(next())
    println(if (A > B) "GREATER" else if (A < B) "LESS" else "EQUAL")
}

Measured memory_bytes: 34756
N,M = map(int,input().split())
X=sorted([int(i) for i in input().split()])
if N==1:
  print(X[M-1]-X[0])
elif N>=M:
  print(0)
else:
  print(sum(sorted([i-j for i,j in zip(X[1:],X)],reverse=True)[N-1:]))


Measured memory_bytes: 13840
#include <cstdio>
#include <vector>

int main()
{
  int n;
  scanf("%d",&n);
  std::vector<int> d(n),c(n,0);
  for(int i=0;i<n;i++){
    scanf("%d",&(d[i]));
    c[d[i]]++;
  }
  long long ans=(d[0]==0?1ll:0ll);
  const long long mod=998244353ll;
  for(int i=1;i<n;i++){
    ans=ans*(d[i]==0?0ll:c[d[i]-1])%mod;
  }
  printf("%lld\n",ans);
  return 0;
}


Measured memory_bytes: 1152
import java.util.*;

public class Main{
    
    public static final long INF = (long)1e11;
    
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int q = Integer.parseInt(sc.next());
        TreeSet<Long> s = new TreeSet<>();
        TreeSet<Long> t = new TreeSet<>();
        s.add(INF);
        s.add(-INF);
        t.add(INF);
        t.add(-INF);
        for(int i=0; i<a; i++){
            s.add(Long.parseLong(sc.next()));
        }
        for(int i=0; i<b; i++){
            t.add(Long.parseLong(sc.next()));
        }
        long[] sa = new long[2];
        long[] ta = new long[2];
        for(int i=0; i<q; i++){
            long x = Long.parseLong(sc.next());
            sa[0] = s.lower(x);
            sa[1] = s.higher(x);
            ta[0] = t.lower(x);
            ta[1] = t.higher(x);
            long ans = INF;
            for(int j=0; j<4; j++){
                long jinja = sa[j&1];
                long tera = ta[j>>1];
                long sum = Math.abs(jinja-tera) + Math.min(Math.abs(x-jinja), Math.abs(x-tera));
                ans = Math.min(ans, sum);
            }
            System.out.println(ans);
        }
    }
}


Measured memory_bytes: 97792
#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <vector>
#include <tuple>
#include <queue>
#include <stack>
#include <set>
#include <map>
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define fi first
#define se second
typedef long long ll;

int M,H,W,K,A,B;
string S;
string alpha = "abcdefghijklmnopqrstuvwxyz";
string ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

int main() {
    ll N;
    cin>>N;
    ll ans = 0;
    /*for(ll m = N-1; m > 0; m--){
        if(N%m == N/m) ans += m;
        if(m*(m+1)<N) {
            cout << m << endl;
            break;
        }
    }*/
    ll N_i = N;
    ll ii = 0;
    reps(i,1,N){
        N_i--;
        ii += i+i;
        ii--;
        if(N_i <= ii) break;
        if(N_i%i == 0){
            ans += N_i/i;
        }
        //cout << ans << endl;
    }
    cout<<ans<< endl;
    
}


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

int main()
{
  int n,p[50],t[50],dis;
  string ans="";
  int dp[50][3];


  while(1){
    cin>>n;
    if(n==0)break;
    for(int i=0;i<50;i++)for(int j=0;j<3;j++)dp[i][j]=inf;
    for(int i=1;i<n+1;i++)cin>>p[i]>>t[i];

    for(int i=n;i>1;i--)t[i]-=t[i-1];

    ans="OK";dis=inf;
    dp[0][0]=0;
    for(int i=0;i<n+1;i++){
      for(int j=0;j<3;j++){
	if(dp[i][j]==inf)continue;
	if(i==0){
	  if(p[i+1]<=t[i+1])dp[i+1][0]=p[i+1];
	}
	else {
	  if(j<2){
	    if(abs(p[i+1]-p[i])*(j+2)<=t[i+1])
	      dp[i+1][j+1]=min(dp[i+1][j+1],dp[i][j]+abs(p[i+1]-p[i]));
	  }
	  if(p[i+1]+p[i]*(j+2)<=t[i+1])
	    dp[i+1][0]=min(dp[i+1][0],dp[i][j]+p[i]+p[i+1]);
	}
      }
      bool flag=false;
      if(i<n){
	for(int j=0;j<3;j++){
	  if(dp[i+1][j]!=inf)flag=true;
	}
	if(!flag){
	  ans="NG";
	  dis=i+1;
	  break;
	}
      }
      if(i==n){
	for(int j=0;j<3;j++)dis=min(dp[i][j],dis);
	dis+=p[i];
      }
    }
    cout<<ans<<" "<<dis<<endl;
  }
  return 0;
}

Measured memory_bytes: 1208
#include<stdio.h>

int main(void){
    int h,w,i,j;

    while(1){
        scanf("%d%d",&h,&w);
        if(h==0&&w==0) break;
        for(i=0;i<h;i++){
            if(i==0 || i==h-1){
                for(j=0;j<w;j++){
                    printf("#");
                }
            }
            else{
                printf("#");
                for(j=1;j<w-1;j++){
                    printf(".");
                }
                printf("#");
            }
            printf("\n");
        }
        printf("\n");
    }

    return 0;
}


Measured memory_bytes: 2032
# include <bits/stdc++.h>
# define ll long long
# define pb push_back
# define fi first
# define se second
# define mp make_pair
using namespace std;
ll mod = 1e9+7;
ll dp[1007][1007];

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    ll n,m;
    // dp[i][j]-> maximum paths to reach (i,j) from (0,0)
    cin>>n>>m;
    char a[1007][1007];
    for(ll i=0;i<n;i++)
    {
        for(ll j=0;j<m;j++)
        {
            cin>>a[i][j];
        }
    }
    if(a[0][0]=='.')
    {
        dp[0][0]=1;
    }
    else
    {
        cout<<"0"<<endl;
        return 0;
    }
    for(ll i=1;i<n;i++)
    {
        if(dp[i-1][0]==1 && a[i][0]=='.') dp[i][0]=1;
    }
    for(ll j=1;j<m;j++)
    {
        if(dp[0][j-1]==1 && a[0][j]=='.') dp[0][j]=1;
    }
    for(ll i=1;i<n;i++)
    {
        for(ll j=1;j<m;j++)
        {
            if(dp[i-1][j]==0 && dp[i][j-1]==0)
            {
                dp[i][j]=0;
            }
            else if(a[i][j]=='.')
            { 
               dp[i][j] = (dp[i-1][j]%mod + dp[i][j-1]%mod)%mod;
            }
        }
    }
    cout<<dp[n-1][m-1]<<endl;
}


Measured memory_bytes: 12484
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <cmath>
#include <iomanip>
#include <algorithm>
using namespace std;

int main(){
    char x, y;
    cin >> x >> y;
    if(x < y){
        cout << "<" << endl;
    } else if(x == y){
        cout << "=" << endl;
    } else {
        cout << ">" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
int main() {

	int a, b, k;
	std::cin >> a >> b >> k;

	std::vector<int> v;
	auto mv = std::min(a, b);
	for (int i{1}; i <= mv; ++i) {
		if (a%i == 0 && b%i == 0)
			v.emplace_back(i);
	}


	std::cout << *(v.rbegin() + k-1) << "\n";
	return 0;
}

Measured memory_bytes: 256
macro_rules! input {
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = || -> String {
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}
 
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};
 
    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
    
    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}
 
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };
 
    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [$t:tt]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };
 
    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };
 
    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };
 
    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}
fn main() {
    input! { n: usize, t: f32, a: f32, h: [f32;n] }
    let b = h.iter().map(|&x| t - x*0.006).collect::<Vec<_>>();
    let mut ret = 0;
    let mut min:f32 = 100000.0;
    for (i, bb) in b.iter().enumerate() {
        let tmp = (a-bb).abs();
        if tmp < min {
            min = tmp;
            ret = i;
        }
    }
    println!("{}", ret+1);
}

Measured memory_bytes: 4352
#include <stdio.h>
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <time.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#pragma warning(disable:4996)
#pragma comment(linker, "/STACK:336777216")
using namespace std;

#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define ldb ldouble

//typedef tuple<int, int, int> t3;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <ll, int> pli;
typedef pair <db, db> pdd;

int IT_MAX = 1 << 18;
ll MOD = 1000000007;
const int INF = 0x3f3f3f3f;
const ll LL_INF = 0x3f3f3f3f3f3f3f3f;
const db PI = acos(-1);
const db ERR = 1e-10;
#define szz(x) (int)(x).size()
#define Se second
#define Fi first
#define rep(i, n) for(int i=0;i<n;i++)
#define pb(x) push_back(x)

class Matrix {
public:
	ll v[2][2];
	Matrix() {
		memset(v, 0, sizeof(v));
	}
	Matrix(ll a, ll b, ll c, ll d) {
		v[0][0] = a, v[0][1] = (b + MOD) % MOD;
		v[1][0] = c, v[1][1] = d;
	}
	Matrix operator * (const Matrix &l) const {
		Matrix rv = Matrix();
		int i, j, k;
		for (i = 0; i < 2; i++) {
			for (j = 0; j < 2; j++) {
				for (k = 0; k < 2; k++) rv.v[i][j] += v[i][k] * l.v[k][j];
				rv.v[i][j] %= MOD;
			}
		}
		return rv;
	}
};
char u[1050][1050];
char in[1050][1050];
int main() {
	int N, M, i, j;
	ll K;
	scanf("%d %d %lld", &N, &M, &K);
	for (i = 0; i < N; i++) scanf("%s", in[i]);

	bool c1 = false, c2 = false;
	for (i = 0; i < N; i++) if (in[i][0] == in[i][M - 1] && in[i][0] == '#') c1 = true;
	for (i = 0; i < M; i++) if (in[0][i] == in[N - 1][i] && in[0][i] == '#') c2 = true;
	if (c1 && c2) return !printf("1\n");
	if (!c1 && !c2) {
		K--;
		ll ans = 1;
		ll cx1 = 0;
		for (i = 0; i < N; i++) for (j = 0; j < M; j++) if (in[i][j] == '#') cx1++;
		while (K) {
			if (K % 2) ans = (ans*cx1) % MOD;
			cx1 = cx1 * cx1 % MOD;
			K /= 2;
		}
		return !printf("%lld\n", ans);
	}
	if (c2) {
		for (i = 0; i < N; i++) for (j = 0; j < M; j++) u[j][i] = in[i][j];
		swap(N, M);
		for (i = 0; i < N; i++) for (j = 0; j < M; j++) in[i][j] = u[i][j];
	}

	int cx1 = 0, cx2 = 0, cx3 = 0, cx4 = 0;
	for (i = 0; i < N; i++) for (j = 0; j < M; j++) if (in[i][j] == '#') cx1++;
	for (i = 0; i < N; i++) for (j = 0; j + 1 < M; j++) if (in[i][j] == '#' && in[i][j + 1] == '#') cx2++;
	for (i = 0; i < N; i++) if (in[i][0] == in[i][M - 1] && in[i][0] == '#') cx4++;

	Matrix mul = Matrix(cx1, -cx2, cx3, cx4);
	Matrix rv = Matrix(1, 0, 0, 1);

	K--;
	while (K) {
		if (K % 2) rv = rv*mul;
		mul = mul*mul;
		K /= 2;
	}
	printf("%lld\n", (rv.v[0][0] + rv.v[0][1] + 2*MOD) % MOD);
}

Measured memory_bytes: 2304
use std::io::prelude::*;
use std::io::stdin;
use std::str::FromStr;

fn main() {
    println!(
        "{}",
        read::<String>()
            .replace("BC", "D")
            .split(|c| c == 'B' || c == 'C')
            .map(|s| s
                .chars()
                .fold((0, 0), |(n, sum), c| if c == 'A' {
                    (n + 1, sum)
                } else {
                    (n, sum + n)
                },)
                .1)
            .sum::<u64>()
    );
}

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let token: String = stdin
        .lock()
        .bytes()
        .map(|b| b.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}


Measured memory_bytes: 4352