akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<cstdio>
#include<cstring>
#include <cstdlib>  
#include <math.h>
#include <cmath>
#include<cctype>
#include<string>
#include<set>
#include<iomanip>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include<bitset>
#include <deque>
#include <climits>
#include <typeinfo>
#include <utility> 
using namespace std;
using ll = long long;
template<typename T>using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
const ll inf = 1LL << 60;
#define all(x) (x).begin(),(x).end()
#define puts(x) cout << x << endl
#define rep(i,m,n) for(ll i = m;i < n;++i)
#define pb push_back
#define fore(i,a) for(auto &i:a)
#define rrep(i,m,n) for(ll i = m;i >= n;--i)




int main() {
	int n;
	cin >> n;
	double sum = 0.0;
	for (int i = 0; i < n; i++) {
		double a;
		cin >> a;
		sum += (1 / a);
	}
	cout << setprecision(20) << (1 / sum) << endl;
	
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

int main()
{
  int h,w;
  
  scanf("%d%d",&h,&w);
  
  char s[h][w];
  int i,j,k;
  int count[50][50]={};
  
  int x[8]={0,-1,-1,-1, 0, 1, 1,1};
  int y[8]={1,-1, 0, 1,-1,-1 ,0,1};
  
  for(i=0;i<h;i++)
  {
    scanf("%s",&s[i]);
    
  }
  
  for(i=0;i<h;i++)
  {
    for(j=0;j<w;j++)
    {
      if(s[i][j]!='#')
      {
        for(k=0;k<8;k++)
        {
          int x_w=j+x[k];
          int y_h=i+y[k];
        
          if(x_w>=0&&y_h>=0&&x_w<w&&y_h<h)
          {
            if(s[y_h][x_w]=='#')
            {
              count[i][j]++;
            }
          }
        }
      }
    }
  }
  
 for(i=0;i<h;i++)
  {
    for(j=0;j<w;j++)
    {
      if(s[i][j]!='#')
      {
        printf("%d",count[i][j]);
      }
      else
      {
        printf("#");
      }
    }
    printf("\n");
  }
  
  return 0;
}
        

Measured memory_bytes: 128
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr
    

n = int(input())

if n == 1:
    print(0)
    exit()

s = factorization(n)
ans = 0

for i in s:
    cnt = 1
    tmp = i[1]
    while tmp > 0:
        tmp -= cnt
        if tmp >= 0:
            ans += 1
        cnt += 1

print(ans)

Measured memory_bytes: 9472
#include <stdio.h>
#include <math.h>

long gcd(long x, long y){
    if(y==0){
        return x;
    }else{
        return gcd(y, x%y);

    }
}

int main(void){



long A, B, GCD;
int i, k;


scanf("%ld", &A);
scanf("%ld", &B);
GCD = gcd(A, B);

k = 0;

for(i=2;i<=sqrt(GCD);i++){
    if(GCD%i==0){
        k++;
        while(GCD%i==0){
			GCD/=i;
		}
	}
}

    
if(GCD==1){
    k++;
}else{
	k+=2;
}
	
printf("%d", k);
return 0;
}


Measured memory_bytes: 128
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, i321) => {
        read_value!($next, i32) - 1
    };

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

//
// # Examples
//
// # integers
// input! { n: i32, m: i32, ... }
//
// # array
// input! { n: i32, v: [i32; n], }
//
// # matrix
// input! { n: i32, m: i32, mat: [[]] }
//
// # string
// input! { s: chars }
//
// 3 4
// ####
// #..#
// .#.#
//
// input!{
//     h: i32,
//     w: i32,
//     board: [chars; h],
// }

// https://practice.contest.atcoder.jp/tasks/practice_1
//fn main() {
//    input!{
//        a: i32, b: i32, c: i32,
//        foo: chars,
//    }
//    let s: String = foo.into_iter().collect();
//    println!("{} {}", a+b+c, s);
//}
fn main() {
    input! { n: chars }
    if n[0] == '9' || n[1] == '9' {
        println!("Yes");
    } else {
        println!("No");
    }
}

Measured memory_bytes: 4352
import java.util.*

fun main(args: Array<String>){
        val scn = Scanner(System.`in`)
        val n = scn.nextInt()
        val s = scn.next()

        var ans = 1
        for(i in 1 until n){
                if (s[i] != s[i-1]){++ans}
        }
        println(ans)
}

Measured memory_bytes: 32304
#include <iostream>
#include <cstring>
#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
int main(){
  int n, m, i, j, tmp, bb=1000000007;
  cin >> n >> m;
  int x[n+1];
  for(i=0; i<n+1; i++)
    x[i]=-1;
  for(i=0; i<m; i++){
    cin >> tmp;
    x[tmp]=0;
  }
  x[0]=1;
  if(x[1]==-1) x[1]=1;
  for(i=2;i<=n; i++){
    if(x[i]==-1) x[i]=(x[i-2]+x[i-1])%bb;
  }
  cout << x[n];
  return 0;
}


Measured memory_bytes: 768
#include<bits/stdc++.h>
#include<set>
#include<bitset>
#define rep(i,a,b)  for(i=a;i<b;i++)
#define itrep(at)	for(auto it=at.begin();it!=at.end();it++)
#define lli long long int
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define vll vector<long long int>
#define vd vector<double>
#define vs vector<string>
#define vb vector<bool>
#define vc vector<char>
#define vvll vector<vector<long long int> >
#define sll set<long long int>
#define mll map<long long int,long long int>
#define sllit set<long long int>::iterator
#define pll pair<long long int,long long int>
#define vpll vector<pair<long long int,long long int> >
#define db double
#define M 1000000007
#define pi 3.1415926535897932384626433832795028841971
using namespace std;
lli min(lli a,lli b){return a<b?a:b;}
lli min(lli a,lli b,lli c){a=min(a,b);a=min(a,c);return a;}
lli max(lli a,lli b){return a>b?a:b;}
lli max(lli a,lli b,lli c){a=max(a,b);a=max(a,c);return a;}
lli power(lli a,lli b){lli res=1;while(b){if(b&1) res=res*a;a=a*a;b>>=1;}return res;}
lli mpower(lli a,lli b,lli m){lli res=1;a=a%m;while(b){if(b&1){res=(res*a)%m;}a=((a%m)*(a%m))%m;b>>=1;}return res;}
lli gcd(lli a,lli b){if(b==0) return a;if(a==0) return b;if(a>=b) return gcd(b,a%b);else return gcd(a,b%a);}
lli lcm(lli a,lli b){lli p=a*b;return p/gcd(a,b);}
lli dsum(lli n){lli ans=0;while(n){ans+=(n%10);n/=10;}return ans;}


/******************************START********************************/
int main()
{
	char ch1,ch2,ch3;
	string s1,s2,s3,str;
    lli i,j,k,a,b,c,t,d,n,m,sum=0,ans=0,temp;
    cin >> s1 >> s2;
    cin >> a>> b;
    cin >> s3;
    if(s3==s1){
    	cout << a-1 << " " << b << endl;
	}
	else	cout << a << " " << b-1 << endl;
    
    
    
    
    return 0;
}





















/* UJJWAL KESHRI */

Measured memory_bytes: 256
import sys
import numpy as np
from numba import vectorize

readline = sys.stdin.readline
read = sys.stdin.read

n = int(input())
a = np.array(readline().split(), dtype=np.int64)

@vectorize("i8(i8,i8)")
def larger (a,b):
    return max(a,b)

b = larger.accumulate(a)
ans = sum(b-a)
print(ans)

Measured memory_bytes: 116544
#include <bits/stdc++.h>
#define int long long
using namespace std;
int num[100007],chance=0,n,m,v,p;
bool cmp(int a,int b)
{
	return a>b;
}
signed main() 
{
	scanf("%lld%lld%lld%lld",&n,&m,&v,&p);
	int ans=p;
	for(int i=1;i<=n;i++)
	{
		scanf("%lld",&num[i]);
	}
	sort(num+1,num+1+n,cmp);
	for(int i=1;i<=n-p;i++)
	{
		if(num[p]>num[p+i]+m)
		{
			cout<<ans<<endl;
			return 0;
		}
		int t=v+i-n;
		if(t<=0)
		{
			ans++;
		}
		else 
		if( (t*m-chance-1)/i +num[p]<num[p+i]+m)
		{
			ans++;
		}
		chance+=num[p]-num[p+i];
//		cout<<ans<<' ';
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 4532
#include<bits/stdc++.h>
#define int long long
//#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
//using namespace __gnu_pbds;
const int inf=0x3f3f3f3f;
const double eps=1e-6;
const int mod=1000000007;
typedef long long ll;
int modpow(int x,int y,int md){if(y==0)return 1;int ret=modpow(x,y>>1,md);ret=(ll)ret*ret%md;if(y&1)ret=(ll)ret*x%md;return ret;}
int n,m;
pair<int,int> a[111111];
signed main(){
	cin>>n>>m;
	for(int i=0;i<n;i++)cin>>a[i].first>>a[i].second;
	sort(a,a+n);
	ll ans=0,rest=m;
	for(int i=0;i<n;i++){
		if(rest>a[i].second){
			ans+=a[i].first*a[i].second;
			rest-=a[i].second;
		}else{
			ans+=rest*a[i].first;
			cout<<ans<<endl;
			return 0;
		}
	}
	return 0;
}

Measured memory_bytes: 1792
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */

#include <iostream>
#include <fstream>

#include <iostream>
#include "bits/stdc++.h"

using namespace std;

typedef unsigned long long ll;
typedef int                     integer;
#define int                     long long
#define ii                      pair<int,int>
#define vii                     vector<pair<int,int>>
#define vi                      vector<int>
#define vvi                     vector<vector<int>>
#define f(a,b,c)                for(int a=b;a<c;a++)
#define s(x)                    in>>x
#define s2(x,y)                 in>>x>>y
#define s3(x,y,z)               in>>x>>y>>z
#define s4(x,y,z,w)             in>>x>>y>>z>>w
#define p(x)                    out<<x<<endl
#define p2(x,y)                 out<<x<<" "<<y<<endl
#define pl(x)                   out<<x
#define p2l(x,y)                out<<x<<" "<<y
#define p1d(a,n)                for(int ix=0;ix<n;ix++) out<<a[ix]<<" "; out<<endl
#define p2d(a,n,m)              for(int ix=0;ix<n;ix++){ for(int jx=0;jx<m;jx++) out<<a[ix][jx]<<" "; out<<endl;}
#define range(v)                v.begin(),v.end()
#define w(x)                    while(x--)
#define rst(x)                  memset(x, -1, sizeof(x))
#define UNVISITED               -1
#define VISITED                 0
#define EXPLORED                2

class AServalVsMonster {
public:
	void solve(std::istream& in, std::ostream& out) {
	    int h,a;
	    s2(h,a);
	    out<<ceil((double)h/a)<<endl;

	}
};


integer main() {
	AServalVsMonster solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
}


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

using namespace std;

typedef long long ll;

int main(){
    int x, y;
    cin >> x >> y;
    char z[100][100];
    for(int a = 0; a < x; a++){
        for(int b = 0; b < y; b++) cin >> z[a][b]; 
    }

    bool ans[2][100] = {false};
    for(int c = 0; c < x; c++){
        for(int d = 0; d < y; d++){
            if(z[c][d] == '#') break;
            if(d == y - 1) ans[0][c] = true;
        }
    }
    for(int c = 0; c < y; c++){
        for(int d = 0; d < x; d++){
            if(z[d][c] == '#') break;
            if(d == x - 1) ans[1][c] = true;
        }
    }

    for(int e = 0; e < x; e++){
        if(ans[0][e] == false){
            for(int f = 0; f < y; f++){
                if(ans[1][f] == false) cout << z[e][f];
            }
            cout << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;

namespace test
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = Read();
            var ans = 0;
            for (int i = 0; i < 4; i++)
            {
                if (N.Substring(i, 1) == "2") ans++;
            }            

            Console.WriteLine(ans);
            Console.ReadLine();
        }

        static string Read() { return Console.ReadLine(); }
        static int ReadInt() { return int.Parse(Read()); }
        static long ReadLong() { return long.Parse(Read()); }
        static int[] ReadArrayInt() { return Read().Split(' ').Select(s => int.Parse(s)).ToArray(); }
        static long[] ReadArrayLong() { return Read().Split(' ').Select(s => long.Parse(s)).ToArray(); }
    }
}

Measured memory_bytes: 11092
import fractions

n, k = map(int, input().split())
A = sorted(list(map(int, input().split())))

g = A[-1]
for a in A:
    g = fractions.gcd(a, g)

if k % g == 0 and k <= A[-1]:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')


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

using namespace std;

#define int long long
int n;
int a[200010];

main()
{
    ios_base::sync_with_stdio(false);
    cin >> n;
    for(int i = 0; i < n; i++) cin >> a[i];
    for(int i = 1; i < n; i++){
        if(a[i] - a[i-1] > 1){
            cout << -1 << endl;
            exit(0);
        }
    }
    if(a[0] != 0){
        cout << -1 << endl;
        exit(0);
    }
    int an = 0;
    for(int i = 0; i < n; i++){
        if(a[i] >= a[i + 1]) an += a[i] ;
    }
    cout << an << endl;
}


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

int main() {
    int n,m;
    cin >> n >> m;
    string a[n],b[m];
    for(int i=0;i<n;i++){
        cin >> a[i];
    }
    for(int i=0;i<m;i++){
        cin >> b[i];
    }
    bool ans=0;
    for(int i=0;i<=n-m;i++){
        for(int h=0;h<=n-m;h++){
            int count=0;
            for(int j=0;j<m;j++){
                for(int k=0;k<m;k++){
                    if(b[j][k]==a[i+j][h+k]){
                        count++;
                    }
                }
            }
            if(count==m*m){
                ans=1;
                break;
            }
        }
        if(ans) break;
    }
    if(ans) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<math.h>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<stack>

#define ll long long
#define vl vector<ll>
#define vvl vector< vector<ll> >
#define vb vector<bool>
#define vbb vector< vector<bool> >
#define vs vector<string>
#define vc vector<char>
#define vvc vector< vector<char> >

#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()

using namespace std;

int main(){
	ll n; cin >> n;
	vl a(n);
	ll alicebob = 0;
	for (ll i = 0; i < n; ++i){
		cin >> a[i];
		alicebob += a[i];
	}
	sort(rall(a));
	ll alice = 0;
	for (ll i = 0; i < n; i += 2) alice += a[i];
	ll bob = alicebob - alice;
	cout << alice - bob << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>

const int modnum = 1000000007;

long factorial(long num) {
    if (num == 1) return 1;
    else return ((num % modnum) * (factorial(num-1) % modnum)) % modnum;
}

int main(int argc, char const *argv[]) {
    long n, m, ans = 0;
    std::cin >> n >> m;
    if (std::abs(n - m) > 1) {
        std::cout << 0 << '\n';
        return 0;
    }
    ans = factorial(std::min(n, m));
    ans = (ans * ans) % modnum;
    if (n == m) {
        std::cout << (ans * 2) % modnum << '\n';
    } else {
        std::cout << (ans * std::max(n, m)) % modnum << '\n';
    }
    return 0;
}

Measured memory_bytes: 1792
#include<cstdio>
#include<algorithm>
int min(int,int);
int main(void){
	int i,j,k,x,y;
	int n, m;
	int c[20];
	int a[50001];
	int b[50001];
	
	scanf("%d%d",&n,&m);
	
	
	for(i=0;i<m;i++){
		scanf("%d",&c[i]);
	}
	
	if(m == 1){
		printf("%d\n", n);
		return 0;
	}
	
	std::sort(c,c+m);
	
	
	for(i=0;i<=n;i++){
		a[i]=i/c[1] + i%c[1];
		b[i]=a[i];
	}
	//for(j=0;j<=n;j++){
	//		printf("%d ",a[j]);
	//	}
	//printf("\n");
	bool l = true;
	for(i=2;i<m;i++){
		
		if (l){
	//	printf("ok\n");
			for(j=0;j<=n;j++){
				if(j<c[i]){
					b[j] = a[j];
				} else{
					b[j] = min(b[j-c[i]]+1, a[j]);
				}
			}
			
			l = false;
		} else {
			for(j=0;j<=n;j++){
				if(j<c[i]){
					a[j] = b[j];
				} else{
					a[j] = min(a[j-c[i]]+1, b[j]);
				}
			}
			l = true;
		}
		
	//	for(j=0;j<=n;j++){
	//		printf("%d ",a[j]);
	//	}
	//	for(j=0;j<=n;j++){
	//		printf("%d ",b[j]);
	//	}
	//	printf("\n");
	//	for(j=0;j<=n;j++){
	//		a[j] = b[j];
	//	}
	
	}
	if (m%2 == 0){
		printf("%d\n", a[n]);
	} else {
		printf("%d\n", b[n]);
	}
	return 0;
}

int min(int a,int b){
	if(a<b){
		return a;
	} else {
		return b;
	}
}
	

Measured memory_bytes: 3160
#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long INF = (long long)(1e18) + 1;

int main()
{
  int N;
  long long K;
  cin >> N >> K;
  vector<long long> A(N);
  for (int i = 0; i < N; i++)
    cin >> A[i];
  sort(A.begin(), A.end());
  long long l = -INF, r = INF;
  while (l + 1 < r)
  {
    long long x = (l + r) / 2;
    // ラムダ式 &を入れとくと関数の外にアクセス出来る
    bool ok = [&] {
      long long tot = 0;
      for (int i = 0; i < N; i++)
      {
        if (A[i] < 0)
        {
          int l = -1, r = N;
          while (l + 1 < r)
          {
            int c = (l + r) / 2;
            if (A[c] * A[i] < x)
              r = c; // ok側を動かす
            else
              l = c;
          }
          tot += N - r; // ある場所より右
        }
        else
        {
          int l = -1, r = N; // lはok rはng
          while (l + 1 < r)
          {
            int c = (l + r) / 2;
            if (A[c] * A[i] < x)
              l = c;
            else
              r = c;
          }
          tot += r; // 0-indexedだから
        }
        if (A[i] * A[i] < x)
          tot--;
      }
      tot /= 2;
      return tot < K;
    }(); // 定義の直後に関数呼び出し
    if (ok)
      l = x;
    else
      r = x;
  }
  cout << l << endl;
  return 0;
}

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

int main(){
	double w;
	while(cin>>w){
		if(w<=48.00)cout << "light fly";
		if(48.00<w && w<=51.00)cout << "fly";
		if(51.00<w && w<=54.00)cout << "bantam";
		if(54.00<w && w<=57.00)cout << "feather";
		if(57.00<w && w<=60.00)cout << "light";
		if(60.00<w && w<=64.00)cout << "light welter";
		if(64.00<w && w<=69.00)cout << "welter";
		if(69.00<w && w<=75.00)cout << "light middle";
		if(75.00<w && w<=81.00)cout << "middle";
		if(81.00<w && w<=91.00)cout << "light heavy";
		if(91.00<w)cout << "heavy";
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 1220
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define __ ios_base::sync_with_stdio(0);cin.tie(0);
#define fi first
#define se second
#define pb push_back
#define all(x) x.begin(),x.end()
#define forn(i,a,n) for(int i=a; i < n; i++)
typedef long long int lli;
typedef long double Double;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
const int mod = 1e9 + 7;
#define MAXN 21
int n;
int a[MAXN][MAXN];
lli dp[MAXN][1 << MAXN];
lli solve(int pos, int msk)
{
	if (pos == n) {
		if (msk == (1 << n) - 1)
			return 1ll;
		return 0ll;
	}
	if (dp[pos][msk] != -1) return dp[pos][msk];
	lli ans = 0ll;
	for (int i = 0; i < n; i++) {
		if (a[i][pos] == 1 && (msk & (1 << i)) == 0) {
			ans = (ans + solve(pos + 1, (msk | (1 << i))) % mod ) % mod;
		}
	}
	return dp[pos][msk] = ans % mod;
}

int main() {
/*#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif*/
	cin >> n;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			cin >> a[i][j];
		}
	}
	memset(dp, -1, sizeof(dp));
	cout << solve(0, 0) % mod << endl;
	return 0;
}


Measured memory_bytes: 344320
///                   _ooOoo_
///                  o8888888o
///                  88" . "88
///                  (| -_- |)
///                  O\  =  /O
///               ____/`---'\____
///             .'  \\|     |//  `.
///            /  \\|||  :  |||//  \
///           /  _||||| -:- |||||-  \
///           |   | \\\  -  /// |   |
///           | \_|  ''\---/''  |   |
///           \  .-\__  `-`  ___/-. /
///         ___`. .'  /--.--\  `. . __
///      ."" '<  `.___\_<|>_/___.'  >'"".
///     | | :  `- \`.;`\ _ /`;.`/ - ` : | |
///     \  \ `-.   \_ __\ /__ _/   .-` /  /
///======`-.____`-.___\_____/___.-`____.-'======
///                   `=---='
///^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
///
///         佛祖保佑       永无BUG
///  本模块已经经过开光处理，绝无可能再产生bug
///
///=============================================
#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,k) for(int i = j;i <= k;++i)
#define repp(i,j,k) for(int i = j;i >= k;--i)
#define rept(i,x) for(int i = linkk[x];i;i = e[i].n)
#define P pair<int,int>
#define Pil pair<int,ll>
#define Pli pair<ll,int>
#define Pll pair<ll,ll>
#define pb push_back 
#define pc putchar
#define mp make_pair
#define file(k) memset(k,0,sizeof(k)
#define ll long long
int rd()
{
	int num = 0;char c = getchar();bool flag = true;
	while(c < '0'||c > '9') {if(c == '-') flag = false;c = getchar();}
	while(c >= '0' && c <= '9') num = num*10+c-48,c = getchar();
	if(flag) return num;else return -num;
}
int a[1010],b[1010];
int main()
{ 
    int n = rd(),T = rd();
    rep(i,1,n) a[i] = rd(),b[i] = rd();
    bool flag = true;
    rep(i,1,n) if(b[i] <= T) flag = false;
    if(flag){printf("TLE\n");return 0;}
    int Min = 10000;
	rep(i,1,n) if(b[i] <= T) Min = min(Min,a[i]);
	printf("%d\n",Min);
	return 0;
}

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

int main(){
  string a, b;
  cin >> a >> b;
  int m, n;
  m = a.size();
  n = b.size();
  if(m < n){
    cout << "LESS" << endl;
    return 0;
  }
  if(m > n){
    cout << "GREATER" << endl;
    return 0;
  }
  for(int i = 0; i < n; i++){
    if(a[i] < b[i]){
      cout << "LESS" << endl;
      return 0;
    }
    if(a[i] > b[i]){
      cout << "GREATER" << endl;
      return 0;
    }
  }
  cout << "EQUAL" << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <unordered_set>
#include <bitset>
#include <limits>
#include <algorithm>

#define MOD_BIG 1000000007
#define MOD_BIG2 998244353
using std::string;
using std::cin;
using std::cout;
using std::cerr;
using std::endl;
using ll = long long;
using pint = std::pair<int, int>;
using pll = std::pair<ll, ll>;
using std::vector;

#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(int i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)

//////////////////////////////////////


//////////////////////////////////////

int main() {
    
    ll N, A, B;
    cin >> N >> A >> B;
    ll ans = 0;
    if ((B-A) % 2 == 0) {
        ans = (B-A) / 2;
        cout << ans << endl;
        return 0;
    }
    if (N - B > A - 1) {
        ans = A;
        ans += (B-A-1) / 2;
    } else {
        ans = N - B + 1;
        ans += (B-A-1) / 2;
    }
    cout << ans << endl;
    
    return 0;
}


Measured memory_bytes: 256
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,avx512f")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")


#include <iostream>
#include <vector>


signed main() {
  int n;
  std::cin >> n;
  std::vector<int> a, b;
  a.reserve(n);
  b.reserve(n);
  for (int i = 0; i < n; ++i) { int t; std::cin >> t; a.emplace_back(t); }
  for (int i = 0; i < n; ++i) { int t; std::cin >> t; b.emplace_back(t); }

  int ans = 0;
  for (int i = 0; i < n; ++i)for (int j = 0; j < n; ++j) {
    ans ^= (a[i] + b[j]);
  }
  std::cout << ans << std::endl;

  return 0;
}

Measured memory_bytes: 4780
N = int(input())  # 数値入力
b = list(map(int, input().split()))  # リスト入力（数値）  map関数はリストの各要素に対して関数を適用してくれる

b.reverse()
ans = []
while b:
    check = 0

    tmp = 0
    for i in b:
        if i == len(b) - tmp:
            ans.append(b.pop(tmp))
            check = 1
            break

        tmp += 1

    if check == 0:
        check = 2
        break


if check == 2:
    print(-1)
else:
    ans.reverse()
    for i in ans:
        print(i)


Measured memory_bytes: 3060
#include <string.h>
#include <stdio.h>
#include<math.h>
int main()
{
    char c[10];
    char b[20];
    gets(c);
    gets(b);
    int flag=1;
    if(c[0]!=b[2])flag=0;
    if(c[1]!=b[1])flag=0;
    if(c[2]!=b[0])flag=0;
    if(flag==1)
        printf("YES\n");
    else
        printf("NO\n");
    return 0;
}

Measured memory_bytes: 128
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int count = 0;
		for (int i = A; i <= B; i++) {
			String n = String.valueOf(i);
			if (n.charAt(0) == n.charAt(4)) {
				if (n.charAt(1) == n.charAt(3)) {
					count++;
				}
			}
		}
		System.out.println(count);
	}
}


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

int main(){
    long long x;
    cin >> x;
    long long i =0;
    long long n = 100;
    while(true){
        if(n>=x){
            cout << i << endl;
            return 0;
        }
        i++;
        n = n*1.01;
    }
}

Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
int main(){
  
  int N,M;
  
  cin>>N>>M;
  
  vector<int>K(N);

  vector<int>sum(M+1);
  
    
    for(int j=0;j<N;j++){
    cin>>K.at(j);
      
      for(int k=0;k<K.at(j);k++){
        vector<int>A(K.at(j));
        cin>>A.at(k);
          
          for(int i=0;i<=M;i++){
        if(i==A.at(k)){
          
          sum.at(i)++;
          
        }
      }
    }
  }
  
  int answer=0;
  
  for(int i=0;i<=M;i++){
    if(sum.at(i)==N){
      answer++;
      
    }
  }
  cout<<answer<<endl;
  
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(){

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

    int left_road = 0, right_road = 0;

    for(int i = 0; i < M; i++){
        int a;
        cin >> a;
        if(0 < a && a < X) left_road++;
        else if(X < a && a < N) right_road++;
    }

    if(left_road < right_road) cout << left_road << endl;
    else cout << right_road << endl;

    return 0;
}

Measured memory_bytes: 256
use std::cmp;
use std::collections::HashMap;
use std::collections::VecDeque;
use std::io::Read;
use std::usize::MAX;

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:tt ]) => {{let len = read_value!($next, usize);(0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()}};($next:expr, $t:ty) => {$next().parse::<$t>().expect("Parse error")};}

fn solve() {
    input! {
        n: usize,
        a: [u64;n]
    }

    let mut ans = 0;

    for i in 0..n {
        let mut tmp_a = a[i];
        while tmp_a % 2 == 0 {
            tmp_a /= 2;
            ans += 1;
        }
    }

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

fn main() {
    let thd = std::thread::Builder::new().stack_size(104_857_600);
    thd.spawn(|| solve()).unwrap().join().unwrap();

    /*
    // 入力を一括で読み込む場合
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();
    let mut input = buf.split_whitespace();

    // inputに対しnext()で読み込んでいく
    let q: usize = input.next().unwrap().parse().unwrap();
    */
}

const LARGE_PRIME: u64 = 1_000_000_007;

// @〜でsnippet


Measured memory_bytes: 8572
#include<bits/stdc++.h>
using namespace std;
int main(){
    int a,b,k;
    cin >> a >> b >> k;
    
    int tmp;
    if( a>b ){
        tmp = a;
    }else{
        tmp =b;
    }
    vector<int> divisor(tmp+1);
    int count;
    count = 0;
    for( int i=1; i<=tmp; i++){
        if( (0 == a%i) && (0 == b%i) ){ 
            //cout << i << endl;
            divisor[count] = i;
            count++;
        }
    }
    cout << divisor[count-k] << endl;
}



Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
 
#define nl '\n'
#define ll long long 
#define ull unsigned long long
#define debug(x)       { cerr << #x << " = " << x << endl; } 
#define fastread ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
 
 
const int Max = (int)2e5+5;
 
//functions
ll lcm(ll a,ll b) {if(a==0 || b==0){return 0;}else{return (a*b)/__gcd(a,b);}}
 
//direction arry
int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dy8[] = {1,-1, 1, -1, 0, 0, -1, 1};
int dx4[] = {0, 0, 1, -1};
int dy4[] = {1, -1, 0, 0};
 
//____________________________________________________________________________________________________
void solve()
{
       int a,b,c;
       cin>>a>>b>>c;
       swap(a,b);
       swap(a,c);
       cout<<a<<" "<<b<<" "<<c<<endl;
}
int main()
{
    fastread;
    int tc=1;
    // cin>>tc;
    while(tc--){
        solve();
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#include <numeric>
#include <set>
#include <cstdlib>
#include <queue>
#include <map>
#include <cstdio>

using namespace std;

typedef long long llint;
typedef long double ld;
#define inf 1e18
#define mod 1000000007
//priority_queue<llint,vector<llint>,greater<llint>> que;
//priority_queue<llint> q;

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int n;

void solve(){
  int sum=0;
  for(int i=0;i<4;i++){
    cin >> n;
    sum+=n;
  }
  cout << sum << endl;
}

int main() {
  solve();
  return 0;
}



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

using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
typedef vector<int> Vi;
//typedef tuple<int, int, int> T;
#define FOR(i,s,x) for(int i=s;i<(int)(x);i++)
#define REP(i,x) FOR(i,0,x)
#define ALL(c) c.begin(), c.end()
#define DUMP( x ) cerr << #x << " = " << ( x ) << endl

const int dr[4] = {-1, 0, 1, 0};
const int dc[4] = {0, 1, 0, -1};

// graph by adjacency list
template <typename T>
struct Edge {
  int dst; T weight;
  Edge(int dst, T weight) : dst(dst), weight(weight) { }
  bool operator < (const Edge<T> &e) const {
    return weight > e.weight;
  }
};

template <typename T>
struct Graph {
  int V;
  vector<vector<Edge<T>>> E;
  Graph(int V) : V(V) { E.resize(V); }
  void add_edge(int src, int dst, T weight) {
    E[src].emplace_back(dst, weight);
  }
};

template <typename T>
struct Node {
  int v, src; T dist;
  Node(int v, int src, T dist) : v(v), src(src), dist(dist) { };
  bool operator < (const Node<T> &n) const {
    return dist > n.dist; // reverse
  }
};

template <typename T>
struct MinimumSpanningTree {
  Graph<T> g;
  vector<Node<T>> mst;
  int mincost;

  MinimumSpanningTree(const Graph<T> &g) : g(g) { }

  int prim() {
    mincost = 0;

    vector<bool> used(g.V, false);

    priority_queue<Node<T>> que;
    que.emplace(0, -1, 0);

    while (!que.empty()) {
      Node<T> n = que.top(); que.pop();
      int v = n.v; T cost = n.dist;
      if (used[v]) continue;
      if (n.src != -1) mst.push_back(n);
      used[v] = true;
      mincost += cost;
      for (Edge<T> e : g.E[v]) {
	if (!used[e.dst]) que.emplace(e.dst, v, e.weight);
      }
    }
    return mincost;
  }
};

int main() {
  // use scanf in CodeForces!
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int V, E; cin >> V >> E;
  Graph<int> g(V);
  REP(_, E) {
    int s, t, w; cin >> s >> t >> w;
    g.add_edge(s, t, w);
    g.add_edge(t, s, w);
  }
  MinimumSpanningTree<int> mst(g);
  cout << mst.prim() << endl;
  return 0;
}

Measured memory_bytes: 9096
#include <iostream>
#include <algorithm>
using namespace std;
int n;
int a[200002];
int ans[200002];
int res[200002];

int main(){
	int m=0;
	cin>>n;
	for (int i=1;i<=n;i++){
		cin>>a[i];
	}
	for (int i=n;i>=1;i--){
		// a[i] = b[i] ^ b[2i] ^ b[3i] ...
		// b[i] = a[i] ^ b[2i] ^ b[3i] ^ ...
		/*
		0 0 0
		0 1 1
		1 0 1
		1 1 0
		*/
		int sum=0;
		for (int j=2;j*i<=n;j++){
//			ans[i]=a[i]^ans[i*j];
			sum+=ans[i*j];
		}
//		sum+=a[i];
		sum%=2;
//		ans[i]=a[i]^sum;
		if (sum!=a[i]){
			ans[i]=1;
		}else ans[i]=0;
		if (ans[i]==1){
			m++;
			res[m]=i;
		}
	}
	cout<<m<<endl;
	for (int i=1;i<=m;i++){
		cout<<res[i]<<" ";
	}
	return 0;
}

Measured memory_bytes: 2944
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<climits>
#include<iostream>
#include<sstream>
#include<utility>
#include<map>
#include<vector>
#include<queue>
#include<algorithm>
#include<set>
#include<stack>
using namespace std;
typedef long long ll;
typedef pair<int,int>P;

int main()
{
	ll A,B,X,r;
	scanf("%lld%lld%lld",&A,&B,&X);
	if(A==0)r=B/X+1;
	else r=B/X-(A-1)/X;
	printf("%lld\n",r);
	return 0;
}


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

int main(){
    long long n,k;cin>>n>>k;
    vector<long long> points(n);for (long long i=0;i<n;i++){cin>>points[i];}

    sort(points.begin(), points.end(), greater<long long>());

    long long acc = 0;
    for (auto p : points){
        if (k > 0){
            k--;
        } else {
            acc += p;
        }
    }
    cout << acc << endl;
    return 0;
}

Measured memory_bytes: 1792
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
const int INF = 1 << 28;
const ll MOD = 1000000007;
template <class T>
bool chmax(T &a, const T &b) {
    return (a < b) ? (a = b, 1) : 0;
}
template <class T>
bool chmin(T &a, const T &b) {
    return (b < a) ? (a = b, 1) : 0;
}

int main() {
    int n, x;
    cin >> n >> x;
    vi l(n);
    for (int i = 0; i < n; ++i) {
        cin >> l[i];
    }
    int d = 0;
    int ret = 1;
    for (int i = 0; i < n; ++i) {
        d += l[i];
        if (d <= x)
            ret++;
    }
    cout << ret << "\n";
    return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;
int main(){
	int i,n;
	cin >> n;
	int x = 1000000001,ans = 0;
	for(i=0;i<n;i++){
		int y; cin >> y;
		if(y>x) ans++;
		x = y;
	}
	cout << ans << endl;
}
		


Measured memory_bytes: 3120
#include <cstdio>
#include <queue>
#include <algorithm>

using namespace std;

int main()
{
	int x , y , z;
	scanf("%d %d %d",&x , &y , &z);
	x -= z;
	int sum = 0;
	sum = x / (y + z);
	printf("%d\n",sum);
}

Measured memory_bytes: 128
#単位元を設定
ide = 0

class SegmentTree:
	def __init__(self,n):
        #セグ木の頂点はindex == 1から。index == 0は無視すること。
        #つまり、STtable[0]は無視。頂点はSTtable[1]。
		self.n = n
		tmp = 0
		while True:
			if 2 ** tmp >= self.n:
				break
			tmp += 1
		self.STtable = [ide] * (2*2**tmp)
		self.STtable_size = len(self.STtable)

	def update(self,i,a):
        #更新のためのインデックスの指定は0_indexedで。
		a_bit = 1 << ord(a)-97
		i += self.STtable_size//2
		self.STtable[i] = a_bit
		while i > 0:
			i //= 2
			self.STtable[i] = self.STtable[i*2] | self.STtable[i*2+1]

	def find(self,a,b,k=1,l=0,r=None):
        #kは頂点番号。初期値は1にすること。
		#[a,b)の最小を返す。
		#[l,r)からです。
        #初期値のrは、self.STtable_size//2にすると、ちょうど要素数と同じ値になって[l,r)のrになる。
        #問題に適するように範囲を指定するように注意。大体[l,r]で指定されている。
		if r == None:
			r = self.STtable_size//2        
		if a >= r or b <= l:
			return ide
		elif a <= l and b >= r:
			return self.STtable[k]
		else:
			mid = (l+r)//2
			if b <= mid:
				return self.find(a,b,2*k,l,mid)
			elif a >= mid:
				return self.find(a,b,2*k+1,mid,r)
			else:
				v1 = self.find(a,mid,2*k,l,mid)
				v2 = self.find(mid,b,2*k+1,mid,r)
			return v1 | v2

N = int(input())
solve = SegmentTree(N)
S = input()
for i in range(N):
	solve.update(i,S[i])
Q = int(input())
ans = []
for _ in range(Q):
	a,b,c = map(str, input().split())
	if a == '1':
		solve.update(int(b)-1,c)
	else:
		tmp = solve.find(int(b)-1,int(c))
		cnt = 0
		for i in range(26):
			if tmp >> i & 1 == 1:
				cnt += 1
		ans.append(cnt)

for a in ans:
	print(a)


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

void main_()
{
    string S;
    int64_t K;
    cin >> S >> K;

    auto pos = S.find_first_not_of("1");

    if (pos == string::npos || K <= pos) {
        cout << 1 << endl;
    } else {
        int d = S[pos] - '0';
        cout << d << endl;
    }
}
int main()
{
    cin.tie(nullptr);
    cout.tie(nullptr);
    ios_base::sync_with_stdio(false);
    main_();
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
#include<map>
#include<cmath>
#include<stdio.h>
using namespace std;
 
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define INF 1<<25
int t[300000];
int u[300000];
int main()
{
	int n, i;
	string s;

	int mn = 0;
	int ss = 0;
	cin >> n >> s;
	
	rep(i, n) {
		if (s[i] == 'E')
			t[i] = 1;
		else
			t[i] = 0;
		ss += t[i];
	}
	 
	u[0] = ss - t[0];
	mn = u[0];
	REP(i, 1, n) {
		u[i] = u[i - 1] + (t[i - 1] ^ 0x01 & 0x01) - t[i];
		mn = min(mn, u[i]);
	}
	cout << mn << endl;
	
	return 0;
}

Measured memory_bytes: 3076
#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int main() {
  string s;
  cin >> s;
  vector <vector <int> > dp(s.length() + 1, vector <int>(13, 0));
  dp[0][0] = 1;
  for (int i = 0; i < s.length(); i++) {
	  if (s[i] != '?') {
		  int n = s[i] - '0';
		  for (int j = 0; j < 13; j++) {
			  dp[i + 1][(10 * j + n) % 13] = dp[i][j];
			}
		} else {
		  for (int n = 0; n < 10; n++) {
			  for (int j = 0; j < 13; j++) {
				  dp[i + 1][(10 * j + n) % 13] += dp[i][j];
				  dp[i + 1][(10 * j + n) % 13] %= mod;
				}
			}
		}
	}
  cout << dp[s.length()][5] << endl;
  return 0;
}


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

typedef long long ll;

int main()
{
    int n,m;
    int i,j;
    cin >> n >> m;
    vector<int> a(n);
    for(i = 0;i < n;++i){
        cin >> a.at(i);
    }
    vector<pair<int,int>> b(m);
    for(i = 0;i < m;++i){
        cin >> b.at(i).second;
        cin >> b.at(i).first;
    }
    sort(a.begin(),a.end());
    sort(b.begin(),b.end());
    ll ans = 0;
    int now_a = 0;
    int now_b = m-1;
    int now_bj = 0;
    while(true){
        if(b.at(now_b).first > a.at(now_a)){
            ans += b.at(now_b).first;
            ++now_a;
            ++now_bj;
            if(now_a == n){
                break;
            }
            if(now_bj == b.at(now_b).second){
                now_bj = 0;
                --now_b;
                if(now_b == -1){
                    break;
                }
            }
        }else{
            break;
        }
    }
    if(now_a <= n-1){
        for(i = now_a;i < n;++i){
            ans += a.at(i);
        }
    }
    cout << ans << endl;
    return 0;
}

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

#define REP(i,num) for(int i=0;i<(num);++i)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto& x:c){cout<<x<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	int N=in();
	auto A=vecin(N);
	int M=in();
	auto B=vecin(M);
	vector<int> C;
	set_symmetric_difference(ALL(A),ALL(B),back_inserter(C));
	
	for(auto& x:C){
		out(x);
	}
	return 0;
}


Measured memory_bytes: 6500
#include<iostream>
#include<string>
#include <sstream>
#include <stdio.h>
#include <math.h>
 
using namespace std;
 
int main() {
    string t; 
    cin >> t; 
   
    for(double i=0;i < t.size();i+=1){
 
        if(t[i]=='?'){
           
      
                 t[i]='D';
            
        }
    }
   

    cout << t << endl;
}


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

template < unsigned mod >
class Modint
{
public:
        using uint = unsigned;
        using u64 = uint64_t;
        using i64 = int64_t;

        Modint (const i64 dat = 0) : dat(dat >= 0 ? dat % mod : (mod - (-dat) % mod) % mod) {}
        constexpr Modint operator + (const Modint &v) const { return ( Modint(dat + v.dat) ); }
        constexpr Modint operator - () const { return ( Modint(-((i64)dat)) ); }
        constexpr Modint operator - (const Modint &v) const { return ( (*this) + -v ); }
        constexpr Modint operator * (const Modint &v) const { return ( Modint((u64)dat * v.dat) ); }

        constexpr Modint operator ~ () const
        {
                i64 a = dat, b = mod, x1 = 1, x2 = 0, t;
                
                while ( b > 0 ) {
                        t = a / b;
                        swap(a -= t * b, b);
                        swap(x2 -= t * x1, x1);
                }
                
                return ( Modint(x1) );
        }
        
        constexpr Modint operator / (const Modint &v) const { return ( (*this) * ~v ); }

        Modint &operator = (const i64 &v) { return ( (*this) = Modint < mod > (v) ); }
        Modint &operator += (const Modint &v) { return ( (*this) = (*this) + v ); }
        Modint &operator -= (const Modint &v) { return ( (*this) = (*this) - v ); }
        Modint &operator *= (const Modint &v) { return ( (*this) = (*this) * v ); }
        Modint &operator /= (const Modint &v) { return ( (*this) = (*this) / v ); }

        constexpr Modint operator ^ (u64 n) const
        {
                Modint < mod > ret(1), mul(dat);
                while ( n > 0 ) {
                        if ( n & 1 ) ret *= mul;
                        mul *= mul;
                        n >>= 1;
                }
                return ( ret );
        }
        
        bool operator == (const Modint &v) { return ( dat == v.dat ); }
        bool operator != (const Modint &v) { return ( dat != v.dat ); }

        friend ostream& operator << (ostream &os, const Modint &p )
        {
                return ( os << p.dat );
        }
        
        friend istream& operator >> (istream &is, Modint &p )
        {
                i64 data;
                is >> data;
                p = Modint < mod >(data);
                return ( is );
        }

private:
        uint dat;
};

Modint < 1000000007 > dp[2005][2005];
int main()
{
        int N, M;
        int S[2005], T[2005];
        cin >> N >> M;
        
        dp[0][0] = 1;

        for ( int i = 1; i <= N; i++ ) cin >> S[i];
        for ( int i = 1; i <= M; i++ ) cin >> T[i];
        
        for ( int i = 0; i <= N; i++ ) {
                for ( int j = 0; j <= M; j++ ) {
                        if ( i > 0 ) dp[i][j] += dp[i - 1][j];
                        if ( j > 0 ) dp[i][j] += dp[i][j - 1];
                        if ( i > 0 && j > 0 ) dp[i][j] -= dp[i - 1][j - 1];
                        if ( i > 0 && j > 0 && S[i] == T[j] ) dp[i][j] += dp[i - 1][j - 1];
                }
        }
        
        cout << dp[N][M] << endl;

        return ( 0 );
}

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

char table[1000000][1],tablek[1000000];
int po[182];

int main(){
	int i,j,k,n;
	
	memset(po,0,sizeof(po));
	memset(table,0,sizeof(table));
	memset(tablek,0,sizeof(tablek));
	
	for(i=1;i<182;i++){
		po[i]=i*(i+1)*(i+2)/6;
		if(po[i]<1000000)table[po[i]][0]=1;
	}
	
	for(i=1;i<5;i++){
		for(j=1;j<1000000;j++){
			if(table[j][0]==i){
				for(k=1;k<182;k++){
					if(j+po[k]>=1000000)break;
					if(table[j+po[k]][0]==0)table[j+po[k]][0]=i+1;
				}
			}
		}
	}
	
	n=1000000-1;
	
	for(i=1;i<182;i++){
		if(po[i]<1000000 && po[i]%2==1){
			tablek[po[i]]=1;
			--n;
		}
	}
	for(i=1;n>0;i++){
		for(j=1;j<1000000;j++){
			if(tablek[j]==i){
				for(k=1;k<182;k++){
					if(j+po[k]>=1000000)break;
					if(tablek[j+po[k]]==0 && po[k]%2==1){
						tablek[j+po[k]]=i+1;
						--n;
					}
				}
			}
		}
	}
	
	while(scanf("%d",&n)>=0){
		if(n==0)break;
		printf("%d %d\n",table[n][0],tablek[n]);
	}
	
	
	return 0;
}

Measured memory_bytes: 2588
#include<iostream>
#include<stdio.h>
#include<math.h>
using namespace std;

int main(){
	double s[1000],n,a,sum=0,b,c=0;
	while (1){
		sum = 0;
		c = 0;
		cin >> n;
		if (n == 0) break;
		for (int i = 0; i < n; i++){
			cin >> s[i];
			sum += s[i];
		}
		b = sum / n;
		for (int i = 0; i < n; i++){
			c += pow(s[i] - b,2);
		}
		a = sqrt( c / n );
		printf("%f\n", a);

	}

	return 0;
}


Measured memory_bytes: 3196
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define dunk(a) cout << (a) << endl
using namespace std;
typedef long long ll;

ll count(ll h) {
	if (h == 1) return 1;

	return 1 + 2*count(h / 2);
}

int main() {
	ll h; cin >> h;

	dunk(count(h));
}


Measured memory_bytes: 256
N = int(input())
AB = [0]*N
for i in range(N):
    AB[i] = [int(j) for j in input().split()]
second = lambda val:val[1]
AB.sort(key = second)

flag = 0
tmp = 0
for i in range(N):
    tmp += AB[i][0]
    if tmp >AB[i][1]:
        print("No")
        flag = 1
        break
if flag == 0:
    print("Yes")


Measured memory_bytes: 41232
from sys import stdin
import math
import re
import queue

input = stdin.readline

MOD = 1000000007
INF = 122337203685477580


def solve():

    A,V = map(int, input().split())
    B,W = map(int, input().split())
    T = int(input().rstrip())
    if(B < A):
        V *= -1
        W *= -1
    if (A-B)*(A + T*V - B -T*W) <= 0:
        print("YES")
    else:
        print("NO")

if __name__ == '__main__':
    solve()


Measured memory_bytes: 10140
#include<stdio.h>
int main(){

  int flag=1;
  int n,a[100],i,j,esc,count=0;

  scanf("%d",&n);
  for(i = 0;i < n;i++) scanf("%d",&a[i]);

  if(n==1){
    printf("%d\n",a[0]);
    printf("0\n");
  }

  else{

    while(flag){
      flag=0;

      for(j=n-1;j>=1;j--){
	if(a[j] < a[j-1]){
	  esc=a[j-1];
	  a[j-1]=a[j];
	  a[j]=esc;
	  flag=1;
	  count++;
	}
      }
    }	
    for(i=0;i<n;i++){
      printf("%d",a[i]);
      if(i==n-1) break;
      printf(" ");
    }
    printf("\n%d\n",count);
  }
    return 0;
}

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

int n, m, q;
vector<int> a, b, c, d;
int ans;

void dfs(vector<int> A) {
    if (A.size() == n + 1) {
        int sum = 0;
        for (int i = 0; i < q; i++) {
            if (A[b[i]] - A[a[i]] == c[i]) {
                sum += d[i];
            }
        }
        ans = max(ans, sum);
        return;
    }
    A.push_back(A.back());
    while(A.back() <= m) {
        dfs(A);
        A.back()++;
    }
}


int main() {
    cin >> n >> m >> q;
    a = b = c = d = vector<int>(q);
    for (int i = 0; i < q; i++) {
        cin >> a[i] >> b[i] >> c[i] >> d[i];
    }
    ans = 0;
    dfs(vector<int> (1,1));

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3624