akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

#define rep(i, n) REP(i, 0, n)
#define REP(i,k,n) for(int i = k; i < n; i++)
#define mmax(start, end) *max_element(start, end)
#define mmin(start, end) *min_element(start, end)
#define argmax max_element
#define argmin min_element
#define ALL(x) (x).begin(), (x).end()

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

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

template<class T = ll> T in() {
    T _in;
    cin >> _in;
    return _in;
}

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

    int N;
    cin >> N;
    int a[2][100];
    int dp[2][100];

    rep(i, 2) {
        rep(j, N) {
            cin >> a[i][j];
        }
    }

    dp[0][0] = a[0][0];
    REP(j, 1, N) {
        dp[0][j] = dp[0][j-1] + a[0][j];
    }

    dp[1][0] = dp[0][0] + a[1][0];
    REP(j, 1, N) {
        dp[1][j] = max(dp[1][j-1], dp[0][j]) + a[1][j];
    }

    cout << dp[1][N-1] << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};

void solve(int W,int H){
    vector<string> S(H);
    for (int i=0;i<H;++i) cin >> S[i];
    vector<vector<bool>> seen(H,vector<bool>(W,false));
    int ans=0;
    auto dfs=[&](auto self,int x,int y)->void{
        seen[x][y]=true; ++ans;
        for (int i=0;i<4;++i){
            int nx=x+dx[i],ny=y+dy[i];
            if (nx<0||H<=nx||ny<0||W<=ny) continue;
            if (S[nx][ny]=='#') continue;
            if (seen[nx][ny]) continue;
            self(self,nx,ny);
        }
    };
    for (int i=0;i<H;++i){
        for (int j=0;j<W;++j){
            if (S[i][j]=='@'){
                dfs(dfs,i,j);
            }
        }
    }
    cout << ans << '\n';
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int W,H;
    while(cin >> W >> H,W){
        solve(W,H);
    }
}


Measured memory_bytes: 3208
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int comp(const void *a, const void *b){return *(int*)a-*(int*)b;}

#define P 1000000007

ulong f(uint k){
	if(k<64) return (((long)1)<<k)%P;
	ulong a=f(k/2);
	if(k&1) return a*a*2%P;
	else return a*a%P;
}

int main(void){
	int n, i;
	char a[100000];
	memset(a, 0, sizeof(a));
	scanf("%d", &n);
	for(i=0; i<n; i++){
		int A;
		scanf("%d", &A);
		if((A&1)==(n&1) || a[A]>=2 || (A==0&&a[0]>=1)){
			puts("0");
			return 0;
		}else{
			a[A]++;
		}
	}
	printf("%ld\n", f(n/2));
}


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

using namespace std;

int main(){


int K;
cin >>K;
int even=0;
int odd=0;
for(int i=1;i<=K;i++){
    if(i%2==0){
    even++;
    }
    else{
    odd++;
    }
}

  cout<<even*odd<<endl;  

 return 0;
}

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

const int N = 3e3 + 5;
typedef long long LL;

LL mod = 998244353, f[N][N];
int a, b, c, d;

LL cal(int x, int y) {
	return (x - 1)*(y - 1);
}

int main() {
	cin>>a>>b>>c>>d;

	f[a][b] = 1;
	for(int i = a; i <= c; i++)
		for(int j = b; j <= d; j++) 
			if(i + j != a + b) f[i][j] = (f[i - 1][j]*j%mod + f[i][j - 1]*i%mod - f[i - 1][j - 1]*cal(i, j)%mod + mod)%mod;

	cout<<f[c][d]%mod<<endl;
	return 0;
}

Measured memory_bytes: 73996
#include <bits/stdc++.h>
using namespace std;
int read();
int n, m;
long long x[200005], k;
int a[200005], nx[200005];
int res[200005], vis[200005], st[200005], top;
int main() {
    n = read();
    for (int i = 1; i <= n; ++i) x[i] = read(), nx[i] = i;
    for (int i = n; i >= 1; --i) x[i] -= x[i - 1];
    m = read(), scanf("%lld", &k);
    for (int i = 1; i <= m; ++i) a[i] = read();
    // for (int i = 1; i <= k; ++i)
    for (int j = 1; j <= m; ++j) swap(nx[a[j]], nx[a[j] + 1]);

    for (int i = 1, j; i <= n; ++i) {
        if (vis[i]) continue;
        st[top = vis[i] = 1] = i, j = nx[i];
        while (j != i) st[++top] = j, j = nx[j], vis[j] = 1;
        for (j = 1; j <= top; ++j) res[st[j]] = st[(j + k - 1) % top + 1];
    }
    long long t = 0;
    for (int i = 1; i <= n; ++i) t += x[res[i]], printf("%lld.0\n", t);
    return 0;
}

int read() {
    int x = 0, f = 1;
    char c = getchar();
    while (c < '0' || c > '9') f = (c == '-') ? -1 : f, c = getchar();
    while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
    return x * f;
}

Measured memory_bytes: 5248
def gcd(a, b):
    if a % b == 0:
        return b
    else:
        return gcd(b, a % b)
 
def prime_factorize(n):
    a = 2
    lst = []
    while a * a <= n:
        if n % a == 0:
            n = n / a
            lst.append(a)
        else:
            a += 1
    if n > 1:
        lst.append(n)
    return lst
 
A, B = map(int, input().split())
n = gcd(A, B)
lst = prime_factorize(n)
print(len(set(lst)) + 1)

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

typedef long long int ll;

using namespace std;

void SieveOfEratosthenes(int n,vector <int> &primes) 
{ 
    // Create a boolean array "prime[0..n]" and initialize 
    // all entries it as true. A value in prime[i] will 
    // finally be false if i is Not a prime, else true. 
    bool prime[n+1]; 
    memset(prime, true, sizeof(prime)); 
  
    for (int p=2; p*p<=n; p++) 
    { 
        // If prime[p] is not changed, then it is a prime 
        if (prime[p] == true) 
        { 
            // Update all multiples of p greater than or  
            // equal to the square of it 
            // numbers which are multiple of p and are 
            // less than p^2 are already been marked.  
            for (int i=p*p; i<=n; i += p) 
                prime[i] = false; 
        } 
    } 
  
    // Print all prime numbers 
    for (int p=2; p<=n; p++) 
       if (prime[p]) 
          primes.push_back(p);
} 

ll max(ll a,ll b)
{
	if(a>b)
		return a;
	return b;
}

ll power(ll x, ll y,ll mod) 
{ 
    ll temp; 
    if( y == 0) 
        return 1; 
    temp = power(x, y/2,mod); 
    if (y%2 == 0) 
        return (temp*temp)%mod; 
    else
        return (((x*temp)%mod)*temp)%mod; 
} 

void find(vector <int> &a,ll n,int size,int i,int cur,int d,bool *flag)
{
    double y=(d/cur);
        ll temp=cur-1+ceil(y);
        if(temp<=n)
            *flag=1;
    while(i<size)
    {
        
        //cur*=a[i];
        find(a,n,size,i+1,cur*a[i],d,flag);
        //cur/=a[i];
        i++;
    }
}

int main()
{
    
   
    int a,b;
    cin>>a>>b;
    string s="";
    if(a<b)
    {
        for(int i=0;i<b;i++)
            s.push_back(a+48);
    }
    else
    {
        for(int i=0;i<a;i++)
            s.push_back(b+48);
    }
    cout<<s<<endl;

	return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static boolean[] array;
	public static int count = 0;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.next();
		array = new boolean[str.length()];
		for (int i = 0; i < array.length; i++) {
			if (str.charAt(i) == '1') {
				array[i] = true;
			}
		}
		exec(0);
		System.out.println(count);
	}
	
	public static void exec(int index) {
		if (index >= array.length - 1) {
			return;
		} else {
			if (array[index] == array[index + 1]) {
				array[index + 1] = !array[index + 1];
				count++;
			}
			exec(++index);
			return;
		}
	}
}


Measured memory_bytes: 35152
#include <bits/stdc++.h>
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define int long long
using namespace std;

typedef pair<int, int> Pii;

template<typename T>
void readvec(vector<T> &a);
void readindex(vector<int> &a);



signed main(){

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

    if(N % K == 0){
        cout << 0;
    }else{
        cout << 1;
    }
    
    return 0;
}


template<typename T>
void readvec(vector<T> &a){
    REP(i, a.size()){
        cin >> a[i];
    }
}
void readindex(vector<int> &a){
    REP(i, a.size()){
        cin >> a[i];
        a[i]--;
    }
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void){
    int l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,v1,v2;
    int l[10];
    int dist=0;
    double cross;
    int adv;
    while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",&l1,&l2,&l3,&l4,&l5,&l6,&l7,&l8,&l9,&l10,&v1,&v2)!=EOF){
        dist=0;
        l[0]=l1;
        l[1]=l2;
        l[2]=l3;
        l[3]=l4;
        l[4]=l5;
        l[5]=l6;
        l[6]=l7;
        l[7]=l8;
        l[8]=l9;
        l[9]=l10;
        for(int i=0;i<10;i++){
            dist+=l[i];
        }
        cross=(double)dist*v1/(v1+v2);
        adv=0;
        for(int i=0;i<10;i++){
            if(adv<cross && adv+l[i]>=cross){
                printf("%d\n",i+1);
            }
            adv+=l[i];
        }
    }
    return 0;
}



Measured memory_bytes: 2108
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
const int INF=1e9,MOD=1e9+7,ohara=1e6+10;
const ll LINF=1e18;
using namespace std;
    
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define Size(n) (n).size()
#define Cout(x) cout<<(x)<<endl
#define doublecout(a) cout<<fixed<<setprecision(15)<<a<<endl;
#define Cerr(x) cerr<<(x)<<endl
#define fi first
#define se second
#define P pair<ll,ll> 
#define m_p make_pair
#define V vector<ll> 
#define U_MAP unordered_map<ll,ll>
#define pq priority_queue<ll>
#define rpq priority_queue<ll,vector<ll>,greater<ll>>
#define p_b push_back
    
ll n,cnt,ans,a,b,c,d,tmp,tmpp,m,h,w,x,y,sum,pos,k,q;
ld doua;
int dy[]={1,0,-1,0};
int dx[]={0,1,0,-1};
//int dy[]={-1,0,1,-1,1,-1,0,1};
//int dx[]={-1,-1,-1,0,0,1,1,1};
string alph("abcdefghijklmnopqrstuvwxyz"),s;
bool fl;
struct edge{int to,cost;};
    
//------ Believe yourself as a genius!!!!!! ------
    
int main(void){
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    
    cin>>n;
    ll mi=LINF,ma=0;
    rep(i,n){
        cin>>a;
        mi=min(mi,a);
        ma=max(ma,a);
    }
    Cout(ma-mi);
    return 0;
}

Measured memory_bytes: 256
use std::collections::HashSet;

fn gcd(a: u64, b: u64) -> u64 {
    let ab_max = std::cmp::max(a, b);
    let ab_min = std::cmp::min(a, b);
    let r = ab_max % ab_min;
    if r == 0 {
        ab_min
    } else {
        gcd(ab_min, r)
    }
}

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_line(&mut buf).unwrap();
    let mut iter = buf.split_whitespace();
    let a: u64 = iter.next().unwrap().parse().unwrap();
    let b: u64 = iter.next().unwrap().parse().unwrap();

    let mut ab_gcd = gcd(a, b);

    let mut divisor = HashSet::new();
    divisor.insert(1);

    let ab_sqrt = (ab_gcd as f64).sqrt() as u64 + 2;

    for i in 2..ab_sqrt {
        while ab_gcd % i == 0 {
            divisor.insert(i);
            ab_gcd /= i;
        }
    }
    if ab_gcd > 1 {
        divisor.insert(ab_gcd);
    }

    println!("{}", divisor.len());
}


Measured memory_bytes: 4352
import java.util.*;

public class Main {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        long a = sc.nextLong();
        long b = sc.nextLong();
        long c = sc.nextLong();
        boolean res = true;
        if(c-a-b >= 0){
            if((c-a-b) * (c-a-b) > 4*a*b){
                res = true;
            }else{
                res = false;
            }
        }else{
            res = false;
        }
        if(res)
            System.out.println("Yes");
        else
            System.out.println("No");
    }

}


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

int main() {
  ll a,b,k;
  cin>>a>>b>>k;
  
  if(a>=k){
  	cout<<a-k<<" "<<b<<endl;
  }
  
  else if(k>a+b){
  	cout<<0<<" "<<0<<endl;
  }
  
  else{
  	cout<<0<<" "<<b-(k-a)<<endl;
  }
}

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

using namespace std;

int n,cnt[2];

int main(){
	scanf("%d",&n);
	for (int i=1;i<=n;++i){
		int x; scanf("%d",&x); ++cnt[x%2];
	}
	if (cnt[0]){
		puts(cnt[1]%2==0?"YES":"NO");
	}
	else{
		if (cnt[1]==1) puts("YES");
		else puts(cnt[1]%2==0?"YES":"NO");
	}
	
	return 0;
}
			

Measured memory_bytes: 256
use std::io::Read;
use std::cmp::min;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let answer = solve(&buf);

    println!("{}", answer);
}

fn solve(input: &str) -> String {
    let mut iterator = input.split_whitespace();

    let n: usize = iterator.next().unwrap().parse().unwrap();
    let a: Vec<i64> = (0..n).map(|_| iterator.next().unwrap().parse().unwrap()).collect();

    let mut c: Vec<i64> = a.iter().enumerate().map(|x| x.1 - (x.0 + 1) as i64).collect();
    c.sort();

    let mut ans = std::i64::MAX;
    for i in (n as i64 / 2 - 1)..(n as i64 / 2 + 1) {
        if i < 0 || i >= n as i64 {
            continue;
        }
        let sad = c.iter().map(|x| (x - c[i as usize]).abs()).sum::<i64>();
        ans = min(ans, sad);
    }
    ans.to_string()
}


Measured memory_bytes: 7608
/*
                                Bismillahi-r-Rahmani-r-Rahim
                                        RhIeyAaD
                                    IIT-7th Batch,JU
*/
#include<bits/stdc++.h>
using namespace std;

#define pf(a)           printf("%lld\n", a)
#define sf(a)           scanf("%lld", &a)
#define line(a)         getline(cin,(a))
#define ll              long long int
#define MAX             2134567891
#define MID(l,r)        (l+r)>>1
#define fr(i,n)         for(i=0;i<n;i++)
#define rep(i,n)        for(i=1;i<=n;i++)
#define per(i,a,n)      for(i=n;i>=a;i--)
#define FOR(i,a,n)      for(i=a;i<=n;i++)
#define ALL(n)          n.begin(),n.end()
#define mem(x,n)        memset(x,n,sizeof(x))
#define T_C(t)          printf("Case %lld: ",t)
#define TC(t)           printf("Case %lld:\n",t)
#define ans(t,c)        printf("Case %lld: %lld\n",t,c)
#define SETP(n)         cout<<setprecision(n)<<fixed
#define READ            freopen("F:\\Project\\Test_Case.txt","r",stdin)
#define WRITE           freopen("F:\\Project\\Output_Test.txt","w",stdout)
#define IO              ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0);
#define PAIR            pair<ll,ll>
#define MP              make_pair
#define pb(a)           push_back(a)
#define ff              first
#define ss              second
#define MOD             1000000007///10^9
#define p6              1000007 ///10^6->6 zero after 1 **
#define hlw             printf("hlw\n");
#define SN              4*p6
#define NN              111
#define N               p6

ll x[N],y[N],z[N],n;
string s,S;
vector<ll>v;
//map <ll,ll> mp;

int main()
{
    //IO;
    //while(1)
    //READ;WRITE;
{
    ll a=0,b=0,c=0,d,e,f,g,i,j,k,l,m,p,q,r,u,w,t,tc,in,mod,loc,diff,val,sz,lo,hi,mid,mn=MAX,mx=0,sum=0,ans=0;
    cin>>n>>a>>b;

    rep(i,n)
    {
        for(j=i+1;j<=n;j++)
        {
            p=min(j-i,abs(a-i)+abs(b-j)+1);
            x[p]++;
        }
    }
    rep(i,n-1)cout<<x[i]<<endl;
}
    return 0;
}

/*

*/
/// Check for constraint 0 or 1?
/// long long or double? sqrt or division will work fine??


Measured memory_bytes: 2304
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define rep2(i, s, n) for(int i=s; i<(n); ++i)
#define ALL(v) (v).begin(), (v).end()

using namespace std;

typedef long long ll;

static const int INTINF = (2147483647 >> 1); // 10^9 + 5000
static const ll LLINF = (9223372036854775807 >> 1);
static const int MAX = 1e5+1;
static const ll MOD = 1e9+7;

namespace Kunitaka{
    template<
        typename TYPE,
        std::size_t SIZE
    >
    std::size_t array_length(const TYPE (&array)[SIZE])
    {
        return SIZE;
    }
}
using namespace Kunitaka;
namespace Printer{
    void br(){
        cout << endl;
    }

    void loop_cnt(int i){
        cout << "i = " << i << endl;
    }

    void loop_cnt(int i, int j){
        cout << "i = " << i << ", " << "j = " << j << endl;
    }

    template<class T>
    void print(T x){
        cout << x << endl;
    }

    template<class T, class S>
    void print(T x, S y){
        cout << x << "," << y << endl;
    }

    template<class T, class S, class U>
    void print(T x, S y, U z){
        cout << x << "," << y << "," << z << endl;
    }

    template<class T, class S>
    void print(pair<T, S> p){
        cout << p.first << ", " << p.second << endl;
    }

    template<
        typename TYPE,
        std::size_t SIZE
    >
    void print(const TYPE (&array)[SIZE]){
        int lim = array_length(array);
        for(int i=0; i<lim; i++){
            if(i) cout << " ";
            cout << array[i];
        }
        cout << endl;
    }

    template<class S>
    void print(vector<S> v){
        for(int i=0; i<v.size(); i++){
            if(i) cout << " ";
            cout<< v[i];
        }
        cout << endl;
    }

    template<class S>
    void print(vector<vector<S> > vv){
        for(int i=0; i<vv.size(); i++){
            for(int j=0; j<vv[i].size(); j++){
                if(j) cout << " ";
                cout << vv[i][j];
            }
            cout << endl;
        }
    }

    void yesno(bool x){
        if(x) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
};
using namespace Printer;

int main(int argc, const char * argv[]) {
    //提出時、消す----//
    //--------------//

    // variable
    ll ans = 0;

    // input
    cout << fixed << setprecision(10);
    int N; cin >> N;
    vector<bool> A(1e9+1);

    // solve
    rep(i, N){
        int a; cin >> a;
        if(A[a]){
            cout << "NO" << endl;
            return 0;
        }
        A[a] = true;
    }
    cout << "YES" << endl;
    
    return 0;
}


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

int n, m, c, b[20], ans;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cin >> n >> m >> c;
	for(int i=0; i<m; ++i) cin >> b[i];
	for(int i=0; i<n; ++i){
		int t = 0;
		for(int j=0; j<m; ++j){
			int a;
			cin >> a;
			t += a * b[j];
		}
		t += c;
		if(t > 0) ++ans;
	}
	cout << ans << "\n";
}

Measured memory_bytes: 256
#pragma GCC optimize(3,"Ofast","inline")
#include<bits/stdc++.h>
#define IOS ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define ms(a,b) memset(a,b,sizeof(a))
#define msn(a,n,b) for(int i=0;i<=n;i++)a[i]=b
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
#define fi first
#define se second
using namespace std;
mt19937 rng_32(chrono::steady_clock::now().time_since_epoch().count());
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
const int mod=1e9+7;
const int seed=233;
const double PI=acos(-1.0);
const double eps=1e-7;
const int inf=0x3f3f3f3f;
const int max_n=200005;
namespace {
    inline int Add(int x,int y){return (x+=y)>=mod?x-mod:x;}
    inline int Sub(int x,int y){return (x-=y)<0?x+mod:x;}
    inline int Mul(int x,int y) {return 1ll*x*y%mod;}
    inline int Pow(int x,int y=mod-2){if(y==0)return 1;int res=1;while(y){if(y&1)res=1ll*res*x%mod;x=1ll*x*x%mod;y>>=1;}return res;}
}
/**********************head************************/
int n;
vector<int> G[max_n];
int sz[max_n];
int ans=0;
int p[max_n],p2[max_n];
void dfs(int u,int fa){
    for(auto v:G[u]){
        if(v==fa)continue;
        dfs(v,u);
        sz[u]+=sz[v];
    }
    sz[u]++;
    int res=p2[n-1];
    res=Sub(res,1);
    for(auto v:G[u]){
        if(v==fa)continue;
        res=Sub(res,Sub(p2[sz[v]],1));
    }
    if(fa){
        res=Sub(res,Sub(p2[n-sz[u]],1));
    }
    //cout<<u<<' '<<res<<endl;
    res=Mul(res,p[n]);
    ans=Add(ans,res);
}
int main(){
    scanf("%d",&n);
    int inv=Pow(2,mod-2);
    p[0]=1;
    for(int i=1;i<=n;i++)p[i]=Mul(p[i-1],inv);
    p2[0]=1;
    for(int i=1;i<=n;i++)p2[i]=Mul(p2[i-1],2);
    for(int i=1;i<n;i++){
        int u,v;scanf("%d%d",&u,&v);
        G[u].push_back(v);
        G[v].push_back(u);
    }
    dfs(1,0);
    printf("%d\n",ans);
    return 0;
}

Measured memory_bytes: 24704
import java.util.*;
class Main {
 public static void main(String[] args) {
  Scanner sc = new Scanner(System.in);
  int a = sc.nextInt();
  int b = sc.nextInt();
  if( a > b ) {
   System.out.println("a > b");
  }else if( a < b ) {
   System.out.println("a < b");
  }else if( a == b ) {
   System.out.println("a == b");
}
}
}


Measured memory_bytes: 26244
N = int(input())
music_list = [input().split(' ') for i in range(N)]
X = input()
sleep_switch = False
total_time = 0
for music in music_list:
    if not sleep_switch:
        if music[0] == X:
            sleep_switch = True
    else:
        total_time += int(music[1])
print(total_time)

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

int main() {
	int n, k;
	cin >> n >> k;
	vector<int> h(n);
	rep(i, n) cin >> h[i];
	sort(all(h));
	reverse(all(h));
	ll ans = 0;
	for(int i = k; i < n; i++){
		ans += h[i];
	}
	
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define MAX 3000
using namespace std;

int dp[MAX+1][MAX+1];

int lenLCS(string&s,string&t,int i ,int j){
    if(i>=s.length()||j>=t.length()){
        return 0;
    }
    if(dp[i][j]!=-1)
        return dp[i][j];
        
    if(s[i]==t[j])
        return dp[i][j]=1+lenLCS(s,t,i+1,j+1);
        
    
    return dp[i][j]=max(lenLCS(s,t,i+1,j),lenLCS(s,t,i,j+1));

    
}


string LCS(string &s,string &t,int len){
    
    string ans = "";
    int i=0,j=0;
    while(len>0){
        if(s[i]==t[j]){
            ans.push_back(s[i]);
            i++;
            j++;
            len--;
        }
        else if(dp[i][j+1]>dp[i+1][j]){
            j++;
        }
        else{
            i++;
        }
    }
    
    return ans;
}

string solve(string&s,string&t){
    int len = lenLCS(s,t,0,0);
    return LCS(s,t,len);
    
}


int main() {
	// your code goes here
	string s,t;
	cin>>s>>t;
	memset(dp,-1,sizeof(dp));
	cout<<solve(s,t);
	
	return 0;
}


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

const double PI = acos(-1);

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
using P = pair<ll, ll>;
using V = vector<ll>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep1(i, n) for(ll i=1;i<=(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
#define ALL(obj) (obj).begin(), (obj).end()
#define RALL(obj) (obj).rbegin(), (obj).rend()
#define MOD 1000000007
#define INF 1000000000

void solve_abc_c() {
	ll n, m;
	//ll x;
	ll a;
	string s;
	string s_ans;
	ll l_ans = 0;
	double d_ans = 0;
	
	cin >> n;

	ull now, cnt, val;

	now = 0;
	cnt = 1;
	val = 26;
	while (1) {
		if (val >= n) {
			break;
		}
		cnt++;
		n -= val;
		val *= 26;
	}

	n--;

	// 桁数はcnt、残りはn

	rep(i, cnt) {
		s_ans += 'a' + n % 26;
		n /= 26;
	}
	reverse(ALL(s_ans));

	cout << s_ans << "\n";
}

int main(void) {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed;
	cout << setprecision(15);

	solve_abc_c();

	return 0;
}


Measured memory_bytes: 3580
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,x,n) for(int i=(x);i<(n);i++)
#define all(v) (v).begin(),(v).end()
#define int long long
using namespace std;
const int MOD=1e9+7;
const int INF=1e10;

using namespace std;
signed main(){
  int n,x;
  cin>>n>>x;
  vector<int> m(n);
  int sum=0;
  rep(i,n){
    cin>>m[i];
    sum+=m[i];
  }
  int mini=*min_element(all(m));


  cout<<(x-sum)/mini+n<<endl;

  return 0;
}


Measured memory_bytes: 256
n = int(input())
robots = []
for _ in range(n):
    xi, li = map(int, input().split())
    robots.append((xi + li, xi - li))
robots.sort()
ans = n
pre_right = robots[0][0]
for i in range(1, n):
    now_left = robots[i][1]
    if pre_right > now_left:
        ans -= 1
    else:
        pre_right = robots[i][0]
print(ans)


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

int main()
{
    int N,L;
    string S[110];
    cin >> N >> L;
    for(int i=0; i<N; i++){
        cin >> S[i];
    }
    sort(S,S+N);
    string ans="";
    for(int i=0; i<N; i++){
        ans += S[i];
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
#include <math.h>

int main( void ){
	char s[11];
	int i,x,min;
	scanf("%s",s);
	min = abs(((s[0]-'0')*100+(s[1]-'0')*10+(s[2]-'0')) - 753);
	for( i=1;i<(int)strlen(s)-2;i++ ){
		x=abs(((s[i]-'0')*100+(s[i+1]-'0')*10+(s[i+2]-'0')) - 753);
		if( min > x ) min = x;
	}
	printf("%d\n",min);
	return 0;
}

Measured memory_bytes: 128
n = int(input())
b = list(map(int, input().split()))
ans = []
flag = True
for i in range(n):
  flag = True
  m = len(b)
  for j in range(m):
    if b[m-1-j] == m-j:
      ans.append(m-j)
      del b[m-1-j]
      flag = False
      break
  if flag:
    print(-1)
    break
if not flag:
  for i in range(n):
    print(ans[n-1-i])

Measured memory_bytes: 3064
#include<bits/stdc++.h>
#include<string>
using namespace std;
int compare(string s1,string s2)
{
    int match = 0;
    long int s1_length  = s1.length();
    long int s2_length  = s2.length();
    for(long int i=0;i<min(s1_length,s2_length);i++){
        if(s1[i] != s2[i]){
            match++;
        }
    }
    return match;
}
int main()
{
    int min_change = INT_MAX;
    string s1,s2;
    cin >> s1 >> s2;
    long int t1 = s1.length();
    long int t2 = s2.length();
    long int dif = abs(t2-t1);
    if(s1.length() > s2.length()){
    for(long int i=0;i<dif;i++){
        if(min_change > compare(s1.substr(i,min(s1.length(),s2.length())), s2)){
            min_change = compare(s1.substr(i,min(s1.length(),s2.length())), s2);
        }
    }
        cout << min_change << endl;
    }
    else if(s1.length() >= s2.length()){
        int count = 0;
        for(int i=0;i<t1;i++){
            if(s1[i] != s2[i]){
                count++;
            }
        }
        cout << count << endl;
    }
    else{
        cout << 0 << endl;
    }
    
}


Measured memory_bytes: 3628
#include <iostream>

using namespace std;

int main() {
    int x_1, x_2, y_1, y_2;
    cin >> x_1 >> y_1 >> x_2 >> y_2;

    cout << x_2 + y_1 - y_2 << " " << y_2 - x_1 + x_2 << " " << y_1 - y_2 + x_1 << " " << y_1 - x_1 + x_2 << endl;

    return 0;
}

Measured memory_bytes: 888
#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main(){
    int m;
    cin>>m;
    int num[m];
    int ball[m];
    vector<ll> ans;
    for (int i = 0; i < m; i++) {
        cin>>num[i];
        ball[i]=0;
    }
    for (int j = m-1; j >=0 ; j--) {
        int temp=0;
        int now=j+j+1;
        while(now<m){
            temp+=ball[now];
            now+=j+1;
        }
        if(temp%2!=num[j]){
            ball[j]=1;
            ans.push_back(j);
        }
    }
    cout<<ans.size()<<endl;
    if(!ans.empty()) {
        for (int k = 0; k < ans.size() - 1; ++k) {
            cout << ans.at(k) + 1 << " ";
        }
        cout << ans.at(ans.size() - 1) + 1 << endl;
    }
    return 0;
}

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

typedef long long ll;

int main() {
  ll n;
  cin >> n;
  ll tmp = n, x = 1, d = 0;
  while (tmp) {
    tmp /= 10;
    x *= 10;
    d++;
  }
  ll y = x - 1;
  x /= 10;
  while (y > n) {
    y -= x;
  }
  ll ans = 0;
  while (y) {
    ans += y%10;
    y /= 10;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random,resource

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    s = S()

    return s[:3]


print(main())




Measured memory_bytes: 10828
#include <stdio.h>
#include <math.h>
#include <algorithm>
#include <stack>

using namespace std;

int main(){

	int a,b,c,d,sum;
	scanf("%d",&a);
	scanf("%d",&b);
	scanf("%d",&c);
	scanf("%d",&d);

	sum = a + b + c + d;

	printf("%d\n%d\n",sum/60,sum%60);

	return 0;
}

Measured memory_bytes: 2712
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
using namespace std;
typedef long long ll;
ll MOD = 1e9+7;
#define rep(i,n) for(int i = 0; i < (n); ++i)
int main() {
    int n;
    cin >> n;
    cout << (n + 1) / 2 << endl;
    return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize ("O3")
#pragma GCC target ("avx")
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

int dp[6010][2010];

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


	int N, M;
	cin >> N >> M;

	dp[0][0] = 1;

	rep(i, 3 * N) {
		rep(j, N + 1) {
			dp[i + 3][j + 1] += ll(dp[i][j]) * (i + 1) * (i + 2) % M;
			if (dp[i + 3][j + 1] > M) dp[i + 3][j + 1] -= M;
			dp[i + 2][j + 1] += ll(dp[i][j]) * (i + 1) % M;
			if (dp[i + 2][j + 1] > M) dp[i + 2][j + 1] -= M;
			dp[i + 1][j] += dp[i][j];
			if (dp[i + 1][j] > M) dp[i + 1][j] -= M;
		}
	}

	//rep(i, 3 * N + 1) {
	//	rep(j, N + 2) {
	//		cesp(dp[i][j][0]);
	//		cesp(dp[i][j][1]);
	//	}
	//	ce("");
	//}

	ll kotae = 0;
	rep(i, N + 1) kotae += dp[3 * N][i];
	co(kotae % M);

	Would you please return 0;
}

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

#define LL long long

int main() {
    ios::sync_with_stdio(0), cin.tie(0);
    
    string s; cin >> s; reverse(s.begin(), s.end());
    int i = 0, res = 0, cnt[2019]={}, mul = 1; LL ans = 0;
    cnt[0]++;

    for(char c : s) {
        res += ((c - 48) * mul);
        res %= 2019;
        ans += cnt[res];
        mul *= 10;
        mul %= 2019;  
        cnt[res]++;
    }    
    cout << ans;
}

Measured memory_bytes: 3664
#include<bits/stdc++.h>
#define REP(i, a, b) for(int i=(int)(a); i<(int)(b); i++)
#define RREP(i, a, b) for(int i=(int)(a); i>=(int)(b); i--)
#define ALL(v) v.begin(), v.end()
#define INF 2e9
typedef long long ll;
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;}

using namespace std;

int main()
{
    int N, A, B;
    cin >> N >> A >> B;
    if(B>N*A){
        cout << N*A;
    }else{
        cout << B;
    }
    cout << "\n";
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <float.h>

int main()
{
	int n,m;
	if (scanf("%d %d", &n, &m));

	int i;
	int sum = 0;
	int array[n];
	memset(array, 0, sizeof(array));
	for (i=0; i<n; i++) {
		if (scanf("%d", &array[i]))
		sum += array[i];
	}

	int cnt = 0;
	float ave = (float)sum / (4 * m);
	for (i=0; i<n; i++) {
		if (ave <= (float)array[i]) {
			cnt++;
		}
		if (cnt >= m) break;
	}

	printf("%s", (m <= cnt)? "Yes" : "No");

	return 0;
}

Measured memory_bytes: 128
[N,K] = list(map(int,input().split()))
A = list(map(int,input().split()))

for j in range(min(K,50)):
    NextA = [0]*N
    for i in range(N):
        l = max(0, i-A[i])
        r = min(N-1, i+A[i])

        NextA[l]+=1
        if r+1<=N-1:
            NextA[r+1]-=1

    for i in range(1,N):
        NextA[i] += NextA[i-1]
    A = NextA[:]

print(*NextA)

Measured memory_bytes: 170748
#include <cstdio>

#define abs(a) (a < 0 ? -(a) : a)

int main()
{
  int x, a, b;
  scanf("%d %d %d", &x, &a, &b);
  puts(abs(x - a) < abs(x - b) ? "A" : "B");
  return 0;
}

Measured memory_bytes: 128
# -*- coding: utf-8 -*-
a, b, c = map(int, input().split())
k = int(input())

while a >= b and k > 0:
    b *= 2
    k -= 1

while b >= c and k > 0:
    c *= 2
    k -= 1

if a < b < c and k >= 0:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 9164
#include <bits/stdc++.h>
#define rep(i,x,n) for(int i=x; i<(int)(n); i++)
#define rep_eq(i,x,n) for(int i=x; i<=(int)(n); i++)
using namespace std;

int main() {
  int N,K; cin >>N >>K;
  int ans=0;
  rep(i,0,N) {
    int x; cin >>x;
    ans+=min(x,K-x)*2;
  }
  cout <<ans <<endl;
  return 0;
}


Measured memory_bytes: 256
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy


class UnionFind:

    def __init__(self, n: int):
        self._n = n
        self._parents = [i for i in range(n)]
        self._rank = [1 for _ in range(n)]

    def unite(self, x: int, y: int) -> None:
        px = self.find(x)
        py = self.find(y)

        # 一致していないときはリンクをつける
        if px != py:
            self._link(px, py)

    def _link(self, x: int, y: int):
        if self._rank[x] < self._rank[y]:
            self._parents[x] = y
        elif self._rank[x] > self._rank[y]:
            self._parents[y] = x
        else:
            self._parents[x] = y
            self._rank[y] += 1

    def same(self, x: int, y: int) -> bool:
        px = self.find(x)
        py = self.find(y)
        return px == py

    def find(self, x: int) -> int:
        if self._parents[x] == x:
            return x

        self._parents[x] = self.find(self._parents[x])
        return self._parents[x]


N = int(input())
ps = [list(map(int, input().split())) + [i] for i in range(N)]
ps.sort(key=lambda t: t[0])
xs = []
for i in range(N - 1):
    xs.append((ps[i + 1][0] - ps[i][0], ps[i][2], ps[i + 1][2]))

ps.sort(key=lambda t: t[1])
ys = []
for i in range(N - 1):
    ys.append((ps[i + 1][1] - ps[i][1], ps[i][2], ps[i + 1][2]))

xs += [(1<< 40, -1, -1)]
ys += [(1<< 40, -1, -1)]

xs.sort()
ys.sort()

xc, yc = 0, 0
uf = UnionFind(N)

ans = 0
while xc < N - 1 and yc < N - 1:
    if xs[xc][0] < ys[yc][0]:
        if not uf.same(xs[xc][1], xs[xc][2]):
            uf.unite(xs[xc][1], xs[xc][2])
            ans += xs[xc][0]
        xc += 1
    else:
        if not uf.same(ys[yc][1], ys[yc][2]):
            uf.unite(ys[yc][1], ys[yc][2])
            ans += ys[yc][0]
        yc += 1

print(ans)


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

int main(){
    int d,n,ans=1;cin>>d>>n;
    if(n!=100){
        ans=pow(100,d)*n;
        cout<<ans<<endl;
    }
    else{
        ans=pow(100,d)*101;
        cout<<ans<<endl;
    }
}

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

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

#define DEBUG(x) cout<<#x<<": "<<(x)<<'\n'
#define DEBUG_VEC(v) cout<<#v<<":";REP(i, v.size())cout<<' '<<v[i];cout<<'\n'
#define ALL(a) (a).begin(), (a).end()

template<typename T> inline void CHMAX(T& a, const T b) {if(a<b) a=b;}
template<typename T> inline void CHMIN(T& a, const T b) {if(a>b) a=b;}

constexpr ll MOD=1000000007ll;
// constexpr ll MOD=998244353ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

const double EPS=1e-9;
#define EQ0(x) (abs((x))<EPS)
#define EQ(a, b) (abs((a)-(b))<EPS)

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  // cout<<setprecision(10)<<fixed;
  int x;
  cin>>x;
  cout<<(x==0 ? 1 : 0)<<'\n';
  return 0;
}


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

using namespace std;

#define ll long long

int bin_pow(int a, int pow) {
    if (pow == 0) return 1;
    if (pow == 1) return a;
    if (pow % 2 == 0) {
        int tmp = bin_pow(a, pow / 2);
        return tmp * tmp;
    }
    return a * bin_pow(a, pow - 1);
}

int fact(int x) {
    int ans = 1;

    for (int i = 1; i <= x; i++) ans *= i;
    return ans;
}

int count(vector<int> a) {
    int ans = 0;
    unordered_set<int> was;
    for (int i = 0; i < a.size(); i++) {
        int count = a[i] - 1;
        for (int j = 1; j < a[i]; j++) {
            count -= was.count(j);
        }
        ans += count * fact(a.size() - i - 1);
        was.insert(a[i]);
    }

    return ans;
}

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

    unordered_set<int> correct;

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

    unordered_set<int> a;

    for (int i = 0; i < n; i++) {
        int x;
        cin >> x;
        a.insert(x);
    }

    int cnt = -1;

    unordered_set<int> b;
    for (int aa : a) {
        int tmp = 0;

        while (aa % 2 == 0) {
            aa /= 2;
            tmp++;
        }
        b.insert(aa);

        if (cnt == -1) cnt = tmp;
        else if (cnt != tmp) {
            cout << 0;
            return 0;
        }
    }

    unordered_map<int, int> mp;

    for (int aa : b) {
        for (int j = 3; j * j <= aa; j += 2) {
            int tmp = 0;
            while (aa % j == 0) {
                tmp++;
                aa /= j;
            }
            mp[j] = max(mp[j], tmp);
        }
        if (aa != 1) {
            mp[aa] = max(mp[aa], 1);
        }
    }

    ll ans = bin_pow(2, cnt - 1);
    for (pair<int, int> mmp : mp) {
        ans *= bin_pow(mmp.first, mmp.second);
        if (ans > m) {
            cout << 0;
            return 0;
        }
    }

    cout << (m / ans + 1) / 2;

    return 0;
}

Measured memory_bytes: 896
import sys


def input():
    return sys.stdin.readline().rstrip()


def main():
    S =input()
    if "RRR" in S:
        print(3)
        exit()
    elif "RR" in S:
        print(2)
        exit()
    elif "R" in S:
        print(1)
        exit()
    else:
        print(0)



if __name__ == "__main__":
    main()


Measured memory_bytes: 61716
from sys import stdin
from collections import deque
import heapq


N, M = [int(x) for x in stdin.readline().rstrip().split()]
AB = [[int(x) for x in stdin.readline().rstrip().split()] for _ in range(N)]
AB.sort(key=lambda x: (x[0], -x[1]))
work = [deque([]) for _ in range(M + 1)]

for ab in AB:
    if ab[0] <= M:
        work[ab[0]].append(ab[1])

ans = 0
day = 1
available_work = []
while day <= M:
    for w in work[day]:
        heapq.heappush(available_work, -w)
    if len(available_work) > 0:
        ans += heapq.heappop(available_work)
    day += 1

print(-ans)


Measured memory_bytes: 89032
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define ll long long
#define P pair<ll,ll>
#define all(v) (v).begin(),(v).end()

const ll mod = 1e9+7;
const ll INF = 1e18;
const double pi = acos(-1.0);

int main(void)
{
    string s; cin>>s;
    ll n=s.size();
    string ans="AC";
    if(s[0]!='A') ans="WA";
    ll cnt=0;
    for(int i=1;i<n;i++){
        if(isupper(s[i])){
            if(i==1 || i==n-1 || s[i]!='C') ans="WA";
            cnt++;
        }
    }
    if(cnt!=1) ans="WA";
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3600
#pragma warning(disable : 4996)
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define dup(x) x.erase(unique(x.begin(), x.end()),x.end())
typedef long long int ll;
typedef unsigned long long int ull;
using namespace std;
// https://atcoder.jp/contests/abc170/tasks/abc170_b
string ans[2] = {"No", "Yes"};
int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    bool isAnswer = false;
    ll x,y;
    cin >> x >> y;

    if(y >= 2*x && y <= 4*x && y % 2 == 0){
        isAnswer = true;
    }

    cout << ans[isAnswer];

	return 0;
}

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


int main() {
  int N, M, X;
  cin >> N >> M >> X;
  int C[N], A[N][M];
  int Ans = -1;
  rep(i, N) {
    cin >> C[i];
    rep(j, M) {
      cin >> A[i][j];
    }
  }
  rep(i, (1<<N)) {
    int SC = 0;
    int SA[M];
    int flag = 1;
    rep(k, M) {
      SA[k] = 0;
    }
    
    rep(j, N) {
      if (i & (1<<j)) {
        SC += C[j];
        rep(l, M) {
          SA[l] += A[j][l];
        }
      }
    }
    rep(j, M) {
      if (SA[j] < X)
        flag = 0;
    }
    
    if (flag) {
      if (Ans == -1)
        Ans = SC;
      else
        Ans = min(Ans, SC);
    }
  }
  cout << Ans << endl;
}

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

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

    vector<int64_t> lucas(N+1,0);
    lucas.at(0) = 2LL;
    lucas.at(1) = 1LL;
    
    for(int i = 2;i < N+1;i++){
    lucas.at(i) = lucas.at(i-1) + lucas.at(i-2);
    }
    cout<<lucas.at(N)<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstring>
using namespace std;
int A[100];
int main()
{
  int N;
  while(cin >> N){
    memset(A,0,sizeof(A));
    for(int i=0; i<N; i++){
      cin >> A[i];
    }
    int count = 0;
    for(int i=0; i<N; i++){
      for(int j=N-1; j>i; j--){
        if(A[j] < A[j-1]){
          int t = A[j];
          A[j] = A[j-1];
          A[j-1] = t;
          count++;
        }
      }
    }
    for(int i=0; i<N; i++){
      if(i!=0) cout << " ";
      cout << A[i];
    }
    cout << endl;
    cout << count << endl;
  }
  return 0;
}

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

using namespace std;
using ll = long long;

//container util
#define SORT(c) sort((c).begin(),(c).end())
#define all(a) (a).begin(), (a).end()

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

//print
#define pv(val) cerr << #val << '=' << (val) << endl

const int INF = 1e9;

int main(void){

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

	if(S == 1e9){
		REP(i, K) cout << S << " ";
		REP(i,N-K) cout << 1 << " ";

	}else{
		REP(i, K) cout << S << " ";
		REP(i,N-K) cout << S+1 << " ";

	}

	cout << endl;

	return 0;

}


Measured memory_bytes: 1280
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**5)

K = int(input())

cnt = 0
def dfs(keta, cur) :
  if keta == 0 :
    global cnt
    cnt += 1
    if cnt == K :
      print(cur)
      exit()
    return 
      
  i = cur % 10
  if i - 1 >= 0 :
    dfs(keta - 1, cur * 10 + i - 1)
  dfs(keta - 1, cur * 10 + i)
  if i + 1 <= 9 :
    dfs(keta - 1, cur * 10 + i + 1)

for keta in range(100) :
  for i in range(1, 10) :
    dfs(keta, i)

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

int main() {
  int N; cin >> N;
  vector<long long int> A(N + 1); for (int i = 1; i <= N; i++) cin >> A[i];

  for (int i = 1; i <= N; i++) A[i] += A[i - 1];
  sort(A.begin(), A.end());

  long long int same_n = 0, ans = 0;
  for (int i = 1; i <= N; i++) {
    same_n++;
    if (A[i] == A[i - 1]) ans += same_n; else same_n = 0;
  }

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 1792
#include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<iostream>
#include<queue>
#include<map>
#include<set>
#include<complex>
#include<stack>
#include<cmath>

using namespace std;

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


#define X real()
#define Y imag()
typedef complex<double> P;

const double EPS = 0.1;

int main(){
	
	while(1){
		string a;
		getline(cin,a);
		
		if(cin.eof())break;
		
		rep(i,26){
			string s;
			rep(j,a.size()){
				if(a[j]<'a' || a[j]>'z')s+=a[j];
				else s+=(a[j]-'a'+i)%26+'a';
			}
			if(s.find("this")!=-1 || s.find("the")!=-1 || s.find("that")!=-1){
				cout<<s<<endl;
				goto A;
			}
		}
		A:;
	}
}

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

int main(void){
int i, j, k, sl, tl;
char ans[60] = "UNRESTORABLE";
char s[60], t[60];

scanf("%s", s);
scanf("%s", t);

sl = strlen(s);
tl = strlen(t);

for(i = sl -tl; i >= 0; i--){
	for(j = 0; j < tl; j++){
		if(s[i+j] != t[j] && s[i+j] != '?')
			break;
	}
	if(j == tl) break;
}

if(i == -1) printf("%s", ans);
else{
	for(k = 0; k < sl; k++){
		if(i <= k &&k < tl +i) printf("%c", t[k-i]);
		else if(s[k] == '?') printf("a");
		else printf("%c", s[k]);
	}
	
}
printf("\n");

return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;

signed main() {
#ifdef LOCAL
  assert(freopen("b.in", "r", stdin));
#endif
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  reverse(a.begin(), a.end());
  ll l = 2, r = 2;
  for (ll x : a) {
    ll nl = (l + x - 1) / x * x;
    ll nr = r / x * x;
    if (nl > nr) {
      cout << -1 << endl;
      return 0;
    }
    l = nl, r = nr + x - 1;
    //cerr << l << ' ' << r << '\n';
  }
  cout << l << ' ' << r << '\n';
}


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

int main()
{
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long a, b, c, d, e, f, g;
  cin >> a >> d >> e >> b >> c >> f >> g;
  long long ans = 0;
  if (a % 2 && b % 2 && c % 2) {
    --a, --b, --c;
    ans += 3;
  } else if (a % 2 && (b % 2 && c || c % 2 && b)) {
    --a, --b, --c;
    ans += 3;
  } else if (b % 2 && c % 2 && a) {
    --a, --b, --c;
    ans += 3;
  }
  a = a / 2 * 2;
  b = b / 2 * 2;
  c = c / 2 * 2;
  ans += a + b + c + d;
  cout << ans << endl;
  return 0;
}


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

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

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

//gcd,lcmはc++17からの機能
 
int main() {
   ll a,b,c,d;
   cin>>a>>b>>c>>d;

   cout<<(b-a+1)-(b/c+b/d-b/lcm(c,d)-((a-1)/c+(a-1)/d-(a-1)/lcm(c,d)))<<endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
const int Inf = 1e9;
int a, b, c, d;
int ans;

int main() {
	while(~scanf("%d %d %d %d", &a, &b, &c, &d)) {
		int r1, r2;
		if(a <= b) r1 = a;
		else r1 = b;
		if(c <= d) r2 = c;
		else r2 = d;
		ans = r1 + r2;
		printf("%d\n", ans);
	}
}

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

using ll = long long;

const int INF = 1001001001;
const ll INF_LL = 1001001001001001001LL;

int main(void){
  string s; cin >> s;

  int ans = 0;
  rep(i,s.size()){
    int tmp = 0;
    if(s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T'){
      tmp++;
      for(int j = i+1;j<s.size();j++){
	if(s[j] == 'A' || s[j] == 'C' || s[j] == 'G' || s[j] == 'T'){
	  tmp++;
	}
	else break;
      }
    }
    ans = max(ans,tmp);
  }

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


Measured memory_bytes: 3620
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <cmath>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define MA(i,j) make_pair(i,j)
#define PA pair<int,int>
#define PB push_back
#define PQ priority_queue<int>
#define PGQ priority_queue<int,vector<int>,greater<int> >
#define VE vector<int>
#define VP vector<PA>
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"Yes":"No")<<endl
#define MOD 1000000007
#define INF 1000000007
using namespace std;
//
int main(){
  long long N,cnt=0;
  cin>>N;
  for(long long i=sqrt(N);i>0;i--){
    if(N%i==0){
      int A=max(i,N/i);
      while(A/10){
        cnt++;
        A/=10;
      }
      cout<<cnt+1<<endl;
      return 0;
    }
  }
}


Measured memory_bytes: 256