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

int main(void){
    string number;
    int sum;
    while(true){
        sum = 0;
        cin >> number;
        if (number[0] == '0'){
            break;
        }
        for ( int i = 0; i < number.size(); i++ ){
            sum += number[i] - '0';
        }
        cout << sum << endl;
    }
    return 0;
}


Measured memory_bytes: 3212
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define rrep(i,n) for (int i = n-1; i >= 0; i--)
#define rep2(i,s,n) for (int i = s; i < n; ++i)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define tmax(a,b,c) max(a,max(b,c))
#define tmin(a,b,c) min(a,min(b,c))
#define pb push_back
#define eb emplace_back
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vs vector<string>
#define vc vector<char>
#define vb vector<bool>
using namespace std;
using ll = long long;
using P = pair<int,int>;
using LP = pair<ll,ll>;
inline void Yes(bool b) { cout << (b ? "Yes" : "No") << endl; }
inline void YES(bool b) { cout << (b ? "YES" : "NO") << endl; }
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;}
const int inf = 1001001001;
const ll linf = 1001001001001001001;
const int mod = 1000000007;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
    int k;
    cin >> k;
    vi dist(k,inf);
    dist[1] = 1;
    deque<int> q;
    q.push_front(1);
    while(!q.empty()) {
        int now = q.front();
        q.pop_front();
        int nx = (now+1)%k;
        if(dist[now]+1 < dist[nx]) {
            dist[nx] = dist[now]+1;
            q.pb(nx);
        }
        nx = now*10%k;
        if(dist[now] < dist[nx]) {
            dist[nx] = dist[now];
            q.push_front(nx);
        }
    }
    cout << dist[0] << endl;
}


Measured memory_bytes: 896
#include <stdio.h>
typedef double value_type; /* ソートするキーの型 */

/* x, y, z の中間値を返す */
value_type med3(value_type x, value_type y, value_type z) {
    if (x < y) {
        if (y < z) return y; else if (z < x) return x; else return z;
    } else {
        if (z < y) return y; else if (x < z) return x; else return z;
    }
}

value_type Abs(value_type x){
  if( x > 0 ) return x ; else return -x;
}

/* クイックソート
 * a     : ソートする配列
 * left  : ソートするデータの開始位置
 * right : ソートするデータの終了位置
 */
void quicksort(value_type a[], int left, int right) {
    if (left < right) {
        int i = left, j = right;
        value_type tmp, pivot = med3(Abs(a[i]), Abs(a[i + (j - i) / 2]), Abs(a[j])); /* (i+j)/2 ではオーバーフローしてしまう */
        while (1) { /* a[] を pivot 以上と以下の集まりに分割する */
            while (Abs(a[i]) < pivot) i++; /* a[i] >= pivot となる位置を検索 */
            while (pivot < Abs(a[j])) j--; /* a[j] <= pivot となる位置を検索 */
            if (i >= j) break;
            tmp = a[i]; a[i] = a[j]; a[j] = tmp; /* a[i], a[j] を交換 */
            i++; j--;
        }
        quicksort(a, left, i - 1);  /* 分割した左を再帰的にソート */
        quicksort(a, j + 1, right); /* 分割した右を再帰的にソート */
    }
}

int main(void){
  int i,n;
  value_type x[200000];
  value_type y[200000];
  
  scanf("%d",&n);
  for( i=0; i<n; i++){
    scanf("%lf",&x[i]);
  }
  
  quicksort( x, 0, n-1);
  //printf("MAX = %f\n",x[n-1]);
  
  for( i=0; i<n-1; i++) x[i] -= x[n-1]/2;
  
  quicksort( x, 0, n-2);

  //printf("NEAREST to MAX/2 = %f\n", x[n-1]/2 + x[0]);
  
  printf("%.0f %.0f\n",x[n-1],x[n-1]/2+x[0]);
  return 0;
}

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

const int N = 1e5 + 100;

int n, m, ans, cnt[N];
bool can[N];

int main() {
	ios::sync_with_stdio(false), cin.tie(0);
	cin >> n >> m;
	fill(cnt, cnt + n, 1);
	can[0] = true;
	while(m--) {
		int x, y;
		cin >> x >> y;
		cnt[--x]--;
		cnt[--y]++;
		can[y] |= can[x];
		if(cnt[x] == 0)
			can[x] = false;
	}
	for (int i = 0; i < n; i++)
		ans += can[i];
	cout << ans;
	return 0;
}

Measured memory_bytes: 768
#include <iostream>
#include <string>
#include<vector>
#include<algorithm>
#include<utility>
#include<queue>
#include<math.h>
#include<stack>
#include<set>
#define INF 2e9
#define rep(i,n,m) for(int i=n;i<m;i++)

using namespace std;

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

	vector<string>s(N);
	rep(i, 0, N)cin >> s[i];

	int ans = N;
	sort(s.begin(), s.end());
	rep(i, 1, N)if (s[i - 1] == s[i])ans--;
	
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 9576
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<sstream>
#include<unordered_map>
#include<unordered_set>
#include<vector>
using namespace std;
using uint = unsigned int;
using ll = long long;
const int M = 1e9 + 7;
const ll MLL = 1e18L + 9;
#pragma unused(M)
#pragma unused(MLL)
#ifdef LOCAL
#include"rprint.hpp"
#else
template <ostream& out = cout, class... T> void prints(T&&...){ }
template <ostream& out = cout, class... T> void printd(T&&...){ }
template <ostream& out = cout, class... T> void printb(T&&...){ }
template <ostream& out = cout, class... T> void printArr(T&&...){ }
#endif
#include<boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;

ll comb(int n, int r){
    mp::cpp_int ret = 1, d = 1;
    for(int i = n; i > n - r; i--){
        ret *= i;
    }
    printd(n, r, ret);
    for(int i = r; i >= 2; i--){
        // ret /= r;
        d *= i;
    }
    ret /= d;
    printd(n, r, ret);
    return (ll)ret;
}

int main(){
    int n, p;
    cin >> n >> p;
    int e = 0, o = 0;
    for(int i = 0; i < n; i++){
        int a; cin >> a;
        if(a & 1){
            o++;
        }else{
            e++;
        }
    }
    printd(e, o);
    // even
    ll ans = 0;
    for(int i = 0; i <= o / 2; i++){
        ans += comb(o, i * 2);
    }
    ans *= (1ll << e);
    cout << (p == 0 ? ans : (1ll << n) - ans) << '\n';
    return 0;
}


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

using namespace std;

const int maxn = 3e3+10;
const int mod = 1e9+7;

int dp[maxn][maxn];
int soma[maxn];

char antes[maxn];

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

	for (int i = 1; i < n; i++)
		scanf(" %c", &antes[i]);

	dp[1][1] = 1, soma[1] = 1;
	for (int i = 2; i <= n; i++)
	{
		if (antes[i-1] == '>')
		{
			for (int j = 1; j < i; j++)
				dp[i][j] = (soma[i-1]-soma[j-1]+mod)%mod;
			for (int j = 1; j <= i; j++)
				soma[j] = (soma[j-1]+dp[i][j])%mod;
		}
		else
		{
			for (int j = 2; j <= i; j++)
				dp[i][j] = soma[j-1];
			for (int j = 1; j <= i; j++)
				soma[j] = (soma[j-1]+dp[i][j])%mod;
		}
	}

	int ans = 0;
	for (int i = 1; i <= n; i++)
		ans = (ans+dp[n][i])%mod;

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

Measured memory_bytes: 34304
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cmath>
#include <iomanip>
using namespace std;
typedef long long int LL;
typedef pair<int,int> P;
const int INF=100000000;
const int MOD_2=998244353;

LL a[200010];
int main()
{
	LL n,k;
	LL sum=0;
	cin>>n>>k;
	for(int i=0;i<n;i++)
	{
		cin>>a[i];	
	}
	sort(a,a+n);
	for(int i=0;i<n-k;i++)
	{
		sum+=a[i];
	}
	cout<<sum<<"\n";
	return 0;
}
	

Measured memory_bytes: 1792
#include <iostream>
#include <cmath>
#include <string>
#include <algorithm>
#include <set>
#include <vector>
#include <map>
#include <list>
#include <stack>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <queue>
#define mkp make_pair
#define fi first
#define se second
#define pr(num) cout << num << "\n"
#define max(a, b) ((a)>(b) ? (a):(b))
#define min(a, b) ((a)<(b) ? (a):(b))
#define chmax(a, b) (a<b ? a=b : 0)
#define chmin(a, b) (a>b ? a=b : 0)
#define INF 1000000000000000000
#define MOD 1000000007LL
#define MAX 101010
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef map<ll, ll> Map;

ll N;
ll a[MAX]={};
ll cnt[MAX]={};
ll id=-1;
ll l=-1, r=-1;
ll mfa[MAX];
ll mrfa[MAX];

ll mPow(ll x, ll n) {
    ll res=1;
    while(n>0) {
        if(n&1) res=res*x%MOD;
        x=x*x%MOD;
        n>>=1;
    }
    return res;
}

ll fa(ll x) {
    if(x==0) return 1;
    if(mfa[x]!=-1) return mfa[x];
    return mfa[x]=x*fa(x-1)%MOD;
}

ll rfa(ll x) {
    if(x==0) return 1;
    if(mrfa[x]!=-1) return mrfa[x];
    rfa(x-1);
    return mrfa[x]=mPow(fa(x), MOD-2)%MOD;
}

ll C(ll n, ll k) {
    if(n<k) return 0;
    return fa(n)*rfa(k)%MOD*rfa(n-k)%MOD;
}

int main(void) {
    cin >> N;
    ll i;
    
    for(i=1; i<=N+1; i++) {
        cin >> a[i];
        cnt[a[i]]++;
        if(cnt[a[i]]==2) id=a[i];
    }
    
    for(i=1; i<=N+1; i++) {
        if(a[i]==id) {
            if(l==-1) l=i;
            else r=i;
        }
    }
    
    memset(mfa, -1, sizeof(mfa));
    memset(mrfa, -1, sizeof(mrfa));
    
    fa(100010);
    rfa(100010);
    
    for(i=1; i<=N+1; i++) {
        pr((C(N+1, i)-C(N+l-r, i-1)+MOD)%MOD);
    }
    
}
















Measured memory_bytes: 5888
import math

def twoch(k):
    if len(str(round(k))) == 1:
        ans = '0' + str(round(k))

    else:
        ans = str(round(k))

    return(ans)

while True:
    lst = list(input().split())
    if lst[0] == '-1':
        break

    T, H, S = int(lst[0]), int(lst[1]), int(lst[2])

    s = 3600*T + 60*H + S
    Sa = 7200 - s
    Sb = 3*Sa

    Ta = Sa//3600
    Sa = Sa - 3600*Ta
    Ha = Sa//60
    Sa = Sa - 60*Ha

    Tb = Sb//3600
    Sb = Sb - 3600*Tb
    Hb = Sb//60
    Sb = Sb - 60*Hb
    
    print(twoch(Ta)+ ':'+ twoch(Ha)+ ':'+ twoch(Sa))
    print(twoch(Tb)+ ':'+ twoch(Hb)+ ':'+ twoch(Sb))


Measured memory_bytes: 5668
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned int u32;
typedef pair<int, int> p;
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 Inf = 1000000000;
ll inf = 1000000000000;
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 main() {
	int n;
	cin >> n;
	int a[330000];
	int i;
	for (i = 0; i < n; i++) {
		cin >> a[i];
	}
	stable_sort(a,a+n);
	for (i = 0; i < n - 1; i++) {
		if (a[i] == a[i + 1]) {
			cout << "NO";
			return(0);
		}
	}
	cout << "YES";
	return(0);
}

Measured memory_bytes: 1408
#include<bits/stdc++.h>
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define full(a) a.begin(),a.end()
#define rfull(a) a.rbegin(),a.rend()

using namespace std;
const double pi=acos(-1.0);
const double pii=2*pi;
const double eps=1e-6;
const long long MOD=1e9+7;

// long long pow_mod(long long a, long long b){
// 	if(a == 0)
// 		return 0ll;
// 	if(b == 0)
// 		return 1ll;
// 	if(b == 1)
// 		return a%MOD;
// 	long long x = pow_mod(a,b/2);
// 	return ((b%2 == 1) ? (((x*x)%MOD)*a)%MOD : (x*x)%MOD);
// }

// long long pow_int(long long a, long long b){
// 	if(a==0)
// 		return a;
// 	if(b==0)
// 		return 1;
// 	if(b==1)
// 		return a;
// 	long long x = pow_int(a,b/2);
// 	return ((b%2 == 1) ? x*x*a : x*x);
// }

// int pow_int(int a, int b){
// 	if(a==0)
// 		return a;
// 	if(b==0)
// 		return 1;
// 	if(b==1)
// 		return a;
// 	int x = pow_int(a,b/2);
// 	return ((b%2 == 1) ? x*x*a : x*x);
// }


// void print_vec(vector<int>& a){
// 	for(int i=0;i<a.size();i++)
// 		cout << a[i] << (i<n-1 ? " ":"\n");
// }

// void print_vec(vector<long long>& a){
// 	for(int i=0;i<a.size();i++)
// 		cout << a[i] << (i<n-1 ? " ":"\n");
// }

// void solve_kick_start(int test_case){

// }

void solve(){
	vector<pair<string,int>> s{{"SUN",7},{"MON",6}, {"TUE",5}, {"WED",4}, {"THU",3}, {"FRI",2}, {"SAT",1}};
	string sr;
	cin>>sr;
	for(int i=0;i<7;i++){
		if(sr==s[i].F){
			cout << s[i].S << "\n";
			return;
		}
	}
}

int main(){
	std::ios::sync_with_stdio(false);
	std::cin.tie(NULL);
	std::cout.tie(NULL);

	// // CodeChef Template
	// int t;       
	// cin >> t;
	// while(t--){
	// 	solve();
	// }

	// Single test case input
	solve();

	// // Kick Start Template	
	// int test_cases;
	// cin >> test_cases;
	// for(int i=1;i<=test_cases;i++){
	// 	solve_kick_start(i);
	// }

	return 0;
}

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

int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(n);
    priority_queue<int> q;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    q.push(a[i]);
  }

  for (int i = 0; i < m; i++) {
    int tmp = (q.top() / 2);
    q.pop();
    q.push(tmp);
  }

  int64_t ans = 0;
  for (int i = 0; i < n; i++) {
    ans += q.top();
    q.pop();
  }
  cout << ans << endl;
}

Measured memory_bytes: 1276
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())

iter = False
#while iter == False:
if a < b:
  if a + t*v >= b + t*w:
    iter =True
 
elif a > b:
  if a - t*v <= b - t*w:
    iter = True

elif a == b:
  iter = True
  


if iter == True:
  print("YES")
else:
  print("NO")

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

struct UnionFind
{
  vector<int> par;
  vector<int> sizes;
  int counts;

  UnionFind(int n) : par(n), sizes(n, 1)
  {
    rep(i,n)
      par[i] = i;
    counts = n;
  }

  int find(int x)
  {
    if (x == par[x])
      return x;
    return par[x] = find(par[x]);
  }

  void unite(int x, int y)
  {
    x = find(x);
    y = find(y);

    if (x == y)
      return;

    if (sizes[x] < sizes[y])
      swap(x, y);

    par[y] = x;
    sizes[x] += sizes[y];
    counts--;
  }

  bool same(int x, int y)
  {
    return find(x) == find(y);
  }

  int size(int x)
  {
    return sizes[find(x)];
  }

  int count()
  {
    return counts;
  }
};

int main()
{
  int n, m;
  cin >> n >> m;
  UnionFind u = UnionFind(n);
  rep(i, m)
  {
    int x, y, z;
    cin >> x >> y >> z;
    x--; y--;
    u.unite(x, y);
  }
  cout << u.count() << endl;
}

Measured memory_bytes: 1024
import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextInt()
    val a = sc.nextInt()
    val b = sc.nextInt()
    println(problem083b(n, a, b))
}

fun problem083b(n: Int, a: Int, b: Int): Int {
    var allSum = 0
    for (i in 1..n) {
        var sum = i.toString().takeLast(1).toInt()
        var n2 = i
        while (n2 >= 10) {
            n2 /= 10
            sum += n2.toString().takeLast(1).toInt()
        }
        if (sum in a..b) {
            allSum += i
        }
    }
    return allSum
}

Measured memory_bytes: 33692
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Diagnostics;


struct Myon2
{
    int a;
}

class Myon
{
    public Myon() { }
    public static int Main()
    {
        new Myon().calc();
        return 0;
    }

    Scanner cin;

    int N;
    List<int>[] es;

    void calc()
    {
        cin = new Scanner();

        N = cin.nextInt();
        es = new List<int>[N];
        for (int i = 0; i < N; i++)
        {
            es[i] = new List<int>();
        }
        for (int i = 0; i < N - 1; i++)
        {
            int a = cin.nextInt() - 1;
            int b = cin.nextInt() - 1;
            es[a].Add(b);
            es[b].Add(a);
        }
        int start = getPos(0);
        int dist;
        getPos(start);
        dist = d;

        if (dist % 3 == 1) Console.WriteLine("Second");
        else Console.WriteLine("First");
    }

    int d;
    int getPos(int a)
    {
        Queue<int> q = new Queue<int>();
        int[] dist = new int[N];
        int MAX = 9999999;
        for (int i = 0; i < N; i++)
        {
            dist[i] = MAX;
        }
        q.Enqueue(a);
        dist[a] = 0;
        int last = 0;
        while(q.Count != 0)
        {
            int now = q.Dequeue();
            last = now;
            foreach (var next in es[now])
            {
                if (dist[next] != MAX) continue;
                dist[next] = dist[now] + 1;
                q.Enqueue(next);
            }
        }
        d = dist[last];
        return last;
    }
}




class Scanner
{
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner()
    {
        s = new string[0];
        i = 0;
    }

    public string next()
    {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return next();
        i = 0;
        return s[i++];
    }

    public int nextInt()
    {
        return int.Parse(next());
    }
    public int[] ArrayInt(int N, int add = 0)
    {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextInt() + add;
        }
        return Array;
    }

    public long nextLong()
    {
        return long.Parse(next());
    }

    public long[] ArrayLong(int N, long add = 0)
    {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextLong() + add;
        }
        return Array;
    }

    public double nextDouble()
    {
        return double.Parse(next());
    }


    public double[] ArrayDouble(int N, double add = 0)
    {
        double[] Array = new double[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextDouble() + add;
        }
        return Array;
    }
}


Measured memory_bytes: 42928
#include<iostream>
#include<string>

using namespace std;
int main(void){
  string str;
  cin >> str;
  int i;
  int a,b;

  while(str!="-"){
    cin >> a;
    for(i=0;i<a;i++){
      cin >> b;
      str=str.substr(b,str.size()-b)+str.substr(0,b);
    }
    cout << str << endl;
    cin >> str;
  }
  
}


Measured memory_bytes: 3176
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<ctime>
#include<queue>

using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vector<int> >;
using pii = pair<int, int>;
using ppi = pair<pii, int>;

int f_dir[2][4] = {{-1, 0, 1, 0}, {0, 1, 0, -1}}; //↑→↓←
int e_dir[2][8] = {{-1, -1, -1, 0, 0, 1, 1, 1}, {-1, 0, 1, -1, 1, -1, 0, 1}};
bool is_in_field(int y, int x, int h, int w){
  return (y >= 0 && y < h && x >= 0 && x < w);
}

#define MOD 1000000007

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int ti = clock();
  // start-----------------------------------------------
  ll n, k; cin >> n >> k;
  ll ans = 0;
  vector<long long> acc(n+2);
  acc[0] = 0;
  acc[1] = 0;
  for(int i = 2; i <= n+1; i++){
    acc[i] = acc[i-1] + i - 1;
  }
  for(int i = k; i <= n+1; i++){
    // cout << acc[n+1] << ' ' << acc[n+1-i] << ' ' << acc[i] << ' ' <<acc[0] << endl;
    // cout << acc[n] - acc[n-i] << ' ' << acc[i] - acc[0] << endl;
    ans +=  (acc[n+1] - acc[n+1-i]) - (acc[i] - acc[0]) + 1;
    ans %= MOD;
  }
  cout << ans << endl;

  // end-----------------------------------------------
  // cerr << 1.0 * (clock() - ti) / CLOCKS_PER_SEC << endl;
}


Measured memory_bytes: 4768
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG //GCC5.4.1で配列の範囲外アクセスをエラーにする

//cmdで g++ test.cpp とするとコンパイルできる
//制限1秒なら10^6は余裕 10^7は多分間に合う 10^8はよほど単純でないと厳しい
// https://github.com/atcoder/live_library
// cppdbg: test.exeのterminalに標準入力を打てる

#define ALL(x) x.begin(),x.end()
#define get_tp(t,i) get<i>(t)
#define len(x) (ll)(x.size())
#define ub(a,x) (upper_bound(ALL(a),x)-a.begin())
#define lb(a,x) (lower_bound(ALL(a),x)-a.begin())
typedef long long ll; //long long
typedef pair<int,int> pii; //pair<int,int>
typedef pair<long long,long long> pllll; //pair<ll,ll>
typedef vector<int> vi; //vector<int>
typedef vector<vector<int>> vvi; //vector<vector<int>>
typedef vector<ll> vll; //vector<long long>
typedef vector<vector<ll>> vvll; //vector<vector<long long>>
typedef priority_queue<ll, vector<ll>, greater<ll> > gpq; //逆順priority_queue
typedef priority_queue<ll> pq;

//const int MOD=998244353;
const int MOD=1000000007; //10^9+7
const long double PI=3.1415926535897932;

int main(){
    string O,E;cin>>O>>E;
    for(int i=0;i<O.size()+E.size();i++){
        cout<<((i%2)?E[i/2]:O[i/2]);
    }
    cout<<endl;
}

Measured memory_bytes: 3608
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)*}
    };
}

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

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

fn main(){
    let n: usize = 2;
    input!{
        v: [usize;n],
    }
    let n = v[0];
    let mut r = v[1];

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

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

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

int main() {
  int n, k;
  cin >> n >> k;
  int sum = 0;

  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    if (x < (k - x) ) sum += x * 2;
    else sum += (k - x) * 2;
  }

  cout << sum << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(int argc, char **argv)
{
	char str[10];
	memset( str,'\0',sizeof(str));
    int cnt=0;
  	fgets(  str,sizeof(str),stdin );
    for( int i=0; i<2; i++ )
    {
      if( *(str+i)=='9' )
      {
        cnt++;
      }
    }
    printf("%s\n",(cnt>0 ? "Yes" : "No"));
    fflush( stdout );
}
  

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

//素因数分解
vector<pair<ll,int>> factorize(ll n){
    vector<pair<ll,int>>res;
    for(ll i=2;i*i<=n;i++){
        if(n%i)continue;
        res.emplace_back(i,0);
        while (n%i == 0)
        {
        n /= i;
        res.back().second++;
        }
        
    }
    if(n != 1) res.emplace_back(n,1);
    return res;
}

void trace(int A[],int N){
    REP(i,N){
        if(i>0)printf(" ");
        printf("%d",A[i]);
    }
    printf("\n");
}


int main(){
    int A,B,C,D;
    cin >> A >> B >> C >> D;
    int sa = A*B,sb = C*D;
    if(sa == sb)cout << sa << endl;
    else if(sa>sb)cout << sa << endl;
    else cout << sb << endl;
}


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

int abs(int x){
  return (x<0?-x:x);
}

int main(){
  int N;
  cin >> N;
  int W[N];
  for(int i=0;i<N;i++) cin>>W[i];
  int min=-1;
  for(int T=0;T<N-1;T++){
    int sum1=0,sum2=0;
    for(int i=0;i<=T;i++) sum1+=W[i];
    for(int i=T+1;i<N;i++) sum2+=W[i];
    if(min==-1 || min>abs(sum2-sum1)) min=abs(sum2-sum1);
  }
  cout<<min<<endl;
  return 0;
}

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

#define all(x) x.begin(),x.end()
#define LB(V,x) lower_bound(all(V),x)-V.begin()

using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using pi = pair<int32, int32>;
using pll = pair<int64, int64>;
using vi = vector<int32>;
using vll = vector<int64>;
using ll = int64;

ll gcd(ll A, ll B){
    if(A<B) swap(A, B);
    if(B==0) return A;
    gcd(B,A%B);
}
ll gcd(vll V){
    ll ans=V[0],i=V.size();
    while(i--) ans = gcd(ans,V[i]);
    return ans;
}

void Main(){
    int N;
    cin >> N;
    vll A(N);
    for(auto &a:A) cin >> a;
    cout << gcd(A) << endl;
}

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

Measured memory_bytes: 1792
import sys
input = sys.stdin.readline

MAX = 2*10**6+100
MOD = 10**9+7
fact = [0]*MAX #fact[i]: i!
inv = [0]*MAX #inv[i]: iの逆元
finv = [0]*MAX #finv[i]: i!の逆元
fact[0] = 1
fact[1] = 1
finv[0] = 1
finv[1] = 1
inv[1] = 1
    
for i in range(2, MAX):
    fact[i] = fact[i-1]*i%MOD
    inv[i] = MOD-inv[MOD%i]*(MOD//i)%MOD
    finv[i] = finv[i-1]*inv[i]%MOD

def C(n, r):
    if n<r:
        return 0
    if n<0 or r<0:
        return 0
    return fact[n]*(finv[r]*finv[n-r]%MOD)%MOD
    
K = int(input())
S = input()[:-1]
L = len(S)
ans = 0

for i in range(L, L+K+1):
    ans += C(i-1, L-1)*pow(25, i-L, MOD)*pow(26, L+K-i, MOD)
    ans %= MOD

print(ans)

Measured memory_bytes: 138432
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

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

    static class BComparingStrings {
        public void solve(int testNumber, FastReader s, PrintWriter w) {
            int a = s.nextInt(), b = s.nextInt();
            if (a == b) {
                for (int i = 0; i < a; i++) w.print(a);
            } else if (a < b) {
                for (int i = 0; i < b; i++) w.print(a);
            } else for (int i = 0; i < a; i++) w.print(b);
        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private FastReader.SpaceCharFilter filter;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {

            if (numChars == -1)
                throw new InputMismatchException();

            if (curChar >= numChars) {

                curChar = 0;

                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }

                if (numChars <= 0)
                    return -1;
            }

            return buf[curChar++];
        }

        public int nextInt() {

            int c = read();

            while (isSpaceChar(c))
                c = read();

            int sgn = 1;

            if (c == '-') {
                sgn = -1;
                c = read();
            }

            int res = 0;

            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();

                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));

            return res * sgn;
        }

        public boolean isSpaceChar(int c) {

            if (filter != null)
                return filter.isSpaceChar(c);

            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}



Measured memory_bytes: 21716
/*
.   Bismillahir Rahmanir Rahim
.   Author - Marajul islam
.   created- 

*/ 
#include<bits/stdc++.h>
using namespace std;


 
int sc1() {int x; scanf("%d", &x); return x;}
long long sc2() {long long x; scanf("%lld", &x); return x;}

const int mod= 1e9 + 7;
inline int add(int a, int b) {a += b; return a >= mod ? a - mod : a;}
inline int sub(int a, int b) {a -= b; return a < 0 ? a + mod : a;}
inline int mul(int a, int b) {return (long long)a * b % mod;}
 
#define F               first
#define S               second 
#define mp              make_pair
#define pb              push_back
#define pf              push_front
#define speed_up        ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define sz(x)           (int)x.size()
#define all(x)          x.begin(), x.end()
#define debug           cerr << "OK\n";
#define ub              upper_bound
#define lb              lower_bound
#define gcd(a,b)        __gcd(a,b)
#define lcm(a,b)        (a*b)/gcd(a,b)
#define Int             sc1()
#define LL              sc2()
#define For(n)          for(int i=0;i<n;i++)
#define Forj(n)         for(int j=0;j<n;j++)
#define Fork(n)         for(int k=0;k<n;k++)
#define For1(n)         for(int i=1;i<=n;i++)

typedef long long       ll;
typedef vector<int>     vi;
typedef vector<ll>      vll;
typedef pair<int, int>  pii;
typedef pair<ll, ll>    pll;
typedef vector<pii>     vpii;
typedef set <int>       si;
typedef set <ll>        sll;
typedef multiset <int>  msi;
typedef multiset <ll>   msll;
typedef map <int, int>  mi;
typedef map <ll, ll>    mll;

#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) {cout << endl;}
template<typename T, typename... Args> void err(istream_iterator<string> it, T a, Args... args) {
    cerr << *it << " = " << a << ", ";
    err(++it, args...);
}
  
const int inf           = (int)2e9 + 5;
const ll  Inf           = (ll)1e18 + 5;
const int N             = 5e6 + 5;
 
 
 
int solve() {
 
	int k=Int;
	int sum =0;
	for(int i=1;i<=k;i++){
		for(int j=1;j<=k;j++){
			for(int l=1;l<=k;l++){
				int a=gcd(i,j);
				int b=gcd(a,l);
				// cout<<b<<endl;
				sum+=b;
			}
		}
	}
	cout<<sum<<endl;
 
	return 0;
}
 
 
 
 
int main()
{
	speed_up;
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
 
	int test = 1, tc = 0;
	//scanf("%d", &test);
	//cin >> test;
	while (test--) {
		//printf("Case %d: ", ++tc);
		solve();
	}
 
	return 0;
 
 
 
 
}




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

int main(){
  	int i,count=0;
 	string s;
  	cin >> s;
  	for(i=0;i<s.size()/2;i++){
     if(s[i] != s[s.size()-(i+1)]) count++; 
    }
   cout << count << endl;
  
}

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

int main(){
  int n;
  string st = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
  cin >>n;

  while(n!=0){
    string s;
    vector<int>key;
    string ans = "";

    for(int i = 0; i<n;i++){
      int x;
      cin >>x;
      key.push_back(x);
    }
    cin >>s;
    int ind = 0;
    for (int i = 0; i<(int)s.size(); i++){
      char c;
      for (int j = 0; j < (int)st.size();j++){
        if(s[i] == st[j]){
          if(j - key[ind] < 0)c = st[j - key[ind] + 52];
          else c =  st[j - key[ind]];
        }
      }
      ans = ans + c;
      ind++;
      if(ind >= (int)key.size()){
        ind = 0;
      }
    }
    cout <<ans<<endl;
    key.clear();
    cin >>n;
  }
  return 0;
}



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

int main(){
  	ios_base::sync_with_stdio(0);
  	cin.tie(0);
  	cout.tie(0);
  	int n, k;
  	cin >> n >> k;
  	int a[n];
  	for(int i=0; i<n; i++)
      cin >> a[i];
  	sort(a, a+n);
  	for(int i=0, j=0; i<=k; i++){
    	if(i == k){
        	cout << j;
          	break;
        }
      	j += a[i];
    }
	return 0;
}

Measured memory_bytes: 3656
F = [0 for i in range(10)]
def dfloor(l):
    f = F.copy()
    f[l[0]-1] = l[1]
    return f

H = {1:[F,F,F],
    2:[F,F,F],
    3:[F,F,F],
    4:[F,F,F]}
N = int(input())
p = 0
for n in range(N):
    a,b,c,d = tuple(int(n) for n in input().split())
    H[a][b-1] = [H[a][b-1][h]+dfloor([c,d])[h] for h in range(10)]
for I in H.values():
    p += 1
    for i in I:
        print(" " + " ".join(map(str,i)))
    if p != 4:
        print("#"*20)
     


Measured memory_bytes: 5604
x,y=map(int,input().split())
#p + q = x
#2p + 4q = y
#2(x-q)+4q = y
#2x+2q = y
#q = 2x-y/2
p = (4*x-y)/2
q = (y-2*x)/2
print('Yes' if p >= 0 and q >= 0 and p.is_integer() == True and q.is_integer() == True else 'No')

Measured memory_bytes: 9172
#include<iostream>
#include<cstring>
#include<cmath>
using namespace std;
//int ans = 0;

long long int recursive(int arr[100005][3], int sz, int row, int initial, long long int dp[100005][3]) {
	if (row >= sz)
		return 0;

	if (dp[row][initial] != -1)
		return dp[row][initial];

	int ans = 0;

	if (initial == 0) {
		int mchoice = arr[row][1] + recursive(arr, sz, row + 1, 1, dp);
		int rchoice = arr[row][2] + recursive(arr, sz, row + 1, 2, dp);
		ans += max(mchoice, rchoice);
	} else if (initial == 1) {
		int lchoice = arr[row][0] + recursive(arr, sz, row + 1, 0, dp);
		int rchoice = arr[row][2] + recursive(arr, sz, row + 1, 2, dp);
		ans += max(lchoice, rchoice);
	} else if (initial == 2) {
		int lchoice = arr[row][0] + recursive(arr, sz, row + 1, 0, dp);
		int mchoice = arr[row][1] + recursive(arr, sz, row + 1, 1, dp);
		ans += max(lchoice, mchoice);

	}
	else {
		int lans = arr[row][0] + recursive(arr, sz, row + 1, 0, dp);
		int mans = arr[row][1] + recursive(arr, sz, row + 1, 1, dp);
		int rans = arr[row][2] + recursive(arr, sz, row + 1, 2, dp);
		ans += max(lans, max(mans, rans));

	}

	return dp[row][initial] = ans;

}

int main() {
	int n;
	cin >> n;
	int arr[100005][3];
	for (int i = 0; i < n; i++)
		for (int j = 0; j < 3; j++)
			cin >> arr[i][j];


	long long int dp[100005][3];

	memset(dp, -1, sizeof dp);
	cout << recursive(arr, n, 0, 3, dp) << "\n";
	return 0;
}

Measured memory_bytes: 16436
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
    vector<int> W(10), K(10);
    for (int i = 0; i < 10; i++) {
        cin >> W[i];
    }
    for (int i = 0; i < 10; i++) {
        cin >> K[i];
    }
    sort(W.begin(), W.end());
    sort(K.begin(), K.end());
    cout << W[9] + W[8] + W[7] << " " << K[9] + K[8] + K[7] << "\n";
    return 0;
}


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

int main() {
  char x,y;
  cin>>x>>y;
  int a,b;
  a=x;
  b=y;
  if(a==b)
    cout<<'=';
  else if(a==max(a,b))
    cout<<'>';
  else cout<<'<';
}


Measured memory_bytes: 256
n,m,x,y = map(int,input().split())
xi = list(map(int,input().split()))
yi = list(map(int,input().split()))
x_max = max(xi)
y_min = min(yi)
a = 0
if x_max < y_min:
    if x < y_min and y > x_max:
        a += 1
if a >= 1:
    print("No War")
else:
    print("War")

Measured memory_bytes: 3064
#include<iostream>
#include<cstdio>
#include<string>
using namespace std;
string st;
int main()
{
	cin>>st;
	for(int i=0;i<st.size();i++)
	 if(st[i]=='C')
	  for(int j=i+1;j<st.size();j++)
	   if(st[j]=='F')
	   {
	   	puts("Yes");
	   	return 0;
	   }
	puts("No");
	return 0;
} 

Measured memory_bytes: 256
from math import gcd
MOD = 10**9 + 7
MOD_t_MAX = 2*(10**5) + 10

fac  = [None] * MOD_t_MAX
finv = [None] * MOD_t_MAX
inv  = [None] * MOD_t_MAX
def MOD_COM_init():
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, MOD_t_MAX):
        fac[i] = fac[i - 1] * i % MOD
        inv[i] = MOD - inv[MOD%i] * (MOD // i) % MOD
        finv[i] = finv[i - 1] * inv[i] % MOD
def MOD_COM(n, k):
    if n < k:
        return 0
    if n < 0 or k < 0:
        return 0
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD

def main():
    n = int(input())
    iwashi = [list(map(int, input().split())) for _ in range(n)]
    MOD_COM_init()
    ans = pow(2, n, MOD)
    ans -= 1
    ans %= MOD
    dic = {}
    cnt = [0, 0, 0, 0]
    for i in range(n):
        a, b = iwashi[i]
        if a == 0 and b == 0:
            cnt[3] += 1
        elif b == 0:
            cnt[2] += 1
        elif a == 0:
            cnt[1] += 1
        else:
            cnt[0] += 1
            fa, fb = False, False
            if a < 0:
                fa = True
                a *= -1
            if b < 0:
                fb = True
                b *= -1
            c = gcd(a, b)
            a //= c
            b //= c
            if (fa and not fb) or (not fa and fb):
                a *= -1
            tmp = (a, b)
            if tmp in dic:
                dic[tmp] += 1
            else:
                dic[tmp] = 1
    L = 1
    if 0 < cnt[3]:
        p = (pow(2, n-cnt[3], MOD)-1)*MOD_COM(cnt[3], 1)%MOD
        q = 0
        for i in range(2, cnt[3]+1):
            q += MOD_COM(cnt[3], i)
        q *= pow(2, n-cnt[3], MOD)
        ans -= p+q
        ans %= MOD
    if 0 < cnt[1] and 0 < cnt[2]:
        p = (pow(2, cnt[1], MOD)-1) * (pow(2, cnt[2], MOD)-1) % MOD
        p *= pow(2, cnt[0], MOD)
        L *= ((pow(2, cnt[1], MOD)-1) + (pow(2, cnt[2], MOD)-1) + 1) % MOD
        ans -= p
        ans %= MOD
    if 1 < cnt[0]:
        p = 0
        st = set()
        for v in dic.keys():
            if v in st:
                continue
            u = None
            if v[0] > 0 and v[1] > 0:
                u = (-1*v[1], v[0])
            else:
                u = (v[1], -1*v[0])
            x = dic[v]
            y = 0
            if u in dic:
                y = dic[u]
            cnt[0] -= x+y
            q = (pow(2, x, MOD)-1) * (pow(2, y, MOD)-1) * pow(2, cnt[0], MOD) * L % MOD
            p += q
            L *= ((pow(2, x, MOD)-1) + (pow(2, y, MOD)-1) + 1) % MOD
            L %= MOD
            p %= MOD
            st.add(v)
            st.add(u)
        p %= MOD
        ans -= p
        ans %= MOD
    print(ans%MOD)

if __name__ == "__main__":
    main()

Measured memory_bytes: 155264
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt();
			long[] a = new long[n];
			// max[i]=max(a[0],...,a[i-1])
			long[] max = new long[n];
			a[0] = scanner.nextInt();
			max[0] = 0;
			System.out.println(IntStream.range(1, n).mapToLong(i -> {
				a[i] = scanner.nextInt();
				max[i] = Math.max(max[i - 1], a[i - 1]);
				return (max[i] > a[i]) ? max[i] - a[i] : 0;
			}).sum());
		}
	}
}


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

using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
REP(i, v.size()) { if (i)os << " "; os << v[i]; }return os;
}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
REP(i, v.size()) { if (i)os << endl; os << v[i]; }return os;
}

int main() {
	ll n, m;
	vector<ll> v1;
	vector<ll> v2;

	cin >> n;

	REP(i, n) {
		ll d;
		cin >> d;
		v1.push_back(d);
	}

	cin >> m;

	REP(i, m) {
		ll t;
		cin >> t;
		v2.push_back(t);
	}

	sort(v1.begin(), v1.end());
	sort(v2.begin(), v2.end());

	ll now = 0;

	REP(i, n) {
		if (v1[i] == v2[now]) {
			now++;
		}

		if (now >= v2.size()) {
			cout << "YES" << endl;
			return 0;
		}
	}

	cout << "NO" << endl;
}


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

const int N = 3005, djq = 998244353;

int A, B, C, D, f[N][N], g[N][N];

int main()
{
	std::cin >> A >> B >> C >> D;
	f[A][B] = 1;
	for (int i = A; i <= C; i++)
		for (int j = B; j <= D; j++)
		{
			if (i == A && j == B) continue;
			f[i][j] = (1ll * f[i - 1][j] * j + g[i - 1][j]) % djq;
			g[i][j] = 1ll * (f[i][j - 1] + g[i][j - 1]) * i % djq;
		}
	return std::cout << (f[C][D] + g[C][D]) % djq << std::endl, 0;
}

Measured memory_bytes: 74004
#include<iostream>    
#include<cstdio>  
#include<stdio.h>  
#include<cstring>    
#include<cstdio>    
#include<climits>    
#include<cmath>   
#include<vector>  
#include <bitset>  
#include<algorithm>    
#include <queue>  
#include<map> 
#define inf 9999999; 
using namespace std;


int n, m, i, x, y;
int a[100005];
int main()
{
	cin >> n >> m;
	memset(a, 0, sizeof(a));
	for (i = 1; i <= m; i++)
	{
		cin >> x >> y;
		a[x]++;
		a[y]++;
	}
	for (i = 1; i <=n; i++)
	{
		if (a[i] % 2 == 1)
		{
			cout << "NO" << endl;
			return 0;
		}
	}
	cout << "YES" << endl;
}

Measured memory_bytes: 640
in_data = [list(map(int,input().split())) for i in range(3)]

N = in_data[0][0]

earn_ttl = 0

for i in range(N):
    value = in_data[1][i]
    cost = in_data[2][i]
    earn = value - cost
    if (earn > 0):
        earn_ttl = earn_ttl + earn
        
print(earn_ttl)

Measured memory_bytes: 3060
#include <iostream>
using namespace std;
int main()
{
	int n;
	int d;
	int yes[100010];
	int layer=0;
	cin>>n;
	while(n--)
	{
		cin>>d;
		if(yes[d]==0)
		{
			yes[d]=1;
			layer++;
		}
	}
	cout<<layer<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N,M,c=0;
  cin >> N >> M;
  vector<int> in(M*2);
  for(int i=0;i<M*2;i++) cin >> in.at(i);
  for(int i=0;i<N;i++){
    for(int j=0;j<M*2;j++) if(in.at(j) == i+1) c++;
    cout << c << endl;
    c = 0;
  }
}

Measured memory_bytes: 256
//*
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include <stdlib.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <numeric>
#include <functional>
#define MOD 1000000007
#define MAX 0x3f3f3f3f
#define MAX2 0x3f3f3f3f3f3f3f3fll
#define ERR 1e-10
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#pragma warning(disable:4996)
using namespace std;

typedef long long ll;
typedef long double ldb;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;

struct NODE
{
	char x;
	int count;
	NODE *next[27];
	NODE(char x=0):x(x)
	{
		count=0;
		for(int i=0;i<27;i++) next[i]=NULL;
	}
} root;

int n, m;
char in[500000];
string a[300000];

int dat[100005][27][27];

char sq[100];
int q[100];

int main()
{
	int i, j, k, l;
	cin>>n;
	for(i=0;i<n;i++)
	{
		scanf("%s", in);
		a[i]=string(in);
	}
	for(i=0;i<n;i++)
	{
		NODE *now=&root;
		now->count++;
		for(auto e : a[i])
		{
			if(now->next[e-'a'+1] == NULL) now->next[e-'a'+1]=new NODE(e);
			now=now->next[e-'a'+1];
			now->count++;
		}
		if(now->next[0] == NULL) now->next[0]=new NODE(0);
		now=now->next[0];
		now->count++;
	}
	for(i=0;i<n;i++)
	{
		NODE *now=&root;
		for(auto e : a[i])
		{
			int u=e-'a'+1;
			int xcnt=0;
			for(j=0;j<27;j++)
			{
				if(j == u) continue;
				dat[i][u][j]+=now->next[j]?now->next[j]->count:0;
			}
			now=now->next[u];
		}
		int u=0;
		int xcnt=0;
		for(j=0;j<27;j++)
		{
			if(j == u) continue;
			dat[i][u][j]+=now->next[j]?now->next[j]->count:0;
		}
	}
	cin>>m;
	for(k=0;k<m;k++)
	{
		int x;
		scanf("%d%s", &x, sq), x--;
		for(i=0;i<26;i++) q[i+1]=sq[i]-'a'+1;
		int ans=0;
		for(i=0;i<27;i++)
		{
			for(j=0;j<i;j++)
			{
				ans+=dat[x][q[i]][q[j]];
			}
		}
		printf("%d\n", ans+1);
	}
	return 0;
}
//*/

Measured memory_bytes: 343808
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  cin >> n;
  int ans = 1<<30;
  for(int i = 0;i<n;i++){
    int a;
    cin >> a;
    int kari =0;
    while( a %2 ==0){
      a /= 2;
      kari++;
    }
    ans = min(ans,kari);
  }
  cout << ans;
    
}

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

#define ld long double
#define ll long long
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define MP make_pair
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
ll INF = 1e18;
void chmin(ll &a,ll b){if(a>b)a=b;}
void chmax(ll &a,ll b){if(a<b)a=b;}
void pmod(ll &a,ll b){a=(a+b)%MOD;}
void qmod(ll &a,ll b){a=(a*b)%MOD;}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
void ans(bool x,ll y,ll z){if(x)cout<<y<<endl;else cout<<z<<endl;}
void anss(bool x,string y,string z){if(x)cout<<y<<endl;else cout<<z<<endl;}   
ll gcd(ll x,ll y){ll r;while((r=x%y)!=0){x=y;y=r;}return y;}

int main(){
  ll i,j,o;
  ll res=0,res1=0,res2=INF,buf=0,buf1=0,buf2=0,buf3=0,buf4=0,sum=0;
  ll l,r;
  bool judge = true;
  ll n;cin>>n;
  for(i=1;i*i<=n;i++){
    if(n%i==0){
      buf=n/i;
      for(j=0;buf!=0;j++,buf/=10);
      chmin(res2,j);
    }
  }
  cout<<res2<<endl;
  return 0;
}

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

int n;
char str[305][305];
char str2[305][305];

int main(){
    scanf("%d",&n);
    int cnt = 0;
    for(int i=0;i<n;i++) scanf("%s", str[i]);
    for(int i=0;i<n;i++){
        for(int ii=0;ii<n;ii++){
            for(int jj=0;jj<n;jj++){
                str2[ii][(jj+i)%n] = str[ii][jj];
            }
        }
        bool valid = true;
        for(int ii=0;ii<n;ii++){
            for(int jj=0;jj<n;jj++){
                valid = valid & (str2[ii][jj] == str2[jj][ii]);
            }
        }
        if(valid) cnt++;
    }
    printf("%d\n", cnt * n);
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll N=1e6+5,inf=1e18,mod=1e9+7;
#define test ll testcases;cin>>testcases; while(testcases--)
#define lp(var,start,end) for (ll var = start; var <end ; ++var)
#define rlp(var,start,end) for(ll var = start; var>=end ; var--)
#define pb push_back
#define mp make_pair
#define pf push_front
#define ff first
#define ss second
#define vll vector<ll>
#define vld vector<ld>
#define pll pair<ll,ll> 
#define pld pair<ld,ld> 
#define vpll vector<pll>
#define vpld vector<pld>
#define all(X) X.begin(),X.end()
#define sz(x) ((ll)((x).size()))
const ld pi=3.141592653589793238;

bool check_prime(ll n)
{
	ll flag=0,i;
	for(i=2;i*i<=n;i++)
	{
		if(n%i==0)
		{
			flag=1;
			break;
		}
	}
	if(n==1)
	{
		return false;
	}
	else if(flag==0 || n==2 || n==3)
	{
		return true;
	}
	else
	{
		return false;
	}
}

ll fastexpo(ll a,ll b,ll MOD) 
{
	ll result=1;
	while(b>0)
	{
		if(b%2==1)
		{
			result=(result*a)%MOD;
		}
		a=(a*a)%MOD;
		b=b/2;
	}
	return result;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n,i,f,c1,c2;
    cin>>n;
    string s;
    cin>>s;
    c1=0;
    c2=0;
    for(i=0;i<n;i++)
    {
    	if(s[i]=='R')
    	{
    		c1++;
    	}
    	else
    	{
    		c2++;
    	}
    }
    f=0;
    for(i=0;i<n;i++)
    {
    	if(i+1<=c1)
    	{
    		if(s[i]!='R')
    		{
    			f++;
    		}
    	}
    	else
    	{
    		if(s[i]!='W')
    		{
    			f++;
    		}
    	}
    }
    cout<<f/2<<"\n";
	return 0;
}

Measured memory_bytes: 3704