akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <cmath>
#include <cstring>
#include <iostream>
#include <algorithm>

#define MAXN 1005

using namespace std;

int n, x, a[MAXN];

int main()
{

    //freopen("a.txt", "r", stdin);

    while (cin >> n >> x) {

        for (int i = 0; i < n; i++)
            scanf("%d", a + i);
        //printf("n = %d\n", n);
        int ans = 0;
        sort(a, a + n);
        for (int i = 0; i < n; i++) {
            int tmp = min(a[i], x);
            x -= tmp;
            if (tmp == a[i])
                ans++;
        }
        if (x > 0)
            ans--;
        cout << ans << endl;
    }

    return 0;
}


Measured memory_bytes: 256
import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int a, b;
        
        a = sc.nextInt();
        b = sc.nextInt();
        
        if(a < b){
            System.out.println("a < b");
        }
        else if(a > b) {
            System.out.println("a > b");
        }
        else {
            System.out.println("a == b");
        }
    }
}


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

using ll = long long int;

ll N;
ll d[] = {3,5,7};

int rec(ll x){
    if(x > N) return 0;
    
    int res = 0;
    for(int i=0;i<3;i++){
        res += rec(x*10+d[i]);
    }
    bool used[3]={};
    while(x > 0){
        for(int i=0;i<3;i++){
            if(x%10 == d[i]) used[i] = true;
        }
        x /= 10;
    }
    if(used[0] && used[1] && used[2]) res++;
    return res;
}

int main(){
    cin >> N;
    cout << rec(0) << endl;
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	int x, y, z, n,a;
	scanf("%d%d%d", &x, &y, &z);
	n = 1;
	while (1){
		int tmp;
		tmp = (n*y + (n - 1)*z + 2*z);
		a = tmp;
		if (tmp >= x) break;
		else n++;
	}
	if (a > x) n = n - 1;
	printf("%d\n", n);
	return 0;
}

Measured memory_bytes: 128
n = list(reversed(input()))
k = int(input())
dp1 = [1] + [0] * 3
dp2 = [1] + [0] * 3
for i in range(len(n)):
    newdp1 = [0] * 4
    newdp2 = [0] * 4
    for j in range(4):
        newdp2[j] += dp2[j]
        if j > 0:
            newdp2[j] += dp2[j - 1] * 9
        d = int(n[i])
        if d == 0:
            newdp1[j] += dp1[j]
        else:
            newdp1[j] += dp2[j]
        if j > 0:
            if d > 0:
                newdp1[j] += dp1[j - 1]
                newdp1[j] += dp2[j - 1] * (d - 1)
    dp1 = newdp1
    dp2 = newdp2
print(dp1[k])


Measured memory_bytes: 62188
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_poizcy.hpp>
typedef long long  ll;
#define pb                push_back
#define mp                make_pair
#define all(a)            (a).begin(), (a).end()
#define mem(a,h)          memset(a, (h), sizeof(a))
#define fi first
#define se second
#define por(a,b) (((a%MOD) * (b%MOD))%MOD)
#define forg(i, b, e, c)    for (ll i = (ll)b; i < (ll)e; i+=c)
#define forr(i, b, e)    for (ll i = b; i < e; i++)
 
 
using namespace std;
//using namespace __gnu_pbds;
typedef double lldb;
typedef pair<int, int>  ii;
typedef pair<double, double>  iidb;
typedef pair<int, ii>  iii;
typedef vector<ll>     vi;
typedef vector<vi>     vvi;
typedef vector<ii>      vii;
typedef vector<ll>      vll;
//typedef tree<ii,null_type,less<ii>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
const ll INF = 1e9+7;
const double PI = acos(-1);
#define initseg ll new_nodo=(pnodo*2),mid=(iz+der)/2;
 
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define tam 1010000
#define offset 3000
#define ptr nodo*


using namespace std;
vector<int> vect[tam];int v[tam];
int main()
{
	int n;
	cin>>n;
	forr(i,0,n)
	{
		cin>>v[i];
		if (v[i]%4==0)
			vect[2].pb(v[i]);
		else if (v[i]%2==0)
			vect[1].pb(v[i]);
		else
			vect[0].pb(v[i]);

	}
	if (vect[0].size()<=vect[2].size()|| (vect[2].size()+1==vect[0].size() && vect[1].size()==0))
	{
		cout<<"Yes\n";
	}
	else	cout<<"No\n";
	
}

Measured memory_bytes: 28156
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <string>

#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;

using namespace std;



int inputValue(){
    int a;
    cin >> a;
    return a;
};

void inputArray(int * p, int a){
    rep(i, a){
        cin >> p[i];
    }
};

void inputVector(vector<int> * p, int a){
    rep(i, a){
        int input;
        cin >> input;
        p -> push_back(input);
    }
}

template <typename T>
void output(T a, int precision) {
    if(precision > 0){
        cout << setprecision(precision)  << a << "\n";
    }
    else{
        cout << a << "\n";
    }
}

int main(int argc, const char * argv[]) {
    
    // source code
    int A,B;

    cin >> A ;
    cin >> B ;
    if(A <= 8 && B <= 8)
        cout << "Yay!" << endl;
    else
        cout << ":(" << endl;
    return 0;
}

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

using namespace std;

int main(){
  int W, H, N;
  int x, y, a;
  int xmax, xmin, ymax, ymin;

  cin >> W >> H >> N;
  xmax = W;
  ymax = H;
  xmin = 0;
  ymin = 0;

  for(int i = 0;i < N;i++){
    cin >> x >> y >> a;
    if(a==1){
      xmin = max(x, xmin);
    }else if(a==2){
      xmax = min(x, xmax);
    }else if(a==3){
      ymin = max(y, ymin);
    }else{
      ymax = min(y, ymax);
    }
  }

  if((xmax-xmin) < 0 || (ymax-ymin) < 0){
    cout << 0 << endl;
  } else {
    cout << (xmax-xmin) * (ymax-ymin) << endl;
  }

  return 0;
}


Measured memory_bytes: 256
N, X = map(int, input().split())
l_list = list(map(int, input().split()))

ans = 0
z = 0
pr = 0
for i in range(N+1):
    if i >= 1:
        z = l_list[i-1] + pr
    if z <= X:
        ans += 1
    pr = z
print(ans)


Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <functional>
#include <algorithm>
#include <cmath>
#include<bits/stdc++.h>
using namespace std;

int main(){
    int n;
    string s;
    cin >> n;
    cin >> s;
    vector<string> ans(4);
    s += s.substr(0,2);
    string x1,x2;
    for(int i=1; i<n+1; i++){
        if(s[i-1]=='o'){
            if(i==1){
                ans[0] += "WSW";
                ans[1] += "SSS";
                ans[2] += "SWW";
                ans[3] += "WWS";
            }else{
                for(int j=0; j<4; j++){
                    x1 = ans[j][i-1];
                    x2 = ans[j][i];
                    if(x1==x2){
                        ans[j] += "S";
                    }else{
                        ans[j] += "W";
                    }
                    
                }
            }
        }else{
            if(i==1){
                ans[0] += "SSW";
                ans[1] += "WSS";
                ans[2] += "SWS";
                ans[3] += "WWW";
            }else{
                for(int j=0; j<4; j++){
                    x1 = ans[j][i-1];
                    x2 = ans[j][i];
                    if(x1==x2){
                        ans[j] += "W";
                    }else{
                        ans[j] += "S";
                    }
                    
                }
            }

        }
    }
    for(int i=0; i<4; i++){
        if(ans[i].substr(0,2) == ans[i].substr(n,n+1)){
            cout << ans[i].substr(1,n) << endl;
            exit(0);
        }
    }
    cout << -1 << endl;
}

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

typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;

#define pb push_back
#define rep(i, a, n) for(int i = (a); i < (n); i++)
#define dep(i, a, n) for(int i = (a); i >= (n); i--)
#define mod (ll)1e9+7

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

signed main() {
  int n;
  cin >> n;
  int a[200005];
  rep(i, 0, n) cin >> a[i];

  if(n % 2) {
    for(int i = n - 1; i >= 0; i -= 2) cout << a[i] << " ";
    for(int i = 1; i < n; i += 2) cout << a[i] << " ";
  }else {
    for(int i = n - 1; i >= 0; i -= 2) cout << a[i] << " ";
    for(int i = 0; i < n; i += 2) cout << a[i] << " ";
  }
}


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

typedef long long ll;
#define OO 1e9
using namespace std;
double dp[3001][3001];
int main(){
//  freopen("in.txt", "r", stdin);
//  freopen("out.txt", "w", stdout);
  int n;
  cin >> n;
  double p[n];
  for(int i = 0;i < n;i++)
    cin >> p[i];
  dp[0][1] = p[0];
  dp[0][0] = 1 - p[0];
  for(int i = 1;i < n;i++){
    for(int j = 0;j <= i + 1;j++){
      dp[i][j] = dp[i - 1][j] * (1 - p[i]);
      if(j)
        dp[i][j] += dp[i - 1][j - 1] * p[i];
    }
  }
  double res = 0;
  for(int i = n / 2 + 1;i <= n;i++)
    res += dp[n - 1][i];
  printf("%.10f", res);
}


Measured memory_bytes: 68864
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 24 20:49:55 2019

@author: Yamazaki Kenichi
"""

S = input()

ans = 0
counta = 0
for c in S:
    if c == 'A' or c == 'C' or c=='G' or c=='T':
        counta += 1
        ans = max(ans,counta)
    else:
        counta = 0
print(ans)
    

Measured memory_bytes: 2940
#include <iostream>
#include <vector>
#include <list>
#include <algorithm>
#include <set>
#include <queue>
#include <stack>
#include <string>
#include <sstream>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#define rep(i, n) for(int i = 0; i < n; i ++)
#define COUNT(i, n) for(int i = 1; i <= n; i ++)
#define ITER(c) __typeof((c).begin())
#define each(c, it) for(ITER(c) it =(c).begin(); it!=(c).end(); it++)
#define ALL(c) c.begin(), c.end()
#define mp make_pair
#define pb push_back
#define MEMSET(v, h) memset((v), h, sizeof(v))
 
using namespace std; 

typedef pair<int, int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;

const int INF = 1 << 24;
const int N = 1001;

int main(void){
    for(int m; cin >> m, m;){
        vi dp(N);
        dp[0] = 1;

        while(m --){
            int a, b; cin >> a >> b;
            for(int i = N - 1; 0 <= i; i --)
                if(dp[i])
                    COUNT(j, b)
                        if(i + a * j < N) dp[i + a * j] += dp[i];
        }

        int g; cin >> g;
        while(g --){
            int n; cin >> n;
            cout << dp[n] << endl;
        }
    }
 
    return 0;
}

Measured memory_bytes: 1196
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define sz(v) (ll((v).size()))
#define forn(i,n) for(ll i=0;i<(n);i++)
#define forr(i,n) for(ll i=(n)-1;i>=0;i--)
#define forv(i,v) forn(i,sz(v))
#define fors(i,s) for(auto i=(s).begin();i!=(s).end();++i)
#define all(v) (v).begin(),(v).end()
#define clr(x) memset(x,0,sizeof(x))
#define debug(x) cout<<"["#x<<": "<<x<<"] "
#define debugnl(x) cout<<"["#x<<": "<<x<<"]\n"

const ll mod =998244353 ;
const ll N = 1e5+5;

void add_self(ll &a, ll b){a+=b;if(a>=mod)a-=mod;}
void sub_self(ll &a, ll b){a-=b;if(a<0)a+=mod;}
void mul_self(ll &a, ll b){a*=b;a%=mod;}
void max_self(ll &a, ll b){if(b>a)a=b;}

ll power(ll a, ll x){ll ret=1;while(x){if(x%2)mul_self(ret,a);x/=2;mul_self(a,a);}return ret;}



int main()
{
    ios_base::sync_with_stdio(false);

	ll n;cin>>n;
	vector<ll> a(N),used(N,0),ans;
	forn(i,n)cin>>a[i];

	ll f=1;
	forn(rep,n)
	{
		ll pos=1,mx=-1,mx_pos=-1;
		forn(i,n)
		{
			if(used[i])continue;
			if(a[i]==pos)if(a[i]>mx){mx=a[i];mx_pos=i;}
			pos++;
		}
		if(mx==-1){f=-1;break;}
		used[mx_pos]=1;
		ans.pb(mx);
	}
	reverse(all(ans));
	if(f==-1)cout<<f<<endl;
	else {for(ll i:ans)cout<<i<<endl;}
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
    using namespace std;
     
    int n, k, mx, g;
     
    int main(){
    	scanf("%d%d", &n, &k);
    	for(int x; n--; ){
    		scanf("%d", &x);
    		mx = max(mx, x);
    		g = __gcd(g, x);
    	}
    	if(k > mx || k % g) printf("IM");
    	puts("POSSIBLE");
    }

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

N, D = rl()
ps = []
for i in range(N):
	x, y = rl()
	ps.append((x,y))

ans = 0
for x, y in ps:
	if x**2+y**2 <= D**2:
		ans += 1
print(ans)


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

int main(){
    int n,i=0;
    vector<int> vec;
    while(cin >> n,n){
        vec.push_back(n);
    }
    for(i = 0; i < vec.size(); i++){
        cout << "Case " << i+1 << ": " << vec.at(i) << endl;
    }
}


Measured memory_bytes: 3220
import java.util.*;

public class Main {

    private static final int INF = 1_000_000_000;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int H = sc.nextInt();
        int N = sc.nextInt();
        int[] A = new int[N];
        int[] B = new int[N];
        for (int i = 0; i < N; i++) {
            A[i] = sc.nextInt();
            B[i] = sc.nextInt();
        }

        int[][] dp = new int[N][H+1];
        for (int i = 0; i < N; i++) {
            for (int j = 0; j <= H; j++) {
                dp[i][j] = INF;
            }
        }

        int mins[] = new int[N];
        Arrays.fill(mins, INF);
        for (int j = 0; j <= H; j++) {
            int min = INF;
            for (int i = 0; i < N; i++) {
                if (j == 0) {
                    dp[i][j] = 0;
                }
                min = Math.min(min, dp[i][j]);
            }
            for (int i = 0; i < N; i++) {
                if (j+A[i] < H) {
                    dp[i][j+A[i]] = Math.min(dp[i][j+A[i]], min+B[i]);
                } else {
                    mins[i] = Math.min(mins[i],min+B[i]);
                }
            }
        }

        /*
        for (int i = 0; i < N; i++) {
            //for (int j = 0; j <= H; j++) {
                System.out.println(Arrays.toString(dp[i]));
            //}
        }
        System.out.println(Arrays.toString(mins));
        */


        int ans = INF;
        for (int i = 0; i < N; i++) {
            ans = Math.min(ans, mins[i]);
        }
        
        System.out.println(ans);
    }
}


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

using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;

unordered_map<ll,ll> um;
ll N,Q;
vector<ll> v;

int main(){
    cin >> N;
    for(int i=0;i<N;i++){
        ll tmp;
        cin >> tmp;
        um[tmp]++;
    }
    ll sum = 0;
    for(auto &e : um){
        sum += e.first * e.second;
    }
    cin >> Q;
    for(int i=0;i<Q;i++){
        ll b,c;
        cin >> b >> c;
        if(um.find(b) != um.end()){
            ll tmp = um[b];
            um[b] = 0;
            um[c] += tmp;
            sum += (c-b) * tmp;
        }
        v.push_back(sum);
    }
    for(auto &e : v) cout << e << endl;
    return 0;
}

Measured memory_bytes: 7660
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 6)
mod = 10**9+7
cnt = 1
ans = 0
inf = float("inf")
al = "abcdefghijklmnopqrstuvwxyz"
AL = al.upper()

a,b,c,d =I()

ans = max(a*c,a*d)
ans = max(ans,b*c)
print(max(ans,b*d))

Measured memory_bytes: 10500
n, m = map(int, input().split())
list_AB = [ list(map(int,input().split(" "))) for i in range(m)]
list_MAP = [0]*(n+1)

for l in list_AB:
    l.sort()
    if l[0] == 1:
        list_MAP[l[1]] += 1
    if l[1] == n:
        list_MAP[l[0]] += 1

ans = "IMPOSSIBLE"

for num in list_MAP:
    if num > 1:
        ans = "POSSIBLE"

print(ans)

Measured memory_bytes: 79960
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

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

pub trait LexicalPermutation {
    fn next_permutation(&mut self) -> bool;
    fn prev_permutation(&mut self) -> bool;
}

impl<T> LexicalPermutation for [T]
where
    T: Ord,
{
    fn next_permutation(&mut self) -> bool {
        if self.len() < 2 {
            return false;
        }
        let mut i = self.len() - 1;
        while i > 0 && self[i - 1] >= self[i] {
            i -= 1;
        }
        if i == 0 {
            return false;
        }
        let mut j = self.len() - 1;
        while j >= i && self[j] <= self[i - 1] {
            j -= 1;
        }
        self.swap(j, i - 1);
        self[i..].reverse();
        true
    }

    fn prev_permutation(&mut self) -> bool {
        if self.len() < 2 {
            return false;
        }
        let mut i = self.len() - 1;
        while i > 0 && self[i - 1] <= self[i] {
            i -= 1;
        }
        if i == 0 {
            return false;
        }
        self[i..].reverse();
        let mut j = self.len() - 1;
        while j >= i && self[j - 1] < self[i - 1] {
            j -= 1;
        }
        self.swap(i - 1, j);
        true
    }
}

fn main() {
    input! {
        a: usize,
        b: usize,
    }
    if a % 3 == 0 || b % 3 == 0 || (a + b) % 3 == 0 {
        println!("Possible");
    } else {
        println!("Impossible");
    }
}


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

using ll = long long;
static const ll MOD = 1e9 + 7;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  string s;
  cin >> s;
  
  vector<vector<ll>> x(s.size() + 1, vector<ll>(4));
  x.at(s.size()).at(0) = x.at(s.size()).at(1) = x.at(s.size()).at(2) = 0;
  x.at(s.size()).at(3) = 1;
  
  for(int i = s.size() - 1; i >= 0; i--){
    if(s.at(i) == '?') x.at(i).at(3) = x.at(i + 1).at(3) * 3;
    else x.at(i).at(3) = x.at(i + 1).at(3);
    x.at(i).at(3) %= MOD;
  }
  
  for(int i = s.size() - 1; i >= 0; i--){
    for(int j = 0; j < 3; j++){
      if(s.at(i) == '?') x.at(i).at(j) = x.at(i + 1).at(j) * 3;
      else x.at(i).at(j) = x.at(i + 1).at(j);
      if(s.at(i) == '?' || s.at(i) == 65 + j) x.at(i).at(j) += x.at(i + 1).at(j + 1);
      x.at(i).at(j) %= MOD;
    }
  }
  
  cout << x.at(0).at(0) << '\n';
}

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

int main(void) {
    string S;
    cin >> S;
    int N = S.size();
    int count0 = 0, count1 = 0;
    for (int i = 0; i < N; i++) {
        if (S.at(i) == '0') {
            count0++;
        } else {
            count1++;
        }
    }
    if (count0 <= count1) {
        cout << count0*2 << endl;
    } else {
        cout << count1*2 << endl;
    }
}

Measured memory_bytes: 512
N,K = map(int, input().split())
A = [int(a) for a in input().split()]

d = 50
L = [0]*d
for i in range(N):
    b = list(bin(A[i]))
    for j in range(2, len(b)):
        if b[j] == "1":
            L[len(b)-j-1] += 1

X0 = [0]*d
X1 = [0]*d
for i in range(d):
    X0[i] = 2**i*L[i]
    X1[i] = 2**i*(N-L[i])
    
ans = 0
    
Kb = list(bin(K))
for i in range(2, len(Kb)):
    if Kb[i] == "0":
        continue
    c = 0
    for j in range(2, len(Kb)):
        if j < i:
            if Kb[j] == "0":
                c += X0[len(Kb)-1-j]
            else:
                c += X1[len(Kb)-1-j]
        elif j == i:
            c += X0[len(Kb)-1-j]
        else:
            c += max(X0[len(Kb)-1-j], X1[len(Kb)-1-j])
    ans = max(ans, c)
    
for i in range(len(Kb)-2, d):
    ans += X0[i]
    
c = 0
for i in range(N):
    c += K^A[i]
    
ans = max(ans, c)
print(ans)

Measured memory_bytes: 14140
//C
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ld PI = 3.1415926535;
int main(){
	cout.precision(12);
	ld a,b,h,m;
	cin >> a >> b >> h >> m;
	ld deg = 2*PI*(fabs(m/60 - (h+m/60)/12));
	ld ans = sqrt(a*a+b*b - 2*a*b*cos(deg));
	cout << ans;
	return 0;
}


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

int main() {
  int N;
  cin >> N;
  vector<int> X(N), Y;
  for (int &x : X) cin >> x;
  Y = X;
  sort(Y.begin(), Y.end());
  map<int, int> MA;
  for (int i = 0; i < N; i++) {
    MA[Y.at(i)] = (i < N / 2) ? Y.at(N / 2) : Y.at(N / 2 - 1);
  }
  for (auto x : X) cout << MA[x] << "\n";
}

Measured memory_bytes: 13880
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		String a=sc.next();
		String b=sc.next();
		String c=a+b;
		int bool=0;
		int sum=Integer.parseInt(c);
		
		for(int i=1;i<=Math.sqrt(sum);i++){
			if(sum%i==0&&sum==i*i){
				bool=1;
				break;
			}else{
				bool=0;
			}
		}
		
		if(bool==1){
			System.out.println("Yes");
		}
		if(bool==0){
			System.out.println("No");
		}	
	}
}

Measured memory_bytes: 21844
N = int(input())
#divisor
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors

def is_ok(k):
    if(k==1):
        return False
    _N = N
    while(_N>1):
        if(_N%k==0):
            _N//=k
        else:
            _N%=k
            break
    if(_N!=1):
        return False
    else:
        return True

cand = set(make_divisors(N)) | set(make_divisors(N-1))
cnt = 0
for i in list(cand):
    if(is_ok(i)):
        cnt += 1

print(cnt)

Measured memory_bytes: 4120
#pragma GCC optimize("Ofast", "unroll-loops")

#include <bits/stdc++.h>

using namespace std;

int main() {
	int N; cin >> N;
	if (N == 1) {
		cout << "1" << endl << "1" << endl;
	}
	else if (N == 2) {
		cout << "2" << endl << "0" << endl << "11" << endl;
	}
	else {
		cout << (N - 1) << endl;
		for (int i = 2; i <= N; ++i) {
			cout << '1';
			for (int j = 0; j < i - 2; ++j)
				cout << '0';
			cout << '1' << endl;
		}
	}
	return 0;
}


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

int main(){
	int n;
	cin >> n;
	int total=0;
	int remain=n;
	int coins[]={25,10,5,1};
	for(int i=0;i<4;i++){
		int coin = coins[i];
		int noOfCoins=remain/coin;
		total += noOfCoins;
		remain -= noOfCoins*coin;
		
	}
	cout << total << endl;
	return 0;
}




Measured memory_bytes: 3124
#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
using vc = vector<char>;
using vvc = vector<vc>;
ll dx[4]={0,1,0,-1};
ll dy[4]={1,0,-1,0};
int main(){
  ll n,m,k;
  cin>>n>>m>>k;
  for(int i=0;i<=n;i++){
    for(int j=0;j<=m;j++){
      if(i*(m-j)+j*(n-i)==k){
        COUT("Yes");
        return 0;
      }
    }
  }
  COUT("No");
}


Measured memory_bytes: 256
short*p,v[][104];main(c,n,m,i,y){for(;m=scanf("%d %[^\n] %[^\n]",&n,v,v+1)*n;printf(m>n?"NA\n":"%d\n",m))for(i=2;i--;m=c)for(c=0,y=n-1;p=y+v[c+i&1],c<m&y>0;)y-=y==n|*p&2?-1:*p&p[-1]&1?1:!++c+2;}

Measured memory_bytes: 0
#include<stdio.h>//cでは三角関数の引数はラジアンを使わなければならない！
#include<math.h>
#define M_PI 3.14159265358979323846

int main(){
	int a,b,C;
	double c,L,h,S,rad;
	scanf("%d %d %d",&a,&b,&C);
	rad = C*M_PI/180;
	c = sqrt((a*a)+(b*b)-(2*a*b*cos(rad)));
	L = a+b+c;
	h = b*sin(rad);
	S = 0.5*h*a;
	printf("%f\n",S);
	printf("%f\n",L);
	printf("%f\n",h);
}

Measured memory_bytes: 1064
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >>n;
  string s,t;
  cin >>s >>t;
  string k;
  for(int i=0;i<n;i++){
    k=k+s[i]+t[i];
  }
  cout << k <<endl;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Web;

namespace Competitive
{
    internal class Solution
    {
        public int Q;

        public void Run()
        {
            {
                Q = Input.ReadInt();
            }

            for (int i = 0; i < Q; i++)
            {
                long[] vals = Input.ReadLongArray();
                long ans = Solve(vals[0], vals[1]);
                Console.WriteLine(ans);
            }

        }

        public long Solve(long a, long b)
        {
            if (a == b) return a * 2 - 2;

            long n = N(a * b);
            if (a * b <= n * (n + 1)) return n * 2 - 2;

            return n * 2 - 1;
        }

        // N * N < Xとなる最大のN(= N * N >= Xとなる最小のNから1を引いたもの）
        public long N(long x)
        {
            return BinarySearch.Search(x) - 1;
        }

    }

    // libs ----------
    internal class BinarySearch
    {
        // 左側がfalse, 右側がtrueである必要がある
        public static bool Cond(long i, long x)
        {
            if (i * i >= x) return true;
            return false;
        }

        // 初めてCondがtrueを返すindexを返す
        // 全て条件を満たさない場合はNを返す
        public static long Search(long x)
        {
            long left = 0;
            long right = 1000000001;

            if (Cond(0, x)) return 0;
            if (!Cond(right - 1, x)) return right;

            while (left + 1 < right)
            {
                long mid = (left + right) / 2;
                if (!Cond(mid, x))
                {
                    left = mid;
                }
                else
                {
                    right = mid;
                }
            }
            return right;
        }
    }


    // common ----------

    internal static class Input
    {
        public static string ReadString()
        {
            string line = Console.ReadLine();
            return line;
        }

        public static int ReadInt()
        {
            string line = Console.ReadLine();
            return int.Parse(line);
        }

        public static int[] ReadIntArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(int.Parse).ToArray();            
        }

        public static long ReadLong()
        {
            string line = Console.ReadLine();
            return long.Parse(line);
        }

        public static long[] ReadLongArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(long.Parse).ToArray();
        }

        public static double[] ReadDoubleArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(double.Parse).ToArray();
        }
    }
    
    internal class Program
    {
        public static void Main(string[] args)
        {
            var s = new Solution();
            s.Run();
        }
    }
}

Measured memory_bytes: 13268
import java.util.*;
import java.lang.*;

public class Main {
    static final int INF = (1 << 31) - 1;             
    static final int MAXN = 11111;     
    static double a, b, c;
    static double a1, b1, c1;
    static double resX, resY;
    
    public static void main(String[] args) throws Exception {                
        Scanner input = new Scanner(System.in);
        int x0, y0, x1, y1, x2, y2;
        int q;
        x0 = input.nextInt();
        y0 = input.nextInt();
        x1 = input.nextInt();
        y1 = input.nextInt();
        lineOf(x0, y0, y1 - y0, x0 - x1);
        q = input.nextInt();
        for (int i = 0; i < q; ++i) {
            x2 = input.nextInt();
            y2 = input.nextInt();
            line1Of(x2, y2, x0 - x1, y0 - y1);
            intersectionOf2Lines();
            resX = resX * 2 - x2;
            resY = resY * 2 - y2;
            System.out.printf("%.8f %.8f\n", resX, resY);
        }
    }
    
    static void lineOf(double x1, double y1, double vx, double vy) {
        a = vx;
        b = vy;
        c = - vx * x1 - vy * y1;
    }
    
    static void line1Of(double x1, double y1, double vx, double vy) {
        a1 = vx;
        b1 = vy;
        c1 = - vx * x1 - vy * y1;
    }
    
    static void intersectionOf2Lines() {
        double d = a * b1 - a1 * b;
        double dx = b * c1 - b1 * c;
        double dy = c * a1 - c1 * a;
        resX = dx / d;
        resY = dy / d;
    }
}

Measured memory_bytes: 32800
#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 pb push_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define f first
#define s second
#define resz resize
#define ini ll_MAX
#define inl LLONG_MAX
#define MOD 1000000007
#define sz(x) ll((x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define F0R(i, a) for (ll i = 0; i < (a); i++)
#define FORR(i, a, b) for (ll i = a; i >= (b); i--)
#define F0RR(i, a) for (ll i = a; i >= 0; i--)
#define trav(a, x) for (auto& a : x)
#define pbds tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> 
 
using ll = long long;
using vi = vector<ll>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vd = vector<double>;
using vs = vector<string>;
 
using pii = pair<ll, ll>;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;
 
using vpii = vector<pii>;
using vvpii = vector<vpii>;
using vpll = vector<pll>;
using vvpll = vector<vpll>;
using vpdd = vector<pdd>;
using vvpdd = vector<vpdd>;
 
ll mod(ll a,ll b)
{
    return (b+a%b)%b;
}
 
ll gcd(ll a,ll b)
{
    if(b==0)return a;
    else return gcd(b,a%b);
}
ll po(ll a,ll b)
{
    ll ans = 1;
    while(b--)
        ans*=a;
    return ans;
}

ll power(ll x, ll y, ll p)  
{  
    ll res = 1;
    x = x % p;
    if (x == 0) return 0;
    while (y > 0)  
    {  
        if (y & 1)  
            res = (res*x) % p;  
        y = y>>1;
        x = (x*x) % p;  
    }  
    return res;  
}  
 
double sqdist(double a,double b,double c,double d)
{
    return (a-c)*(a-c)+(b-d)*(b-d);
}
ll fact(ll n)
{
    if(n==0)return 1;
    ll ans = 1;
    FOR(i,1,n+1)ans*=i;
    return ans;
}
 


void solve()
{
    int a,b,c,k;cin>>a>>b>>c>>k;
    int ans = 0;
    if(k<=a)cout<<k;
    else if(k<=a+b)cout<<a;
    else {
        k-=(a+b);
        cout<<a-k;
    }
}   
main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    solve();
}

Measured memory_bytes: 3688
#include <stdio.h>
const int M=998244353;
long long f[300010]={1};
int gcd(int x,int y){return y?gcd(y,x%y):x;}
long long inv(long long x){
	long long t=1;
	for(int i=0;i<30;++i){
		if((M-2)&(1<<i))t=t*x%M;
		x=x*x%M;
	}
	return t;
}
long long c(int n,int r){
	return f[n]*inv(f[r])%M*inv(f[n-r])%M;
}
int main(){
	int i,n,x,y,t;
	long long a,b,k,ans=0;
	scanf("%d%lld%lld%lld",&n,&a,&b,&k);
	t=gcd(a,b);
	if(k%t)return !puts("0");
	for(i=1;i<=n;++i)f[i]=f[i-1]*i%M;
	a/=t,b/=t,k/=t;
	for(x=0;x<=n;++x){
		if(a*x>k)break;
		if((k-a*x)%b)continue;
		y=(k-a*x)/b;
		if(y<0||y>n)continue;
		ans=(ans+c(n,x)*c(n,y))%M;
	}
	printf("%lld",ans);
	return 0;
}


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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define scd(n) scanf("%d",&n)
#define scl(n) scanf("%I64d",&n)
#define mp(x,y) make_pair(x,y)
#define repi(a,b,c) for(int i=a;i<b;i+=c)
#define repis(a,b,c) for(int i=a-1;i>=b;i-=c)
#define repj(a,b,c) for(int j=a;j<b;j+=c)
#define repjs(a,b,c) for(int j=a-1;j>=b;j-=c)
#define fi first
#define se second

const int mx = 2e5+100;

int check(int x) {
    if(x < 400) return 1;
    if(x < 800) return 2;
    if(x < 1200) return 3;
    if(x < 1600) return 4;
    if(x < 2000) return 5;
    if(x < 2400) return 6;
    if(x < 2800) return 7;
    if(x < 3200) return 8;
    return 9;
}

int main() {
   int n,arr[mx],ans=0,p,c=0;
   map <int,int> visit;
   scd(n);
   repi(0,n,1) {
       scd(arr[i]);
       p = check(arr[i]);
       if(p == 9) c++;
       else if(visit[p] == 0) ans++;
       visit[p]++;
   }
   printf("%d %d\n",max(1,ans),ans+c);
}


Measured memory_bytes: 256
#include<bits/stdc++.h> 
using namespace std;
 
#define ll long long int
#define absdiff(a,b) (a>b)?a-b:b-a
#define debug cout<<"debug";
#define mp make_pair 
#define pb push_back
#define ff first
#define ss second
#define fast  ios_base::sync_with_stdio(false);cin.tie(0);
#define MOD 1000000007
#define ll_MAX 19223372036859
#define endl "\n"
ll fast_expo(ll x,ll p){if(p==0) return 1;
else if(p%2==0){ ll t=fast_expo(x,p/2)%MOD;return (t*t)%MOD;} else return (x*(fast_expo(x,p-1))%MOD)%MOD;}
ll gcd(ll a,ll b){if(a==0||b==0) return a+b;  else return gcd(b%a,a); }


int main()
{
    ll t;t=1;
    // cin>>t;
    for(ll x=0;x<t;++x){
        ll n;cin>>n;
        ll arr[n];
        for(ll i=0;i<n;++i) cin>>arr[i];

        ll ans=0;
        ll dp[n+1][60];
        memset(dp,0,sizeof(dp));
        for(ll i=n-1;i>=0;--i){
            for(ll j=0;j<60;++j){
                if((1ll<<j)&arr[i]){
                    ll cnt=n-1-i-dp[i+1][j];
                    ans=(ans+((1ll<<j)%MOD)*cnt+MOD)%MOD;
                    dp[i][j]=dp[i+1][j]+1;
                }
                else {
                    ll cnt=dp[i+1][j];
                    ans=(ans+((1ll<<j)%MOD)*cnt+MOD)%MOD;
                    dp[i][j]=dp[i+1][j];
                }
            }
        }
        cout<<ans;
    }
    return 0;
}

Measured memory_bytes: 143232
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
typedef vector<vector<P>> vvP;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;

// aのn乗を求める。計算量はO(logn)
ll modpow(ll a, ll n) {
    if(n == 0) {
        return 1;
    }
    if(n%2 == 1) {
        return (a * modpow(a, n-1))%mod;
    }
    return (modpow(a, n/2) * modpow(a, n/2))%mod;
}

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

    vl v(n);  // v[i] : 数iが入力された回数
    rep(i, n) {
        ll a;
        cin >> a;
        v[a]++;
    }

    if(n%2 == 1) {
        if(v[0] != 1) {
            out(0);
            re0;
        }
        for(ll i = 2; i < n; i += 2) {
            if(v[i] != 2) {
                out(0);
                re0;
            }
        }
    }
    else if(n%2 == 0) {
        for(ll i = 1; i < n; i += 2) {
            if(v[i] != 2) {
                out(0);
                re0;
            }
        }
    }

    out(modpow(2LL, n/2));
    re0;
}

Measured memory_bytes: 1024
//abc142_a.cpp
//Sat Sep 28 20:49:42 2019

#include <iostream>
#include <string>
#include <queue>
#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <math.h>
#include <set>
#define INTINF 2147483647
#define LLINF 9223372036854775807
using namespace std;
using ll=long long;
typedef pair<int,int> P;

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

	double ans;
	if (n%2==0){
		cout << 0.50000000 << endl;
	}else {
		ans = (n-1)/2+1;
		ans = ans / n;
		printf("%.8f\n",ans);
	}

}

Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#define RI register int
#define CI const int&
using namespace std;
const int N=10005;
char s[N],mi='z',ans[N],tp[N]; int n,k;
inline bool cmp_min(char *a,char *b)
{
	for (RI i=1;i<=n;++i)
	if (a[i]!=b[i]) return a[i]<b[i]; return 0;
}
inline void solve(char *s,int k)
{
	int nw=n,len=0; while (nw&&s[nw]==mi) --nw,++len;
	while (k&&len<n) --k,len<<=1; len=min(n,len);
	RI i; for (i=1;i<=len;++i) tp[i]=mi;
	for (i=len+1;i<=n;++i) tp[i]=s[nw--];
	if (cmp_min(tp,ans)) for (i=1;i<=n;++i) ans[i]=tp[i];
}
int main()
{
	RI i; for (scanf("%d%d%s",&n,&k,s+1),i=1;i<=n;++i)
	mi=min(s[i],mi),s[(n<<1)-i+1]=s[i],ans[i]='z';
	if (s[n]==mi) solve(s,k);
	for (i=n+1;i<=(n<<1);++i) if (s[i]==mi) solve(s+i-n,k-1);
	return puts(ans+1),0;
}

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

ll insider(ll x,ll y,ll z){
  ll up,down;
  if(x%z==0){
    down = x/z;
  }else{
    down = x/z + 1;
  }
  up = y/z;
  return up - down + 1;
}

ll gcd(ll x, ll y){
  if(x<y){
    swap(x,y);
  }
  if(x%y==0){
    return y;
  }else{
    return gcd(x%y,y);
  }
}

int main(){
  ll A,B,C,D;
  cin >> A >> B >> C >> D;
  ll lcm = C/gcd(C,D)*D;
  ll ans = B-A+1;
  ans += insider(A,B,lcm) - insider(A,B,C) - insider(A,B,D);
  cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,N) for(int i=0;i<(N);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e12;
const int inf = 1e9;
typedef long long ll;
typedef pair<ll,int> P;
typedef set<int> S;
ll n;
int main(){
    ll l,r;
    cin>>l>>r;
    if(r-l>3000) cout<<"0"<<endl;
    else{
        r=min(r,l+2020);
        ll ans=2018;
        for(ll i = l;i<=r;i++){
            for(ll j=i+1;j<=r;j++){
                ans=min(ans,i*j%2019);
            }
        }
        cout<<ans<<endl;
    }

    return 0;
}

Measured memory_bytes: 256
import java.util.*;
class Main{
	    public static void main(String[] args) {
	        try(Scanner sc = new Scanner(System.in)){
	            int a = sc.nextInt(), b = sc.nextInt();
	            
	            
	        if(a < b)
	        System.out.println("a < b");
	        
	        else if(a > b)
	        System.out.println("a > b");
	        
	        else
	        System.out.println("a == b");
	        }
	    }
	}



Measured memory_bytes: 26168
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define fi first
#define se second
#define mp make_pair
#define itrfor(itr,A) for(auto itr = A.begin(); itr !=A.end();itr++)
template <class T> using reversed_priority_queue = priority_queue<T, vector<T>, greater<T> >;
typedef long long llong;
char moji[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
char moji2[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
char moji3[10]={'0','1','2','3','4','5','6','7','8','9'};
#define Sort(a) sort(a.begin(),a.end());
#define Reverse(a) reverse(a.begin(),a.end());
#define print(a) cout << a << endl;
#define MOD llong(1e9+7)
#define MAX int(2 * 1e5 +5)
#define debug(x)  cout << #x << " = " << (x) << endl;
#define pi acos(-1.0)
#define int llong
#define INF llong(1e17)
void myprint(int* A,int A_num){
   REP(i,A_num) cout << A[i] << " ";
   cout << endl;
}

signed main(){
    string s,t;
    cin >> s >> t;
    int cnt = 0;
    REP(i,3){
        if(s[i] == t[i]) cnt ++;
    }
    cout << cnt << endl;

}

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

public class Main {

    
    public void solve() throws IOException {
      String s = next();
      out.println(s.substring(0, 4) + " " + s.substring(4));
      
    }

    

    
    
    BufferedReader bf;
    StringTokenizer st;
    PrintWriter out;
    
    public String next() throws IOException {
        while (st == null || !st.hasMoreTokens()) 
            st = new StringTokenizer(bf.readLine());
        return st.nextToken();
    }
    public int nextInt() throws IOException {
        return Integer.parseInt(next());
    }
    
    public long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    public Main() throws IOException {
        bf = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(new OutputStreamWriter(System.out));      
        solve();
        bf.close();
        out.close();
    }
    
    public static void main(String args[]) throws IOException {
        new Main();
    }
}

Measured memory_bytes: 8148
#include<bits/stdc++.h>
using namespace std;
typedef long long llong;
const llong N=1e18;
int main() {
    int n;
    llong a=1,b,c;
    scanf("%d",&n);
    while(n--) {
        scanf("%lld",&b);
        if(b==0) {
            a=0;
            break;
        }
        c=N/a;
        if(b>c) {
            a=-1;
        }
        a=a*b;
    }
    a=a<0?-1:a;
    cout<<a;

    return 0;
}


Measured memory_bytes: 3692
import sys
import math
import itertools as it
def I():return int(sys.stdin.readline().replace("\n",""))
def I2():return map(int,sys.stdin.readline().replace("\n","").split())
def S():return str(sys.stdin.readline().replace("\n",""))
def L():return list(sys.stdin.readline().replace("\n",""))
def Intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def Lx(k):return list(map(lambda x:int(x)*-k,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":
    s = input()
    ans = 0
    tmp = ''
    c = ''
    for i in s:
        c += i 
        if c != tmp:
            ans += 1
            tmp = c
            c = ''
    print(ans)



Measured memory_bytes: 9240
#include <bits/stdc++.h>
#define ALL(a)  (a).begin(),(a).end()
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<long long, long long> Pll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<long long> vll;
typedef vector<vector<long long>> vvll;
template <typename T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template <typename T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;
const int INT_INF = 1 << 30;
const double PI = acos(-1.0);
#define MOD 1000000007LL
#define endl "\n"

int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  ll N;
  cin >> N;
  vll T(N), A(N);
  for(int i = 0; i < N; i++){
    cin >> T.at(i);
  }
  for(int i = 0; i < N; i++){
    cin >> A.at(i);
  }
  vector<Pll> TT(N), AA(N);
  TT.at(0) = Pll(T.at(0), T.at(0));
  AA.at(N-1) = Pll(A.at(N-1), A.at(N-1));
  for(int i = 1; i < N; i++){
    //T...1~N-1
    if(T.at(i) > T.at(i-1)) TT.at(i) = Pll(T.at(i), T.at(i));
    else TT.at(i) = Pll(1, T.at(i));

    //A...N-2~1
    int ii = N - 1 - i;
    if(A.at(ii) > A.at(ii+1)) AA.at(ii) = Pll(A.at(ii), A.at(ii));
    else AA.at(ii) = Pll(1, A.at(ii));
  }
  ll ans = 1LL;

  for(int i = 0; i < N; i++){
    ll mini = max(TT.at(i).first, AA.at(i).first);
    ll maxi = min(TT.at(i).second, AA.at(i).second);
    if(mini > maxi){
      cout << 0 << endl;
      return 0;
    }
    ans *= maxi - mini + 1LL;
    ans %= MOD;
  }
  cout << ans << endl;
}

Measured memory_bytes: 4992
#include <bits/stdc++.h>
  using namespace std;
#define ll long long
#define fw(p) for(int w=0;w<(p);w++)
#define fx(p) for(int x=0;x<(p);x++)
#define fy(p) for(int y=0;y<(p);y++)
#define fz(p) for(int z=0;z<(p);z++)
#define fyg(p,g) for(int y=(g);y<(p);y++)
#define fzg(p,g) for(int z=(g);z<(p);z++)
#define ce(d) cout<<d<<endl;
#define vecp(p) int aa;cin>>aa;(p).push_back(aa);
#define vecpl(p) long long aa;cin>>aa;(p).push_back(aa);
#define vecps(p) string aa;cin>>aa;(p).push_back(aa);
#define vecp2(p) int ab;cin>>ab;(p).push_back(ab);
#define vecpl2(p) long long ab;cin>>ab;(p).push_back(ab);
#define vecps2(p) string ab;cin>>ab;(p).push_back(ab);
#define set0(k,n) for(int nn=0;nn<(n);nn++){ (k).push_back(0); }
#define sorts(c) sort((c).begin(),(c).end());
#define reverses(c) reverse((c).begin(),(c).end());
#define vec(b) vector<int> (b);
#define vecl(b) vector<long long> (b);
#define vecs(b) vector<string> (b);
#define vecsize(b,size) vector<int> (b)((size));
#define pb(b,a) (b).push_back((a));

 		
int main() {
string S;
cin>>S;
if(S.size()==2){
	ce(S)
}else{
  reverse(S.begin(),S.end());
	ce(S)
}



}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < b; i++)
#define all(v) v.begin(), v.end()
const int MOD = 1e9 + 7;
const int INF = 1e9;
//'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122

const int MAX = 510000;
long long fac[MAX], finv[MAX], inv[MAX];

void cominit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

long long com(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main() {
    int n, k;
    cin >> n >> k;
    cominit();
    rep(i, 1, k + 1) {
        ll ans = com(k - 1, i - 1) * com(n - k - (i - 1) + i, i);
        ans %= MOD;
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 12160
n = int(input())
a = list(map(int, input().split()))
box = [0]*n
ans = []
cnt = 0
for i in reversed(range(1, n+1)):
    tmp = 0
    for j in range(i*2, n+1, i):
        tmp ^= box[j-1]
    if a[i-1] != tmp:
        ans.append(i)
        box[i-1] = 1

if (len(ans) == 0):
    print(0)
else:
    print(len(ans))
    print(*ans)


Measured memory_bytes: 14004
#include<iostream>

using namespace std;

int main(){
    int n[3];
    int i, j;
    bool f = false;

    for (i=0; i<3; i++){
        cin >> n[i];
    }
    
    if (n[0]+ n[1] + n[2] == 17){
        for (i=0; i<3; i++){
            if (n[i] == 7){
                for (j=0; j<3; j++){
                    if (n[j] == 5){
                        f = true;
                        break;
                    }
                }
            }
        }
    }

    if (f == true){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }
    return 0;
}

Measured memory_bytes: 3540