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

#ifdef LOCAL
#define DEBUG(...) debug(#__VA_ARGS__, __VA_ARGS__);
#else
#define DEBUG(...) 6;
#endif

template<typename T, typename S> ostream& operator << (ostream &os, const pair<T, S> &p) {return os << "(" << p.first << ", " << p.second << ")";}
template<typename C, typename T = decay<decltype(*begin(declval<C>()))>, typename enable_if<!is_same<C, string>::value>::type* = nullptr>
ostream& operator << (ostream &os, const C &c) {bool f = true; os << "["; for (const auto &x : c) {if (!f) os << ", "; f = false; os << x;} return os << "]";}
template<typename T> void debug(string s, T x) {cerr << s << " = " << x << "\n";}
template<typename T, typename... Args> void debug(string s, T x, Args... args) {cerr << s.substr(0, s.find(',')) << " = " << x << " | "; debug(s.substr(s.find(',') + 2), args...);}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    int n, m;
    cin >> n >> m;
    scc_graph scc(n);
    for (int i=0; i<m; i++) {
        int a, b;
        cin >> a >> b;
        scc.add_edge(a, b);
    }

    auto ret = scc.scc();
    cout << ret.size() << "\n";
    for (auto &v : ret) {
        cout << v.size();
        for (int u : v)
            cout << " " << u;
        cout << "\n";
    }

    return 0;
}


Measured memory_bytes: 40136
#include <iostream>
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<algorithm>
#include<string>
#include<stack>
using namespace std;
typedef  long long LL;
const int maxn=505;
char tmp[maxn];
int dp[maxn][maxn];
int max(int a,int b)
{
    if(a<b)
        return b;
    return a;
}
/*LL gcd(LL a,LL b)
{
    if(b==0)
        return a;
    return gcd(b,a%b);
}
LL lcm(LL a,LL b)
{
    return a/gcd(a,b)*b;
}*/

int main()
{
     int n;
     cin>>n;
     int num_4=0;
     int num_2=0;
     int n2=n;
     while(n2--)
     {
         LL m;
         cin>>m;
         if(m%4==0)
            num_4++;
         else if(m%2==0)
         {
             num_2++;
         }

     }
     int sum=0;
     sum=num_4*2+1;
     if(sum>=n)
     {
          cout<<"Yes"<<endl;
     }
     else
     {  sum+=num_2;
     if(sum>n)
        cout<<"Yes"<<endl;
     else
        cout<<"No"<<endl;

     }


    return 0;
}


Measured memory_bytes: 256
N,M,C = gets.split("\s").map {|s|s.to_i}
B_list = gets.split("\s").map {|s|s.to_i}
cnt = 0
N.times do
  ans = 0
  a_list = gets.split("\s").map {|s|s.to_i}
  a_list.each_with_index do |a, idx|
    ans += a*B_list[idx]
  end
  ans += C
  if ans > 0 then
    cnt += 1
  end
end
p cnt

Measured memory_bytes: 1788
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long INF = 1L << 60;
        int N = sc.nextInt();
        int K = sc.nextInt();
        int[] arr = new int[110000];
        for(int i = 0; i < N; i++) {
            arr[i] = sc.nextInt();
        }

        long[] dp = new long[110000];
        Arrays.fill(dp,INF);
        dp[0] = 0;

        for(int j = 0; j < N; j++) {
            for(int k = 1; k <= K; k++) {
                dp[j+k] = Math.min(dp[j+k],dp[j] + Math.abs(arr[j] - arr[j+k]));
            }
        }
        System.out.println(dp[N-1]);
    }
}


Measured memory_bytes: 51088
#include <cstdio>
const int mod = 1000000007;
int a[410], b[410];
int s[410][410];
int x[410];
int dp[410][410];
int main() {
	int n, c;
	scanf("%d%d", &n, &c);
	for (int i = 0; i < n; i++) {
		scanf("%d", &a[i]);
	}
	for (int i = 0; i < n; i++) {
		scanf("%d", &b[i]);
	}
	for (int i = 1; i <= 400; i++) {
		x[i] = 1;
	}
	for (int i = 0; i <= 400; i++) {
		for (int j = 1; j <= 400; j++) {
			s[i][j] = s[i][j-1] + x[j];
			if (s[i][j] >= mod) {
				s[i][j] -= mod;
			}
			x[j] = (long long)x[j] * j % mod;
		}
	}
	dp[0][0] = 1;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j <= c; j++) {
			int t = s[j][b[i]] - s[j][a[i]-1];
			if (t < 0) {
				t += mod;
			}
			for (int k = 0; k <= c - j; k++) {
				dp[i+1][j+k] += (long long)dp[i][k] * t % mod;
				if (dp[i+1][j+k] >= mod) {
					dp[i+1][j+k] -= mod;
				}
			}
		}
	}
	printf("%d\n", dp[n][c]);
	return 0;
}


Measured memory_bytes: 1408
MOD = 10 ** 9 + 7

def kaijo(n):
    k = 1
    for i in range(1, n + 1):
        k = k * i % MOD
    return k

n, m = map(int, input().split())
if n == m:
    print((kaijo(n) ** 2 * 2) % MOD)
elif abs(n - m) > 1:
    print(0)
else:
    if n < m:
        print((kaijo(n) ** 2 * m) % MOD)
    else:
        print((kaijo(m) ** 2 * n) % MOD)

Measured memory_bytes: 3064
/*
 * atcoder/dp_2nd/h.cpp
 */

// C++ 14
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring> // memset
#include <cassert>

using namespace std;

#define ll long long
#define MOD 1000000007

#define loop(__x, __start, __end) for(int __x = __start; __x < __end; __x++)
template <class T> bool chmin(T &a, T b) { if (a > b) {a = b; return true; } return false; }
template <class T> bool chmax(T &a, T b) { if (a < b) {a = b; return true; } return false; }

const int MAX = 1100;
int H, W;
bool G[MAX][MAX];
ll dp[MAX][MAX] = {0};

void input() {
  cin >> H >> W;
  char c;
  loop(h,0,H) loop(w,0,W) {
    cin >> c;
    if (c == '.') G[h][w] = true;
    else G[h][w] = false;
  }
}

void solve() {
  loop(h,0,H) {
    loop(w,0,W) {
      if (!G[h][w]) continue;

      if (h + w == 0) dp[h][w] = 1;
      else if (h == 0) dp[h][w] = dp[h][w-1];
      else if (w == 0) dp[h][w] = dp[h-1][w];
      else {
        dp[h][w] = (dp[h-1][w] + dp[h][w-1]) % MOD;
      }
    }
  }
  cout << dp[H-1][W-1] << endl;
}

int main() {
  // cout.precision(15);
  input();
  solve();
  return 0;
}


Measured memory_bytes: 10752
#include <cstdio>
#include <algorithm>
#include <functional>
#include <numeric>
#include <vector>

template<typename T, unsigned long long N, T M>
struct combination
{
	T array[(N + 1) * (N + 2) / 2];

	constexpr combination() : array()
	{
		array[0] = 1;
		for (unsigned long long i = 1; i <= N; ++i)
		{
			const auto first = i * (i + 1) / 2;
			const auto last = first + i;
			array[first] = array[last] = 1;
			const auto *p = &array[(i - 1) * i / 2];
			for (auto j = 1; j < i; ++j)
			{
				array[first + j] = (*p + *(p + 1)) % M;
	            ++p;
			}
		}
	}
	constexpr T C(T n, T r)
	{
		if (n < 0 || r < 0 || r > n) return 0;
		return array[n * (n + 1) / 2 + r];
	}
};

combination<long long, 100, (long long)1e18> comb;

int main()
{
  long long n, a, b;
  scanf("%lld%lld%lld", &n, &a, &b);
  
  long long v[50];
  for (long long i = 0; i < n; ++i)
  {
    scanf("%lld", v + i);
  }
  std::sort(v, v + n, std::greater<long long>());
  long long l, r;
  for (l = 0; l < n; ++l)
  {
    if (v[l] == v[a - 1])
    {
      r = l;
      while (v[r] == v[a - 1] && r < n) ++r;
      break;
    }
  }
  long long ans = 0;
  if (l == 0)
  {
    for (long long i = a; i <= b; ++i)
    {
      ans += comb.C(r, i);
    }
    printf("%.12f\n", double(v[0]));
  }
  else
  {
    ans = comb.C(r - l, a - l);
    printf("%.12f\n", std::accumulate(v, v + a, 0LL) / double(a));
  }
  printf("%lld\n", ans);
  return 0;
}

Measured memory_bytes: 128
n=int(input())
B=list(map(int,input().split()))
A=[]
A.append(B[0])
if n>=3:
    for i in range(n-2):
      m=min(B[i],B[i+1])
      A.append(m)
    last=B[n-2]
    A.append(last)
else:
    A.append(B[0])

print(sum(A))
  

Measured memory_bytes: 3064
/* bimillahir rahmanir rahim...
 * AUTHOR
 * mubin_akib */
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair <int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ld, ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;

#define FOR(i, a, b) for (int i = a; i < (b); i++)
#define F0R(i, a) for (int i = 0; i < (a); i++)
#define FORd(i,a,b) for (int i = (b) - 1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a) - 1; i >= 0; i--)
#define REP(i, a, b) for(int i = a; i <= (b); ++i)
#define trav(a,x) for(auto& a : x)

#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define ins insert

template<class T> bool ckmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int mod = 1e9 + 7;
const char nl = '\n';

int solve() {
    //ios_base::sync_with_stdio(0);
    //cin.tie(0);
    int a, b, c;
    cin >> a >> b >> c;
    if((a == 5 && b == 5 && c == 7) || (a == 5 && b == 7 && c == 5) || (a == 7 && b == 5 && c == 5)){
        cout << "YES\n";
    }
    else{
        cout << "NO\n";
    }
    return 0;
}

int main() {
#ifndef ONLINE_JUDGE
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    solve();
    return 0;
}


Measured memory_bytes: 3512
#include<bits/stdc++.h>
using namespace std;
#define ALL(x) (x).begin(),(x).end()
#define uniq(x) (x).erase(unique(ALL(x)),(x).end())
#define SORT(x) sort(ALL(x))
#define REV(x) reverse(ALL(x))
#define foreach(it,x) for(__typeof((x).begin()) it=(x).begin();it!=(x).end();it++)
#define debug(x) cerr<<#x<<"="<<(x)<<endl
#define gett() cerr<<"Time:"<<clock()<<"ms."<<endl
#define ri(x) scanf("%d",&x)
#define rl(x) scanf("%lld",&x)
#define rlcfpoj(x) scanf("%I64d",&x)
#define pi(x) printf("%d",x)
#define pl(x) printf("%lld",x)
#define plcfpoj(x) printf("%I64d",x)
#define lfd() printf("\n")
#define sp() printf(" ")
#define inrep(x) int x;scanf("%d",&x);while(x--)
#define testbit(mask,i) (((mask)>>(i))&1)
#define setbit(mask,i) ((mask)|(1<<i))
#define delbit(mask,i) ((mask)^(1<<i))
int n,q;
int a[200100],b[200100];
int tot[200100];
vector<int> ga[200100];
int x,p;
int main(){
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	cin>>n>>q;
	for(int i=1;i<n;i++){
		cin>>a[i]>>b[i];
		ga[a[i]].push_back(b[i]);
	}
	for(int i=1;i<=q;i++){
		cin>>p>>x;
		tot[p]+=x;
	}
	vector<int> topo;
	topo.push_back(1);
	for(int i=0;i<topo.size();i++){
		int cur=topo[i];
		for(int j=0;j<ga[cur].size();j++){
			tot[ga[cur][j]]+=tot[cur];
			topo.push_back(ga[cur][j]);
		}
	}
	for(int i=1;i<=n;i++)
		cout<<tot[i]<<' ';
	return 0;
}


Measured memory_bytes: 16632
#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()

#define CHMIN(a, b) a=min((a), (b))
#define CHMAX(a, b) a=max((a), (b))

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

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

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	double t, a, h;
	cin>>n>>t>>a;
	double b=1e9;
	int ans;
	REP(i, n){
		cin>>h;
		if(abs(t-0.006*h-a)<b){
			b=abs(t-0.006*h-a);
			ans=i;
		}
	}
	cout<<ans+1<<'\n';
	return 0;
}


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

int h,w;
int n;
int a[100005];
int MAP[105][105];

int main(){
    scanf("%d%d",&h,&w);
    scanf("%d",&n);
    for(int i = 1; i <= n; i++) scanf("%d",&a[i]);
    int Pos = 1;
    for(int i = 1; i <= h; i++){
        if(i % 2 == 1){
            for(int j = 1; j <= w; j++){
                if(a[Pos] > 0){
                    a[Pos]--;
                    MAP[i][j] = Pos;
                }
                else{
                    Pos++;
                    a[Pos]--;
                    MAP[i][j] = Pos;
                }
            }
        }
        else{
            for(int j = w; j >= 1; j--){
                if(a[Pos] > 0){
                    a[Pos]--;
                    MAP[i][j] = Pos;
                }
                else{
                    Pos++;
                    a[Pos]--;
                    MAP[i][j] = Pos;
                }
            }
        }
    }
    for(int i = 1; i <= h; i++){
        for(int j = 1; j <= w; j++){
            printf("%d ",MAP[i][j]);
        }
        printf("\n");
    }
    return 0;

}


Measured memory_bytes: 384
if __name__ == '__main__':
    N = int(input())
    A = [int(input()) for _ in range(N)]
    minv = A[0]
    maxv = A[1] - A[0]
    for i in range(1, N):
        maxv = max(maxv, A[i] - minv)
        minv = min(minv, A[i])
    print(maxv)


Measured memory_bytes: 13600
import java.util.ArrayList;
import java.util.Scanner;

public class Main{
    static ArrayList<Integer> multipliedMaxNums;
    static int numOfExe;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int q = sc.nextInt();
        for (int i = 0; i < q; i++) {
            String num = sc.next();
            multipliedMaxNums = new ArrayList<Integer>();
            numOfExe = 0;
            solve(num);
            System.out.println(numOfExe);
        }
        sc.close();
    }

    public static void solve(String num) {
        if (num.length() == 1) {
            // System.out.println(0);
        } else {
            secondExe(num);
        }
    }

    public static void secondExe(String num) {
        int digitNumber = num.length();
        int max = 0;
        for (int i = 0; i < digitNumber - 1; i++) {
            int multipledNum = Integer.parseInt(num.substring(0, (i + 1)))
                    * Integer.parseInt(num.substring((i + 1), digitNumber));
            if (max < multipledNum) {
                max = multipledNum;
            }
        }
        if (multipliedMaxNums.contains(max)) {
            numOfExe = -1;
        } else {
            numOfExe++;
            // System.out.println("?????§??????" + max);
            multipliedMaxNums.add(max);
            solve(String.valueOf(max));
        }
    }

}

// ???????????±????????? 3 9 99 123
// ???????????±????????? 2 999999 1000000
// ???????????±????????? 5 9 99 123 999999 1000000
// 0 2 3 12 1

Measured memory_bytes: 30020
import java.util.*;
import java.io.*;
public class Main {

	public static void main(String[] args) throws Exception{
		int num = 998244353;

		// TODO Auto-generated method stub
 		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
 		PrintWriter out = new PrintWriter(System.out);
 		int t = Integer.parseInt(bf.readLine());
 		out.println( t>=30 ? "Yes" : "No");
 		
 		
 		out.println();
	 		
 		out.close();
 		
 		
 		
 	}
}
 	
 
//StringJoiner sj = new StringJoiner(" "); 
//sj.add(strings)
//sj.toString() gives string of those stuff w spaces or whatever that sequence is

 		
 		
 		
 		
	




Measured memory_bytes: 25388
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
using namespace std;
int st(char t)
{
	switch(t)
	{
		case 'I':return 1;
		case 'V':return 5;
		case 'X':return 10;
		case 'L':return 50;
		case 'C':return 100;
		case 'D':return 500;
		case 'M':return 1000;
		default :return 0;
	}
}
int main()
{
	char num[101];
	while(cin >> num)
	{
		int ans=0;
		int len=strlen(num);
		for(int i=0;i<len;i++)
		{
			if(st(num[i])<st(num[i+1]))
			{
				ans -= st(num[i]);
				continue;
			}
			ans += st(num[i]);
		}
		cout << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 1140
#include<bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define elif else if
#define INF 1000000007
using namespace std;
int a,b,cnt=0;
signed main()
{
	cin>>a>>b;
	if(a==1&&b==1){
		cout<<1000000;
		return 0;
	}
	if(a==1){
		cnt+=300000;
	}elif(a==2){
		cnt+=200000;
	}elif(a==3){
		cnt+=100000;
	}
	if(b==1){
		cnt+=300000;
	}elif(b==2){
		cnt+=200000;
	}elif(b==3){
		cnt+=100000;
	}
	cout<<cnt;

}

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

int main() {
	int n;
	cin >> n;
	vector<int> a(n), b(n), c(n);
	vector<long> ab(n + 1), bc(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; i++) cin >> c[i];
	sort(a.begin(), a.end());
	sort(b.begin(), b.end());
	sort(c.begin(), c.end());
	ab[0] = bc[0] = 0;
	for (int i = 0; i < n; i++) {
		bc[i + 1] = bc[i] + c.end() - upper_bound(c.begin(), c.end(), b[i]);
	}
	for (int i = 0; i < n; i++) {
		ab[i + 1] = ab[i] + b.end() - upper_bound(b.begin(), b.end(), a[i]);
	}
	unsigned long long ans = 0;
	for (int i = 1; i <= n; i++) {
		ans += bc[n] - bc[n - (ab[i] - ab[i - 1])];
	}
	cout << ans << endl;
}

Measured memory_bytes: 2944
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ClassLibrary1
{
    public class ListNode
    {
        public int val;
        public ListNode next;
        public ListNode(int x) { val = x; }
    }


    public class Class1
    {
        static Dictionary<Tuple<long, long>, long> dic = new Dictionary<Tuple<long, long>, long>();


        static void Main(string[] args)
        {

            var aa = ReadLong();
            var res = aa;

            for(long l = aa; l<200000; l++)
            {
                bool flag = true;
                for (long ll = 2; ll < 100000; ll++)
                {
                    if( ll*ll > l) {
                        break;
                    }
                    if( l%ll==0)
                    {
                        flag = false;
                        break;
                    }

                }

                if( flag)
                {
                    res = l;
                    break;
                }
            }


            Console.WriteLine(res);


        }


        class BitArr
        {
            public bool[] bitArr = new bool[64];

            public BitArr(long l)
            {
                var ll = l;
                for(int i=0; i<64; i++)
                {
                    bitArr[i] = (ll % 2) == 1;
                    ll = ll / 2;
                }
            }
        }

        public static int Digit(long num)
        {
            // Mathf.Log10(0)はNegativeInfinityを返すため、別途処理する。
            return (num == 0) ? 1 : ((int)Math.Log10(num) + 1);
        }

        public static long nCm(long n, long m, long mod)
        {
            if (m == 0) return 1;
            if (n == 0) return 0;
            var a = n * nCm(n - 1, m - 1, mod) / m;
            return a % mod;
            //return a % 1000000007;
        }

        private static string ReadString()
        {
            return Console.ReadLine();
        }
        private static string[] ReadStringArr()
        {
            return Console.ReadLine().Split(' ');
        }
        private static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }
        private static long[] ReadLongArr()
        {
            string[] s = ReadStringArr();
            long[] l = new long[s.Length];
            for(int i=0; i<l.Length; i++)
            {
                l[i] = long.Parse(s[i]);
            }

            return l;
        }
    }

}


Measured memory_bytes: 13140
//shubham solution
//shubham solution
//shubham solution

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define  endl   '\n'
#define mod 1000000007
int main() {

#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
ios_base::sync_with_stdio(false);
cin.tie(NULL);
// ll test;
// cin>>test;
// while(test--)
// {
    
// }
ll k;
cin>>k;
ll a,b;
cin>>a>>b;
ll temp=0;
for(ll i=a;i<=b;i++)
{
  if(i%k==0)
  {cout<<"OK"<<endl;
  temp=1;
    break;
  }
}
if(temp==0)
  cout<<"NG"<<endl;
return 0;
}

//shubham solution
//shubham solution
//shubham solution

Measured memory_bytes: 3648
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.UncheckedIOException;
import java.util.List;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author mikit
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        LightScanner in = new LightScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        AChristmasEveEveEve solver = new AChristmasEveEveEve();
        solver.solve(1, in, out);
        out.close();
    }

    static class AChristmasEveEveEve {
        public void solve(int testNumber, LightScanner in, PrintWriter out) {
            int d = in.ints();
            List<String> e = new ArrayList<>();
            e.add("Christmas");
            for (int i = 25; i > d; i--) {
                e.add("Eve");
            }
            out.println(String.join(" ", e));
        }

    }

    static class LightScanner {
        private BufferedReader reader = null;
        private StringTokenizer tokenizer = null;

        public LightScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
        }

        public String string() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new UncheckedIOException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int ints() {
            return Integer.parseInt(string());
        }

    }
}



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

using namespace std;

#define pb push_back
#define mp make_pair
#define sz(x) (int)x.size()
#define mem(a) memset(a,0,sizeof(a))
#define sqr(x) ((x)*(x))

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;

const int mn = 2e5 + 5;
const int mm = 2100;
const int mod = 1e9 + 7;
#define P mod

int b,w;

ll powmod(ll a, ll b, ll P) {
	ll t = 1;
	for (; b; b >>= 1, a = a * a % P)
		if (b & 1) t = t * a % P;
	return t;
}

ll inv(int x) {
	return powmod(x, P - 2, P);
}

const int U = 2e5 + 5;
int F[U + 3], Finv[U + 3];

void init() {
	F[0] = 1;
	for (int i = 1; i <= U; i++) F[i] = 1ll * F[i - 1] * i % P;
	Finv[U] = inv(F[U]);
	for (int i = U; i; i--) Finv[i - 1] = 1ll * Finv[i] * i % P;
}

int comb(int n, int m) {
	if (m < 0 || m > n) return 0;
	return F[n] * 1ll * Finv[n - m] % P * Finv[m] % P;
}

int main() {
	//cin.sync_with_stdio(0);
#ifdef LOCAL
	freopen("../1.txt", "r", stdin);
#endif
	init();
	scanf("%d%d",&b,&w);
	ll aw=0,ab=0;//all are white / all are black
	for(int i=1;i<=b+w;i++){
		//printf("%d %lld %lld\n",i,ab,aw);
		printf("%lld\n",(((1-ab)%mod+mod)%mod*inv(2)%mod+aw*inv(2)%mod)%mod);
		if (i>=b) ab=(ab+comb(i-1,b-1)*inv(powmod(2,i,mod)))%mod;
		if (i>=w) aw=(aw+comb(i-1,w-1)*inv(powmod(2,i,mod)))%mod;
	}


	return 0;
}


Measured memory_bytes: 3840
#include <bits/stdc++.h>
using namespace std;
 
#define ll long long int
#define rep(i, n) for(int i = 0; i < n; i++)
#define repp(i, n) for(int i = 1; i <= n; i++)
#define sort(v) sort((v).begin(), (v).end())
#define pb push_back
#define mp make_pair
#define riverse(v) reverse((v).begin(), (v).end())
using vi = vector<int>;
using vs = vector<string>;
using vvi = vector<vi>;
using vll = vector<ll>;
const int MOD = 1e9+7;
vi alphabet = {'a','b','c','d','e','f','g','h','i','j','k','l','m',
               'n','o','p','q','r','s','t','u','v','w','x','y','z'};

int main() {
	int N;
  	cin >> N;
  	vll A(N);
  	rep(i,N){
    	cin >> A[i];
    }
  	set<ll> s;
  	rep(i,N){
    	if(s.count(A[i])){
        	s.erase(A[i]);
        }
      	else s.insert(A[i]);
    }
  	int n = s.size();
  	cout << n << endl;
}

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

using namespace std;

int main(){
	int a[3];
	for (int i=0;i<3;i++){
		cin>>a[i];
	}

	sort(a, a+3);

	if ( a[0] == a[1] && a[0] == a[2] ){
		cout<<"No"<<endl;
	}else if ( a[0] == a[1] || a[0] == a[2] || a[1] == a[2] ){
		cout<<"Yes"<<endl;
	}else{
		cout<<"No"<<endl;
	}
	return 0;
}

Measured memory_bytes: 256
#pragma region
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <list>
#include <iomanip>
#include <cstdint>
#include <bitset>

using namespace std;
typedef long long ll;
//#define rep(i, s, e) for (int(i) = (s); (i) < (e); ++(i))
#define rep(i, e) for (int(i) = 0; (i) < (e); ++(i))
#define rrep(i, s) for (int(i) = (s) - 1; (i) >= 0; --(i))
#define all(x) x.begin(),x.end()

#pragma region UnionFind
struct UnionFind
{
	vector<int> par;

	UnionFind(int n) : par(n, -1) {}
	void init(int n) { par.assign(n, -1); }

	int root(int x)
	{
		if (par[x] < 0) return x;
		else return par[x] = root(par[x]);
	}

	bool issame(int x, int y)
	{
		return root(x) == root(y);
	}

	bool merge(int x, int y)
	{
		x = root(x); y = root(y);
		if (x == y) return false;
		if (par[x] > par[y]) swap(x, y);
		par[x] += par[y];
		par[y] = x;
		return true;
	}

	int size(int x)
	{
		return -par[root(x)];
	}
};
#pragma endregion
#pragma region GCD
int gcd(int a, int b)
{
	if (a%b == 0)return b;
	return gcd(b, a%b);
}
#pragma endregion
#pragma region chmin
template<class T> inline bool chmin(T& a, T b)
{
	if (a > b)
	{
		a = b;
		return true;
	}
	return false;
}
#pragma endregion
#pragma region chmax
template<class T> inline bool chmax(T& a, T b)
{
	if (a < b)
	{
		a = b;
		return true;
	}
	return false;
}
#pragma endregion
#pragma endregion


int main()
{
	string n; cin >> n;
	char x = n.back();
	if (x == '3')cout << "bon" << endl;
	else if (x == '0' || x == '1' || x == '6' || x == '8')cout << "pon" << endl;
	else cout << "hon" << endl;
}

Measured memory_bytes: 3604
#include<bits/stdc++.h>
#define pb push_back
using namespace std;
int main()
{
    vector<int>v;
    int x;
    for(int i=0;i<3;i++)
    {
        cin>>x;
        v.pb(x);
    }
    sort(v.begin(),v.end());
    if((v[0]==v[1]||v[1]==v[2])&&v[0]!=v[2])cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    
}


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

int MOD=1000000007;
int modpow(int a,int x){
  if(a<0)a+=MOD;
  int ans=1;
  while(x>0){
    if(x&1) ans=ans*a%MOD;
      a=a*a%MOD;
      x>>=1;
  }
  return ans;
}

int gyaku(int n){
    return modpow(n,MOD-2);
}

auto factor(int n){
  map<int,int>res;
  for(int i=2;i*i<=n;i++){
      for(; n%i==0;n/=i) res[i]++;
  }
  if(n>1)res[n]++;
  return res;
}
////////////////////////////////////////////////////////////
signed main() {
  map<int,int>m;
  int n,k;
  cin>>n>>k;
  rep(i,n){
    int a,b;
    cin>>a>>b;
    m[a]+=b;
  }
  int r=0;
  for(auto[a,b]:m){
    r+=b;
    if(r>=k){
      cout<<a<<endl;
      exit(0);
    }
  }
}


Measured memory_bytes: 7360
#include <bits/stdc++.h>
using namespace std;
int main(){
	long long i, o, t, j, l, s, z;
	cin >> i >> o >> t >> j >> l >> s >> z;
	long long ans = 2 * o;
	auto best = [](long long I, long long J, long long L){
		long long ans = 0;
		if(I > 0 && J > 0 && L > 0) ans = max(ans, 6 + ((I - 1) / 2) * 4 + ((J - 1) / 2) * 4 + ((L - 1) / 2) * 4);
		ans = max(ans, (I/2)*4 + (J/2)*4 + (L/2)*4);
		return ans;
	};
	ans += best(i, j, l);
	cout << ans / 2 << endl;
	return 0;
}


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

int main(void){
	int n,m,max,min,answer;
	while(1){
		cin >> n;
		max = 0;
		min = INT_MAX;
		answer = 0;
		if (!n) break;
		for (int i=0;i< n;i++){
			cin >> m;
			if (m > max) max = m;
			if (m < min) min = m;
			answer += m;

		}
		cout << (answer-max-min)/(n-2) << endl;

	}

	return 0;
}

Measured memory_bytes: 2992
#include <bits/stdc++.h>
#define x first
#define y second
#define all(v) v.begin(), v.end()
#define compress(v) sort(all(v)), v.erase(unique(all(v)), v.end())
using namespace std;

typedef long long ll;

int n, m;
char a[111][111];

int main(){
    ios_base::sync_with_stdio(false); cin.tie(nullptr);
    cin >> n >> m;
    for(int i=1; i<=n; i++) for(int j=1; j<=m; j++) cin >> a[i][j];
    for(int i=0; i<=m+1; i++) cout << "#"; cout << "\n";
    for(int i=1; i<=n; i++){
        cout << "#";
        for(int j=1; j<=m; j++) cout << a[i][j];
        cout << "#\n";
    }
    for(int i=0; i<=m+1; i++) cout << "#"; cout << "\n";
}

Measured memory_bytes: 3668
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


class Main{
	public static void main(String[] args)throws IOException{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String name;
		int num;

		while(true){

			try{
				name=br.readLine();
				num=Integer.parseInt(name);
				nabat(num);
			}

			catch(Exception e){
				System.exit(0);
			}
		}
	}

	public static int nabat(int a){
		int p=a;
		boolean pass=false;
		String nk="";
		int kak=0;

		for(int i=1; i<p+1; i++){
			if(i%3==0 && pass==false){
				System.out.print(" "+i);
				pass=true;
			}
			else if(pass== false){
				nk=i+"";
				kak=nk.indexOf("3");
				if(kak!=-1){
					System.out.print(" "+i);
					pass=true;
				}
			}
			pass=false;
		}
		System.out.println("");
		return 0;
	}
}

Measured memory_bytes: 28228
MOD = 10**9 + 7
N = int(input())
A = [list(map(int, input().split())) for _ in range(N)]
dp = [0] * (1 << N)
dp[0] = 1
bits = [1 << i for i in range(N)]
cands = [[] for _ in range(N+1)]
for s in range(1 << N):
    temp = 0
    for n in range(N):
        if s & (1 << n): temp += 1
    cands[temp].append(s)
for i, a in enumerate(A):
    for j in [k for k, v in enumerate(a) if v == 1]:
        bit = bits[j]
        for s in cands[i]:
            if s & bit == 0:
                new_s = s | bit
                dp[new_s] += dp[s]
                if dp[new_s] >= MOD: dp[new_s] -= MOD
print(dp[-1])

Measured memory_bytes: 130692
#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>;

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

  int cnt = 0;
  while (a > 0 && c > 0) {
    if (cnt % 2 == 0) {
      c -= b;
    } else {
      a -= d;
    }
    cnt++;
  }

  cout << (a > 0 ? "Yes" : "No") << endl;

  return 0;
}


Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using VI = vector<int>;
using VL = vector<ll>;
#define FOR(i,a,n) for(int (i)=(a);(i)<(n);++(i))
#define eFOR(i,a,n) for(int (i)=(a);(i)<=(n);++(i))
#define rFOR(i,a,n) for(int (i)=(n)-1;(i)>=(a);--(i))
#define erFOR(i,a,n) for(int (i)=(n);(i)>=(a);--(i))
#define SORT(i) sort((i).begin(),(i).end())
#define rSORT(i,a) sort((i).begin(),(i).end(),(a))
#define all(i) (i).begin(),(i).end()
#define out(y,x,h,w) (y) < 0 || (h) <= (y) || (x) < 0 || (w) <= (x)
constexpr ll INF = 1000000000;
constexpr ll LLINF = 1LL << 60;
constexpr ll mod = 1000000007;
constexpr ll MOD = 998244353;
const long double pi = acos(-1);
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; }return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; }return 0; }
inline void init() { cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); }
template<class T>inline istream& operator>>(istream& input, vector<T>& v) { for (auto& elemnt : v)input >> elemnt; return input; }

int main() {
    init();

    string s; ll k; cin >> s >> k;
    FOR(i, 0, k)if (s[i] != '1') {
        cout << s[i] << "\n";
        return 0;
    }
    cout << "1\n";
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cstring>
using namespace std;
#define ll long long
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define FORD(i,a,b) for(int i=a;i>=b;i--)
#define FORL(i,x) for(int i=head[x];i;i=nxt[i])
#define clr(x,y) memset(x,y,sizeof(x))
#define in(a) a=read()
#define out(a) printf("%d\n",a)
inline ll read(){
    char c=getchar();ll f=1,x=0;
    while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
    while(c>='0'&&c<='9')x=x*10+(c-'0'),c=getchar();
    return x*f;
}
#define mod 1000000007
void MOD(int &x){if(x>=mod)x-=mod;}
#define maxn 100010
#define inf (1<<30)
int X[maxn],Y[maxn];
int fa[maxn],sz[maxn];
int find(int x){return fa[x]==x?x:fa[x]=find(fa[x]);}
ll k[maxn];
int main(){
	int n,m;
	in(n);in(m);
	FOR(i,1,n)fa[i]=i,sz[i]=1;
	FOR(i,1,m)in(X[i]),in(Y[i]);
	ll ans=1ll*n*(n-1)/2;
	FORD(i,m,1){
		k[i]=ans;
		int x=find(X[i]),y=find(Y[i]);
		if(x==y)continue;
		ans+=1ll*sz[x]*(sz[x]-1)/2;
		ans+=1ll*sz[y]*(sz[y]-1)/2;
		sz[x]+=sz[y];fa[y]=x;
		ans-=1ll*sz[x]*(sz[x]-1)/2;	
	}
	FOR(i,1,m)printf("%lld\n",k[i]); 
}

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

struct node{
    int p1, p2;
    ll s;
    friend bool operator <(node a, node b){
        return a.s > b.s;
    }
};

int n;
ll a[MAX], k;
vector<ll> b, c;

bool check(ll x){
    sort(b.begin(), b.end(), greater<ll>());
    sort(c.begin(), c.end());
    ll res = 0;
    for(int i = 0; i < b.size(); i++){
        if(b[i] == 0){
            res += (x>=0)*c.size();
            continue;
        }
        int l = 0, r = c.size()-1, mid, p = -1;
        while(l <= r){
            mid = (l+r)>>1;
            if(b[i]*c[mid] <= x) p = mid, l = mid+1;
            else r = mid-1;
        }
        res += p+1;
    }
    sort(b.begin(), b.end());
    sort(c.begin(), c.end(), greater<ll>());
    for(int i = 0; i < b.size(); i++){
        if(b[i] == 0){
            res += (x>=0)*(b.size()-i-1);
            continue;
        }
        int l = i+1, r = b.size()-1, mid, p = -1;
        while(l <= r){
            mid = (l+r)>>1;
            if(b[i]*b[mid] <= x) p = mid, l = mid+1;
            else r = mid-1;
        }
        res += max(0, p-i);
    }
    for(int i = 0; i < c.size(); i++){
        if(c[i] == 0){
            res += (x>=0)*(c.size()-i-1);
            continue;
        }
        int l = i+1, r = c.size()-1, mid, p = -1;
        while(l <= r){
            mid = (l+r)>>1;
            if(c[i]*c[mid] <= x) p = mid, l = mid+1;
            else r = mid-1;
        }
        res += max(0, p-i);
    }
    return res >= k;
}

int main()
{
    cin >> n >> k;
    for(int i = 1; i <= n; i++){
        scanf("%lld", &a[i]);
        if(a[i] >= 0) b.push_back(a[i]);
        else c.push_back(a[i]);
    }
    ll l = (ll)-1e18, r = (ll)1e18, mid, ans;
//    cout << check(-12) << endl;
    while(l <= r){
        mid = (l+r)>>1;
        if(check(mid)) ans = mid, r = mid-1;
        else l = mid+1;
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3700
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;

typedef pair<int,int> PII;
const int M=1e5+5;
vector<int> g[M];
int d[M][3];
queue<PII> qu;

int main()
{
	int n,m;
	scanf("%d%d",&n,&m);
	
	int u,v;
	for(int i=0;i<m;i++)
	{
		scanf("%d%d",&u,&v);
		g[u].push_back(v);
	}
	int s,t;
	scanf("%d%d",&s,&t);
	memset(d,-1,sizeof(d));
	qu.emplace(s,0);
	d[s][0]=0;
	while(!qu.empty())
	{
		PII node=qu.front(); qu.pop();
		int u=node.first,step=node.second;
		if(u==t&&step==0)
		{
			printf("%d\n",d[u][0]/3);
			return 0;
		}
		int nstep=(step+1)%3;
		for(int v:g[u])
		{
			if(d[v][nstep]!=-1) continue;
			qu.emplace(v,nstep);
			d[v][nstep]=d[u][step]+1;
		}
	}
	printf("-1\n");
	return 0;
}

Measured memory_bytes: 6912
#include <iostream>
#include <queue>
using namespace std;
typedef pair<int,int> P;
int W,H,sx,sy;
int dx[4] = {-1,1,0,0},dy[4] = {0,0,-1,1};
char F[21][21];
int visited[21][21] = {};

bool in(int x,int y){
    return 1<=x && x<=H && 1<=y && y<=W;
}

int main(){
    while(cin >> W >> H && W>0){
        queue<P> Q;
        for(int i=1;i<=H;i++){
            for(int j=1;j<=W;j++){
                visited[i][j] = 0;
                cin >> F[i][j];
                if(F[i][j]=='@'){
                    visited[i][j] = 1;
                    Q.push({i,j});
                }
            }
        }
        int ans = 0;
        while(!Q.empty()){
            ans++;
            int x = Q.front().first,y = Q.front().second; Q.pop();
            for(int i=0;i<4;i++){
                int nx = x+dx[i],ny = y+dy[i];
                if(in(nx,ny) && F[nx][ny]!='#' && visited[nx][ny]==0){
                    visited[nx][ny] = 1;
                    Q.push({nx,ny});
                }
            }
        }
        cout << ans << endl;
    }
}



Measured memory_bytes: 3164
import java.util.Scanner;
import java.io.*;

public class Main{
	public static void main(String[] args) throws IOException{
		Scanner stdIn = null;
		int[] result = new int[10000];
		int index = 0;
		
		try{
			stdIn = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
			while( stdIn.hasNext() ){
				String str = stdIn.next();
				String[] s = str.split(",");
				int[] x = new int[s.length];
				for(int i = 0; i < x.length; i++){
					x[i] = Integer.parseInt(s[i]);
				}
				int v = x[10]+x[11];
				int l = 0;
				int[] length = new int[10];
				for(int i = 0; i < 10; i++){
					l += x[i];
				}
				length[0] = x[0];
				for(int i = 1; i < 10; i++){
					length[i] = length[i-1]+x[i];
				}
				double t = (double) l/v;
				double key = t*x[10];
				for(int i = 0; i < 10; i++){
					if( key <= length[i] ){
						result[index] = i+1;
						break;
					}
				}
				index++;
			}
			for(int i = 0; i < index; i++){
				System.out.println(result[i]);
			}
		} finally {
			if( stdIn != null ){
				stdIn.close();
			}
		}
	}
}

Measured memory_bytes: 12000
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstring>
#include <unordered_set>
#include <unordered_map>
#include <numeric>
#include <ctime>
#include <bitset>
#include <random>
#include <complex>
#include <random>
#include <functional>
 
using namespace std;

#define int long long

const int MOD = 1e9 + 7;

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

    int n;
    cin >> n;
    vector<int> dp(n);
    dp[0] = 1;
    vector<int> c(n);
    for (auto &t : c) {
    	cin >> t;
    }
    map<int, int> pr;
    pr[c[0]] = 0;
    for (int i = 1; i < n; i++) {
    	dp[i] += dp[i - 1];
    	if (pr.count(c[i]) && pr[c[i]] < i - 1) {
    		dp[i] += dp[pr[c[i]]];
    		dp[i] %= MOD;
    	}
    	pr[c[i]] = i;
    }
    cout << dp[n - 1] << endl;
}


Measured memory_bytes: 15872
n = int(input())
s = input()
# memo_ls[i][j] : i番目まででj+1桁のパスワードを作る通り
pos_dict = dict()
for i, _s in enumerate(s):
    if pos_dict.get(_s) is None:
        pos_dict[_s] = []
    pos_dict[_s].append(i)
memo_ls = [[0 for j in range(3)] for i in range(n+1)]
memo_ls[1][0] = 1
ct = dict()
for i in range(1,n+1):
    _s = s[i-1]
    if _s not in ct:
        memo_ls[i][0] = memo_ls[i-1][0] + 1
        ct[_s] = []
    else:
        memo_ls[i][0] = memo_ls[i - 1][0]
    last_s_i = ct[_s]
    if len(last_s_i) > 0:
        memo_ls[i][1] = memo_ls[i-1][1] + memo_ls[i-1][0] - memo_ls[last_s_i[-1]-1][0]
    else:
        memo_ls[i][1] = memo_ls[i - 1][1] + memo_ls[i - 1][0]
    if(len(last_s_i)) > 0:
        memo_ls[i][2] = memo_ls[i - 1][2] + memo_ls[i - 1][1] - memo_ls[last_s_i[-1]-1][1]
    else:
        memo_ls[i][2] = memo_ls[i - 1][2] + memo_ls[i - 1][1]
    ct[_s].append(i)
print(memo_ls[-1][-1])

Measured memory_bytes: 46812
import heapq

N,M=list(map(int,input().split()))
A=list(map(lambda x: -int(x),input().split()))

heapq.heapify(A)

while M>0:
    a=heapq.heappop(A)
    a=-a
    a=a>>1
    a=-a
    heapq.heappush(A,a)

    M-=1
print(-sum(A))

Measured memory_bytes: 72216
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 main() {
    input!{
        a: usize,
        b: usize,
        c: usize,
    }
    let n = vec![a,b,c];
    let mut ok = false;
    for i in 0..1 << 3 {
        let mut x = 0;
        let mut y = 0;
        for j in 0..3 {
            if (1 << j) & i == 0 {
                x += n[j];
            }else{
                y += n[j];
            }
        }
        if x == y {
            ok = true;
        }
    }

    if ok {
        println!("Yes");
    }else{
        println!("No");
    }
}
  

Measured memory_bytes: 4352
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <bitset>
#include <stack>
#include <deque>
#include <set>
#include <unordered_set>
#include <list>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <climits>
#include <ctime>
#include <random>
#define speed ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ll long long
#define eps 1e-9
#define inf 0x3f3f3f3f
#define mod 1000000007
using namespace std;

int main() {
	speed;
	string s;
	cin >> s;
	if (s == "RRR")
		cout << 3;
	else if (s == "RRS" || s == "SRR")
		cout << 2;
	else if (s == "SSS")
		cout << 0;
	else
		cout << 1;
}

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

int main(){
    int n;
    cin >> n;
    vector<int> a(1<<n);
    for(int i=0; i<1<<n; i++) cin >> a[i];
    for(int i=0; i<n; i++){
        for(int j=0; j<(int)a.size()/2; j++){
            if(a[2*j]==a[2*j+1]) a[j] = a[2*j];
            else a[j] = abs(a[2*j]-a[2*j+1]);
        }
    }
    cout << a[0] << endl;
    return 0;
}


Measured memory_bytes: 1280
#include <stdio.h>
int main(void){
	int a[1000000] = {0};
	int s, i = 1;
	scanf("%d", &s);
	while(1){
		a[s]++;
		if(a[s] == 2){
			printf("%d\n", i);
			return 0;
		}
		if(s % 2 == 0){
			s /= 2;
		}else{
			s = s * 3 + 1;
		}
		i++;
	}
	return 0;
}

Measured memory_bytes: 4096
#include <bits/stdc++.h>
using i64 = int_fast64_t;
#define repeat(i, a, b) for(int i = (a); (i) < (b); ++(i))
#define rep(i, n) repeat(i, 0, n)

void solve() {
    int n, k;
    std::cin >> n >> k;
    int r, s, p;
    std::cin >> r >> s >> p;
    std::string T;
    std::cin >> T;
    i64 ans = 0;
    i64 point = 0;
    rep(i, T.size()) {
        if(T[i] == 'r')
            point += p;
        else if(T[i] == 's')
            point += r;
        else if(T[i] == 'p')
            point += s;
    }
    // std::cout << point << std::endl;
    rep(i, k) {
        int t = i;
        std::map<char, int> cnt;
        while(t + k < n) {
            t += k;
            if(T[t] == T[t - k]) {
                cnt[T[t]]++;
                T[t] = 'x';
            }
        }
        ans += p * cnt['r'] + r * cnt['s'] + s * cnt['p'];
    }
    std::cout << point - ans << std::endl;
}

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

Measured memory_bytes: 512
#include <stdio.h>

int main(void){
	char str[4];
	scanf("%s", str);
	int sum=0;
	for(int i=0; i<3;i++){
		for(int x=1;x<4-i;x++){
			if(str[i]==str[i+x])sum++;
		}
	}
	if(sum==2)printf("Yes\n");
	else printf("No\n");
	return 0;
}


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

using namespace std;

int k, s, ans = 0;

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

    cin >> k >> s;

    for (int x = 0; x <= k; x++) {
        for (int y = 0; y <= k; y++) {
            int z = s - (x + y);

            if (0 <= z && z <= k) {
                ans++;
            }
        }
    }

    cout << ans << endl;

    return 0;
}


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

#define int long long
#define endl "\n"
#define REP(i,a,n) for(int i=a;i<n;++i)
#define REPR(i,a,n) for(int i=a;i>n;--i)
#define RUP(a,b) ((a+b-1)/(b))
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define MOD 1000000007
#define INF LLONG_MAX/2

typedef long long ll;
typedef pair<int,int> Pii;
typedef tuple<int,int,int> Tiii;
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef vector<Pii> VPii;
typedef vector<string> Vs;

template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T> void YesNo(T a) {cout<<(a?"Yes":"No")<<endl;}
template<class T> void YESNO(T a) {cout<<(a?"YES":"NO")<<endl;}
void vin(Vi &v){REP(i,0,(v).size()) cin>>v[i];}
void vin(Vi &v,Vi &v2){REP(i,0,(v).size()) cin>>v[i]>>v2[i];}
void vout(Vi &v){for(int i=0;i<(v).size();i++) cout<<v[i]<<" ";cout<<endl;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a/gcd(a,b)*b;}
void uniq(Vi &v){sort(v.begin(),v.end()); v.erase(unique(v.begin(),v.end()),v.end());}
int ctoi(char c){if(c>='0'&&c<='9'){return c-'0';}return 0;}
void accum(Vi &v){REP(i,1,(v).size()) v[i]+=v[i-1];}
bool comp(Pii a,Pii b){
    if(a.second != b.second) return a.second<b.second;
    else return a.first<b.first;
}

signed main(){cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);
    int n,ans=0;
    cin>>n;
    Vi a(n);
    vin(a);
    bool flag=true;
    REP(i,0,n){
        if(i==0){
            if(a[i]!=0) flag=false;
        }else{
            if(a[i]==a[i-1]+1) ans++;
            else if(a[i]>a[i-1]+1) flag=false;
            else if(a[i]<a[i-1]+1) ans+=a[i];
        }
//        cout<<ans<<endl;
    }
    if(flag) cout<<ans<<endl;
    else cout<<-1<<endl;
    return 0;
}


Measured memory_bytes: 1792
# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <bitset>
# include <complex>
#include<limits.h>
#include<unordered_map>
#include<unordered_set>
#include<deque>
#include<cstdio>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
constexpr long long MOD = 1000000000 + 7;
constexpr long long INF = 1000000000;
const double PI = acos(-1);

string S;
bitset<26> B[1000000] = {};
int dp[1<<26];
int main() {
	cin >>S;
	for (LL i = 0; i < S.size(); i++) {
		if (i > 0)
			B[i] = B[i - 1];
		B[i][S[i] - 'a'].flip();
	}
	for (LL i = 0; i <(1<<26); i++)
		dp[i] = INF;
	dp[0] = 0;
	for (LL i = 0; i < S.size(); i++) {
		LL BB = B[i].to_ullong();
		if (B[i].count() < 2) {
			dp[BB] = 1;
			continue;
		}
		for (int j = 0; j < 26; j++) {
			dp[BB] = min(dp[BB^(1 << j)]+1,dp[BB]);
		}
	}
	LL Bi = B[S.size()-1].to_ullong();
	cout << dp[Bi] << endl;
	return 0;
}


Measured memory_bytes: 270468