akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define itrep(x) for(auto it=(x).begin();it!=(x).end();it++)
#define Sort(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define vi vector<int>
#define INF (int)1e9
#define INFL 1e18
//#define MOD 1000000007
#define pb push_back
#define MP make_pair
#define PI 3.1415926535
typedef long long int ll;
typedef std::pair<int,int> P;
int D=1;
int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

using namespace std;

ll gcd(ll a,ll b){
    if(b==0)return a;
    else return gcd(b,a%b);
}
ll lcm(ll a,ll b){
    return a*b/gcd(a,b);
}
int main(){
    ll ans=0;
    int n;
    cin>>n;
    int a,b;
    cin>>ans;
    
    rep(i,0,n-1){
        cin>>b;
        ans=lcm(ans,b);
    }
    cout<<ans<<endl;
    
    
    
    
    
    return 0;
}



Measured memory_bytes: 3100
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <cstring>

#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))

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

using namespace std;

int main(){
    string s;
    int n, m;
    int a, b, c;

    cin >> n >> m;
    cin >> s;
    m--;

    if(s[m] == 'A') {
        s[m] = 'a';
    }
    else if(s[m] == 'B') {
        s[m] = 'b';
    }
    else if(s[m] == 'C') {
        s[m] = 'c';
    }

    cout << s << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <iomanip>
#include <cstdio>

using namespace std;

int gcd(int, int);

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

    int N;
    cin >> N;
    int *A;
    A = new int[N];

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

    int *L = new int[N + 1];
    int *R = new int[N + 1];
    L[0] = 0;
    R[N] = 0;

    for (int i = 0; i < N; ++i)
    {
        L[i + 1] = gcd(L[i], A[i]);
    }
    for (int i = N - 1; i >= 0; --i)
    {
        R[i] = gcd(R[i + 1], A[i]);
    }

    int max = 0;
    for (int i = 0; i < N + 1; ++i)
    {
        int temp = gcd(L[i], R[i + 1]);
        if (max < temp) max = temp;
    }

    cout << max << "\n";

    return 0;
}

int gcd(int a, int b)
{
    if (a == 0)
    {
        return b;
    }
    else if (b == 0)
    {
        return a;
    }

    if (a > b)
    {
        int temp = a;
        a = b;
        b = temp;
    }

    while (a % b)
    {
        int temp = a;
        a = b;
        b = temp % b;
    }

    return b;
}



Measured memory_bytes: 1408
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(readline())
SP = [(x.split()[0].decode('utf-8'),int(x.split()[1])) for x in readlines()]

SP = sorted((name,-pt,i+1) for i,(name,pt) in enumerate(SP))

answer = '\n'.join(str(x[2]) for x in SP)
print(answer)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
const int inf = 1000000000; //10^9

int main(){
    int N;
    cin >> N;
    vector<int> X(N);
    rep(i, N) cin >> X.at(i);

    int L = X.at(0);
    int R = X.at(0);
    rep (i, N){
        L = min (X.at(i), L);
        R = max (X.at(i), R);
    }

    int ans  = inf;
    for (int i = L; i <= R; i++){
        int cost = 0;
        rep(j, N) cost += pow(X.at(j) - i, 2);
        ans = min (ans, cost);
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
//#include <ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
//using namespace __gnu_pbds;
//template<typename key, typename val>
//using ordered_tree =
//  tree<key, val, greater<>, rb_tree_tag, tree_order_statistics_node_update>;
typedef long long int64;
typedef complex<double> comp;
const double pi = 3.14159265358979323846;
const int inf = (int)1e+9 + 2;
const int64 inf64 = (int64)1e+18 + 2;
const double dinf = 1e+20;
const int mod = 1'000'000'007;//998244353;
const int base = 2187;
const double eps = 1e-8;
const int N = 200'000;
const int LOGN = 19;

int n, m, k;

void solve(int test)
{
  cin >> n;
  map<string, int> mp;
  int64 ans = 0;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    sort(begin(s), end(s));
    ans += mp[s]++;
  }
  cout << ans << '\n';
}

void precalc()
{
}

int main()
{
  ios::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  precalc();
  int test = 1;
  //cin >> test;
  //auto start = chrono::high_resolution_clock::now();
  for (int i = 1; i <= test; ++i)
    solve(i);
  //cerr << chrono::duration_cast<chrono::milliseconds>(chrono::high_resolution_clock::now() - start).count() << '\n';
  return 0;
}


Measured memory_bytes: 11264
#include <iostream>
#include <map>
#include <algorithm>
#include <string>
#include <vector> 
#include <numeric>
#include <cmath>
#include <queue>
#include <iomanip>
#include <functional>


#define CHMAX(a,b) a = std::max(a,b)
#define CHMIN(a,b) a = std::min(a,b)
#define MAXMIN(a,b,c) std::max(a,min(b,c))
#define CHABS(a) a = std::abs(a) 
#define COUT(a) std::cout << a << std::endl
#define CERR(a) std::cerr << a << std::endl
#define FOR(n) for(lli i = 0; i < n; i++)

using namespace std;
using lli = long long int;
using pll = pair<lli, lli>;
using tlll = tuple<lli, lli, lli>;
using vll = vector<lli>;

constexpr lli inf = 10000 * 10000;

lli mod197 = 1000000007LL;
lli INF = 10000000000000;

// ax + by = gcd(a,b) 最大公約数
template< typename T >
T extgcd(T a, T b, T& x, T& y) {
	T d = a;
	if (b != 0) {
		d = extgcd(b, a % b, y, x);
		y -= (a / b) * x;
	}
	else {
		x = 1;
		y = 0;
	}
	return d;
}

int main(void) {

	double r;
	cin >> r;

	cout << 2 * 3.1415 * r << endl;


	return 0;
}


Measured memory_bytes: 3720
n = int(input())
monsters = list(map(int, input().split()))
heros = list(map(int, input().split()))

defeat = 0
for i in range(n-1, -1, -1):
  if monsters[i+1] >= heros[i]:
    defeat += heros[i]
  else:
    defeat += monsters[i+1]
    heros[i] -= monsters[i+1]
    if monsters[i] >= heros[i]:
      defeat += heros[i]
      monsters[i] -= heros[i]
    else:
      defeat += monsters[i]
      monsters[i] = 0
      
print(defeat)

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
#define REP(i, n) for(int i=0; i<n; i++)

int D[40][40];
int Co[550][550];
int R[3][40];

int main(){
    int N, C;
    cin >> N >> C;
    REP(i,C){
       REP(j,C) {
           int d;
           cin >> d;
           D[i][j] = d;
       }
    }
    REP(i,N){
       REP(j,N){
           int c;
           cin >> c;
           c--;
           Co[i][j] = c;
       }
    }

    REP(i,N){
        REP(j,N){
            int c = Co[i][j];
            int x = (i+j)%3;
            R[x][c]++;
        }
    }


    ll ans = LLONG_MAX;
    REP(c1, C){
        REP(c2, C){
            if(c1 == c2) continue;
            REP(c3, C){
                if(c1 == c3) continue;
                if(c3 == c2) continue;

                ll num = 0;
                int cc[] = {c1, c2, c3};
                for(int i = 0; i < 3; i++){
                    for(int c = 0; c < C; c++){
                        int r = R[i][c];
                        num += r*D[c][cc[i]];
                    }
                }

                //printf("%d %d %d -> %lld\n", c1, c2, c3, num);
                ans = min(ans, num);
            }
        }
    }

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


Measured memory_bytes: 1280
import * as fs from "fs";

const input = (fs.readFileSync("/dev/stdin", "utf8") as string).split("\n");
const x = input[1].split(" ").map((x: string): number => +x);

const getCost = (x: number, p: number) => (x - p) ** 2;
const sumCosts = (array: Array<number>, p: number) => array.reduce((sum, x) => sum + getCost(x, p), 0);

let result = Infinity;
for (let p = 1; p <= 100; p++) {
	const cost = sumCosts(x, p);
	if (cost < result) result = cost;
}

console.log(result);


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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int N;
string S;

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>S;
	N=S.size();
	FOR(i,8) {
		string A=S.substr(0,i);
		string B=S.substr(N-(7-i));
		if(A+B=="keyence") {
			cout<<"YES"<<endl;
			return;
		}
	}
	cout<<"NO"<<endl;
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


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

template<class T> ostream& operator<<(ostream &os, vector<T> V){
	os << "[ ";
	for(auto v  : V) os << v << " ";
	return os << " ]";
}
template<class T> ostream& operator<<(ostream &os, set<T> V){
	os << "[ ";
	for(auto v  : V) os << v << " ";
	return os << " ]";
}
template<class T , class R > ostream& operator<<(ostream &os, map<T , R> V){
	os << "[ ";
	for(auto v  : V) os << "(" << v.first << ":" << v.second << ")";
	return os << " ]";
}
template<class T , class R > ostream& operator<<(ostream &os, pair<T , R> V){
	return os << "(" << V.first << "," << V.second << ")";
}

#define cerr cout
#define TRACE
#ifdef TRACE
    #define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
        cerr << name << " : " << arg1 << endl;
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names + 1, ',');
        cerr.write(names, comma - names) << " : " << arg1<<" | ";
        __f(comma+1, args...);
    }
    clock_t clk=clock();
    #define checktime() cout<<"\nTime Elapsed : "<<float(clock()-clk)/CLOCKS_PER_SEC<<endl
#else
    #define trace(...);
    #define checktime();
#endif
/*---------------------------Defines----------------------*/
typedef long long int ll;
typedef long double ld;
#define pll pair<ll,ll>
#define pb push_back
#define F first
#define S second
#define I insert
#define vll vector<ll>
#define vbl vector<bool>
#define vvll vector<vll>
#define vld vector<ld>
#define vb vector<bool>
#define vc vector<char>
#define vpll vector<pll>
#define all(x) (x).begin(), (x).end()
/*-----------------------Modular Arithmetic---------------*/
inline int add(int x,int y,int mod){
    x+=y;
    if (x>=mod) return x-mod;
    return x;
}
inline int sub(int x,int y,int mod){
    x-=y;
    if (x<0) return x+mod;
    return x;
}
inline int mul(int x,int y,int mod){
    return (x*1ll*y)%mod;
}
inline int power(int x,int y,int mod){
    int ans=1;
    while(y){
        if (y&1) ans=mul(ans,x,mod);
        x=mul(x,x,mod);
        y>>=1;
    }
    return ans;
}
inline int inv(int x,int mod){
    return power(x,mod-2,mod);
}
/*-----------------------------Code begins----------------------------------*/



void solve(){
    ll n;cin>>n;
    ll a[n];
    for(ll i=0;i<n;i++) cin>>a[i];
    vll dp(n,1ll<<60);
    dp[0]=0;
    for(ll i=0;i<n;i++){
        dp[i+1]=min(dp[i+1], dp[i]+abs(a[i]-a[i+1]));
        dp[i+2]=min(dp[i+2], dp[i]+abs(a[i]-a[i+2]));
    }
    cout<<dp[n-1]<<"\n";
}

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cout<<fixed<<setprecision(25);

    ll t=1;
    // cin>>t;
    while(t--){
        solve();
    }
    return 0;
}

Measured memory_bytes: 1792
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#define ll long long
#define inf 0x3f3f3f3f
#define mod 1000000007
#define Mod1(x) (x>=mod?x-mod:x)
#define Mod2(x) (x<0?x+mod:x)
#define maxn 200010
inline ll read()
{
	ll x=0; char c=getchar(),f=1;
	for(;c<'0'||'9'<c;c=getchar())if(c=='-')f=-1;
	for(;'0'<=c&&c<='9';c=getchar())x=x*10+c-'0';
	return x*f;
}
inline void write(ll x)
{
	static char buf[20];
	int len=0;
	if(x<0)putchar('-'),x=-x;
	for(;x;x/=10)buf[len++]=x%10+'0';
	if(!len)putchar('0');
	else while(len)putchar(buf[--len]);
}
inline void writesp(ll x){write(x); putchar(' ');}
inline void writeln(ll x){write(x); putchar('\n');}
char s[maxn];
int sum[maxn],f[maxn];
int n;
int main()
{
	scanf("%s",s+1);
	n=strlen(s+1);
	sum[0]=0;
	for(int i=1;i<=n;i++)
		sum[i]=(sum[i-1]+(s[i]=='a'?1:2))%3;
	int flag=0;
	for(int i=1;i<n;i++)
		if(s[i]==s[i+1])flag=1;
	if(!flag){
		puts("1"); return 0;
	}
	f[0]=1;
	int pos[3]={0,-1,-1};
	for(int i=1;i<=n;i++){
		f[i]=(!sum[i])&&(i<n);
		if(~pos[(sum[i]+1)%3])f[i]=(f[i]+f[pos[(sum[i]+1)%3]])%mod;
		if(~pos[(sum[i]+2)%3])f[i]=(f[i]+f[pos[(sum[i]+2)%3]])%mod;
		pos[sum[i]]=i;
		// printf("%d %d %d : %d %d %d\n",i,sum[i],f[i],pos[0],pos[1],pos[2]);
	}
	writeln(f[n]);
	return 0;
}

Measured memory_bytes: 1024
#include <cstdio>
#include <algorithm>
using namespace std;
#define INF 0x7fffffff

int a, b, c, x, y, Min = INF;

int main()
{
	scanf("%d%d%d%d%d", &a, &b, &c, &x, &y);
	for (int i = 0; i <= 2 * (x + y); i += 2)
	{
		int tmp = i * c;
		int t_a = max(0, x - i / 2);
		int t_b = max(0, y - i / 2);
		tmp += t_a * a + t_b * b;
		Min = min(Min, tmp);
	}
	printf("%d\n", Min);
	return 0;
}

Measured memory_bytes: 128
// ※※※ 解答不能 ※※※
// rickytheta氏.
// https://atcoder.jp/contests/abc135/submissions/6576054
// (解説の再現を行えなかった)
// 解き直し.
// ABC 135解説
// https://img.atcoder.jp/abc135/editorial.pdf
#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using vi = vector<int>;
using vl = vector<ll>;

using _loop_int = int;
#define REP(i,n) for(_loop_int i=0; i<(_loop_int)(n); i++)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a); i<(_loop_int)(b); i++)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1; i>=(_loop_int)(a); i--)

#define CHMIN(a,b) (a)=min((a),(b))
#define CHMAX(a,b) (a)=max((a),(b))
#define ALL(v) (v).begin(),(v).end()

#define DEBUG(x) cerr<<#x<<": "<<(x)<<endl
#define DEBUG_VEC(v) cerr<<#v<<": ";REP(__i,(v).size())cerr<<((v)[__i])<<", ";cerr<<endl

const ll MOD = 1000000007ll;

ll k,x,y;

pll solve(ll k, ll sx, ll sy, ll tx, ll ty){
    // DEBUG(sx); DEBUG(sy); DEBUG(tx); DEBUG(ty); DEBUG(k);
    REP(i,2)REP(j,3){
        ll y = (sy + ty + (i==0?1:-1)*(sx-tx) + (j==0?1:j==1?-1:0)*2*k)/2;
        REP(ii,2){
            ll x = sx + (ii==0?1:-1)*(k-abs(y-sy));
            // DEBUG(x); DEBUG(y);
            if(abs(x-sx)+abs(y-sy)!=k)continue;
            if(abs(x-tx)+abs(y-ty)!=k)continue;
            return pll(x,y);
        }
    }
}

int main(){
    cin>>k>>x>>y;
    if(k%2==0 && (abs(x)+abs(y))%2==1){
        puts("-1");
        return 0;
    }
    vector<pll> path;
    ll cx = 0, cy = 0;
    while(cx!=x || cy!=y){
        ll d = abs(cx-x) + abs(cy-y);
        if(d == k){
            path.push_back(pll(x,y));
            break;
        }else if(d < 2*k && d % 2 == 0){
            // 2-step
            pll P = solve(k,cx,cy,x,y);
            path.push_back(P);
            path.push_back(pll(x,y));
            break;
        }else if(d < k && d % 2 == 1){
            // 3-step
            if(abs(cx-k-x)+abs(cy-y)<k){
                cx -= k;
            }else if(abs(cx+k-x)+abs(cy-y)<k){
                cx += k;
            }else if(abs(cx-k)+abs(cy-k-y)<k){
                cy -= k;
            }else{
                cy += k;
            }
            path.push_back(pll(cx,cy));
            pll P = solve(k,cx,cy,x,y);
            path.push_back(P);
            path.push_back(pll(x,y));
            break;
        }else{
            // naive step
            ll dx = x - cx; ll dxir = x==cx ? 0 : (x-cx) / abs(x-cx);
            ll dy = y - cy; ll dyir = y==cy ? 0 : (y-cy) / abs(y-cy);
            ll ex=0, ey=0;
            ll sb = min(k, abs(dx));
            ex += sb * dxir;
            ey += (k-sb) * dyir;
            cx += ex;
            cy += ey;
            path.push_back(pll(cx,cy));
        }
    }
    printf("%d\n",(int)path.size());
    for(pll P : path){
        printf("%lld %lld\n",P.first,P.second);
    }
    return 0;
}

Measured memory_bytes: 5488
package main

import (
	"fmt"
	"strconv"
)

func main() {
	var h, w int
	fmt.Scan(&h, &w)
	s := make([][]string, h)
	for i := 0; i < h; i++ {
		s[i] = make([]string, w)
		for j := 0; j < w; j++ {
			fmt.Scan(&s[i][j])
		}
	}
	for i := 0; i < h; i++ {
		for j := 0; j < w; j++ {
			if s[i][j] == "snuke" {
				fmt.Println(string('A'+j) + strconv.Itoa(i+1))
				return
			}
		}
	}
}


Measured memory_bytes: 512
#include<stdio.h>
#define ARYMAX 5
int main(){
    int ary1[ARYMAX],ary2[ARYMAX],ten=0;
    for(int i=0;i<ARYMAX;i++){
        scanf("%d",&ary1[i]);
        ary2[i]=ary1[i]%10;
        if(ary2[i]==0)ten++;
    }
    ten++;
    int net=ARYMAX-ten;
    if(net<0)net=0;
    int mininum=9;
    for(int i=0;i<ARYMAX;i++){
        if(ary2[i]<=mininum&&ary2[i]!=0)mininum=ary2[i];
    }
    int gt=0;
    for(int i=0;i<ARYMAX;i++){
        gt+=ary1[i]-ary2[i];
    }
    gt+=net*10;
    if(net==0)mininum=0;
    gt+=mininum;
    printf("%d\n",gt);
    return 0;
}

Measured memory_bytes: 128
n = gets.to_i

flag = true
ot = ox = oy = 0 # old
n.times do |i|
    
    t,x,y = gets.split.map(&:to_i)
    dt = t - ot
    dx = (x-ox).abs
    dy = (y-oy).abs
    
    remain_t = dt - dx - dy
    if remain_t < 0 or remain_t.odd?
        flag = false
        break
    end
    
    ot, ox, oy = t, x, y
end

puts flag ? "Yes" : "No"

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

using namespace std;
typedef long long ll;
ll dp[100005][105][2],k,n;
ll mod=1e9+7;
vector<int> num;
ll cal(int i, ll sum, bool pre){
  if(i>=n) return sum==0;
  if(dp[i][sum][pre]!=-1) return dp[i][sum][pre];
  ll ans =0;
  if(pre){
    for(int d=0; d<=num[i]; d++){
      ans+=cal(i+1,(sum+d)%k,d==num[i]);
      if(ans>mod) ans-=mod;
    }
  }
  else {
    for(int d=0; d<=9; d++){
      ans+=cal(i+1,(sum+d)%k,false);
      if(ans>mod) ans-=mod;
    }
  }
  return dp[i][sum][pre]=ans;
}
int main() {
  memset(dp,-1,sizeof dp);
  string s;
  cin>>s;
  cin>>k;
  num.clear();
  n=s.size();
  for(int i=0; i<s.size(); i++){
    num.push_back(s[i]-'0');
  }
  ll ans = cal(0,0,true)-1;
  cout<<ans<<endl;
}


Measured memory_bytes: 165248
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
ll mod = 1000000007;

string s;
int n, d, c;

int main() {
    cin >> n >> s;
    rep(i, s.size()) {
        if(s[i] == '(') {
            c++;
        }
        else {
            c--;
        }

        d = min(d, c);
    }

    rep(i, -d) {
        cout << "(";
    }
    cout << s;
    rep(i, c-d) {
        cout << ")";
    }

    cout << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define INF 1e9
#define PI 3.14159265359
#define MOD 1000000007
#define ALL(v) v.begin(),v.end()
#define ALLR(v) v.rbegin(),v.rend()
typedef long long ll;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
//isPrime
//modpow modinv
//getDigit
int main() {
  cout << fixed << setprecision(10);
  int x;
  cin >> x;
  if(x<1200){
    cout << "ABC" << endl;
  }else{
    cout << "ARC" << endl;
  }
}


Measured memory_bytes: 256
let h, w = Scanf.scanf " %d %d" @@ fun a b -> a, b
let css = Array.init h @@ fun _ -> Scanf.scanf " %s" @@ fun s -> s
let _ =
  for i = 0 to h * 2 - 1 do
    for j = 0 to w - 1 do
      print_char css.(i / 2).[j] done;
    print_newline () done

Measured memory_bytes: 512
<?php
  
fscanf(STDIN,"%d",$n);
fscanf(STDIN,"%d %d",$t,$a);
$h_li = explode(" ",trim(fgets(STDIN)));
$ichi = 0;
$re = array();
for($i=0;$i<$n;$i++){
  $re[$i] = abs($a-($t-($h_li[$i]*0.006)));
}


asort($re);

$keys = array_keys($re);
echo ($keys[0]+1)."\n";


Measured memory_bytes: 4604
#include <iostream>
using namespace std;
int main(){
	int c1=1,c5=5,c10=10,c50=50,c100=100,c500=500;
	int a,b,c,d,e,f;
	cin>>a>>b>>c>>d>>e>>f;
	if(c1*a+c5*b+c10*c+c50*d+c100*e+c500*f>=1000){
		cout<<"1"<<endl;
	}else if(c1*a+c5*b+c10*c+c50*d+c100*e+c500*f<=1000){
		cout<<"0"<<endl;
	}
}

Measured memory_bytes: 1156
#include<stdio.h>

int main()
{
  long long int count=0,t=0,T=1000000000,nt=(t+T)/2,i,N,A,B,h[100000];
  scanf("%lld %lld %lld",&N,&A,&B);
  for(i=0;i<N;i++)
    scanf("%lld",&h[i]);
  while(1){
    count =0;
    for(i=0;i<N;i++)
      if(h[i]-B*nt > 0)
        count += h[i]%(A-B) ? (h[i]-B*nt)/(A-B)+1 :(h[i]-B*nt)/(A-B);
    if(count <= nt)
      T = (t+T)/(long long int)2;
    else
      t = (t+T)/(long long int)2;
    nt =(t+T)/2;
    if(t==T-1)
      break;
  }
  printf("%d\n",T);
}


Measured memory_bytes: 896
#include<stdio.h>
int main(){
	int a,b,c,i,j,k;
    scanf("%d" "%d" "%d",&a,&b,&c);
	
	i=a+b;
	j=b+c;
	k=c+a;
		
		if(i==j && j==k && k==i ){
			printf("%d",i);
		}else if(i <= j && i <= k){
			printf("%d\n",i);
						
		}else if(j <= i && j <= k){
			printf("%d\n",j);
			
		}else if(k <= i && k <= j){
			printf("%d\n",k);
		} 

	return 0;
} 

Measured memory_bytes: 128
/*
	Copyright: razouq (c)
	Author: Anass BENDARSI
	Date: 21/01/2018 12:10:40
	flamers will **** you
*/
#include<bits/stdc++.h>
//#include<flamers.h>
#define ll long long
#define ull unsigned long long
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define POB pop_back
#define dist(a, b) sqrt(a*a + b*b)
using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef vector<pair<int, int>> vipi;
bool compare(pi p1, pi p2){
	 if(1) return true;
	 return false;
}

int main(){
//	freopen("input.in", "r", stdin);
//	freopen("output.out", "w", stdout);
	ios::sync_with_stdio(0);
	cin.tie();
	long long a, b;
	cin>>a>>b;
	if(a*b % 2 == 0) cout<<"Even"<<endl;
	else cout<<"Odd"<<endl;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
vector<int> g[100005];
vector<int> l,r;
void dfs(int u,int p=-1,int d=0){
    l[u]=d;
    for(auto v:g[u]){
        if(v==p)continue;
        dfs(v,u,d+1);
    }
}
void dfs2(int u,int p=-1,int d=0){
    r[u]=d;
    for(auto v:g[u]){
        if(v==p)continue;
        dfs2(v,u,d+1);
    }
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;cin>>n;
  rep(i,n-1){
      int a,b;cin>>a>>b;
      --a,--b;
      g[a].push_back(b);
      g[b].push_back(a);
  }
  l=r=vector<int>(n);
  dfs(0);
  dfs2(n-1);
  int a=0,b=0;
  rep(i,n){
      if(l[i]<=r[i])a++;
      else b++;
  }
  if(a>b)cout<<"Fennec"<<endl;
  else cout<<"Snuke"<<endl;
  return 0;
  }

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

namespace{
   constexpr int g1 = 1000 * 1000 * 1000, si = 1001 * 1002, si_log = 8 + 10, mod = static_cast<int>(1e9) + 7;
   constexpr long double eps = 1.0e-9;
   int n, m;
}

int64_t sol() {
   int64_t ret = 0 * numeric_limits<int64_t>::max();
   return ret;
}

int main() {
   ios_base::sync_with_stdio(0); cin.tie(0);
   
   while (1 == scanf("%d", &n))
   {
      //memset(ar, 0, sizeof ar);
      //for (int i = 0; i <= n; i++)  { gr[i].clear(); }
      //for (int i = 1; i < n; i++) {
      //   int a, b; cin >> a >> b; gr[a].push_back(b); gr[b].push_back(a);
      //}
      auto s =0
         //sol()
      ;
      if (9 == (n % 10))
         s = 1;
      n /= 10;

      if (9 == (n % 10))
         s = 1;
      cout << (s ? "Yes": "No") << '\n';
      //cout << s << '\n';
#ifndef _DEBUG
      break;
#endif
   }
   return 0;
}

Measured memory_bytes: 256
def gcdlol(a,b):
    if b==0:
        return a
    else:
        return gcdlol(b,a%b)

n=int((input()))
a=input().split()
t=1
for x in a:
    t=(t*int(x))//(gcdlol(t,int(x)))
ans=0
for x in a:
    ans+=(t//int(x))
print(ans%1000000007)


Measured memory_bytes: 3700
#include <stdio.h>

int main(void)
{
	int a,i;
	int count[101]={0};
	int max=0;
	while(scanf("%d",&a)!=EOF)
		
		count[a]++;
		for(i=1;i<=100;i++){
			if(max<count[i])
				max=count[i];
		}
	
	for(i=0;i<=100;i++){
		if(max==count[i])
			printf("%d\n",i);
	}
	return 0;
}

Measured memory_bytes: 596
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <vector>
using namespace std;
typedef long long int64;
typedef pair<int,int> pii;
typedef pair<int64, int64> pll;

const double PI = acos(-1.0);
const int INF = 0x3f3f3f3f;


int main(){
	int A,B,H,M;
	scanf("%d%d%d%d",&A,&B,&H,&M);

	double C = ((H+M/60.0)/12.0-M/60.0)*2*PI;
	double c2 = A*A+B*B-2*A*B*cos(C);
	double c = sqrt(c2);
	printf("%.20lf\n",c);
}



Measured memory_bytes: 3616
#include <iostream>
#include <cmath>

using namespace std;

long pow(long x,long n,long M){
    long res = 1;
    if(n > 0){
        res = pow(x,n / 2,M);
        if(n % 2 == 0){
            res = (res * res) % M;
        }else{
            res = (((res * res) % M) * x) % M;
        }
    }
    return res;
}

int main(){
    int m,n;
    cin >> m >> n;
    
    cout << pow(m,n,1000000007) << endl;
    return 0;
}



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

int main(){ 
  int P,Q,R,X,Y,Z;
  cin >> P >> Q >> R;
  
  X = P + Q;
  Y = Q + R;
  Z = R + P;
  
  if (X > Y){
    if (Y > Z) cout << Z << endl;
    else cout << Y << endl;
  }
  
  else{
    if (X > Z) cout << Z << endl;
    else cout << X << endl;
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pb push_back
#define mk make_pair
#define x first
#define y second
using namespace std;
typedef long long ll;
typedef pair <int,int> PAIR;
const int N = 2e5+5;
const ll M = 998244353;

ll C[N];

inline ll qpow(ll a,ll b){
	ll res = 1;
	a %= M;
	while(b){
		if(b & 1) (res *= a) %= M;
		(a *= a) %= M;
		b >>= 1;
	}
	return res%M;
}
inline ll inv(ll a){
	return qpow(a,M-2);
}

inline void C_table(ll n){
	C[0] = 1ll;
	C[1] = n;

	for(int i = 2;i <= n;++i){
		C[i] = C[i-1]%M * (ll)(n-i+1)%M * inv(i)%M;
		C[i] += M;
		C[i] %= M; 
	}
	return ;
}

int main() {
	int n,m,k;
	scanf("%d%d%d",&n,&m,&k);
	C_table(n-1);
	
	ll ans = 0;
	for(int i = 0;i <= k;++i){
		int t = n-1-i;
		
		ll l = C[t];
		ll r = t+1;
		
		l = l*(ll)m%M;
		r--;
		l = l*qpow(m-1,r)%M;
		(ans += l) %= M;
		(ans += M) %= M;
	}
	printf("%lld\n",ans);
	return 0;
}


Measured memory_bytes: 5312
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <iomanip>
#include <set>
using namespace std;
typedef long long int ll;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define yes cout << "yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
#define no cout << "no" << endl

const int INF = 1001001001;
const int mod = 1000000007;
#define PI 3.14159265359;

void P(int x) {cout << x << endl;}
void P(long x) {cout << x << endl;}
void P(double x) {cout << x << endl;}
void P(ll x) {cout << x << endl;}
void P(string x) {cout << x << endl;}
void P(char x) {cout << x << endl;}

ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}

int main() {
  int a, b;
  cin >> a >> b;
  int now = 1;
  int ans = 0;
  while (now < b) {
    ans++;
    now += a - 1;
  }
  P(ans);
  return 0;
}

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

#ifdef _DEBUG
#define debug(x) cerr << "line: " << __LINE__ << ", func: " << __func__ << " ->  " << #x << " = " << x << endl
#define INFILE freopen("input.txt", "r", stdin)
#else
#define debug(x)
#define INFILE
#endif

#define ALL(s) begin(s), end(s)
#define RALL(s) rbegin(s), rend(s)
#define REP(i, a, b) for (int i = (a); i < (b); i++)
#define RREP(i, a, b) for (int i = (a); i >= (b); i--)

using namespace std;

using ll = long long;
using ull = unsigned long long;
using i_i = pair<int, int>;
using ll_ll = pair<ll, ll>;
using d_ll = pair<double, ll>;
using ll_d = pair<ll, double>;
using d_d = pair<double, double>;

static constexpr ll INF = 1LL << 60;
static constexpr double PI = static_cast<double>(3.14159265358979323846264338327950288);
static constexpr double EPS = numeric_limits<double>::epsilon();
static constexpr ll MOD = 1000000007;

static map<type_index, const char* const> scanType = {
    {typeid(int), "%d"}, {typeid(ll), "%lld"}, {typeid(double), "%lf"}, {typeid(char), "%c"}};

template <class T> static void scan(vector<T>& v);
[[maybe_unused]] static void scan(vector<string>& v, bool isWord = true);
template <class T> static inline bool chmax(T& a, T b);
template <class T> static inline bool chmin(T& a, T b);
template <class A, size_t N, class T> static void Fill(A (&arr)[N], const T& val);

ll dp[21 + 1][1 << 21];

int main(int argc, char* argv[]) {
  long long N;
  scanf("%lld", &N);
  std::vector<std::vector<long long>> a(N, std::vector<long long>(N));
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      scanf("%lld", &a[i][j]);
    }
  }

  dp[0][0] = 1;
  REP(i, 0, N) {
    REP(j, 0, 1 << N) {
      if (i != __builtin_popcount(j)) continue;
      REP(k, 0, N) {
        int mask = 1 << k;
        if (mask & j || !a[i][k]) continue;
        dp[i + 1][j | mask] = (dp[i + 1][j | mask] + dp[i][j]) % MOD;
      }
    }
  }

  cout << dp[N][(1 << N) - 1] << endl;
  return 0;
}

template <class T> static void scan(vector<T>& v) {
  auto tFormat = scanType[typeid(T)];
  for (T& n : v) {
    scanf(tFormat, &n);
  }
}

static void scan(vector<string>& v, bool isWord) {
  if (isWord) {
    for (auto& n : v) {
      cin >> n;
    }
    return;
  }

  int i = 0, size = v.size();
  string s;
  getline(cin, s);

  if (s.size() != 0) {
    i++;
    v[0] = s;
  }

  for (; i < size; ++i) {
    getline(cin, v[i]);
  }
}

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

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

template <class A, size_t N, class T> void Fill(A (&arr)[N], const T& val) {
  std::fill((T*)arr, (T*)(arr + N), val);
}


Measured memory_bytes: 309504
import collections as cl

N = int(input())
S_list = []
for i in range(N) :
    S_list.append(input())

c = cl.Counter(S_list)

print("AC x " + str(c["AC"]))
print("WA x " + str(c["WA"]))
print("TLE x " + str(c["TLE"]))
print("RE x " + str(c["RE"]))

Measured memory_bytes: 16620
#include <bits/stdc++.h>
using namespace std;
#include "string"
#define endl '\n'
#define ff first
#define int long long
#define pi pair<int,int>
#define ss second 
#define boost ios_base::sync_with_stdio(false);cin.tie(nullptr)


int32_t main() { 
	boost;
    int s,w;
    cin>>s>>w;
    if(w>=s)
        cout<<"unsafe"<<endl;
    else
        cout<<"safe"<<endl;
}
 

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

int main() {

	string S;
	cin >> S;
	int ans = 700;
	for (int i = 0; i < S.size(); i++) {

		if (S[i] == 'o') {
			ans += 100;
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 3148
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String line = scanner.nextLine();
        String[] values = line.split(" ");
        long a = Long.parseLong(values[0]);
        int b = Integer.parseInt(values[1]);
        String c = Long.toString(a,b);
        System.out.println(c.length());
    }
}

Measured memory_bytes: 21716
#include <bits/stdc++.h>
using namespace std;
 
#define F first
#define S second 
#define mp make_pair
#define pb push_back
#define pf push_front
#define speed_up ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define debug cerr << "OK\n";
#define ub upper_bound
#define lb lower_bound
#define treap_pair pair<treap*, treap*>
 
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pii> vpii;
typedef set <int> si;
typedef set <ll> sll;
typedef multiset <int> msi;
typedef multiset <ll> msll;
typedef map <int, int> mi;
typedef map <ll, int> mll;
 
const int N = 2e5 + 2;
const int M = 1e5 + 2;
const int mod = 998244353;
const int inf = 1e9;
const ll INF = 1e16;

void data() {
	#ifdef PC
		freopen("convex.in", "r", stdin);
		freopen("convex.out", "w", stdout);
	#endif
}

vector <pll> lines;

int n;
ll c, h[N], dp[N];

ld cross(pll a, pll b) {
	return (b.S - a.S + 0.0) / (a.F - b.F + 0.0);
}

void add(pll new_line) {
	while (sz(lines) > 1) {
		int sz = sz(lines) - 1;
		if (cross(new_line, lines[sz - 1]) > cross(lines[sz], lines[sz - 1]))
			break;
		lines.pop_back();
	}
	lines.pb(new_line);
}

ll get_min(ll x) {
	int l = 0;
	for (int pos = sz(lines); pos >= 1; pos /= 2)
		while (l + pos < sz(lines) && cross(lines[l + pos - 1], lines[l + pos]) < x + 0.0)
			l += pos;
	return lines[l].F * x + lines[l].S;
}

int main() {
	data();
	scanf("%d %lld", &n, &c);
	for (int i = 1; i <= n; ++i)
		scanf("%lld", &h[i]);
	add(mp(-2LL * h[1], h[1] * h[1]));
	for (int i = 2; i <= n; ++i) {
		dp[i] = get_min(h[i]) + h[i] * h[i] + c;
		add(mp(-2LL * h[i], dp[i] + h[i] * h[i]));
	}              
	printf("%lld", dp[n]);
}

/*
	Timus: 288481RF
	CodeForces: fractal
*/


Measured memory_bytes: 8944
#include<cstdio>
#include<iostream>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<climits>
//#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stack>
#include<queue>
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<functional>
#include<limits.h>
#include<numeric>
using namespace std;
//#def long long ll

//bool visited[100][100];
//char mat[100][100];
//int count=0;
int main() {
	
	long long n,m;
	cin>>n>>m;
	char a[n][m];
	long long ans[n][m];
	for(long long i=0;i<n;i++)
	{
	    for(long long j=0;j<m;j++)
	    {
	        cin>>a[i][j];
	    }
	}
	ans[0][0]=0;
	for(long long i=0;i<n;i++) ans[i][0]=0;
	for(long long  j=0;j<m;j++) ans[0][j]=0;
	for(long long i=1;i<n;i++)
	{
	    if(a[i][0]=='#') break;
	    ans[i][0]=1;
	}
	for(long long j=0;j<m;j++)
	{
	    if(a[0][j]=='#') break;
	    ans[0][j]=1;
	}
	for(long long i=1;i<n;i++)
	{
	    for(long long j=1;j<m;j++)
	    {
	        if(a[i][j]=='#') ans[i][j]=0;
	        else ans[i][j]=ans[i-1][j]+ans[i][j-1];
	        ans[i][j]=ans[i][j]%1000000007;
	    }
	}
	cout<<ans[n-1][m-1]<<endl;
	
	return 0;
}

Measured memory_bytes: 9088
#include <vector>
#include <math.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <queue>
#include <iomanip>
#include <deque>
#include <cctype>
#include <unordered_map>

using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<long, long>;
template <class T> using V = vector<T>;
template <class T> using VV = V<V<T>>;
#define rep(i, n) for(int i = 0; i<n; i++)
#define rep_s(i, start, n) for(int i= start;  i<n; i++)
#define rep_down(i, n) for(int i = n-1; i>=0; i--)
#define rep_down_s(i, n, start) for(int i = n-1; i>=start; i--)
#define ALL(a) (a).begin(), (a).end()
#define ALL_str(a) (a).cbegin(), (a).cend()

string alphabet_upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
string alphabet_lower  = "abcdefghijklmnopqrstuvwxyz";
string numbers = "0123456789";
/*
for (iterator = hash.begin(); iterator != hash.end(); iterator++)
{
// ここで、要素毎の操作を行います。
std::pair<std::string, CMyClass> element = *iterator;

}
*/
/*
using edge = struct {int to; ll cost;};
vector<edge> tree[limit];
ll depth[limit];

void dfs(int v, int p, ll d){
  depth[v] = d;
  //cout <<"v: " << v << endl;
  for (auto &e: tree[v]){
    //cout << "e.to: " << e.to << endl;
    if (e.to == p) continue;
    dfs(e.to, v, d+e.cost);
  }
}
*/
int keta_sum(int num){
  int dig, sum = 0;
  while(num){
    dig = num % 10;
    sum = sum + dig;
    num = num / 10;
  }
  return sum;
}

ll binary_search(ll left_key, ll border, ll low, ll high) {
     // 配列 a の左端と右端
    ll mid = (low+high)/2;
    while (high > low+1) {
       mid = (low+high)/2;
        if (left_key*mid>border) high = mid;
        else if (left_key*mid<border) low = mid;
        else {
          mid =mid-1;
          break;
        }
    }
    return mid;
}

bool IsPrime(ll a){
  ll b = sqrt(a);
  b++;
  while(b-->=2){
    if (a%b==0) return false;
  }
  return true;
}

ll gcd(ll a, ll b){
  ll tmp;
  if(a<b){
    tmp = a;
    a = b;
    b = tmp;
  }

  ll r = a % b;
  while(r!=0){
    a = b;
    b = r;
    r = a % b;
  }
  return b;
}

struct UnionFind {
    vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

    UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
        for(int i = 0; i < N; i++) par[i] = i;
    }

    int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y) { // xとyの木を併合
        int rx = root(x); //xの根をrx
        int ry = root(y); //yの根をry
        if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
        par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
    }

    bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};

int main(void){
  ll N, M, A, B, C, D, E, F, K,L, W, H, P, Q, R, X, Y;
  ll ans;
  string S, T;
  cin >> A >> B;
  ans = 1;
  ll count = 0;
  while (ans<B){
    ans --;
    ans += A;
    count ++;
  }
  

  cout << count << endl;

}


Measured memory_bytes: 256
import math
import sys
from operator import itemgetter

# N, K = map(int, input().split())
# h = list(map(int, input().split()))
# S = [input() for _ in range(H)]
# X = [[0 for j in range(100)] for i in range(200)]


def solve(n, k, h):
	h = sorted(h)
	
	ans = h[-1]
	for i in range(k-1, n):
		ans = min(ans, h[i] - h[i - k + 1])
	print(ans)

if __name__ == '__main__':
	### input
	n, k = map(int, input().split())
	h = []
	for i in range(n):
		h.append(int(input()))
	###solve
	solve(n, k, h)
	
	

Measured memory_bytes: 8356
#include<iostream>
int main()
{
	std::string s,t;
	std::cin>>s>>t;
	int n=s.length(),ans=0;
	for(int i=0;i<n;i++){
		if(s[i]!=t[i])
			ans++;
	}

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

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

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef vector<ll> vll;

#define PI (2*acos(0.0))
#define eps 1e-9
#define pb push_back
#define endl "\n"
#define watch(x) cout << (#x) << " is " << (x) << endl;
#define show(v) for(int fi = 0; fi < v.size(); fi++) cout << v[fi] << " "; cout << endl;
#define showpair(v) for(int fi = 0; fi < v.size(); fi++) cout << v[fi].first << " " << v[fi].second << endl;
#define ff first
#define ss second
#define fu cout << "lol" << endl;
#define precision(n) cout << fixed << setprecision(n);
#define lb lower_bound
#define up upper_bound
#define vscan for(i = 0;i<n;i++){cin>>in; v.pb(in);}
#define all(a) a.begin(), a.end()
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c))
#define mem(a,val) memset(a,val,sizeof(a))
#define loop(i,n) for(i = 0; i < n; i++)
#define TC ull T; cin>>T; while(T--)
#define IN(x) {scanf("%d",&x);}
#define LL(x) {scanf("%lld",&x);}
#define CC(x) {scanf("%c",&x);}
#define pfl(x) printf("%d\n",x)
#define pfll(x) printf("%lld\n",x)
#define newl puts("")
#define space printf(" ")
#define MOD 1000000007
#define speed ios_base::sync_with_stdio(false); cin.tie(NULL);


int main()
{
    int i = 0, j = 0, cs = 0, in;
    string s; cin>>s;
    if(s[0] == 'R' && s[1] == 'R' && s[2] == 'R') cout << 3 << endl;
    else if(s[0] == 'R' && s[1] == 'R' || s[1] == 'R' && s[2] == 'R') cout << 2 << endl;
    else if(s[0] == 'R' || s[1] == 'R' || s[2] == 'R') cout << 1 << endl;
    else cout << 0 << endl;
    return 0;
}


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

using namespace std;

typedef long long ll;

const int INF = 1e9;
const ll LLINF = 1e18;
const ll MOD = (ll)1e9 + 7;

int main()
{
  int N, M; scanf("%d %d", &N, &M);
  vector<vector<int>> dist(N + 5, vector<int>(N + 5, INF));
  int a, b, c;
  vector<pair<int, int>> V(M);
  vector<int> C(M);
  for (int i = 0; i < M; ++i) {
    scanf("%d %d %d", &a, &b, &c);
    dist[a][b] = dist[b][a] = c;
    V[i] = make_pair(a, b);
    C[i] = c;
  }

  for (int i = 1; i <= N; ++i) { dist[i][i] = 0; }

  for (int k = 1; k <= N; ++k) {
    for (int i = 1; i <= N; ++i) {
      for (int j = 1; j <= N; ++j) {
        dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
      }
    }
  }

  int ans = 0;
  for (int i = 0; i < M; ++i) {
    int a = V[i].first, b = V[i].second;
    bool need = false;
    for (int u = 1; u <= N; ++u) {
      if (dist[u][b] == dist[u][a] + C[i]) {
        need = true;
      }
    }
    if (not need) { ++ans; }
  }
  printf("%d\n", ans);
  return 0;
}


Measured memory_bytes: 256
A,B=map(int,input().split())
S=str(input())
if S[A]!="-" or S.count("-")!=1:
    print('No')
else:
    S_prime=S.split("-")
    S_leng=[len(str(i)) for i in S_prime]
    if S_leng==[A,B]:
        print('Yes')
    else:
        print('No')

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    if (n == 1){
        cout << "Hello World" << endl;
    }
    else if (n == 2){
        int A, B;
        cin >> A >> B;
        cout << A + B << endl;
    }
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdlib>

int main()
{
    char S;
    bool odd = true;
    while (std::cin.get(S))
    {
        if ((odd && S == 'L') || (!odd && S == 'R'))
        {
            std::cout << "No" << std::endl;
            return EXIT_SUCCESS;
        }
        odd = !odd;
    }
    std::cout << "Yes" << std::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;
 
#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
	template <class Arg1> void __f(const char* name, Arg1&& arg1) { cerr << name << " : " << arg1 << endl; }
	template <class Arg1, class... Args>
	void __f(const char* names, Arg1&& arg1, Args&&... args) {
		const char* sep = strchr(names + 1, ',');
		cerr.write(names, sep - names) << " : " << arg1 << "  ";
		__f(sep + 1, args...);
	}
#else
#define trace(...) 0
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("popcnt")
#pragma GCC target("avx2,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define _CRT_SECURE_NO_WARNINGS
#endif
 
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<int,pii> piii;
typedef pair<char,int> pci;
typedef pair<ll,ll> pll;
typedef pair<ll,pll> plll;
 


#define pb push_back
 
// order_of_key (k), find_by_order(k)
#define fi first
#define se second
#define input_arr(a,n) for(__typeof (n) i=0; i<n; ++i) {cin>>a[i];}
#define debug_arr(a,n) {{for(__typeof (n) i=0; i<n; ++i) {cout<<a[i]<<" ";}cout<<"\n";}}
#define maxheap priority_queue<ll>
#define minheap priority_queue<ll,vector<ll> ,greater<ll>>
#define initialise(a, x) memset(a, x, sizeof(a))
#define endl '\n'
#define ordered_set tree<pll, null_type,less<pll>, rb_tree_tag,tree_order_statistics_node_update>
#define MAX 1000020
#define maxn 200050
#define eps 0.0000001

const ll mod=1e9+7;
const ll inf=1e18;


int par[maxn];
int size1[maxn];


int find(int x)
{
	if(par[x]==x) return par[x];
	return par[x]=find(par[x]);
}
void merge(int x,int y)
{
	int parx=find(x);
	int pary=find(y);

	if(pary==parx) return;

	if(size1[parx]>=size1[pary])
	{
		size1[parx]+=size1[pary];
		par[pary]=parx;
		return;
	}
	size1[pary]+=size1[parx];
	par[parx]=pary;
}


bool vis[maxn];

signed main()
{

	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

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


	for(int i=0;i<maxn;i++) {par[i]=i;size1[i]=1;}

	int n,m;
	cin>>n>>m;

	for(int i=0;i<m;i++)
	{
		int l,r;
		cin>>l>>r;
		merge(l,r);
	}

	int ans=0;
	for(int i=1;i<=n;i++)
	{
		if(!vis[find(i)])
		{
			vis[find(i)]=1;
			ans=max(ans,size1[find(i)]);
		}
	}

	cout<<ans<<'\n';
	
	
	


	return 0;
}

Measured memory_bytes: 5344
#include <iostream>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <queue>
#include <stack>
#include <list>
#include <utility>
#include <vector>
#include <set>
#include <algorithm>
#include <cmath>
#include <climits>
#include <map>
#include <unordered_map>
#include <string.h>
#include<iomanip>
#include <iterator>
#include <locale>

#define all(a) a.begin(),a.end()
#define VV(T) vector<vector< T > >
#define rep(i,N) for(int i = 0; i <N; i++)
#define repsg(i,s,g) for(int i = s; i <g; i++)
#define name(x) #x
using namespace std;

const int INF = INT_MAX;
const long long INFL =LONG_LONG_MAX;
const double PI = atan(1)*4;
const int MOD = pow(10,9)+7;
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

typedef long long ll,LL;
typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;
typedef pair<int,int> pii;
typedef pair<LL, LL> pLL;


// vector入力
template<typename T>
istream& operator >> (istream& is, vector<T>& vec){
    for(T& x: vec) is >> x;
    return is;
}
// vector出力
template<typename T>
ostream& operator << (ostream& os, vector<T>& vec){
    for(int i=0; i<vec.size(); i++){
        os << vec[i] << ( i+1 == vec.size() ? "" : " " );
    }
    return os;
}

template< typename T >
struct edge{
    int src, to;T cost;
    edge(int to,T cost) :src(-1),to(to),cost(cost){}
    edge(int src, int to, T cost) :src(src),to(to),cost(cost){}edge
    &operator=(const int &x){
        to =x;
        return *this;
    }
    operator int() const{ return to;}
};


int main() {
    int n;cin>>n;
    vector<int> a(n);cin>>a;
    auto p = max_element(all(a));
    auto m = min_element(all(a));
    
    auto Ppos = p-a.begin();
    auto Mpos = m-a.begin();
    
    vector<pii> ans;
    if(*m+*p>=0){
        rep(i,n){
            if(a[i]<0) ans.push_back({Ppos,i});
        }
        for(auto i = 1; i<n;i++){
            ans.push_back({i-1,i});
        }
        
        cout<<ans.size()<<endl;
        for(auto it:ans){
            cout<<1+it.first << " " <<1+ it.second<<endl;
        }
    }else{
        
        rep(i,n){
            if(a[i]>0) ans.push_back({Mpos,i});
        }
        for(auto i = n-1; i>=1;i--){
            ans.push_back({i,i-1});
        }
        
        cout<<ans.size()<<endl;
        for(auto it:ans){
            cout<<1+it.first << " " <<1+ it.second<<endl;
        }
        
    }
    return 0;
}










Measured memory_bytes: 256