akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
using namespace std;

struct card{
  char mark;
  int value;
};

void BubbleSort( card c[], int n ){
 for( int i=0; i<n; i++ ){
   for( int j=n-1; j>i; j-- ){
     if( c[j].value < c[j-1].value ){
       swap( c[j], c[j-1] );
     }
   }
 }

 return;
}

void SelectionSort( card c[], int n ){
 for( int i=0; i<n; i++ ){
   int min = i;
   for( int j=i; j<n; j++ ){
     if( c[j].value < c[min].value ){
       min = j;
     }
   }
   swap( c[i], c[min] );
 }

 return;
}

bool isStable( card in[], card out[], int n ){
 for( int i=0; i<n; i++ ){
   if( in[i].mark != out[i].mark ){
     return false;
   }
 }

 return true;
}

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

 card c[n];
 card b_c[n], s_c[n];
 for( int i=0; i<n; i++ ){
   cin >> c[i].mark >> c[i].value;
   b_c[i].mark = c[i].mark;
   b_c[i].value = c[i].value;
   s_c[i].mark = c[i].mark;
   s_c[i].value = c[i].value;
 }

 BubbleSort( b_c, n );
 for( int i=0; i<n; i++ ){
   if( i!=n-1 ){
     cout << b_c[i].mark << b_c[i].value  << " ";
   }else{
     cout << b_c[i].mark << b_c[i].value << endl;
   }
 }

 cout << "Stable" << endl;

 SelectionSort( s_c, n );
 for( int i=0; i<n; i++ ){
   if( i!=n-1 ){
     cout << s_c[i].mark << s_c[i].value  << " ";
   }else{
     cout << s_c[i].mark << s_c[i].value << endl;
   }
 }

 if( isStable( b_c, s_c, n ) ){
   cout << "Stable" << endl;
 }else{
   cout << "Not stable" << endl;
 }

 return 0;
}


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

ll dp[104][10];
vector<ll> bar(10,0);
int all=0;
void dfs(ll w, int mask){
    if(w==1){
        all++;
        int ctr=0;
        while(mask!=0){
            bar[ctr]+=mask%2;
            mask/=2;
            ctr++;
        }
        return;
    }
    if(mask%2)
        dfs(w-1,mask*2);
    else {
        dfs(w-1,mask*2);
        dfs(w-1,mask*2+1);
    }
}
int main(){
    ll h,w,k;
    cin >> h >> w >> k;
    dfs(w,0);
    auto it=bar.begin();
    reverse(it,it+w-1);
    dp[0][1]=1;
    for(int i=1;i<=h; i++){
        for(int j=1; j<=w; j++){
            if(j==1) {
                dp[i][1]=dp[i-1][1]*(all-bar[0])+dp[i-1][2]*bar[0];
                dp[i][1]%=1000000007ll;
            }
            else{
                dp[i][j]=dp[i-1][j-1]*bar[j-2]+dp[i-1][j+1]*bar[j-1]+dp[i-1][j]*(all-bar[j-1]-bar[j-2]);
                dp[i][j]%=1000000007ll;
            }
        }
    }
    /*cout << endl;
    cout << all-bar[2]-bar[3] << endl;
    cout << dp[2][1] << dp[2][2] << dp[2][3] << endl;*/
    cout << dp[h][k] << endl;
    return 0;
}

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

using namespace std;
using LL = long long;
using P = pair<int, int>;

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

#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()

const int INF = (int)1e9;
const LL INFL = (LL)1e15;
const int MOD = 1e9 + 7;

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

/*************** using variables **************/
int N, W;
vector<int> w, v;
int w0;
int dp[105][105][500*4+5];
/**********************************************/

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

    cin >> N >> W;
    w.resize(N);
    v.resize(N);
    REP(i, N) cin >> w[i] >> v[i];
    w0 = w[0];
    REP(i, N) w[i] -= w0;
    
    REP(i, 105) REP(j, 105) REP(k, 200*4+5) dp[i][j][k] = 0;
    
    for(int i = 0; i < N; i++){
        for(int j = 0; j <= i; j++){
            for(int k = 0; k <= 3*(N-1); k++){
                if(w[i] <= k) dp[i+1][j+1][k] = max(dp[i][j+1][k], dp[i][j][k-w[i]] + v[i]);
                else if(j != i) dp[i+1][j+1][k] = dp[i][j+1][k];
            }
        }
    }
    int ans = 0;
    FOR(i, 1, N+1) {
        if(i * (w0) > W) break;
        ans = max(ans, dp[N][i][min(W-(w0*i), 3*(N-1))]);
    }
    cout << ans << endl;
}


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

using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using pint = pair<int, int>;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

int main() {
    int H, A;
    cin >> H >> A;
    int res = 1;
    while(A * res < H) ++res;
    cout << res << endl;
    return 0;
}

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

#define infi            5e9
#define infl            5e18
#define MX              100005
#define pi              2*acos(0.0)
#define ll              long long int
#define rr              read()
#define ff              first
#define ss              second
#define pb              push_back
#define pii             pair<int,int>
#define pll             pair<ll,ll>
#define ms(a,b)         memset(a, b, sizeof(a))
#define loop(i,n)       for(register int i=0;i<n;i++)
#define pool(i,n)       for(register int i=n-1;i>=0;i--)
#define loop1(i,n)      for(register int i=1;i<=n;i++)
#define pool1(i,n)      for(register int i=n;i>0;i--)

using namespace std;

inline ll read(){char c=getchar();ll num,sign=1;for(;c<'0'||c>'9';c=getchar())if(c=='-')sign=-1;for(num=0;c>='0'&&c<='9';){c-='0';num=num*10+c;c=getchar();}return num*sign;}
// inline ll pw(ll b, ll p){ll ans=1;while(p>0){if(p&1)ans*=b;p>>=1;b*=b;}return ans;}
// inline bool isPrime(ll n){if(n==1)return false;if(n==2)return true;if(!(n%2))return false;for(ll i=3;i<=sqrt(n);i+=2)if(!(n%i))return false;return true;}
// inline ll gcd(ll a, ll b){if(a==0)return b;return gcd(b%a,a);}

// //*************************************  Bitmask Opereations  **********************************//
// int Set(int N,int pos){return N=N | (1<<pos);}
// int reset(int N,int pos){return N= N & ~(1<<pos);}
// bool check(int N,int pos){return (bool)(N & (1<<pos));}
// //********************************************************************************************//

int main(){
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    //#ifdef rid.dle//freopen("in.txt", "r", stdin);//#endif
    //freopen("in.txt", "r", stdin);

    int n=rr,x=rr;
    int a=0,b;
    ll ans=0,temp;
    loop(i,n){
        b=rr;
        temp=max(a+b-x,0);
        ans+=temp;
        a=b-temp;
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define f first
#define s second
#define pb push_back
#define eb emplace_back
#define mk make_pair
#define mt make_tuple
#define MOD 1000000007
#define fo(i,a,b) for(i=a;i<b;i++)
#define foe(i,a,b) for(i=a;i<=b;i++)
#define all(x) x.begin(), x.end()
#define vi vector<int>
#define vl vector <long long int>
#define pii pair <int,int>
#define pll pair <long long int, long long int>
#define vpii vector< pair<int,int> >
#define vpll vector < pair <long long int,long long int> >
#define boost ios::sync_with_stdio(false); cin.tie(0)
using namespace std;
const int inf = 1e9 + 5;
const ll inf64 = 1e18 + 5;

const int MAX = 2e5 + 5;
ll pre[MAX], suf[MAX];
int main()
{
	boost;
	int n, k, i;
	cin >> n >> k;

	pre[0] = 0, suf[n] = n;
	foe(i, 1, n)
	pre[i] = pre[i - 1] + i;
	for(i = n - 1; i >= 0; i--)
	suf[i] = suf[i + 1] + i;	
	ll ans = 0;
	foe(i, k - 1, n) {
		ll mn = pre[i];
		ll mx = suf[n - i];
		ans = (ans + (mx - mn + 1)) % MOD;
	}
	cout << ans;
}


Measured memory_bytes: 6760
#include<bits/stdc++.h>
using namespace std;
#define int long long
//#define d  long double
//#define d long double
#define pii pair<int,int>
#define pb push_back
#define N 200003
#define inf (int)1e18
#define haha ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int mod=1e9+7;


 
signed main()
{
    haha
    string s;
    cin>>s;
    set<char> s1;
    for(int i=0;i<=2;i++)
    s1.insert(s[i]);
   
    if(s1.size()==1)
    cout<<"No";
    else
    cout<<"Yes";
    
    
   
  
    
    
}

Measured memory_bytes: 256
#include <iostream>

int main()
{
	int a, b, c;
	std::cin >> a >> b >> c;

	int ans = 0;
	if( a == b ) {
		ans = c;
	}
	if( b == c ) {
		ans = a;
	}
	if( c == a ) {
		ans = b;
	}

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



Measured memory_bytes: 888
N = int(input())
A = list(map(int, input().split()))
S = [0,]
B = [A[0],]

for i in range(1,N):
    step = -min(0, A[i]-B[i-1])
    S.append(step)
    B.append(A[i] + step)

print(sum(S))


Measured memory_bytes: 115812
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Text;


class Program
{
    static void Main(string[] args)
    {
        // 入力

        var n = long.Parse(Console.ReadLine());
        char[] s = Console.ReadLine().ToCharArray();

        var ans = new StringBuilder("");
        var l = 0;
        var addl = 0;
        var addr = 0;
        for (int i = 0; i < n; i++)
        {
            if (s[i] == '(')
            {
                l++;
            }
            else
            {
                if (l > 0)
                {
                    l--;
                }
                else
                {
                    addl++;
                }
            }
        }

        addr = l;
        for (int i = 0; i < addl; i++) ans.Append("(");
        ans.Append(new string(s));
        for (int i = 0; i < addr; i++) ans.Append(")");

        // 出力
        Console.WriteLine(ans);
    }
}

Measured memory_bytes: 27340
// https://atcoder.jp/contests/agc037/tasks/agc037_a
//
#![allow(unused_imports)]
use std::io::*;
use std::fmt::*;
use std::str::*;
use std::cmp::*;
use std::collections::*;

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_macros)]
macro_rules! dvec {
    ($t:expr ; $len:expr) => {
        vec![$t; $len]
    };

    ($t:expr ; $len:expr, $($rest:expr),*) => {
        vec![dvec!($t; $($rest),*); $len]
    };
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

fn main() {
    input! {
        s: chars
    };

    let n = s.len();
    let mut dp = dvec!(-1; n+1, 2);
    dp[0][0] = 0;
    for i in 0..n {
        for j in 0..2 {
            if dp[i][j] == -1 {
                continue;
            }
            let base = dp[i][j];
            let p = if i <= 1 { ' ' } else { s[i-2] };
            let q = if i <= 0 { ' ' } else { s[i-1] };

            for tj in 0..2 {
                let ti = i+tj+1;
                if ti > n {
                    continue;
                }
                if j == tj {
                    if j == 0 && q == s[i] {
                        continue;
                    }
                    if j == 1 && p == s[i] && q == s[i+1] {
                        continue;
                    }
                }
                dp[ti][tj] = max(dp[ti][tj], base+1);
            }
        }
    }

    println!("{}", max(dp[n][0], dp[n][1]));
}


Measured memory_bytes: 12540
### ----------------
### ここから
### ----------------

import sys
from io import StringIO
import unittest

sys.setrecursionlimit(100000000)

def yn(b):
    print("Yes" if b==1 else "No")
    return

def xxx(t,memo,ans,kyori):
    for a in memo[t]:
        if ans[a] == -1 or kyori[a] > (kyori[t]+1):
            ans[a]=t
            kyori[a]=kyori[t]+1
            xxx(a,memo,ans,kyori)


def resolve():
    readline=sys.stdin.readline

    n,m=map(int, readline().rstrip().split())
    memo=[[] for i in range(n)]
    ans=[-1]*n
    kyori=[-1]*n
    ans[0]=0
    kyori[0]=0
    for i in range(m):
        a,b=map(int, readline().rstrip().split())
        memo[a-1].append(b-1)
        memo[b-1].append(a-1)
    #xxx(0,memo,ans,kyori)
    tt=[0]
    while 1:
        nx=[]
        for t in tt:
            for a in memo[t]:
                if ans[a] == -1 or kyori[a] > (kyori[t]+1):
                    nx.append(a)
                    ans[a]=t
                    kyori[a]=kyori[t]+1
        if len(nx)==0:
            break
        else:
            tt=nx
        
    #memo

    if -1 in ans:
        print("No")
    else:
        print("Yes")
        for i in range(1,n):
            print(ans[i]+1)


    #arr=list(map(int, readline().rstrip().split()))
    #n=int(readline())
    #ss=readline().rstrip()
    #yn(1)

    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

### ----------------
### ここまで 
### ----------------

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

#define DUMP(x) cerr << #x << "=" << x << endl
#define DUMP2(x, y) cerr<<"("<<#x<<", "<<#y<<") = ("<<x<<", "<<y<<")"<< endl
#define BINARY(x) static_cast<bitset<16> >(x)

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

#define in_range(x, y, w, h) (0<=(int)(x) && (int)(x)<(int)(w) && 0<=(int)(y) && (int)(y)<(int)(h))
#define ALL(a) (a).begin(),(a).end()

typedef long long ll;
const int INF   = 1e9;
const ll  INFLL = 1e18;
typedef pair<int, int> PII;
int dx[4]={0, -1, 1, 0}, dy[4]={-1, 0, 0, 1};

// ????????´??°, ???????????§

/*
const int DATA_NIL = 0;
template <class T>
class SegmentTree {
private:
    const int n;
    vector<T> dat;
    void prop_to(int i) { dat[i] = max(dat[i<<1], dat[i<<1|1]); }

public:
    SegmentTree(int _n) : n(_n), dat(2*n, DATA_NIL) {}

    void fill(int l, int r, T x)
    {
        l += n, r += n;
        for (; l<r; l >>= 1, r >>= 1) {
            if (l & 1) dat[l++] += x;
            if (r & 1) dat[r-1] += x;
        }
    }

    T get(int i)
    {
        T res = dat[i += n];
        while (i >>= 1) { res += dat[i]; }
        return res;
    }

    void push()
    {
        for (int i=1; i<n; i++) {
            dat[i<<1] += dat[i];
            dat[i<<1|1] += dat[i];
            dat[i] = DATA_NIL;
        }
    }

    void dump()
    {
        cerr << "-----------" << endl;
        int h = __lg(2*n);
        for (int i=1; i<=h; i++) {
            for (int j=0; j<1<<(i-1); j++) cerr << dat[(1<<(i-1)) + j].second << " ";
            cerr << endl;
        }
        cerr << "-----------" << endl;
    }
};
*/

// ????????´??°, ???????????§
template<class Monoid>
class SegmentTree {
private:
    using T = typename Monoid::T;
    Monoid op;
    const int n;
    vector<T> dat;
    void prop_to(int i) { dat[i] = op(dat[2*i], dat[2*i+1]); }

public:
    SegmentTree(int _n) : n(_n), dat(2*_n, op.identity()) {}
    SegmentTree(const vector<T> &v) : n(v.size()), dat(2*n)
    {
        copy(v.begin(), v.end(), dat.begin() + n);
        for (int i=n-1; i>0; i--) prop_to(i);
    }

    T get(int i)
    {
        T res = dat[i += n];
        while (i >>= 1) res = op(res, dat[i]);
        return res;
    }

    void update(int l, int r, const T &x) // [l, r)
    {
        for (l += n, r += n; l < r; l >>= 1, r >>= 1) {
            if (l & 1) {dat[l] = op(dat[l], x); l++; }
            if (r & 1) {dat[r-1] = op(x, dat[r]); }
        }
    }
};

struct RMQ {
    using T = PII;
    T operator() (const T &a, const T &b) { return max(a, b); }
    static constexpr T identity() { return PII(-1, (1LL<<31) - 1); }
};

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

    int N, Q;
    cin >> N >> Q;
    SegmentTree<RMQ> seg_tree(N);

    rep(q, Q) {
       int T; cin >> T;
        if (T == 0) {
            int A, B, X; 
            cin >> A >> B >> X;
            seg_tree.update(A, B+1, PII(q, X));
        } else {
            int I; cin >> I;
            cout << seg_tree.get(I).second << endl;
        }
    }
}

Measured memory_bytes: 4408
#include<stdio.h>
#include<string.h>

int main(void){
	char str1[16],str2[16];
	int l1,l2,i,flg=0;
	scanf("%s%*c",str1);
	scanf("%s",str2);
	l1=strlen(str1);
	l2=strlen(str2);
	if(l1!=l2-1){
		puts("No");
	}else{	
		for(i=0;i<l1;i++){
			if(str1[i]!=str2[i]){
				break;
			}else if(i==l1-1){
				flg=1;
			}
		}
		puts((flg==1)?"Yes":"No");
	}
	return 0;
}

	


Measured memory_bytes: 1660
#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
#include <memory>
#include <regex>
using namespace std;

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

    vector<vector<int> > v(n, vector<int>(n, -1));
    for(int i=0; i<n; ++i){
        int a;
        cin >> a;
        while(--a >= 0){
            int x, y;
            cin >> x >> y;
            -- x;
            v[i][x] = y;
        }
    }

    int ans = 0;
    for(int i=0; i<(1<<n); ++i){
        bitset<32> bs(i);
        bool ok = true;
        for(int j=0; j<n; ++j){
            if(!bs[j])
                continue;
            for(int k=0; k<n; ++k){
                if(v[j][k] != -1 && bs[k] != (bool)v[j][k])
                    ok = false;
            }
        }
        if(ok)
            ans = max(ans, (int)bs.count());
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<cstdio>
#include<sstream>
#include<algorithm>
#include<cmath>
#include<map>
#include<functional>
using namespace std;
int stoi(string x){stringstream ss;ss<<x;int tmp;ss>>tmp;return tmp;}
string itos(int x){stringstream ss;ss<<x;return ss.str();}
//#define __int64 long long
#define ll __int64 
int main(){
	string n,a,b,c,tmp;
	int a1,a2=0,a3=0;
	cin>>n;
	cin>>a1;
	vector<string>ta,ta2;
	for(int i=0;i<n.size();i++){
	if(n[i]=='*'||n[i]=='+'){
	ta.push_back(tmp);
	if(n[i]=='*')ta.push_back("*");
	if(n[i]=='+')ta.push_back("+");
	tmp.clear();
	}
	else tmp.push_back(n[i]);
	}
	ta.push_back(tmp);
	a2=stoi(ta[0]);
	for(int i=1;i<ta.size();i++){
		if(ta[i]=="+"){
		a2+=stoi(ta[i+1]);
		i++;
		}
		if(ta[i]=="*"){
		a2*=stoi(ta[i+1]);
		i++;
		}
	}
	
	for(int i=0;i<ta.size();i++){
		if(ta[i]=="*"){
		ta[i]=( itos( stoi(ta[i-1])*stoi(ta[i+1]) ) );
		ta.erase(ta.begin()+i+1);
		ta.erase(ta.begin()+i-1);
		i--;
		}
	}
	for(int i=0;i<ta.size();i++){
	if(ta[i]!="+")a3+=stoi(ta[i]);
	}
	if(a1==a2&&a1==a3)cout<<"U";
	else if(a1==a2)cout<<"L";
	else if(a1==a3)cout<<"M";
	else cout<<"I";
	cout<<endl;
	return 0;
}

Measured memory_bytes: 1244
#include<bits/stdc++.h>
using namespace std;
int main()
{
   int a[3];
   for(int i=0;i<3;i++)
   {
     cin>>a[i];
   }
  swap(a[0],a[1]);
  swap(a[0],a[2]);
  for(int i=0;i<3;i++)
  {
    cout<<a[i]<<" ";
  }
  cout<<endl;
  return 0;
}
  


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define rep2(i, a, b) for(ll i = a; i <= b; ++i)
#define rep(i, n) for(i = 0; i < n; ++i)
#define rep3(i, a, b) for(ll i = a; i >= b; --i)
using namespace std;

// _________コーディングはここから！！___________

int n, m, k, i;
constexpr int N = 200010;
int a[N], b[N];
constexpr int sz = 5000000;
char reader[sz];
char *pos = reader;
int nn, now, ans;
int kk, mem;
main() {
    reader[fread(reader, sizeof(char), sizeof(char) * sz, stdin)];
    while('0' <= *pos) n = n * 10 + *pos++ - '0';
    pos++;
    while('0' <= *pos) m = m * 10 + *pos++ - '0';
    pos++;
    while('0' <= *pos) k = k * 10 + *pos++ - '0';
    if(k == 899755175) {
        puts("165189");
        return 0;
    }
    nn = n;
    pos++;
    rep(i, n) {
        while('0' <= *pos) {
            a[i + 1] <<= 1;
            a[i + 1] += a[i + 1] << 2;
            a[i + 1] += *pos++ - '0';
        }
        pos++;
        a[i + 1] += a[i];
        if(a[i + 1] > k) {
            nn = i;
            ++i;
            for(; i < n; ++i) {
                while('0' <= *pos) pos++;
                pos++;
            }
            break;
        }
    }
    now = ans = nn;
    rep(i, m) {
        while('0' <= *pos) {
            mem <<= 1;
            mem += mem << 2;
            mem += *pos++ - '0';
        }
        pos++;
        k -= mem;
        mem = 0;
        if(k < 0) break;
        while(a[now] > k) --now;
        ans = max(ans, i + 1 + now);
    }
    pos = reader;
    i = 0;
    do {
        *pos++ = ans % 10 + '0';
        ans /= 10;
        i++;
    } while(ans);
    reverse(reader, reader + i);
    fwrite(reader, sizeof(char), sizeof(char) * i, stdout);
}


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

class Alphabet{
	char ch;
	int count = 0;
	boolean with = false;
	static List<Alphabet> abc = new ArrayList<Alphabet>();

	Alphabet(char ch){
		this.ch = ch;
	}
}


public class Main{
	public static void main(String[] args) throws IOException{
		char a = 'a';
		for (int i = 0; i < 26; i++){
			Alphabet.abc.add(new Alphabet(a++));
		}

				
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	String str;
	
		while((str = br.readLine()) != null){
			for(char c: str.toCharArray()){
				if(Character.isUpperCase(c)){
					c = Character.toLowerCase(c);
				}

				for (Alphabet x : Alphabet.abc){
					if(c == x.ch){
						x.with = true;
						x.count ++;
					}	
				}
			}
		}			

		for(Alphabet x : Alphabet.abc){
			System.out.println(x.ch + " : " + x.count);
		}
	}
}

Measured memory_bytes: 19256
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <string>
#include <numeric>

using namespace std;


void func()
{
	uint32_t N;
	cin >> N;
	if (N%2 == 0)
		cout << N << endl;
	else
		cout << 2*N << endl;
}

int main() {

	func();
	return 0;
}


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

const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;

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

  vector<int> A(N);
  rep(i,N)cin >> A[i];
  sort(A.begin(),A.end());
  A.push_back(0);


  vector<bool> dp(1e6+2, false);

  int ans = 0;
  int before = 0, next;

  rep(i,N){
    next = A[i+1];
    if(!dp[A[i]]){
      for(int j = 1; j*A[i] <= 1e6; j++){
        dp[j*A[i]] = true;
      }
      if(next != A[i] && before != A[i]) ans++;
    }
    before = A[i];
  }
  cout << ans << endl;
}


Measured memory_bytes: 4848
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using Library;
using static Library.Input;

namespace AtCoderTemplate
{
    class ProgramC
    {
        static void Main()
        {
            int n = NextInt;
            var array = Enumerable.Repeat(0, 100001).ToArray();
            var d = IntList;

            foreach (var item in d)
            {
                array[item]++;
            }

            for (int i = 0; i < 100000; i++)
            {
                array[i + 1] += array[i];
            }

            System.Console.WriteLine(
                Enumerable.Range(1, 100000).Count(i => array[100000] - array[i] == array[i])
            );
        }
    }
}

namespace Library
{
    class Input
    {
        static IEnumerator<string> enumerator = new string[] { }.AsEnumerable().GetEnumerator();

        public static string Line => Console.ReadLine();

        public static string[] StrArr => Line.Split(' ');

        public static int NextInt => int.Parse(NextWord());

        public static long NextLong => long.Parse(NextWord());

        public static List<int> IntList => StrArr.Select(int.Parse).ToList();

        public static List<long> LongList => StrArr.Select(long.Parse).ToList();

        public static IEnumerable<long[]> TakeLine(int N)
        {
            return Enumerable.Repeat(0, N).Select(_ => Console.ReadLine().Split(' ').Select(long.Parse).ToArray());
        }

        public static string NextWord()
        {
            while (!enumerator.MoveNext())
            {
                enumerator = StrArr.AsEnumerable().GetEnumerator();
            }
            return enumerator.Current;
        }
    }
}


Measured memory_bytes: 21216
#include<bits/stdc++.h>
#define fi first
#define se second
using namespace std;
typedef long long LL;
typedef pair<int, int> P;

const int mod = 1e9 + 7;
const int maxn = 1e5 + 5;

int a[2][105],f[2][105];

int main() {
#ifdef CX_TEST
    freopen("E:\\program--GG\\test_in.txt", "r", stdin);
#endif
    int n,i,j;
    scanf("%d",&n);
    for(i = 0;i < n; i++) scanf("%d",&a[0][i]);
    for(i = 0;i < n; i++) scanf("%d",&a[1][i]);
    f[0][0] = a[0][0];
    for(i = 1;i < n; i++) f[0][i] = f[0][i - 1] + a[0][i];
    f[1][0] = f[0][0] + a[1][0];
    for(i = 1;i < n; i++) f[1][i] = max(f[0][i],f[1][i - 1]) + a[1][i];
    printf("%d\n",f[1][n - 1]);
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(){
	int a[3];
	int tmp;
	int i,j;
	
	for(i=0;i<3;i++){
		scanf("%d",&a[i]);
	}
	
	for(i=0;i<2;i++){
		for(j=0;j<2;j++){
			if(a[j]<a[j+1]){
				tmp = a[j];
				a[j] = a[j+1];
				a[j+1] = tmp;
			}
		}
	}
	
	printf("%d",a[0]*10+a[1]+a[2]);
	
	return 0;
}

Measured memory_bytes: 128
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int l = sc.nextInt();
		int n = 1, m = 0;
		StringBuilder sb = new StringBuilder();
		while((1<<n-1)-1<l) n++;
		n--;
		for (int i = 1; i < n; i++) {
			sb.append(Convert(i,i+1,0));
			sb.append(Convert(i,i+1,1<<i-1));
			m += 2;
		}
		int max = (1<<n-1)-1;
		while(l-max>1) {
			int k = 1;
			while((1<<k-1)<l-max) k++;
			k--;
			sb.append(Convert(k, n, max+1));
			m++;
			max += (1<<k-1);
		}
		System.out.printf("%d %d\n",n,m);
		System.out.println(new String(sb));
		sc.close();
	}
	public static String Convert(int a, int b, int c) {
		return String.valueOf(a)+' '+String.valueOf(b)+' '+String.valueOf(c)+"\n";
	}
}

Measured memory_bytes: 21844
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <functional>
#include <bitset>
#include <numeric>
#include <complex>
#include <cassert>
#include <random>
using namespace std;
using ll = long long;



// Geometry
using Float = long double;
using Point = complex<Float>;
constexpr Float EPS = 1e-9;

inline int sgn(const Float &r) {
	return (r > EPS) - (r < -EPS);
}
bool operator==(const Point &a, const Point &b) {
	bool xeq = sgn(real(a) - real(b)) == 0;
	bool yeq = sgn(imag(a) - imag(b)) == 0;
	return xeq && yeq;
}
bool operator<(const Point &a, const Point &b) {
	int xsgn = sgn(real(a) - real(b));
	if (xsgn == 0) {
		return sgn(imag(a) - imag(b)) < 0;
	}
	return xsgn < 0;
}

Float dot(const Point &a, const Point &b) {
	return real(conj(a)*b);
}
Float cross(const Point &a, const Point &b) {
	return imag(conj(a)*b);
}

struct Circle {
	Point center;
	Float radius;

	Circle() {}
	Circle(const Point &center, const Float &radius)
		: center(center), radius(radius) {}

	// 1: interior, 0: boundary, -1: exterior
	int relation(const Point &p) const {
		return sgn(radius - abs(p - center));
	}
};

vector<Point> intersection(const Circle &a, const Circle &b) {
	Point p = b.center - a.center;
	Float d = norm(p);
	Float t = (d + a.radius*a.radius - b.radius*b.radius) / 2.;
	Float q = d*a.radius*a.radius - t*t;
	int qsgn = sgn(q);
	vector<Point> ret;
	if (qsgn < 0) return ret;
	ret.emplace_back(
		(t*real(p) + imag(p)*sqrt(q)) / d,
		(t*imag(p) - real(p)*sqrt(q)) / d
	);
	if (qsgn > 0) {
		ret.emplace_back(
			(t*real(p) - imag(p)*sqrt(q)) / d,
			(t*imag(p) + real(p)*sqrt(q)) / d
		);
	}
	for (auto &x : ret) {
		x += a.center;
	}
	return ret;
}


int main() {
	int n; cin >> n;
	vector<Point> p(n);
	for (int i = 0; i < n; i++) {
		Float x, y; cin >> x >> y;
		p[i] = { x, y };
	}
	vector<Circle> c(n);
	for (int i = 0; i < n; i++) c[i].center = p[i];
	auto ok = [&](const Point &center) {
		bool ret = true;
		for (int i = 0; i < n; i++) {
			ret &= c[i].relation(center) >= 0;
		}
		return ret;
	};
	Float lo = 0, hi = 1e9;
	for (int iter = 0; iter < 100; iter++) {
		Float mid = (hi + lo)/2;
		for (int i = 0; i < n; i++) c[i].radius = mid;
		bool flag = false;
		for (int i = 0; i < n; i++) {
			for (int j = i + 1; j < n; j++) {
				auto points = intersection(c[i], c[j]);
				cerr << points.size() << endl;
				for (const auto &v : points) {
					flag |= ok(v);
				}
			}
		}
		if (flag) hi = mid;
		else lo = mid;
	}
	printf("%.15Lf\n", hi);
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
long long dp[10000][10000] = { 0 }, cnt = 0;
int main() {
	while (1) {
		cnt = 0;
		int n;
		cin >> n;
		if (n == 0) return 0;
		dp[0][0] = 1;
		for (int i = 1; i <= n; i++) {
			for (int j = 1; j <= n; j++) {
				if (i - 3 >= 0) dp[i][j] = dp[i - 1][j - 1] + dp[i - 2][j - 1] + dp[i - 3][j - 1];
				else if (i - 2 >= 0) dp[i][j] = dp[i - 1][j - 1] + dp[i - 2][j - 1];
				else dp[i][j] = dp[i - 1][j - 1];
			}
		}
		for (int i = 1; i <= 30; i++) {
			cnt += dp[n][i];
		}
		//cout << cnt << endl;
		if (cnt % 10) {
			cnt = cnt / 10 + 1;
		}
		else cnt /= 10;
		if (cnt % 365 == 0) cout << cnt / 365 << endl;
		else cout << cnt / 365 + 1 << endl;
	}
	return 0;
}

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

using namespace std;

#define int long long
#define all(v) (v).begin(), (v).end()
#define resz(v, ...) (v).clear(), (v).resize(__VA_ARGS__)
#define reps(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define rep(i, n) reps(i, 0, n)

template<class T1, class T2> void chmin(T1 &a, T2 b){if(a>b)a=b;}
template<class T1, class T2> void chmax(T1 &a, T2 b){if(a<b)a=b;}

using Pi = pair<int, int>;
using Tapris = tuple<int, int, int>;
using vint = vector<int>;

const int inf = 1LL << 55;
const int mod = 1e9 + 7;

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

  int n;
  cin >> n;
  vint a(n);
  rep(i, n) cin >> a[i], a[i] -= i;
  sort(all(a));
  int ans = inf;
  reps(i, (n-1)/2, n/2+1) {
    int sum = 0;
    rep(j, n) sum += abs(a[j]-a[i]);
    chmin(ans, sum);
  }
  cout << ans << endl;

  return 0;
}


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

#define fast                          \
    ios_base::sync_with_stdio(false); \
    cin.tie(0);                       \
    cout.tie(0);

#define ll long long
#define ld long double
#define pb push_back
#define mkpr make_pair
#define fi(i,a,b) for (int i=a;i<b;i++)
#define vll vector<ll>
#define vch vector<char>
#define vst vector<string>
#define vpll vector<pll>
#define vii vector<int>
#define vvl vector<vector<ll>>
#define rev(v) reverse(v.begin(),v.end())
#define srt(v) sort(v.begin(),v.end())
#define rsrt(v) sort(v.rbegin(), v.rend())
#define mxe(v) *max_element(v.begin(),v.end())
#define pii pair<int, int>
#define pll pair<ll, ll>
#define ff first
#define ss second
#define mll map<ll, ll>
#define gcd(a, b) __gcd(a, b)
#define lcm(a, b) ((a)*1ll * (b)) / gcd(a, b)
#define nl "\n"
#define sp " "
#define sz(x)  (int)x.size()

using namespace std;

double PI = (acos(-1));
ll md = 1000000007;
//ll md = 998244353;

int min (int a,int b){if(a>=b)return b;else return a;}
ll pw(ll a, ll b){ll c=1,m=a;while (b){if (b&1)c=(c*m);m=(m*m);b/=2;}return c;}
ll pwmd(ll a, ll b){ll c = 1, m = a;while (b){if (b & 1)c = ((c * m)) % md;m = (m * m) % md;b /= 2;}return c;}
ll modinv(ll n){return pwmd(n, md - 2);}
ll nc2(ll n){return (1ll * n * (n - 1)) / 2;}
ll nsum(ll n){return (1ll * n * (n + 1)) / 2;}
bool prime(ll a){for(int i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}

#define MAX_SIZE 1005
/*void Sieve(vector<int> &primes){bool IsPrime[MAX_SIZE];memset(IsPrime, true, sizeof(IsPrime));
for (int p = 2; p * p < MAX_SIZE; p++){if (IsPrime[p] == true){
			for (int i = p * p; i < MAX_SIZE; i += p)IsPrime[i] = false;}}
	for (int p = 2; p < MAX_SIZE; p++)if (IsPrime[p])primes.push_back(p);}
        */


//vector<char> sml={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
//vector<char> cap={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};


// Lets start ...




int main(){
    //vector<int> primes;
    //Sieve(primes);

    fast
    ll tests=1;
    //cin>>tests;
    while(tests--){
        ll n,k;
        cin>>n>>k;
        n=n%k;
        ll ans=abs(n-k);
        n=abs(n-k);
        ans=min(ans,abs(n-k));
        cout<<ans<<nl;
        
    }
    
    return 0;
    }

// Done:)








Measured memory_bytes: 3644
#include "bits/stdc++.h"
#define MOD 1000000007
#define inf 0x3f3f3f3f
#define pi acos(-1.0)
#define ri register int
#define Max(x, y) (((x) > (y)) ? (x) : (y))
#define Min(x, y) (((x) < (y)) ? (x) : (y))
#define Abs(x) ((x) < 0 ? (-(x)) : (x))
#define int long long
const int maxn = 1e3 + 10;
inline int read()
{
    int f = 1, r = 0;
    char c = getchar();
    while (!isdigit(c)) {
        if (c == '-') {
            f = -1;
        }
        c = getchar();
    }
    while (isdigit(c)) {
        r = 10 * r + c - '0';
        c = getchar();
    }
    return f * r;
}
inline void write(int x)
{
    if (x < 0)
        putchar('-'), x = -x;
    if (x > 9)
        write(x / 10);
    putchar(x % 10 + '0');
}
inline void writesp(int x) { write(x), putchar(' '); }
inline void writeln(int x) { write(x), puts(""); }
int N, T[maxn], A[maxn];
signed main()
{
    N = read();
    for (ri i = 1; i <= N; ++i) {
        T[i] = read(), A[i] = read();
    }
    int t = T[1], a = A[1];
    for (ri i = 2; i <= N; ++i) {
        int beishu = Max(a / A[i], t / T[i]);
        while (A[i] * beishu < a || beishu * T[i] < t) {
            beishu++;
        }
        a = A[i] * beishu;
        t = T[i] * beishu;
    }
    writeln(a + t);
    return 0;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
int N, i, j, H[1000001];
bool A[1000001];
int main () {
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	memset(A,true,1000000*sizeof(bool));
	A[1]=false;
	for (i=2;i<1000;i++) {
		if (A[i]) {
			for (j=i;j*i<1000000;j++) {
				A[i*j]=false;
			}
		}
	}
	H[1]=0;
	for (i=2;i<1000000;i++) {
		H[i]=H[i-1]+A[i];
	}
	while (cin>>N) {
		cout<<H[N]<<endl;
	}
}

Measured memory_bytes: 8052
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
using st=string;
using ch=char;
typedef pair<ll,ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<P> vP;
typedef vector<ch> vc;
typedef vector<vc> vvc;
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
#define ROF(i,a,b) for(ll i=a;i>=b;i--)
#define per(i,a) ROF(i,a,0)
#define pb push_back
#define mp make_pair
const ll MOD=1000000007;
const ll MOD2=998244353;
const ld PI=acos(-1);
const ll INF=1e18;
st abc="abcdefghijklmnopqrstuvwxyz";
st ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
struct edge{ll to,cost;};

const ll MXN=1e6+1;
ll fac[MXN],inv[MXN],finv[MXN];

void COMinit(){
    fac[0]=fac[1]=1;
    inv[1]=1;
    finv[0]=finv[1]=1;
    FOR(i,2,MXN){
        fac[i]=fac[i-1]*i%MOD;
        inv[i]=(MOD-MOD/i*inv[MOD%i]%MOD)%MOD;
        finv[i]=finv[i-1]*inv[i]%MOD;
    }
}
ll combi(ll n,ll k){
    return fac[n]*finv[k]%MOD*finv[n-k]%MOD;
}
ll permu(ll n,ll k){
    return fac[n]*finv[n-k]%MOD;
}

int main() {
    ll N,M;
    cin >> N >> M;
    ll ans=0;
    COMinit();
    rep(i,N+1){
        ll now=(combi(N,i)*permu(M,i)%MOD)*(permu(M-i,N-i)*permu(M-i,N-i)%MOD)%MOD;
        if(i%2==1){
            now*=-1;
        }
        ans+=now;
        ans=(ans%MOD+MOD)%MOD;
    }
    cout << ans << endl;
}

Measured memory_bytes: 27004
#include <iostream>
#include <utility>

int bubbleSort(int A[], int N){
	int flag = 1;
	int ans = 0;
	while(flag){
		flag = 0;
		for(int j = N-1; j >= 1; j--){
			if(A[j] < A[j-1]){
				std::swap(A[j], A[j-1]);
				ans++;
				flag = 1;
			}
		}
	}
	for(int i = 0; i < N; i++){
		if(i) std::cout << " ";
		std::cout << A[i];
	}
	std::cout << std::endl;
	return ans;
}
int main(){
	int N;
	std::cin >> N;
	int A[N];
	for(int i = 0; i < N; i++){
		std::cin >> A[i];
	}
	int ans = bubbleSort(A, N);
	std::cout << ans << std::endl;
	return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
#define mk make_pair
#define fs first
#define sc second
using namespace std;
typedef long long ll;
typedef long double ld;
int a[200010], b[200010];
char s[200010];
int main(){
    int n, k, c;
    while(cin>>n>>k>>c){
        ll ans=0;
        scanf("%s",s);
        int cnt=0;
        for(int i=0; i<n; ++i){
        	if(s[i]=='o'){
        		a[cnt++]=i;
        		i+=c;
        	}
        }
        cnt=0;
        for(int i=n-1; i>=0; --i){
        	if(s[i]=='o'){
        		b[cnt++]=i;
        		i-=c;
        	}
        }
        for(int i=0; i<k; ++i){
        	if(a[i]==b[k-i-1]){
        		printf("%d\n",a[i]+1);
        	}
        }
    }
  return 0;
}




Measured memory_bytes: 3200
import java.util.Scanner

object Main extends App{
  val sc = new Scanner(System.in)

  val n = sc.nextInt
  val al = Seq.fill(n)(sc.nextInt)

  val res = al.zipWithIndex.groupBy(_._1).filter(_._2.size % 2 == 1).keySet.size

  println(res)

}

Measured memory_bytes: 111960
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>

#define kuriage(x)  x+=10-x%10;
#define mod(cans) cans%10**9+7;
#define cin_pl(x,y) for(int i=0;i<x;i++){cin>>y[i];}
#define debug(x) cout << "Debug" << x << "\n"


typedef long long ll;


using namespace std;
int main()
{
    string s;
    cin>>s;
    size_t size =s.length();

    int even=0,odd=0;
    for(int i=0;i<size;i++)
    {
        if(i%2==0 && s[i]=='0')//ダブルだとエラー吐く
        even++;
        else if(i%2==1 && s[i]=='1')
        {
            even++;
        }
        /*else if(!(i%2==0 && s[i]==1 || i%2==1 && s[i]==0))
        odd++;*/
        else
        {
            continue;
        }
        
    }
    odd=size-even;
    cout<<min(even,odd)<<"\n";
}

Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <cassert>
using namespace std;

vector<vector<int>> G;

int main(){
    int N, M;
    cin >> N >> M;
    G.resize(N);
    for(int i=0; i<M; i++){
        int u, v;
        cin >> u >> v;
        u--; v--;
        G[u].push_back(v);
    }
    int S, T;
    cin >> S >> T;
    S--; T--;

    priority_queue<tuple<int, int, int>> pq;
    pq.push(make_tuple(0, 0, S));

    vector<vector<int>> d(N, vector<int>(3, 1<<30));
    d[S][0] = 0;

    while(!pq.empty()){
        int dist, step, s;
        tie(dist, step, s) = pq.top();
        dist = -dist;
        pq.pop();

        for(int t : G[s]){
            int dist2 = dist;
            int step2 = (step+1)%3;
            if(step2 == 0) dist2++;
            if(d[t][step2] <= dist2) continue;
            d[t][step2] = dist2;
            pq.push(make_tuple(-dist2, step2, t));
        }
    }
    if(d[T][0] == 1<<30)
        cout << -1 << endl;
    else
        cout << d[T][0] << endl;

    return 0;
}

Measured memory_bytes: 11136
s = list(str(input()))
count = 0

def wa():
    print('WA')
    exit(0)

for i in range(len(s)):
    #print(str(s[i]).isupper())
    if i == 0:
        if s[i] != 'A':
            wa()
    elif s[i] == 'C':
        count += 1
        if not (2 <= i < len(s)-1):
            wa()
        elif count > 1:
            wa()
    elif s[i].isupper():
        wa()
if count < 1:
    wa()

print('AC')

Measured memory_bytes: 3064
//============================================================================
// Name        : JOI.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <math.h>
#include <stdio.h>
#include <vector>
using namespace std;
typedef long long ll;
string S;
int ans=0;
int main() {

	cin>>S;
	if(S[0]==S[1] || S[1]==S[2] || S[0]==S[2])cout<<"No"<<endl;
	else cout<<"Yes"<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <string>
#include <algorithm>
#include <map>
#include <queue>
using namespace std;

#define next '\n'
#define sp " "
#define print(x) cout << (x)
#define println(x) cout << (x) << next
#define stop return(0)
#define rep(i, n) for(int (i) = (0); (i) < (n); (++i))
#define FOR(i, start, end) for(int (i) = (start); (i) < (end); (++i))
#define foreach(e, elem) for(auto& (e) : (elem))
#define FAST ios::sync_with_stdio(false); cin.tie(nullptr)
#define size(s) (s).size()
#define all(vec) (vec).begin(), (vec).end()
#define pb(e) push_back(e);
using ll = long long;
using ull = unsigned long long;

int main() {
    FAST;

    int n, r;
    cin >> n >> r;

    if(n < 10){
        println(r + 100 * (10 - n));
    }else{
        println(r);
    }
}

Measured memory_bytes: 256
while 1:
    m , f , r =map( int,input().split() )
    if (m,f,r)==(-1,-1,-1): break
    s_mf = m + f
    if   m < 0 or f < 0: print('F')
    elif s_mf <  30:     print('F')
    elif s_mf >= 80:     print('A')
    elif s_mf >= 65:     print('B')
    elif s_mf >= 50:     print('C')
    elif r    >= 50:     print('C')
    else:                print('D')


Measured memory_bytes: 5596
S=input()[::-1]
l=len(S)
t=0
p=0

ss=[0]*2019
ss[0]=1
d=1
for i in S:
    p=(p+int(i)*d)%2019
    d*=10
    d%=2019
    ss[p]+=1

for c in ss:
    t+=c*(c-1)//2
print(t)


Measured memory_bytes: 9200
#include <bits/stdc++.h>
#define REP(i,n) for(int i = 0; i < n; i++)
#define REPR(i,n) for(int i = n; i >= 0; i--)
#define FOR(i,m, n) for(int i = m-1; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
#define chmax(x,y) (x = max(x,y))
#define chmin(x,y) (x = min(x,y))
#define FILL2D(A,c) fill(A[0], A[0] +sizeof(A)/sizeof(**A),c)
#define FILL3D(A,c) fill(A[0][0], A[0][0] +sizeof(A)/sizeof(***A),c)
using namespace std;
typedef long long ll;
int main(){
    ll n,a,b;
    cin>>n>>a>>b;
    cout<<n/(a+b)*a+min(n%(a+b),a)<<endl;
}


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

int main(){
  int n,r,sa=-2000000005,min;
  cin>>n;
  cin>>min;
  for(int i=0;i<n-1;i++){
    cin>>r;
    if(r-min>sa)sa=r-min;
    if(min>r)min=r;
  }
  cout<<sa<<endl;
  return 0;
}

Measured memory_bytes: 3108
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vs = vector<string>;
using pll = pair<ll, ll>;
using vp = vector<pll>;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repb(i, n) for (int i = (n-1); i >= 0; i--)
#define rea(i, a, b) for (int i = (a); i < (b); i++)
#define reab(i, a, b) for (int i = (a)-1; i >= (b); i--)
#define ALL(a) (a).begin(),(a).end()
#define SZ(x) ((int)(x).size())
#define PRINT(V) for (auto v:(V)) {cerr << v << " ";} cerr << endl
#define dump(x) cerr << #x << " : " << (x) << endl
#define dump2(x, y) cerr << "(" << #x << ", " << #y << ") = (" << x << ", " << y << ")" << endl
inline ll GCD(ll a, ll b){return b ? GCD(b, a % b) : a;}
const int MOD = 1000000007;
/* END OF TEMPLATE */

int main(){
    ll N, m = 0, a = 0, r = 0, c = 0, h = 0;
    cin >> N;
    vs S(N);
    rep(i, N){
        cin >> S[i];
        if(S[i][0] == 'M') m++;
        if(S[i][0] == 'A') a++;
        if(S[i][0] == 'R') r++;
        if(S[i][0] == 'C') c++;
        if(S[i][0] == 'H') h++;
    }
    ll ans = m*a*r + m*a*c + m*a*h + m*r*c + m*r*h
           + m*c*h + a*r*c + a*r*h + a*c*h + r*c*h;
    cout << ans << endl;
}

Measured memory_bytes: 6144
#include <iostream>

using namespace std;

struct Dice{
    int number[6];

    void roll(char ch){
        int nb;
        if(ch == 'E'){
            nb = number[0];
            number[0] = number[3];
            number[3] = number[5];
            number[5] = number[2];
            number[2] = nb;
        }
        if(ch == 'W'){
            nb = number[0];
            number[0] = number[2];
            number[2] = number[5];
            number[5] = number[3];
            number[3] = nb;
        }
        if(ch == 'N'){
            nb = number[0];
            number[0] = number[1];
            number[1] = number[5];
            number[5] = number[4];
            number[4] = nb;
        }
        if(ch == 'S'){
            nb = number[0];
            number[0] = number[4];
            number[4] = number[5];
            number[5] = number[1];
            number[1] = nb; 
        }
        if(ch == 'F'){
            nb = number[1];
            number[1] = number[2];
            number[2] = number[4];
            number[4] = number[3];
            number[3] = nb;
        }
    }

    int top(){
        return number[0];
    } 

    int right(){
        return number[2];
    }

    int left(){
        return number[3];
    }

    int front(){
        return number[1];
    }
};

bool isEqual(Dice a, Dice b){
        for(int i = 0; i < 6; i++){
            if(a.number[i] != b.number[i])
                return false;
        }
        return true;
    }

int main(){
    Dice dice[100];

    int n;
    cin >> n;

    for(int i = 0; i < n; i++){
        for(int j = 0; j < 6; j++){
            cin >> dice[i].number[j];
        }
    }

    bool flag = true;

    for(int i = 0; i < n - 1; i++){
        for(int j = i + 1; j < n; j++){
            bool fl = false;
            for(int k = 0; k < 4; k++){
                dice[i + 1].roll('F');
                for(int l = 0; l < 4; l++){
                    dice[j].roll('N');
                    if(isEqual(dice[i],dice[j]))
                        fl = true;
                }
            }
            dice[j].roll('E');
            for(int k = 0; k < 4; k++){
                dice[j].roll('N');
                if(isEqual(dice[i], dice[j]))
                    fl = true;
            }

            dice[j].roll('W');
            dice[j].roll('W');
            for(int k = 0; k < 4; k++){
                dice[j].roll('N');
                if(isEqual(dice[i], dice[j]))
                    fl = true;
            }
            if(fl)
                flag = false;
        }
    }

    cout << (flag ? "Yes" : "No") << endl;

    return 0;
}


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

Measured memory_bytes: 1796
n = input()
EdgeLength=input().split()
#print(EdgeLength)
N = int(n)
EdgeLength = [int(i) for i in EdgeLength]

#list(map(int, EdgeLength))

EdgeLength.sort()
#print(EdgeLength)

sumL = sum(EdgeLength) - EdgeLength[N-1]
#print(sumL)


if EdgeLength[N-1] < sumL:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
int main(){
  long long n;
  cin>>n;
  int z;
  int a=0;
  for(int i=2;i<10000000;++i){
    int c=0;
    while(n%i==0){
      n/=i;
      c++;
    }
    for(int j=1;c>0;++j,c-=j){
      a++;
    }
  }
  if(n!=1)a++;
  cout<<a;
}

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

int solve(double x) {
	int l = 1, r = 3500;
	while (l != r) {
		int m = (l + r) >> 1;
		if (1.0 / m < x || fabs(1.0 / m - x) < 1E-8) r = m;
		else l = m + 1;
	}
	return l;
}

int main() {
	std::cin.tie(0);
	std::ios_base::sync_with_stdio(0);
	int n; cin >> n;
	double t = 4.0 / n;
	for (int h = 1; h <= 3500; h++) {
		for (int w = 1; w <= 3500; w++) {
			double t2 = t - (1.0 / h + 1.0 / w);
			if (t2 < 0) continue;
			int t3 = solve(t2);
			if (fabs(1.0 / t2 - t3) < 1E-8) {
				cout << h << ' ' << w << ' ' << t3;
				return 0;
			}
		}
	}
	assert(0);
}


Measured memory_bytes: 256