akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<algorithm>

using namespace std;

int main() {
	int A, B;
	cin >> A >> B;
	
	if (A == B) {
		cout << "Draw" << endl;
	}
	else if (A == 1 && B != 1) {
		cout << "Alice" << endl;
	}
	else if (B == 1 && A != 1) {
		cout << "Bob" << endl;
	}
	else if (A > B) {
		cout << "Alice" << endl;
	}
	else cout << "Bob" << endl;

	return 0;
}

Measured memory_bytes: 256
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
using namespace std;

int main(){
    long long int n,p=0,ans=0;
    cin >> n;
    rep(i,n){
        int m;
        cin >> m;
        if(p>m){
            ans +=(p-m);
        }else{
            p=m;
        }
    }
    cout <<ans <<endl;
}

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

using namespace std;

#define REP(i, a, b) for (int i = (a), i##_end_ = (b); i < i##_end_; ++i)
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define mp make_pair
#define x first
#define y second
#define pb push_back
#define SZ(x) (int((x).size()))
#define ALL(x) (x).begin(), (x).end()

template<typename T> inline bool chkmin(T &a, const T &b) { return b < a ? a = b, 1 : 0; }
template<typename T> inline bool chkmax(T &a, const T &b) { return a < b ? a = b, 1 : 0; }

typedef long long LL;

const int oo = 0x3f3f3f3f;

const int maxq = 1010;

inline LL f(const LL a, const LL b)
{
	if (!b) return a;
	LL l = 0, r = (a + b - 1) / b;
	while (l < r)
	{
		LL mid = (l + r) >> 1;
		if (a - mid * b <= mid) r = mid;
		else l = mid + 1;
	}
	return l;
}

inline LL ff(const LL a, const LL b)
{
	return max(f(a, b), f(b, a));
}

int main()
{
#ifdef matthew99
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	int qn;
	LL a, b, l, r;
	scanf("%d", &qn);
	REP(i, 0, qn)
	{
		cin >> a >> b >> l >> r;
		--l;
		LL goal = ff(a, b);
		LL le = 0, ri = l;
		chkmin(le, a), chkmin(ri, a);
		chkmax(le, l - b);
		while (le < ri)
		{
			LL mid = (le + ri + 1) >> 1;
			if (f(mid, l - mid) > goal || f(b - (l - mid), a - mid) > goal) ri = mid - 1;
			else le = mid;
		}
		LL numa = le, numb = l - le;
		REP(j, l, r)
		{
			if (numa + 1 > a || ff(numa + 1, numb) > goal || ff(a - (numa + 1), b - numb) > goal)
			{
				putchar('B');
				++numb;
			}
			else
			{
				putchar('A');
				++numa;
			}
		}
		printf("\n");
	}
	return 0;
}


Measured memory_bytes: 384
# import bisect
# import heapq
# import math
# import queue
import sys


def main():
    # 読み込み回数が多い場合
    input = sys.stdin.readline
    N = int(input())
    
    # heap queue
    h = []
    for i in range(N):
        A, B = map(int, input().split())
        h.append((B, A))
    h.sort()
	
    time = 0
    for B, A in h:
        time += A
        if B < time:
            print("No")
            sys.exit()
    
    print("Yes")


if __name__ == "__main__":
    main()

Measured memory_bytes: 29468
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define all(x) x.begin(), x.end()

using namespace std;
typedef long long int ll;

double dist(double a, double b){
	double h = abs(a-b);
	double r = a+b;
	return sqrt( r*r - h*h );
}
int main(){
	int N;
	double r[1005], x[1005];
	cin >> N;
	rep(i,N) cin >> r[i];
	rep(i,N){
		x[i] = r[i];
		rep(j,i){
			double d = dist(r[i], r[j]);
			x[i] = max(x[i], x[j] + d);
		}
	}
	double ans = 0;
	rep(i,N) ans = max(ans, x[i] + r[i]);
	printf("%.8f\n", ans);
}

Measured memory_bytes: 3272
#include<iostream>
using namespace std;
 
int main(){
  int a,b;

  cin >> a >> b;

  if (a > b) cout << "a > b";
  if (a == b) cout << "a == b";
  if (a < b) cout << "a < b";
  cout << endl;
  return 0;		 
}


Measured memory_bytes: 3100
import java.util.Scanner;

public class Main {
    
    public static final int BIG_NUM = 2000000000;
    public static final int MOD  = 1000000007;
    
    public static void main(String[] args) {
        
        Scanner scanner =new Scanner(System.in);
        
        String P = scanner.next().toLowerCase();
        char p[] = P.toCharArray();
        
        String tmp;
        int ans = 0;
        boolean FLG;
        
        while(!(tmp = scanner.next()).equals("END_OF_TEXT")){
            
            char line[] = tmp.toLowerCase().toCharArray();
            
            if(line.length != p.length)continue;
            
            FLG = true;
            for(int i = 0; i< P.length(); i++){
                if(p[i] != line[i]){
                    FLG = false;
                    break;
                }
            }
            if(FLG)ans++;
        }
        
        System.out.println(ans);
    }
}


Measured memory_bytes: 26400
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
#define rep(i,m,n) for(int (i)=(m);(i)<(n);++(i))
#define rREP(i,m,n) for(int (i)=(n)-1;(i)>=(m);--(i))
#define all(x) (x).begin(),(x).end()
#define out(y,x,h,w) (y)<0||(x)<0||(y)>=(h)||(x)>=(w)
constexpr int INF = 1000000001;
constexpr ll mod = 1000000007;
constexpr double PI = 3.1415926535897932;
template<class T>inline bool chmin(T& a, T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}
template<class T>inline bool chmax(T& a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}
inline void init() {
	cin.tie(nullptr); cout.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

int main() {
	init();

	int N; cin >> N;
	vector<int>A(N);
	rep(i, 0, N)cin >> A[i];
	vector<int>B(N);
	rep(i, 0, N)cin >> B[i];
	vector<int>C(N);
	rep(i, 0, N)cin >> C[i];
	
	sort(all(A));
	sort(all(B));
	sort(all(C));
	ll ans = 0;
	rep(i, 0, N) {
		if (A[0] >= B[i] || C[N - 1] <= B[i])continue;
		ll a = lower_bound(all(A), B[i]) - A.begin();
		ll c = N - (upper_bound(all(C), B[i]) - C.begin());
		ans += a * c;
	}
	cout << ans << "\n";

	return 0;
}

Measured memory_bytes: 1408
from collections import Counter

N = int(input())
V = map(int, input().split())

odd = Counter()
even = Counter()

for i, v in enumerate(V):
    cnt = even if i % 2 else odd
    cnt[v] += 1

oddCmn = odd.most_common(2)
evenCmn = even.most_common(2)

oddCmn.append((0, 0))
evenCmn.append((0, 0))

od = 0
ev = 0
if oddCmn[od][0] == evenCmn[ev][0]:
    if oddCmn[od][1] + evenCmn[ev + 1][1] < evenCmn[ev][1] + oddCmn[od + 1][1]:
        od += 1
    else:
        ev += 1


print(N - oddCmn[od][1] - evenCmn[ev][1])


Measured memory_bytes: 21224
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please

int D[1001][1001];

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


	int N, K;
	cin >> N >> K;

	int gyaku = 0;
	rep(i, N) {
		int x, y;
		char c;
		cin >> x >> y >> c;
		int k = x / K ^ y / K;
		x = x % K;
		y = y % K;
		if (c == 'W' ^ (k & 1)) {
			gyaku++;
			D[x][y]--;
		}
		else D[x][y]++;
	}

	for (int i = K - 1; i >= 0; i--) {
		for (int j = K - 1; j >= 0; j--) {
			D[i][j] = D[i][j + 1] + D[i + 1][j] - D[i + 1][j + 1] + D[i][j];
		}
	}
	int saidai = -1e9;
	rep(i, K) rep(j, K) {
		int kari = D[i][0] + D[0][j] - D[i][j] - D[i][j];
		saidai = max(saidai, kari);
		saidai = max(saidai, D[0][0] - kari);
	}
	co(gyaku + saidai);

	Would you please return 0;
}

Measured memory_bytes: 4224
#include<iostream>
#include<string>
#include<vector>
using namespace std;
int main(){
    string S; cin >> S;
    unsigned long long int sum = stoll(S);
    for(int bit=1; bit < (1<<(S.length()-1)); ++bit){
        vector<int> v;
        for(int i=0; i<S.length()-1; i++){
            if(bit & (1<<i)){
                v.push_back(i+1);
            }
        }
        for(int i=0; i<=v.size(); i++){
            string temp;
            if(i == 0) temp = S.substr(S.length()-v[i]);
            else if(i == v.size()) temp = S.substr(0, S.length()-v[i-1]);
            else temp = S.substr(S.length()-v[i], v[i]-v[i-1]);
            int num = stoll(temp);
            sum += num;
        }
    }
  	cout << sum;
}

Measured memory_bytes: 380
#define _USE_MATH_DEFINES
#include<iostream>
#include<algorithm>
#include<cmath>
#include<string>
#include<set>
#include<map>
#include<stdlib.h>
#include<stdio.h>
#include<vector>
#include<utility>
#include<queue>
#include<stdbool.h>
#include<math.h>
typedef long long ll;
#define N (1000000000+7)
using namespace std;
typedef pair<int, int> P;

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

ll prime[100010];
ll kaijo[200010];
void init() {
	kaijo[0] = 1;
	for (ll i = 1;i <= 200000;i++)kaijo[i] = (kaijo[i - 1] * i) % N;
}

ll inv(ll x) {
	ll res = 1;
	ll k = N - 2;
	ll y = x;
	while (k) {
		if (k & 1)res = (res*y) % N;
		y = (y%N*y%N) % N;
		k /= 2;
	}
	return res;
}

ll Comb(ll n, ll k) {
	ll b = kaijo[n];
	ll c = kaijo[n - k];
	ll d = kaijo[k];
	ll cd = (c*d) % N;
	return ((b%N)*(inv(cd)%N) + N) % N;
}


int main(void) {
	ll k, a, b, ans = 0;
	cin >> k >> a >> b;
	if (k<=a||b-a<=2) {
		cout << k + 1 << endl;
		return 0;
	}
	ll num = k + 1 - a;
	if (num % 2 == 0) {
		ans = a+(b-a)*(num/2);
	}
	else {
        num--;
		ans = (num / 2)*(b - a) + a + 1;
	}
	
	cout <<  ans << endl;
}


Measured memory_bytes: 3588
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
#define FOR(i, x, y) for (decay<decltype(y)>::type i = (x), _##i = (y); i < _##i; ++i)
#define FORD(i, x, y) for (decay<decltype(x)>::type i = (x), _##i = (y); i > _##i; --i)
#ifdef zerol
#define dbg(x...) do { cout << "\033[32;1m" << #x << " -> "; err(x); } while (0)
void err() { cout << "\033[39;0m" << endl; }
template<template<typename...> class T, typename t, typename... A>
void err(T<t> a, A... x) { for (auto v: a) cout << v << ' '; err(x...); }
template<typename T, typename... A>
void err(T a, A... x) { cout << a << ' '; err(x...); }
#else
#define dbg(...)
#endif
// -----------------------------------------------------------------------------

const int N = 2E5 + 100;
int n, a[N];

int main() {
    cin >> n;
    FOR (i, 1, n + 1) cin >> a[i];
    if (a[1] != 0) {
        puts("-1");
        return 0;
    }
    LL ans = 0;
    FOR (i, 1, n + 1) {
        if (a[i] <= a[i - 1]) ans += a[i];
        else if (a[i] == a[i - 1] + 1) ans++;
        else {
            puts("-1");
            return 0;
        }
    }
    cout << ans << endl;
}


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

using namespace std;

int main() {
    ios_base::sync_with_stdio(false); cin.tie(NULL);

    int n; string s;
    cin >> n >> s;
    int cnt = 1;
    for(int i = 1; i < (int) s.size(); i++) {
        if(s[i] != s[i - 1]) cnt++;
    }
    cout << cnt << "\n";

    return 0;
}


Measured memory_bytes: 512
#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/stack:512000000")
#include<utility>
#include<iostream>
#include<fstream>
#include<vector>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<ctime>
#include<functional>
#include<random>
#include<climits>
#include<queue>
#include<stack>
#include<deque>
#include<bitset>
#include<map>
#include<set>
#include<unordered_map>
#include<unordered_set>
#include<cassert>
#include<ccomplex>

//4Head

#define all(x) x.begin(), x.end()
#define mp make_pair
#define X first
#define Y second

using namespace std;

using ll = long long;
using ull = unsigned long long;
using ld = long double;
mt19937_64 gen(time(NULL));

ll const mod = 1e9 + 7;

namespace {
	ll mul(ll a, ll b) {
		ll val = a * b - (ll)((ld)a * b / mod) * mod;
		if (val < 0) val += mod;
		if (val >= mod) val -= mod;
		return val;
	}

	ll poww(ll a, ll b) {
		ll val = 1;
		a %= mod;
		while (b > 0) {
			if (b % 2) val = mul(a, val);
			a = mul(a, a);
			b >>= 1;
		}
		return val % mod;
	}

	ll inv(ll a) {
		return poww(a, mod - 2);
	}
}

ll const maxn = 3e5 + 5;

signed main() {
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	ll n, r; cin >> n >> r;
	if (n >= 10) {
		cout << r << endl;
	} else {
		cout << r + 100 * (10 - n) << endl;
	}
	return 0;
}

/*
3
0 1
3 0
1 0
*/

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

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

Measured memory_bytes: 256
//                             In The Name Of Allah
#include <bits/stdc++.h>
#define	ss second
#define ff first
#define use_fast ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define ret(n) return cout << n, 0
#define se(n) cout << setprecision(n) << fixed
#define pb push_back
#define int long long
#define ld long double
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#pragma GCC optimize("no-stack-protector,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std; 

const int N = 2e5 + 100, OO = 1e16 + 7, T = 13, M = 1e9 + 7, P = 6151, SQ = 800, lg = 32;
typedef pair <int, int> pii;

int32_t main() {
	use_fast;
	int n, m, z;
	cin >> n >> m >> z;
	cout << z << " " << n << " " << m << endl;
	return 0; 
} 
/*
be carefull :
1- if not solve after 20 min, read again twice
2- after submit read the code again
3- fun with contest
4- ... 
*/

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
import sys
from collections import defaultdict

H,W,K=map(int, sys.stdin.readline().split())
S=[ sys.stdin.readline().strip() for _ in range(H) ]

ans=float("inf")
for bit in range(2**H):
    cnt=0
    group_num=0
    GROUP={}
    for i,s in enumerate(S):
        if i==0:
            GROUP[i]=group_num
        else:
            if bit>>i-1&1==1:
                cnt+=1      #境目のカウントに+1
                group_num+=1
            GROUP[i]=group_num

    ok=None
    VALUE=defaultdict(lambda: 0)
    w=0
    break_flag=False
    for w in range(W):
        if break_flag:  #breakフラグがTrueならループを止める
            break
        for h in range(H):
            VALUE[GROUP[h]]+=int(S[h][w])
        #現時点の集計でKを超えている値がないかをチェック
        for v in VALUE.values():
            if v<=K:
                pass
            else:
                if ok is None:      #okに値がない場合は、このパターンは成り立たない
                    cnt=float("inf")    #不可能なパターンなのでカウントに無限大を代入
                    break_flag=True     #breakフラグにTrueを代入
                    break
                else:      #以前の列でok番号に値が入っていた、つまり成り立つ列があった場合
                    cnt+=1      #境目のカウントに+1
                    VALUE=defaultdict(lambda: 0)    #NGの場合は値を初期化して入れなおし
                    for h in range(H):
                        VALUE[GROUP[h]]+=int(S[h][w])
                    break
        else:
            ok=w    #値が全てK以下だった場合はok変数に列番号を記録
    ans=min(ans,cnt)
       
print ans

Measured memory_bytes: 33900
import sys
from collections import defaultdict
sys.setrecursionlimit(200000)
input = sys.stdin.readline

A, B, C, D, = map(int, input().split())

if abs(B - A) <= D and abs(C - B) <= D:
    print("Yes")
elif abs(C - A) <= D:
    print("Yes")
else:
    print("No")

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

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 998244353

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

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

    ll t1, t2, a1, a2, b1, b2;
    cin >> t1 >> t2 >> a1 >> b1 >> a2 >> b2;
    if(a1 < a2){
        swap(a1, a2);
        swap(b1, b2);
    }

    ll x = t1 * (a1 - a2);
    ll y = t2 * (b1 - b2);

    if(x + y == 0){
        cout << "infinity" << endl;
        return 0;
    }
    if(y > 0 || abs(x) > abs(y)){
        cout << 0 << endl;
        return 0;
    }

    //cout << x << " " << y << endl;

    ll tmp = abs(y) - abs(x);
    cout << 1 + 2 * (abs(x) / tmp) - (abs(x) % tmp == 0) << endl;



	return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
	int i,A,A1,B,B1,C,C1,D,D1;
	float a,b;
	A=0;
	A1=0;
	B=0;
	B1=0;
	C=0;
	C1=0;
	D=0;
	D1=0;
	while(scanf("%f %f",&a,&b)!=EOF)	{ 
		if(1.1<a){
			A++;
		}
		else if(0.6<a && a<1.1){
			B++;
		}
		else if(0.2<a && a<0.6){
			C++;
		}
		else if(0.2>a){
			D++;
		}
		if(1.1<b){
			A1++;
		}
		else if(0.6<b && b<1.1){
			B1++;
		}
		else if(0.2<b && b<0.6){
			C1++;
		}
		else if(0.2>b){
			D1++;
		}
	}
	printf("%d %d\n",A,A1);
	printf("%d %d\n",B,B1);
	printf("%d %d\n",C,C1);
	printf("%d %d\n",D,D1);
	return 0;
}

Measured memory_bytes: 1056
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const ll MOD = 1000000007;
template <class T>
/*  ワーシャルフロイド
    O(V)，全店最短路
    dis[i][i]=0を入力しておく
    dis[i][j]に，辺i-jのコストを入力しておく
    辺がなかったらINF
    負の閉路があったらdis[i][i]が負になるものが存在する*/
void warshall_floyd(T &dis) {
  int V = dis.size();
  REP(k, V) {
    REP(i, V) {
      if (dis[i][k] == INF) continue;
      REP(j, V) {
        if (dis[k][j] == INF) continue;
        dis[i][j] = min(dis[i][j], dis[i][k] + dis[k][j]);
      }
    }
  }
}
int main() {
  int N, M;
  cin >> N >> M;
  vector<tuple<int, int, int>> edge(M);
  vector<vector<ll>> dis(N, vector<ll>(N, INF));
  REP(i, N) dis[i][i] = 0;
  REP(i, M) {
    int a, b, c;
    cin >> a >> b >> c, a--, b--;
    edge[i] = make_tuple(a, b, c);
    dis[a][b] = c;
    dis[b][a] = c;
  }
  warshall_floyd(dis);
  ll ans = 0;
  REP(i, M) {
    int a = get<0>(edge[i]), b = get<1>(edge[i]), c = get<2>(edge[i]);
    bool ok = false;
    REP(j, N) {
      for (int k = j + 1; k < N; k++) {
        if (dis[j][a] + c + dis[b][k] == dis[j][k]) ok = true;
        if (dis[j][b] + c + dis[a][k] == dis[j][k]) ok = true;
      }
    }
    if (!ok) ans++;
  }
  cout << ans << endl;
}

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


int main(){


    int n, k, i, t;

    int s = 1000000000;

    vector<int> h;


    cin >> n >> k;


    for( i = 0 ; i < n ; i = i + 1 ){

         cin >> t;

         h.push_back(t);

         }


    sort( h.begin(), h.end() );


    for( i = 0 ; i + k - 1 < n ; i = i + 1 ){

         s = min( s, h.at(i + k - 1) - h.at(i) );

         }


    cout << s << endl;

    
    return 0;


    }


Measured memory_bytes: 892
small = 'abcdefghijklmnopqrstuvwxyz'
big = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
a,b,c=map(str,input().split())
i=small.find(a[0])
j=small.find(b[0])
k=small.find(c[0])
print(big[i]+big[j]+big[k])

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

int main()
{
    long long K;
    cin>>K;
    long long X, Y;
    cin>>X>>Y;

    if (K%2==0 && (X+Y)%2!=0)
    {
        cout<<-1<<endl;
        return 0;
    }

    long long D = abs(X)+abs(Y);
    vector<long long> ax;
    vector<long long> ay;
    long long d = 0;

    while (true)
    {
        if (d==D)
            break;

        if (abs(D-d)%2==0 && abs(D-d) < 2*K && D-d!=K)
        {
            ax.push_back(d+(D-d)/2);
            ay.push_back(-(K-abs(D-d)/2));
            ax.push_back(D);
            ay.push_back(0);
            break;
        }

        d += K;
        ax.push_back(d);
        ay.push_back(0);
    }

    for (int i=0; i<(int)ax.size(); i++)
    {
        if (ax[i]>=abs(X))
        {
            long long t = ay[i];
            ay[i] = ax[i]-abs(X);
            ax[i] = abs(X)-t;
        }

        if (X<0)
            ax[i] *= -1;
        if (Y<0)
            ay[i] *= -1;
    }

    //for (int i=0; i<(int)ax.size(); i++)
    //    cout<<abs(ax[i]-(i==0?0:ax[i-1]))+abs(ay[i]-(i==0?0:ay[i-1]))<<endl;

    cout<<ax.size()<<endl;
    for (int i=0; i<(int)ax.size(); i++)
        cout<<ax[i]<<" "<<ay[i]<<endl;
}


Measured memory_bytes: 5604
import math
N, K = map(int, input().split())
P = [i -1 for i in map(int,input().split())]
lgk = int(math.log(K,2))
last = P
point = 0
for j in range(lgk+1):
    if (K >> j) & 1:
        point = last[point]
    res = []
    for i in last:
        res.append(last[i])
    last = res

print(point+1)


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

const long long maxn = 1e5 + 10;

long long dp[maxn][3];
long long n, k, r, s, p;
string st;
long long ans;

void in();
void solve();
void out();
long long fnd(string t);

int main(){
    in();
    solve();
    out();
}

void in(){
    ios::sync_with_stdio(false);
    cout.tie(0);
    cin.tie(0);
    cin >> n >> k;
    cin >> r >> s >> p;
    cin >> st;
}

void solve(){
    for(long long i = 0; i < k; i++){
        string t = "";
        for(long long j = i; j < n; j += k)
            t += st[j];
        ans += fnd(t);
    }
}

void out(){
    cout << ans;
}

long long fnd(string t){
    for(long long i = 1; i <= t.size(); i++){
        dp[i][0] = max(dp[i - 1][1], dp[i - 1][2]);
        dp[i][1] = max(dp[i - 1][0], dp[i - 1][2]);
        dp[i][2] = max(dp[i - 1][1], dp[i - 1][0]);
        if(t[i - 1] == 's')
            dp[i][0] += r;
        if(t[i - 1] == 'r')
            dp[i][1] += p;
        if(t[i - 1] == 'p')
            dp[i][2] += s;
    }
    return max(dp[t.size()][0], max(dp[t.size()][1], dp[t.size()][2]));
}


Measured memory_bytes: 2944
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    String S = sc.next();
    sc.close();
    if (N % 2 != 0) {
      System.out.println("No");
    } else {
      String A = S.substring(0, N / 2);
      String B = S.substring((N / 2), N);
      if (A.equals(B)) {
        System.out.println("Yes");
      } else {
        System.out.println("No");
      }
    }
  }
}


Measured memory_bytes: 21716
#include <iostream>
#include <string>
#include <set>
#include <vector>
using namespace std;

inline int max(int x, int y){
  return (x>y)?x:y;
}
inline int min(int x, int y){
  return (x<y)?x:y;
}
inline int abs(int x){
  return (x>0)?x:-x;
}

int main(void){
  int n; cin >> n;
  string st; cin >> st;
  set<int> s[3];
  for(int i=0;i!=n;++i){
    switch(st[i]){
      case 'R':
      s[0].insert(i);
      break;
      case 'G':
      s[1].insert(i);
      break;
      case 'B':
      default:
      s[2].insert(i);
    }
  }
  long res = s[0].size()*s[1].size()*s[2].size();
  // 区間が等しいものを削除
  for(int i=1;i*2<n;++i){ //区間
    for(int j=0;j+i*2<n;++j){
      if(st[j]!=st[j+i] and st[j]!=st[j+2*i] and st[j+i]!=st[j+2*i]){
        --res;
      }
    }
  }
  /*
  int x, y, z;
  for(auto r: s[0]){
    for(auto g: s[1]){
      for(auto b: s[2]){
        if(abs(r-b)!=abs(b-g) and abs(b-g)!=abs(g-r) and abs(g-r)!=abs(r-b)){
          ++res;
        }
      }
    }
  }
  */
  cout << res << endl;
  return 0;
}
/*
39
RBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB
1800
*/


Measured memory_bytes: 3808
/* BISMILLAHIR RAHMANIR RAHIM */
#include<bits/stdc++.h>
using namespace std;
#define ll        long long
#define ull       unsigned long long
#define si(x)     scanf("%d", &x)
#define sll(x)    scanf("%lld", &x)
#define ssll(x,y)    scanf("%lld %lld", &x ,&y)
#define sd(x)     scanf("%lf", &x)
#define l0(i,n)   for(ll i=0; i<n; i++)
#define MAX       100000
#define maxn 	  200002
#define pb 		  push_back
#define mk 		  make_pair
#define endl	  "\n"
#define INF 	  1000000000
#define MOD		  1000000007
#define vll(a)	  vector<ll>a
#define imie(...) "[" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "


int main ()
{
		ios::sync_with_stdio(0);
		cin.tie(0);
		//CODE TONOY
		ll a;
		sll(a);
		cout << (ll)a+a*a+a*a*a << endl;
		return 0;
}







Measured memory_bytes: 3684
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int N = scan.nextInt();
        long C = scan.nextLong();
        long K = scan.nextLong();
        long[] l = new long[N];
        for (int i = 0; i < N; i++) {
            l[i] = scan.nextLong();
        }
        Arrays.sort(l);
        long[] r = new long[N];
        for (int i = 0; i < N; i++) {
            r[i] = l[i] + K;
        }
        int answer = 0;
        long current = 0;
        long number_of_people = 0;
        for (int i = 0; i < N; i++) {
            if (number_of_people == C) {
                answer += 1;
                number_of_people = 0;
                current = r[i];
            }
            if (current < l[i]) {
                answer += (number_of_people + (C-1))/C;
                number_of_people = 1;
                current = r[i];
                continue;
            }
            number_of_people += 1;
        }
        answer += (number_of_people + (C - 1)) / C;
        System.out.println(answer);
    }
}


Measured memory_bytes: 50732
import math

mod = 1000000007
dp = [0, 1]
num = [0, 1]
for i in range(2, 200000):
    if i % 2 == 0:
        num.append(num[i//2])
    else:
        num.append(num[i//2]+1)
    dp.append(dp[i % num[i]]+1)
N = int(input())
x = input()
ones = 0
for c in x:
    if c == '1':
        ones += 1
powlow = [1]
powhigh = [1]
modlow = ones - 1
modhigh = ones + 1
for i in range(200000):
    if modlow != 0:
        powlow.append((powlow[i]*2) % modlow)
    powhigh.append((powhigh[i]*2) % modhigh)
reslow = 0
reshigh = 0
for i in range(N):
    if x[i] == '1':
        if modlow != 0:
            reslow = (reslow + powlow[N - i - 1]) % modlow
        reshigh = (reshigh + powhigh[N - i - 1]) % modhigh
for i in range(N):
    if x[i] == '1':
        if modlow != 0:
            temp = (modlow + reslow - powlow[N - i - 1]) % modlow
            print(dp[temp] + 1)
        else:
            print(0)
    if x[i] == '0':
        temp = (reshigh + powhigh[N - i - 1]) % modhigh
        print(dp[temp] + 1)


Measured memory_bytes: 28532
#include <iostream>
using namespace std;
int main(void){
  // Your code here!
  string s;
  while (true){
      cin>>s;
      if (s=="0"){
          break;
      }
      int sum=0;
      for (int i=0; i<s.size();i++){
          int n=s[i]-48;
          sum+=n;
      }
      cout<<sum<<endl;
  }
}


Measured memory_bytes: 3176
#include<bits/stdc++.h>
using namespace std;
int main(){
 string s1,s2,s3;
 cin>>s1>>s2>>s3;
 cout<<(char)(s1[0]-32)<<(char)(s2[0]-32)<<(char)(s3[0]-32)<<endl;
 return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <iomanip>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <vector>
#include <cmath>
#include <math.h>
#include <stdexcept>
#include <algorithm>
#include <set>
#include <map>
#include <stdlib.h>
#include <cctype>
#include <bitset>
using namespace std;
int main(){
    int N,i,j,p,a = 10000000;
    cin >> N;
    int X[N];
    for(i = 0;i < N;i++) cin >> X[i];
    for(i = 0;i <= 100;i++){
        p = 0;
        for(j = 0;j < N;j++){
            p += pow(X[j] - i,2);
        }
        if(a > p){
            a = p;
        }
    }
    cout << a << endl;
}

Measured memory_bytes: 3604
use v5.18; # strict say state
use warnings;
use List::Util qw(reduce first max min sum0);

my ($a, $b, $c, $d) = split / /, <STDIN>;
my $gcd = sub {
  my ($x, $y) = @_;
  while ($y) {
    my $r = $x % $y;
    $r += $y if $r < 0;
    $x = $y;
    $y = $r;
  }
  return $x;
};
my $ans = $b - $a + 1;
my $e = 0;
if ($a<=$c) {
  $e = $c;
} else {
  $e = int ($a/$c) * $c;
  $e += $c if $e < $a;
}
$ans -= ($b - $b%$c - $e) / $c + 1;
if ($a<=$d) {
  $e = $d;
} else {
  $e = int ($a/$d) * $d;
  $e += $d if $e < $a;
}
$ans -= ($b - $b%$d - $e) / $d + 1;
my $f = $c / $gcd->($c, $d) * $d;
if ($a<=$f) {
  $e = $f;
} else {
  $e = int ($a/$f) * $f;
  $e += $f if $e < $a;
}
$ans += ($b - $b%$f - $e) / $f + 1;

say $ans;

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

ll gcd(ll x,ll y) {return y ? gcd(y,x%y) : x;} 
ll lcm(ll x,ll y) {return x/gcd(x,y)*y;}

int main(){
    ll l,r,d,ans=0;
    cin >> l >> r >> d;
    for(ll i=l;i<=r;i++){
        if(i%d==0) ans++;
    }

    cout << ans << endl;
    return 0;
}











Measured memory_bytes: 3580
#include <bits/stdc++.h>
#define ull unsigned long long
#define int long long
#define ll long long
#define fr(i, n) for (int i = 0; i < n; i++)
#define frf(i, j, n) for (int i = j; i <= n; i++)
#define frd(i, n) for (int i = n; i >= 0; i--)
#define mp(i, j) make_pair(i, j)
#define pb(x) push_back(x)
using namespace std;
// typedef vector<vector<ll>> matrix;
// const ll S = 3e5 + 20;
// const ll N = 1e6 + 1;
// const ll PRIME = 1e9 + 7;
// const ll MAX = 1e6;

void solve()
{
  string s,t;
  cin>>s>>t;
  int ans=0;
  fr(i,s.length())
  {
      if(s[i]!=t[i])
      ans++;
  }
  cout<<ans;
}
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    int t;
    // cin >> t;
    t = 1;
    while (t--)
    {
        solve();
    }
}

Measured memory_bytes: 3764
// TEMPLATE {{{
#include <bits/stdc++.h>
using namespace std;
#ifndef LOCAL
#define OJ 1
#else
#define OJ 0
#endif
 
#define endl '\n'
#define TIMESTAMP merr << "Execution time: " << (double)clock()/CLOCKS_PER_SEC << " s.\n"
class C_ {}; template <typename T> C_& operator <<(C_& __m, const T& __s) { if (!OJ) cerr << "\E[91m" << __s << "\E[0m"; return __m; }
C_ merr;
 
struct __s { __s() { if (OJ) { ios_base::Init i; cin.sync_with_stdio(0); cin.tie(0); } } ~__s(){ TIMESTAMP; } } __S;
/// END OF TEMPLATE }}}

#define size_t unsigned long long

vector<size_t> G[222222];
size_t D[222222];
bool u[222222];

void dfs(size_t v) {
    u[v] = 1;
    for (size_t vv : G[v]) {
        if (u[vv]) continue;
        D[vv] = D[v]+1;
        dfs(vv);
    }
}

int main(void) {
    size_t n;
    cin >> n;
    for (size_t i = 0; i < n-1; i++) {
        size_t a,b;
        cin >> a >> b;
        a--, b--;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    dfs(0);
    size_t mxv = 0;
    for (size_t i = 0; i < n; i++) {
        if (D[i] > D[mxv]) mxv = i;
    }
    memset(D, 0, sizeof(D));
    memset(u, 0, sizeof(u));
    dfs(mxv);
    size_t d = 0;
    for (size_t i = 0; i < n; i++) {
        d = max(d, D[i]);
    }
    merr << d << '\n';
    if ((d+1)%3 == 2) {
        cout << "Second" << endl;
    } else {
        cout << "First" << endl;
    }
}


Measured memory_bytes: 19968
#include<iostream>
#include<vector>
#include<cmath>
#include<algorithm>
#include<string>
#include<climits>
#include<stack>
#include<queue>
#include<unordered_map>
#include<map>
#include<set>

#define loopi(x,y) for(int i = x;i<(y);i++)
#define rloopi(x,y) for(int i = x;i>=(y);i--)
#define rloopj(x,y) for(int j = x;j>=(y);j--)
#define loopj(x,y) for(int j = x;j<(y);j++)


#define nl cout<<"\n";
#define ll long long int
using namespace std;
#define mod  1000000007


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

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

	int n, k;
	cin >> n >> k;

	vector<int> a(n);

	loopi(0, n)
	{
		cin >> a[i];
	}

	sort(a.begin(), a.end());

	int sum = 0;
	loopi(0, k)
	{
		sum += a[i];

	}
	cout << sum;

	return 0;
}

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

#define rep(i, n) for(int i = 0; i < (n); ++i)

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

  int n; cin >> n;
  string s, t; cin >> s >> t;
  int tmp = 0;
  bool flag = false;
  rep(i, n) {
    if(s.substr(i, n-i) == t.substr(0, n-i)) {
      tmp = i;
      flag = true;
      break;
    }
  }

  cout << (flag ? n+tmp : n*2) << '\n';
  return 0;
}


Measured memory_bytes: 256
use std::io;
use std::str::FromStr;


fn input<T:FromStr>() -> T {
  let mut line: String = String::new();
  io::stdin().read_line(&mut line);
  line.trim().parse().ok().unwrap()
}

fn input_i32_vec() -> Vec<i32> {
  let mut line: String = String::new();
  io::stdin().read_line(&mut line);
  line.split_whitespace().map(|s| s.parse().unwrap()).collect()
}

fn main() {
  let n: i32 = input();
  let a_vec = input_i32_vec();
  let mut a_sorted = vec![0; a_vec.len()];

  for i in 0..a_vec.len() as usize {
    a_sorted[(a_vec[i] - 1) as usize] = i + 1;
  }
  for n in a_sorted.iter() {
    print!("{} ", n);
  }
}


Measured memory_bytes: 6780
#pragma GCC optimize("Ofast") 
#include<bits/stdc++.h>
#define l(i,a,b) for(auto i=a;i<b;i++)
#define lr(i,a,b) for(auto i=a;i>=b;i--)
#define ll long long
#define lli long long int
#define ld long double
#define vec vector<int>
#define mii map<ll,ll>
#define vl vector<long long>
#define se set <long long int>
#define pi pair<long long,long long>
#define pb push_back
#define mp make_pair
#define ft first
#define sd second
#define all(v) v.begin(), v.end()
#define in(x) cin>>x
#define o(x) cout<<x
#define SYNC ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define PI 3.14159265359
using namespace std;


//const string k = "enterstringtobechecked";



int main()
{
    SYNC
    //clock_t tStart = clock();
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    ll n; in(n);
    if(n>=30)
        o("Yes");
    else
        o("No");





    //printf("Time taken: %.2fs\n", (double)(clock() - tStart)/CLOCKS_PER_SEC);   
}


Measured memory_bytes: 3636
#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <climits>
#include <queue>
#include <set>
#include <map>
#include <valarray>
#include <bitset>
#include <stack>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define chmax(a,b) (a<b?(a=b,1):0)
#define chmin(a,b) (a>b?(a=b,1):0)
#define valid(y,x,h,w) (0<=y&&y<h&&0<=x&&x<w)
typedef long long ll;
typedef pair<int,int> pii;
const int INF = 1<<29;
const double PI = acos(-1);
const double EPS = 1e-8;

int a[1000000];

int main() {
  int n,t;
  cin >> n >> t;
  REP(i,n) cin >> a[i];
  sort(a,a+n);
  ll ans = 1;
  const ll mod = 1e9+7;
  REP(i,n) {
    ll num = upper_bound(a,a+n,a[i]+t)-(a+i);
    ans = ans * num % mod;
  }
  cout << ans << endl;
}

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

int Exp(long long int exp_n,long long int exp_e, long long exp_mod);


int main(){
  int x;
  cin >> x;
  if(x==0){
    cout << 1 <<endl;
  }else{
    cout << 0 <<endl;
  }
}


int Exp(long long int exp_n,long long int exp_e, long long int exp_mod){
  long long int exp_o = 1;
  long long int exp_x=exp_n;
  long long int exp_tmp;
  
  while(0<exp_e){
    exp_tmp = exp_e/2;
    if(exp_e - exp_tmp*2 == 1){
      exp_o = exp_o*exp_x;
      if(exp_o>exp_mod){
        exp_o=exp_o%exp_mod;
      }
    }
    
    exp_x = exp_x*exp_x;
    if(exp_x>exp_mod){
      exp_x=exp_x%exp_mod;
    }
    exp_e = exp_tmp;
  }
  return exp_o;
}


Measured memory_bytes: 3588
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef tuple<int, int> ti2;
typedef tuple<int, int, int> ti3;
typedef tuple<int, int, int, int> ti4;
typedef tuple<ll, ll> tl2;
typedef tuple<ll, ll, ll> tl3;
typedef tuple<ll, ll, ll, ll> tl4;
typedef vector<int> vi;
typedef vector<ti2> vti2;
typedef vector<ti3> vti3;
typedef vector<ti4> vti4;
typedef vector<ll> vl;
typedef vector<tl2> vtl2;
typedef vector<tl3> vtl3;
typedef vector<tl4> vtl4;
typedef vector<string> vs;
typedef vector<vi> vvi;
typedef vector<vti2> vvti2;
typedef vector<vti3> vvti3;
typedef vector<vti4> vvti4;
typedef vector<vl> vvl;
typedef vector<vtl2> vvtl2;
typedef vector<vtl3> vvtl3;
typedef vector<vtl4> vvtl4;
typedef vector<vs> vvs;
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i < i##_len; i++)
#define FORD(i, a, b) for (int i = (a), i##_len = (b); i > i##_len; i--)
#define FORR(t, a) for (auto t : a)
#define ALL(x) (x).begin(), (x).end()  // sortなどの引数を省略したい
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
#define SORT(a, func) sort(ALL(a), [](const auto& x, const auto& y) func)
#define GET(i, j) get<j>(i)
#define MT(x, ...) make_tuple(x, __VA_ARGS__)
#define PRINT(i) cout << i << endl
#define PRINT2(i, j) cout << i << " " << j << endl
#define PRINT3(i, j, k) cout << i << " " << j << " " << k << endl
#define PRINT4(i, j, k, l) cout << i << " " << j << " " << k << " " << l << endl
#define PRINTL(a)                                       \
    for (const auto& d9aw : a) { cout << d9aw << " "; } \
    cout << endl

//演算子オーバーロード
bool operator<(const ti2 x, const ti2 y) {
    if (GET(x, 0) != GET(y, 0))
        return GET(x, 0) < GET(y, 0);
    else
        return GET(x, 1) < GET(y, 1);
}
bool operator>(const ti2 x, const ti2 y) {
    if (GET(x, 0) != GET(y, 0))
        return GET(x, 0) > GET(y, 0);
    else
        return GET(x, 1) > GET(y, 1);
}

int main() {
    int n;
    cin >> n;
    int h = n / 3600;
    n -= h * 3600;
    int m = n / 60;
    n -= m * 60;
    cout << h << ":" << m << ":" << n << endl;
}


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

using namespace std;

#define maxn 100005
#define ll long long int
#define db(x) cout<<#x<<" -> "<<x<<endl
#define db2(x,y) cout<<#x<<" -> "<<x<<" , "<<#y<<" -> "<<y<<endl
#define db3(x,y,z) cout<<#x<<" -> "<<x<<" , "<<#y<<" -> "<<y<<" , "<<#z<<" -> "<<z<<endl
#define prt(x) for(auto it = x.begin(); it!=x.end(); it++){cout<<*it<<" " ;}cout<<endl
#define IN freopen("input.txt","r",stdin)

ll dp[maxn][4];
vector< int > V[maxn];
int main(){
    ios_base::sync_with_stdio(false); cin.tie(0);
//    IN ;
    int n;
    cin>>n;
    for(int i=1; i<=n; i++){
        int a,b,c;
        cin>>a>>b>>c;
        V[i].push_back(a) ;
        V[i].push_back( b );
        V[i].push_back( c );
    }
    for(int i=1; i<=n; i++){
        for(int j=0; j < 3; j++){
            for(int k=0; k < 3 ; k++){
                if(j==k){ continue ; }
                dp[ i ][ j ] = max(dp[ i ][ j ] , dp[i-1][k]+V[i][j]) ;
            }
        }
    }
    ll ans = -1;
    for(int i=0; i<3; i++){
        ans = max(ans,dp[n][i]);
    }
    cout<<ans<<endl;
}


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

int main() {
  string s;
  cin >> s;
  if (s.size() % 2) {
    puts("No");
    return 0;
  }
  for (int i = 0; i < s.size(); i += 2) {
    if (s.at(i) != 'h' || s.at(i + 1) != 'i') {
      puts("No");
      return 0;
    }
  }
  puts("Yes");
}


Measured memory_bytes: 768
#include<iostream>
#include<string>
#include<iomanip>
#include<stdio.h>
#include<sstream>

using namespace std;

int main(void){
	long a,b;
	long ans = 0;
	cin >> a >> b;
	long tmp = b - a;
	for(int i = 1; i < tmp; i++){
		ans += i;
	}
	cout << ans - a << endl;
	
	
	return 0;
}

Measured memory_bytes: 256
#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 pb push_back
#define pp pop_back
#define x first
#define y second
#define endl "\n"
#define ll long long
#define ld long double
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define pii pair<int, int>
#define pss pair<string, string>
#define pll pair<long long, long long>

template <typename T> using ordered_set = tree <T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update>;

void INeedIT() {ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);	}

void freopen(string s) {
	freopen((s + ".in").c_str(), "r", stdin);
	freopen((s + ".out").c_str(), "w", stdout);
}

const int N = 1e4 + 5;

int a[N];

int main() {
	INeedIT();
	int n, sum = 0;
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> a[i];
		sum += a[i];
	}
	if (sum % 10 != 0) {
		cout << sum;
		return 0;
	}
	bool ok = 0;
	sort(a + 1, a + n + 1);
	for (int i = 1; i <= n; i++) {
		if (a[i] % 2 != 0) {
			ok = 1; 
			sum -= a[i];
			break;
		}
	}
	if (ok == 1) cout << sum;
	else cout << 0;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> //gp_hash_table

using namespace std;
using namespace __gnu_pbds;

typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define pb push_back

int L;

void solve() {
    cin >> L;
    double side = L / 3.0;
    cout << (side * side * side) << "\n";
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(20);
    solve();
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define maxn 500005
int n,last[maxn],dp[maxn];
char s[maxn];
int main()
{	
	scanf("%d%s",&n,s+1);
	int lp=0;
	for (int i=1;i<=n;i++)
	{
		last[i]=lp;
		if (s[i]=='0') lp=i;
	}
	for (int i=1;i<=n;i++)
	{
		dp[i]=dp[i-1];
		if (s[i]=='0' || !last[i] || s[last[i]-1]=='0') continue;
		int pos=last[i];
		int lpos=last[pos];
		if (pos>=2) dp[i]=max(dp[i],dp[pos-2]+i-pos);//10111111...
		if (pos==i-1)//0111111...01
		{
			if (lpos>=0) dp[i]=max(dp[i],dp[lpos]+i-lpos-2);//dp[lpos]+number of 1 on the left
		if (s[lpos-1]=='1')	if (lpos+1<pos) dp[i]=max(dp[i],dp[lpos+1]+i-lpos-3);
		}
	}
	printf("%d\n",dp[n]);
	return 0;
}


Measured memory_bytes: 4608
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int intH;
		int intW;
		while(true){
			intH = scan.nextInt();
			intW = scan.nextInt();
			if(intH == 0 && intW ==0){
				break;
			}
			for(int i = 0; i < intH; i++){
				for(int j = 0; j < intW; j++){
					if(j == 0 || j + 1 == intW || i == 0 || i + 1 == intH){
						System.out.print("#");
					}else{
						System.out.print(".");
					}

				}
				System.out.println();
			}
			System.out.println();
		}

		scan.close();
	}
}

Measured memory_bytes: 24664
#include <bits/stdc++.h>
using namespace std;
int main(){
    int X;
    cin>> X;
    int Ans=1;
    for(int i=2;i<35;i++){
        int j =2;
        while(pow(i,j)<=X){
            int A = pow(i,j);
            if(A<=X)Ans = max(Ans,A);
            j++;
        }
    }
    cout << Ans << endl;
}

Measured memory_bytes: 4088
public class Hello{
    public static void Main(){
        var s = System.Console.ReadLine();
        var a = false;
        var b = false;
        for(var i = 0; i < 3; ++i){
            if(s.Substring(i, 1) == "A"){
                a = true;
            } else {
                b = true;
            }
        }
        
        if(a && b){
            System.Console.WriteLine("Yes");
        }else{
            System.Console.WriteLine("No");
        }
    }
}


Measured memory_bytes: 11092
using System;
using System.Linq;

namespace Getting_Started
{
    class Insertion_Sort
    {
        static void Main(string[] args)
        {
            var N = int.Parse(Console.ReadLine());
            var A = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            InsertionSort(A, N);
        }

        static void InsertionSort(int[] A,int N)
        {
            for (int i = 1; i < N; i++)
            {
                for (int k = 0; k < A.Length - 1; k++)
                    Console.Write(A[k] + " ");
                Console.WriteLine(A.Last());
                var v = A[i];
                var j = i - 1;
                for (;j>=0 && A[j] > v;j--)
                    A[j + 1] = A[j];
                A[j + 1] = v;
            }

            for (int k = 0; k < A.Length - 1; k++)
                Console.Write(A[k] + " ");
            Console.WriteLine(A.Last());
        }
    }
}

Measured memory_bytes: 9676
#include <iostream>
#include <cstring>
#include <climits>
using namespace std;

void solve(string s,string key){
  int left = 0, right = 0;
  int n = s.length(), m = key.length();
  int minLen = INT_MAX, cnt = 0;
  string minStr = "";

  int level[256];
  bool flg[256];
  memset(flg,0,sizeof(flg));
  memset(level,0,sizeof(level));
  for(int i=0;i<m;i++) flg[key[i]] = true;

  int sum = 0;

  while(1){
    while(right < n && sum < m){
      level[s[right]]++;
      if(flg[s[right]] && level[s[right]] == 1){
        sum++;
      }
      right++;
    }

    if(sum < m) break;
    if(right - left < minLen){
      minLen = right - left;
      minStr = s.substr(left,right-left);
      cnt = 1;
    }
    else if(right - left == minLen){
      cnt++;
    }

    level[s[left]]--;
    if(flg[s[left]] && level[s[left]] == 0){
      sum--;
    }
    left++;
  }

  if(minLen == INT_MAX){
    cout<<"0\n\n";
  }
  else{
    cout<<cnt<<endl<<endl;
    int i;
    for(i=0;i<minStr.length();i++){
      if(i != 0 && i % 72 == 0) cout<<endl;
      cout<<minStr[i];
    }
    cout<<endl<<endl;
  }
}

int main(void){
  while(1){
    string s,key;

    while(1){
      string tmp;
      getline(cin,tmp);
      if(tmp.empty()) break;
      s += tmp;
    }

    if(s == "") break;
    getline(cin,key);
    solve(s,key);

    getline(cin,s);
  }

  return 0;
}

Measured memory_bytes: 2132
#include <iostream>

using namespace std;
typedef long long ll;

#define REP(i,n) for(int i = 0; i < n; i++)

int main(void)
{
    int A[2],K,p,q;
    cin >> A[0] >> A[1] >> K;
    for(int i = 0; i < K; i++) {
        p=i%2;q=1-p;
        if(A[p]%2==1) {
            A[p]-=1;
        }
        A[q]+=A[p]/2;
        A[p]/=2;
    }

    cout << A[0] << " " << A[1] << endl;


}


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

int main(){
    string str1, str2;
    int i;
    char tmp;
    cin >> str1 >> str2;
    if(str1 == str2){
        cout << "Yes" << endl;
        return 0;
    }
    for(i = 0; i < str1.size(); i++){
        tmp = str1[str1.size() - 1];
        
        str1.erase(str1.end() - 1);
        str1 = tmp + str1;

        if(str1 == str2){
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;

    return 0;
}


Measured memory_bytes: 256
/*
  ->->->->->-> Vora Mahammadasim <-<-<-<-<-<-
*/
#include<bits/stdc++.h>
#include<stdio.h>
#define int long long
#define pb emplace_back
#define Mod 1000000007
#define all(a) a.begin(),a.end()
using namespace std;
signed main(){

    ios::sync_with_stdio(false);
    cin.tie(0);
    string s;
    cin>>s;
    if(s == "ABC") cout<<"ARC\n";
    else cout<<"ABC";
}


Measured memory_bytes: 3648