akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
int test[123456];
int main(){
  int n, k, a, b, ans = 1; cin >> n;
  if(n/100 * 5>=n%100){
    cout<<1<<endl;
  }
  else{
    cout<<0<<endl;
  }
}

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

#define rep(i, n) for (int i = 0; i < n; ++i)
#define ALL(a) (a).begin(), (a).end()
#define rALL(a) (a).rbegin(), (a).rend()
#define SZ(x) ((int)(x).size())
using ll = long long;
using ull = unsigned long long;
using P = pair<int, int>;
using llP = pair<ll, ll>;
using DoP = pair<double, double>;
const int di[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dj[] = {1, 0, -1, 0, 1, -1, 1, -1};
const int INF = 1 << 28;
const ll INF64 = 1ll << 55;
//const int mod = 1000000007;
const int mod = 998244353;

template <class T>inline bool chmin(T &a, const T b)
{
  if (a > b)
  {
    a = b;
    return true;
  }
  return false;
}
template <class T>inline bool chmax(T &a, const T b)
{
  if (a < b)
  {
    a = b;
    return true;
  }
  return false;
}
template <class T>inline void line_out(const vector<T> vec) {
  int n = SZ(vec);
  rep(i, n) {
    cout << vec[i];
    if(i < n-1) cout << " ";
  }
  cout << endl;
  return;
}

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

  // for prime mod
  mint inv() const
  {
    return pow(mod - 2);
  }
  mint &operator/=(const mint a)
  {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const
  {
    mint res(*this);
    return res /= a;
  }
};


int main()
{
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  vector<vector<mint>> dp(c+1, vector<mint>(d+1, 0));
  dp[a][b] = 1;
  for(int i = a+1; i <= c; ++i) dp[i][b] = dp[i-1][b]*b;
  for(int j = b+1; j <= d; ++j) dp[a][j] = dp[a][j-1]*a;

  for(int i = a+1; i <= c; ++i) {
    for(int j = b+1; j <= d; ++j) {
      dp[i][j] = dp[i-1][j]*j + dp[i][j-1]*i - dp[i-1][j-1]*(i-1)*(j-1);
    }
  }
  cout << dp[c][d].x << endl;
}

Measured memory_bytes: 73748
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
  int n;cin>>n;
  vector<long long> A(n);
  int mins = 0;
  long long sm = 0;
  for(int i = 0; n > i; i++){
    cin>>A[i];
    sm += abs(A[i]);
    if(A[i] < 0)mins++;
    A[i] = abs(A[i]);
  }
  sort(A.begin(),A.end());
  if(mins%2){
    sm -= A[0]*2;
  }
  cout << sm << endl;
}
    


Measured memory_bytes: 1024
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <ctype.h>
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include <math.h>

#define N_MAX (100)
#define P_MAX (100)
#define DP_ARRAY_SIZE (N_MAX * P_MAX / 32 + 1)

#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define ABS(a) ((a) < 0 ? -(a) : (a))
#define ABSS(a, b) ((a) > (b) ? (a) - (b) : (b) - (a))

int compare_sz_desc(const void* a, const void* b) {
    return *((size_t*)a) > * ((size_t*)b) ? -1 : 1;
}

int compare_f(const void* a, const void* b) {
    return *((int64_t*)a) < *((int64_t*)b) ? -1 : 1;
}

int compare_f2(const void* a, const void* b) {
    return *((uint64_t*)a) > * ((uint64_t*)b) ? -1 : 1;
}

static size_t comb(const size_t n, const size_t r) {
    size_t result = 1;

    for (size_t i = 0; i < r; i++) {
        result *= n - i;
        result /= i + 1;
    }

    return result;
}

static uint64_t combU64(const uint64_t n, const uint64_t r) {
    uint64_t result = 1;

    for (uint64_t i = 0; i < r; i++) {
        result *= n - i;
        result /= i + 1;
    }

    return result;
}

static uint64_t gcdU64(uint64_t m, uint64_t n)
{
    uint64_t temp;

    while (m % n != 0) {
        temp = n;
        n = m % n;
        m = temp;
    }

    return n;
}

static size_t gcdZu(size_t m, size_t n) {
    size_t temp;

    while (m % n != 0) {
        temp = n;
        n = m % n;
        m = temp;
    }

    return n;
}

int main(void) {
    size_t N,M;

    scanf("%zu %zu\n", &N, &M);

    size_t leftEdge = 1;
    size_t rightEdge = N;

    for (size_t i = 0; i < M; i++) {
        size_t L, R;
        scanf("%zu %zu", &L, &R);

        if (leftEdge < L) {
            leftEdge = L;
        }

        if (R < rightEdge) {
            rightEdge = R;
        }
    }

    if (leftEdge <= rightEdge) {
        printf("%zu\n", rightEdge - leftEdge + 1);
    }
    else {
        puts("0");
    }

    return 0;
}


Measured memory_bytes: 128
from collections import Counter
n = input()
A = map(int, raw_input().split())
C = Counter(A)
ans = 0
for k in C.keys():
    if C[k] >= 3:
        ans += (C[k]-1) / 2
        C[k] = 1 if C[k] % 2 == 1 else 2
tmp = 0
for v in C.values():
    if v == 2:
        tmp += 1
#print ans, tmp
ans += tmp / 2 + tmp % 2
print n-ans*2


Measured memory_bytes: 16448
# AOJ ITP2_4_C: Swap
# Python3 2018.6.24 bal4u

n = int(input())
a = list(map(int, input().split()))
q = int(input())
for i in range(q):
	b, e, t = map(int, input().split())
	s = t+e-b
	if t > b:
		a = a[:b] + a[t:s] + a[e:t] + a[b:e] + a[s:]
	else:
		a = a[:t] + a[b:e] + a[s:b] + a[t:s] + a[e:]
print(*a)


Measured memory_bytes: 5812
#include <stdio.h>

int main() {
	int l,r,d;
	scanf("%d %d %d", &l, &r, &d);
	int kelipatan = 0;
	for(int i = l; i <= r; i++){
		if ( i % d == 0){
		kelipatan ++;
			
		}
		
	}
	printf("%d", kelipatan);
	return 0;
}

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

#define ll long long
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vl vector<ll>
#define vul vector<ull>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vi2d vector<vi >
#define vl2d vector<vl >
#define vpll vector<pll >

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rz resize
#define fr(i,n) for(i=0;i<(n);i++)
#define frr(i,n) for(i=(n-1);i>=0;i--)
#define fre(i,n) for(i=0;i<=(n);i++)
#define frre(i,n) for (i=(n);i>=0;i--)
#define frab(i,a,b) for(i=(a);i<(b);i++)
#define freab(i,a,b) for(i=(a);i<=(b);i++)
#define frrab(i,a,b) for(i=(b-1);i>=a;i--)
#define frreab(i,b,a) for(i=(b);i>=a;i--)

#define sz(a) int((a).size())
#define mset(a,b) (memset(a,b,sizeof(a)))
#define max3(a,b,c) (max((a),max((b),(c))))
#define min3(a,b,c) (min((c),min((a),(b))))
#define sumv(v) accumulate(all(v),ll(0))
#define productv(v) accumulate(all(v), ll(1), multiplies< ll >())
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
vector <ll> sprime;
vector<char> prime (1000000, true);
void sieve(ll n)
{
  //O(nloglogn) time
  sprime.pb(0);
  prime[0] = prime[1] = false;
  ll cnt = 0;
  for (ll i = 2; i <= n; ++i)
  {
    if (prime[i])
    {
      cnt++;
      sprime.pb(i);
      for (ll j = 2 * i; j <= n; j += i)
        prime[j] = false;
    }
  }
}
ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b); }
ll fastpowMOD(ll a, ll p, ll MOD) { if (p == 0) return 1; ll z = fastpowMOD(a, p / 2, MOD); z = (z * z) % MOD; if (p % 2) z = (z * a) % MOD; return z; }
ll fastpow(ll a, ll p) { if (p == 0) return 1; ll z = fastpow(a, p / 2); z = (z * z); if (p % 2) z = (z * a); return z; }

#define mod 1000000007
#define inf LLONG_MAX
#define minf LLONG_MIN
#define pi 3.14
#define ex 2.71

//*********************************************///
const int N = 1e5+5;
//int i,j;
ll dp[22][2097200];
ll a[22][22];
ll n;

ll fun(ll p,ll mask)
{
  int i;
  if(dp[p][mask]!=-1)
    return dp[p][mask];
  if(p==0)
  {
    if(mask==(pow(2,n)-1))
      return dp[p][mask]=1;
    else
      return dp[p][mask]=0;
  }

  dp[p][mask]=0;
  freab(i,1,n)
  {
    if(a[p][i] && !(mask & (1<<(i-1))))
    {
      ll k= mask|(1<<(i-1));
      dp[p][mask]=(dp[p][mask]+fun(p-1,mask|(1<<(i-1))))%mod;
    }
  }
  return dp[p][mask];
}
void solve()
{

  cin>>n;
  int i,j;
  freab(i,1,n)
  {
    //cout<<i<<endl;
    freab(j,1,n)
      cin>>a[i][j];
  }
  mset(dp,-1);
  int ans=fun(n,0);
  cout<<ans<<endl;
}

int main()
{
  fast;
  int z;
  //cin>>z;
  z=1;
  while(z--)
  {
    solve();
  }
  return 0;
}


Measured memory_bytes: 361856
#include<bits/stdc++.h>
using namespace std;
 
#define rep(i,m,n) for(int i = (m); i < (int)(n); i++)
#define rrep(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define vsort(v) sort(v.begin(), v.end());
#define rvsort(v) sort(v.begin(), v.end(),greater<int>());
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl  
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define ret return
#define lb(v,n) lower_bound(v.begin(),v.end(),n)
#define ub(v,n) upper_bound(v.begin(),v.end(),n)
#define mae(v) max_element(v.begin(),v.end())
#define mie(v) min_element(v.begin(),v.end())
#define INF 0x7FFFFFFF
#define mod 1000000007
#define fir first
#define sec second
typedef long long ll;
////////////////////////////////////////////////////////////

int main(){
	int n;
	cin >> n;
	vector<int> l(n);
	rep(i,0,n) cin >> l[i];
	vsort(l);
	int sum = accumulate(l.begin() , l.end() - 1 , 0);
	if( sum > l[n-1] ) Yes;
	else No;
	ret 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define pi 3.141592653589793238

int32_t main() {

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

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);


	int a, b, c, k;
	cin >> a >> b >> c >> k;

	int i = 0;
	if (a >= k) {
		cout << k;
		return 0;
	}

	else {
		int ans = a;
		int r = k - a;
		if (b >= r) {
			cout << ans;
			return 0;
		}
		else {
			r = r - b;
			ans -= r;
			cout << ans;

		}

		return 0;
	}


}

Measured memory_bytes: 3576
#include<stdio.h>
 int main(void){
    int r,c,i,j;
    int a[150][150];
    int sum=0;
    scanf("%d %d",&r,&c);
    for(i=0;i<r;i++){
        for(j=0;j<c;j++){
            a[i][j]=0;
        }
    }
    for(i=0;i<r;i++){
        for(j=0;j<c;j++){
           scanf("%d",&a[i][j]);
           sum+=a[i][j];
           a[i][c]+=a[i][j];
           a[r][j]+=a[i][j];
           a[r][c]+=a[i][j];
        }
    }
    for(i=0;i<=r;i++){
        for(j=0;j<=c;j++){
            printf("%d",a[i][j]);
            if(j<c){
                printf(" ");
            }
        }
        printf("\n");
    }
    return 0;
 }

Measured memory_bytes: 672
N,M = map(int,input().split())
arr = list(map(int,input().split()))

res = 0
for i in range(N):
    if arr[i] < (1/(4*M)*sum(arr)):
        res = res
    else:
        res += 1

if res >= M:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 3060
#include <algorithm>
#include <cassert>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>

using namespace std;

typedef long long ll;

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

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

vector<int> arr = {
    1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51
};

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

    cout << arr[K - 1] << endl;

    return 0;
}


Measured memory_bytes: 256
//i日目の当番,i-1日目に鍵を持ち帰った人どちらも、i-1日目に鍵を持ち帰った人と考えたほうがやりやすい。

#include<iostream>
#define rep(i,n) for(i = 0;i < n;i++)
using namespace std;

int N;
char S[1002];
int dp[1001][2][2][2];	//dp[i][ほげ] = i日目の出席状況.0日目はJだけが出席している。
char *str = "JOI";

int main(){
	int i,j,k,l,m,n,o,p;
	int touJ,touO,touI;		//次の日当番かどうか
	int keyJ,keyO,keyI;		//次の日鍵を持ってくるかどうか
	int bitJ,bitO,bitI;		//次の日必ず出席するかどうか
	cin >> N >> S;

	dp[0][1][0][0] = 1;
	rep(i,N){
		touJ = (S[i]==str[0]);
		touO = (S[i]==str[1]);
		touI = (S[i]==str[2]);
		rep(j,2){
			rep(k,2){
				rep(l,2){
					if( dp[i][j][k][l] == 0 ){
						continue;
					}

					int plusflag[2][2][2] = {0};
					rep(m,3){
						keyJ = 0,keyO = 0,keyI = 0;
						keyJ = ( m == 0 && j == 1 );
						keyO = ( m == 1 && k == 1 );
						keyI = ( m == 2 && l == 1 );
						if( keyJ == 0 && keyO == 0 && keyI == 0 )
							continue;
						bitJ = max( touJ,keyJ );
						bitO = max( touO,keyO );
						bitI = max( touI,keyI );
						//あり得る候補にタス(各状態で1回だけ)
						rep(n,2){
							rep(o,2){
								rep(p,2){
									if( n < bitJ || o < bitO || p < bitI )
										continue;
									if( plusflag[n][o][p] )
										continue;
									dp[i+1][n][o][p] += dp[i][j][k][l];
									dp[i+1][n][o][p] %= 10007;
									plusflag[n][o][p] = 1;
								}
							}
						}
					}
				}
			}
		}
	}

	//デバッグ
	/*rep(i,N+1){
		rep(j,2){
			rep(k,2){
				rep(l,2){
					cout << dp[i][j][k][l] << " ";
				}
			}
		}
		cout << endl;
	}*/

	int ans = 0;
	rep(i,2){
		rep(j,2){
			rep(k,2){
				ans += dp[N][i][j][k];
				ans %= 10007;
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1196
#include <iostream>
#include <fstream>
#include <cassert>
#include <typeinfo>
#include <vector>
#include <stack>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#include <random>
#include <complex>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<long double,long double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<long double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<61;
const double pi=acos(-1);
const double eps=1e-10;
const ll mod=1e9+7;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

string s;

int main(){
	cin>>s;
	int A=s[0]-'0',B=s[1]-'0',C=s[2]-'0',D=s[3]-'0';
	if(A+B+C+D==7) cout<<A<<'+'<<B<<'+'<<C<<'+'<<D<<'='<<7<<endl;
	else if(A+B+C-D==7) cout<<A<<'+'<<B<<'+'<<C<<'-'<<D<<'='<<7<<endl;
	else if(A+B-C+D==7) cout<<A<<'+'<<B<<'-'<<C<<'+'<<D<<'='<<7<<endl;
	else if(A+B-C-D==7) cout<<A<<'+'<<B<<'-'<<C<<'-'<<D<<'='<<7<<endl;
	else if(A-B+C+D==7) cout<<A<<'-'<<B<<'+'<<C<<'+'<<D<<'='<<7<<endl;
	else if(A-B+C-D==7) cout<<A<<'-'<<B<<'+'<<C<<'-'<<D<<'='<<7<<endl;
	else if(A-B-C+D==7) cout<<A<<'-'<<B<<'-'<<C<<'+'<<D<<'='<<7<<endl;
	else if(A-B-C-D==7) cout<<A<<'-'<<B<<'-'<<C<<'-'<<D<<'='<<7<<endl;
}

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

const double PI = 3.14159265358979323846;

int main() {
  int r;
  cin >> r;
  double ans = (double)2.0 * (double)r * PI;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3784
#include <iostream>
#include <string>
#include <cmath>

using namespace std;

int main() {
	int a, b = 0;
	cin >> a >> b;
	
	int t = a * pow(10,floor(log10(b))+1) + b;

	if (t == pow(floor(sqrt(t)),2)) {
		cout << "Yes";
	}
	else {
		cout << "No";
	}

	return 0;
}

Measured memory_bytes: 512
#include<stdio.h>
int main(){
	int N;
	char S[300001];
	int answer=114514334;
	int Wnum[300001]={},Enum[300001]={};
	scanf("%d %s",&N,S);
	for(int i=0;i<N;i++){
		if(S[i]=='W'){
			Wnum[i+1]=Wnum[i]+1;
			Enum[i+1]=Enum[i];
		}
		else{
			Wnum[i+1]=Wnum[i];
			Enum[i+1]=Enum[i]+1;
		}
	}
	for(int i=0;i<N;i++){
		int changepeople=Wnum[i]-Wnum[0]+Enum[N]-Enum[i+1];
		if(changepeople<answer) answer=changepeople;
	}
	printf("%d\n",answer);
	return 0;
}


Measured memory_bytes: 2816
#include<iostream>
#include <algorithm>
using namespace std;
int main(){
  int N,ans,i;
  ans = 0;
  cin >> N;
  int A[N];
  for(i = 0;i<N;i++){
      cin>>A[i];
  }
  sort(A, A + N, greater<int>());
  ans += A[0] / 2;
  for(i = 1;i<N;i++)
  ans += A[i];
  cout << ans << "\n";
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
/* typedef */
typedef long long ll;
typedef pair<int, int> pii;
/* constant */
const int INF = 1 << 30;
const ll LINF = 1LL << 50;
const int NIL = -1;
const int MAX = 10000;
const int mod = 1000000007;
const double pi = 3.141592653589;
/* global variables */
/* function */
/* main */
int main(){
    int N;
    cin >> N;
    ll ans = 1;
    for (ll i = 1; i <= N; i++) {
        ans = (ans * i) % mod;
    }
    cout << ans << '\n';
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG //これつけるとA[N]でもいいらしい
//for文のマクロ
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define big 1000000007
#define all(a) sort((a).begin(),(a).end()) //ソートのマクロ
#define Re(a) reverse((a).begin(),(a).end())
int main(){
    string s;
    cin>>s;
    int n=s.length();
    //n-7文字取りのぞく
    bool ans=false;
    /*
    if(n==7){
        if(s=="keyence"){
            cout<<"YES"<<endl;
        }
        else{
            cout<<"NO"<<endl;
        }
        return 0;
    }
    */
    rep(i,8){
        //s.substr(i,n-7)取り除く
        string t;
        t = s.substr(0,i)+s.substr(n-7+i,7-i);
        //cout<<t<<endl;
        if(t=="keyence"){
            ans = true;
        }
    }
    if(ans){
        cout<<"YES"<<endl;
    }
    else{
        cout<<"NO"<<endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(void){
    long long int N;
    long long int A;
    long long int B;
    
    cin >> N >> A >> B; // A:青 B:赤
    
    long long int q = N / (A + B);
    long long int r = N % (A + B);
    
    long long int count = q * A;
    
    if ( r >= A) {
        count += A; 
    } else {
        count += r;
    }
    
    cout << count << endl;
    
    
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		if(a < b){
			System.out.println("a < b");
		}else if(a>b){
			System.out.println("a > b");
		}else if (a==b){
			System.out.println("a == b");
		}
	}
}

Measured memory_bytes: 26152
#include<bits/stdc++.h>
using namespace std;
int i,j,a[20],n,b[20],c,l,k;
int main()
{
  for(cin>>n;i<n;i++)cin>>a[i];
  for(i=0;i<n;i++){
    cin>>b[i];
    if(a[i]-b[i]>0)c+=(a[i]-b[i]);
  }
  cout<<c;
}

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

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define FORd(i, a, b) for (int i = (a); i >= (b); i--)
#define REP(i, n) FOR(i, 0, n)
#define ll long long
#define _ << " " <<

using namespace std;

const int MAXN = 3010;

const int mod = 1e9 + 7;
int add(int x, int y) {
  x += y;
  if(x >= mod) return x - mod;
  return x;
}
int mul(int x, int y) {
  return (ll) x * y % mod;
}
int sub(int x, int y) {
  x -= y;
  if(x < 0) return x + mod;
  return x;
};

int dp[MAXN][MAXN];
int pr[MAXN];

int main() {
  dp[0][0] = 1;

  int n; cin >> n;
  string s; cin >> s;

  REP(i, MAXN) pr[i] = 1;

  FOR(i, 1, n) {
    REP(j, i + 1)  {
      if(s[i - 1] == '<') {
        dp[i][j] = (j ? pr[j - 1] : 0);
      }
      else {
        dp[i][j] = pr[MAXN - 1];
        if(j) dp[i][j] = sub(dp[i][j], pr[j - 1]);
      }
    }
    pr[0] = dp[i][0];
    FOR(j, 1, MAXN) pr[j] = add(pr[j - 1], dp[i][j]);
  }

  cout << pr[MAXN - 1] << endl;
}


Measured memory_bytes: 34304
#include <stdio.h>

int souatari(int,int);
int n,A[2000];

int main(){
    int q,Q[2000],i;
    
    scanf("%d",&n);
    for(i=0;i<n;i++) scanf("%d",&A[i]);
    scanf("%d",&q);
    for(i=0;i<q;i++) scanf("%d",&Q[i]);

    for(i=0;i<q;i++){
        if(souatari(0,Q[i])==1) printf("yes\n");
        else printf("no\n");
    }

    return 0;
}

int souatari(int i,int q){
    int res;
    if(q==0) return 1;
    if(i>=n) return 0;
    res = souatari(i + 1,q) || souatari(i + 1,q-A[i]);
    return res;
}


Measured memory_bytes: 2068
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> iint;
typedef pair<ll,ll> llll;
#define ALL(x) (x).begin(),(x).end()
const ll zero = 0;
const ll INF = 3000000000000000000; //10^18
const int inINF = 1000000000; //10^9
const ll MOD = 1000000007; //10^9+7
const ll MOD2 = 998244353;

int main(){
    int N, M;
    cin >> N >> M;
    vector<int> X(N);
    for (int i = 0; i < N; i++) {
        cin >> X[i];
    }
    vector<int> A(M, 0);
    for (int i = 0; i < N; i++) {
        A[X[i] % M]++;
    }

    int tmp;
    int ans = 0;
    for (int i = 1; i < M; i++) {
        if(i != M - i){        
            tmp = min(A[i], A[M-i]);
            A[i] -= tmp;
            A[M-i] -= tmp;
        }
        else{
            tmp = A[i] / 2;
            A[i] = A[i] % 2;
        }
        ans += tmp;
    }
    ans += A[0] / 2;
    A[0] = A[0] % 2;

    sort(ALL(X));
    int i = 0;
    while(i < N-1) {
        if(X[i] == X[i+1]){
            tmp = X[i] % M;
            if(A[tmp] >= 2){
                ans++;
                A[tmp] -= 2;
            }
            i++;
        }
        i++;
    }
    printf("%d\n", ans);


}

Measured memory_bytes: 3956
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int u, v; ll w; };

ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

int main() {
	for (;;) {
		int n, w; cin >> n >> w;
		if (n == 0) break;
		vector<int> a(11);
		int r = 0;
		while (n--) {
			int v; cin >> v;
			a[v / w]++;
			r = max(r, v / w);
		}
		int h = 0;
		for (int i = 0; i < 11; i++)
			h = max(h, a[i]);
		double sum = 0.01;
		for (int i = 0; i <= r; i++)
			sum += (double)(r - i) / r * a[i] / h;
		printf("%.10f\n", sum);
	}
}

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

typedef long long int ll;

void fileioe(){
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout); 
	freopen("error.txt","w",stderr);
}
#define GO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

#ifndef ONLINE_JUDGE
#define fioe() fileioe()
#else
#define fioe() 1
#endif
//!
bool cmp(pair<ll,ll> a,pair<ll,ll> b){
	return a.first<b.first;
}
int main()
{
	GO
	//fioe();
	ll x,y;
	cin>>x>>y;
	ll a,b,c;
	cin>>a>>b>>c;
	ll size=max(a,max(b,c));
	ll red[size+2],blue[size+2],cless[size+2];
	memset(red,0,sizeof(red));
	memset(blue,0,sizeof(blue));
	memset(cless,0,sizeof(cless));
	for(int i=0;i<a;i++){
		cin>>red[i];
	}	
	for(int i=0;i<b;i++){
		cin>>blue[i];
	}
	for(int i=0;i<c;i++){
		cin>>cless[i];
	}
	sort(red,red+size,greater<ll> ());
	sort(blue,blue+size,greater<ll> ());
	sort(cless,cless+size,greater<ll> ());
	ll ans=0;
	ll i=0,j=0,k=0;
	ll count=0;
	while(x+y-count>0){
		priority_queue<pair<ll,ll> > p;
		if(x>0)
			p.push({red[i],3});
		if(y>0)
			p.push({blue[j],2});
		 p.push({cless[k],1});
		auto xx=p.top();p.pop();
		bool xdone=false,ydone=false;
		if(xx.second==3){
			i++;x--;
		}
		else if(xx.second==2){
			j++;y--;
		}
		else{
			k++;count++;
		}
		ans+=xx.first;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 2560
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <queue>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <stdio.h>
#include <complex>
#include <cstdint>
#include <tuple>

#define M_PI       3.14159265358979323846

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<int, PII> TIII;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;

//container util

//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((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())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define MOD 1000000007

int ways[1 << 8][8];


int main() {
	ways[1][0] = 1;
	int n, m;
	scanf("%d%d", &n, &m);
	auto g = VVI(n);
	REP(i, m) {
		int a, b;
		scanf("%d%d", &a, &b);
		a--, b--;
		g[a].PB(b);
		g[b].PB(a);
	}
	FOR(i,1, (1 << n) - 1) {
		REP(j, n) {
			REP(k, g[j].size()) {
				if (i & (1 << g[j][k]))continue;
				ways[i | (1 << g[j][k])][g[j][k]] += ways[i][j];
			}
		}
	}
	int ret = 0;
	REP(i, n) {
		ret += ways[(1 << n) - 1][i];
	}
	printf("%d\n", ret);
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(i,a,b) for(int i=int(a); i<int(b); ++i)
#define FORD(i,a,b) for(int i=int(a); i<int(b); --i)
#define REP(i,N) for(int i=0; i<int(N); ++i)
#define REPD(i,N) for(int i=0; i<int(N); --i)
#define PB push_back
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1000000000000 //10^12:∞
#define MOD 1000000007 //10^9+7
#define MAXR 100000 //配列の最大のrenge

int main() {
    int N,K; cin>>N>>K;
    ll res = 0;
    res = K*pow(K-1,N-1);
    cout << res;
}

Measured memory_bytes: 3908
Q,H,S,D = map(int,input().split())
N = int(input())


L2 = min(D,2*S,4*H,8*Q)
L1 = min(S,2*H,4*Q)

ans = 0

ans+= (N//2)*L2
ans+= (N%2) *L1
ans=int(ans)
print(ans)

Measured memory_bytes: 3064
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <string>
#include <vector>
#include <math.h>
#include <queue>
#include <deque>
#include <stack>
#include <map>
const int MOD = 1e9+7;
#define PI 3.14159265359
typedef long long ll;
using namespace std;

string s;
int k;
vector<string> str; 

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

	for (int i = 1; i <= k; i++){
		for (int j = 0; j < s.length() - i + 1; j++){
			str.push_back(s.substr(j, i));
		}
	}

	sort(str.begin(), str.end());
	auto result = unique(str.begin(), str.end());
	str.erase(result, str.end());
	cout << str[k-1] << endl;
	return 0;
}


Measured memory_bytes: 4244
N, A, B = [int(i) for i in input().split()]

ret_sum = 0
for i in range(N+1) :
	t_sum = 0
	for s in str(i) :
		t_sum += int(s)
		if t_sum > B :
			break
	if A <= t_sum <= B :
		ret_sum += i
		
print(ret_sum)

Measured memory_bytes: 3060
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
using namespace std;

int a, b, c;

int main() {
    ios_base::sync_with_stdio(false);

    cin >> a >> b >> c;
    int Max = max(max(a, b), c);

    if (Max == (a+b+c-Max))
        cout << "Yes" << endl;
    else
        cout << "No" << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<n+1;i++)
#define sort(A) sort(A.begin(),A.end())
#define reverse(A) reverse(A.begin(),A.end())
typedef long long ll;
typedef pair<int,int> P;

int main(){
  int n,k;
  cin >> n >> k;
  const ll INF = pow(10,9)+7;
  ll comb[2100][2100];
  comb[0][0] = 1;
  rep(i,2050){
    rep(j,i+1){
      comb[i][j] %= INF;
      comb[i+1][j] += comb[i][j];
      comb[i+1][j+1] += comb[i][j];
    }
  }
  rep1(i,k){
    ll comb1 = comb[n-k+1][i];
    ll comb2 = comb[k-1][i-1];
    cout << comb1*comb2%INF << endl;
  }
}

Measured memory_bytes: 33792
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define MAX(x,y) (((x)>(y))?(x):(y))

int i,j;
int n,k,a[100005],x,ans,ans2;
int comp(const void *p,const void *q){
	return *(int *)p-*(int *)q;
}

int main(){
	scanf("%d %d",&n,&k);
	while(n!=0 && k!=0){
		for(i=1;i<=n;i++){
			/*scanf("%d",&x);
			a[i]+=x;
			if(i<n)a[i+1]=a[i];*/
			scanf("%d",&a[i]);
		}
		ans=0;
		for(i=1;i<=k;i++)ans+=a[i];
		ans2=ans;
		for(i=k+1;i<=n;i++)/*if(a[i]-a[i-k]>0)*/ans2+=a[i]-a[i-k],ans=MAX(ans,ans2);
		printf("%d\n",ans);
		scanf("%d %d",&n,&k);
	}
	return 0;
}

Measured memory_bytes: 0
#include <stdio.h>

int main()
{
	int n,a,b,c;
	scanf("%d",&n);
	while(n--){
		int tmp;
		scanf("%d %d %d",&a,&b,&c);
		if (a>b) {
			tmp = a;
			a = b;
			b = tmp;
		}
		if (b>c) {
			tmp = b;
			b = c;
			c = tmp;
		}
		if (a>b) {
			tmp = a;
			a = b;
			b = tmp;
		}
		if(a*a+b*b==c*c) printf("YES\n");
		else printf("NO\n");
	}
	return(0);
}
	

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1e9+7;
const long long INF = 1e15;

int main(){
    int x;
    cin >> x;
    if(x >= 30) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 3632
#include <iostream>
#include <cctype>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <string>
#include <functional>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iomanip>
#include <bitset>

#define PB push_back
#define MP make_pair
#define YES cout<<"YES"<<endl
#define Yes cout<<"Yes"<<endl
#define NO cout<<"NO"<<endl
#define No cout<<"No"<<endl
#define INF (1<<30)
#define LLINF (1<<60)
#define MOD 1000000007
#define REP(i, n) for(int i=0;i<n;i++)
using ll = long long;
using namespace std;

int main() {
    string s;
    vector<char>ans;
    cin >> s;
    for (int i = 0; i < s.length(); i++) {
        if (s[i] != 'B') ans.PB(s[i]);
        else if(ans.size()!=0)ans.erase(ans.end()-1);
    }
    for (int i = 0; i < ans.size(); i++)cout << ans[i];
    return 0;
}


Measured memory_bytes: 256
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
//package aojdigitnumber;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

/**
 *
 * @author in2
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        
        Scanner sc = new Scanner(System.in);
        while( sc.hasNext() ){
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = a + b;
            int count = 0;
            while(c!=0){
                c = c/10;
                count++;
            }
           System.out.println(count);
        }
    }
}

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

using namespace std;

int main()
{
  int x, y;
  cin >> x >> y;
  int ans = INT_MAX;
  for (int i = -1; i < 2; i += 2)
    for (int j = -1; j < 2; j += 2)
      if (i * x <= j * y)
        ans = min(ans, j * y - i * x + (i == -1 ? 1 : 0) + (j == -1 ? 1 : 0));
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cmath>
#define rad(x) (x * 3.141592653589793) / 180
using namespace std;

int main(void){
  int m, n;
  int ansx,ansy;
  char chr;
  double x = 0, y = 0, a = 90.0;

  while(cin >> m >> chr >> n , m != 0 || n != 0){
    x += cos(rad(a)) * m;
    y += sin(rad(a)) * m;
    a -= n;
    if(a < 0)
      a += 360;
    if(a >= 360)
      a -= 360;
  }
  
  ansx = x;
  ansy = y;
  cout << ansx << endl << ansy << endl;
  return 0;
}

Measured memory_bytes: 1164
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b;
	int ans;
	cin>>a>>b;
	if(a<=5)
		ans=0;
	else if(a>=6&&a<=12)
		ans=b/2;
	else
		ans=b;
	cout<<ans;
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>
typedef long long LL;

int main() 
{
	LL p, q, k, i, t, s, x, y;
	
	scanf("%lld%lld", &p, &q);
	if(q > p){
		puts("-1");
		return 0;
	}
	if(q == p){
		printf("%lld\n", p + 1);
		return 0;
	}
	for(i = 2, k = sqrt(p); i <= k; i++){
		t = p, s = 0;
		while(t){
			s += t % i;
			t /= i;
		}
		if(s == q){
			printf("%lld\n", i);
			return 0;
		}
	}
	for(t = p - q, i = sqrt(t); i > 0; i--){
		if(t % i) continue;
		x = t / i + 1;
		y = p - x * i;
		if(y >= 0 && y < x){
			printf("%lld\n", x);
			return 0;
		}
	}
	puts("-1");
	
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
using namespace std;
int main() {
  char N[5];
  cin >> N;
  if((N[0] == N[1] && N[1] == N[2]) || (N[1] == N[2] && N[2] == N[3])) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}

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

int main() {
  int n,m,x,cnt_f=0,cnt_b=0;
  cin >> n >> m >> x;
  vector<int> as(n+1);
  for(int i=0 ;i<m ;i++){
    int a;
    cin >> a;
    as[a] = 1;
  }
  for(int i=x ;i<n ;i++){
    if(as[i]){
      cnt_f++;
    }
  }
  for(int i=x;i>0;i--){
    if(as[i]){
      cnt_b++;
    }
  }
  cout << min(cnt_f,cnt_b) << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <stdlib.h>
using namespace std;
int main(){
    int N,A,B,UN,BN;
    A=0;
    B=0;
    UN=0;
    BN=0;
    int weight[100];
    cin >> N;
    for(int i=0;i<N;i++){
        cin >> weight[i];
    }
    for(int j=0;j<N;j++){
        if(A>B){
            B=B+weight[N-BN-1];
            BN++;
        }
        else{
            A=A+weight[UN];
            UN++;
        }

    }
    cout << abs(A-B) << endl;
    return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            bool flend = true;
                List<int> anslist = new List<int>();
            while (flend)
            {
                string str = Console.ReadLine();
                string[] str2 = str.Split();
                int a = int.Parse(str2[0]);
                char op = char.Parse(str2[1]);
                int b = int.Parse(str2[2]);
                int ans = 0;
                switch (op)
                {
                    case '+':
                        ans = a + b;
                        break;
                    case '-':
                        ans = a - b;
                        break;
                    case '*':
                        ans = a * b;
                        break;
                    case '/':
                        ans = a / b;
                        break;
                    case '?':
                        flend = false;
                        break;
                    default:
                        break;
                }
                if(flend)
                anslist.Add(ans);
            }
            foreach (var item in anslist)
            {
                
            Console.WriteLine(item);
            }
            Console.ReadLine();
            //string str = Console.ReadLine();
            //string[] str2 = str.Split();
            //int W = int.Parse(str2[0]);
            //int H = int.Parse(str2[1]);
            //int x = int.Parse(str2[2]);
            //int y = int.Parse(str2[3]);
            //int r = int.Parse(str2[4]);
            //if (x - r < 0 || W < x + r || y - r < 0 || H < y + r)
            //{
            //    Console.WriteLine("No");

            //}
            //else
            //{
            //    Console.WriteLine("Yes");

            //}
            //Console.ReadLine();
        }
    }
}

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

int main(){
  int n;
  cin>>n;
  vector<P> p(n);
  rep(i,n){
    ll x,y;
    cin>>x>>y;
    p[i]=make_pair(x,y);
  }
  sort(p.begin(),p.end());
  map<P,int> mp;
  for(int i = 0; i < n; i++){
    for(int j = i+1; j < n; j++){
      ll dx,dy;
      dx=p[j].first-p[i].first;
      if(dx==0) dy=abs(p[j].second-p[i].second);
      else dy=p[j].second-p[i].second;
      mp[make_pair(dx,dy)]++;
    }
  }
  int mi=0;
  for(auto x : mp){
    mi=max(x.second,mi);
  }
  cout<<n-mi<<endl;
}


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

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

  int ac = 0;
  int wa = 0;

  bool ps[n+1] = {0};
  int wal[n+1] = {0};
  rep(i, m) {
    int p; string s;
    cin >> p >> s;
    if(!ps[p]) {
      if(s == "AC") {
        ac++;
        wa += wal[p];
        ps[p] = true;
      } else {
        wal[p]++;
      }
    }
  }

  cout << ac << " " << wa << endl;
  return 0;
}


Measured memory_bytes: 768
import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = println(solve(new Scanner(System.in)))

  def solve(in: String): String = solve(new Scanner(in))

  def solve(sc: Scanner): String = {
    val N = sc.nextInt
    val K = sc.nextInt

    (if (N % K == 0) 0 else 1).toString
  }
}


Measured memory_bytes: 27556
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, n) for(int i = 0; i < (n); i++)
#define MEM(a, x) memset(a, x, sizeof(a))
#define ALL(a) a.begin(), a.end()
#define UNIQUE(a) a.erase(unique(ALL(a)), a.end())
typedef long long ll;

int main(int argc, char const *argv[]) {
	ios_base::sync_with_stdio(false);
	queue<int> q[3];
	FOR(i, 3) {
		string s;
		cin >> s;
		FOR(j, s.size()) q[i].push(s[j]-'a');
	}
	int x = 0;
	while (!q[x].empty()) {
		int next = q[x].front();
		q[x].pop();
		x = next;
	}
	cout << (char)('A'+x) << endl;
	return 0;
}

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

int main() {
  ll n;
  cin >> n;
  vector <ll> v(n);
  rep(i, n) cin >> v.at(i);
  ll res = 0;
  rep(i, n-2) {
    if (v.at(i)<v.at(i+1) && v.at(i+1)<v.at(i+2)) res++;
    if (v.at(i+2)<v.at(i+1) && v.at(i+1)<v.at(i)) res++;
  }
  cout << res << endl;
}

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

int main(){
  string S;
  cin >> S;
  if(S.back() == '3') cout << "bon" << endl;
  else if(S.back() == '0' || S.back() == '1' || S.back() == '6' || S.back() == '8'){
    cout << "pon" << endl;
  }
  else cout << "hon" << endl;
}

Measured memory_bytes: 3620
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//List<String> list=new ArrayList<String>(Arrays.asList(s.split("")));
		//List<Integer> list=new ArrayList<Integer>();
		//int[] array_k = new int[100000];
		String s = sc.next();
		List<String> list=new ArrayList<String>();
		list.add("a");
		list.add("b");
		list.add("c");
		list.add("d");
		list.add("e");
		list.add("f");
		list.add("g");
		list.add("h");
		list.add("i");
		list.add("j");
		list.add("k");
		list.add("l");
		list.add("m");
		list.add("n");
		list.add("o");
		list.add("p");
		list.add("q");
		list.add("r");
		list.add("s");
		list.add("t");
		list.add("u");
		list.add("v");
		list.add("w");
		list.add("x");
		list.add("y");
		list.add("z");
		for(int i=0;list.size()>i;i++) {
			if(list.get(i).equals(s))
				System.out.println(list.get(i+1));
		}

	}
}

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

int main() {
	int n;
	while(cin >> n && n){
		int ans = 0, s[10000];
		for(int i = 0; i < n; ++i)
			cin >> s[i];
		sort(s, s + n);
		for(int i = 1; i < n - 1; ++i)
			ans += s[i];
		cout << ans / (n - 2) << endl;
	}
	return 0;
}

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

using i32 = int_fast32_t;
using i64 = int_fast64_t;
using u32 = uint_fast32_t;
using u64 = uint_fast64_t;
using f64 = double;
using f80 = long double;

#define FOR(v, a, b) for(i64 v = (a); v < (b); ++v)
#define FORE(v, a, b) for(i64 v = (a); v <= (b); ++v)
#define REP(v, n) FOR(v, 0, n)
#define REPE(v, n) FORE(v, 0, n)
#define REV(v, a, b) for(i64 v = (a); v >= (b); --v)
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define ITR(it, c) for(auto it = (c).begin(); it != (c).end(); ++it)
#define RITR(it, c) for(auto it = (c).rbegin(); it != (c).rend(); ++it)
#define EXIST(c,x) ((c).find(x) != (c).end())
#define fst first
#define snd second
#define UNIQ(v) (v).erase(unique(ALL(v)), (v).end())
#define bit(i) (1LL<<(i))

#ifdef DEBUG
#include <Mylib/Debug/debug.cpp>
#else
#define dump(...) ((void)0)
#endif

using namespace std;

template <typename I> void join(ostream &ost, I s, I t, string d=" "){for(auto i=s; i!=t; ++i){if(i!=s)ost<<d; ost<<*i;}ost<<endl;}
template <typename T> istream& operator>>(istream &is, vector<T> &v){for(auto &a : v) is >> a; return is;}
template <typename T> void pout(const T &value){std::cout << value << "\n";}
template <typename T, typename ...Args> void pout(const T &value, const Args&... args){std::cout << value << " ";pout(args...);}

template <typename T, typename U> bool chmin(T &a, const U &b){return (a>b ? a=b, true : false);}
template <typename T, typename U> bool chmax(T &a, const U &b){return (a<b ? a=b, true : false);}
template <typename T, size_t N, typename U> void fill_array(T (&a)[N], const U &v){fill((U*)a, (U*)(a+N), v);}
template <typename T> auto make_vector(int n, int m, const T &value){return vector<vector<T>>(n, vector<T>(m, value));}


struct Init{
  Init(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(12);
    cerr << fixed << setprecision(12);
  }
}init;



int main(){
  string s;

  while(cin >> s){
    if(s == "ABC"){
      pout("ARC");
    }else{
      pout("ABC");
    }
  }


  return 0;
}


Measured memory_bytes: 3552
#include<bits/stdc++.h>
#define pi acos(-1)
#define ll long long
#define pii pair<ll,ll>
#define debug(a) cout<<a<<'\n'
#define maxn 200009 /// Still trying to be normal
#define MOD 1000000007
#define F first
#define S second
#define rep(i, a, b) for(ll i = a; i < (b); ++i)
#define per(i, b, a) for(ll i = b-1; i>=a ; i--)
#define trav(a, x) for(auto& a : x)
#define allin(a , x) for(auto a : x)
#define all(x) begin(x), end(x)
#define sz(x) (ll)(x).size()
using namespace std;
const ll INF = 1e9 + 15;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n,k;
    cin>>n>>k;
    ll vet[maxn];
    rep(i,1,n+1){
        cin>>vet[i];
    }
    ll pos[maxn];
    memset(pos,-1,sizeof pos);
    ll post=1;
    ll cont=0;
    vector<ll> cycle;
    vector<ll> analisis;
    while(true){
        // cout<<post<<endl;
        pos[post]=cont++;
        analisis.push_back(post);
        post=vet[post];
        if(pos[post]!=-1)break;
    }
    rep(i,pos[post],cont){
        cycle.push_back(analisis[i]);
    }
    // for(auto e: cycle){
    //     cout<<e<<" ";
    // }
    // cout<<endl;
    if(k<pos[post]){
        cout<<analisis[k]<<'\n';
        return 0;
    }
    else k-=pos[post];
    ll szc=sz(cycle);
    cout<<cycle[k%szc]<<'\n';
}


Measured memory_bytes: 10808
#include <stdio.h>

int main(void) {
	int x = 0;
	char str[4];
	scanf("%s", str);
	int i;
	for (i=0; i<=3; i++) {
		if (str[i] == '+')
			x++;
		else 
			x--;
	}
	printf("%d\n", x);
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <cassert>
#include <algorithm>
#include <functional>
#include <string>

using namespace std;

int gcd(int x, int y) { return (x % y) ? gcd(y, x % y) : y; }

int main() {
	int k;
	int a_b;
	long long int sum = 0;
	cin >> k;

	for (int i = 1; i <= k; i++) {
		for (int j = 1; j <= k; j++) {
			a_b = gcd(i, j);
			for (int l = 1; l <= k; l++) {
				sum += gcd(a_b, l);
			}
		}
	}
	
	cout << sum;
	return 0;
}

Measured memory_bytes: 3636
#include <cstdio>
#include <vector>
#include <algorithm>
#include <functional>
#include <map>
#include <set>
#include <string>
#include <iostream>
#include <cassert>
#include <cmath>
#include <queue>
using namespace std;

int main() {
        int n, m;
        scanf("%d%d", &n, &m);
        priority_queue<pair<pair<int, pair<int, int>>, bool>> que;
        for (int i = 0; i < m; i ++) {
                int a, b, c;
                scanf("%d%d%d", &a, &b, &c);
                que.push({{-c, {a, b}}, false}); //once
                que.push({{-(c + 1), {a, (a + 1) % n}}, true}); 
                que.push({{-(c + 2), {b, (b + 1) % n}}, true});
        }
        vector<int> par(n);
        for (int i = 0; i < n; i ++) par[i] = i;
        function<int (int)> root = [&](int x) { return x == par[x] ? x : par[x] = root(par[x]); };
        long long ans = 0;
        while (!que.empty()) {
                auto e = que.top();
                que.pop();
                if (root(e.first.second.first) != root(e.first.second.second)) {
                        par[root(e.first.second.first)] = root(e.first.second.second);
                        ans += -e.first.first;
                        if (e.second) que.push({{e.first.first - 2, {(e.first.second.first + 1) % n, (e.first.second.second + 1) % n}}, true});
                }
        }
        printf("%lld\n", ans);
        return 0;
}



Measured memory_bytes: 18664