akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>

int main()
{
    int w, h, n;
    int lx = 0;
    int rx;
    int by = 0;
    int ty;
    
    scanf("%d %d %d", &w, &h, &n);
    
    rx = w;
    ty = h;
    
    for (int i = 0; i < n; i++)
    {
        int x, y, a;
        scanf("%d %d %d", &x, &y, &a);
        
        switch(a)
        {
            case 1:
            if (lx < x)
            {
                lx = x;
            }
            break;
            
            case 2:
            if (x < rx)
            {
                rx = x;
            }
            break;
            
            case 3:
            if (by < y)
            {
                by = y;
            }
            break;
            
            case 4:
            if (y < ty)
            {
                ty = y;
            }
            break;
            
            default:
            break;
        }
    }
    
//    printf("lx=%d, rx=%d, by=%d, ty=%d\n", lx, rx, by, ty);
    
    int ans;
    if (rx - lx < 0 || ty - by < 0)
    {
        ans = 0;
    }
    else
    {
        ans = (rx - lx) * (ty - by);
    }

    printf("%d\n", ans);
    
    return 0;
}


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

using namespace std;

//FILE *fi=freopen("1.txt","r",stdin);

int n;
pair<int,int> a[100001];

void nhap()
{
    scanf("%d",&n);
    for (int i=1;i<=n;++i)
    {
        scanf("%d",&a[i].first);
        a[i].second=i;
    }
    sort(a+1,a+1+n);
    for (int i=1;i<=n;++i)
        cout<<a[i].second<<" ";
}

int main()
{
    nhap();
    return 0;
}


Measured memory_bytes: 1536
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		
		if(s.charAt(s.length() - 1) == 's') System.out.println(s + "es");
		else System.out.println(s + "s");
		
		
		
	}

}


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

int main(){
  int h,w;
  cin>>h>>w;
  char bomb[h+2][w+2];
  for(int i=0;i<h+2;i++){
    for(int j=0;j<w+2;j++){
      bomb[i][j]='.';
    }
  }
  for(int i=1;i<=h;i++){
    for(int j=1;j<=w;j++){
      cin>>bomb[i][j];
    }
  }
  char ans[h][w];
  int c;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      if(bomb[i+1][j+1] == '#') ans[i][j] = '#';
      if(bomb[i+1][j+1] == '.'){
        c=0;
        for(int s=-1;s<2;s++){
          for(int t=-1;t<2;t++){
            if(bomb[i+1+s][j+1+t] == '#') c++;
          }
        }
        char x;
        x= c;
        x += 48;
        ans[i][j] = x;
      }
    }
  }
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      cout << ans[i][j];
    }
    cout <<endl;
  }
}


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

#define uni(x)      (x).resize(unique(all(x)) - (x).begin())
#define fprint(v)   for(auto x : v) cout << x << ' '
#define ALL(x)      (x).begin(), (x).end()
#define MP(x, y)    make_pair(x, y)
#define PII         pair<int, int>
#define SZ(x)       int((x).size())
#define PB(x)       push_back(x)
#define ll          long long
#define S           second 
#define F           first
#define nl          '\n'

using namespace std;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
mt19937_64 rnd;

const int N = 2e5 + 5;

int main() {
    ios_base::sync_with_stdio(0);cin.tie(0);
    int n, m;
    cin >> n >> m;
    map<int, int> mp, done;
    int ans = 0;
    while(m--){
        int x;
        string ver;
        cin >> x >> ver;
        if(ver == "AC"){
            done[x] = 1;
        }else if(!done.count(x) && ver == "WA"){
            mp[x]++;
        }
    }
    for(auto x : done){
        ans += mp[x.F];
    }
    cout << SZ(done) << ' ' << ans;
    return 0;
}
/*
    *** Most Impo.. -> check base case always
    1. Overflow Check (*, +)
    2. Index check (0 - based or 1 - based)
    3. Check for n = 1, 2, 3, 4....
    4. Corner Cases
*/

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

int main(){
    string s;
    int n;
    cin >> n >> s;
    int ans = 0, memo = 0;
    for(int i = 0;i < n;i++){
        if(s.at(i) == 'I')memo++;
        else memo--;
        if(memo >= ans)ans = memo;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
struct Fast { Fast() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20);} } fast;

int main() {
    int n, q, a = 0, l, r;
    string s;
    cin >> n >> q >> s;
    vector<int>as(n);
    map<int, int>cnt;
    for (int i = 0; i + 1 < n; i++){
        if (s[i] == 'A' && s[i + 1] == 'C'){
            as[i + 1] = 1;
        }
    }
    for (int i = 1; i < n; i++) {
        as[i] += as[i - 1];
    }
    for (int i = 0; i < q; i++){
        cin >> l >> r;
        cout << as[r - 1] - as[l - 1] << endl;
    }
}

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

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define FOR(i,n,m) for(int i=(int)(n); i<=(int)(m); i++)
#define RFOR(i,n,m) for(int i=(int)(n); i>=(int)(m); i--)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend();x++)
#define setp(n) fixed << setprecision(n)

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; }

#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>

#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ins insert

using namespace std;

struct Event {
    int id,x,y;
    Event(int id, int x, int y):id(id),x(x),y(y){}
    bool operator<(const Event &e){return x<e.x;}
};

//-------------------------------------------------

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; cin>>n;
    vector<Event> event;
    rep(i,n){
        int x,y; cin>>x>>y;
        event.pb(Event(0,x,y));
    }
    rep(i,n){
        int x,y; cin>>x>>y;
        event.pb(Event(1,x,y));
    }
    sort(all(event));
    int ans=0;
    set<int> s; s.ins(-1);
    for(auto e:event){
        if (e.id==0){
            s.ins(e.y);
        }else{
            auto itr = s.lower_bound(e.y); itr--;
            if (*itr==-1) continue;
            ans++;
            s.erase(itr);
        }
    }
    cout<<ans<<"\n";
    return 0;
}


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

int main() {
  string S;
  cin >> S;

  if(S.at(0)!=S.at(1) && S.at(0)!=S.at(2) && S.at(1)!=S.at(2)){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }

return 0;  
}

Measured memory_bytes: 256
import java.io.BufferedReader
import java.io.InputStreamReader
import java.io.PrintWriter
import kotlin.math.abs
import kotlin.math.min

val br = BufferedReader(InputStreamReader(System.`in`))
val out = PrintWriter(System.out)

fun main() {
    br.use { out.use {
        solve()
        out.flush()
    } }
}

fun solve() {
    val n = readLong()
//    a * b = n - c
    // n - cを固定して　素因す分解してABの組を求める
    var ans = 0L
    for (c in 1 until n) {
        val p = primeFactor(n - c)
        var tmp = 1L
        for (l in p.values) {
            tmp *= (l + 1)
        }
        ans += tmp

//        2^2 * 3^4
    }
    out.println(ans)
}

/**
O(n^(1/2)) // n * n <= Long.MAX_VALUE n <= 10^8 or more
if n == 1, return emptyMap
 */
fun primeFactor(n: Long): Map<Long, Long> {
    val factorMap = mutableMapOf<Long, Long>()
    var target = n
    var i = 2L
    while (i * i <= target) {
        while (target % i == 0L) {
            factorMap[i] = factorMap.getOrElse(i) { 0L } + 1L
            target /= i
        }
        i++
    }

    if (target != 1L) { factorMap[target] = 1 }
    return factorMap
}




fun readInteger() = Integer.parseInt(br.readLine())
fun readLong() = java.lang.Long.parseLong(br.readLine())
fun readStringList() = br.readLine()!!.split(' ')
fun readIntegerList() = readStringList().map(Integer::parseInt)
fun readLongList() = readStringList().map(java.lang.Long::parseLong)
fun readDoubleList() = readStringList().map(java.lang.Double::parseDouble)


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

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

    if(a < b){
        if(a+W > b){
            cout << 0 << endl;
        }
        if(a+W < b){
            cout << b - (a+W) << endl;
        }
        if(a+W == b){
            cout << 0 << endl;   
        }
    }
    if(a > b){
        if(b+W > a){
            cout << 0 << endl;
        }
        if(b+W < a){
            cout << a - (b+W) << endl;
        }
        if(b+W == a){
            cout << 0 << endl;
        }
    }
    if(a == b){
        cout << 0 << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <vector>
#include <queue>
#include <algorithm>

using namespace std;

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

ll mod = 1e9 + 7;

vector<bool> seen;
ll x[200000];
void dfs(const vector<vector<int>> &G, int v) {
    seen[v] = true;
    for (auto next_v : G[v]) { 
        if (seen[next_v]) continue;
		x[next_v] += x[v];
        dfs(G, next_v);
    }
}


int main(){
	int n;
	int q;
	
	vector<vector<int>> v(200000);

	cin >> n >> q;
	for(int i=0;i<n-1;i++){
		int a,b;
		cin >> a >> b;
		v[a-1].push_back(b-1);
		v[b-1].push_back(a-1);
	}
	for(int i=0;i<n;i++) x[i] = 0;
	for(int i=0;i<q;i++){
		int a;
		ll b;
		cin >> a >> b;
		x[a-1] += b;
	}

	seen.assign(n, false);
	for(int i=0;i<n;i++){
	
	}
	dfs(v, 0);

	for(int i=0;i<n;i++) cout << x[i] << " ";
	cout << endl;
	

	return 0;
}


Measured memory_bytes: 24320
#include<bits/stdc++.h>
// Useful constants
#define INF  (int)1e9
#define EPS   1e-9
#define MOD 1000000007ll
#define PI 3.14159
// for input-output
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
// iteration macros: have advantage of auto-casting and not recomputing arguments
#define REP(i, a, b) \
for (int i = int(a); i <= int(b); i++) // a to b, and variable i is local!
#define TRvi(c, it) \
for (vi::iterator it = (c).begin(); it != (c).end(); it++)
#define TRvii(c, it) \
for (vii::iterator it = (c).begin(); it != (c).end(); it++)
#define TRmsi(c, it) \
for (msi::iterator it = (c).begin(); it != (c).end(); it++)
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define setBit(S, j) (S |= (1 << j))
#define clearBit(S, j) (S &= ~(1 << j))
#define toggleBit(S, j) (S ^= (1 << j))
// input macro
#define in(x,n)   for(int e=0;e<n;e++){ll y;cin>>y;x.pb(y);}
//output macro
#define print(x)    for(auto it:x) cout<<it<<' '; cout<<endl;
#define printii(x)  for(auto it:x) cout<<it.F<<' '<<it.S<<'\t';  cout<<endl;
// shortcut for data type
#define ll long long
#define vi vector<ll>
#define vvi vector<vi>
#define ii pair<ll,ll>
#define pll pair<ll,ll>
#define vii vector<ii>
#define vvii vector<vii>
#define viii vector<pair<ii,ll>>
#define pb push_back
#define ppb pop_back
#define eb emplace_back
#define mp make_pair
#define F first
#define S second
#define uset unordered_set
#define umap unordered_map
//--namespace
using namespace std;
//--useful function
ll gcd(ll a, ll b){ll temp;while (b > 0){temp = a%b;a = b;b = temp;} return a;}
ll lcm(ll a, ll b){return a*b/gcd(a,b);}
ll fpow(ll  b, ll exp, ll mod){if(exp == 0) return 1;ll t = fpow(b,exp/2,mod);if(exp&1) return t*t%mod*b%mod;return t*t%mod;}
ll divmod(ll i, ll j, ll mod){i%=mod,j%=mod;return i*fpow(j,mod-2,mod)%mod;}
// --clock funtion
clock_t time_p=clock();
void TimeTaken()
{
    time_p=clock()-time_p;
    cerr<<"Completion time : "<<(float)(time_p)/CLOCKS_PER_SEC<<"\n";
}
// --solve function
void solve() {

}
//--main function
int main(){
  int k;
  cin>>k;
	string s;cin>>s;
  if(s.length()<=k)cout<<s;
  else{
    REP(i,0,k-1)cout<<s[i];
    cout<<"...";
  }
	return 0;

//   TimeTaken();
}


Measured memory_bytes: 3608
#include<stdio.h>
int main(void)
{
	int a,b,wa,sa,seki;
	scanf("%d %d",&a,&b);
	wa=a+b;
	sa=a-b;
	seki=a*b;
	if(sa<=wa && seki<=wa){
		printf("%d\n",wa);
	}
	else if(wa<=sa && seki<=sa){
		printf("%d\n",sa);
	}
	else{
		printf("%d\n",seki);
	}
	return 0;
}

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

#define stirng string
#define vvi vector<vector<int>>
#define vi vector<int>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;

const int inf = 1e9 + 7;

int main() {
  int n, m, x;
  cin >> n >> m >> x;
  int p[m];
  int mas[n + 1] = {0};
  for (int i = 0; i < m; i++) {
    cin >> p[i];
    mas[p[i]] = 1;
  }
  int ans1 = 0;
  int ans2 = 0;
  for (int i = x; i < n + 1; i++) {
    ans1 += mas[i];
  }
  for (int i = x; i >= 0; i--) {
    ans2 += mas[i];
  }

  cout << min(ans1, ans2) << endl;

  return 0;
}


Measured memory_bytes: 256
w = int(input())
wlist = list(range(1,w+1))
n = int(input())
for i in range(n):
    a, b = map(int, input().split(','))
    wlist[a-1], wlist[b-1] = wlist[b-1], wlist[a-1]
for i in range(w):
    print(wlist[i])


Measured memory_bytes: 5596
W = sorted(input())
n = len(W)
if n % 2 == 1:
    print('No')
    exit()

for i in range(0, n, 2):
    w1, w2 = W[i], W[i+1]
    if w1 != w2:
        print('No')
        exit()

print('Yes')

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

using namespace std;

#define INF 1000000007
#define LINF (1LL << 60)
#define PI 3.14159265358979

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

inline i64 mod(i64 a, i64 m) { return (a % m + m) % m; }

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; }



int a,b,c;
void solve(){
	cin >> a >> b >> c;
	if(a+b == c || a+c == b || b+c == a) cout << "Yes" << endl;
	else cout << "No" << endl;
}

int main(){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	int t = 1;
	//cin >> t;
	while(t--){
		solve();
	}
	
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
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; }

const ll INF=(1LL<<60);

int main(void){
    int N; cin >> N;
    int A[N+1],B[N+1],C[N+1];
    for(int i=1; i<=N; i++){
        cin >> A[i] >> B[i] >> C[i];
    }

    ll dp[N+1][3];
    for(int i=1; i<=N; i++){
        for(int j=0; j<3; j++) dp[i][j]=-INF;
    }

    dp[1][0]=A[1]; dp[1][1]=B[1]; dp[1][2]=C[1];

    for(int i=2; i<=N; i++){
        chmax(dp[i][0], dp[i-1][1]+A[i]);
        chmax(dp[i][0], dp[i-1][2]+A[i]);

        chmax(dp[i][1], dp[i-1][0]+B[i]);
        chmax(dp[i][1], dp[i-1][2]+B[i]);

        chmax(dp[i][2], dp[i-1][0]+C[i]);
        chmax(dp[i][2], dp[i-1][1]+C[i]);
    }

    cout << max(dp[N][0], max(dp[N][1], dp[N][2])) << endl;

    // for(int i=1; i<=N; i++){
    //     cout << dp[i][0] << " " << dp[i][1] << " " << dp[i][2] << endl;
    // }
}

Measured memory_bytes: 3712
#include<bits/stdc++.h>
using namespace std;
int main(){
	string s;
	cin>>s;
	for(int i=0;i<s.size()-1;i++){
		if(s[i]==s[i+1]){
			cout<<"Bad"<<endl;
			return 0;
		}	
	}
	cout<<"Good"<<endl;
	return 0;
} 

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

int main() {
	double n;
	cin>>n;
	n*=3.1415926535;
	n*=2;
	printf("%.9f",n);
	// your code goes here
	return 0;
}

Measured memory_bytes: 3752
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {
    static PrintWriter out;
    static CF_Reader in;
    static int[][] arr;
    static int n;

    public static void main(String[] args) throws IOException {
        out = new PrintWriter(new OutputStreamWriter(System.out));
        in = new CF_Reader();

        n = in.intNext();
        int k = in.intNext();
        arr = new int[n][2];
        for (int i = 0; i < n; i++) arr[i] = new int[]{in.intNext(), in.intNext()};
        out.println(solve(arr, k));

        out.close();
    }

    static int solve(int[][] arr, int K) {
        int ln = arr.length;
        int MAX = 1000 * ln;
        Integer[] dp = new Integer[MAX + 1];
        Arrays.fill(dp, null);

        dp[0] = 0;
        for (int i = 0; i < ln; i++) {
            int weight = arr[i][0];
            int value = arr[i][1];

            for (int v = MAX - value; v >= 0; v--) {
                if (dp[v] != null && dp[v] + weight <= K) {
                    dp[v + value] = (dp[v + value] == null) ? dp[v] + weight : Math.min(dp[v + value], dp[v] + weight);
                }
            }
        }

        for (int v = MAX; v >= 0; v--) if (dp[v] != null) return v;
        return -1;
    }

    static class CF_Reader {
        BufferedReader br;
        StringTokenizer st;

        public CF_Reader() throws IOException {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine().trim());
            return st.nextToken();
        }

        long longNext() throws IOException {
            return Long.parseLong(next());
        }

        int intNext() throws IOException {
            return Integer.parseInt(next());
        }

        double doubleNext() throws IOException {
            return Double.parseDouble(next());
        }

        char charNext() throws IOException {
            return next().charAt(0);
        }

        public int[] nextIntArray(final int n) throws IOException {
            final int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = intNext();
            return a;
        }

        public long[] nextLongArray(final int n) throws IOException {
            final long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = longNext();
            return a;
        }

        String line() throws IOException {
            return br.readLine().trim();
        }
    }
}


Measured memory_bytes: 42580
#include <bits/stdc++.h>
#define ms(x, n) memset(x,n,sizeof(x));
#define rep(i, n) for(int i = 0; i < (int)n; ++i)
#define rep1(i, n) for(int i = 1; i <= (int)n; ++i)
#define pb push_back
#define PI acos(-1.0)
#define INF 0x3f3f3f3f
#define LL_MAX 9223372036854775807
#define LL_MIN -9223372036854775808
typedef long long int ll;
typedef unsigned long long int ull;
using namespace std;

int n, k;
string s;

int main() {
    ios::sync_with_stdio(false); cin.tie(0);
    cin >> n >> k;
    cin >> s;
    int ans = 0;
    for (int i = 1; i < s.size(); ++i) {
        if (s[i] == s[i-1]) {
            ++ans;
        }
    }
    cout << min(n-1, ans + 2*k) << '\n';
    return 0;
}


Measured memory_bytes: 512
#include<iostream>
#include<vector>
#include<string>
#include <algorithm>
using namespace std;
int main(void){
    int N, a, point;
    string b;
    string city;
    cin >> N;
    vector<pair<pair<string, int>, int> >AA;
    for(int i = 0; i < N; i++){
        cin >> b; cin >> a;
        AA.push_back(make_pair(make_pair(b, a*(-1)), i + 1));
    }
	sort(AA.begin(), AA.end());
	for (int i = 0; i < N; i++) cout << AA[i].second <<endl;;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <utility>
#include <cmath>
#include <random>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <algorithm>
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)
#define all(x) begin(x),end(x)
#define show(obj) {for(auto x:obj)cout<<x<<' ';cout<<endl;}
#define line "----------"
typedef long long ll;
typedef pair<int,int> P;
const int inf = 1001001000;
const ll INF = 1LL<<60;
const ll MOD = 1e9 + 7;

int main(){
	int a,b;cin>>a>>b;
	if(a == 1)a = 14;
	if(b == 1)b = 14;
	if(a>b){
		cout<<"Alice"<<endl;
	}else if(a == b){
		cout<<"Draw"<<endl;
	}else{
		cout<<"Bob"<<endl;
	}
	return 0;
}

Measured memory_bytes: 3556
#include <iostream>
#include <string>
#include <map>
#include <limits>
using namespace std;
using ll = long long;

ll calc(ll v1, ll v2, char op) {
    if(op == '+') {
        return v1 + v2;
    } else if(op == '-') {
        return v1 - v2;
    } else {
        return v1 * v2;
    }
}

// <expr> := <term1> | <expr> <op1> <term1>
// <term1> := <term2> | <term1> <op2> <term2>
// <term2> := <fact> | <term2> <op3> <fact>
// <fact> := (<expr>) | <number>

ll expr(string const& s, int& p, map<char, int>& m);
ll term1(string const& s, int& p, map<char, int>& m);
ll term2(string const& s, int& p, map<char, int>& m);
ll fact(string const& s, int& p, map<char, int>& m);

ll number(string const& s, int& p) {
    ll res = 0;
    while(isdigit(s[p])) {
        res *= 10;
        res += s[p++] - '0';
    }
    return res;
}

ll expr(string const& s, int& p, map<char, int>& m) {
    ll v1 = term1(s, p, m);
    while(p < s.size() && m.count(s[p]) == 1 && m[s[p]] == 0) {
        char op = s[p++];
        v1 = calc(v1, term1(s, p, m), op);
    }
    return v1;
}

ll term1(string const& s, int& p, map<char, int>& m) {
    ll v1 = term2(s, p, m);
    while(p < s.size() && m.count(s[p]) == 1 && m[s[p]] == 1) {
        char op = s[p++];
        v1 = calc(v1, term2(s, p, m), op);
    }
    return v1;
}

ll term2(string const& s, int& p, map<char, int>& m) {
    ll v1 = fact(s, p, m);
    while(p < s.size() && m.count(s[p]) == 1 && m[s[p]] == 2) {
        char op = s[p++];
        v1 = calc(v1, fact(s, p, m), op);
    }
    return v1;
}

ll fact(string const& s, int& p, map<char, int>& m) {
    if(isdigit(s[p])) {
        return number(s, p);
    }
    ll res = expr(s, ++p, m);
    ++p;
    return res;
}

int main() {
    string s;
    cin >> s;
    ll res = numeric_limits<ll>::min();
    for(int i=0; i<3; ++i) {
        for(int j=0; j<3; ++j) {
            for(int k=0; k<3; ++k) {
                int p = 0;
                map<char, int> m;
                m['+'] = i;
                m['-'] = j;
                m['*'] = k;
                res = max(res, expr(s, p, m));
            }
        }
    }
    cout << res << endl;
}


Measured memory_bytes: 3204
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <math.h>
using namespace std;
int main(){
  cin.tie(NULL);
  ios::sync_with_stdio(false);
  string s;
  cin>>s;
  if((s[0]==s[1] && s[1]==s[2]) || (s[1]==s[2] && s[2]==s[3])){
    cout<<"Yes"<<"\n";
  }
  else{
    cout<<"No"<<"\n";
  }
  return 0;
  }

Measured memory_bytes: 3608
sx, sy, tx, ty = map(int, input().split())

y = ty - sy
x = tx - sx

u = "U" * y
r = "R" * x
d = "D" * y
l = "L" * x

offset1 = "LU"
offset2 = "RD"
print(u + r + d + l + offset1 + u + r + offset2 + offset2 + d + l + offset1)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
    int r, D, x;
    cin >> r >> D >> x;
    for ( int i = 2001; i <= 2010 ; i++ ) {
        x = r * x - D;
        cout << x << '\n';
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define all(x) begin(x), end(x)
#define range(x) begin(x), begin(x)
#define what(x) cout << #x << ": " << x << '\n'
#define print(x) for (auto &el: x) cout << el << ' '; cout << '\n'
using namespace std;

std::ostream& operator<<(std::ostream& dest, __int128_t value) {
    std::ostream::sentry s(dest);
    if (s) {
        __uint128_t tmp = value < 0 ? -value : value;
        char buffer[ 128 ];
        char* d = std::end( buffer );
        do {
            -- d;
            *d = "0123456789"[ tmp % 10 ];
            tmp /= 10;
        } while ( tmp != 0 );
        if ( value < 0 ) -- d, *d = '-';
        int len = std::end( buffer ) - d;
        if ( dest.rdbuf()->sputn( d, len ) != len ) dest.setstate( std::ios_base::badbit );
    }
    return dest;
}

template<typename S, typename T>
ostream& operator <<(ostream &os, pair<S, T> &m) { 
    os << '[' << m.first << " " << m.second << ']';
    return os;
}

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

    ll a;
    double b;
    cin >> a >> b;
    cout << (a * (ll) (b * 100 + 0.01) ) / 100LL << endl;

    return 0;
}


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

int main(){

  char str[100][100];
  int n,m,ans = 0;
  int a[106][105] = {{}};
  int b[105][105] = {{}};
  int graph[105][105] = {{}};

  cin >> m >> n;



  for(int i = 0;i < m;i++){
    for(int j = 0;j < n;j++){

      cin >> str[i][j];
    }
  }



  for(int i = 0;i < m;i++){
    for(int j = 0;j < n;j++) {
      if(str[i][j] == 'o'){
	graph[i][j]++;
	graph[i][j + 1]++;
	graph[i][j - 1]++;
      }
      if(str[i][j] == 'x'){
	graph[i][j - 1]++;
	graph[i][j + 1]++;
	graph[i][j]++;
	graph[i + 1][j]++;
	graph[i - 1][j]++;
	graph[i][j - 1]++;
	graph[i + 1][j + 1]++;
	graph[i + 1][j - 1]++; 
	graph[i - 1][j + 1]++;
	graph[i - 1][j - 1]++;
      }
    }
  }




  for(int i = 1;i < m;i++){
    for(int j = 0;j < n;j++){
      if(graph[i][j] == 0) ans++;
    }
  }



  cout << ans << endl;
}

Measured memory_bytes: 1220
#include<iostream>
using namespace std;
const int maxn=100005;
long long n,dp[maxn],a[maxn];
int main()
{
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
	}
	dp[0]=0;
	dp[1]=0;
	dp[2]=abs(a[1]-a[2]);
	for(int i=3;i<=n;i++)
	{
		dp[i]=min(dp[i-2]+abs(a[i]-a[i-2]),dp[i-1]+abs(a[i]-a[i-1]));
	}
	cout<<dp[n]<<endl;
	return 0;
}

Measured memory_bytes: 5200
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', function (chunk) {
    var input = chunk.split("\n");
    var output = "";
    
    var length = Number(input[0]);
    var nums = input[1].split(" ");
    
    for (var i = length - 1; i >= 0 ; i --){
        output += (nums[i] + " ");
    }
    output = output.slice(0, -1);
    console.log(output);
});

Measured memory_bytes: 7644
#include <bits/stdc++.h>
using namespace std;
#define ll
#define ld long double
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define si size()
#define bk back()
#define popb pop_back()
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define endl "\n"
#define lb lower_bound
#define ub upper_bound
#define emp empty()
#define beg begin()
#define en end()
#define forl(i,a,n) for(   int  i=a;i<n;i++)
#define rfor(i,n,a) for(   int  i=n;i>=a;i--)
#define fore(i,a,n) for(   int  i=a;i<=n;i++)
//---------------------------------------------------------------------
int isPalindrome(string str) 
{ 
    // Start from leftmost and rightmost corners of str 
    int l = 0; 
    int h = str.length() - 1; 
  
    // Keep comparing characters while they are same 
    while (h > l) 
    { 
        if (str[l++] != str[h--]) 
        { 
            
            return 0; 
        } 
    } 
    return 1;
} 

 int main()
{

  string s;
  cin>>s;
  int n=s.length();
  if( isPalindrome(s) && isPalindrome(s.substr(0,(n-1)/2)) && isPalindrome(s.substr((n+1)/2,(n-1)/2)) )
  {
    cout<<"Yes";
  }
  else
  {
    cout<<"No";
  }
   
    
	return 0;
}


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

void printArray(int* A, int N){
  for (int i = 0; i < N; i++) {
    std::cout << A[i];
    if (i!=N-1) {
      std::cout << " ";
    }else{
      std::cout <<'\n';
    }
  }
}


int* insertionSort(int* A, int N){
  int tmp;

  for(int i=0; i<N; i++){
    tmp = A[i];
    int j = i-1;
    while (j>=0 && A[j]>tmp) {
      A[j+1]=A[j];
      j--;
    }
    A[j+1]=tmp;
    printArray(A, N);
  }
  return A;
}


int main(){
  int n;
  std::cin >> n;
  int* A = new int[n];

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

  A = insertionSort(A, n);

  return 0;

}



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

int main() {
    int n, k;
    cin >> n >> k;
    vector<int> p(n);
    for (int i = 0; i < n; i++) {
        cin >> p[i];
    }
    sort(p.begin(), p.end());
    int ans = 0;
    for(int i = 0; i < k; i++) {
        ans += p[i];
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3608
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <climits>
#include <cstring>
#include <utility>
#include <cmath>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

#define F first
#define S second 
#define pb push_back
#define all(x) x.begin(),x.end()
#define endl "\n"


void print() { cout << endl; }

template <typename T, typename... Types>
void print(T arg, Types... args) {
    cout << arg << " ";
    print(args...);
}

typedef long long ll;
typedef long double ld;
typedef pair< int, int > pii;
typedef vector < int > vi;

const int mod = 1e9 + 7;
const int N = 2e5 + 7;


ll gcdExtended(ll a, ll b, ll *x, ll *y){
    if (a == 0){
        *x = 0, *y = 1;
        return b;
    }
    ll x1, y1;
    ll gcd = gcdExtended(b%a, a, &x1, &y1);
    *x = y1 - (b/a) * x1;
    *y = x1;
    return gcd;
}

ll modInv(ll a, ll m){
    ll x, y;
    ll g = gcdExtended(a, m, &x, &y);
    ll res = (x%m + m) % m;
    return res;
}
 
 
ll mpower(ll x, ll y, ll p){
    ll res = 1;
    x = x % p;
    while(y > 0){
        if(y & 1) res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}
 
ll power(ll x, ll y){
    ll res = 1;
    while (y > 0){
        if (y & 1) res = res*x;
        y = y>>1;
        x = x*x;
    }
    return res;
}
 
bool isPrime(ll n){
    if (n <= 1)  return false;
    if (n <= 3)  return true;
    if (n%2 == 0 || n%3 == 0) return false;
    ll p=sqrt(n);
    for(int i=5;i<=p;i=i+6)
        if (n%i == 0 || n%(i+2) == 0)
            return false;
    return true;
}



int main()
{
    IOS;
    int a, b, c;
    cin >> a >> b >> c;
    cout << c << " " << a << " " << b << endl;
    return 0;
}


Measured memory_bytes: 256
n,k = map(int, input().split())
p = [0]+[int(x) for x in input().split()]
c = [0]+[int(x) for x in input().split()]

ans=-10**18

for saisyo in range(1,n+1):
    tensuulist=[]
    genzaiti=saisyo

    while(True):
        genzaiti=p[genzaiti]
        tensuulist.append(c[genzaiti])
        if genzaiti==saisyo:
            break

    goukei=sum(tensuulist)
    nagasa=len(tensuulist)
    kaisuu=k
    syou=kaisuu//nagasa
    amari=kaisuu%nagasa

    tensuu=0
    nokorikaisuu=0

    if goukei<=0:
        for i in range(nagasa):
            tensuu+=tensuulist[i]
            ans=max(ans,tensuu)
    else:
        if 3*nagasa<kaisuu:
            tensuu+=goukei*(syou-1)
            nokorikaisuu=nagasa+amari
            for i in range(nokorikaisuu):
                tensuu+=tensuulist[(i%nagasa)]
                ans=max(ans,tensuu)
        else:
            for i in range(kaisuu):
                tensuu+=tensuulist[(i%nagasa)]
                ans=max(ans,tensuu)

print(ans)

Measured memory_bytes: 79980
#include <vector>
#include <unordered_set>
#include <sstream>
#include <iostream> 
 
 
using namespace std;
 
 
int main() {
	int n;
	cin >> n;
    
    int x;
    cin >> x;

    int t;
    cin >> t;

		if (n % x == 0) {
				cout << n/x*t << endl;
		} else {
				cout << ((n/x)+1)*t  << endl;
		}
 
}

Measured memory_bytes: 3620
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <functional>
#include <iostream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define ll long long
#define imfor(i, n) for(int i = 0; i < n; i++)
using namespace std;
ll MOD = 1000000007;

int main() {
    ll a, b, x;
    cin >> a >> b >> x;
    if (a != 0) {
        cout << ((b / x) + 1) - (((a - 1) / x) + 1) << endl;
    }
    else {
        cout << (b / x) + 1 << endl;
    }
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
using namespace std;

char s[200010];
int a[200010], l[200010], r[200010], b[200010];
int n, k, c;

int main() {
    scanf("%d%d%d", &n, &k, &c);
    scanf("%s", s);
    for(int i = 0; i < n; i++) {
        if(s[i] == 'x') a[i + 1] = 0;
        else a[i + 1] = 1;
    }
    for(int i = 1; i <= c + 1; i++) l[i] = a[i];
    for(int i = c + 2; i <= n; i++) {
        l[i] = l[i - 1];
        if(a[i] == 1) {
            l[i] = max(l[i], l[i - c - 1] + 1);
        }
    }
    int ans = l[n];
    if(ans > k) return 0;
    for(int i = n; i >= n - c - 1 && i >= 1; i--) r[i] = ans;
    for(int i = n - c - 1; i >= 1; i--) {
        r[i] = r[i + 1];
        if(a[i] == 1) {
            r[i] = min(r[i], r[i + c + 1] - 1);
        }
    }
    for(int i = 1; i <= n; i++) {
        if(l[i] == r[i]) {
            b[l[i]]++;
        }
    }
    for(int i = 1; i <= n; i++) {
        if(l[i] == r[i]) {
            if(b[l[i]] == 1) printf("%d\n", i);
        }
    }
    return 0;
}


Measured memory_bytes: 4736
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <stdlib.h>
#include <string.h>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <stdio.h>
#include <tuple>
#include <bitset>
#include <cfloat>
#include <fstream>
#include <limits.h>
#include <list>
#include <math.h>
#include <random>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <numeric>
#include <utility>
#include <sstream>

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

using namespace std;
#define int long long
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repr(i,n) for(ll i=n;i>=0;i--)
#define P pair<ll, ll>
#define sz(x) (ll)x.size()
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define VE vector<ll>
#define COUT(x) cout<<(x)<<endl
#define MA map<ll,ll>
#define SE set<ll>
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,VE,greater<ll>>
#define COUT(x) cout<<(x)<<endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define EPS (1e-10)
ll gcd(ll a, ll b) {
	if (a < b)swap(a, b);
	if (b == 0) return a;
	return gcd(b, a % b);
}
ll lcm(ll a, ll b) {
	ll g = gcd(a, b);
	return a / g * b;
}
bool prime(ll n) {
	for (ll i = 2; i <= sqrt(n); i++) {
		if (n%i == 0)return false;
	}
	return n != 1;
}


const long long MOD = 1000000007;
const long long INF = 1LL << 60;


const int MAX_N = 100010;

signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	string s; cin >> s;
	string t; cin >> t;
	if (s.size() < t.size()) {
		cout << "UNRESTORABLE" << endl; return 0;
	}
	reverse(ALL(s)); reverse(ALL(t));
	bool ok = false;
	rep(i, s.size() - t.size() + 1) {
		bool tmp = true;
		rep(j, t.size()) {
			if (s[i + j] != t[j])tmp = false;
		}
		if (tmp) {
			ok = true;
			goto ex;
		}
	}
	rep(i, s.size() - t.size() + 1) {
		bool tmp = true;
		rep(j, t.size()) {
			if (s[i+j]!='?'&&s[i + j] != t[j])tmp = false;
		}
		if (tmp) {
			ok = true;
			rep(j, t.size()) {
				s[i + j] = t[j];
			}
			break;
		}
	}
	if (!ok) {
		cout << "UNRESTORABLE" << endl; return 0;
	}
ex:;
	rep(i, s.size()) {
		if (s[i] == '?')s[i] = 'a';
	}
	reverse(ALL(s));
	cout << s << endl;
	return 0;
}

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

using namespace std;
#define  ll long long

int main()
{
    int n;
    cin>>n;
    ll a[n];
   for(int i=0;i<n;i++)cin>>a[i];
   ll sm=0,si=1;
   ll ans[n];
   for(int i=n-1;i>=0;i--){
     sm+=(si*a[i]);
    si=si*-1;
   }
   ans[0]=sm/2;
   for(int i=1;i<n;i++){
    ans[i]=a[i-1]-ans[i-1];

   }
   for(int i=0;i<n;i++)cout<<2*ans[i]<<" ";

    return 0;
}


Measured memory_bytes: 2816
#include <algorithm>
#include <bits/stdc++.h>
#include <cstddef>
#include <cstdint>
#include <iostream>
#include <iterator>
#include <sstream>
#include <string>
#include <type_traits>
#include <vector>

// lib/join.hpp
#ifndef JOIN_HPP
#define JOIN_HPP


namespace tools {
  template <typename Iterator>
  std::string join(const Iterator begin, const Iterator end, const std::string delimiter) {
    std::ostringstream ss;
    std::string current_delimiter = "";
    for (Iterator it = begin; it != end; ++it) {
      ss << current_delimiter << *it;
      current_delimiter = delimiter;
    }
    return ss.str();
  }
}

#endif

// lib/pow2.hpp
#ifndef POW2_HPP
#define POW2_HPP

/*
usage:

tools::pow2(5) => 32
*/


namespace tools {
  template <typename T, typename std::enable_if<std::is_unsigned<T>::value, std::nullptr_t>::type = nullptr>
  constexpr T pow2(const T x) {
    return static_cast<T>(1) << x;
  }

  template <typename T, typename std::enable_if<std::is_signed<T>::value, std::nullptr_t>::type = nullptr>
  constexpr T pow2(const T x) {
    return static_cast<T>(static_cast<typename std::make_unsigned<T>::type>(1) << static_cast<typename std::make_unsigned<T>::type>(x));
  }
}

#endif

// lib/util.hpp
#ifndef UTIL_HPP
#define UTIL_HPP


typedef ::std::int_fast64_t i64;
typedef ::std::uint_fast64_t u64;
typedef ::std::int_fast32_t i32;
typedef ::std::uint_fast32_t u32;

namespace tools {
  template <typename T>
  void read(::std::istream& is, ::std::vector<T>& vector, const typename ::std::vector<T>::size_type size) {
    vector.reserve(size);
    ::std::copy_n(::std::istream_iterator<T>(is), size, ::std::back_inserter(vector));
  }
  template <typename T>
  void read(::std::vector<T>& vector, const typename ::std::vector<T>::size_type size) {
    ::tools::read(::std::cin, vector, size);
  }

  template <typename T, ::std::size_t N>
  void read(::std::istream& is, ::std::array<T, N>& array) {
    ::std::copy_n(std::istream_iterator<T>(is), N, array.begin());
  }
  template <typename T, ::std::size_t N>
  void read(::std::array<T, N>& array) {
    ::tools::read(::std::cin, array);
  }
}

#endif

// main.cpp

int main() {
  i64 M, K;
  std::cin >> M >> K;

  std::vector<i64> answers;
  if (M <= 1) {
    if (K == 0) {
      for (i64 i = 0; i < tools::pow2(M); ++i) {
        answers.push_back(i);
        answers.push_back(i);
      }
    } else {
      answers.push_back(-1);
    }
  } else {
    if (K < tools::pow2(M)) {
      for (i64 i = tools::pow2(M) - 1; i >= 0; --i) {
        if (i != K) {
          answers.push_back(i);
        }
      }
      answers.push_back(K);
      for (i64 i = 0; i < tools::pow2(M); ++i) {
        if (i != K) {
          answers.push_back(i);
        }
      }
      answers.push_back(K);
    } else {
      answers.push_back(-1);
    }
  }

  std::cout << tools::join(answers.begin(), answers.end(), " ") << std::endl;
  return 0;
}

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

int int_len(int n) {
  int s=0;
  while(n!=0) s++, n/=10;
  return s;
}

int int_sum(int n) {
  int m=0,s=0,a=n;
  while(a!=0) s++, a/=10;
  for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow(10,i+1)))*10;
  return m;
}






int gcd(int a,int b)
{
 
  int r, tmp;
 
  
 
  /* 自然数 a > b を確認・入替 */
  if(a<b){
    tmp = a;
    a = b;
    b = tmp;
  }
 
  /* ユークリッドの互除法 */
  r = a % b;
  while(r!=0){
    a = b;
    b = r;
    r = a % b;
  }
 
 
 
  return b;
}







int fac(int n){
  int m=1;
  while(n>=1) m*=n,n--;
  return m;
}

int vec_sum(vector<int> v){
  int n=0;
  for(int i=0;i<v.size();i++) n+=v[i];
  return n;
}
///////////////////////////
int main() {
  string s;
  cin>>s;
  map<char,int> mp;
  rep(i,26){
    mp['a'+i]=0;
  }
  rep(i,s.size()){
    mp[s[i]]++;
  }
  for(auto c:mp){
    if(c.second==0){
      cout<<c.first<<endl;
      return 0;
    }
  }
  cout<<"None"<<endl;
  
}
///////////////////////////

Measured memory_bytes: 512
#include <stdio.h>

int main(void){
	int m,f,r,x;
	char a;
	
	
	while(1){
		scanf("%d %d %d",&m,&f,&r);
		x=m+f;
		
		if(m==-1 && f==-1 && r==-1){
			break;
		}else if(m==-1 || f==-1 || x<30){
			a='F';
			printf("%c\n",a);
		}else if(80<=x){
			a='A';
			printf("%c\n",a);
		}else if(65<=x && x<80){
			a='B';
			printf("%c\n",a);
		}else if(50<=x && x<65){
			a='C';
			printf("%c\n",a);
		}else if(30<=x && x<50){
			if(50<=r){
				a='C';
				printf("%c\n",a);
				}else{
				a='D';
				printf("%c\n",a);
				}
		}
	}
	return 0;
}


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

#define INF 1e9
using namespace std;
typedef long long ll;

int main() {

    int a, b; cin >> a >> b;

    if (a % 3 == 0 || b % 3 == 0 || (a+b) % 3 == 0) {
        puts("Possible");
    } else {
        puts("Impossible");
    }
}

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

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

using namespace std;
int main(){
	vector<int>Term(4);
	int num;
	cin >> num;
	rep(i, 4) {
		Term[3-i] = num % 10;
		num /= 10;
	}
	string ans = to_string(Term[0]);
	for (int tmp = 0; tmp < (1 << 3); tmp++) {	//演算子が入りうるすべての場所をbitで表現
		bitset<3>bit(tmp);	//取りうる最大のbit数　<>内は定数不可
		num = Term[0];
		rep(i, 3) {
			if (tmp & (4 >> i)) {
				num += Term[i+1] * (-1);
			}
			else {
				num += Term[i+1];
			}
		}
		if (num == 7) {
			rep(i, 3) {
				if (tmp & (4 >> i)) {
					ans += "-" + to_string(Term[i+1]);
				}
				else {
					ans += "+" + to_string(Term[i+1]);
				}
			}
			break;
		}
	}
	cout << ans << "=7" << endl;
}


Measured memory_bytes: 256
#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream> 
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <unordered_map>  
using namespace std;
#define eps 0.00000001
#define LONG_INF 10000000000000000
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define REP(i,n) for(long long i = 0;i < n;++i)
int main() {
	string n;
	cin >> n;
	if (n[0] == n[2]) {
		cout << "Yes" << endl;
	}
	else cout << "No" << endl;
}

Measured memory_bytes: 760
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <string>

using namespace std;

int main() {
    int n, m;
    map <string, int> mp;
    cin >> n;
    for(int i = 0; i < n; i++){
        string st;
        cin >> st;
        mp[st]++;
    }

    cin >> m;
    for(int i = 0; i < m; i++){
        string st;
        cin >> st;
        mp[st]--;
    }
    int Max = 0;
    for(auto x : mp){
        Max = max(x.second, Max); 
    }
    if(Max < 0){
        cout << "0" << endl;
    }else{
        cout << Max << endl;
    }
}

Measured memory_bytes: 256
#include <stdio.h>

int main(int argc,char* argv[]){
  int w,i,first_time;

  while(scanf("%d",&w) != EOF){
    for(i = 1,first_time = 0;i < (1 << 10);i *= 2){
      if(w & i){
	if(first_time == 0){
	  first_time = 1;
	  printf("%d",i);
	}else{
	  printf(" %d",i);
	}
      }
    }
    printf("\n");
  }
  
  return 0;
  
}

Measured memory_bytes: 0
NIL = -1


class Node():
  def __init__(self, nid):
    self.nid = nid
    self.parent = -1
    self.left = self.right = None
    self.depth = None

  def __str__(self):

    template = "node {}: parent = {}, depth = {}, {}, {}"
    if self.parent == -1:
      ntype = "root"
    elif self.left is None:
      ntype = "leaf"
    else:
      ntype = "internal node"

    children = self.get_childs()
    chidlren = ", ".join(map(str,children))
    parend_id = self.parent.nid if self.parent != -1 else -1
    return template.format(
      self.nid, parend_id, self.depth, ntype, children
    )
  
  def get_childs(self):
    c = self.left
    children = []
    while c is not None:
      children.append(c.nid)
      c = c.right
    return children
  
      


def set_depth(node, p):
  node.depth = p
  if node.right is not None:
    set_depth(node.right, p)
  if node.left is not None:
    set_depth(node.left, p+1)

def main():
  n = int(input())
  T = [Node(i) for i in range(n)]
  for i in range(n):
    tmp = list(map(int, input().split()))
    nid = tmp[0]
    k = tmp[1]
    c = tmp[2:]
    if len(c) == 0:
      continue
    T[nid].left = T[c[0]]
    for idx in c:
      T[idx].parent = T[nid]
    for j in range(k-1):
      T[c[j]].right = T[c[j+1]]
  for i in range(n):
    if T[i].parent == -1:
      break
  set_depth(T[i], 0)
  for x in T:
    print(x)



if __name__ == "__main__":
    import io, sys
    sys.setrecursionlimit(200000)
    main()


Measured memory_bytes: 125780
#include <bits/stdc++.h>
    using namespace std;
    typedef long long ll;
    #define FAST ios_base::sync_with_stdio(false);cin.tie(0);
    const double EPS = 1e-9;
    const double PI = acos(-1);
    const int knightDir[8][2] = {{-2,-1},{-2,1},{-1,2},{1,2},{2,-1},{2,1},{-1,-2},{1,-2}};
    //const int dx[]={0,0,0,1,1,1,-1,-1,-1};
    //const int dy[]={-1,0,1,-1,0,1,-1,0,1};
    const int dx[] = {0 , 1 , 0 , -1};
    const int dy[] = {1 , 0 , -1 , 0};
    const int MAX  = 1e7 + 5;
    const ll MOD = 1000000000 + 7;

    ll f[MAX];
    void sieve(int n)
    {
        for(int i = 1 ; i <= n ; i++)
        {
            for(int j = i ; j <= n ; j += i)
            {
                f[j]++;
            }
        }
    }
    int main()
    {
        FAST
        int t;
        t = 1;
        
       
        while(t--)
        {
           int n;
           cin >> n;
           
           sieve(n);
           
           ll sum = 0;
           for(int i = 1 ; i <= n ; i++)
           {
               sum += i * f[i];
           }
           
           cout << sum << endl;
        }
    }



Measured memory_bytes: 81752
/**
 *  author: MahfuzAhmed
 *  created: 26.08.2019
**/

#include <bits/stdc++.h>
using namespace std;
#define debug(x) cout << '>' << #x << ':' << x << endl;
//~ const double pi = 2*acos(0.0);
//~ const long long mod = 1e9+7;
//~ const int max_n = 1e6+5;
typedef long long ll;

int n;
int arr[55];

bool check(){
    
    for(int i=0; i<n-1; i++){
        if(arr[i] > arr[i+1])
            return false;
    }
    
    return true;    
}




int main(int argc, char* argv[]){
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
       
    #ifdef _DEBUG
    freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    #endif
    
    
    cin >> n;
    
    for(int i=0;i<n;i++)
        cin >> arr[i];
    
    if(check()){
        cout << "YES\n";
        return 0;
    }
    
    
    for(int i=0; i<n; i++){
        for(int j=0; j<n; j++){
            swap(arr[i], arr[j]);
            
            if(check()){
                cout << "YES\n";
                return 0;
            }
            
            swap(arr[i], arr[j]);
        }
    }
    
    cout << "NO\n";
    
    return 0;
}

Measured memory_bytes: 256