akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <queue>

// output
#define SPBR(w, n) std::cout<<(w + 1 == n ? '\n' : ' ');
#define YES cout << "YES" << endl;
#define Yes cout << "Yes" << endl;
#define NO cout << "NO" << endl;
#define No cout << "No" << endl;
// utility
#define ALL(i) (i).begin(), (i).end()
#define FOR(i, a, n) for(int i=(a);i<(n);++i)
#define RFOR(i, a, n) for(int i=(n)-1;i>=(a);--i)
#define REP(i, n) for(int i=0;i<int(n);++i)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define IN(a, x, b) (a<=x && x<b)
#define OUT(a, x, b) (x<a || b<=x)
template<class T> inline T chmax(T & a, const T b) { return a = (a < b) ? b : a; }
template<class T> inline T chmin(T& a, const T b) { return a = (a > b) ? b : a; }

// type/const
#define int ll
using ll = long long;
using ull = unsigned long long;
using ld = long double;
constexpr int MOD = 1000000007;
constexpr int INF = 1e18;

using namespace std;


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

  vector<int> A(N);
  REP(i, N) cin >> A[i];


  vector<int> dp(N, INF);
  REP(i, N) *upper_bound(ALL(dp), -A[i]) = -A[i];
  dp.push_back(INF);
  
  cout << lower_bound(ALL(dp), INF)-begin(dp) << endl;

  return 0;
}

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

using namespace std;

#define ll long long
#define fix cout << fixed; cout << setprecision(0)





void solve() {

	int x, y, z;
	cin >> x >> y >> z;
	cout << z << " " << x << " " << y;
	




	
}

int main() {

	ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	fix;
	solve();

	return 0;
}

Measured memory_bytes: 3604
#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using ull = uint64_t;
const ll INF = 9e18;

void print() { cout << endl; }
template <typename Head, typename... Tail>
void print(Head head, Tail... tail) {
    int size = sizeof...(Tail);
    cout << head;
    if (size > 0) {
        cout << " ";
    }
    print(tail...);
}

void print0() {}
template <typename Head, typename... Tail>
void print0(Head head, Tail... tail) {
    cout << head;
    print0(tail...);
}

vector<ll> mkprimes(ll N) {
    vector<bool> isprime(N + 1);
    vector<ll> primes;
    for (ll i = 0; i <= N; i++) {
        isprime[i] = true;
    }
    isprime[0] = false;
    isprime[1] = false;

    for (ll i = 2; i <= N; i++) {
        if (isprime[i]) {
            primes.push_back(i);
            for (ll j = 2 * i; j <= N; j += i) {  // 素数iの倍数は素数ではない
                isprime[j] = false;
            }
        }
    }
    return primes;
}

vector<vector<ll>> prime_factors(ll m) {
    vector<vector<ll>> result(m + 1);

    vector<ll> primes = mkprimes(m);
    vector<bool> isprime(m + 1, false);
    for (auto p : primes) {
        isprime[p] = true;
    }

    for (ll nn = 2; nn <= m; nn++) {
        if (isprime[nn]) {
            result[nn].push_back(nn);
            continue;
        }
        ll n = nn;
        for (auto p : primes) {
            if (n % p == 0) {
                bool exist = false;
                for (ll pp : result[n / p]) {
                    if (pp == p) {
                        exist = true;
                    }
                    result[n].push_back(pp);
                }
                if (!exist) {
                    result[n].push_back(p);
                }
                break;
            }
        }
    }
    return result;
}

int main() {
    ll N;
    cin >> N;
    vector<ll> A(N);
    for (ll i = 0; i < N; i++) {
        cin >> A[i];
    }
    ll maxval = 1000000;
    vector<vector<ll>> pfs = prime_factors(maxval);

    vector<ll> usecount(maxval + 1, 0);
    for (ll i = 0; i < N; i++) {
        ll n = A[i];
        for (auto pf : pfs[n]) {
            usecount[pf]++;
        }
    }
    ll maxusecount = 0;
    for (auto u : usecount) {
        maxusecount = max(maxusecount, u);
    }
    if (maxusecount == N) {
        print("not coprime");
        return 0;
    } else if (maxusecount >= 2) {
        print("setwise coprime");
        return 0;
    } else {
        print("pairwise coprime");
        return 0;
    }
}


Measured memory_bytes: 84892
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//lcm = xとyの最小倍数
ll lcm(ll x, ll y){
	//g = xとyの最大公約数
    ll g = __gcd(x, y);
    return x * y / g;
}
 
int main() {
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
	//B = bをcとdで割り切れる数
    ll B = b/c + b/d - b/lcm(c, d);
	//A = aをcとdで割り切れる数
    ll A = (a-1)/c + (a-1)/d - (a-1)/lcm(c, d);
	//ans = 全ての数からAとBを引く
    ll ans = (b-(a-1)) - B + A;
    cout << ans << endl;
}

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

using namespace std;

int main(){
	string s;
	cin>>s;
	int n=s.size();
	int v[n][2];
	v[0][0]=1,v[0][1]=0;
	for(int i=1;i<n;i++){
		if(s[i]!=s[i-1]){
			v[i][0]=max(v[i-1][0],v[i-1][1])+1;
		}
		else{
			if(v[i-1][1]) v[i][0]=v[i-1][1]+1;
			else v[i][0]=0;
		}
		if(i>=3){
			if(s[i-3]+s[i-2]!=s[i-1]+s[i]){
				v[i][1]=max(v[i-2][0],v[i-2][1])+1;
			}
			else{
				if(v[i-2][0]) v[i][1]=v[i-2][0]+1;
				else v[i][1]=0;
			}
		}
		else if(i==2){
			if(v[i-2][0]) v[i][1]=v[i-2][0]+1;
			else v[i][1]=0;
		}
		else{
			v[i][1]=1;
		}
	}
	cout<<max(v[n-1][0],v[n-1][1])<<"\n";
	return 0;
}

Measured memory_bytes: 2180
fun main(args: Array<String>) {
    val (n, m) = readLine()?.split(" ")?.map(Integer::parseInt) ?: return
    val shipMap = mutableMapOf<String, Int>()
    repeat(m) {
        val (a, b) = readLine()?.split(" ")?.map(Integer::parseInt)!!
        shipMap["${a}_${b}"] = 0
    }
    for (midIsland in 2..m) {
        if (shipMap.containsKey("1_$midIsland") && shipMap.containsKey("${midIsland}_$n")) {
            println("POSSIBLE")
            return
        }
    }
    println("IMPOSSIBLE")
}

Measured memory_bytes: 104268
#include <stdio.h>
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <queue>
#include <set>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <cmath>

long long int MOD = 1e9 + 7;

int main(){
  long long int N, tmp;
  std::vector<long long int> A;

  scanf("%lld", &N);
  for(long long int i = 0; i < N; i++){
    scanf("%lld", &tmp);
    A.push_back(tmp);
  }

  // count the number of times that each bit is 1
  std::vector<long long int> bit_counts(60);

  for(long long int i = 0; i < N; i++){
    for(long long int j = 0; j < 60; j++){
      bit_counts[j] += ((A[i]>>j) & 1);
    }
  }

  long long int pow2 = 1;
  long long int ans = 0;

  for(long long int i = 0; i < 60; i++){
    tmp = ((N-bit_counts[i])*bit_counts[i] + MOD)%MOD;
    tmp = (tmp*pow2 + MOD)%MOD;
    ans += tmp;
    ans = (ans+MOD)%MOD;
    pow2 = (pow2*2 + MOD)%MOD;
  }

  std::cerr << "Answer: " << std::endl;
  std::cout << ans << std::endl;

  return 0;
  
}


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

/**
 * vector<int>ar(3);
 * for(auto&e:ar){
 *     scanf("%d",&e);
 * }
 * sort(ar.begin(),ar.end())
 * int sum=accumulate(ar.begin(),ar.end(),0);
 ***/
bool check(int x){
    int i=2;
    while(i*i<=x){
        if(x%i==0) return false;
        i++;
    }
    return true;
}

int main(){
    double pai=3.141592653589;
    int n,k,ans=0;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%d",&k);
        if(check(k)){
            ans++;
        }
    }
    printf("%d\n",ans);
    return 0;
}

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

int main()
{
    string O, E;
    cin >> O >> E;
    string ans = {};
    int o = 0;
    int e = 0;

    for (int i = 0; i < (O.size() + E.size()); ++i)
    {
        if (i % 2 == 0)
        {
            ans.push_back(O[o]);
            ++o;
        }
        else
        {
            ans.push_back(E[e]);
            ++e;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define pb push_back
#define ppb pop_back
#define mer make_pair
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<pair<int,int>,int> piii;
typedef pair<int,pair<int,int> > ipii;
typedef pair<pii,pii> pi4;
const int vbi=999999999;

/*void cin_bin(){
	char bin[10000];
	gets(bin);
}*/

/*vector<int> jz10_2(int a){
	vector<int> ans;
	while(a!=0){
		ans.pb(a%2);
		a/=2;
	}
	reverse(ans.begin(),ans.end());
	return ans;
}*/

int main(){
	//my new name is Veex
	//clock_t start1=clock();
	int n,k;
	cin>>n>>k;
	int x[n+1],fj[n+1],zj1[n+1],zj2[n+1];
	for(int i=1;i<=n;i++)
		cin>>x[i];
	int b0=n+1;
	for(int i=1;i<=n;i++)
		if(x[i]>0){
			b0=i;
			break;
		}
	int sum=0;
	for(int i=b0-1;i>=1;i--){
		sum++;
		fj[i]=sum;
		zj1[sum]=i;
	}
	if(b0!=n+1){
		sum=0;
		for(int i=b0;i<=n;i++){
			sum++;
			zj2[sum]=i;
			fj[i]=sum;
		}
	}
	
	ll minn=99999999999999;
	for(int i=1;i<=n-k+1;i++){
		ll ans=0;
		if(i>=b0)
			ans=x[k+i-1];
		else if(k+i-1<b0)
			ans=-x[i];
		else{
			int then=k-fj[i];
			ans=-x[i];
			if(then>0){
				ans+=-x[i];
				ans+=x[zj2[then]];
			}
			ll ans2=0;
			then=k-fj[k+i-1];
			ans2=x[k+i-1];
			if(then>0){
				ans2+=x[k+i-1];
				ans2+=-x[zj1[then]];
			}
//			cout<<ans<<' '<<ans2<<' ';
			ans=min(ans,ans2);
		}
//		cout<<ans<<' '<<i<<endl;
		minn=min(minn,ans);
	}
	cout<<minn;
	//cout<<endl<<((double)(clock()-start1)/CLOCKS_PER_SEC);
	return 0;
}


Measured memory_bytes: 1408
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (long long  i=a;i<n;i++)
#define sz(A) (int)(A.size())
#define all(x) (x).begin(),(x).end()
#define get(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
typedef long long ll;
typedef pair<int, int> PII;
typedef vector<int> VI;
int h, w;
int a, b, c, d;
int f = 0;
//set < pair<int, int>> se1;
void dfs(vector<string> &grid, int i, int j, vector<VI> &vis, set < pair<int, int>> &se) {
	if (i < 0 || i >= h || j < 0 || j >= w)return;
	if (vis[i][j] || grid[i][j]=='#')return ;
	if (i == c&&j == d) {
		f = 1;
		return;
	}
	se.insert({ i,j });
	vis[i][j] = 1;
	dfs(grid, i + 1, j, vis,se);
	dfs(grid, i - 1, j, vis,se);
	dfs(grid, i, j+1, vis,se);
	dfs(grid, i, j-1, vis,se);
}
void solve() {
	
	cin >> h >> w;
	
	cin >> a >> b >> c >> d;
	a--;
	b--;
	c--;
	d--;
	vector<string> grid;
	rep(i, 0, h) {
		string s;
		cin >> s;
		grid.push_back(s);
	}
	queue<pair<int, int> > q;
	q.push({ a,b });
	int ans = 0;
	vector<VI> vis(h, VI(w, 0));
	//for (auto poi : se1)q.push(poi);
	while (!q.empty()) {
		int m = q.size();
		set < pair<int, int>> se1;
		rep(kk, 0, m) {
			f = 0;
			pair<int, int> poi = q.front();
			q.pop();
			set < pair<int, int>> se;
			dfs(grid, poi.first, poi.second, vis,se);
			if (f == 1) {
				cout << ans << endl;
				return;
			}
			for (auto poi : se)se1.insert(poi);
		}
		for (auto poi : se1) {
			int x = poi.first, y = poi.second;
			for (int i = -2; i <= 2; i++) {
				for (int j = -2; j <= 2; j++) {
					if (x + i >= 0 && x + i < h&&y + j >= 0 && y + j < w && !vis[x + i][y + j] && grid[x + i][y + j] == '.') {
						q.push({ x + i,y + j });
					}
				}
			}
		}
		ans++;
	}
	cout << -1 << endl;
}
int main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int T_ = 1;
	//cin >> T_;
	for (int i = 0; i < T_; i++)solve();
	return 0;
}



Measured memory_bytes: 9108
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
const int MAXN = 1e7 + 5;

int a[MAXN];
char s[MAXN];

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

int main(void)
{
	int a,b,c;
	scanf("%d%d%d",&a,&b,&c);
	swap(a,b);
	swap(a,c);
	printf("%d %d %d",a,b,c);
	return 0;
}

Measured memory_bytes: 128
#include <algorithm>
#include <iostream>
#define INF (1e9)
#define N 101
using namespace std;
int n,m,s,g1,g2,b,e,c,d[N][N],ans;
void warshall_floyd();

int main(){
  while(1){
    cin>>n>>m>>s>>g1>>g2;
    if(!n&&!m&&!s&&!g1&&!g2) break;
    for(int i=0;i<N;i++)
      for(int j=0;j<N;j++) d[i][j]=INF;
    for(int i=0;i<N;i++) d[i][i]=0;
    while(m--) cin>>b>>e>>c,d[b][e]=c;
    warshall_floyd();
    ans=INF;
    for(int i=1;i<=n;i++){
      if(d[s][i]==INF||d[i][g1]==INF||d[i][g2]==INF) continue;
      ans=min(ans,d[s][i]+d[i][g1]+d[i][g2]);
    }
    cout<<ans<<endl;
  }
  return 0;
}

void warshall_floyd(){
  for(int k=1;k<=n;k++)
    for(int i=1;i<=n;i++)
      for(int j=1;j<=n;j++) d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
}

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

int main()
{
    int m;
    int n;
    
    cin >> n >> m;
    
    int *vecb = new int[m];
    
    int **vecA  = new int*[n];
    
    for (int i = 0; i < n; ++i)
    {
        vecA[i] = new int[m];
    }
    
    for (int i = 0; i < n; ++i)
    {
        for (int j = 0; j < m; ++j)
        {
            cin >> vecA[i][j];
        }
    }
    
    for (int i = 0; i < m; ++i)
    {
        cin >> vecb[i];
    }
    
    for (int i = 0; i < n; ++i)
    {
        int value = 0;
        for (int j = 0; j < m; ++j)
        {
            value += vecA[i][j] * vecb[j];
        }
        
        cout << value << endl;
    }
    
    delete[] vecb;
    delete[] vecA;
    
    return 0;
    
}


Measured memory_bytes: 3108
/*
  The Island Was Silent before.
  .....
  And One day again it became Silent.
*/
#include<bits/stdc++.h>
using namespace std;
 
#define endl '\n'
#define ll  long long
#define modd(a,b) ((a+2*b)%b)
#define debug(a) cout << #a << ": " << (a) << "\n"
#define ioso ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define rtt cerr << "Time: " << clock()*1.0 / CLOCKS_PER_SEC << endl;
#define ffe freopen("input.txt","r",stdin), freopen("output.txt","w",stdout);
ll dp[100010]; 
ll mod = 1000000007;
ll n;
ll fx(ll s) {
  if(s<3) {return 0;}
  else if(dp[s]!=-1) {return dp[s]%mod;}
  else {
    dp[s] = 1;
    for(int i=3;i<=(n-3);i++) {
      dp[s] += ((fx(s-i))%mod);
    }

    return dp[s]%mod;
  }
}
int main() {
  ioso
  #ifndef ONLINE_JUDGE
  ffe
  #endif
   cin >> n;
  memset(dp,-1,sizeof(dp));
  dp[3]=1;
  ll ss = fx(n);
  cout << ss%mod << endl;
}

Measured memory_bytes: 4432
import java.io.InputStream;
import java.io.PrintStream;
import java.util.Scanner;

public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int[] a = new int[5];
		for (int i = 0; i < a.length; i++) {
			a[i] = sc.nextInt();
		}
		int k = sc.nextInt();

		if (a[4] - a[0] <= k) {
			out.println("Yay!");
		} else {
			out.println(":(");
		}

		sc.close();

	}

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

}


Measured memory_bytes: 21204
#include<bits/stdc++.h>
using namespace std;
#define FASTIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define ll long long
#define pb push_back
#define mp make_pair
#define pii pair<ll,ll>
#define F first
#define S second
#define ld long double
#define rep(i,a,n) for (ll i = (a) ; i < (n); ++i)
#define vi vector<ll>
#define all(v) (v).begin(),(v).end()
#define M_PI 3.14159265358979323846
const ll MOD = 1e9 + 7;
const ll INF = 1e18L + 5;

void solve() {
	int n, m, k;
	cin >> n >> m >> k;
	vi a(n), b(m);
    rep(i,0,n) cin>>a[i];
    rep(i,0,m) cin>>b[i];

	int lena = 0;
	rep(i, 0, n) {
		if ( i != 0)
			a[i] += a[i - 1];
        //cout<<a[i]<<" ";
		if ( a[i] > k) {
			lena = i + 1;
			break;
		}
	}
	//cout<<endl;
	//cout<<lena<<endl;

	int lenb = 0;
	rep(i, 0, m) {
		if ( i != 0)
			b[i] += b[i - 1];

		if ( b[i] > k) {
			lenb = i + 1;
			break;
		}
	}
	if ( lena == 0 ) lena = n + 1;
	if ( lenb == 0 ) lenb = m + 1;

    //cout<<lena<<' '<<lenb<<endl;
	ll ans = max(lena, lenb) - 1, ca = lena-1;

	int i = lena - 2, j = 0;

	while ( i >= 0 && j < lenb - 1 ) {

		if ( a[i] + b[j] <= k ) {
			j++;
			ca++;
		}
		else {
			i--;
			ca--;
		}
		ans = max(ans, ca);
	}

	cout << ans << endl;

}


int main() {

	int t = 1;

	//cin >> t;
	ll k = 1;
	while (t--) {
		//cout << "Case #" << k++ << ": ";
		solve();
	}
	return 0;
}


Measured memory_bytes: 6364
using namespace std;
#include<bits/stdc++.h>
#define BEGIN ios_base::sync_with_stdio(0);cin.tie(0);
#define END return EXIT_SUCCESS;
#define FOR(I,A,B) for((I)=(A);(I)<(B);(I)++)
#define REP(I,N) FOR((I),0,(N))
#define UP(I,A,B) for((I)=(A);(I)<=(B);(I)++)
#define DW(I,A,B) for((I)=(A);(I)>=(B);(I)--)
#define IN(P) cin>>(P)
#define IN2(P1,P2) cin>>(P1)>>(P2)
#define IN3(P1,P2,P3) cin>>(P1)>>(P2)>>(P3)
#define INS(I,N,V) REP((I),(N)) cin>>(V[I])
#define INS2(I,N,V1,V2) REP((I),(N)) cin>>(V1[I])>>(V2[I]);
#define INS3(I,N,V1,V2,V3) REP((I),(N)) cin>>(V1[I])>>(V2[I])>>(V3[I]);
#define OUT(P) cout<<(P)<<endl
#define OUT2(P1,P2) cout<<(P1)<<" "<<(P2)<<endl
#define OUT3(P1,P2,P3) cout<<(P1)<<" "<<(P2)<<" "<<(P3)<<endl
#define OUTS(I,N,V) REP((I),(N)) cout<<(V[i])<<endl
#define ALL(C) (C).begin(),(C).end()
#define RALL(C) (C).rbegin(),(C).rend()
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;}
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;}

int A,B;
char op;
inline void solve(){
  IN3(A,op,B);
  OUT(op=='+'?A+B:A-B);
}

int main(int argc,char**argv){
  BEGIN
  solve();
  END
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod=1e9+7ll;

int a,b,c,d;

int main(){

cin.tie(0);
ios::sync_with_stdio(false);

cin>>a>>b>>c>>d;

cout<<min(a,b)+min(c,d)<<endl;

}



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

int main() {
  int x;cin>>x;
  while(1){
    bool ans=true;
    for(int i=2;i<x;i++){
      if(x%i==0)ans=false;
    }
    if(ans)break;
    x++;
  }
  cout<<x<<endl;
}

Measured memory_bytes: 3484
import collections

n = int(input())
ls = [input() for _ in range(n)]

c = collections.Counter(ls)

cs = c.most_common()
mst = cs[0][1]

ans = []

for i in range(len(cs)):
    if mst == cs[i][1]:
        ans.append(cs[i][0])
    elif mst != cs[i][1]:
        break

ans.sort()

for j in range(len(ans)):
    print(ans[j])

Measured memory_bytes: 47668
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <queue> //C++
#include <string> //C++
#include <iostream> //C++
#include <vector> //C++
#include <algorithm> //C++
using namespace std; //C++
#define rep(i, a, n) for (i = (a); i < (n); i++)

//C++で提出



// string s="AAA";    s.size() =3    (sのサイズ) ...1
// vector <int> a;    配列a(サイズは0) ...2
// a.push_back(10);   配列のサイズが一つ増えて一番後ろに10を代入 ...2
// A.pop_back();   最後の要素が消去される
// sort(A.begin(),A.end());   配列Aの最初の要素から最後の要素(/.)より前までを小さい順に並び替えてa[0]から代入していく...3
// reverse(A.begin(),A.end());   配列Aの最初の要素から最後の要素(/.)までを逆の順にしてa[0]から代入していく
// s.substr(3,2)   配列s[3]から2個の文字を抜き出した文字列 (s[3]とs[4]) ...4
// strcmp(s1,s2)  文字列が等しければ0を出力　s1>s2なら1 s1<s2なら-1を出力　C言語用なので配列は、s1[100]にする...5





int main()
{
	
	int x, y;
	cin >> x >> y;

	if (x < 10 && y < 10)
		cout << x * y;
	else cout << -1;
	
}


Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"log"
	"math"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)
var buff []byte

func init() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(buff, bufio.MaxScanTokenSize*1024)
	log.SetFlags(log.Lshortfile)
}

func main() {
	eps := 0.000000000001
	A := nextInt()
	B := nextFloat64()
	log.Println(A, B)
	ans := 0
	for i := 0.0; i+eps < B; i += 0.01 {
		ans += A
	}
	fmt.Println(ans / 100)
}

func nextString() string {
	sc.Scan()
	return sc.Text()
}

func nextFloat64() float64 {
	sc.Scan()
	f, err := strconv.ParseFloat(sc.Text(), 64)
	if err != nil {
		panic(err)
	}
	return f
}

func nextInt() int {
	sc.Scan()
	i, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}
	return i
}

func nextInts(n int) (r []int) {
	r = make([]int, n)
	for i := 0; i < n; i++ {
		r[i] = nextInt()
	}
	return r
}

var dy = []int{0, 1, 0, -1}
var dx = []int{1, 0, -1, 0}
var MAX = math.MaxInt32

func pow(a, b int) int {
	return int(math.Pow(float64(a), float64(b)))
}

func lcm(a, b int) int {
	return a * b / gcd(a, b)
}
func gcd(a, b int) int {
	if a < b {
		a, b = b, a
	}
	for b != 0 {
		a, b = b, a%b
	}
	return a
}
func max(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r < a[i] {
			r = a[i]
		}
	}
	return r
}
func min(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r > a[i] {
			r = a[i]
		}
	}
	return r
}
func sum(a []int) (r int) {
	for i := range a {
		r += a[i]
	}
	return r
}
func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

type Pair struct {
	a, b int
}

type Pairs []Pair

func (p Pairs) Len() int {
	return len(p)
}
func (p Pairs) Swap(i, j int) {
	p[i], p[j] = p[j], p[i]
}

func (p Pairs) Less(i, j int) bool {
	if p[i].a == p[j].a {
		return p[i].b < p[j].b
	}
	return p[i].a < p[j].a
}


Measured memory_bytes: 1860
from bisect import bisect_left, bisect_right

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort()
C.sort()
ans = 0
for i in range(0, N):
    ans += (bisect_left(A, B[i])*(N-bisect_right(C, B[i])))
print(ans)


Measured memory_bytes: 23360
while True:
    n = int(input())
    if not(n): break
    flag = [True]*(n*2+1)
    flag[0] = flag[1] = False
    for i in range(2,int(n*2**0.5)+1):
        if flag[i]:
            for j in range(i**2, n*2+1, i):
                flag[j] = False
    print(flag[n+1:].count(True))

Measured memory_bytes: 11324
/* Generated by powerful Codeforces Tool
 * You can download the binary file in here https://github.com/xalanq/cf-tool (Windows, macOS, Linux)
 * Author: alireza_kaviani
 * Time: 2020-05-19 21:38:36
**/
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;

template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

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

#define all(x)                      (x).begin(),(x).end()
#define Sort(x)                     sort(all((x)))
#define X                           first
#define Y                           second
#define sep                         ' '
#define endl                        '\n'
#define SZ(x)                       ll(x.size())

ll poww(ll a, ll b, ll md) {
    return (!b ? 1 : (b & 1 ? a * poww(a * a % md, b / 2, md) % md : poww(a * a % md, b / 2, md) % md));
}

const ll MAXN = 1e5 + 10;
const ll LOG = 22;
const ll INF = 8e18;
const ll MOD = 1e9 + 7; // 998244353; // 1e9 + 9;

int n , m , cnt , fen[MAXN] , ans[MAXN];
vector<pii> Q[MAXN];

void add(int x , int val){
    for( ; x < MAXN ; x += x & -x)  fen[x] += val;
}

int get(int x){
    int ans = 0;
    for( ; x > 0 ; x -= x & -x) ans += fen[x];
    return ans;
}

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

    cin >> n >> m;
    for(int i = 0 , l , r ; i < n ; i++){
        cin >> l >> r;
        Q[r - l + 1].push_back({l , r});
    }

    for(int i = 1 ; i <= m ; i++){
        for(pii j : Q[i])   add(j.X , 1) , add(j.Y + 1 , -1) , cnt++;
        for(int j = i ; j <= m ; j += i)    ans[i] += get(j);
        ans[i] += n - cnt;
    }
    for(int i = 1 ; i <= m ; i++)   cout << ans[i] << endl;

    return 0;
}
/*

*/


Measured memory_bytes: 8448
import math

# inputList=[]
# for i in range(6):
#     inputNum = input()
#     inputList.append(inputNum)
inputa = input().split()
# inputb = input().split()

# inputa = [int(n) for n in inputa]
# inputa.sort()

a = int(inputa[0])
b = int(inputa[1])
# c = int(inputa[2])

# x = int(inputb[0])
# y = int(inputb[1])

print(a - b + 1)

Measured memory_bytes: 38256
#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
#define rep(i,n) for(int i = 0; i < ((int)(n)); i++)   // 0-indexed昇順
#define INF 1<<29

using Graph = vector<vector<int>>;
Graph d;

void warshall_floyd(int V) {
    rep(k,V)
        rep(i,V)
            rep(j,V) d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
}

int main() {
    int N, M, R; cin >> N >> M >> R;
    d.assign(N, vector<int>(N, INF));
    rep(i,N) d[i][i] = 0;
    vector r(R, 0);
    rep(i,R) {
        int n; cin >> n; n--;
        r.at(i) = n;
    }
    sort(r.begin(), r.end());

    rep(i, M) {
        int a, b, c; cin >> a >> b >> c;
        a--, b--;
        if (d[a][b] > c) {
            d[a][b] = d[b][a] = c;
        }
    }
    
    warshall_floyd(N);

    ll mi = INT64_MAX;
    do {
       ll c = 0;
       rep(i, R-1) c += d[r[i]][r[i+1]];
       mi = min(mi, c);
    } while(next_permutation(r.begin(), r.end()));

    cout << mi << endl;

}


Measured memory_bytes: 3812
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <vector>
using namespace std;
#define REP(i, n) for(int (i)=0; (i)<(n); (i)++)
#define OUT(a) cout << (a) << "\n";

int main() {
    string x;
    cin >> x;
    int s,e;
    for(int i=0;i<x.length();i++) if(x[i]=='A') {
        s=i; break;
    }
    for(int i=x.length()-1;i>=0;i--) if(x[i]=='Z') {
        e=i+1; break;
    }
    OUT(e-s)
    return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
typedef long long ll;
using namespace std;
const ll mod=1000000007;
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;

int main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    ll n,k;
    cin>>n>>k;
    ll ans=k;
    ans*=pow(k-1,n-1);
    cout << ans <<endl;
    return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <vector>
#include <utility>
using namespace std;
#define MAXSIZE 1e5
#define MAXL 100
typedef long long int lli;

int main(){
    int n, q;
    cin >> n >> q;
    string s;
    cin >> s;
    vector<int> countAC(s.length(), 0);
    for(int i = 1; s[i] != '\0'; ++i){
        if(s.substr(i - 1, 2) == "AC"){
            countAC[i] = countAC[i - 1] + 1;
        }else{
            countAC[i] = countAC[i - 1];
        }
        //printf("countAC[%d] = %d\n", i, countAC[i]);
    }
    
    vector<pair<int, int>> lr;
    for(int i = 0; i < q; ++i){
        pair<int, int> lr_input;
        cin >> lr_input.first >> lr_input.second;
        lr.push_back(lr_input);
        //cout << (countAC[r - 1] - countAC[l - 1]) << endl;
    }

    for(int i = 0; i < q; ++i){
        cout << (countAC[lr[i].second - 1] - countAC[lr[i].first - 1]) << endl;
    }
    //lmax = max(l, lmax);
    //char ans = (b == 'A')? 'T' : (b == 'T')? 'A' : (b == 'C')? 'G' : 'C';
    //cout << ans << endl;
    //cout << lmax << endl;
    return 0;
}

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

int main(){
  int A,B;
  cin>>A>>B;
  if(A>12){
    cout<<B<<endl;
    return 0;
  }
  if((5<A)&&(13>A)){
    cout<<B/2<<endl;
    return 0;
  }
  cout<<0<<endl;
  return 0;

}

  


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

const int N=1e5+5;


int n,x,y,cur[N],ans;

int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>x>>y;
        cur[x]++;
        cur[y+1]--;
    }
    for(int i=1;i<N;i++){
        cur[i]+=cur[i-1];
        if(cur[i]){
            ans++;
        }
    }
    cout<<ans;
}


Measured memory_bytes: 640
# include "cstdio" 

using namespace std;

int
	d,
	n;
	
long long
	mul=1ll; 

int main(){
	scanf("%d%d",&d,&n);	 
	register int i;
	for(i=1;i<=d;i++){
		mul*=100; 
	}
	printf("%lld",(n+(n==100))*mul);
	return 0; 
} 

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

int main(){
  int N ; 
  cin >> N ; 
  vector<int> h(N+1) ; 
  int cnt = 105 ; 
  for(int i = 1 ; i < N+1 ; i++ ){
    cin >> h.at(i) ; 
    cnt = min(cnt , h.at(i)) ; 
  }
  h.at(0) = cnt ; 
  
  int ans = 0 ; 
  for(int i = 1 ; i < N+1 ; i++){
    if(h.at(i) > cnt && h.at(i) -  max(cnt , h.at(i-1)) > 0){
      ans += h.at(i) -  max(cnt , h.at(i-1)) ; 
    }
  }
  cout << ans + cnt<< endl ; 
}

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

def labeling(A):
    # ラベル数は9
    label = [0] * 9
    
    for i in A:
        if (0 <= i) and (i < 400):
            label[0] += 1
        elif (400 <= i) and (i < 800):
            label[1] += 1
        elif (800 <= i) and (i < 1200):
            label[2] += 1
        elif (1200 <= i) and (i < 1600):
            label[3] += 1
        elif (1600 <= i) and (i < 2000):
            label[4] += 1
        elif (2000 <= i) and (i < 2400):
            label[5] += 1
        elif (2400 <= i) and (i < 2800):
            label[6] += 1
        elif (2800 <= i) and (i < 3200):
            label[7] += 1
        else:
            label[8] += 1

    return label

label = labeling(A)
label_number = 0

for i in range(len(label)-1):
    if label[i] > 0:
        label_number += 1

print(max(label_number, 1), min(100000000000, (label_number+label[-1])))


Measured memory_bytes: 3064
N,M=map(int,input().split())
def f(a,r,c):
  return (a/(1-r)+(a*r)/(1-r)**2)*c

a=1/2**M
r=(2**M-1)/2**M
c=1900*M+100*(N-M)

print(int(f(a,r,c)))

Measured memory_bytes: 9088
#include <bits/stdc++.h>
using namespace std;
 
/*** Template Begins ***/
 
typedef long long   ll;
typedef pair<ll,ll> pll;
typedef long double ld; 
#define rep(i,a,b) for(i=a;i<b;i++)
#define pb           push_back
#define F            first
#define S            second
#define ios          ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define hell   1000000007LL
#define all(a)       (a).begin(),(a).end()
ll power(ll x, ll y, ll p){ ll res = 1;x = x % p;while (y > 0) {if (y & 1) res = (res*x) % p;y = y>>1;
  x = (x*x) % p;} return res;} 

const long double PI = acos(-1);
// Debug //
#define trace(x)                 cerr << #x << ": " << x << endl;
#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;
ll euclid(ll x,ll y,ll a,ll b){
  return (a-x)*(a-x)+(b-y)*(b-y);
}
void solve()
{
  char c;
  cin>>c;
  if(c>='a' && c<='z')
    cout<<'a';
  else
    cout<<'A';
}
int main()
{ 
  ios; 
  // freopen("input.txt", "r", stdin);
  // freopen("output.txt", "w", stdout);
  ll t=1,i=1;
  // sieve();
  // cin>>t;
  while(i<=t)
  {
    solve();
    i++;
  }
  return 0;
}


Measured memory_bytes: 3608
#include <iostream>

int n,m,q,x[510][510],c[510][510];
int main(){
  std::cin>>n>>m>>q;
  for(int i=0;i<m;++i){
    int l,r;
    std::cin>>l>>r;
    ++x[l][r];
  }
  for(int i=1;i<=n;++i)
    for(int j=0;j<n;++j)
      c[i][j+1]=c[i][j]+x[i][j+1];
  for(int i=0;i<q;++i){
    int l,r;
    std::cin>>l>>r;
    int sum=0;
    for (int j = l; j <= r; j++)
      sum += c[j][r] - c[j][l - 1];
    std::cout<<sum<<std::endl;
  }
  return 0;
}


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

int main(){
  string S;
  bool b = true;
  cin >> S;
  for(int i=0;i<S.size();i+=2){
    if(S.size()%2==1)
      b=false;
    else if(S.at(i)!='h'||S.at(i+1)!='i')
      b = false;
  }
  if(b)
    cout << "Yes";
  else
    cout << "No";
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main() {
    int k, s;
    cin >> k >> s;
    
    int ret = 0;
    for (int i = 0; i <= k; i++) {
        if (i > s)  break;

        for (int j = 0; j <= k; j++) {
            if (i + j > s)  break;
            if (s - (i + j) <= k)   ret++;
        }
    }

    cout << ret << endl;

    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
int n,m,p,d,c[31][10],np,i,j,g[31][11];

int main()
{
	for(;~scanf("%d%d%d%d",&n,&m,&p,&d),n;)
	{
		memset(g,0,sizeof(g));
		memset(c,0,sizeof(c));
		for(i=0;i<d;i++)
			for(j=1;j<n;j++)
				scanf("%1d",&c[i][j]);
		for(g[d][p]=1,i=d,np=p;i>0;i--)
		{
			if(np>1&&c[i-1][np-1])
				g[i-1][--np]=1;
			else if(np<n&&c[i-1][np])
				g[i-1][++np]=1;
			else
				g[i-1][np]=1;
		}
		if(g[0][m]==1)
		{
			puts("0");continue;
		}
		for(i=0,np=m;i<d;i++)
		{
			if(c[i][np-1])
				np--;
			else if(c[i][np])
				np++;
			else if(g[i+1][np-1]&&!c[i][np-2])
			{
				printf("%d %d\n",i+1,np-1);
				break;
			}
			else if(g[i+1][np+1]&&!c[i][np+1])
			{
				printf("%d %d\n",i+1,np);
				break;
			}
		}
		if(i==d)
			puts("1");
	}
	return 0;
}

Measured memory_bytes: 612
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
const int maxn=1e5+10;
const ll mod=20180623;
int main(){
    ll x,k,d;
    cin>>x>>k>>d;
    x=abs(x);
    ll temp=x/d;
    if(abs(x-(temp+1)*d)>x-temp*d){
        if(k<=temp){
            cout<<x-d*k;
        }else{
            x-=d*temp;
            k-=temp;
            if(k&1){
                cout<<abs(x-d);
            }else{
                cout<<abs(x);
            }
        }
    }else{
        if(k<=temp+1){
            cout<<abs(x-d*k);
        }else{
            x-=d*(temp+1);
            k-=temp+1;
            if(k&1){
                cout<<x+d;
            }else{
                cout<<abs(x);
            }
        }
    }
    return 0;
}


Measured memory_bytes: 3620
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <numeric>
#include <map>
#include <iomanip>
#include <limits.h>

using namespace std;    
typedef long long ll;
typedef pair<ll, ll> pll;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
const bool DEBAG = false;

int main(){

    int n;
    cin >> n;

    if(n % 2){
        cout << 1.0 * (n / 2 + 1) / n << endl; 
    }
    else{
        cout << 0.5 << endl;
    }


}

Measured memory_bytes: 764
uses math;
var f,a:array[-1..10,0..1020] of longint;
var n,i,j:longint;
begin
  read(n);for i:=1 to 2 do for j:=1 to n do
  begin read(a[i,j]);f[i,j]:=max(f[i-1,j],f[i,j-1])+a[i,j];end;
  writeln(f[2,n]);
end.

Measured memory_bytes: 256
x1, y1, x2, y2 = map(int,input().split())
deltax = x2 - x1
deltay = y2 - y1
x3 = x2 - deltay
y3 = y2 + deltax
x4 = x1 - deltay
y4 = y1 + deltax
print(x3, y3, x4, y4)

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


int main() {
    int n;
    std::cin >> n;

    int p0, p1, p2;
    int count = 0;
    std::cin >> p0 >> p1;
    for (int i = 2; i < n; i++) {
        std::cin >> p2;
        if (p0 <= p1 && p1 < p2) {
            count++;
        } else if (p2 <= p1 && p1 < p0) {
            count++;
        }
        p0 = p1;
        p1 = p2;
    }
    std::cout << count << std::endl;
}


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

using namespace std;

int main(){
	int n,k;
	cin >> n >> k;
	
	vector<int> x;
	for(int i = 0;i < n;i++){
		int tx;
		cin >> tx;
		x.push_back(tx);
	}
	
	int l,r;
	int ans = 1e9;
	for(int i = 0;i < n - k + 1;i++){
		l = i;
		r = l + k - 1;
		if(abs(x[l]) <= abs(x[r])){
			ans = min(ans,abs(x[l]) + abs(x[l] - x[r]));
		}else{
			ans = min(ans,abs(x[r]) + abs(x[l] - x[r]));
		}
	}
	
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 892
#include<stdio.h>
#include<stdlib.h>
int f[1000005]={0},i,n,q,a,v,ra=0;


int main()
{
	scanf("%d%d",&n,&q);
	for(;q--;)
	{
		scanf("%d%d",&a,&v);
		f[a]+=v;
		if(v>0&&(f[ra]<f[a]||f[ra]==f[a]&&ra>a))
			ra=a;
		else if(a==ra)
		{
			for(i=ra=n;i>0;i--)
				if(f[ra]<=f[i])
					ra=i;
		}
		printf("%d %d\n",ra,f[ra]);
	}
	return 0;
}

Measured memory_bytes: 4500
#include<stdio.h>
int main(void)
{
         int a,b,c,d,e,f,g,h,i,j,x;
		 scanf("%d",&a);
		 scanf("%d",&b);
		 scanf("%d",&c);
		 scanf("%d",&d);
		 scanf("%d",&e);
		 scanf("%d",&f);
		 scanf("%d",&g);
		 scanf("%d",&h);
		 scanf("%d",&i);
		 scanf("%d",&j);
		 x = a + b + c + d + e + f + g + h + i + j;
		 printf("%d\n",x);
		 return 0;
}

Measured memory_bytes: 1028
package main

import "fmt"

func main() {
	var a, b int
	fmt.Scan(&a, &b)
	var res = abc086A(a, b)
	fmt.Println(res)
}

func abc086A(a, b int) string {
	var res string
	if a*b%2 == 0 {
		res = "Even"
	} else {
		res = "Odd"
	}
	return res
}

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

using namespace std;

#define ll long long
#define ld long double
#define io ios_base::sync_with_stdio(false); cin.tie(NULL)
  
int main() 
{ 
   string s;
   cin >> s;
   if(s[2]==s[3] && s[4]==s[5])
   {
       cout << "Yes";
   } 
   else
   {
       cout << "No";
   }
   
   return 0;
} 
    


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

const int N = 1e5 + 1;
int c[N];
int t0[N], t1[N];

int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  int n, m;
  cin >> n >> m;
  for(int i = 0; i < n; i++) {
    int x; cin >> x; c[x]++;
  }
  for(int i = 1; i < N; i++) {
    t1[i % m] += c[i] / 2 * 2;
    t0[i % m] += c[i] % 2;
  }
  int ans = 0;
  for(int i = 0; i < m; i++) {
    int ii = (m - i) % m;
    if(i == ii) {
      ans += (t0[i] + t1[i]) / 2;
      continue;
    }
    int p = min(t0[i] + t1[i], t0[ii] + t1[ii]);
    ans += p;
    t1[i] -= max(0, p - t0[i]);
    t0[i] = 0;
    t1[ii] -= max(0, p - t0[ii]);
    t0[ii] = 0;
    ans += t1[i]/2;
    t1[i] = 0;
    ans += t1[ii]/2;
    t1[ii] = 0;
  }
  cout << ans << endl;
}


Measured memory_bytes: 1408
n = int(input())
a = list(map(int,input().split()))
f = 0
t = 0
for ai in a:
  if ai%4 == 0:
    f += 1
  elif ai%2 == 0:
    t += 1
e = n-f-t
if t == 0:
  if f+1 >= e:
    print("Yes")
  else:
    print("No")
else:
  if f >= e:
    print("Yes")
  else:
    print("No")
    

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

int main(){
  int a,b,c;
  long long k;
  cin >> a >> b >> c >> k;
  
  if (abs(b-a)>1e18){
    puts("Unfair");
  }
  else if (k==0||k%2==0){
    cout << (a-b) << endl;
  }
  else {
    cout << (b-a) << endl;
  }
}


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

N, A, B, C = map(int, input().split())

ans = []
ans_append = ans.append

S = [str(input()) for _ in range(N)]

for i in range(N):
    s = S[i]
    if s == 'AB\n':
        if A == B == 0:
            print ('No')
            exit()
        elif A == 0:
            A += 1
            B -= 1
            ans_append('A')
        elif B == 0:
            B += 1
            A -= 1
            ans_append('B')
        elif A * B > 0:
            if i == N - 1:
                A += 1
                B -= 1
                ans_append('A')
            else :
                if S[i + 1] == 'BC\n':
                    B += 1
                    A -= 1
                    ans_append('B')
                elif S[i + 1] == 'AC\n':
                    A += 1
                    B -= 1
                    ans_append('A')
                else:
                    if A < B:
                        A += 1
                        B -= 1
                        ans_append('A')
                    else:
                        B += 1
                        A -= 1
                        ans_append('B')

    elif s == 'BC\n':
        if B == C == 0:
            print ('No')
            exit()
        elif B == 0:
            B += 1
            C -= 1
            ans_append('B')
        elif C == 0:
            C += 1
            B -= 1
            ans_append('C')
        elif B * C > 0:
            if i == N - 1:
                B += 1
                C -= 1
                ans_append('B')
            else:
                if S[i + 1] == 'AB\n':
                    B += 1
                    C -= 1
                    ans_append('B')
                elif S[i + 1] == 'AC':
                    C += 1
                    B -= 1
                    ans_append('C')
                else:
                    if B < C:
                        B += 1
                        C -= 1
                        ans_append('B')
                    else:
                        C += 1
                        B -= 1
                        ans_append('C')

    else: #AC
        if C == A == 0:
            print ('No')
            exit()
        elif A == 0:
            A += 1
            C -= 1
            ans_append('A')
        elif C == 0:
            C += 1
            A -= 1
            ans_append('C')
        elif A * C > 0:
            if i == N - 1:
                A += 1
                C -= 1
                ans_append('A')
            else:
                if S[i + 1] == 'AB\n':
                    A += 1
                    C -= 1
                    ans_append('A')
                elif S[i + 1] == 'BC\n':
                    C += 1
                    A -= 1
                    ans_append('C')
                else:
                    if A > C:
                        C += 1
                        A -= 1
                        ans_append('C')
                    else:
                        A += 1
                        C -= 1
                        ans_append('A')
    # print (A, B, C)

print ('Yes')
print (*ans, sep = '\n')

Measured memory_bytes: 18512
z[9][101][101];n,m,t,c,b,*p;char*f="%d%d%d%d\n";main(a){for(;scanf(f+4,&n,&m)*n;){for(memset(z,9,9e4);n--;z[0][a][b]=z[0][b][a]=c)scanf(f,&a,&b,&c,&t),z[1][a][b]=z[1][b][a]=t;for(t=++m;--t;)for(c=m;--c;)for(b=m;--b;)for(a=2;a--;p[c]=fmin(p[c],p[t]+z[a][t][c]))p=z[a][b];for(scanf(f+6,&n);n--;printf(f+6,z[a][b][c]))scanf(f+2,&c,&b,&a);}}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#include <cmath>
#include <numeric>
using namespace std;
#define rep(i,a,b) for(int64_t i=(a); i<(b); ++i) // a ≦ i < b 
#define Rrep(i,a,b) for(int64_t i=(a);i>=(b);--i) // reverse repeat. a から b まで減少．
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend() //逆イテレータ
#define RANGE(a,b,c) (a).begin()+b,(a).begin()+c // コンテナ a の 要素 b から c へのイテレータ
#define MOD 1000000007
#define INF 1000000000000
typedef pair<int64_t, int64_t> PII;
typedef vector<int64_t> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef vector<PII> VP;

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

int64_t N, K; cin >> N >> K;
VI h(N); rep(i, 0, N) cin >> h[i];

sort(ALL(h));

int64_t mini = INF;
rep(i, 0, N-K+1){
    mini = min(mini, h[i + K - 1] - h[i]);
}
cout << mini << endl;

}

// 書いて考える
// 境界，出力文字列 チェック
// 可読性優先．高速化次点．
// まずは全探索，分割統治，次にDP
// 制限を見る．境界に注意．求めたい量の変域．
// 偶奇，逆から，ソート，出現回数，出現位置，DP， 余事象，包除
// データ構造． 問題の特徴量．単調性，二分探索
// 存在判定：構成方法，入力の特徴
// gcd, lcm ,素因数分解．
// 例外を十分に含む一般化．想像力の限界
// 小さい系から例示
// 代数的処理
// 始めは過剰に例示・場合分けしてもいい．各場合を確実に対処．
// 自明な例から処理，除外．
// 小数のときは，精度の設定する．doubel 変数に数値を入力するときは 123. とする．
// テストケース作成は数表あり



Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define READ freopen("in.txt","r",stdin)
#define WRITE freopen("out.txt","w",stdout);
#define pb push_back
#define mem(arr,val) memset(arr,val,sizeof(arr))
#define sf(x) scanf("%d",&x)
#define sf2(x,y) scanf("%d %d",&x,&y)
#define sf3(x,y,z) scanf("%d %d %d",&x,&y,&z)
#define sl(x) scanf("%lld",&x)
#define sl2(x,y) scanf("%lld %lld",&x,&y)
#define sl3(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)
#define sd(x) scanf("%lf",&x);
#define pii pair<int,int>
#define pLL pair<long long,long long>
#define ff first
#define sn second
#define PRINT_CASE  printf("Case %d: ",tc++)
#define PRINT_CASENL  printf("Case %d:\n",tc++)
#define mx 100005
#define lnd tree[ind<<1]
#define rnd tree[(ind<<1)+1]
#define cnd tree[ind]
#define lndp b,(b+e)>>1,(ind<<1)
#define rndp ((b+e)>>1)+1,e,(ind<<1)+1
#define IN(a,x,y) (a>=x && a<=y)
typedef long long ll;
typedef long long int lln;
ll INF=1<<28;
//typedef long long lld;
const double pi=acos(-1.0);
int fx[]={1,-1,0,0}; //direction array
int fy[]={0,0,1,-1};
int dir[4][2]={1,0,-1,0,0,-1,0,1};
const long double EPS=1e-7;
//#define INF 10000
ll gcd(ll a,ll b)
{
    if(b==0)
        return a;
    else
        return gcd(b,a%b);
}
ll lcm(ll a,ll b)
{
    return a/gcd(a,b)*b;
}

bool cmp(int a, int b)
{
    return a<b;
}

int vis[200000];
struct compare
{
  bool operator()(const int& l, const int& r)
  {
      return vis[l]>vis[r];
  }
};
ll inf=1e18;
int mod=1e9+7;
const int sz=300005;
ll tree[4*sz];
void update(int b,int e,int ind,int st,int en,ll val)
{
    if(b>=st && e<=en)
    {
        cnd+=val;
        return;
    }
    if(st>e || en<b)
    {
        return;
    }
    update(lndp,st,en,val);
    update(rndp,st,en,val);
    cnd=max(lnd,rnd);
}
ll query(int b,int e,int ind,int st,int en)
{
    if(st>e || en<b)
    {
        return -inf;
    }
    if(b>=st && e<=en)
    {
        return cnd;
    }
    ll l=query(lndp,st,en);
    ll r=query(rndp,st,en);
    return max(l,r);
}
int h[sz],a[sz];
int main()
{
//    READ;
    int n;
    sf(n);
    int maxx=0;
    for(int i=0;i<n;i++)
    {
        sf(h[i]);
        maxx=max(maxx,h[i]);
    }
    for(int i=0;i<n;i++)
    {
        sf(a[i]);
    }
    ll x,val;
    ll ans=0;
    for(int i=n-1;i>=0;i--)
    {
        x=query(1,maxx,1,h[i],maxx);
        ans=max(x+a[i],ans);
        update(1,maxx,1,h[i],h[i],x+a[i]);
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 7936
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

#define watch(x) cout<<(#x)<<"="<<(x)<<'\n'
#define mset(d,val) memset(d,val,sizeof(d))
#define setp(x) cout<<fixed<<setprecision(x)
#define forn(i,a,b) for(int i=(a);i<(b);i++)
#define fore(i,a,b) for(int i=(a);i<=(b);i++)
#define pb push_back
#define F first
#define S second
#define pqueue priority_queue
#define fbo find_by_order
#define ook order_of_key
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef long double ld;
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> pbds;
void amin(ll &a, ll b){ a=min(a,b); }
void amax(ll &a, ll b){ a=max(a,b); }
void YES(){cout<<"YES\n";} void NO(){cout<<"NO\n";}
void SD(int t=0){ cout<<"PASSED "<<t<<endl; }
const ll INF = ll(1e18);
const int MOD = 998244353;

const bool DEBUG = 0;
const int MAXN = 100005;

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	
	string s; cin>>s;
	if(s.back()!='s') s+='s';
	else s+="es";
	cout<<s<<'\n';
	
	return 0;
}


Measured memory_bytes: 3608
#include <bits/stdc++.h>
using namespace std;
int main(){
    int s_size;
    string s, ans;
    cin >> s;
    s_size = s.length();
    for(int i=0; i < s_size; i++){
        if(s[i] == '0'){
            ans += '0';
        }else if(s[i] == '1'){
            ans += '1';
        }else{
            if(ans.empty() == false){
                ans.pop_back();
        }
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <list>
#include <set>
#include <stack>
#include <string>
#include <queue>

using namespace std;

int main() {
    int N;
    int X[200000], Y[200000];

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

    sort(X, X + N);

    int a = X[N / 2 - 1], b = X[N / 2];

    for(int i = 0; i < N; i++) {
        if(Y[i] <= a) cout << b << endl;
        else cout << a << endl;
    }
}

Measured memory_bytes: 3712