akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(), a.end()
#define rrng(a) a.rbegin(), a.rend()
#define maxs(x, y) (x = max(x, y))
#define mins(x, y) (x = min(x, y))
#define limit(x, l, r) max(l, min(x, r))
#define lims(x, l, r) (x = max(l, min(x, r)))
#define isin(x, l, r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)), x.end())
#define show(x) cout << #x << " = " << x << endl;
#define PQ(T) priority_queue<T, v(T), greater<T>>
#define bn(x) ((1 << x) - 1)
#define dup(x, y) (((x) + (y)-1) / (y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<T> vt;
const ll inf = 1001001001001LL;

int main() { 
  ll h,w;
  cin >> h >> w;
  if(h%3 ==0 || w %3 == 0){
    cout<<0<<endl;
    return 0;
  }
  ll a,b,c;
  ll ans = inf;
  vl t(3);
  rep(k,2){
    srep(x,1,w+1){
      t[0] = h*x;
      ll xx = (w-x)/2;
      if(xx==0)continue;
      t[1] = xx*h;
      t[2] =(w-xx-x)*h;
      sort(t.begin(),t.end());
      ans = min(ans,t[2]-t[0]);

      t[0] = h*x;
      ll y = h/2;
      if(y==0)continue;
      t[1] = (w-x)*y;
      t[2] =(w-x)*(h-y);
      sort(t.begin(),t.end());
      ans = min(ans,t[2]-t[0]);
    }
    swap(h,w);
  }
  if(ans==inf){
    cout<<1<<endl;
    return 0;
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 256
#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++)
using namespace std;
using P = pair<int, int>;
typedef long long ll;

int  main()
{
	int N; cin >> N;
	vector<int> h(N);
	int cnt = 1;
	priority_queue<int> q;
	rep(i, N)
		cin >> h[i];
	q.push(h[0]);
	rep1(i, N)
	{
		if (q.top() <= h[i])
			cnt++;
		q.push(h[i]);
	}
	cout << cnt << endl;
	return (0);
}

Measured memory_bytes: 256
//Counting Roads

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,x,y) for(int i=x;i<y;i++)
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a/__gcd(a, b)*b)
#define range(a) (a).begin(),(a).end()
#define pb push_back
const int inf = 2147483647;

int main (){
    int n,m;cin>>n>>m;
    int a[n]={0};
    rep(i,0,m*2){
        int b;cin>>b;
        a[b-1]++;
    }
    rep(i,0,n){
        cout << a[i]<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 1e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main()
{

int x ; 
cin >> x;
cout << x*x*x << endl;

return 0;
}


Measured memory_bytes: 3076
#include<cstdio>
int main(){
    int n;
    for(;;){
        scanf("%d",&n);
        if(n==0) break;
        for(int i=0;i<n;i++){
            int p[3];
            char r='C';
            for(int j=0;j<3;j++){
                scanf("%d",&p[j]);
            }
            int sum=0,sumb=0;
            for(int j=0;j<3;j++){
                if(p[j]==100){
                    r='A';
                }
                sum+=p[j];
                if(j!=2) sumb+=p[j];
            }
            if(r=='C'){
                if(sumb/2>=90||sum/3>=80) r='A';
                else if(sum/3>=70) r='B';
                else if(sum/3>=50 && (p[0]>=80 || p[1]>=80)) r='B';
            }
            printf("%c\n",r);
        }
    }
}

Measured memory_bytes: 0
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<map>
#include<queue>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
using namespace std;


int main(){

  int w, h, x, y, r;
  cin >> w >> h >> x >> y >> r;

  if( x + r > w || x - r < 0 || y + r > h || y - r < 0 ) cout << "No" << endl;
  else cout << "Yes" << endl;

  return 0;
}








// EOF

Measured memory_bytes: 3088
N = int(input())
args_list = [input().split() for i in range(N)]
tuples_list = [(args[0], int(args[1]), i+1) for i, args in enumerate(args_list)]
tuples_list.sort(key=lambda x: x[1], reverse=True)
tuples_list.sort(key=lambda x: x[0])
for tuples in tuples_list:
  print(tuples[2])


Measured memory_bytes: 3060
S = list(input())

lenS = len(S)-1
ans = 0

for i in range(2**lenS) :
    pat = str("{:0>{}b}".format(i, lenS))
    for k in range(lenS) :
        S[k] = S[k].replace("+","")
        if pat[k] == "1" :
            S[k] = S[k] + "+"
    ans += eval("".join(S))

print(ans)

Measured memory_bytes: 3064
a, b, k = map(int ,input().split())
if b-a+1 <= k:
    k = b-a+1
ans = []
for i in range(k):
    print(a+i)
    ans.append(a+i)
for i in range(-k+1,1):
    if b+i not in ans:
        print(b+i)


Measured memory_bytes: 3060
n = int(input())
t_input = list(map(int,input().split()))
m = int(input())
px_input = [list(map(int,input().split())) for i in range(m)]

sum_ = sum(t_input)

for i in range(m):
    p,x = map(int,px_input[i])
    print(sum_-t_input[p-1]+x)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define F first
#define S second
#define mp make_pair
#define PII pair<int,int>
#define PLL pair<long long,long long>
#define pq priority_queue
#define M map
#define UM unordered_map
#define graph unordered_map<int,vector<int>>
#define graphw unordered_map<int,vector<pair<int,int>>>
#define V vector
#define mod 1000000007
#define inf 3000000000000000007ll
#define P pair
#define Fast ios_base::sync_with_stdio(false);cin.tie();cout.tie();
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(), a.rend()
#define sz(a) signed(a.size())
#define FIXED cout << fixed << setprecision(12)
#define L list
#define D deque
#define ld long double
#define FILE_READ_IN freopen("input.txt","r",stdin);
#define FILE_READ_OUT freopen("output.txt","w",stdout);
#define deb(x) cout<<#x<<" "<<x<<endl;
using namespace std;
// pair operation
template<class T, class U>istream& operator>>(istream& in, pair<T, U> &rhs) {in >> rhs.first; in >> rhs.second; return in;}
template<class T, class U>ostream& operator<<(ostream& out, const pair<T, U> &rhs) {out << rhs.first; out << " "; out << rhs.second; return out;}
template<class T, class U>pair<T, U> operator+(pair<T, U> &a, pair<T, U> &b) {return pair<T, U>(a.first + b.first, a.second + b.second);}
template<class T, class U>pair<T, U> operator-(pair<T, U> &a, pair<T, U> &b) {return pair<T, U>(a.first - b.first, a.second - b.second);}
// Linear STL
// VECTOR
template<class T>istream& operator>>(istream& in, vector<T> &a) {for (auto &i : a)cin >> i; return in;}
template<class T>ostream& operator<<(ostream& out, const vector<T> &a) {for (auto &i : a)cout << i << " "; return out;}
// SET
template<class T>ostream& operator<<(ostream& out, const set<T> &a) {for (auto &i : a)cout << i << " "; return out;}
template<class T>ostream& operator<<(ostream& out, const unordered_set<T> &a) {for (auto &i : a)cout << i << " "; return out;}
template<class T>ostream& operator<<(ostream& out, const multiset<T> &a) {for (auto &i : a)cout << i << " "; return out;}
// MAP
template<class T, class U>ostream& operator<<(ostream& out, const map<T, U> &a) {for (auto &i : a)cout << "(" << i.first << ", " << i.second << "(\n"; return out;}
template<class T, class U>ostream& operator<<(ostream& out, const unordered_map<T, U> &a) {for (auto &i : a)cout << "(" << i.first << ", " << i.second << "(\n"; return out;}


void judge() {
#ifndef ONLINE_JUDGE
	FILE_READ_IN
	FILE_READ_OUT
#endif
}



int main() {
	Fast;
	int t = 1;
	// judge();
	// cin >> t;
	while (t--) {
		ld r;
		cin >> r;

		ld ans = 6.28 * r;
		cout << ans << endl;
	}
}


Measured memory_bytes: 3792
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >>N;
  int x=999999999;
  
  for(int i=0; i<N; i++){
    int A;
    cin >> A;
    int j = 0;
    
    for ( ; 2*A %2 == 0; j++){
      if(A%2==0) {
        A /= 2;
      }
      else {
      break;
    }
    }   
   if (x>j){
      x = j;
    }
   }
  

  cout << x <<endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

/**
 * @author Vicfred
 * 11/3/18
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int x[] = new int[N];
        int y[] = new int[N];
        int h[] = new int[N];
        int a,b,c;
        a = b = c = -1;
        for(int i = 0; i < N; ++i) {
            x[i] = scanner.nextInt();
            y[i] = scanner.nextInt();
            h[i] = scanner.nextInt();
            if(h[i] > 0) {
                a = x[i];
                b = y[i];
                c = h[i];
            }
        }
        for(int i = 0; i <= 100; ++i) {
            for(int j = 0; j <= 100; ++j) {
                int H = c + Math.abs(a-i) + Math.abs(b-j);
                H = Math.max(H,0);
                boolean flag = true;
                for(int k = 0; k < N; ++k) {
                    int HH = H - Math.abs(x[k] - i) - Math.abs(y[k] - j);
                    HH = Math.max(HH, 0);
                    if(HH != h[k]) {
                        flag = false;
                        break;
                    }
                }
                if(flag)
                    System.out.println(i+" "+j+" "+H);
            }
        }
    }
}


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

public class Main {
	private static final int MOD = (int)Math.pow(10, 9) + 7;
	public static void main(String[] args) {
		FastReader sc = new FastReader();
      	int n = sc.nextInt();
      	int res = 0;
      	if (n >= 64 && n <= 100) {
        	res = 64;
        } else if (n >= 32 && n <= 63) {
        	res = 32;
        } else if (n >= 16 && n <= 31) {
        	res = 16;
        } else if (n >= 8 && n <= 15) {
        	res = 8;
        } else if (n >= 4 && n <= 7) {
        	res = 4;
        } else if (n >= 2 && n <= 3) {
        	res = 2;
        } else {
        	res = 1;
        }
 		System.out.println(res);
	}
	
    static class FastReader {
	    BufferedReader br;
	    StringTokenizer st;
	
	    public FastReader() {
	      br = new BufferedReader(new InputStreamReader(System.in));
	    }
	  
	    String next() { 
	      while (st == null || !st.hasMoreElements()) {
	        try {
	          st = new StringTokenizer(br.readLine());
	        } catch (IOException  e) {
	          e.printStackTrace();
	        }
	      }
	      return st.nextToken();
	    }
	
	    int nextInt() {
	      return Integer.parseInt(next());
	    }
	
	    long nextLong() {
	      return Long.parseLong(next());
	    }
	
	    double nextDouble() { 
	      return Double.parseDouble(next());
	    }
	
	    String nextLine() {
	      String str = "";
	        try{
	            str = br.readLine();
	        } catch (IOException e) {
	            e.printStackTrace();
	        }
	        return str;
	      }
	  }
}


Measured memory_bytes: 23252
#include <stdio.h>

int swap(int *a,int *b){
	int t=*a;
	*a=*b;
	*b=t;
}
int main(void){

	int a,b,c;

	scanf("%d %d %d",&a,&b,&c);

	if(b>c){
		swap(&b,&c);
	}
	if(a>b){
		swap(&a,&b);
	}
	if(b>c){
		swap(&b,&c);
	}

	printf("%d %d %d\n",a,b,c);

	return 0;
}

Measured memory_bytes: 596
n,a,b=map(int,input().split())
mod=10**9+7
ans=pow(2,n,mod)-1+mod*2
def c(x,y):
	p=1
	for i in range(x-y+1,x+1):
		p*=i
		p%=mod
	q=1
	for i in range(2,y+1):
		q*=i
		q%=mod
	return pow(q,mod-2,mod)*p%mod
r=ans-c(n,a)-c(n,b)
print(r%mod)

Measured memory_bytes: 3064
#include<iostream>
#define INF 1e9
using namespace std;
int main(){

  int N,M;
  cin >>N>>M;
  int D[N+1];
  int C[M+1];
  int dp[M+1][N+1];
  
  for(int i=1 ; i <= N ; i++)cin >>D[i];
  for(int i=1 ; i <= M ; i++)cin >>C[i];

  for(int i=0 ; i <= M ; i++)dp[i][0]=0;
  for(int i=1 ; i <= N ; i++)dp[0][i]=INF;

  for(int i=1 ; i <= M ;i++){
    for(int j=1 ; j <= N ; j++){
      dp[i][j]=min(dp[i-1][j],dp[i-1][j-1]+D[j]*C[i]);
    }
  }

  cout <<dp[M][N]<<endl;
  
  return 0;
}

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

// マクロ //
#define rep(i,N) for(int i = 0; i < N; i++)
#define all(x) x.begin(), x.end()
#define sort(x) sort(all(x))
#define uniq(x) x.erase(unique(all(x)), x.end())
#define vsum(x) accumulate(all(x), 0)
#define cou(x) cout << x << endl
#define y() cout << "Yes" << endl
#define n() cout << "No" << endl
#define Y() cout << "YES" << endl
#define N() cout << "NO" << endl
#define x2(x) (x) * (x)

// 型エイリアス //
using lint = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vli = vector<lint>;
using vc = vector<char>;
using vs = vector<string>;
using vb = vector<bool>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvc = vector<vc>;
using vpii = vector<pii>;
using msi = map<string, int>;

// 関数 //
template<class T> lint gcd(T a, T b) {
    int t;
    while (b != 0) {
        t = a % b;
        a = b;
        b = t;
    }
    return a;
}

template<class T> lint lcm(T a, T b) {
    return a * b / gcd(a, b);
}

double distance(pii a, pii b) {
    double dist;
    dist = sqrt(x2(a.first - b.first) + x2(a.second - b.second));
    return dist;
}

lint perm(int a) {
    lint perm = 1;
    for (int i = a; i >= 1; i--) {
        perm *= i;
    }
    return perm;
}

lint combination(int n, int m) {
    long double c = 1;
    for (int i = n, k = 1; i > m; i--, k++) {
        c *= i;
        c /= k;
    }
    return (lint)c;
}

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

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

// 定数 //
#define pi acos(-1)
#define mod 1000000007
#define MOD 998244353
#define inf ((1LL << 62) - 1 + (1LL << 62))

// キーワード //
#define elif else if

// End of Template //



int main() {

    cin.tie(0);
    ios::sync_with_stdio(false);
        
    lint N;
    cin >> N;
    lint ple = 0;
    ple += (N / 500 * 1000);
    ple += ((N % 500) / 5 * 5);
    cou(ple);
    


}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define debug(x) cout << #x << ": " << x << endl
#define repn(i, a, b) for(int i = (int)(a); i < (int)(b); i++)
#define rep(i, a) for(int i = 0; i < (int)(a); i++)
#define all(v) v.begin(), v.end() 
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define endl '\n'

int dp[100005];

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	//freopen("input.in", "r", stdin);
	//freopen("output.out", "w", stdout);
	int n;
	cin >> n;
	int a[n];
	rep(i, n) cin >> a[i], dp[i] = 1e9;
	dp[0] = 0;
	repn(i, 1, n){
		repn(j, 1, 3) if(i - j >= 0){
			dp[i] = min(dp[i], dp[i - j] + abs(a[i] - a[i - j]));
		}
	}
	cout << dp[n - 1] << endl;
	return 0;
}
/*
Things to look out for:
	- Integer overflows
	- Array bounds
	- Special cases
Be careful!
*/


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

const int INF = 1<<28;
const int START = 108;
const int GOAL = 109;

int enc(string s){
    if(s == "H")        return START;
    else if(s == "D")   return GOAL;
    char c = s[0];
    int x = stoi(s.substr(1));
    return (c == 'C' ? 0 : 6) + x-1;
}

int main(){
    int m, n, k, d;
    while(cin >> m >> n >> k >> d, m+n+k+d){
        vector<pair<int,int>> vp[110];
        vector<int> cake(m);
        for(int i = 0; i < m; i++)  cin >> cake[i];
        while(d-- > 0){
            string a, b;
            int c;
            cin >> a >> b >> c;
            int from = enc(a), to = enc(b);
            c *= k;
            vp[from].push_back({to, c});
            vp[to].push_back({from, c});
        }
        vector<vector<int>> dp(110, vector<int>(1<<m, INF));
        dp[START][0] = 0;

        for(int loop = 0; loop < 110*64; loop++){
            bool update = false;
            for(int pos = 0; pos < 110; pos++){
                for(pair<int,int> p : vp[pos]){
                    for(int bit = 0; bit < 1<<m; bit++){
                        if(dp[pos][bit] == INF) continue;
                        int next = p.first, ncost = dp[pos][bit]+p.second;
                        if(next < m){
                            if((bit>>next&1)==0 && ncost-cake[next] < dp[next][bit^(1<<next)]){
                                dp[next][bit^(1<<next)] = ncost-cake[next];
                                update = true;
                            }
                            continue;
                        }
                        if(ncost < dp[next][bit]){
                            dp[next][bit] = ncost;
                            update = true;
                        }
                    }
                }
            }
            if(!update) break;
        }

        int ans = 1<<30;
        for(int i = 0; i < 1<<m; i++){
            ans = min(ans, dp[GOAL][i]);
        }
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 3128
#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3f
#define MOD 1000000007
#define EPS (1e-10)
using namespace std;
typedef long long ll;
typedef pair<int, int>P;

int p[20000], a[20000], b[20000];
int main() {
	int n; scanf("%d", &n);
	rep(i, n) {
		scanf("%d", &p[i]); p[i]--;
	}
	int d = 30000;
	rep(i, n) {
		a[i] = d;
		b[n - i - 1] = d;
		d += 30000;
	}
	rep(i, n)a[p[i]] += i;
	rep(i, n) {
		printf("%d", a[i]);
		if (i == n - 1)printf("\n");
		else printf(" ");
	}
	rep(i, n) {
		printf("%d", b[i]);
		if (i == n - 1)printf("\n");
		else printf(" ");
	}
}

Measured memory_bytes: 896
#include <bits/stdc++.h>
const double pi=acos(-1.0);
int n,l;
double ansx,ansy;
double t[3003];
int main(){
	scanf("%d%d",&n,&l);
	for (int i=1;i<=n;i++){
		scanf("%lf",&t[i]);
		t[i]=t[i]*2*pi/l;
	}		
	for (int i=1;i<=n;i++)
		for (int j=i+1;j<=n;j++){
			double m1=(t[i]+t[j])/2,m2=m1+pi;//中点 
			ansx=ansx+cos(m1)*(n-(j-i+1));
			ansx=ansx+cos(m2)*(j-i-1);
			ansy=ansy+sin(m1)*(n-(j-i+1));
			ansy=ansy+sin(m2)*(j-i-1);
		}
	double tot=1ll*n*(n-1)*(n-2)/6;
	printf("%.10lf %.10lf",ansx/tot,ansy/tot);
} 

Measured memory_bytes: 384
#include <stdio.h>

int main(void){
  int y,m,d;
  while(scanf("%d %d %d",&y,&m,&d)!=EOF){
    if(1868>y) printf("pre-meiji\n");
    else if(y==1868){
      if(m<9) printf("pre-meiji\n");
      else if(m>9) printf("meiji %d %d %d\n",y-1867,m,d);
      else{
	if(d<8) printf("pre-meiji\n");
	else printf("meiji %d %d %d\n",y-1867,m,d);
      }
    }else if(y<1912) printf("meiji %d %d %d\n",y-1867,m,d);
    else if(y==1912){
      if(m<7) printf("meiji %d %d %d\n",y-1867,m,d);
      else if(m>7) printf("taisho %d %d %d\n",y-1911,m,d);
      else{
	if(d<30) printf("meiji %d %d %d\n",y-1867,m,d);
	else printf("taisho %d %d %d\n",y-1911,m,d);
      }
    }else if(y<1926) printf("taisho %d %d %d\n",y-1911,m,d);
    else if(y==1926){
      if(y<12) printf("taisho %d %d %d\n",y-1911,m,d);
      else{
	if(d<25) printf("taisho %d %d %d\n",y-1911,m,d);
	else printf("showa %d %d %d\n",y-1925,m,d);
      }
    }else if(y<1989) printf("showa %d %d %d\n",y-1925,m,d);
    else if(y==1989){
      if(m>1) printf("heisei %d %d %d\n",y-1988,m,d);
      else{
	if(d<8) printf("showa %d %d %d\n",y-1925,m,d);
	else printf("heisei %d %d %d\n",y-1988,m,d);
      }
    }else printf("heisei %d %d %d\n",y-1988,m,d);
  }
  return 0;
}

Measured memory_bytes: 608
Str = input()
num = 0
for i in range(len(Str)):
    char = Str[i]
    if (i + 1) % 2 == 0 and i != 0:
        if char != "L" and char != "U" and char != "D":
            num = 1
    else:
        if char != "R" and char != "U" and char != "D":
            num = 1
if num == 1:
    print("No")
else:
    print("Yes")

Measured memory_bytes: 3064
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string>
#include <string.h>
#include <algorithm>

using namespace std;

int main (void)
{
	char x,y;

	cin >> x >> y;

	if (x > y)
	{
		cout << '>' << endl;
	}
	else if (x == y)
	{
		cout << '=' << endl;
	}
	else
	{
		cout << '<' << endl;
	}
}





Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <queue>
#include <cstring>
#include <vector>
#include <map>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <bitset>
#include <set>
#include <stack>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,k,n) for(int i=(k);i<(int)(n);i++)
#define all(i,n) (i),(i+n)

int dx4[4]={1,0,-1,0};
int dy4[4]={0,-1,0,1};
int dx8[8]={1,0,-1,1,-1,1,0,-1};
int dy8[8]={1,1,1,0,0,-1,-1,-1};

typedef pair<int, int> P;
typedef pair<string, int> SP;
typedef long long ll;
typedef pair<ll, ll> PLL;

const int INF = 1e9;
const ll LLINF = 1e18;
const int MAX_V = 1e6+1;
const ll mod = 1000000007;

// --------------------------------------
string s;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  cin >> s;

  char b = 'A', c = 'A';
  REP(i, s.length()) {
    if(b == s[i]) {
      cout << i << " " << i + 1 << endl;
      return 0;
    } if(c == s[i]) {
      cout << i - 1 << " " << i + 1 << endl;
      return 0;
    } else {
      c = b;
      b = s[i];
    }
  }

  cout << "-1 -1" << endl;
}


Measured memory_bytes: 512
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AGC023C {
    class Program {
        static void Main(string[] args) {
            int N = int.Parse(Console.ReadLine());
            long[] fact = new long[N];
            long[] invfact = new long[N];
            fact[0] = 1;
            invfact[0] = 1;
            for (int i = 1; i < N; i++) {
                fact[i] = multiply(fact[i - 1], i);
                invfact[i] = divide(1, fact[i]);
            }
            long[] nums = new long[N];
            for (int i = 1; i < N; i++) {
                long conbi = 0;
                if (i - 1 >= N - 1 - i) {
                    conbi = multiply(fact[i - 1], multiply(invfact[N - 1 - i], invfact[(i - 1) - (N - 1 - i)]));
                }
                nums[i] = multiply(multiply(fact[i], fact[N - 1 - i]), conbi);
            }
            long ans = 0;
            for (int i = 1; i < N; i++) {
                ans = (ans + multiply((nums[i] - nums[i - 1] + mod), i)) % mod;
            }
            Console.WriteLine(ans);
        }

        //定数です
        const long mod = 1000000007;

        //mod下でのx×yです
        private static long multiply(long x, long y) {
            return (x % mod) * (y % mod) % mod;
        }

        //mod下でのxのy乗です
        private static long power(long x, long y) {
            if (y == 0) {
                return 1;
            } else if (y == 1) {
                return x % mod;
            } else if (y % 2 == 0) {
                long p = power(x, y / 2);
                return p * p % mod;
            } else {
                long p = power(x, y / 2);
                return (p * p) % mod * (x % mod) % mod;
            }
        }

        private static long divide(long x, long y) {
            return multiply(x, power(y, mod - 2));
        }
    }
}


Measured memory_bytes: 36320
using System;
using System.Linq;
using System.Collections.Generic;

class Program
{
    static void Main(string[] args)
    {
        var N = int.Parse(Console.ReadLine());
        var inputV = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        var inputC = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        
        var ans = 0;
        for (var i = 0; i < inputV.Length; i++) {
            if (inputV[i] - inputC[i] > 0) {
                ans += inputV[i] - inputC[i];
            }
        }
        
        Console.WriteLine(ans);
    }
}


Measured memory_bytes: 13268
#include <iostream>
#define INF -100000
using namespace std;

int n;
int data[100];

long long memo[21][100];

long long dfs(int sum, int pos) {
	// cout << sum << " " << pos << endl;
	if (sum > 20 || sum < 0) return 0;
	if (pos == n-2) {
		if (sum == data[n-1]) return 1;
		return 0;
	}
	if (memo[sum][pos] != -INF) return memo[sum][pos];
	memo[sum][pos] = dfs(sum + data[pos+1], pos+1) + dfs(sum - data[pos+1], pos+1);
	return memo[sum][pos];
}

int main() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> data[i];
	}
	for (int i = 0;i < 21;i++) {
		for (int j = 0; j < 100;j++) {
			memo[i][j] = -INF;
		}
	}
	cout << dfs(data[0],0) << endl;
	return 0;
}

Measured memory_bytes: 3076
#include<stdio.h>
int main()
{
	int n,i,j,k,d,a[2005];
	while(~scanf("%d",&n))
	{for(i=0;i<n;i++)
	 scanf("%d",&a[i]);
	 for(i=0;i<n-1;i++)
	 for(j=0;j<n-1-i;j++)
	  if(a[j]<a[j+1])
	   {d=a[j];
	    a[j]=a[j+1];
	    a[j+1]=d;
	   }
	 int sum=0;
	 for(i=0;i<n-2;i++)
	 for(j=i+1;j<n-1;j++)
	  for(k=j+1;k<n;k++)
	   if(a[i]<a[j]+a[k]&&a[k]>a[i]-a[j])sum++;
	printf("%d\n",sum);
	}
}

Measured memory_bytes: 128
from heapq import heappush, heappop
from operator import itemgetter
import sys
input = sys.stdin.readline


class PseudoSet():
    def __init__(self):
        self.s = []  # set
        self.e = []  # erase candidate

    def insert(self, x):
        heappush(self.s, x)

    def erase(self, x):
        heappush(self.e, x)

    def get_min(self):
        while self.e and self.e[0] == self.s[0]:
            _ = heappop(self.s)
            _ = heappop(self.e)
        return self.s[0] if len(self.s) > 0 else None


n, q = map(int, input().split())
stx = []
events = []
for i in range(n):
    s, t, x = map(int, input().split())
    stx.append((s, t, x))
    events.append((s - x, +1, i))
    events.append((t - x, -1, i))
for i in range(q):
    d = int(input())
    events.append((d, 2, i))

ans = [-1] * q
events.sort(key=itemgetter(0, 1))
# print(events)
ps = PseudoSet()
for c, t, i in events:
    if t == 1:
        ps.insert(stx[i][2])
    elif t == -1:
        ps.erase(stx[i][2])
    else:
        # t == 0
        m = ps.get_min()
        if m is not None:
            ans[i] = m

print(*ans, sep='\n')


Measured memory_bytes: 166484
#include<bits/stdc++.h>
using namespace std;
#define ll  long long
#define endl '\n'
#define FASTINOUT ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
const ll MOD = 1000000007;
const double PI = 3.141592653589793238463;
const ll N=1e3+9;
bool prime[N];
int main()
{
    FASTINOUT;
    vector<int>p;
    ll x;
    cin>>x;
    for (int i=2; i<=N-9; i++)
    {
        if (!prime[i])
        {
            if (i<=x)
            p.push_back(i);
            //cout<<"i = "<<i<<endl;
            for (int j=i+i; j<=N-9; j+=i)
            {
                prime[j]=true;
            }
        }
    }
    ll ans=1;
    for (int i=0;i<p.size();i++){
        ll t=p[i];
        ll ex=0;
      // cout<<t<<" ";
        while (t<=x){
            ex+=x/t;
            t*=p[i];
        }
        ans=ans*(ex+1);
        ans%=MOD;
    }
    //cout<<endl;
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <locale>
#include <iostream>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

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

using namespace std;

using ll = long long;
using ld = long double;

template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
template <typename T> int len(const T &x) { return x.size(); }

template<typename T>
vector<T> table(int n, T v) { return vector<T>(n, v); }

template <class... Args>
auto table(int n, Args... args) {
  auto val = table(args...);
  return vector<decltype(val)>(n, move(val));
}

struct yes_no : numpunct<char> {
  string_type do_truename()  const { return "Yes"; }
  string_type do_falsename() const { return "No"; }
};

void solve(ll N, ll M) {
  if (N == 1 && M == 1) cout << 1 << endl;
  else if (N == 1) cout << M - 2 << endl;
  else if (M == 1) cout << N - 2 << endl;
  else cout << (M - 2) * (N - 2) << endl;
}

int main() {
  locale loc(locale(), new yes_no);
  cout << boolalpha << setprecision(12) << fixed;
  cout.imbue(loc);
	ll N;
	ll M;
	scanf("%lld", &N);
	scanf("%lld", &M);
	solve(N, M);
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#define MAXN 30000

using namespace std;

int n;
int a[MAXN], b[MAXN];

int main() {
    cin >> n;
    for (int i = 0; i < n; i++) {
        a[i] = i * n + 1;
        b[i] = n * n - i * n + 1;
    }
    for (int i = 0; i < n; i++) {
        int p;
        cin >> p;
        p--;
        a[p] += i;
    }
    for (int i = 0; i < n; i++)
        cout << a[i] << " ";
    cout << endl;
    for (int i = 0; i < n; i++)
        cout << b[i] << " ";
    cout << endl;
}


Measured memory_bytes: 768
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lvector vector<ll>
#define P pair<ll,ll> 
#define ALL(a) (a).begin(),(a).end()
#define rep(i,n) for(ll (i)=0; (i)<(n); ++(i))
#define print(a) cout << (a) << endl

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll k,n;cin>>k>>n;
  lvector A(n,0),dist(n,0);rep(i,n) cin>>A[i];
  A.emplace_back(A[0]+k);
  rep(i,n) dist[i]=A[i+1]-A[i];
  sort(ALL(dist));
  print(k-dist[n-1]);
  return 0;
}

Measured memory_bytes: 6528
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

g = []
g.append(a)
g.append(b)
g.append(c)
g.append(d)
g.append(e)

G = []

A=a%10
B=b%10
C=c%10
D=d%10
E=e%10

G.append(A)
G.append(B)
G.append(C)
G.append(D)
G.append(E)

min_except0 = G[:]

for i in range(4):
    try:
        min_except0.remove(0)
    except:
        pass
x = G.index(min(min_except0))

loop = [0,1,2,3,4]
loop.remove(x)

answer = 0
for i in loop:
  answer += g[i]
  answer += 10-G[i]
answer += g[x]

minas = 10*(5 - len(min_except0))

answer -= minas

print(answer)


Measured memory_bytes: 3064
#include <algorithm>
#include <cstring>
#include <iostream>
#include <vector>

using namespace std;

long long dp[2001][2001];
int mod = 1000000007;
void makePascalTriangle(int n) {
  for (int i = 0; i <= n; i++) {
    dp[i][0] = 1;
    for (int j = 1; j <= i; j++) {
      dp[i][j] = dp[i - 1][j] + dp[i - 1][j - 1];
      if (dp[i][j] >= mod) dp[i][j] -= mod;
    }
  }
}
int main() {
  int n, k;
  cin >> n >> k;
  makePascalTriangle(n);

  for (int i = 1; i <= k; i++)
    cout << (dp[n - k + 1][i] * dp[k - 1][i - 1]) % mod << endl;
  return 0;
}

Measured memory_bytes: 30080
#include <iostream>
#include <algorithm>
#include <string>
#define int long long
using namespace std;
int n, m;
int Gcd(int a,int b) {
	if (a < b)swap(a, b);
	if (a%b== 0)return b;
	else return Gcd(b, a%b);
}
signed main() {
	string s, t;
	cin >> n >> m >> s >> t;
	if (s[0] != t[0]) { cout << "-1\n"; return 0; }
	int gcd = Gcd(n, m);
	int lcm = n / gcd * m;
	if (m%n == 0) {
		swap(m, n);
		swap(s, t);
	}
	if (n%m == 0) {
		bool flag = 1;
		for (int i = 0; i < m; i++) 
			if (s[i*(n / m)] != t[i]) {
				flag = 0;
				break;
			}
		cout << (flag ? n : -1) << endl;
	}
	else {
		if (lcm == n * m) { cout << n * m << endl; return 0; }
		bool flag = 1;
		for (int i = 0; i < lcm; i += lcm/gcd) {
			if (s[i / (lcm / n)] != t[i / (lcm / m)])flag = 0;
		}
		cout << (flag ? lcm : -1) << endl;
	}
}

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

void update(vector<vector<int64_t> > &kirai, vector<vector<bool> > &emp, int x, int y) {
    if (emp.at(x).at(y-1)) {
        if (kirai.at(x).at(y-1) > kirai.at(x).at(y)) {
            kirai.at(x).at(y-1) = kirai.at(x).at(y);
            update(kirai, emp, x, y-1);
        }
    } else {
        if (kirai.at(x).at(y-1) > kirai.at(x).at(y) + 1) {
            kirai.at(x).at(y-1) = kirai.at(x).at(y) + 1;
            update(kirai, emp, x, y-1);
        }
    }
    if (emp.at(x).at(y+1)) {
        if (kirai.at(x).at(y+1) > kirai.at(x).at(y)) {
            kirai.at(x).at(y+1) = kirai.at(x).at(y);
            update(kirai, emp, x, y+1);
        }
    } else {
        if (kirai.at(x).at(y+1) > kirai.at(x).at(y) + 1) {
            kirai.at(x).at(y+1) = kirai.at(x).at(y) + 1;
            update(kirai, emp, x, y+1);
        }
    }
    if (emp.at(x-1).at(y)) {
        if (kirai.at(x-1).at(y) > kirai.at(x).at(y)) {
            kirai.at(x-1).at(y) = kirai.at(x).at(y);
            update(kirai, emp, x-1, y);
        }
    } else {
        if (kirai.at(x-1).at(y) > kirai.at(x).at(y) + 1) {
            kirai.at(x-1).at(y) = kirai.at(x).at(y) + 1;
            update(kirai, emp, x-1, y);
        }
    }
    if (emp.at(x+1).at(y)) {
        if (kirai.at(x+1).at(y) > kirai.at(x).at(y)) {
            kirai.at(x+1).at(y) = kirai.at(x).at(y);
            update(kirai, emp, x+1, y);
        }
    } else {
        if (kirai.at(x+1).at(y) > kirai.at(x).at(y) + 1) {
            kirai.at(x+1).at(y) = kirai.at(x).at(y) + 1;
            update(kirai, emp, x+1, y);
        }
    }
    return;
}

int main() {
    int n; cin >> n;
    vector<int> p(n*n);
    for (int i = 0; i < n*n; i++) {
        cin >> p.at(i);
    }
    vector<vector<int64_t> > kirai(n+2, vector<int64_t>(n+2, -1));
    for (int k = 1; k <= (n+1)/2; k++) {
        for (int i = k; i <= n+1-k; i++) {            
            kirai.at(k).at(i) = k-1;
            kirai.at(n+1-k).at(i) = k-1;
            kirai.at(i).at(k) = k-1;
            kirai.at(i).at(n+1-k) = k-1;
        }
    }
    vector<vector<bool> > emp(n+2, vector<bool>(n+2, false));
    int64_t cnt = 0;
    for (int i = 0; i < n*n; i++) {
        int x = (p.at(i)-1)/n+1;
        int y = (p.at(i)-1)%n+1;
        cnt += kirai.at(x).at(y);
        emp.at(x).at(y) = true;
        kirai.at(x).at(y) = kirai.at(x-1).at(y);
        kirai.at(x).at(y) = min(kirai.at(x).at(y), kirai.at(x+1).at(y));
        kirai.at(x).at(y) = min(kirai.at(x).at(y), kirai.at(x).at(y-1));
        kirai.at(x).at(y) = min(kirai.at(x).at(y), kirai.at(x).at(y+1));
        update(kirai, emp, x, y);
    }
    cout << cnt << endl;
}

Measured memory_bytes: 52896
#include <bits/stdc++.h>
#define INF 2e9
#define MOD 1000000007
using namespace std;
typedef long long llong;
typedef long double ldouble;

using Graph = vector<vector<int>>;

// int ctoi(const char c){
//   if('0' <= c && c <= '9') return (c-'0');
//   return -1;
// }

// int gcd(int a, int b){
//   int ma = max(a,b);
//   int mi = min(a,b);
//   if(mi == 0) return ma;

//   return gcd(mi, ma%mi);
// }

int main(){
  int K, A, B;
  llong X;
  cin >> X;
  int year = 0;
  llong cash = 100;
  while(cash < X){
    ++year;
    cash = cash + cash/100;
  }
  cout << year << endl;
  return 0;
}

Measured memory_bytes: 3636
import sys

def set_list_flag(es):
    return len(list(set(es))) == 1

input = sys.stdin.readline

S = input()
S = S.replace('\n','')
s_list = list(S)

s_result = s_list
next_s_result = []
min_count = 10**6

if set_list_flag(s_list):
    print(0)
    exit(0)
for s in s_list:
    count = 0
    while not set_list_flag(next_s_result):
        count += 1
        next_s_result = []
        for i in range(len(s_result)):
            cur_s = s_result[i]
            nex_s = s_result[i+1]
            get_s = nex_s
            
            if cur_s == s:
                get_s = s

            next_s_result.append(get_s)
            if i+1 == len(s_result)-1:
                break
        s_result = next_s_result

    min_count = min(min_count,count)
    s_result = s_list
    next_s_result = []


print(min_count)

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


int main() {
    ll a, b, c, k;
    cin >> a >> b >> c >> k;
    if(a >= k) {
        cout << k << endl;
    } else if (a+b >= k ) {
        cout << a << endl;
    } else if (a+c+b >= k) {
        cout << 2*a+b-k << endl;
    } else {
       cout << a-c << endl;
    }

    return 0;
}



Measured memory_bytes: 3644
#include<bits/stdc++.h>
using namespace std;
signed main(){
  string t;
  cin>>t;
  for(int i=0;i<t.size();++i)if(t[i]=='?')t[i]='D';
  int r=0;
  for(int i=0;i<t.size();++i){
    if(t[i]=='D'){
      ++r;
      if(i>0&&t[i-1]=='P')++r;
    }
  }
  cout<<t;
}

Measured memory_bytes: 3696
/*
 * by:       okay__
 * 2020-05-17 18:03
 */

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

#define endl '\n'

int main()
{
    ios_base::sync_with_stdio(false); cin.tie(nullptr);
    int n; cin >>n;
    string s; cin >> s;
    if (n < s.size()) {
        for (int i = 0; i < n; i++) cout << s[i];
        cout << "...\n";
    } else {
        cout << s << endl;
    }
    
    return 0;
}

Measured memory_bytes: 3652
#include<iostream>
using namespace std;
int main()
{
    int x;
    cin>>x;
    if(x==25)
    {
        cout<<"Christmas";
    }
    else if(x==24)
    {
        cout<<"Christmas Eve";
    }
    else if(x==23)
    {
        cout<<"Christmas Eve Eve";
    }
    else if(x==22)
    {
        cout<<"Christmas Eve Eve Eve";
    }

    return 0;
}


Measured memory_bytes: 256
/* ---------- STL Libraries ---------- */

// IO library
#include <cstdio>
#include <iomanip>
#include <ios>
#include <iostream>

// algorithm library
#include <algorithm>
#include <cmath>
#include <numeric>

// container library
#include <deque>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>


/* ---------- Namespace ---------- */

using namespace std;


/* ---------- Type Abbreviation ---------- */

template <typename T>
using V = vector<T>;
template <typename T, typename U>
using P = pair<T, U>;

using ll = long long;
using PL = P<ll, ll>;
using PS = P<string, ll>;

using VI = V<int>;
using VVI = V<VI>;
using VL = V<ll>;
using VVL = V<VL>;
using VS = V<string>;
using VB = V<bool>;
using VVB = V<VB>;
using VPL = V<PL>;
using VPS = V<PS>;

#define fst first
#define snd second


/* ---------- conversion ---------- */

#define INT(c) static_cast<int>(c)
#define CHAR(n) static_cast<char>(n)
#define LL(n) static_cast<ll>(n)
#define DOUBLE(n) static_cast<double>(n)


/* ---------- container ---------- */

#define EACH(i, c) for (auto i = (c).begin(); i != (c).end(); i++)
#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort(ALL(c))
#define GSORT(c) sort(ALL(c), greater<decltype((c).front())>())
#define SZ(x) (LL((x).size()))


/* ---------- repetition ---------- */

#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define REP(i, n) FOR(i, 0, n - 1)
#define NREP(i, n) FOR(i, 1, n)

#define RFOR(i, a, b) for (ll i = (a); i >= (b); i--)
#define RREP(i, n) RFOR(i, n, 0)
#define RNREP(i, n) RFOR(i, n, 1)

// Usual REP runs from 0 to n-1 (R: n to 0)
// Natural REP runs from 1 to n (R: n to 1)


/* ---------- Constants ---------- */

// const ll MOD = 1e9 + 7;
// const int INF = 1 << 25;
// const ll INF = 1LL << 50;
// const double PI = 3.14159265358979;
// const ll dx[4] = {0, -1, 1, 0};
// const ll dy[4] = {-1, 0, 0, 1};
// const ll dx[8] = {-1, 0, 1, -1, 1, -1, 0, 1};
// const ll dy[8] = {-1, -1, -1, 0, 0, 1, 1, 1};


/* ---------- Short Functions ---------- */

template <typename T>
T square(T a) {
    return a * a;
}


/* ---------- Debug ---------- */
#define GET_VAR_NAME(variable) #variable

#define test(x) cout << GET_VAR_NAME(x) << " = " << x << endl;
#define testP(p) cout << GET_VAR_NAME(p) << " = (" << (p).fst << ", " << (p).snd << ")" << endl;


/* ^^^^^^^^^^^^^^^ Settting Part ^^^^^^^^^^^^^^^ */

/* ---------- Variances ---------- */


/* ---------- Functions ---------- */


/* ---------- Main Function ---------- */

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

  int X, A, B;
  cin >> X >> A >> B;
  cout << (X - A) % B << endl;
    
    return 0;
}

Measured memory_bytes: 384
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner stdIn = new Scanner(System.in);
        String input = stdIn.nextLine();
        String[] a = input.split(" ");
        int x = Integer.parseInt(a[0]);
        int n = Integer.parseInt(a[1]);
        input = stdIn.nextLine();
        int z = x;
        int w = x;
        int c = 0;
        int d = 0;
        String[] b = input.split(" ");

        if(b.length == n){
            while(true){
                for(int i = 0 ; i < b.length ; i++){
                    if(w == Integer.parseInt(b[i])){
                        c += 1;
                        w -= 1;
                    }
                    if(z == Integer.parseInt(b[i])){
                        c += 1;
                        z += 1;
                    }
                }
                if(c == 0){

                    break;
                }
                c = 0;
            }
            if(x - w > z - x){
                System.out.println(z);
            }else{
                System.out.println(w);
            }
        }else if(n == 0){
            System.out.println(x);
        }
    }
}


Measured memory_bytes: 36012
#include<bits/stdc++.h>
#define lld long long
#define pb push_back
#define mk make_pair
#define MAX (lld)1e18+7
#define lim (lld)1e9+7
#define MAX2 (lld)2e5+9
#define ff first
#define ss second
#define fastio ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;

const lld mod=lim;

lld power(lld x, lld y, lld p)  
{   lld res = 1;     x = x % p; if (x == 0) return 0;  
  
    while (y > 0)  
    { if (y & 1) res = (res*x) % p;  y = y>>1; x = (x*x) % p;   }  
    return res;  } 


lld extend_gcd(lld a, lld b, lld& x, lld& y) {
    if (b == 0) { x = 1;y = 0;return a;}
    lld x1, y1;
    lld d = extend_gcd(b, a % b, x1, y1);
    x = y1; y = x1 - y1 * (a / b);return d;	}

lld rowNum[]={-1,0,0,1};
lld colNum[]={0,-1,1,0};

int main()
{
	fastio
	lld n;
	cin>>n;
	string s;
	s="";
	while(n>0)
	{
		n--;
		lld rem=n%26 ;

		char c = (char)(rem+97) ;

		s = s+c;
		n = (n-rem)/26;
	}

	
	reverse(s.begin(), s.end());
	cout<<s<<endl;
}

Measured memory_bytes: 3568
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vb = vector<bool>;
using vs = vector<string>;
using msi = map<string, int>;
using mii = map<int, int>;
using psi = pair<string, int>;
using pii = pair<int, int>;
using vlai = valarray<int>;
#define rep(i,n) for(int i=0;i<n;i++)
#define range(i,s,n) for(int i=s;i<n;i++)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define INF 1E9
#define LINF 1E17
#define EPS 1E-9
#define MOD 1000000007
#define PI 3.1415926535897932384

template<class S, class T>ostream& operator<<(ostream&os, pair<S, T>p) { os << "[" << p.first << ", " << p.second << "]"; return os; };
template<class S>auto&operator<<(ostream&os, vector<S>t) { bool a = 1; for (auto s : t) { os << (a ? "" : " ") << s; a = 0; } return os; }

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


int main() {
	string s;
	cin >> s;
	int ans = 0;
	if (s.size() % 2 == 1) {
		int loc = s.size() / 2;
		int tgt = s[s.size() / 2];
		rep(i, loc) {
			if (s[loc - i - 1] == tgt&& s[loc + i + 1] == tgt) {
				ans++;
			}
			else break;
		}
		cout << loc + ans + 1 << endl;
	}
	else {
		int loc = s.size() / 2;
		int tgt = s[s.size() / 2];
		rep(i, loc) {
			if (s[loc - i-1] == tgt&& s[loc + i] == tgt) {
				ans++;
			}
			else break;
		}
		cout << loc + ans << endl;
	}
}


Measured memory_bytes: 512
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <set>
#include <string>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <utility>
using namespace std;

typedef unsigned int uint;
typedef long long int64;
typedef unsigned long long uint64;
typedef pair<int, int> ii;
typedef pair<int64, int64> int64int64;
typedef vector<int> vint;
typedef vector<int64> vint64;
typedef vector<uint64> vuint64;
typedef vector<vint> vvint;
typedef vector<vint64> vvint64;
typedef vector<vuint64> vvuint64;
typedef vector<ii> vii;
typedef vector<vector<ii>> vvii;

#define mp make_pair
#define pb push_back
#define ALL(a) a.begin(), a.end()
#define fi first
#define se second
#define fori(n) for(int i = 0; i < n; ++i)
#define forj(n) for(int j = 0; j < n; ++j)
#define fork(n) for(int k = 0; k < n; ++k)
#define INF9 (int64)(1e9)
#define INF18 (int64)(1e18)

template<typename T>
struct compF{
	bool operator()(const pair<T, T> &a, const pair<T, T> &b){
		return a.first < b.first;
	}
};

template<typename T>
struct compS{
	bool operator()(const pair<T, T> &a, const pair<T, T> &b){
		return a.second < b.second;
	}
};

template<typename T>
void printMatrix(const string &txt, vector<vector<T>> &a){
	cout << txt;
	fori(a.size()){
		forj(a[i].size())
			cout << a[i][j] << ' ';

		cout << endl;
	}
}

template<typename T>
void printVector(const string &txt, vector<T> &a){
	cout << txt;
	for (int i = 0; i < a.size(); ++i)
		cout << a[i] << ' ';
	cout << endl;
}

template<typename T>
void readVector(int n, vector<T> &a){
	if (a.size() < n)
		a.resize(n);

	fori(n) cin >> a[i];
}

template<typename T1, typename T2>
bool exist(map<T1, T2> &m, T1 x){
	if (m.find(x) == m.end())
		return false;

	return true;
}

int64 gcd(int64 a, int64 b){
	while (a != 0 && b != 0){
		if (b > a)
			b %= a;
		else
			a %= b;
	}

	return a + b;
}

int64 minFactor(int64 x){
	for (int64 i = 2; i * i <= x; ++i)
		if (x % i == 0)
			return i;

	return x;
}

int64 allFactors(int64 x, vint64 &prms, vint64 &prm_cnt){
	prms.clear();
	prm_cnt.clear();
	while (x > 1){
		int64 t = minFactor(x);
		prms.push_back(t);
		int s = prms.size() - 1;
		prm_cnt.push_back(0);
		while (x % t == 0){
			x /= t;
			++prm_cnt[s];
		}
	}

	return 0;
}

int main(){

	ios_base::sync_with_stdio(0);
	cin.tie();
	
	int n;
	cin >> n;
	vint a(n);

	readVector(n, a);

	sort(ALL(a));
	reverse(ALL(a));
	int64 res = 0;

	int cnt = 0;
	int j = 0;
	fori(n){
		res += a[j];
		++cnt;
		if (cnt == 2){
				++j;
				cnt = 0;
		}
	}

	res -= a[0];
	cout << res << endl;

	return 0;
}


Measured memory_bytes: 4048
#include <bits/stdc++.h>
using namespace std;
#define _overload3(_1,_2,_3,_4,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,n) (int i=a;i<n;i++)
#define per(i,a,n,s) (int i=a;s>0?i<n:i>n;i+=s)
#define range(...) _overload3(__VA_ARGS__,per,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
template<class T>inline bool chmax(T &a, const T b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>inline bool chmin(T &a, const T b) { if (b<a) { a=b; return 1; } return 0; }
const int inf = 1e9+10, mod = 1e9+7; const long long llinf = 1e18;
// head

int chan[30][100000+10];
int main(){
  int n,c;
  cin >> n >> c;
  for range(i,n){
    int s,t,c;
    cin >> s >> t >> c;
    s--;t--;c--;
    chan[c][s] += 1;
    chan[c][t+1] -= 1;
  }
  for range(ci,30){
    for range(i,100000+9){
      chan[ci][i+1] += chan[ci][i];
    }
  }
  long long ans = 0;
  for range(i,100000+9){
    long long tmp = 0;
    for range(ci,30){
      tmp += min(1,chan[ci][i]) ;
    }
    chmax(ans,tmp);
  }
  cout << ans << endl;
  // for range(i,15){ cout << chan[0][i] << " ";} cout << endl;
}

Measured memory_bytes: 11904