akhauriyash/Code-Regression huggingface dataset:
#if defined(__GNUC__)
#include <bits/stdc++.h>
// __GNUC__
#else
#include "bits/stdc++.h"
#endif
using namespace std;

#define int long long

#if defined(__GNUC__)
#define __int32 __int32_t
#endif // __GNUC__

#define itn __int32
#define REP(i, n) for(itn (i) = 0; (i) < (n); ++(i))
#define REP2(i, x, n) for(itn (i) = x; (i) < (n); ++(i))
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define SORT(x) std::sort(ALL(x))
#define RSORT(x, T) std::sort(ALL(x), greater<T>())
#define REVERCE(x) std::reverce(ALL(x))
#define ACM(x, y) std::accumulate(ALL(x), y)

#define INT_POW(x, y) [](int a, int b) -> int {int c = a; REP(i, b - 1){c *= a;} return c;}(x, y)
#define INT_POWM(x, y, m) [](int a, int b, int m) -> int {int c = a; REP(i, b - 1){c *= a; c %= m;} return c;}(x, y, m)

int kaisu(int tim, int h);

itn main() {
	std::ios::sync_with_stdio(false);

	int h;

	cin >> h;

	int val = 1;

	cout << kaisu(1, h);

	return 0;
}

int kaisu(int tim, int h) {
	if(h == 1){
		return tim;
	}
	
	return kaisu(tim * 2, h / 2) + tim;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, n) for(int i = 1; i <= n; i++)
#define REP(i, n) for(int i = 0; i < n; i++)
#define MP make_pair
#define FI first
#define SE second
#define VI vector<int>
#define CLR(x) memset(x, 0, sizeof(x))
#define SZ(x) (x.size())
#ifdef QWERTIER
#define err(x) cerr<<x<<endl;
#else
#define err(x)
#endif

typedef long long LL;
#define MOD 1000000007

#define N 1010
int cnt[N];
int main() {
#ifdef QWERTIER
  freopen("in.txt", "r", stdin);
#endif
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int tmp = i;
    for (int j = 2; j <= n; j++) {
      if (tmp%j==0) {
        while (tmp % j ==0) {
          tmp /= j;
          cnt[j]++;
        }
      }
    }
  }
  int ans = 1;
  FOR (i, 1000) {
    ans = ans * (LL)(cnt[i]+1)% MOD;
  }
  printf("%d\n", ans);
  return 0;
}


Measured memory_bytes: 256
/*BISMILLAH
THE WHITE WOLF
NO DREAM IS TOO BIG AND NO DREAMER IS TOO SMALL*/

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<long long> vll;
typedef vector<int> vi;

#define io ios_base::sync_with_stdio(false)
#define pb push_back
#define eb emplace_back
#define mod   998244353
#define PI 2*acos(0.0)
int dirx[] = {1, -1,0, 0}, diry[] = {0, 0, 1, -1};

ll bigmod(ll x, ll p)
{
    ll res = 1;
    while(p)
    {
        if(p&1)
            res = (res*x)%mod;
        x = (x*x)%mod;
        p >>= 1;
    }
    return res;
}

//=============================================ASIFAZAD==============================================//

int32_t main()
{
    io;
    int x;
    cin>>x;
    int a, b;
    for(int i = -121; i < 121; i++)
    {
        for(int j = -121; j < 121; j++)
        {
            if(1LL*i*i*i*i*i - 1LL*j*j*j*j*j == x)
            {
                a = i;
                b = j;
            }
        }
    }
    cout<<a<<" " <<b;
    return 0;
}

Measured memory_bytes: 3688
#include<iostream>
#include<cmath>
 
using namespace std;
typedef unsigned long long ullong;
 
ullong power(ullong x, ullong n, ullong M){
  ullong tmp = 1;
 
  if ( n > 0 ){
    tmp = power(x, n/2, M);
    if ( n%2 == 0 ) tmp = (tmp*tmp)%M;
    else tmp = (((tmp*tmp)%M)*x)%M;
  }
  return tmp;
}
 
main(){
  int m, n;
  cin >> m >> n;
 
  cout << power(m, n, 1000000007) << endl;
 
  return 0;
}

Measured memory_bytes: 3100
#include <bits/stdc++.h>
using namespace std;
//#pragma GCC target("avx2")
#pragma GCC optimize("-O3")
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define INF 1e18
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> PII;
typedef double db;
mt19937 mrand(random_device{}());
const ll mod=1743;
const ll gd = 2000001;
const ll gd_o = 1000001;
//const ll p = 31;
const ll MD=1e6 + 3;
int rnd(int x) { return mrand() % x;}
ll fastpow(ll a, ll n) {ll res=1;while(n){if(n&1)res*=a;a*=a;n>>=1;}return res;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
ll nok(ll a,ll b){ return (a * b / gcd(a, b));}


int main() {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//    freopen("input.txt","r",stdin);
//    freopen("output.txt","w",stdout);
//    freopen("msched.in", "r", stdin);
//    freopen("msched.out", "w", stdout);
    ll n, ans = 0;
    cin >> n;
    for (int i = 1; i <= n; i++) {
        if (i % 3 == 0 && i % 5 == 0) continue;
        else if (i % 3 == 0) continue;
        else if (i % 5 == 0) continue;
        else ans += i;
    }
    cout << ans;
}


Measured memory_bytes: 3660
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
  int n;
  cin>>n;
  int p[n+1];
  for(int i=0;i<n;i++)
  {
      int temp;
      cin>>temp;
      p[temp]=i+1;
  }
  for(int i=1;i<=n;i++)
  cout<<p[i]<<" ";
  return 0;
}
    

Measured memory_bytes: 1280
/*
 * Insertion Sort.c
 *
 *  Created on: 2015/02/13
 */
#include <stdio.h>

void presentation(int N,int A[]){
	int i;

	for(i=0;i<N-1;i++){
		printf("%d ",A[i]);
	}
	printf("%d\n",A[N-1]);
}

void swap(int *from,int *to){
	int tmp;

	tmp = *to;
	*to = *from;
	*from  = tmp;
}

void insert_sort(int N,int A[]){
	int i,j;

	presentation(N,A);

	for(i=1;i<N;i++){
		j=i;



		while((j>0) && (A[j-1] > A[j])){
			swap(&A[j-1],&A[j]);

			j--;
		}
	presentation(N,A);
	}

}


int main(void){
	int N,A[100];
	int i;

	scanf("%d",&N);

	for(i=0;i<N;i++){
		scanf("%d",&A[i]);
	}

	insert_sort(N,A);

	return 0;
}

Measured memory_bytes: 600
import sys

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


def main():
    N, D = map(int, readline().split())
    F = 2 * D + 1
    print((N + F - 1) // F)

    return


if __name__ == '__main__':
    main()


Measured memory_bytes: 9112
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In, ' '));
        }

        public void Solve(ConsoleInput cin)
        {
            int N =cin.ReadInt;
            int L =cin.ReadInt;
            var taste = new List<int>();
            for(int t = L;t<L+N;t++){
                taste.Add(t);
            }
            var T = taste.OrderBy(x => Abs(x)).ToList();
            WriteLine(T.Sum() - T[0]);
        }
    }

    public class ConsoleInput
    {
        private readonly System.IO.TextReader _stream;
        private char _separator =' ';
        private Queue<string> inputStream;
        public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue<string>();
        }
        public string Read
        {
            get
            {
                if (inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for (int i = 0; i < tmp.Length; ++i)
                    inputStream.Enqueue(tmp[i]);
                return inputStream.Dequeue();
            }
        }
        public string ReadLine { get { return _stream.ReadLine(); }}
        public int ReadInt { get { return int.Parse(Read); }}
        public long ReadLong { get { return long.Parse(Read); }}
        public double ReadDouble { get { return double.Parse(Read); }}
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret;}
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret;}
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret;}
    }
}

Measured memory_bytes: 13524
<?php
$s=trim(fgets(STDIN));
$n=strlen($s);
$b=0;
$ans=0;
$i=0;
while($i<$n){
  if($s[$i]=="W"){
    $ans+=$b;
  }else{
    ++$b;
  }
  ++$i;
}
echo $ans;

Measured memory_bytes: 4856
import fractions as f
a,b,k=map(int,input().split())
g=f.gcd(a,b)
count=0
#print(g)
for s in range(g,0,-1):
    if g%s==0:
  #      print(s)
        count+=1
    if count==k:
        print(s)
        exit()

Measured memory_bytes: 5048
#include<iostream>
#include<algorithm>
using namespace std;
int n;
long a[16][16],dp[1<<16],sum[1<<16];
main()
{
	cin>>n;
	for(int i=0;i<n;i++)for(int j=0;j<n;j++)cin>>a[i][j];
	for(int i=0;i<1<<n;i++)
	{
		for(int j=0;j<n;j++)
		{
			if(i&1<<j)
			{
				for(int k=j+1;k<n;k++)
				{
					if(i&1<<k)sum[i]+=a[j][k];
				}
			}
		}
	}
	for(int i=0;i<1<<n;i++)
	{
		for(int j=i+1|i;j<1<<n;j=j+1|i)
		{
			dp[j]=max(dp[j],dp[i]+sum[j&~i]);
		}
	}
	cout<<dp[(1<<n)-1]<<endl;
}

Measured memory_bytes: 1280
use std::cmp::{min, Ordering};
use std::collections::VecDeque;
use std::io::{stdin, Read};
use std::str::FromStr;

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

#[allow(dead_code)]
fn main() {
    let n = read::<usize>();
    let k = read::<usize>();
    let hh = (0..n).map(|_| read::<usize>()).collect::<Vec<_>>();
    let mut ans = 0;
    for h in hh {
        if h >= k {
            ans += 1;
        }
    }
    println!("{}", ans)
}


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

using namespace std;
#define all(a)a.begin(),a.end()
#define rep(i,n) for (int i = 0; i < (n); ++i)
using ll=long long;
const int INF = 1<<30;
const ll INFll =1LL<<62;
const int mod = int(1e9)+7;
using V = vector<int>;
using P = pair<int,int>;

int main()
{
    ll n;cin >>n;
    vector<string> s(n);
    rep(i,n){
        string a;cin >>a;
        sort(all(a));
        s[i]=a;
    }
    sort(all(s));
    vector<ll> l;
    int co=1;
    rep(i,n){
        if(i==n-1){
            l.push_back(co);
            continue;
        }
        if(s[i]==s[i+1])co++;
        else {
            l.push_back(co);
            co=1;
        }
    }
    ll ans=0;
    for(ll i:l){
        ans+=i*(i-1)/2;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 6904
#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>

/* define */
#define Yes(X) puts ( (X) ? "Yes" : "No")
#define YES(X) puts ( (X) ? "YES" : "NO")
#define FOR(i, a, b) for ( int i = (a); i < (b) ; i++)
#define REP(i, n) for ( int i = 0; i < (n) ; i++)
#define max(a, b) (((a) > (b)) ? (a) : (b))
#define min(a, b) (((a) < (b)) ? (a) : (b))
#define max3(a, b, c) ((max((a), (b)) > (c)) ? max((a), (b)) : (c))
#define min3(a, b, c) ((min((a), (b)) < (c)) ? min((a), (b)) : (c))

/* const */
const int MOD = 1000000007;

/* alias */
typedef long long ll;
typedef unsigned  u;

/* function */
int cmp(const void *a, const void *b) {
	return *(int*)a - *(int*)b;
}
int cmp2(const void *a, const void *b) {
	return *(int*)b - *(int*)a;
}
int gcd(int a, int b) {
	if (b != 0)return gcd(b, a % b);
	return a;
}
ll Lgcd(ll a, ll b) {
	if (b != 0) return Lgcd(b, a % b);
	return a;
}
int lcm(int a, int b) {
	return a / gcd(a, b) * b;
}
ll Llcm(ll a, ll b) {
	return a / Lgcd(a, b) * b;
}

/* main */

int main() {
	int n, a[200000], max = 0, nmax;
	scanf("%d", &n);
	REP(i, n) {
		scanf("%d", &a[i]);
		if (a[i] > max) {
			max = a[i];
			nmax = i;
		}
	}
	qsort(a, n, sizeof(int), cmp2);
	REP(i, n) {
		if (i == nmax)printf("%d\n", a[1]);
		else printf("%d\n", a[0]);
	}
	return 0;
}

Measured memory_bytes: 2352
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;

int tax(int a, int x) {
	return a + (a * x / 100);
}

int main() {
	int x, y, s;
	cin >> x >> y >> s;
	while (x || y || s) {
		int p = 0;
		loop(a, 1, s) {
			int b = (s - tax(a, x)) * 100 / (100 + x) - 1;
			if (b < 0) break;
			while (tax(a, x) + tax(b, x) <= s) b++;
			b--;
			if (tax(a, x) + tax(b, x) != s) continue;
			if (p < tax(a, y) + tax(b, y)) {
				p = tax(a, y) + tax(b, y);
			}
		}
		cout << p << endl;
		cin >> x >> y >> s;
	}
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll,ll> l_l;
const int INF=1001001000;
const int mINF=-1001001000;
const ll LINF=1010010010010010000;
template<class T> inline bool chmin(T& a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template<class T> inline bool chmax(T& a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
int main(){
    int n;cin >> n;
    string s;cin >> s;
    vector<int> a(n);
    for(int i=0;i<n;i++) a[i]=(s[i]=='o');
    for(int ti=0;ti<2;ti++){
        for(int tj=0;tj<2;tj++){
            vector<int> b(n);
            b[0]=ti,b[1]=tj;
            for(int i=0;i<n;i++){
                int j=(i+1)%n;
                b[(i+2)%n]=b[i]^b[j]^a[j];
            }
            if(b[0]==ti&&b[1]==tj){
                string ans="";
                for(int i=0;i<n;i++) ans+="WS"[b[i]];
                cout << ans << endl;
                return 0;
            }
        }
    }
    cout << -1 << endl;
    return 0;
}

Measured memory_bytes: 1408
#include<iostream>
#include<string>
#include<vector>
#define rep(i,n) for(int i=0;i<(n);++i)


using namespace std;

int main(){
	int A,B;
	cin >>A>>B;
	int ans=A-2*B;
	if(ans<=0)ans=0;
	
	cout<<ans<<endl;
return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;

int main(void) {
int a, b, c, d;

std::cin >> a >> b >> c >> d;

if (abs(b-a) <= d && abs(c-b) <= d || abs(c-a) <= d) {
  std::cout << "Yes" << '\n';
} else std::cout << "No" << '\n';

return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
#define VL vector<ll>
#define VS vector<string>
#define VB vector<bool>
#define VP vector<pair<ll,ll>>
#define VVL vector<vector<ll>>
#define VVP vector<vector<pair<ll,ll>>>
#define PL pair<ll,ll>
#define ALL(v) (v).begin(), (v).end()
ll d1[4] = {1, -1, 0, 0};
ll d2[4] = {0, 0, 1, -1};

int main(){
    ll A, B;
    cin >> A >> B;
    ll K = 50;
    VVL ans(2*K, VL(2*K));
    rep(i, 0, K){
        rep(j, 0, 2*K) ans[i][j] = -1; 
    }
    rep(i, K, 2*K){
        rep(j, 0, 2*K) ans[i][j] = 1; 
    }
    ll ii = 0, jj = 0;
    rep(c, 0, B-1){
        ans[jj][ii] = 1;
        if(ii + 2 >= 2 * K){
            jj += 2;
            ii = 0;
        }else{
            ii += 2;
        }
    }
    ii = 0, jj = K + 1;
    rep(c, 0, A-1){
        ans[jj][ii] = -1;
        if(ii + 2 >= 2 * K){
            jj += 2;
            ii = 0;
        }else{
            ii += 2;
        }
    }

    cout << 2*K << " " << 2*K << endl;
    rep(i, 0, 2*K){
        rep(j, 0, 2*K){
            if(ans[i][j] == 1) cout << '#';
            else cout << '.';
        }
        cout << endl;
    }
    return 0;
}

Measured memory_bytes: 384
#coding: utf-8

def xor_from0(n):
    a = ~0
    if(n&1): a = 0
    ans = ((n >> 1) & a) << 1
    one = (n&1) ^ ((n&2)>>1)
    return ans ^ one

a, b = map(int, raw_input().split())
print(xor_from0(b) ^ xor_from0(a-1))



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

struct Node {
    int key;
    struct Node *next,*prev;
};

struct Node *nil;

struct Node* listSearch(int key) {
    struct Node *cur=nil->next;
    while (cur!=nil && cur->key!=key) {
        cur=cur->next;
    }
    return cur;
}
void init() {
    nil = (struct Node *)malloc(sizeof(struct Node));
    nil->next = nil;
    nil->prev = nil;
}
void printlist() {
    struct Node *cur = nil->next;
    int cnt=0;
    while (1) {
        if (cur==nil) {
            break;
        }
        if ( cnt++ > 0 ) {
            printf(" ");
        }
        printf("%d",cur->key);
        cur = cur->next;
    }
    printf("\n");
}
void deleteNode(struct Node *t) {
    if (t==nil) {
        return;
    }
    t->prev->next = t->next;
    t->next->prev = t->prev;
    free(t);
}
void deleteFirst() {
    deleteNode(nil->next);
}
void deleteLast() {
     deleteNode(nil->prev);
}
void deletekey(int key) {
    deleteNode(listSearch(key));
}
void insert(int key) {
    struct Node *x = (struct Node *)malloc(sizeof(struct Node));
    x->key = key;
    x->next = nil->next;
    nil->next->prev = x;
    nil->next = x;
    x->prev = nil;   
}
int main() {
    int key, n, i;
    int size = 0;
    char cmd[20];
    scanf("%d",&n);
    init();
    for (i=0; i<n; i++) {
        scanf("%s%d",cmd,&key);
        if (cmd[0]=='i') {
            insert(key);
        } 
        else if (cmd[0]=='d') {
            if (strlen(cmd)>6) {
                if (cmd[6]=='F') {
                    deleteFirst();
                } 
                else if (cmd[6]=='L') {
                    deleteLast();
                }
            }
            else {
              deletekey(key);
            }
        }
    }
    printlist();
    return 0;
}


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

typedef long long ll;
typedef pair<int,int> P;
typedef map<int,int> M;
typedef vector<int> V;
typedef queue<int> Q;
typedef pair<long,long> PLL;
typedef map<long,long> MLL;
typedef vector<long long> VLL;
typedef vector<pair<int,int>> VP;
typedef vector<vector<int>> VV;
#define INF (int)(1e9)
#define MAXX 1.1529215e+18
#define inf 999999
#define EPS (1e-7)
#define MOD (1e9+7)
#define rep(i,n) for(int i=0; i<(int)(n);i++)
#define REP(i,n) for(int i=1;i<=(int)(n);i++)
#define rrep(i,n) for(int i=(int)(n-1);i>=0;i--)
#define FOR(i,k,n) for(int i=(k);i<(int)(n);i++)
#define ALL(a)  a.begin(),a.end()
#define RALL(a) a.begin(),a.end(),greater<int>()
#define PRALL(a) a.begin(),a.end(),greater<pair<int,int>>()
#define ROT(a) a.begin(),a.begin()+1,a.end()
#define RROT(a) a.begin(),a.end()-1,a.end()
#define PB push_back
#define MP make_pair
#define PI acos(-1.0)
/*--------------------------------------------*/
int main(){
    string s;cin>>s;
    int n=(int)s.size();
    n-=2;
    while(1){
        int half=n/2;
        string front=s.substr(0,half);
        string back=s.substr(half,half);
        if(front==back)break;
        else n-=2;
    }
    cout<<n<<endl;
}


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

using namespace std;



int main(){

	int a[9];
	int n,b;
	for (auto& x : a) cin >> x;
	cin >> n;

	for (int i = 0; i < n; i++){
		cin >> b;
		for (auto& x : a) {
			if (x == b) x = 0;
		}
	}

	if (a[0] + a[1] + a[2] == 0 || a[3] + a[4] + a[5] == 0 || a[6] + a[7] + a[8] == 0 ||
		a[0] + a[3] + a[6] == 0 || a[1] + a[4] + a[7] == 0 || a[2] + a[5] + a[8] == 0 ||
		a[0] + a[4] + a[8] == 0 || a[6] + a[4] + a[2] == 0) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
	

	cin >> n;
	return 0;

	
}



Measured memory_bytes: 256
//ABC0115A
#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <numeric>
#include <math.h>
#include <stdio.h>
#include <climits>
#include <cfloat>
#include <string>
using namespace std;

int main(){
	int d;
	cin >> d;
	cout << "Christmas";
	for(int i=25;i>d;i--){
		cout << " Eve";
	}
	return 0;
}

Measured memory_bytes: 256
#!/usr/bin/env python3

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)


N = int(input())
S, T = input().split()

res = ""
for i in range(N):
    res += S[i] + T[i]

print(res)

Measured memory_bytes: 9120
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys

input = sys.stdin.readline

def main():
    N, M = map(int, input().split())
    X = list(map(int, input().split()))
    X.sort()

    diff = [0] * (len(X)-1)
    for i in range(len(X)-1):
        diff[i] = X[i+1] - X[i]

    diff.sort(reverse=True)
    print(sum(diff[N-1:]))

main()


Measured memory_bytes: 13956
N, K = map(int, input().split())
s = input()
S = [int(x) for x in list(str(s))]

l = []
tmp = 1
p = S[0]

for i in range(1, N):
    if p == S[i]:
        tmp += 1
    else:
        l.append(tmp)
        p = S[i]
        tmp = 1
l.append(tmp)

if len(l) == 1:
    print(N)
    exit()

i = 0
check = False

if S[0] == 0:
    r = 2 * K - 1
    check = True
else:
    r = 2 * K

ans = sum(l[i:r + 1])
tmp = ans

while r < len(l) - 2:
    tmp += l[r + 1] + l[r + 2]
    r += 2
    if check:
        tmp -= l[i]
        i += 1
        check = False
    else:
        tmp -= l[i] + l[i + 1]
        i += 2
    ans = max(tmp, ans)

if S[-1] == 0:
    tmp += l[r + 1]
    if check:
        tmp -= l[i]
    else:
        tmp -= l[i] + l[i + 1]

ans = max(ans, tmp)
print(ans)


Measured memory_bytes: 5248
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int N = scanner.nextInt();
    Node[] nodes = new Node[N * (N - 1) / 2];
    for (int i = 0; i < N * (N - 1) / 2; i++) nodes[i] = new Node();

    for (int i = 0; i < N; i++) {
      int a = scanner.nextInt() - 1;
      for (int j = 1; j < N - 1; j++) {
        int b = scanner.nextInt() - 1;
        nodes[node(i, a, N)].adjs.add(nodes[node(i, b, N)]);
        a = b;
      }
    }

    try {
      int max = 0;
      for (int i = 0; i < N * (N - 1) / 2; i++) {
        max = Math.max(max, dfs(nodes[i]));
      }
      System.out.println(max);
    } catch (IllegalStateException e) {
      System.out.println(-1);
    }
  }

  private static int dfs(Node node) {
    if (node.maxPathLength > 0) return node.maxPathLength;
    if (node.visited) throw new IllegalStateException("loop");
    node.visited = true;
    int max = 0;
    for (Node a : node.adjs) {
      max = Math.max(max, dfs(a));
    }
    node.maxPathLength = max + 1;
    return node.maxPathLength;
  }

  private static int node(int i, int j, int N) {
    if (i > j) return node(j, i, N);
    int d = j - i;
    return (N - d) * (N - 1 - d) / 2 + i;
  }

  private static class Node {
    private final List<Node> adjs = new ArrayList<>();
    private int maxPathLength = -1;
    private boolean visited;
  }
}


Measured memory_bytes: 211676
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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

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

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

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

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

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

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

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        #[cfg(debug_assertions)]
        writeln!(&mut std::io::stderr(), concat!("[DEBUG] ", $(stringify!($a), "={:?} "),*), $($a),*);
    }
}

#[allow(unused_imports)]
use std::cmp::{min, max};

#[allow(unused_imports)]
use std::io::Write;

fn main() {
    input!{
      mut n: usize,
      m: usize,
      aa: [usize; m],
    }
    let nums = [
        0, 2 , 5 , 5 , 4 , 5 , 6 , 3 , 7 , 6
    ];
    let mut usable = vec![false; 10];
    for a in aa { usable[a] = true; }
    let mut dp = vec![None; n+1];
    dp[0] = Some(0);
    for i in 0..n+1 {
        for j in 1..10 {
            if !usable[j] { continue; }
            if i >= nums[j] {
                dp[i] = max(dp[i], dp[i-nums[j]].map(|v| v + 1));
            }
        }
    }

    let mut ans = vec![];
    while n > 0 {
        for j in (1..10).rev() {
            if !usable[j] { continue; }
            if n >= nums[j] && dp[n-nums[j]] == dp[n].map(|v| v-1) {
                n -= nums[j];
                ans.push(j);
                break;
            }
        }
    }
    println!("{}", ans.iter().map(|v| v.to_string()).collect::<String>());
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
using ll = long long;
int main(){
  string s;
  cin>>s;
  if (s=="AAA" || s=="BBB"){
    cout << "No";
  }else{
    cout << "Yes";
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define all(x) (x).begin(), (x).end()
using ll = long long;
using namespace std;
template <typename T> using vec = std::vector<T>;

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

    vec<int> A(N);
    map<int, int> mpA;
    rep(i, N) {
        cin >> A[i];
        ++mpA[A[i]];
    }

    vec<int> B(N);
    map<int, int> mpB;
    rep(i, N) {
        cin >> B[i];
        ++mpB[B[i]];
    }

    for (int i = 1; i <= N; ++i) {
        if (mpA[i] + mpB[i] > N) {
            cout << "No" << endl;
            return 0;
        }
    }

    cout << "Yes" << '\n';

    int now  = 0;
    rep(i, N) {
        if (A[i] == B[i]) {
            for(int j=now;j<N;j=(j+1)%N){
                if(A[j]!=B[i] && B[i] != B[j]){
                    swap(B[i],B[j]);
                    now=j;
                    break;
                }
            }
        }
    }
    rep(i, N) cout << B[i] << " ";
    cout << '\n';
}


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


class A{
public:
  int D, P;
  bool operator <(const A &a) const {
    if(P != a.P) return P > a.P;
    return D > a.D;
  }
};

main() {
  while(1) {
    int N, M;
    A a[10000];
    int sum;

    cin >> N >> M;
    if(N == 0 && M == 0) break;

    sum = 0;
    for(int i = 0; i < N; i++) {
      cin >> a[i].D >> a[i].P;
      sum += a[i].D * a[i].P;
    }
    sort(&a[0], &a[N]);

    for(int i = 0; i < N; i++) {
      if(M <= a[i].D) {
	sum -= M*a[i].P;
	break;
      } else {
	sum -= a[i].D*a[i].P;
	M -= a[i].D;
      }
    }
    cout << sum << endl;
  }
}

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

typedef long long ll;

int N;
ll L[100010],R[100010];
ll dif[2];
ll INF = 1001001001001001001;
multiset<ll> st[2];
multiset<ll>::iterator itel,iter;
ll ans;

void mov(int id)
{
    ll tmp = *st[id].begin();
    st[id].erase(st[id].begin());
    if(id)st[1 - id].insert(-(tmp + dif[id]) - dif[1 - id]);
    else st[1 - id].insert(-(tmp + dif[id]) - dif[1 - id]);
    return;
}

int main()
{
    scanf("%d",&N);
    for(int i = 0; i < N; i++)scanf("%lld%lld",L + i,R + i);

    st[0].insert(INF),st[1].insert(INF);
    for(int i = 0; i < N; i++)
    {
        if(i)
        {
            dif[0] += R[i] - L[i];
            dif[1] += R[i - 1] - L[i - 1];
        }

        int idl = 0,idr = 0;
        itel = st[0].begin();
        for(int j = 0; j < 2; j++)
        {
            if(*itel < -L[i] - dif[0])
            {
                itel++;
                idl++;
            }
        }
        iter = st[1].begin();
        for(int j = 0; j < 2; j++)
        {
            if(*iter < L[i] - dif[1])
            {
                iter++;
                idr++;
            }
        }

        if(idl)ans += -L[i] - dif[0] - *st[0].begin();
        if(idr)ans += L[i] - dif[1] - *st[1].begin();
        if(idl == idr)
        {
            st[0].insert(-L[i] - dif[0]);
            st[0].insert(-L[i] - dif[0]);
            mov(0);
        }
        if(idl)
        {
            st[0].insert(-L[i] - dif[0]);
            st[0].insert(-L[i] - dif[0]);
            mov(0);
        }
        if(idr)
        {
            st[1].insert(L[i] - dif[1]);
            st[1].insert(L[i] - dif[1]);
            mov(1);
        }
    }

    printf("%lld\n",ans);
}




Measured memory_bytes: 11136
#include <iostream>

using namespace std;

int main() {
  int n, tmp = -1, ans = 0;
  cin >> n;
  int a[n], b[n], c[n-1];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  for (int i = 0; i < n; ++i) {
    cin >> b[i];
  }
  for (int i = 0; i < n-1; ++i) {
    cin >> c[i];
  }
  for (int i = 0; i < n; ++i) {
    ans += b[a[i] - 1];
    if (tmp + 1 == a[i]) ans += c[tmp - 1];
    tmp = a[i];
  }
  cout << ans << endl;
  return 0;
}

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

#define f(i,a,b) for( ll i = a; i < b ; i++ )
#define af(i,a,b) for( ll i = a; i >= b ; i--)
#define rep(i,a,b,k) for(ll i = a; i < b ; i+= k )
#define arep(i,a,b,k) for( ll i = a; i >= b ; i-= k)
#define ones(x) (ll) __builtin_popcount(x)
#define fs first
#define sc second
#define pb push_back
#define po pop_back
#define mp make_pair  
#define sz(a) (ll) a.size()
#define all(a) a.begin(), a.end()
#define sor(a) sort( a.begin(), a.end() )
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL)
#define ller ios::sync_with_stdio(false);cin.tsie(nullptr);cout.tie(nullptr)
#define watch(x) cout << (#x) << " is " << (x) <<"#" <<endl
#define PI 3.1415926535
using namespace std;
typedef long long ll;
typedef long double ld; 
typedef pair<ll,ll> ii ;
typedef vector<ll>  vi ;
typedef vector<ii> vii ;
const ll mod = 998244353;
const ll MAX = 3e3+23;
const ll inf = 1e18+7;


int main(){
  fastio;
  string s,t;
  cin>>s>>t;
  ll ans = inf;
  f(i,0,sz(s)-sz(t)+1){
    ll cnt=0;
    f(j,0,sz(t)){
        if(s[j+i]!=t[j]) cnt++;
    }
    ans = min(ans,cnt);
  }
  cout<<ans<<"\n";
  return 0; 
}

Measured memory_bytes: 3668
#include <bits/stdc++.h>
using namespace std;
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,n1,n2) for(int i=n1;i<n2;i++)
#define bFOR(i,n1,n2) for(int i=n1;i>=n2;i--)
#define speed_up    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

typedef long long int ll;
typedef pair<int,int> Pi;
const int INF=(ll)(1LL<<30)-1;
const double INFd=100000000000.0;
const ll INFl=(ll)9223372036854775807;
const int MAX=10000;
const ll MOD=(ll)1e9+7;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a, b)*b;}
int dx[4]={0,1,0,-1},dy[4]={-1,0,1,0};

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

int n,m,p;
int x[110];
vector<int> ans;

int main(){
	while(1){
		int sum=0;
		cin>>n>>m>>p;
		if(n==0&&m==0&&p==0)break;
		REP(i,n){
			cin>>x[i];
			sum+=x[i];
		}
		sum*=100;
		if(x[m-1]==0){
			ans.push_back(0);
		
			continue;
		}
		sum=sum*(100-p)/100;
		ans.push_back(sum/x[m-1]);
	}
	REP(i,ans.size())
		cout<<ans[i]<<endl;
	return 0;
}


Measured memory_bytes: 3032
import java.math.BigInteger

fun main(args: Array<String>) {
  val (n, p) = readLine()!!.split(" ").map { it.toLong() }
  println(solve(n, p))
}

fun solve(n: Long, p: Long): Long {
  if (n >= 60) return 1
  if (n == 1L) return p
  var max = 1L
  var x = 1L
  while (true) {
    if (BigInteger.valueOf(x).pow(n.toInt()) > BigInteger.valueOf(p)) {
      break
    }
    val xp = BigInteger.valueOf(x).pow(n.toInt()).toLong()
    if (p % xp == 0L) {
      max = x
    }
    x++
  }
  return max
}

Measured memory_bytes: 116724
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
 int n;
 cin>>n;
 vector<int> a(n),b(n),c(n);
 for(int i=0;i<n;i++) cin>>a[i]>>b[i]>>c[i];
 vector<vector<int>> dp(n,vector<int>(3));
 dp[n-1][0]=a[n-1];
 dp[n-1][1]=b[n-1];
 dp[n-1][2]=c[n-1];
 for(int i=n-2;i>=0;i--){
  dp[i][0]=a[i]+max(dp[i+1][1],dp[i+1][2]);
  dp[i][1]=b[i]+max(dp[i+1][0],dp[i+1][2]);
  dp[i][2]=c[i]+max(dp[i+1][0],dp[i+1][1]);
 }
 cout<<max({dp[0][0],dp[0][1],dp[0][2]})<<endl;
 return 0;
}

Measured memory_bytes: 6912
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut 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")
    };
}

fn getGroupId(a: usize) -> usize {
    let g = vec![vec![1, 3, 5, 7, 8, 10, 12], vec![4, 6, 9, 11], vec![2]];
    
    for (id, v) in g.iter().enumerate() {
        if v.contains(&a) {
            return id;
        }
    }

    100
}

fn main() {
    input!{
        x: usize,
        y: usize,
    }

    let mut x_id = getGroupId(x);
    let mut y_id = getGroupId(y);

    println!("{}", if x_id == y_id { "Yes" } else { "No" });
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
#define ll long long int 
#define mod 1000000007
#define se second
#define fi first
using namespace std;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	ll k,n;
	cin>>k>>n;
	ll arr[n];
	for(int a=0;a<n;a++)
	cin>>arr[a];
	ll z=100000000;
	for(int a=0;a<=n-1;a++)
	{
		if(a==0)
		z=min(z,arr[n-1]-arr[0]);
		else 
		{
			z=min(z,k-arr[a]+arr[a-1]);
		}
	}
	cout<<z;
	return 0;
}


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

void output(vector<int> a, bitset<3> op){
   rep(i,3){
      cout << a.at(i);
      if(op.test(i)) cout << '+';
      else cout << '-';
   }
   cout << a.at(3) << "=7" << endl;
}

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


   vector<int> a(4);
   a.at(0) = N/1000;
   a.at(1) = (N%1000)/100;
   a.at(2) = (N%100)/10;
   a.at(3) = N%10;

   int sum;
   rep(i,(1<<3)){
      bitset<3> op(i);
      sum = a.at(0);
      rep(j,3){
         if(op.test(j)) sum += a.at(j+1);
         else sum -= a.at(j+1);
      }
      if(sum==7){
         output(a,op);
         return 0;
      }
   }
   cout << "Wrong code! NO ANSWER is founded." << endl;
   return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <algorithm>
#include <climits>
#include <vector>
#include <string>
#define REP(i,n) for (int i=0;i<(n);i++)
using namespace std;

int main(){
    string s, s1, s2;
    cin >> s;
    int n = s.size()/2;
    int ans = 0;
    for(int i = 0; i < n; ++i){
        s1 = s.substr(0, i);
        s2 = s.substr(i, i);
        if(s1 == s2){
            ans = i;
        }
    }
    cout << ans * 2 << endl;
    return 0;
}


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

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

    int R1[26], R2[26];
    for (int i = 0; i < 26; ++i) {
        R1[i] = -1;
        R2[i] = -1;
    }

    bool same = true;
    for (int i = 0; i < S.size(); ++i) {
        if (R1[(int)(S[i] - 'a')] >= 0) {
            if (R1[(int)(S[i] - 'a')] != (int)(T[i] - 'a')) {
                same = false;
                break;
            }
        }
        if (R2[(int)(T[i] - 'a')] >= 0) {
            if (R2[(int)(T[i] - 'a')] != (int)(S[i] - 'a')) {
                same= false;
                break;
            }
        }
        if (R1[(int)(S[i] - 'a')] < 0) {
            R1[(int)(S[i] - 'a')] = (int)(T[i] - 'a');
        }
        if (R2[(int)(T[i] - 'a') < 0]) {
            R2[(int)(T[i] - 'a')] = (int)(S[i] - 'a');
        }
    }

    if (same) cout << "Yes" << endl;
    else cout << "No" << endl;
    
    return 0;
}

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

long long int N, i;

int main(){
    scanf("%lld", &N);
    i = int(sqrt(N));
    for(; i > 0; --i){
        if(N % i == 0){
            cout << int(log10(N / i)) + 1 << endl;
            return 0;
        }
    }
    return 0;
}


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

using namespace std;
typedef long long ll;
#define int ll

#define REP(i,n) for(int i=0;i<n;++i)
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
#if 1
#  define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
#  define DBG(fmt, ...)
#endif

const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const double DINF = std::numeric_limits<double>::infinity();
const int MOD = 1000000007;
#define MAX_N 100010

string S;
int K;

signed main()
{
    cin >> S >> K;
    REP(i, S.length()) {
        int cost = 'z' - S[i] + 1;  // a にするのに必要なコスト
        if(S[i] != 'a' && cost <= K) {
            S[i] = 'a';
            K -= cost;
        }
    }
    int ind = S.length() - 1;
    K %= 26;
    while(K > 0) {
        S[ind] = S[ind] + 1;
        if(S[ind] > 'z') { S[ind] = 'a'; }
        K--;
    }
    cout << S << endl;
    return 0;
}


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

int main() {
  int N;
  cin >> N;
  vector<char> S(N);
  for (int i = 0; i < N; i++) {
    cin >> S.at(i);
  }
  bool four = false;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == 'Y') four = true;
  }
  if (four) cout << "Four" << endl;
  else cout << "Three" << endl;
}

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

using namespace std;
int main()
{
    long long a,b,c,k;
    cin >> a;
    cin >> b;
    cin >> c;
    cin >> k;
    long long i = 0;
    long long sum = 0;

    
    if(a>=k){
        sum = k;
    }
    else{
        if(b>=k-a){
            sum = a;
        }
        else{
            sum = a - (k-a-b);
        }
    }
    cout << sum;
}

Measured memory_bytes: 3624
N = int(input())
T, A = map(int, input().split())

H = list( map(int, input().split()))

mindiff = 1e9
ans = -1

for i in range(N):
  if abs(T - 0.006*H[i] -A) < mindiff:
    mindiff = abs(T - 0.006*H[i] -A)
    ans = i+1
    
print(ans)

Measured memory_bytes: 3060
N = int(input())
A = list(map(int, input().split()))
Q = int(input())

lis = [0]*(10**5 + 1)
total = 0
for a in A:
    lis[a] += 1
    total += a

for q in range(Q):
    b,c = map(int, input().split())
    x,y = lis[b],lis[c]
    lis[b] = 0
    lis[c] += x
    total += (c-b)*x
    print(total)

Measured memory_bytes: 20900
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int a,b;
    cin >> a >> b;
    if(a<b)
    {
        if(a==1)
        {
            cout << "Alice" << endl;
        }
        else
        {
            cout << "Bob" << endl;
        }
    }
    if(b<a)
    {
        if(b==1)
        {
            cout << "Bob" << endl;
        }
        else
        {
            cout << "Alice" << endl;
        }
    }
    if(a==b)
    {
        cout << "Draw" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define repr(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define reprrev(i,a,b) for(int i=b-1;i>=a;i--) // [a, b)
#define reprev(i,n) reprrev(i,0,n)

                    
using ll = long long;
using ull = unsigned long long;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
const ll mod = 1e9+7;
void chmod(ll &M){
  if(M >= mod) M %= mod;
  else if(M < 0){
     M += (abs(M)/mod + 1)*mod;
    M %= mod;
}
}
ll modpow(ll x, ll n){
   if(n==0) return 1;
  ll res=modpow(x, n/2);
 if(n%2==0) return res*res%mod;
else return res*res%mod*x%mod;
}
int getl(int i, int N) { return i==0? N-1:i-1; };
int getr(int i, int N) { return i==N-1? 0:i+1; };
long long GCD(long long a, long long b) {
  if (b == 0) return a;
  else return GCD(b, a % b);
}

using namespace std;

int main()
{
  int K;
  cin >> K;
  int sum = 0;
  for(int i = 1; i <= K; i++) {
    for(int j = 1; j <= K; j++) {
      for(int k = 1; k <= K; k++) {
        sum += GCD(GCD(i, j), GCD(j, k));
      }
    }
  }


  cout << sum << endl;

}

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

using namespace std;

int r,g,b;

int main(){
	scanf("%d%d%d", &r, &g, &b);
	
	if((r * 100 + g * 10 + b) % 4 == 0)
	printf("YES\n");
	else
	printf("NO\n");
}

Measured memory_bytes: 256
#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 n;
  cin>>n;
  ll ans=0;
  REP(i, n+1){
    if(i%3==0 || i%5==0){
      continue;
    }
    ans+=i;
  }
  cout<<ans<<'\n';
  return 0;
}


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

int n, a, b, x, y;
std::string s;

int main() {
  std::cin >> n >> a >> b >> s;
  x = 0;
  y = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'a' && x < (a+b)) {
      std::cout << "Yes" << std::endl;
      x++;
    }
    else if (s[i] == 'b' && x < (a+b) && y < b) {
      std::cout << "Yes" << std::endl;
      x++;
      y++;
    }
    else {
      std::cout << "No" << std::endl;
    }
  }
}

Measured memory_bytes: 896
#include<iostream>
using namespace std;
int main()
{
  int n,count=0,flag=0,d1,d2;
  cin>>n;
  for(int i=0;i<n;i++)
  {
    cin>>d1>>d2;
    if(d1==d2)
      count++;
    else
    {
      if(count>=3)
        flag=1;
      count=0;
    }
  }
  if(count>=3)
	flag=1;
  if(flag==1)
    cout<<"Yes";
  else
    cout<<"No";
 return 0;
}  

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

#define int long long
#define For(i, a, b) for (int i = (a); i <= static_cast<int>(b); i++)
#define Forr(i, a, b) for (int i = (a); i >= static_cast<int>(b); i--)
#define rep(i, n) For(i, 0, n - 1)
#define repall(i, arr) for (auto& i : (arr))
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define dump(x) cerr << #x << " = " << (x) << '\n'
#define dump2(x, y) \
    cerr << #x << " = " << (x) << " " << #y << " = " << (y) << '\n'

template <typename T>
using pq = priority_queue<T>;
template <typename T>
using pqr = priority_queue<T, vector<T>, greater<T>>;
const int INF = LLONG_MAX / 2;
constexpr int MOD = 1e9 + 7;
using P = pair<int, int>;
using vec = vector<int>;
using mat = vector<vec>;

template <typename T1, typename T2>
ostream& operator<<(ostream& stream, const pair<T1, T2>& p) {
    return stream << p.first << " " << p.second;
}
template <typename T>
void print(const vector<vector<T>> matrix) {
    repall (vec, matrix)
        print(vec);
}
template <typename T>
void print(const vector<T> vec) {
    unsigned int len = vec.size();
    rep (i, len - 1)
        cout << vec[i] << ' ';
    cout << vec[len - 1] << '\n';
}
template <typename Arg>
void print(const Arg arg) {
    cout << arg << '\n';
}
template <typename Head, typename... Args>
void print(const Head head, const Args... args) {
    cout << head << " ";
    print(args...);
}
template <typename T>
T sum_(vector<T> vec, T init = 0) {
    return std::accumulate(all(vec), T(init));
}

void yn(bool tf) { print(tf ? "Yes" : "No"); }
void YN(bool tf) { print(tf ? "YES" : "NO"); }

template <typename T>
void init(vector<T>& v) {
    rep (i, v.size())
        cin >> v[i];
}

template <typename T, typename U>
void init(vector<T>& v, vector<U>& w) {
    assert(v.size() == w.size());
    rep (i, v.size())
        cin >> v[i] >> w[i];
}

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

// -------------------------------------------------------------------
// sort 1 2 3 4
// pqr 1 2 3 must impl >

signed main() {
    cin.tie(0), cout.tie(0), ios::sync_with_stdio(false);
    int n, m;
    cin >> n >> m;
    vec a(m);
    init(a);
    vec dp(n + 1);
    dp[0] = 1;
    dp[1] = 1;
    repall (i, a)
        dp[i] = -1;

    if (n == 1) {
        print(1);
        return 0;
    }

    For(i, 2, n) {
        if (dp[i] < 0) continue;
        if (dp[i - 1] >= 0) dp[i] += dp[i - 1];
        dp[i] %= MOD;
        if (dp[i - 2] >= 0) dp[i] += dp[i - 2];
        dp[i] %= MOD;
    }
    print(dp[n]);

    return 0;
}


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

using namespace std;

using int64 = long long;

int main() {
  string s;
  cin>>s;
  string t;
  cin>>t;
  for(int i=0;i<(int)s.size();i++){
  	if(s==t){
  		cout<<"Yes";
  		return 0;
  	}
  	rotate(s.begin(),s.begin()+1,s.end());	
  }
  cout<<"No"<<endl;
  return 0;
}

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

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;
string char_to_string(char val) {
  return string(1, val);
}
int char_to_int(char val) {
  return val - '0';
}
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template<class T> inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int vector_finder(std::vector<ll> vec, int number) {
  auto itr = std::find(vec.begin(), vec.end(), number);
  size_t index = std::distance( vec.begin(), itr );
  if (index != vec.size()) { // 発見できたとき
    return 1;
  }
  else { // 発見できなかったとき
    return 0;
  }
}

int main() {
  int A, B; cin >> A >> B;
  int ans = 0;
  if(A >= 13) {
    ans += B;
  } else if(A >= 6 && A <= 12) {
    ans += B / 2;
  } else {
    ans = 0;
  }
  cout << ans << endl;
}


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

using namespace std;

#define int long long
#define endl "\n"

constexpr long long INF = (long long)1e18;
constexpr long long MOD = 1'000'000'007; 

string yn(bool f){return f?"Yes":"No";}
string YN(bool f){return f?"YES":"NO";}



signed main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(10);
	
	int N;
	int mini = INF, num = 0;
	
	cin>>N;
	
	for(int i = 0; i < N; i++){
		int a;
		
		cin>>a;
		
		if(mini > a){
			mini = a;
			num = i+1;
		}
	}
	
	cout<<num<<endl;
	
	
	return 0;
}


Measured memory_bytes: 3180