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


typedef long long ll;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef long double ld;

typedef set<int>::iterator sit;
typedef map<int,int>::iterator mit;
typedef vector<int>::iterator vit;

const int INF = 1e9 + 7;
const int MOD = 1e9 + 7;
const int MAXN = 1e6 + 3;

#define _  %  MOD
#define __ %= MOD

#define      each(it,s)        for(auto it = s.begin(); it != s.end(); ++it)
#define      sortA(v)          sort(v.begin(), v.end())
#define      sortD(v)          sort(v.begin(), v.end(), greater<auto>())
#define      fill(a)           memset(a, 0, sizeof (a))

#define      swap(a,b)        {a=a+b;b=a-b;a=a-b;}
#define      rep(i, n)         for(ll i = 0; i < (n); ++i)
#define      repA(i, a, n)     for(ll i = a; i <= (n); ++i)
#define      repD(i, a, n)     for(ll i = a; i >= (n); --i)
#define watch(x) cout << (#x) << " is " << (x) <<endl

#define fi first
#define se second
#define mp make_pair
#define pb push_back

#define fbo find_by_order
#define ook order_of_key

ll gcd(ll a,ll b){if(b==0) return a; else return gcd(b,a%b);}
ll power(ll x,ll y){ll res=1; while(y>0){if(y&1) res=res*x;y=y>>1;x=x*x;}return res;} // modular exponent

int main()
{
    ios_base::sync_with_stdio(false); // don't use printf and scanf
    cin.tie(NULL); // cout<<fixed<<setprecision
    string s,t;
    cin>>s>>t;
    int a=s.length();
    rep(i,a)
    {
        if(s[i]!=t[i])
        {
            cout<<"No\n";
            return 0;
        }
    }
    cout<<"Yes\n";
    return 0;
}
// JUST ASK YOURSELF DID YOU GIVE YOUR BEST ? ISSE ZYADA
// KUCH KAR BHI NAHI SAKTE !! ENJOY AND GIVE YOUR BEST!!


Measured memory_bytes: 3648
fun main(args: Array<String>) {
    val (d, n) = readInputLine().split(" ").map { it.toInt() }
    
    println(pow(100, d) * if (n != 100) n else (n + 1))
}
 
fun readInputLine(): String {
    return readLine()!!
}

fun pow(x: Int, y: Int): Int {
    var ret = 1
    
    for (i in 1..y) {
        ret *= x
    }
    
    return ret
}


Measured memory_bytes: 37904
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using static System.Console;
using static System.Math;

namespace Atcoder
{
    class Program
    {
        static StreamWriter sw = new StreamWriter(OpenStandardOutput()) { AutoFlush = false };
        static void Main(string[] args)
        {
            try
            {
                SetOut(sw);
                Solve.Answer();
                Out.Flush();
            }
            catch (Exception ex)
            {
                WriteLine(ex.ToString());
                Out.Flush();
            }
        }
    }

    public class Solve
    {
        public static void Answer()
        {
            var N = IO.RInt;

            for (int i = 0; i < 100000; i++)
            {
                int a = (int)(i * (decimal)1.08);
                if (a == N)
                {
                    WriteLine(i);
                    return;
                }
            }
            WriteLine(":(");
        }
    }

    public class IO
    {
        #region Input
        public static int RInt => int.Parse(ReadLine());
        public static long RLong => long.Parse(ReadLine());
        public static double RDouble => double.Parse(ReadLine());

        public static string[] RSString => ReadLine().Split();
        public static int[] RSInt => ReadLine().Split().Select(s => int.Parse(s)).ToArray();
        public static long[] RSLong => ReadLine().Split().Select(s => long.Parse(s)).ToArray();
        public static double[] RSDouble => ReadLine().Split().Select(s => double.Parse(s)).ToArray();
        #endregion

        #region Output
        public static void OutJoinSpace<T>(IEnumerable<T> list) => WriteLine(string.Join(" ", list));
        public static void WriteLineYes_or_No(bool flag) => WriteLine(flag ? "Yes" : "No");
        public static void WriteLineYES_or_NO(bool flag) => WriteLine(flag ? "YES" : "NO");
        #endregion
    }

    public class Mod
    {
        #region
        private readonly static long M = 1000000007;

        public static long Add(long a, long b) => (a * b) % M;
        public static long Sub(long a, long b) => (a - b) % M >= 0 ? (a - b) % M : (a - b) % M + M;
        public static long Multi(long a, long b) => (a * b) % M;
        #endregion
    }
}

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

int main(){
    int a, b, c;
    cin >> a >> b >> c;
    cout << max(0,c-(a-b)) << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
using namespace std;
using ll = long long;
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; }
const ll INF = 1e9;
const ll MOD = 1e9 + 7;


struct UnionFind {
    vector<int> par;
    vector<int> sizes;
    vector<int> maxs;
    vector<int> mins;

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

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

    bool merge(int x, int y) {
        x = root(x);
        y = root(y);
        if (x == y) return false;
        if (sizes[x] < sizes[y]) swap(x, y);
        par[y] = x;
        maxs[x] = max(maxs[y], maxs[x]);
        mins[x] = min(mins[y], mins[x]);
        sizes[x] += sizes[y];
        return true;
    }

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

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

    int getMax(int x) {
        return maxs[root(x)];
    }

    int getMin(int x) {
        return mins[root(x)];
    }

};


int main(){
    int n, m;
    cin >> n >> m;
    vector<int> a(m), b(m);
    rep(i, m) cin >> a[i] >> b[i];

    int ans = 0;
    rep(i, m){
        UnionFind uf(n+1);
        rep(j, m){
            if(i == j) continue;
            uf.merge(a[j], b[j]);
        }
        if(uf.size(1) != n) ans++;
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <numeric>

using namespace std;

int main()
{
	int N;
	cin >> N;
	vector<int> a(N);
	for (auto &x : a) {
		cin >> x;
	}
	int ans = accumulate(a.begin(), a.end(), -N);
	cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (i=a;i<n;i++)
#define per(i,a,n) for (i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define SIZE 1000001
#define ONLINE_JUDGE
#define rd
#define PI acos(-1)
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
mt19937 mrand(random_device{}());
auto clk=clock(); 
const ll mod=1000000007;
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
const ll infl=0x3f3f3f3f3f3f3f3fLL;
const int infi=0x3f3f3f3f;

int main(){

	int i,n,freq[200005];
	memset(freq,0,sizeof(freq));
	cin>>n;
	rep(i,1,n){
		int x;
		cin>>x;
		freq[x-1]++;
	}
	rep(i,0,n) cout<<freq[i]<<"\n";
	return 0;
}


Measured memory_bytes: 4388
#include<stdio.h>
int main(){
	int A, B, a = 1, b;
	scanf("%d", &A);
	scanf("%d", &B);
	for (int i = 0; i < A; i++){
		a = a * 100;
	}
  if (B == 100) B += 1;
  b = a * B;
	printf("%d", b);
}


Measured memory_bytes: 128
use std::vec::Vec;

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().split_whitespace()
        .map(|e| e.parse().ok().unwrap()).collect()
}

fn main() {
    let n: usize = read();
    let v: Vec<i32> = read_vec();
    let c: Vec<i32> = read_vec();
    let mut ans = 0;
    for i in 0..n  {
        if v[i] - c[i] > 0 {
            ans += v[i] - c[i];
        }
    }
    println!("{}", ans)
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    int n;
    cin>>n;
    vector<ll> a(n+2);
    a.at(0)=0;
     a.at(n+1)=0;
    for(int i=1;i<n+1;i++)cin>>a.at(i);
    vector<ll> d(n+1),d2(n);
   for(int i=0;i<n+1;i++){
       d.at(i)=abs(a.at(i+1)-a.at(i));
   }
   for(int i=2;i<n+2;i++)d2.at(i-2)=abs(a.at(i)-a.at(i-2));
   ll ans=0;
   for(int i=0;i<n+1;i++)ans+=d.at(i);
   for(int i=0;i<n;i++){
       ll res=ans;
       res+=d2.at(i)-(d.at(i+1)+d.at(i));
       cout<<res<<endl;
   }
}

Measured memory_bytes: 3584
#include <stdio.h>
int main()
{
	int i,j,a[100000];
	while(1){
		scanf("%d",&a[i]);
		if(a[i]==0)
			break;
		i++;
	}
	for(j=0;j<i;j++)
		printf("Case %d: %d\n",j+1,a[j]);
	return 0;
}

Measured memory_bytes: 644
#include<bits/stdc++.h>
using namespace std;
int ff;
int n,m,col[500100],blo,tot,le,ri,ans[500100],cnt[500100];
pair<pair<int,int>,int> que[500100];
bool pp(pair<pair<int,int>,int> x,pair<pair<int,int>,int> y){
	return x.first.second<y.first.second;
}
inline void inser(int val){cnt[val]++;if(cnt[val]==1) ff++;}
inline void eras(int val){cnt[val]--;if(cnt[val]==0) ff--;}
int main(){
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++) scanf("%d",&col[i]);
	for(int i=1;i<=m;i++){
		scanf("%d%d",&que[i].first.first,&que[i].first.second);
		que[i].second=i;
	}
	sort(que+1,que+m+1);
	blo=max(1,(int)(sqrt(m)));
	tot=(m+blo-1)/blo;
	for(int i=1;i<=tot;i++){
		le=blo*(i-1)+1;
		ri=min(blo*i,m);
		sort(que+le,que+ri+1,pp); 
		for(int j=1;j<=n;j++) cnt[j]=0;
		ff=0;
		for(int j=que[le].first.first;j<=que[le].first.second;j++)
			inser(col[j]);
		ans[que[le].second]=ff;
		for(int j=le+1;j<=ri;j++){
			for(int kk=que[j-1].first.first;kk<que[j].first.first;kk++)
				eras(col[kk]);
			for(int kk=que[j].first.first;kk<que[j-1].first.first;kk++)
				inser(col[kk]);
			for(int kk=que[j-1].first.second+1;kk<=que[j].first.second;kk++)
				inser(col[kk]);
			ans[que[j].second]=ff;
		}
	}
	for(int i=1;i<=m;i++) printf("%d\n",ans[i]);
	return 0;
}


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

#define gcd(m,n) __gcd(m,n)
#define lcm(m,n) m*(n/gcd(m,n))
#define fast std::ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pi acos(-1.0)
#define endl '\n'
#define MOD 1000000007
#define ull unsigned long long
#define ll long long
#define ld long double
#define pb push_back
#define dbg(x) cout << #x << "  " << x << endl;

using namespace std;

ll mod(ll a, ll b) { return (a % b + b) % b; }
ll power(ll base, ll exp) 
{ll res=1;while(exp>0) {if(exp%2==1) res=(res*base);base=(base*base);exp/=2;}return res;}

int main()
{
    fast;
    ll N,K,x,cnt;
    cin>>N>>K;
   	ll arr[10] = {0};
    for(ll i = 0; i < K; i++)
    {
    	cin>>x;
    	arr[x] = 1;
	}
	for(ll i = N; ; i++)
	{
		 string str = to_string(i);
		 cnt = 0;
		 for(ll j = 0; j < str.size(); j++)
		 {
		 	if(arr[str[j] - '0'] == 1)
		 	{
		 		break;
			}
			else cnt++;
		 }
		 if(cnt == str.size())
		 {
		 	cout << str << endl;
		 	break;
		 }
	}
   	return 0;
} 

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

int cnt;
string l,r;

void check(){
  if(l[0] == '0' || r[0] == '0') return;
  int x = atoi(l.c_str()) ,y = atoi(r.c_str());
  if(l.size() > r.size() || x > y) return;  
  if((x + y) % 2 == 0 || (x - y) % 2 == 0) cnt++;
}

int main(){
  string a;

  cin >> a;
  int size = a.size();
  int z = atoi(a.c_str());

  if(z % 2 == 0) cnt++;

  for(int i = 1 ; i < size ; i++){
    l = a.substr(0,i);
    r = a.substr(i);
    check();
  }
  cout << cnt << endl;

  return 0;
}

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

int main() {
  int N, M;
  while (cin >> N >> M && N > 0) {
    vector<pair<int, int> > A;
    A.reserve(N);
    for (int i = 0; i < N; i++) {
      int d, p;
      cin >> d >> p;
      pair<int, int> a = make_pair(p, d);
      A.push_back(a);
    }
    sort(A.rbegin(), A.rend());

    int result = 0;
    for (int i = 0; i < N; i++) {
      int d = max(0, A[i].second - M);
      M = max(0, M - A[i].second);
      result += d * A[i].first;
    }

    cout << result << endl;
  }

  return 0;
}



Measured memory_bytes: 3164
#12:17
n = int(input())
a = list(map(int,input().split()))
plus = []
minus = []
for i in range(n):
  if a[i] >= 0:
    plus.append(a[i])
  else:
    minus.append(a[i])
plus.sort()
minus.sort(reverse=True)
lp = len(plus)
lm = len(minus)
if lp >= 1 and lm >= 1:
  ans = sum(plus) - sum(minus)
  print(ans)
  x = minus[0]
  lp = len(plus)
  for i in range(1,lp):
    print(x,plus[i])
    x = x - plus[i]
  minus[0] = x
  x = plus[0]
  for j in range(lm):
    print(x,minus[j])
    x = x - minus[j]
elif lp == 0:
  ans = - sum(minus) + 2 * max(minus)
  print(ans)
  x = minus[1]
  for j in range(2,lm):
    print(x,minus[j])
    x = x - minus[j]
  print(x,minus[0])
elif lm == 0:
  ans = sum(plus) - 2 * min(plus)
  print(ans)
  x = plus[0]
  for i in range(2,lp):
    print(x,plus[i])
    x = x - plus[i]
  print(plus[1],x)

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

public class Main {
    public static void main(String[] args) {
        MyScanner sc = new MyScanner();

        int n = sc.nextInt();
        int m = sc.nextInt();
        int[][] s = new int[m][];
        int[] p = new int[m];

        for (int i = 0; i < m; i++) {
            int k = sc.nextInt();
            s[i] = new int[k];
            for (int j = 0; j < k; j++) {
                s[i][j] = sc.nextInt() - 1;
            }
        }

        for (int i = 0; i < m; i++) {
            p[i] = sc.nextInt();
        }

        int ans = 0;
        for (int i = 0; i < (1<<n); i++) {
            boolean isOK = true;
            for (int j = 0; j < m; j++) {
                int cnt = 0;
                for (int k = 0; k < s[j].length; k++) {
                    if (((1<<s[j][k])&i) > 0)
                        cnt++;
                }
                if (cnt % 2 != p[j]) {
                    isOK = false;
                    break;
                }
            }
            if (isOK)
                ans++;
        }

        System.out.println(ans);
    }

    static class MyScanner {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 1 << 15);
        StringTokenizer tokenizer;

        String next() {
            try {
                while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                    tokenizer = new StringTokenizer(reader.readLine());
                }
            } catch (IOException ignored) {
            }
            return tokenizer.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }
    }
}

Measured memory_bytes: 23124
#include <stdio.h>

int main(void)
{
  long N;
  scanf("%ld", &N);
  long long ans = 0;
  long long i;
  for(i = 1; i <= N; i++){
    if(i % 3 != 0 && i % 5 != 0){
      ans += i;
    }
  }
  printf("%lld\n", ans);
	return 0;
}


Measured memory_bytes: 1732
#include <stdio.h>
 
int dic(char c1[],char c2[]){
  int a=0,i=0;
  while(1){
    if(c1[i]<c2[i])return 1;
    if(c1[i]>c2[i])return 2;
    if(c1[i]=='\0'&&c2[i]=='\0')return 0;
    if(c1[i]=='\0')return 1;
    if(c2[i]=='\0')return 2;
    i++;
  }
  return 0;
}
 
int main(){
  int n,p1=0,p2=0,i,a;
  char c1[102],c2[102];
  scanf("%d",&n);
  for(i=0; i<n; i++){
    scanf("%s",&c1);
    scanf("%s",&c2);
    a=dic(c1,c2);
    if(a==0){
      p1+=1;
      p2+=1;
    }else if(a==1)p2+=3;
    else p1+=3;
  }
  printf("%d %d\n",p1,p2);
  return 0;
}


Measured memory_bytes: 2052
/*
 *  Author : Jun_SH
 *  Solution for ABC 145 B
 */
#include<bits/stdc++.h>
#define int long long
using namespace std;
inline int read(){
    int f=1,x=0;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return f*x;
}
main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n;
    string s;
    cin>>n;
    cin>>s;
    if(n&1){cout<<"No"<<endl;return 0;}
    else{
        n>>=1;
        for(int i=0;i<n;++i){
            if(s[i]!=s[n+i]){
                cout<<"No"<<endl;return 0;
            }
        }
        cout<<"Yes"<<endl;

    }
}


Measured memory_bytes: 256
#include <iostream>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <tuple>
#include <algorithm>
#include <functional>
#include <cstring>
#include <limits.h>
#define FOR(i,k,n)  for (int i=(k); i<(int)(n); ++i)
#define REP(i,n)    FOR(i,0,n)
#define FORIT(i,c)	for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define SZ(i) ((int)i.size())
#define pb          push_back
#define mp          make_pair
#define mt          make_tuple
#define get0(x)     (get<0>(x))
#define get1(x)     (get<1>(x))
#define get2(x)     (get<2>(x))
#define ALL(X)      (X).begin(),(X).end()
#define LLMAX       9223372036854775807LL
#define LLMIN       -9223372036854775808LL
#define IMAX        2147483647
#define IMIN        -2147483648
typedef long long LL;
using namespace std;

static const LL MOD=1e9+7LL;
LL ADD(LL x,LL y){	return (x+y)%MOD;	}
LL SUB(LL x,LL y){	return (x-y+MOD)%MOD;	}
LL MUL(LL x,LL y){	return ((x*y)%MOD+MOD)%MOD;	}
LL POW(LL x,LL e)
{
    LL r=1;
    for(;e;x=MUL(x,x),e>>=1)
        if(e&1)
            r=MUL(r,x);
    return r;
}
LL DIV(LL x,LL y){	return MUL(x,POW(y,MOD-2));	}
LL COMB(LL n,LL k)
{
    LL r=1;
    for(LL i=1;i<=k;i++)
        r=DIV(MUL(r,n-i+1),i);
    return r;
}

LL combN[200000],combR[200000],fact[200000];

int main(void){
    LL n;
    cin>>n;
    vector<int> a;
    vector<int> index(n+1,-1);
    LL ds,de;
    REP(i,n+1){
        int aa;cin>>aa;a.pb(aa);
        if(index[aa]==-1){
            index[aa]=i;
        }else{
            ds=index[aa];
            de=i;
        }
    }
    LL N=n+1,R=ds+n-de;
    fact[0]=1;
    for(LL i=1;i<=N;i++){
        fact[(int)i]=MUL(i,fact[(int)i-1]);
        // printf("fact[%lld]=%lld\n",i,fact[i]);
        // cout<<fact[i]<<endl;
    }
    for(LL i=0;i<=R;i++){
        combR[i]=DIV(fact[R],MUL(fact[i],fact[R-i]));
        // printf("combR[%lld]=%lld\n", i,combR[i]);
    }
    for(LL i=0;i<=N;i++){
        combN[i]=DIV(fact[N],MUL(fact[i],fact[N-i]));
        // printf("combN[%lld]=%lld\n", i,combN[i]);
    }

    // printf("N=%lld R=%lld\n",N,R);
    FOR(i,1,N+1){
        if(i==1)
            cout<<N-1<<endl;
        else{
            // printf("de-ds+1=%d\n",de-ds+1);
            cout<<SUB(combN[i],combR[i-1])<<endl;
        }
    }
     return 0;
}

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

#define mp make_pair
typedef long long ll;
typedef pair<int,int>pii;
vector<int>ans;
const int N = 2e5;
int arr1[N+100],arr2[N+100];

int main()
{
	int n;
	scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%d",&arr1[i]);
	for(int i=n;i>=1;i--){
		int cnt = 0;
		for(int j=i+i;j<=n;j+=i){
			cnt = (cnt+arr2[j])%2;
		}
		if(cnt==arr1[i]){
			arr2[i] = 0;
		}
		else{
			arr2[i] = 1;
		}
	}
	for(int i=1;i<=n;i++){
		if(arr2[i]){
			ans.push_back(i);
		}
	}
	printf("%d\n",(int)ans.size());
	for(auto it:ans){
		printf("%d ",it);
	}
	printf("\n");
}


Measured memory_bytes: 3064
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		new Main().run();
	}

	void run() {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int[] a = new int[M];
		int[] b = new int[M];
		for (int i = 0; i < M; ++i) {
			a[i] = sc.nextInt();
			b[i] = sc.nextInt();
			--a[i];
			--b[i];
		}
		solve(N, M, a, b);
	}

	void solve(int N, int M, int[] a, int[] b) {
		int[] deg = new int[N];
		for (int i = 0; i < M; ++i) {
			++deg[a[i]];
			++deg[b[i]];
		}
		boolean f = true;
		for (int i = 0; i < N; ++i) {
			f &= deg[i] % 2 == 0;
		}
		System.out.println(f ? "YES" : "NO");
	}

	private static void tr(Object... o) {
		System.out.println(Arrays.deepToString(o));
	}
}


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

int main() {

  int N;
  cin >> N;
  
  int M;
  M = N;
  
  int sum;
  sum = 0;
  
  for (int i = 0; i < 8; i++) {
   sum += N % 10;
   N /= 10 ;
  }
    
   if ( M % sum == 0){
   cout << "Yes" << endl;
   }
  else  {
    cout << "No" << endl;
  }
}


Measured memory_bytes: 3608
import sys, math
from collections import defaultdict, deque, Counter
from bisect import bisect_left, bisect_right
from itertools import combinations, permutations, product
from heapq import heappush, heappop
from functools import lru_cache
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mat = lambda x, y, v: [[v]*y for _ in range(x)]
ten = lambda x, y, z, v: [mat(y, z, v) for _ in range(x)]
mod = 1000000007
sys.setrecursionlimit(1000000)

N, K = rl()

ans = 0
for i in range(1, N+1):
	if i >= K:
		ans += 1/N
	else:
		n = math.ceil(math.log(K/i)/math.log(2))
		ans += 1/pow(2, n)/N
print(ans)



Measured memory_bytes: 71768
#include <cstdio>

using namespace std;

int gcd(int a, int b) {
  while (b) {
    int r = a % b;
    a = b;
    b = r;
  }
  return a;
}

int main() {
  long long l, r;
  int a, b;
  scanf("%lld%lld%d%d", &l, &r, &a, &b);
  long long good = 0;
  good += r / a - (l - 1) / a;
  good += r / b - (l - 1) / b;
  long long c = (long long)a / gcd(a, b) * b;
  good -= r / c - (l - 1) / c;
  printf("%lld\n", (r - l + 1) - good);
}


Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;
int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,k;
    cin >> n >> k;
    vector<int> v;
    for(int i=0;i<n;i++){
        int a;
        cin >> a;
        v.push_back(a);
    }
    sort(v.begin(), v.end(),greater<int>() );

    int ans = 0;
    for(int i=0;i<k;i++){
        ans+=v[i];
    }
    cout << ans << endl;
    return 0;
}

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

struct UnionFind {
  vector<int> parent;
  UnionFind(int n) {
    parent.resize(n);
    for (int i = 0; i < n; ++i)parent[i] = i;
  }
  int find(int x) {
    return parent[x] == x ? x : (parent[x] = find(parent[x]));
  }
  void unite(int x, int y) {
    if (find(x) != find(y)) parent[find(y)] = find(x);
  }
  bool issame(int x, int y) {
    return find(x) == find(y);
  }
};


signed main(){
  int h,w,k;
  cin>>h>>w>>k;
  vector<vector<bool>> v(h,vector<bool>(w,false));
  for(int i=0;i<h;++i){
    string s;
    cin>>s;
    for(int j=0;j<w;++j)if(s[j]=='#')v[i][j]=true;
  }
  UnionFind uf(h*w);
  int l=0;
  for(int i=0;i<h;++i){
    int b=count(v[i].begin(),v[i].end(),true);
    if(b==0){
      ++l;
      continue;
    }
    int hp=-1,wp=-1;
    for(int j=0;j<w-1;++j){
      if(v[i][j]){
        hp=i,wp=j;
        continue;
      }
      uf.unite(i*w+j+1,i*w+j);
    }
    if(!v[i][w-1])uf.unite(hp*w+wp,hp*w+wp+1);
    while(l>0){
      for(int j=0;j<w;++j){
        uf.unite(i*w+j,(i-l)*w+j);
      }
      --l;
    }
  }
  for(int i=0;i<l;++i){
    for(int j=0;j<w;++j){
      uf.unite((h-2-i)*w+j,(h-1-i)*w+j);
    }
  }
  
  vector<vector<int>> a(h,vector<int>(w,0));
  {
    int km=0;
    for(int i=0;i<h;++i)for(int j=0;j<w;++j){
      if(v[i][j])a[i][j]=++km;
    }
  }
  for(int i=0;i<h;++i)for(int j=0;j<w;++j){
    if(!v[i][j]){
      int p=uf.find(i*w+j);
      int ph=p/w,pw=p%w;
      a[i][j]=a[ph][pw];
    }
  }
  for(auto row:a){
    for(auto i:row)cout<<i<<" ";
    cout<<"\n";
  }
  
}

Measured memory_bytes: 2176
#include "bits/stdc++.h"
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize ("unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
using ll = long long int;

int main()
{
	ios::sync_with_stdio(0); cin.tie(0);
	mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

	int n; cin >> n;
	const int mod = 1e9+7;
	ll tot = 1;
	for (int i = 0; i < n; ++i)
		tot = (tot*10)%mod;
	ll sub = 1;
	for (int i = 0; i < n; ++i)
		sub = (sub*8)%mod;
	ll sub2 = 1;
	for (int i = 0; i < n; ++i)
		sub2 = (sub2*9)%mod;
	ll ans = (tot - 2*sub2 + sub)%mod;
	cout << (ans + mod)%mod << '\n';
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.h"
#else
#define dump(...)
#endif
#define endl "\n"
#define ll long long
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define REP(i, x) for (int i = 0; i < (int)(x); i++)
#define REPS(i, x) for (int i = 1; i <= (int)(x); i++)
#define RREP(i, x) for (int i = ((int)(x)-1); i >= 0; i--)
#define RREPS(i, x) for (int i = ((int)(x)); i > 0; i--)
#define INF 2147483647
#define LLINF 9223372036854775807LL
#define vi vector<int>
#define vvi vector<vector<int>>
#define pi pair<int, int>
#define ALL(a) (a).begin(), (a).end()
#define BIT(n) (1LL << (n))
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end()) //sortしてからつかうこと
constexpr ll MOD = 1e9 + 7;
int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};
ll A, B, C, D, E, F, G, H, N, M, L, K, P, Q, R, W, X, Y, Z;
string S, T;
ll ans = 0;

template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
    for (T &x : vec)
        is >> x;
    return is;
}

signed main() {
    cin >> X;
    cout << 10 - (X / 200) << endl;
}

Measured memory_bytes: 3628
#include "bits/stdc++.h"
#define ALL(x) x.begin(), x.end()
#define iostreamBooster() do{ cin.tie(nullptr); ios_base::sync_with_stdio(false); }while(0)
#define rep(i, s, n) for(i64 i=(s); i < (n); ++i)
using namespace std;
using i64 = long long;
using pii = pair<int, int>;
template<class A, class B>inline bool chmax(A &a, const B &b){return b>a ? a=b,1 : 0;}
template<class A, class B>inline bool chmin(A &a, const B &b){return b<a ? a=b,1 : 0;}
constexpr int INF  = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int MOD  = int(1e9) + 7;

signed main()
{
  int K;
  cin >> K;

  int even = K / 2;
  int odd = K - even;

  cout << even * odd << endl;
  return 0;
}



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

int main(void){
  char x[2],y[2];
  scanf("%s %s",x,y);
  if(strcmp(x,y)==0){
    printf("=\n");
  }else if(strcmp(x,y)<0){
    printf("<\n");
  }else{
    printf(">\n");
  }
  return 0;
}

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

#define lli long long int
#define pi pair<int,int>
#define mod 1000000007
const int INF=1e9+5;
lli min_cost(vector<int> &v,int k)
{
	int n=v.size();
	vector<lli> dp(n,INF);
	dp[0]=0;
	for(int i=0;i<n;i++)
	{
		for(int j=i+1;j<=(i+k);j++)
		{
			if(j<n)
				dp[j]=min(dp[j],dp[i]+abs(v[i]-v[j]));
		}
		//dp[i]=min(dp[i-1]+abs(v[i]-v[i-1]),dp[i-2]+abs(v[i]-v[i-2]));
	}
	return dp[n-1];
}

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);	cout.tie(0);
	int n,k;
	cin>>n>>k;
	vector<int> arr(n);
	for(int i=0;i<n;i++)
		cin>>arr[i];
	cout<<min_cost(arr,k)<<endl;
	return 0;
}

Measured memory_bytes: 1536
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		long a = sc.nextLong();
		
        long b = sc.nextLong();
        
		long c = Math.min(a%b,-1*(a%b-b));
		System.out.println(c);
	}
}


Measured memory_bytes: 21844
def get_i() #空白区切の入力を数値(整数)の配列で返す
  return gets.chomp.split(" ").map(&:to_i)
end
def get_f() #空白区切の入力を数値(実数)の配列で返す
  return gets.chomp.split(" ").map(&:to_f)
end
def get() #空白区切の入力を文字列の配列で返す
  return gets.chomp.split(" ")
end
def get_nsp() #入力されたものを一文字ずつに区切った文字列の配列で返す
  return gets.chomp.split("")
end
def yn_judge(bool,y="Yes",n="No") #boolに真偽を投げることで、trueならy、falseならnの値を出力する
  return bool ? y : n 
end
def array(size1,init=nil,size2=1) #size2に二次元配列時の最初の要素数、size1に次の配列の大きさ、initに初期値を投げることでその配列を返す
  if size2==1
    return Array.new(size1){init}
  else
    return Array.new(size2){Array.new(size1){init}}
  end
end


#class SegTree
#  attr_accessor:node,:n
#  def initialize(n,a)
#    @n=1
#    @n*=2 while @n<n
#    @node=array(2*@n,0)
#    n.times do|i|
#      @node[i+@n]=(a[i]-1)*a[i]/2
#    end
#    (@n-1).downto(1) do|i|
#      @node[i]=@node[i*2]+@node[i*2+1]
#    end
#  end
#
#  def update(i,x)
#    i+=@n
#    @node[i]=(x-1)*x/2
#    while i>1
#      i/=2
#      @node[i]=@node[i*2]+@node[i*2+1]
#    end
#  end
#
#  def getSum(l,r)
#    ret=0
#    l+=@n
#    r+=@n
#    while l<r
#      if l.odd?
#        ret+=@node[l]
#        l+=1
#      end
#
#      if r.odd?
#        r-=1
#        ret+=@node[r]
#      end
#      l/=2
#      r/=2
#    end
#    return ret
#  end
#end
#

N=gets.to_i
A=get_i
cnt=array(N+1,0)
A.each do|a|
  cnt[a]+=1
end
sum=0
cnt.each do|num|
  sum+=(num-1)*num/2
end
#st=SegTree.new(N+1,cnt)
#N.times do|i|
#  st.update(A[i],cnt[A[i]]-1)
#  puts st.getSum(0,N+2)
#  st.update(A[i],cnt[A[i]])
#end

N.times do|i|
  val1=(cnt[A[i]]-2)*(cnt[A[i]]-1)/2
  val2=(cnt[A[i]]-1)*cnt[A[i]]/2
  puts sum+val1-val2
end

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

int N;

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

	cin >> N;
	int sum = 0;
	for( int i = 1; i <= N; i++) {
		int x;  cin >> x;
		sum += x-1;
	}

	cout << sum << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using pint = pair<int,int>;
ll mod = 1000000007,mod2 = 998244353;

void chmin(long long &a, long long b) { if (a > b) a = b; }
void chmax(long long &a, long long b) { if (a < b) a = b; }
//void chmin(int &a, int b) { if (a > b) a = b; }
//void chmax(int &a, int b) { if (a < b) a = b; }

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); // merge technique
        par[x] += par[y];
        par[y] = x;
        return true;
    }

    int size(int x) {
        return -par[root(x)];
    }
};

int main() {
    int n,m,k;
    cin >> n >> m >> k;
    UnionFind uf(n);
    vector<set<int>> out(n);
    for (int i = 0; i < m; ++i) {
        int a,b;
        cin >> a >> b;
        a--,b--;
        out[a].insert(b);
        out[b].insert(a);
        uf.merge(a,b);
    }
    for (int i = 0; i < k; ++i) {
        int c,d;
        cin >> c >> d;
        c--,d--;
        if(uf.issame(c,d)){
            out[c].insert(d);
            out[d].insert(c);
        }
    }
    for (int i = 0; i < n; ++i) {
        cout << uf.size(i)-1-out[i].size() << endl;
    }
    return 0;
}

Measured memory_bytes: 24704
N = int(input())
A = [int(x) for x in input().split()]
A_dict = {}
for a in A:
    if A_dict.get(a):
        A_dict[a] += 1
    else:
        A_dict[a] = 1
B = [0] * N
for i in range(N+1):
    if A_dict.get(i):
        B[i-1] = A_dict[i]
for b in B:
    print(b)


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

class T{
  public:
    int value;
    char c;

    bool operator == (const T &t)const{
      return value == t.value && c == t.c;
    }
};

vector<T> BubbleSort(vector<T> C, int N){
  for(int i = 0; i < N; i++){
    for(int j = N-1; j >= i+1; j--){
      if(C[j].value < C[j-1].value)
        swap(C[j], C[j-1]);
    }
  }
  return C;
}

vector<T> SelectionSort(vector<T> C, int N){
  for(int i=0; i < N; i++){
    int minj = i;
    for(int j = i; j < N; j++){
      if(C[j].value < C[minj].value){
        minj = j;
      }
    }
    swap(C[i], C[minj]);
  }
  return C;
}

void output(vector<T> t){
  for(int i=0; i < t.size()-1; i++){
    cout << t[i].c << t[i].value << " ";
  }
  cout << t[t.size()-1].c << t[t.size()-1].value << endl;
}

bool isStable(vector<T> input, vector<T> sorted){
  for(int ck = 1; ck <= 9; ck++){
    list<char> l;
    for(int i = 0; i < input.size(); i++){
      if(input[i].value == ck) l.push_back(input[i].c);
    }
    for(int i = 0; i < sorted.size(); i++){
      if(sorted[i].value == ck){
        if(sorted[i].c == *(l.begin())){
          l.erase(l.begin());
        }else{
          return false;
        }
      }
    }
  }
  return true;
}

int main(void){
  int N; cin >> N;
  vector<T> t(N);
  for(int i=0; i < N; i++){
    string tmp; cin >> tmp;
    t[i].c = tmp[0];
    t[i].value = tmp[1] - '0';
  }
  output(BubbleSort(t, N));
  cout << "Stable" << endl;
  output(SelectionSort(t, N));
  if(!isStable(t, SelectionSort(t, N))) cout << "Not stable" << endl;
  else cout << "Stable" << endl;
  return 0;
}

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

using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;
using Graph = vector<vector<int>>;
typedef long long ll;
typedef pair<int, int> P;

const int MOD = 1000000007;
const int INF_32 = 1LL << 30;
const int64_t INF_64 = 1LL << 60;

const int mod = 1000000007;
struct mint {
    ll x; // typedef long long ll;
    mint(ll x = 0)
        : x((x % mod + mod) % mod)
    {
    }
    mint operator-() const { return mint(-x); }
    mint& operator+=(const mint a)
    {
        if ((x += a.x) >= mod)
            x -= mod;
        return *this;
    }
    mint& operator-=(const mint a)
    {
        if ((x += mod - a.x) >= mod)
            x -= mod;
        return *this;
    }
    mint& operator*=(const mint a)
    {
        (x *= a.x) %= mod;
        return *this;
    }
    mint operator+(const mint a) const { return mint(*this) += a; }
    mint operator-(const mint a) const { return mint(*this) -= a; }
    mint operator*(const mint a) const { return mint(*this) *= a; }
    mint pow(ll t) const
    {
        if (!t)
            return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1)
            a *= *this;
        return a;
    }

    // for prime mod
    mint inv() const { return pow(mod - 2); }
    mint& operator/=(const mint a) { return *this *= a.inv(); }
    mint operator/(const mint a) const { return mint(*this) /= a; }
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x; }
ostream& operator<<(ostream& os, const mint& a) { return os << a.x; }

int main()
{
    int N, K;
    cin >> N >> K;
    Graph G(N);
    vector<bool> visit(N, false);
    rep(i, N - 1)
    {
        int a, b;
        cin >> a >> b;
        a--, b--;
        G[a].push_back(b);
        G[b].push_back(a);
    }

    queue<int> q;
    q.push(0);
    visit[0] = true;

    int stage = 1;
    mint ans(K);
    while (!q.empty()) {
        int size = q.size();
        for (int i = 0; i < size; i++) {
            int v = q.front();
            q.pop();
            mint fact(K - 1);
            if (stage >= 2) {
                fact = K - 2;
            }
            for (int nv : G[v]) {
                if (!visit[nv]) {
                    q.push(nv);
                    visit[nv] = true;
                    ans *= fact;
                    fact -= 1;
                }
            }
        }
        stage++;
    }
    cout << ans.x << endl;
    return 0;
}

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

int main()
{
	string o, e;
	cin >> o >> e;

	for (int i = 0; i < e.size(); ++i) {
		cout << o[i] << e[i];
	}
	if (o.size() != e.size()){
		cout << o[o.size() - 1];
	}
	cout << endl;
}


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

using namespace std;

int ctoi(const char& c){
    return int(c) - 48;
}

int main(){

    string S;
    cin >> S;
    int t, bit;
    
    for(bit=0;bit<8;++bit){
        t = ctoi(S[0]);
        for(int i=0;i<3;++i){
            if((bit >> i) & 1 == 1) t += ctoi(S[i+1]);
            else t -= ctoi(S[i+1]);
        }
        if(t==7) break;
    }

    cout << S[0];
    for(int i=0;i<3;++i){
        if((bit >> i) & 1 == 1) cout << "+";
        else cout << "-";
        cout << S[i+1];
    }
    cout << "=7" << endl;
    
    return 0;
}


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

#define REP(i, n) for (int i = 0; i < (n); ++i)
#define RREP(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define RFOR(i, a, b) for (int i = (a); i >= (b); --i)
#define ALL(v) (v).begin(), (v).end()
#define RALL(a) (a).rbegin(), (a).rend()

#define uint8_t unsigned char
#define uint16_t unsigned short
#define uint32_t unsigned int
#define uint64_t unsigned long long

#define int8_t signed char
#define int16_t signed short
#define int32_t signed int
#define int64_t signed long long



using namespace std;
// #define PI 3.14159265358979323846
// cout << fixed << setprecision(20);

int main(int argc, char const* argv[])
{
    string n;
    cin >> n;
    int total = 0;
    for (auto c : n) {
        total += (int)c - (int)('0');
    }
    if (total % 9 == 0) {cout << "Yes" << endl;}
    else {cout << "No" << endl;}
    return 0;
}




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

using namespace std;

using int64 = long long;
const int mod = 1e9 + 7;
// const int mod = 998244353;

const int64 infll = (1LL << 62) - 1;
const int inf = (1 << 30) - 1;

struct IoSetup {
  IoSetup() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    cerr << fixed << setprecision(10);
  }
} iosetup;


template< typename T1, typename T2 >
ostream &operator<<(ostream &os, const pair< T1, T2 > &p) {
  os << p.first << " " << p.second;
  return os;
}

template< typename T1, typename T2 >
istream &operator>>(istream &is, pair< T1, T2 > &p) {
  is >> p.first >> p.second;
  return is;
}

template< typename T >
ostream &operator<<(ostream &os, const vector< T > &v) {
  for(int i = 0; i < (int) v.size(); i++) {
    os << v[i] << (i + 1 != v.size() ? " " : "");
  }
  return os;
}

template< typename T >
istream &operator>>(istream &is, vector< T > &v) {
  for(T &in : v) is >> in;
  return is;
}

template< typename T1, typename T2 >
inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }

template< typename T1, typename T2 >
inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }

template< typename T = int64 >
vector< T > make_v(size_t a) {
  return vector< T >(a);
}

template< typename T, typename... Ts >
auto make_v(size_t a, Ts... ts) {
  return vector< decltype(make_v< T >(ts...)) >(a, make_v< T >(ts...));
}

template< typename T, typename V >
typename enable_if< is_class< T >::value == 0 >::type fill_v(T &t, const V &v) {
  t = v;
}

template< typename T, typename V >
typename enable_if< is_class< T >::value != 0 >::type fill_v(T &t, const V &v) {
  for(auto &e : t) fill_v(e, v);
}

template< typename F >
struct FixPoint : F {
  FixPoint(F &&f) : F(forward< F >(f)) {}

  template< typename... Args >
  decltype(auto) operator()(Args &&... args) const {
    return F::operator()(*this, forward< Args >(args)...);
  }
};

template< typename F >
inline decltype(auto) MFP(F &&f) {
  return FixPoint< F >{forward< F >(f)};
}

int main() {
  string S, T;
  cin >> S >> T;
  int ret = 0;
  for(int i = 0; i < S.size(); i++) ret += S[i] != T[i];
  cout << ret << "\n";
}

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

#define rep(i, a, b) for(int i = (a); i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) ((int)(x).size())
#define pb push_back
#define fst first
#define snd second
#define PI (acos(-1))
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))

#define MAXN 1123456
#define MOD 1000000007

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pii;
typedef vector<ll> vi;
typedef vector<pii> vii;
typedef vector<vi> vvi;

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


  string s;
  cin >> s;

  if (s[2] == s[3] and s[4] == s[5]) cout << "Yes\n";
  else cout <<"No\n";
}

Measured memory_bytes: 256
#include<iostream>

int judge(int m, int f, int r){
    if(m==-1||f==-1) std::cout << "F" << std::endl;
    else if(m+f>=80) std::cout << "A" << std::endl;
    else if(m+f>=65) std::cout << "B" << std::endl;
    else if(m+f>=50) std::cout << "C" << std::endl;
    else if(m+f>=30)
      if(r>=50) std::cout << "C" << std::endl;
      else std::cout << "D" << std::endl;
    else std::cout << "F" << std::endl;
    
    return 0;
}

int main(){
  int m,f,r;
  std::cin >> m >> f >> r;
  while(m!=-1||f!=-1||r!=-1){
    judge(m, f, r);
    std::cin >> m >> f >> r;
  }
  return 0;
}


Measured memory_bytes: 3100
#include<stdio.h>
#include<stdlib.h>
#include<string>
#include<iostream>
using namespace std;

struct Node{
  int key;
  Node *right,*left,*parent;
};

Node *root,*NIL;

Node *find(Node *u,int k){
  while(u!=NIL && k!=u->key){
    if(k< u->key) u=u->left;
    else u = u->right;
  }
  return u;
}

void insert(int k){
  Node *y = NIL;
  Node *x = root;
  Node *z;

  z = (Node *)malloc(sizeof(Node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;

  while(x != NIL){
    y = x;
    if(z->key < x->key){
      x = x->left;
    }else{
      x = x->right;
    }
  }
  z->parent = y;
  if(y == NIL){
    root = z;
  }else{
    if(z->key < y->key){
      y->left = z;
    }else{
      y->right = z;
    }
  }
}


void inorder(Node *u){
  if(u == NIL) return;
  inorder(u->left);
  printf(" %d",u->key);
  inorder(u->right);
}
void preorder(Node *u){
  if(u == NIL) return;
  printf(" %d",u->key);
  preorder(u->left);
  preorder(u->right);
}
int main(){
  int n,i,x;
  string com;

  scanf("%d",&n);

  for(i = 0;i<n;i++){
    cin >> com;
    if(com[0] == 'f'){
      scanf("%d",&x);
      Node *t = find(root,x);
      if(t != NIL) printf("yes\n");
      else printf("no\n");
    }else if(com =="insert"){
      scanf("%d",&x);
      insert(x);
    }else if(com =="print"){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    }
  }

  return 0;
}



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

int A[9] = {1,2,4,7,12,20,29,38,52}; long long arr[11][11] , N;

int main(){
	cin >> N; long long MX = 1;
	for(int i = 2 ; i <= N ; ++i){
		for(int j = 1 ; j < i ; ++j) arr[i][j] = arr[j][i] = MX * A[j - 1];
		MX += arr[i][i - 1] + arr[i][i - 2] - arr[i - 1][i - 2];
	}
	for(int i = 1 ; i <= N ; ++i) for(int j = 1 ; j <= N ; ++j) cout << arr[i][j] << " \n"[j == N];
	return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
using ll = long long; using ull = unsigned long long;
//#define int ll
using vb = vector<bool>; using vvb = vector<vb>;
using vi = vector<int>; using vvi = vector<vi>;
using vl = vector<ll>; using vvl = vector<vl>;
using pii = pair<int,int>; using pll = pair<ll,ll>;
#define FOR(i,a,b) for(ll i = (a); i < (ll)(b); ++i)
#define REP(i,n) FOR(i,0,n)
#define RFOR(i,a,b) for(ll i = (ll)(b)-1;i >= a;--i)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define eb(val) emplace_back(val)
const double PI = acos(-1);
const double EPS = 1e-10;
const ll MOD = 1e9+7;
void cioacc(){//accelerate cin/cout
  cin.tie(0);
  ios::sync_with_stdio(false);
}
int main(){
  vector<char> suit = {'S','H','C','D'};
  map<char,set<int>> st;
  REP(i,4)REP(j,13){
    st[suit[i]].insert(j+1);
  }
  int n;
  cin >> n;
  REP(i,n){
    char s;
    int a;
    cin >> s >> a;
    st[s].erase(a);
  }
  REP(i,4)for(auto j:st[suit[i]]){
    cout << suit[i] << " " << j << endl;
  }
}


Measured memory_bytes: 3108
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <climits>
using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

int L;

int main(){
    cin>>L;
    double a = L/3.0;
    double v = a*a*a;
    printf("%.10lf", v);
    return 0;
}



Measured memory_bytes: 256
n = int(input())
#import math
#math.gcd(n, 2)
#print( n * 2 / math.gcd(n, 2))
'''
for i in range(1,(2*n)+1):
  if i %2 ==0 and i%n ==0:
    print(i)
    break
'''
if n%2 ==0:
  print(n)
else:
  print(2*n)
    

Measured memory_bytes: 2940
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int MAXN = 2e5 + 7;
const int mod = 1e9 + 7;
priority_queue<int>pq;
int p[MAXN], q[MAXN], r[MAXN];
bool cmp(int &a, int &b) {return a > b;}
int main()
{
    ll ans = 0;
    int X, Y, A, B, C; scanf("%d%d%d%d%d", &X, &Y, &A, &B, &C);
    for (int i = 1; i <= A; i++) scanf("%d", &p[i]);
    for (int i = 1; i <= B; i++) scanf("%d", &q[i]);
    for (int i = 1; i <= C; i++) scanf("%d", &r[i]);
    sort(p + 1, p + 1 + A, cmp);
    sort(q + 1, q + 1 + B, cmp);
    sort(r + 1, r + 1 + C, cmp);
    for (int i = 1; i <= X; i++) pq.push(-p[i]), ans += p[i];
    for (int i = 1; i <= Y; i++) pq.push(-q[i]), ans += q[i];
    for (int i = 1; i <= C; i++)
        if (pq.top() + r[i] > 0) ans += r[i] + pq.top(), pq.pop();
    printf("%lld\n", ans);
    return 0;
}

Measured memory_bytes: 2552
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string N;
  cin >> N;
  
  if(N.at(0) == '9' || N.at(1) == '9')
    cout << "Yes" << endl;
  
  else
    cout << "No" << endl;
  
   
}

Measured memory_bytes: 3608
#include <bits/stdc++.h>
#define rep(i, start, end) for (long long i = start; i < end; ++i)
#define repreverse(i, start, end) for (long long i = start; i >= end; --i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define len(x) ((long long)(x).size())
#define lcm(a, b) ((a) / __gcd((a), (b)) * (b))
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using vllvll = vector<vll>;
using vc = vector<char>;
using pll = pair<ll, ll>;
template<class T> void print1d(T x,ll n=-1){if(n==-1)n=x.size();rep(i,0,n){cout<<x[i]<<' ';}cout<<'\n';}
template<class T> void print2d(T x,ll r=-1,ll c=-1){if(r==-1)r=x.size();if(c==-1)c=x[0].size();rep(i,0,r)print1d(x[i],c);}
template<class T, class U> bool haskey(T mp, U key) { return mp.find(key) != mp.end(); }
template<class T, class U> bool isin(T el, U container) { return find(all(container), el) != container.end(); }
template<class T> bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
template<class T> bool even(T n) { return ! (n & 1); }
template<class T> bool odd(T n) { return n & 1; }
template<class T> ll rup(T a, T b) { return a % b ? a / b + 1 : a / b; }
template<class T> ld deg2rad(T deg) { return M_PI * deg / 180.0; }
template<class T> ld rad2deg(T rad) { return 180.0 * rad / M_PI; }
const long double pi = M_PI;
const long long big = 1LL << 50;
const long long inf = 1LL << 60;
const long long mod = 1e9 + 7;
ll intpow(ll a, ll n, ll _mod=numeric_limits<ll>::max()) { ll p=1; while (n) { if (n&1) p=p*a%_mod; a=a*a%_mod; n>>=1; } return p; } 
ll modc(ll a, char op, ll b, ll _mod=mod) { a %= _mod; b %= _mod; ll res = 1; switch(op) {
        case '+': res = (a + b) % _mod; break;
        case '-': res = (a - b) % _mod; break;
        case '*': res = a * b % _mod; break;
        case '/': res = modc(a, '*', modc(b, '^', _mod-2, _mod), _mod); break;
        case '^': res = intpow(a, b, _mod); break;
        case 'P': rep(i, a-b+1, a+1) res = modc(res, '*', i, _mod); break;
        case 'C': res = modc(modc(a, 'P', b, _mod), '/', modc(b, 'P', b, _mod)); break; } if (res < 0) res += _mod; return res; }


int main()
{
        ll N, K;
        cin >> N >> K;
        if (rup(N, 2LL) >= K) {
                cout << "YES" << endl;
        } else {
                cout << "NO" << endl;
        }
}


Measured memory_bytes: 3636