akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
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; }

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    int ans = 0;
    map<int, int> cnt;
    rep(i,n){
        int a;
        cin >> a;
        cnt[a]++;
    }
    for(auto p : cnt){
        if(p.second < p.first) ans += p.second;
        else ans += p.second - p.first;
    }
    cout << ans << endl;
    return 0;
}

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

using namespace std;
#define rep(i, n) for(int i=0;i<n;i++)
#define REP(i, n) for(int i=1;i<=n;i++)
typedef long long ll;

int main() {
	string a, b;
	cin >> a >> b;
	int la = a.size();
	int lb = b.size();
	if (la > lb) {
		cout << "GREATER" << endl;
	} else if (la < lb) {
		cout << "LESS" << endl;
	} else {
		if (a < b) {
			cout << "LESS" << endl;
		} else if (a > b) {
			cout << "GREATER" << endl;
		} else {
			cout << "EQUAL" << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, ans=0;
  char S;
  cin >> N;
  for(int i=1;i<=N;i++){
    cin >> S;
    if(S=='Y'){
      ans=1;
      break;
    }
  }
  cout << (ans==0?"Three":"Four") << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
 
using namespace std;
 
 
int main(){
	int n;
	scanf("%d",&n);
	int i,h[100002],dp[100002];
	for(i=1;i<=n;i++)
		scanf("%d",&h[i]);

	dp[1]=0;
	dp[2]=abs(h[2]-h[1]);
	for(i=3;i<=n;i++){
		dp[i]=min(dp[i-1]+abs(h[i]-h[i-1]),dp[i-2]+abs(h[i]-h[i-2]));
	}

	printf("%d\n",dp[n] );
	return 0;
}


Measured memory_bytes: 1024
import java.util.Scanner;

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

		int s = scan.nextInt();
		int w = scan.nextInt();

		if(s <= w) {
			System.out.println("unsafe");
		}else {
			System.out.println("safe");
		}
	}
}


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

int main(){
  int c;
  c = 0;
  std::string S, T;
  std::cin >> S >> T;
  for (int i = 0; i < S.size(); i++) {
    if (S[i] != T[i]) {
      c++;
    }
  }
  std::cout << c << std::endl;
}

Measured memory_bytes: 3916
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <string>
#include <map>

#define ll long long
#define REP(i,n) for(int i = 0; i < n; i++)
#define PI 3.141592653589

using namespace std;

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

void solve_A(){
    int n;
    cin >> n;
    if(n%2 == 0) cout << n/2;
    else cout << n/2 + 1;
}

void solve_B(){
    int a[3][3];
    int n;
    REP(i,3){
        REP(j,3){
            cin >> a[i][j];
        }
    }
    cin >> n;
    int b[n];
    REP(i,n){
        cin >> b[i];
        REP(k,3){
            REP(l,3){
                if(b[i] == a[k][l]) a[k][l] = -1;
            }
        }
    }

    bool ok = false;

    REP(i,3){
        if(a[i][0] == -1 && a[i][1] == -1 && a[i][2] == -1) ok = true;
    }

    REP(i,3){
        if(a[0][i] == -1 && a[1][i] == -1 && a[2][i] == -1) ok = true;
    }

    if(a[0][0] == -1 && a[1][1] == -1 && a[2][2] == -1) ok = true;
    if(a[0][2] == -1 && a[1][1] == -1 && a[2][0] == -1) ok = true;

    if(ok) cout << "Yes";
    else cout << "No";

}

int main(void){
    solve_B();
    
    return 0;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define sz(x) (int)(x).size()
#define uni(x) x.erase(unique(rng(x)),x.end())
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define dup(x,y) (((x)+(y)-1)/(y))
#define v(T) vector<T>
#define vv(T) v(v(T))
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<pii> vp;
inline int getInt() { int x; scanf("%d",&x); return x;}
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int MX = 200005;
#define M 1000000007
//---------------------------------------------------------------
#define fastio cin.tie(nullptr); std::ios::sync_with_stdio(false);
#define myio ifstream iofi; if(argc>1){iofi.open(argv[1]); std::cin.rdbuf(iofi.rdbuf());}
//--------------------------------------------------------------

void Main(){
  string s;
  cin>>s;
  int bk = 0;
  int wt = 0;
  ll ans=0;
  rep(i,s.length()){
    if(s[i]=='W'){
      wt++;
      ans+= bk;
    } else {
      bk++;
    }
  }
  cout<<ans<<endl;
} int main(int argc,char** argv)
{fastio; myio; Main();}


Measured memory_bytes: 720
#include "bits/stdc++.h"

using namespace std;
#ifdef _DEBUG
#define _GLIBCXX_DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

#define int long long
#define ll long long
#define DBG 1
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define loop(n) rep(loop, (0), (n))
#define all(c) begin(c), end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
using pii = pair<int, int>;
// template<class T> ostream &operator<<(ostream &os,T &t){dump(t);return os;}
template <typename T, typename S>istream &operator>>(istream &is, pair<T, S> &p) { is >> p.first >> p.second; return is; }
//template <typename T, typename S>ostream &operator<<(ostream &os, pair<T, S> &p) {os << p.first << " " << p.second;return os;}

template <typename T> void printvv(const vector<vector<T>> &v) {
	cerr << endl;
	rep(i, 0, v.size()) rep(j, 0, v[i].size()) {
		if (typeid(v[i][j]).name() == typeid(INF).name() and v[i][j] == INF) {
			cerr << "INF";
		}
		else
			cerr << v[i][j];
		cerr << (j == v[i].size() - 1 ? '\n' : ' ');
	}
	cerr << endl;
}

#ifndef _DEBUG
#define printvv(...)
#endif
void YES(bool f) { cout << (f ? "YES" : "NO") << endl; }
void Yes(bool f) { cout << (f ? "Yes" : "No") << endl; }
template <class T, class U>bool chmin(T& a, U b) { if (a > b) { a = b; return true; }return false; }
template <class T, class U>bool chmax(T& a, U b) { if (a < b) { a = b; return true; }return false; }

signed main(signed argc, char *argv[]) {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(12);

	int A, P; cin >> A >> P;
	cout << (A * 3 + P) / 2 << endl;

	return 0;
}


Measured memory_bytes: 256
import java.io.*;
import java.util.*;

public class Main{
    public static void main(String[] args)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str;
                    
        while((str = br.readLine()) != null){
            StringBuilder abcde =new StringBuilder(str);
            str = br.readLine();
            int num = Integer.parseInt(str);
            for(int i =0;i < num;i++){
                str = br.readLine();
                String[] temp = str.split("\\s");
                if(temp[0].equals("replace")){
                    //replace
                    int a = Integer.parseInt(temp[1]);
                    int b = Integer.parseInt(temp[2]) + 1;
                    abcde.replace(a,b,temp[3]);

                }else if(temp[0].equals("reverse")){
                    //reverse
                    int a = Integer.parseInt(temp[1]);
                    int b = Integer.parseInt(temp[2]) + 1;
                    StringBuilder rev = new StringBuilder(abcde.substring(a,b)).reverse();
                    abcde.replace(a,b,rev.toString());
                }else{
                    //print
                    int a = Integer.parseInt(temp[1]);
                    int b = Integer.parseInt(temp[2]) + 1;                             
                    System.out.println(abcde.substring(a,b));
                }
            }
        }
        br.close();
                  
    }

}


Measured memory_bytes: 25424
#include <stdio.h>

int main()
{
    int n, t, ci, ti;
    int menori = 10000;
    scanf("%d %d", &n, &t);
    while (n--)
    {
        scanf("%d %d", &ci, &ti);
        if (ti <= t)
        {
            if (ci <= menori)
            {
                menori = ci;
            }
        }
    }
    if(menori==10000){
        printf("TLE\n");
    }else{
        printf("%d\n",menori);
    }
}

Measured memory_bytes: 128
// 有點不耐煩會破壞偉大的計劃

#include <bits/stdc++.h>

#define append push_back

using namespace std;
using ll = long long;

const int N = 1e5 + 3;
const int M = 1e6 + 7;
const long long MOD = 1e9 + 7;
const long long INF = 1e18 + 9;
const int SM = 1e3 + 5;
const int logN = 22, BL = 400;
const double EPS = 1e-9, PI = acos(-1);
const int dx[] = {1, 0, 0, -1, -1, 1, -1, 1};
const int dy[] = {0, 1, -1, 0, -1, 1, 1, -1};

void debug(){
	cerr << "\n";
}
template<typename Type1, typename... Type2>
void debug(Type1 a, Type2... b) {
    cerr << a << " ";
    debug(b...);
}

int main(){
//    freopen(".in", "r", stdin);
//    freopen(".out", "w", stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);

    string s, t; cin >> s >> t;

    long long n = s.size(), m = t.size(), ans = INF;

    for(long long i = 0; i + m - 1 < n; i++){
        long long cnt = 0;
        for(long long j = i; j < i + m; j++){
            cnt += s[j] != t[j - i];
        }
        ans = min(ans, cnt);
    }

    cout << ans;
    return 0;
}


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

// 総数を1000000007（素数）で割った余り
const long long mod = 1e9 + 7;

using ll = long long;
using pii  = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pii>
#define vpll vector<pll>

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; i++)
#define rep1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; i++)
#define repr(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rep1r(i, n) for (int i = ((int)(n)); i >= 1; i--)

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RSORT(x) sort(rall(x));
#define pb push_back
#define mp make_pair

#define INF (1e9)
#define PI (acos(-1))
#define EPS (1e-7)

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

int main(){
    ll a, b;
    cin >> a >> b;
    rep1(i, b) {
        if (a*i%b==0) {
            cout << a*i << endl;
            break;
        }
    }
    return 0;
}


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

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let a: usize;
    let b: usize;
    a = read();
    b = read();
    if (a * b) % 2 == 1 {
        println!("Odd");
    } else {
        println!("Even");
    }
}


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

ans=1
for i in range(N):
    ans *= A[i]
    if ans > int(1e18):
        break
if 0 in A:
    print(0)
elif ans>int(1e18):
    print(-1)
else:
    print(ans)

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

#define ll long long
#define db double
#define el "\n"
#define ld long double
#define rep(i,n) for(int i=0;i<n;i++)
#define rev(i,n) for(int i=n;i>=0;i--)
#define rep_a(i,a,n) for(int i=a;i<n;i++)
#define tr(ds, it) for(auto it=ds.begin(); it!=ds.end(); it++)
#define rtr(ds, it) for(auto it=ds.rbegin(); it!=ds.rend(); it--)
#define all(ds) ds.begin(), ds.end()
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
typedef priority_queue <int> pq;
typedef vector< long long > vi;
typedef pair<long long, long long> ii;
#define o_set tree<ii, null_type,less<ii>, rb_tree_tag,tree_order_statistics_node_update>
#define graph vector<vi>
#define Mod 1000000007
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define T int t;cin>>t;rep(i,t)

void solve() {

    string s, t;
    cin >> s >> t;

    int count = 0;

    rep(i, s.size()) {
        if (s[i] != t[i])
            count++;
    }

    cout << count << "\n";

}

int main()
{
    fastio;
    // T
    solve();
    //code
    return 0;
}


Measured memory_bytes: 3792
import java.util.*;

public class Main {
	static int P = 1000000007;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int k = sc.nextInt();
		int a[] = new int[n];
		for(int i=0;i<n;i++) {
			a[i] = sc.nextInt();
		}
		
		Arrays.sort(a);
		
		long[] mm = new long[100005];
		mm[0] = 1;
		long[] nn = new long[100005];
		nn[0] = 1;
		for(int i=1;i<mm.length;i++) {
			mm[i] = mm[i-1] * i % P;
			nn[i] = nn[i-1] * fp(i, P-2) % P;
		}
		
		long sum = 0;
		for(int i=n-1;i>=k-1;i--) {

			long d = (a[i]-a[n-1-i]) % P;
			if(d < 0)
				d += P;

			long num = d * mm[i] % P * nn[i-k+1] % P * nn[k-1] % P;
			sum = (sum + num) % P;
		}
		
		System.out.println(sum);
		
	}
	static long fp(int a, int p) {
		
		if(p == 0)
			return 1;
		
		long num = fp(a, p/2);
		if(p % 2 == 0)
			return num * num % P;
		else
			return num * num % P * a % P;
	}
}

Measured memory_bytes: 51980
#include<bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define debug(v) cout<<#v<<":";for(auto x:v){cout<<x<<' ';}cout<<endl; 
#define INF 1000000000
#define mod 1000000007
typedef long long ll;
const ll LINF = 1001002003004005006ll;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

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

    int a,b;cin>>a>>b;
    cout<<(max(0,a-2*b))<<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++)
using ll = long long;

int main() {
  int n,k;
  cin >> n >> k;
  priority_queue<int> q;
  vector<vector<int>> v(k);
  rep(i,n){
    int x,y;
    cin >> x >> y;
    int z=k-x;
    if(z>=0) v[z].push_back(y);
  }
  ll ans=0;
  for(int i=k-1;i>=0;i--){
    for(int x:v[i]){
      q.push(x);
    }
    if(!q.empty()){
     int y=q.top();q.pop();
     ans+=y;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 8388
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
typedef long double lb;
const ll MOD=1e9+7;
#define REP(i,n) for(ll i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define pb push_back
void IOS(){	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);return ;}
ll h,w,dp[1005][1005];
char c[1005][1005];
ll f(int y,int x){
	if(y==h-1&&x==w-1)return 1;
	if(y>=h||x>=w)return 0;
	if(dp[y][x]!=-1)return dp[y][x];
	ll tmp=0;
	if(c[y][x+1]=='.')tmp+=f(y,x+1)%MOD;
	if(c[y+1][x]=='.')tmp+=f(y+1,x)%MOD;
	return dp[y][x]=tmp%MOD;
}

int main(){
	IOS();
	memset(dp,-1,sizeof(dp));
	cin>>h>>w;
	REP(i,h)REP(j,w){
		cin>>c[i][j];
	}
	cout<<f(0,0)%MOD;
	return 0;
}

Measured memory_bytes: 9216
#include <bits/stdc++.h>
#define rep(i,a,b) for(ll i=ll(a);i<ll(b);i++)
#define irep(i,a,b) for(ll i=ll(a);i>=ll(b);i--)
#define pb push_back
#define mp make_pair
#define F .first
#define S .second 
using ll=long long;
using ld=long double;
using namespace std;
const ll mod=1e9+7;
ll a[110000];
int main(){
  ll n,x,ans=0;
  cin>>n>>x;
  rep(i,0,n)cin>>a[i];
  rep(i,0,n-1){
    ll w=a[i]+a[i+1];
    if(w>x){
      if(a[i+1]>=w-x)a[i+1]-=w-x;
      else {a[i]+=x-w-a[i+1];a[i+1]=0;}
      ans+=w-x;
    }
  }
  cout<<ans;
}




Measured memory_bytes: 1024
#!/usr/bin/env python3
def main():
    import sys
    from collections import deque

    input = sys.stdin.readline

    S = input().rstrip()
    Q = int(input())

    S = deque(S)
    rev = 0
    for _ in [0] * Q:
        q = input().split()
        if q[0] == '1':
            rev += 1
        else:
            if q[1] == '1':
                S.append(q[2]) if rev % 2 else S.appendleft(q[2])
            else:
                S.appendleft(q[2]) if rev % 2 else S.append(q[2])
    ans = ''.join(S)
    print(ans[::-1] if rev % 2 else ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 14308
#define _USE_MATH_DEFINES
#include <sstream> //string stream its useful!
#include<string>
#include<iostream>
#include<utility> //pair
#include <vector> // vector
#include <algorithm>    // swap,sort,binary_search
#include <functional>   // std::greater
#include <map> //map
#include<set> //set
#include<queue> //queue
#include<list> //list
#include<cmath>
#include<numeric>
#include<cassert>
#include <iomanip> //cout<<setprecision

typedef long long ll;
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))

using namespace std;
void omajinai() {
    
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<setprecision(15);
    //freopen("txt.csv","r",stdin);
}


int main(){
    omajinai();
    int H,W; cin>>H>>W;
    vector<vector<char > > A(H,vector<char>(W,' '));
    for(int i = 0 ; i<H;i++) for(int j = 0; j<W;j++) cin>>A[i][j];
    int nowi = 0, nowj = 0;
    while(true){
        bool upleftcondition = (nowi-1>0 && A[nowi-1][nowj] == '#')&&(nowj-1>0 && A[nowi][nowj-1] == '#');
        if (upleftcondition){
            cout<<"Impossible"<<endl;
            exit(0);
        }
        if(nowi==H-1 && nowj == W-1) break;
        bool tate = nowi+1<H&&A[nowi+1][nowj] == '#';
        bool yoko = nowj+1<W&&A[nowi][nowj+1] == '#';
        if (!(tate^yoko)){
            cout<<"Impossible"<<endl;
            exit(0);
        }
        if(tate) nowi++;
        if(yoko) nowj++;
    }
    cout<<"Possible"<<endl;
    
}

Measured memory_bytes: 256
Imports System.Collections.Generic
Imports System.Console
Imports System.Math  
Module Program
 	Sub Main()
        Dim input() As String = Console.ReadLine().Split(" ")
        Dim N As Integer = input(0)
        Dim K As Integer  = input(1)
        Console.WriteLine(IIF((N-1)/2>=K-1, "YES", "NO"))
    End Sub
End Module


Measured memory_bytes: 11220
n = int(input())
ti=0
xi=0
yi=0
for i in range(n):
    t, x, y = map(int, input().split())
    if abs(x-xi) + abs(y-yi) > abs(t-ti) or (abs(x-xi) + abs(y-yi) + abs(t-ti)) % 2 != 0:
        print("No")
        exit()
    ti=t
    xi=x
    yi=y
print("Yes")

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

int main(){
    int n;
    cin >> n;
    for(int i = 0; i < n; i++){
        int a;
        cin >> a;
        if(a%2 == 0){
            if(a%3 != 0 && a%5 != 0){
                cout << "DENIED" << endl;
                return 0;
            }
        }
    }    
    cout << "APPROVED" << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include <bits/stdc++.h>
#include<stdio.h>
#include <stdlib.h>
#include<string>
#include<queue>
using namespace std;

int main(){
	int a,b;
	cin>>a;
	b=a%10;
	a=a-b;
	a/=10;
	a=(a-a%10)/10;
	if(a==b){
		cout<<"Yes"<<endl;
	}else{
	cout<<"No"<<endl;
	}
}

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
const int INF = (int)1e9 + 7;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

template <class T>
vector<T> make_v(size_t size, const T &init) {
    return vector<T>(size, init);
}
template <class... Ts>
auto make_v(size_t size, Ts... rest) {
    return vector<decltype(make_v(rest...))>(size, make_v(rest...));
}

int main() {
    const int MAXW = 1e3;
    int n, m;
    while (cin >> n >> m, n) {
        vector<vector<pair<int, int>>> stone(n);
        for (int i = 0; i < n; i++) {
            int k; cin >> k;
            while (k--) {
                int x, d; cin >> x >> d; x--;
                stone[i].emplace_back(x, d);
            }
        }
        auto dp = make_v(n, MAXW, m + 1, INF);
        for (int j = 0; j < MAXW; j++) {
            for (auto &p: stone[0]) dp[0][p.first][m] = 0;
            if (m) for (auto &p: stone[1]) dp[1][p.first][m - 1] = 0;
        }
        for (int i = 0; i < n - 1; i++) for (int k = 0; k <= m; k++) {
            for (auto &s: stone[i]) for (auto &t: stone[i + 1]) {
                int cost = abs(s.first - t.first) * (s.second + t.second);
                chmin(dp[i + 1][t.first][k], dp[i][s.first][k] + cost);
            }
            if (i == n - 2 || k == 0) continue;
            for (auto &s: stone[i]) for (auto &t: stone[i + 2]) {
                int cost = abs(s.first - t.first) * (s.second + t.second);
                chmin(dp[i + 2][t.first][k - 1], dp[i][s.first][k] + cost);
            }
        }
        int ans = INF;
        for (int j = 0; j < MAXW; j++) for (int k = 0; k <= m; k++) {
            if (k) chmin(ans, dp[n - 2][j][k]);
            chmin(ans, dp[n - 1][j][k]);
        }
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 53472
A = list(list(map(int, input().split())) for _ in range(3))
n = int(input())
B = set(int(input()) for _ in range(n))

ans = 'No'

if len(set(A[0])&B)==3:
  ans = 'Yes'
elif len(set(A[1])&B)==3:
  ans = 'Yes'
elif len(set(A[2])&B)==3:
  ans = 'Yes'
elif len(set([A[0][0], A[1][0], A[2][0]])&B)==3:
  ans = 'Yes'
elif len(set([A[0][1], A[1][1], A[2][1]])&B)==3:
  ans = 'Yes'
elif len(set([A[0][2], A[1][2], A[2][2]])&B)==3:
  ans = 'Yes'
elif len(set([A[0][0], A[1][1], A[2][2]])&B)==3:
  ans = 'Yes'
elif len(set([A[0][2], A[1][1], A[2][0]])&B)==3:
  ans = 'Yes'
  
print(ans)

Measured memory_bytes: 3064
import numpy as np
h,w = map(int,input().split())
graph = [['.' for j in range(w)]for i in range(h)]


for i in range(h):
    tmp = input()
    for j in range(len(tmp)):
        graph[i][j] = tmp[j]
graph = np.array(graph)

flag = True
while flag:
    flag = False
    for i in range(graph.shape[1]):
        if( graph[:,i] == ['.']*graph.shape[0]).all():
            flag = True
            if i == 0:
                graph = graph[: , 1:]
                break
                
            if i == graph.shape[1] -1:
                graph = graph[:,:i]
                break
                
            else:
                graph = np.concatenate([graph[:,:i],graph[:,i+1:] ], 1)
                break
                
    for i in range(graph.shape[0]):
        if (graph[i,:] == ['.']*graph.shape[1]).all():
            flag = True
            if i == 0:
                graph = graph[1: , :]
                break
                
            if i == graph.shape[0] -1:
                graph = graph[:i,:]
                break
                
            else:
                graph = np.concatenate([graph[:i , :],graph[i+1: , :] ], 0)
                break
                
for i in graph:
    print(*i, sep="")

Measured memory_bytes: 13928
#ifndef LOCAL
#pragma GCC optimize("O3")
#endif
#include "bits/stdc++.h"
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);
typedef long long ll;
const ll MOD = 1e9 + 7 ; 
long long n;
vector<long long>h;
long long INF=1e9+10;
long long dx[100010];
long long dp(long long x){
	debug() << imie(x);
	if(x>=n)return INF;
	if(x==n-1)return 0;
	if(dx[x]!=-1)return dx[x];
	long long choice1=abs(h[x]-h[x+1])+dp(x+1);
	long long choice2=INF;
	if(x+2<n)
	choice2=abs(h[x]-h[x+2])+dp(x+2);
	long long ans=min(choice2,choice1);
	return dx[x]=ans;
}
int main(){
	fastio;
	cin>>n;
	memset(dx,-1,sizeof dx);
	h.resize(n);
	for(int i=0;i<n;i++){
		cin>>h[i];
	}
	debug() << imie(h);
	cout<<dp(0)<<endl;
}	

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

int main()
{
    ll X;
    ll Y;
    cin >> X >> Y;
    cout << ((X % Y == 0) ? -1 : X) << endl;
}


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

int main(){
    int n;
    cin >> n;
    vector<pair<int, int> > shougen[n];
    for(int i = 0; i < n; i++){
        int a;
        cin >> a;
        for(int j = 0; j < a; j++){
            int x, y;
            cin >> x >> y;
            pair<int,int> p = make_pair(x-1, y);
            shougen[i].push_back(p);
        }
    }

    int ans = 0;
    for (int bit = 0; bit < (1<<n); ++bit) {
        bool expect[n];
        int count = 0;
        for (int i = 0; i < n; ++i) {
            if (bit & (1<<i)) {
                expect[i] = true;
                count++;
            } else {
                expect[i] = false;
            }
        }
        bool result = true;
        for(int i = 0; i < n; i++){
            if(expect[i]){
                for(int j = 0; j < shougen[i].size(); j++){
                    int x = shougen[i][j].first;
                    int y = shougen[i][j].second;
                    if(y == 1){
                        result &= (expect[x] == true);
                    } else {
                        result &= (expect[x] == false);
                    }
                }
            }
            if(!result){
                break;
            }
        }
        if(result){
            ans = max(count, ans);
        }
    }  
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define next Next
#define gc getchar
#define int long long
const int N=1e6+5;
int n,m,ans,sum,a[N],b[N];
char s[N];
//char buf[1<<21],*p1=buf,*p2=buf;
//inline int gc(){return p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++;}
inline int read()
{
    int ret=0,f=0;char c=gc();
    while(!isdigit(c)){if(c=='-')f=1;c=gc();}
    while(isdigit(c)){ret=ret*10+c-48;c=gc();}
    if(f)return -ret;return ret;
}
signed main()
{
	n=read();m=read();
	if((n%m)==0){cout<<0;return 0;}
	cout<<min(n%m,abs(n%m-m));
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#include <boost/integer/common_factor.hpp>
#include <boost/integer/common_factor_rt.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>

using std::string;
using std::vector;
using std::set;
using std::multiset;
using std::unordered_set;
using std::map;
using std::multimap;
using std::unordered_map;
using std::pair;
using std::cin;
using std::cout;

using boost::multiprecision::cpp_int;
using cpp_dec_float_1000 = boost::multiprecision::number<boost::multiprecision::cpp_dec_float<1000>>;

typedef uintmax_t    ull;
typedef intmax_t     ll;
typedef uint64_t     ul;
typedef uint32_t     ui;
typedef uint8_t      uc;

constexpr char CRLF  = '\n';
constexpr char SPACE = ' ';
constexpr char VECTOR_COUT_SEPARATOR = SPACE;
constexpr ll INF = 1000'000'007;
constexpr int MOD = 1000'000'007;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> std::ostream& operator<< (std::ostream& os, const std::vector<T>& vc) { for(auto it = vc.begin(); it != vc.end(); ++it) { if (std::next(it) == vc.end()) os << *it; else os << *it << VECTOR_COUT_SEPARATOR; } return os; }
template<class T1, class T2> inline std::ostream & operator<< (std::ostream & os, const std::pair<T1, T2> & p) { return os << p.first << ' ' << p.second; }
template<class T> T modinv(T a, T m) { T b = m, u = 1, v = 0; while (b) { T t = a / b; a -= t * b; boost::swap(a, b); u -= t * v; boost::swap(u, v); } u %= m; if (u < 0) u += m; return u; }

struct Tmp
{
public:
  Tmp(int N);
};

Tmp::Tmp(int N){}

void solve(void)
{
  int N, K; cin >> N >> K;
  int count{};
  while (N >= K) {
    N /= K;
    count++;
  }
  auto ans = count+1;
  cout << ans << CRLF;
  return;
}

int main(void)
{
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(0);

  solve();

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    char a[20],b[20],c[20];
    scanf("%s %s",&a,&b);
    int sum1,sum2;
    scanf("%d %d%*c",&sum1,&sum2);
    scanf("%s",&c);
    if(strcmp(a,c)==0){
        sum1--;
    }
    if(strcmp(b,c)==0){
        sum2--;
    }
    printf("%d %d\n",sum1,sum2);

}


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

#define rep(i,n) for(int i=0; i<(n); i++)
#define reps(i,x,n) for(int i=x; i<(n); i++)
#define rrep(i,n) for(int i=(n)-1; i>=0; i--)
#define all(X) (X).begin(),(X).end()
#define X first
#define Y second
#define pb push_back
#define eb emplace_back

using namespace std;
typedef long long int ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

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

template<class A, size_t N, class T> void Fill(A (&a)[N], const T &v){ fill( (T*)a, (T*)(a+N), v ); }

template<class T> ostream& operator<<(ostream &os, const vector<T> &t) {os<<"{"; rep(i,t.size()) {os<<t[i]<<",";} os<<"}"; return os;}
template<class T,size_t n> ostream& operator<<(ostream &os, const array<T,n> &t) {os<<"{"; rep(i,n) {os<<t[i]<<",";} os<<"}"; return os;}
template<class S, class T> ostream& operator<<(ostream &os, const pair<S,T> &t) { return os<<"("<<t.first<<","<<t.second<<")";}

const ll INF = 1e9+7;


int main(){
	ios_base::sync_with_stdio(false);
	int N, ans=0;

	cin >> N;
	if( N == 3 ){
		cout << "2 5 63" << endl;
	}else{
		int cnt = N, sum = 0;
		reps(i,2,30001) if( i%2 == 0 || i%3 == 0 ){
			if( cnt > 2 ){
				cout << i << " ";
				sum += i;
				cnt--;
			}else if( cnt == 2 ){
				if( (sum % 6 == 0 && i % 6 >= 0) ||
					(sum % 6 == 1 && i % 6 == 2) ||
					(sum % 6 == 1 && i % 6 == 3) ||
					(sum % 6 == 2 && i % 6 == 0) ||
					(sum % 6 == 2 && i % 6 == 2) ||
					(sum % 6 == 2 && i % 6 == 4) ||
					(sum % 6 == 3 && i % 6 == 0) ||
					(sum % 6 == 3 && i % 6 == 3) ||
					(sum % 6 == 4 && i % 6 == 0) ||
					(sum % 6 == 4 && i % 6 == 2) ||
					(sum % 6 == 4 && i % 6 == 4) ||
					(sum % 6 == 5 && i % 6 == 3) ||
					(sum % 6 == 5 && i % 6 == 4) ){
					cout << i << " ";
					sum += i;
					cnt--;
				}
			}else if( cnt == 1 ){
				if( (sum % 6 == 0 && i % 6 == 0) ||
					(sum % 6 == 2 && i % 6 == 4) ||
					(sum % 6 == 3 && i % 6 == 3) ||
					(sum % 6 == 4 && i % 6 == 2) ){
					cout << i << " ";
					sum += i;
					cnt--;
					break;
				}
			}
		}
		cout << endl;
	}

	return 0;
}

Measured memory_bytes: 384
#include<iostream>
using namespace std;

void insertionSort(int A[],int N)
{
	for(int i=0;i<N;i++)
	{
		int v = A[i];
		int j = i-1;
		while (j>= 0 && A[j] >v)
		{
			A[j+1]=A[j];
			j--;
		}
		A[j+1]=v;
		for(int i =0;i<N-1;i++)cout<<A[i]<<" ";
		cout<<A[N-1]<<endl;
	}
}

int main()
{
	int N;cin>>N;
	int A[100];for(int i=0;i<N;i++)cin>>A[i];
	insertionSort(A,N);
	return 0;
}


Measured memory_bytes: 3080
#include <bits/stdc++.h>
            #include<iostream>
            #include<cstdio>
            #include<vector>
            #include<queue>
            #include<map>
            #include<cstring>
            #include<string>
            #include <math.h>
            #include<algorithm>
        //    #include <boost/multiprecision/cpp_int.hpp>
            #include<functional>
          #define int long long
            #define inf  1000000007
            #define pa pair<int,int>
    #define ll long long
            #define pal pair<ll,ll>
            #define ppa pair<int,pa>
            #define  mp make_pair
            #define  pb push_back
            #define EPS (1e-10)
            #define equals(a,b) (fabs((a)-(b))<EPS)
     
            using namespace std;
     
            class Point{
            	public:
            	double x,y;
            	Point(double x=0,double y=0):x(x),y(y) {}
            	Point operator + (Point p) {return Point(x+p.x,y+p.y);}
            	Point operator - (Point p) {return Point(x-p.x,y-p.y);}
            	Point operator * (double a) {return Point(x*a,y*a);}
            	Point operator / (double a) {return Point(x/a,y/a);}
            	double absv() {return sqrt(norm());}
            	double norm() {return x*x+y*y;}
            	bool operator < (const Point &p) const{
            		return x != p.x ? x<p.x: y<p.y;
            	}
            	bool operator == (const Point &p) const{
            		return fabs(x-p.x)<EPS && fabs(y-p.y)<EPS;
            	}
            };
            typedef Point Vector;
     
            struct Segment{
            Point p1,p2;
            };
     
        double hen(Vector a){
        if(fabs(a.x)<EPS && a.y>0) return acos(0);
        else if(fabs(a.x)<EPS && a.y<0) return 3*acos(0);
        else if(fabs(a.y)<EPS && a.x<0) return 2*acos(0);
        else if(fabs(a.y)<EPS && a.x>0) return 0.0;
        else if(a.y>0) return acos(a.x/a.absv());
        else return 2*acos(0)+acos(-a.x/a.absv());
     
        }
     
int gcd(int v,int b){
	if(v>b) return gcd(b,v);
	if(v==b) return b;
	if(b%v==0) return v;
	return gcd(v,b%v);
}
            double dot(Vector a,Vector b){
            	return a.x*b.x+a.y*b.y;
            }
            double cross(Vector a,Vector b){
            	return a.x*b.y-a.y*b.x;
            }
        
            //----------------kokomade tenpure------------
string s,t;
int n,k;
    signed main(){
    	
    	int h,w;
    	cin>>h>>w;
    	
    	for(int i=0;i<h;i++){
    		for(int j=0;j<w;j++){
    			cin>>s;
    			
    			if(s=="snuke"){
    				char z='A';
    				z += j;
    				cout<<z<<i+1<<endl;
    				
    			}
    		}
    	}

    //	printf("%.10f\n",ans);
    	return 0;
    }

Measured memory_bytes: 256
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60


def isqrt(n):
    if n > 0:
        x = 1 << (n.bit_length() + 1) // 2
        y = (x + n // x) // 2
        while y < x:
            x = y
            y = (x + n // x) // 2
        return x
    elif n == 0:
        return 0
    else:
        raise ValueError("isqrt() argument must be nonnegative")


def main():
    N = int(readline())
    n = (isqrt(8 * N + 1) - 1) // 2
    if N != n * (n + 1) // 2:
        print('No')
        return

    it = iter(range(1, N + 1))
    G = [[0] * n for _ in range(n)]
    for i in range(n):
        for j in range(i + 1):
            G[i][j] = G[j][i] = next(it)

    print('Yes')
    print(n + 1)
    for row in G:
        print(n, end=' ')
        print(*row)
    print(n, end=' ')
    print(*(G[i][i] for i in range(n)))
    return


if __name__ == '__main__':
    main()


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

#define rep(i,x,y) for(int i=(x);i<(y);++i)
#define debug(x) #x << "=" << (x)

#ifdef DEBUG
#define _GLIBCXX_DEBUG
#define dump(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl
#else
#define dump(x)
#endif

typedef long long int ll;
typedef pair<int,int> pii;
//template<typename T> using vec=std::vector<T>;

const int inf=1<<30;
const long long int infll=1LL<<58;
const double eps=1e-9;
const int dx[]={1,0,-1,0},dy[]={0,1,0,-1};

template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec){
	os << "[";
	for (const auto &v : vec) {
		os << v << ",";
	}
	os << "]";
	return os;
}

struct edge{
    int to,cost,num;
    edge(int to,int cost,int num):to(to),cost(cost),num(num){}
};

struct state{
    int vertex,sum,money;
    state(int vertex,int sum,int money):vertex(vertex),sum(sum),money(money){}
    bool operator>(const state& other)const{
        return sum>other.sum;
    }
};

void solve(){
    while(true){
        int n,m,l;
        cin >> n >> m >> l;
        if(n==0 and m==0 and l==0) break;

        vector<vector<edge>> graph(n);
        rep(i,0,m){
            int a,b,d,e;
            cin >> a >> b >> d >> e;
            --a; --b;
            graph[a].emplace_back(edge(b,d,e));
            graph[b].emplace_back(edge(a,d,e));
        }

        vector<vector<int>> dist(n,vector<int>(l+1,inf));
        priority_queue<state,vector<state>,greater<state>> que;
        dist[0][l]=0;
        que.push(state(0,0,l));
        int ans=inf;
        while(!que.empty()){
            state st=que.top();
            que.pop();
            int v=st.vertex,s=st.sum,m=st.money;
            if(s>dist[v][m]) continue;
            if(v==n-1) ans=min(ans,s);
            for(const auto& e:graph[v]){
                if(s+e.num<dist[e.to][m]){
                    dist[e.to][m]=s+e.num;
                    que.push(state(e.to,dist[e.to][m],m));
                }
                if(m>=e.cost and s<dist[e.to][m-e.cost]){
                    dist[e.to][m-e.cost]=s;
                    que.push(state(e.to,dist[e.to][m-e.cost],m-e.cost));
                }
            }
        }
        cout << ans << endl;
    }
}

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

Measured memory_bytes: 3556
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.StringTokenizer;

public class Main {

	// Atcoder用のサンプルプログラム
	public static void main(String[] args) {
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			
			//line = br.readLine();
			
			int N = Integer.parseInt(br.readLine());
			int sum = 0;
			int max = 0;
			String[] n = br.readLine().split(" ");
			for (int i = 0;i < N;i++) {
				int m = Integer.parseInt(n[i]);
				if (max < m) {
					max=m;
				}
				sum = sum+m;
			}
			if (max < sum-max) {
				System.out.println("Yes");
			} else {
				System.out.println("No");
			}
			
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}


Measured memory_bytes: 22612
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
 
#include<stdio.h>
#include<math.h>
#include<string.h>
#include<stdlib.h>
#include<stdarg.h>
#include<malloc.h>
#include<limits.h>

int land();
void clear(int, int);

char map[12][16];

int main()
{
	int i;

	while(scanf("%s", map[0]) != EOF){
		for(i=1; i<12; i++)
			scanf("%s", map[i]);

		printf("%d\n", land());

	}

	return 0;
}

int land()
{
	int i, j, ans=0;
	for(i=0; i<12; i++){
		for(j=0; j<12; j++){
			if(map[i][j] == '1'){
				ans++;
				clear(i, j);
			}
		}
	}
	return ans;
}

void clear(int i, int j)
{
	map[i][j] = '0';
	if(i >= 1){
		if(map[i-1][j] == '1')
			clear(i-1, j);
	}
	if(j >= 1){
		if(map[i][j-1] == '1')
			clear(i, j-1);
	}
	if(i <= 10){
		if(map[i+1][j] == '1')
			clear(i+1, j);
	}
	if(j <= 10){
		if(map[i][j+1] == '1')
			clear(i, j+1);
	}
	return;
}

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

int main() {
  int N;
  cin >> N;

  string S;
  cin >> S;

  rep(i, S.size()){
    char a = S.at(i);
    int b = (int)a;
    b += N;
    while(b > 90){
      b -= 26;
    }
    char c = (char)b;
    S.at(i) = c;
  }

  cout << S << endl;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n)  for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
#define deb(x) cerr << #x <<": " << x << '\n';
#define ios ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
using namespace std;
typedef long double ld;
typedef long long ll;

int main(){
    ios;
    ll x; cin >> x;
    ll amount = 101;
   for(ll i = 1; i <= 3760; ++i){
        if(amount >= x) {cout << i; return 0;}
        amount = amount + (amount * 0.01);
       // deb(amount);
    }
    return 0;
}


Measured memory_bytes: 3636
#include <stdio.h>
int main(){

   int n, x, i ,j, k, s;
   
   scanf("%d %d", &n, &x);
   while (n != 0 || x != 0)
   {
   	s = 0;
   	for(i = 1; i <= n - 2; i++)
   	{
   		for(j = i + 1; j <= n - 1; j++)
   		{
   			for(k = j + 1; k <= n; k++)
   			{
   				if(i + j + k == x)
   				{
   					s++;
   				}
   			}
   		}
   	}
   	printf("%d\n", s);
   	scanf("%d %d", &n, &x);
   }
   return 0;
}

Measured memory_bytes: 600
#include<map>
#include<cmath>
#include<stack>
#include<queue>
#include<cstdio>
#include<vector>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
template<class Read>void in(Read &x){
    x=0;
    int f=0;
    char ch=getchar();
    while(ch<'0'||ch>'9'){
        f|=(ch=='-');
        ch=getchar();
    }
    while(ch>='0'&&ch<='9'){
        x=(x<<1)+(x<<3)+(ch^48);
        ch=getchar();
    }
    x=f?-x:x;
    return;
}
string s;
int main(){
	cin>>s;
	if(s=="SUN")puts("7");
	if(s=="MON")puts("6");
	if(s=="TUE")puts("5");
	if(s=="WED")puts("4");
	if(s=="THU")puts("3");
	if(s=="FRI")puts("2");
	if(s=="SAT")puts("1");
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <memory>
#include <complex>
#include <numeric>
#include <cstdio>
#include <iomanip>

#define REP(i,m,n) for(int i=int(m);i<int(n);i++)
#define EACH(i,c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())

#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR 
#endif
using namespace std;

using UI = unsigned int;
using UL = unsigned long;
using LL = long long int;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VS = vector<string>;
using PII = pair<int,int>;
using VP = vector<PII>;

//struct edge {int from, to, cost;};

constexpr double EPS = 1e-10;
constexpr double PI  = acos(-1.0);
//constexpr int INF = INT_MAX;

template<class T> inline T sqr(T x) {return x*x;}

int main() {
    string s;
    cin >> s;
    int pos = s.size() - 1;
    // dream dreamer erase eraser
    while (pos >= 0) {
        if (s.substr(pos-4,5)=="dream" || s.substr(pos-4,5)=="erase") pos -= 5;
        else if (s.substr(pos-5,6)=="eraser") pos -= 6;
        else if (s.substr(pos-6,7)=="dreamer") pos -= 7;
        else {
            cout << "NO" << endl;
            return 0;
        }
    }
    cout << "YES" << endl;
    
    return 0;
}

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

#define fi  first
#define se  second
#define mp  make_pair
#define pb  push_back
#define ll  long long
#define mod 1000000007
#define pii pair<int, int>
#define pie 2.0*acos(0.0)

int concat(int a, int b) {
    stack<int> sto;
    while (b != 0) {
        sto.push(b % 10);
        b /= 10;
    }
    while (!sto.empty()) {
        int x = sto.top();
        a *= 10;
        a += x;
        sto.pop();
    }
    return a;
}

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

    int c = concat(a, b);
    int d = sqrt(c);

    if (d * d == c) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 256
/**In the name of Allah, the Most Merciful, the Most Merciful.**/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define INF 9223372036854775806
#define pb push_back
#define mp make_pair
#define MOD 1000000007
#define PI 2*acos(0.0)
#define EPS 1e-9
ll max(ll a,ll b) {if(a>b) return a; else return b;}
ll min(ll a,ll b) {if(a<b) return a; else return b;}

int par[100004];
int Find(int r){
    if(par[r]==r) return r;
    return par[r]=Find(par[r]);
}
int c;
void Union(int x,int y){
    int px=Find(x); int py=Find(y);
    if(px!=py){
        par[py]=px;
        c--;
    }
}
int main()
{
    int n,m;
    cin>>n>>m;
    c=n;
    for(int i=1;i<=n;i++) par[i]=i;
    int x,y;
    for(int i=1;i<=m;i++){
        cin>>x>>y;
        Union(x,y);
    }
    cout<<c-1<<endl;

    return 0;
}




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

vector<int> calc_cut_left(vector<long long> pref, int n) {
  vector<int> ans(n);
  int cur = 0;
  ans[1] = 0;
  for (int i = 2; i + 2 < n; i++) {
    long long s1 = abs(pref[cur + 1] - (pref[i] - pref[cur + 1]));
    long long s2 = abs(pref[cur] - (pref[i] - pref[cur]));
    while (abs(pref[cur + 1] - (pref[i] - pref[cur + 1])) < abs(pref[cur] - (pref[i] - pref[cur])))
      cur++;
    ans[i] = cur;
  }
  return ans;
}

vector<int> calc_cut_right(vector<long long> pref, int n) {
  vector<int> ans(n);
  int cur = n - 2;
  ans[n - 3] = cur;
  for (int i = n - 4; i >= 1; i--) {
    long long s1 = abs((pref[n - 1] - pref[cur - 1]) - (pref[cur - 1] - pref[i]));
    long long s2 = abs((pref[n - 1] - pref[cur]) - (pref[cur] - pref[i]));
    while (abs((pref[n - 1] - pref[cur - 1]) - (pref[cur - 1] - pref[i])) < abs((pref[n - 1] - pref[cur]) - (pref[cur] - pref[i])))
      cur--;
    ans[i] = cur;
  }
  return ans;
}

int main() {
  int n;
  scanf("%d", &n);
  vector<int> a(n);
  for (int i = 0; i < n; i++)
    scanf("%d", &a[i]);
  vector<long long> pref(n, a[0]);
  for (int i = 1; i < n; i++)
    pref[i] = pref[i - 1] + a[i];
  vector<int> pos_left = calc_cut_left(pref, n);
  vector<int> pos_right = calc_cut_right(pref, n);
  long long ans = -1;
  for (int i = 1; i + 2 < n; i++) {
    int l = pos_left[i];
    int r = pos_right[i];
    long long s1 = pref[l];
    long long s2 = pref[i] - pref[l];
    long long s3 = pref[r] - pref[i];
    long long s4 = pref[n - 1] - pref[r];
    long long cur = max({s1, s2, s3, s4}) - min({s1, s2, s3, s4});
    if (ans == -1 || cur < ans)
      ans = cur;
  }
  printf("%lld\n", ans);
  return 0;
}

Measured memory_bytes: 5732
N, K, S = map(int, input().split())

A = [0]*N

for i in range(K):
    A[i] = S
    
for j in range(K, N):
    if(S+j+1 >= 10**9):
        A[j] = 1    
    else:
        A[j] = S+j+1
    
print(*A)

Measured memory_bytes: 13724