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

#define REPR(i,n) for(int i=(n); i >= 0; --i)
#define FOR(i, m, n) for(int i = (m); i < (n); ++i)
#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define ALL(a)  (a).begin(),(a).end()

template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
int gcd(int a,int b){return b?gcd(b,a%b):a;}
typedef long long ll;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}


int main() {
    string s;
    cin >> s;

    set<char> d;
    REP(i,s.size()) {
        d.insert(s[i]);
    }

    if ((d.find('S') != d.end()) != (d.find('N') != d.end())) {
        cout << "No" << endl;
        return 0;
    }
    if ((d.find('E') != d.end()) != (d.find('W') != d.end())) {
        cout << "No" << endl;
        return 0;
    }

    cout << "Yes" << endl;

    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
using namespace std;
 
vector<pair<int, int> > N[100009];
int v[100009], n;

void bfs(int k){
    queue<int> Q;
    Q.push(k);
    while(!Q.empty()){
        for(int j=0;j<N[Q.front()].size();j++){
            int nei_v = N[Q.front()][j].first;
            int nei_w = N[Q.front()][j].second;
            if(v[nei_v]==-1){
                v[nei_v] = (v[Q.front()] + nei_w)%2;
                Q.push(nei_v);
            }
        }
        Q.pop();
    }
}
 
void solve(){
    for(int i=0;i<n;i++){
        v[i] = -1;
    }
    v[0]=1;
    bfs(0);
    for(int i=0;i<n;i++){
        cout << v[i] << endl;
    }
}
 
int main(){
    cin >> n;
    int tmp_u, tmp_v, tmp_w;
    for(int i=0;i<n-1;i++){
        cin >> tmp_u >> tmp_v >> tmp_w;
        tmp_u--;
        tmp_v--;
        N[tmp_u].push_back(make_pair(tmp_v,tmp_w));
        N[tmp_v].push_back(make_pair(tmp_u,tmp_w));
    }
    solve();
}

Measured memory_bytes: 6784
#include<iostream>
using namespace std;
int main(){
  int n[101];
  int i;
  int num;
  cin >> num;
  for(i=0;i<num;i++) cin >> n[i];
  cout << n[num-1];
  for(i=1;i<num;i++) cout <<" "<< n[num-i-1];
  cout << endl;
  return 0;
}

Measured memory_bytes: 1160
#include<iostream>
using namespace std;
int N,D;
string x,y="";
main()
{
	cin>>N>>x>>D;
	for(int i=0;i<N;i++)
	{
		if(x[i]=='1')y+='1';
		else
		{
			if(D)D--,y+='1';
			else y+='0';
		}
	}
	for(int i=N;i--;)
	{
		if(x[i]=='1'&&D)
		{
			D--;
			y[i]='0';
		}
	}
	cout<<y<<endl;
}



Measured memory_bytes: 3220
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <string>
#include <math.h>
#include <time.h>
#include <stdlib.h>
using namespace std;

int main(){
	int a;
	scanf("%d",&a);
	printf("%d\n",180*a-360);
	return 0;
}

Measured memory_bytes: 256
from typing import Tuple, List
from heapq import heappush, heappop


def max_value(max_weight: int, items: List[Tuple[int, int]]) -> float:
    def _cost(weight: int, value: int, i: int) -> Tuple[int, float]:
        # Use value as negative cost
        for j in range(i, n):
            v, w = items[j]
            if (weight + w > max_weight):
                return (-value, -value - (v / w) * (max_weight - weight))
            weight += w
            value += v
        return (-value, -value * 1.0)

    n = len(items)
    items.sort(key=lambda x: x[1], reverse=True)
    items.sort(key=lambda x: x[0] / x[1], reverse=True)
    u, c = _cost(0, 0, 0)
    heap = [(c, u, 0, 0, 0)]
    maxcost = u
    while heap:
        cost, upper, weight, value, i = heappop(heap)
        if (cost > maxcost):
            break
        if (i < n):
            v, w = items[i]
            if (weight + w <= max_weight):
                heappush(heap, (cost, upper, weight + w, value + v, i + 1))
            u, c = _cost(weight, value, i + 1)
            if (c < maxcost):
                if (u < maxcost):
                    maxcost = u
                heappush(heap, (c, u, weight, value, i + 1))

    return -maxcost


if __name__ == '__main__':
    N, W = map(lambda x: int(x), input().split())
    items: List[Tuple[int, int]] = []

    for _ in range(N):
        v, w, m = map(lambda x: int(x), input().split())
        for i in range(m.bit_length() - 1):
            h = 2 ** i
            m -= h
            items.append((v * h, w * h))
        if m > 0:
            items.append((v * m, w * m))

    print(max_value(W, items))



Measured memory_bytes: 7428
#include<iostream>
#include<vector>
#include<map>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#include<set>
#include<bitset>
#include<iomanip>
#define BUG puts("no bug")
#define sci(x) scanf("%d",&x)
#define scl(x) scanf("%lld",&x)
#define ll long long
#define ull unsigned long long
#define REP(a,b,c) for(int a=b;a<=c;a++)
#define PER(a,b,c) for(int a=b;a>=c;a--)
#define lb(a) (a&(-a))
#define pp (p<<1)
#define ppp (p<<1|1)
#define pi pair<int,int>
#define pii pair<pair<int,int>,int>
using namespace std;
const int MAXN=1e6+5;
int n,m,t;
int v[MAXN];
int ans[MAXN];
int main(){
    int a,b;
    cin>>n>>a>>b;
    REP(i,1,n){
        REP(j,i+1,n){
            int tmp=min(j-i,min(abs(a-i)+abs(b-j)+1,abs(a-j)+abs(b-i)+1));
            ans[tmp]++;
        }
    }
    REP(i,1,n-1)cout<<ans[i]<<endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 2000000000
int main()
{
	double max=-1,min=INF,tmp;
	while(scanf("%lf",&tmp)!=EOF)
	{
		if(tmp>=max)max=tmp;
		if(tmp<=min)min=tmp;
	}
	cout << max-min << endl;
	return 0;
}

Measured memory_bytes: 1280
MOD = 10**9 + 7
n = int(input())
A = list(map(int, input().split()))

fact = {i: None for i in range(n+2)}                 # n!
inverse = {i: None for i in range(1, n+2)}       # inverse of n in the field Z/(MOD)Z
fact_inverse = {i: None for i in range(n+2)}  # inverse of n! in the field Z/(MOD)Z

fact[0] = fact[1] = 1
fact_inverse[0] = fact_inverse[1] = 1
inverse[1] = 1
for i in range(2, n+2):
    fact[i] = i * fact[i-1] % MOD
    inverse[i] = - inverse[MOD % i] * (MOD // i) % MOD
    fact_inverse[i] = inverse[i] * fact_inverse[i-1] % MOD

def combination(n, r):
    if n < r or n < 0 or r < 0:
        return 0
    else:
        return fact[n] * (fact_inverse[r] * fact_inverse[n-r] % MOD) % MOD

dup_num = sum(A) - n*(n+1)//2
dup_idx = []
for i, a in enumerate(A):
    if a == dup_num:
        dup_idx.append(i)
        
left, right = dup_idx[0], dup_idx[1]
        
for k in range(1, n+2):
    print((combination(n+1, k) - combination(n + 1 - (right - left + 1), k - 1)) % MOD)

Measured memory_bytes: 45744
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

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

    static class AEatingSymbolsEasy {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            String s = in.next();
            int answer = 0;
            for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) == '+')
                    answer++;
                else
                    answer--;
            }
            out.println(answer);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

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

    }
}



Measured memory_bytes: 23124
#include <iostream>
#define rep(i,n) for(long i=0; i<(n); i++)
using namespace std;

int main(){
  long n,red=0,count=0;
  cin >> n;
  char c[n+10];
  rep(i,n){
    cin >> c[i];
    if(c[i] == 'R'){red++;}
  }
  
  rep(i,red){
    if(c[i] == 'W'){count++;}
  }
  
  cout << count << endl;
  
  return 0;
}


Measured memory_bytes: 3736
#include <string>
#include <iostream>
#include <algorithm>
using namespace std;
int n, m, dp[2009][2009][2]; string s, t;
int main() {
	cin >> n >> m >> s >> t;
	int ret = 0;
	for (int i = 0; i <= n; i++) {
		for (int j = 0; j <= m; j++) {
			if (i >= 1) {
				if (s[i - 1] == 'I') dp[i][j][0] = max(dp[i][j][0], dp[i - 1][j][1] + 1);
				else if(dp[i - 1][j][0] >= 1) dp[i][j][1] = max(dp[i][j][1], dp[i - 1][j][0] + 1);
			}
			if(j >= 1) {
				if (t[j - 1] == 'I') dp[i][j][0] = max(dp[i][j][0], dp[i][j - 1][1] + 1);
				else if(dp[i][j - 1][0] >= 1) dp[i][j][1] = max(dp[i][j][1], dp[i][j - 1][0] + 1);
			}
			ret = max(ret, dp[i][j][0]);
		}
	}
	if (ret == 0) cout << 0 << endl;
	else cout << (ret - 1) / 2 * 2 + 1 << endl;
	return 0;
}

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

int main(){
  int N;
  vector<int> rec(100,0);
  cin >> N;
  for(int i=0;i<N;i++){
  	int r;
    cin >> r;
    rec[r-1]++;
  }
  int R=0;
  for(int i=0;i<100;i++)
    if(rec[i]!=0) R++;
  
  cout << R << endl;
}

Measured memory_bytes: 256
module Main where

import Control.Applicative
import Text.Printf

main :: IO ()
main = do
  { [a,b,c] <- getInts
  ; print (count 0  a b c)
  }

count :: Int -> Int -> Int -> Int -> Int
count n x y z
  | x > y          = n
  | z `mod` x == 0 = count (n+1) (x+1) y z
  | otherwise      = count n     (x+1) y z
  
--

getInts :: IO [Int]
getInts = map read . words <$> getLine

putInts :: [Int] -> IO ()
putInts = putStrLn .  unwords . map show



Measured memory_bytes: 4112
#include <bits/stdc++.h>
 
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FORD(i, a, b) for(int i = (a); i >= (b); --i)
#define VAR(v, i) __typeof(i) v=(i)
#define FORE(i, c) for(VAR(i, (c).begin()); i != (c).end(); ++i)
#define all(v) (v).begin(),(v).end()
 
#define PII pair<int,int>
#define mp make_pair
#define st first
#define nd second
#define pb push_back
#define lint long long int
#define VI vector<int>
 
#define debug(x) {cerr <<#x <<" = " <<x <<endl; }
#define debug2(x,y) {cerr <<#x <<" = " <<x << ", "<<#y<<" = "<< y <<endl; } 
#define debug3(x,y,z) {cerr <<#x <<" = " <<x << ", "<<#y<<" = "<< y << ", " << #z << " = " << z <<endl; } 
#define debugv(x) {{cerr <<#x <<" = "; FORE(itt, (x)) cerr <<*itt <<", "; cerr <<endl; }}
#define debugt(t,n) {{cerr <<#t <<" = "; FOR(it,0,(n)) cerr <<t[it] <<", "; cerr <<endl; }}
 
#define make( x) int (x); scanf("%d",&(x));
#define make2( x, y) int (x), (y); scanf("%d%d",&(x),&(y));
#define make3(x, y, z) int (x), (y), (z); scanf("%d%d%d",&(x),&(y),&(z));
#define make4(x, y, z, t) int (x), (y), (z), (t); scanf("%d%d%d%d",&(x),&(y),&(z),&(t));
#define makev(v,n) VI (v); FOR(i,0,(n)) { make(a); (v).pb(a);} 
#define IOS ios_base::sync_with_stdio(0)
#define HEAP priority_queue
 
#define read( x) scanf("%d",&(x));
#define read2( x, y) scanf("%d%d",&(x),&(y));
#define read3(x, y, z) scanf("%d%d%d",&(x),&(y),&(z));
#define read4(x, y, z, t) scanf("%d%d%d%d",&(x),&(y),&(z),&(t));
#define readv(v,n) FOR(i,0,(n)) { make(a); (v).pb(a);}
#define jeb fflush(stdout)
 
 
using namespace std;

const int max_n = 3e5+5;


int main() {
	make(n);
	makev(v, 3*n);
	vector<lint> ans1;
	lint sum = 0;
	FOR(i,0,n) sum += v[i];
	ans1.pb(sum);
	HEAP<int> x;
	FOR(i,0,n) x.push(-v[i]);
	FOR(i,0,n) {
		sum += v[i+n];
		x.push(-v[i+n]);
		sum += x.top();
		x.pop();
		ans1.pb(sum);
	}
	
	vector<lint> ans2;
	sum = 0;
	while (!x.empty()) x.pop();
	FOR(i,2*n, 3*n) sum += v[i];
	
	FOR(i,2*n, 3*n) x.push(v[i]);
	ans2.pb(sum);
	FORD(i,2*n-1,n) {
		sum += v[i];
		x.push(v[i]);
		sum -= x.top();
		x.pop();
		ans2.pb(sum);
	}
	lint best = ans1[0] - ans2.back();
	FOR(i,0,ans1.size()) {
		best = max(best, ans1[i] - ans2[ans1.size()-1-i]);
	}
	printf("%lld\n", best);

}


Measured memory_bytes: 5744
n, x = map(int, input().split())
a = [int(i) for i in input().split()]
a.sort()
calc = 0
ans = 0
for i, aa in enumerate(a):
    calc += aa
    if calc > x:
        break
    else:
        ans += 1
if (i == n-1) & (ans == x):
    ans += 1
if calc < x:
    ans = i
print(ans)

Measured memory_bytes: 3064
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
 
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;
 
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
 
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;
 
#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
 
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define ins insert
#define watch(x) cout << (#x) << " is " << (x) << endl
 
bool isPrime(int i) {
	if(i < 2) {
		return false;
	}
	if(i == 2) {
		return true;
	}
	if(!(i % 2)) {
		return false;
	}
	for(int j = 3; j * j <= i; j += 2) {
		if(!(i % j)) {
			return false;
		}
	}
	return true;
}
void solve() {
	int n;
	cin >> n;
	if(n >= 30) {
		cout << "Yes";
	}
	else {
		cout << "No";
	}

}

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0); 
	// #ifndef ONLINE_JUDGE
	// freopen("input.txt", "r", stdin);
	// freopen("output.txt", "w", stdout);
	// #endif
    int T = 1; 
    // cin >> T;
    while(T--)
    	solve();
	return 0;
}


Measured memory_bytes: 3608
import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, core.stdc.string;

immutable long MOD = 10^^9 + 7;

void main() {
    auto s = readln.split.map!(to!int);
    auto N = s[0];
    auto M = s[1];
    auto A = M.iota.map!(_ => readln.split.map!(to!int).array).array;
    auto P = readln.split.map!(to!int).array;

    int ans = 0;

    foreach (mask; 0..(1<<N)) {
        bool ok = true;
        foreach (i; 0..M) {
            int p = 0;
            foreach (j; 1..A[i].length.to!int) {
                int x = A[i][j] - 1;
                if (mask & (1 << x)) {
                    p ^= 1;
                }
            }
            if (p != P[i]) {
                ok = false;
                break;
            }
        }
        ans += ok;
    }

    ans.writeln;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main (){
	int n;
	cin >> n;
	while (n != 0){
		if (n%10 == 7){
			cout << "Yes";
			return 0;
		}
		n /= 10;
	}
	cout << "No";
	return 0;
}

Measured memory_bytes: 3636
#include<stdio.h>
int main(void){
    int D;
    scanf("%d",&D);
    if(D == 25) printf("Christmas\n");
    if(D == 24) printf("Christmas Eve\n");
    if(D == 23) printf("Christmas Eve Eve\n");
    if(D == 22) printf("Christmas Eve Eve Eve\n");
    return 0;
}

Measured memory_bytes: 128
import math
S=int(input())
ss=math.sqrt(S)
s=math.ceil(ss)
t=s*s-S
if t>10**9:
    for n in range(2,t+1):
        if t%n==0:
            k=n
            break
elif t>0:
    k=1
    print(0,0,s,k,round(t/k),s)
if t==0:
    print(0,0,s,0,0,s)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
#include <sstream>
#include<ctime>
using namespace std;
#define ll long long int
#define ld long double
#define key pair<ld,ld>
#define ii pair<int,int>
#define si set<int>
#define mii map<int,int>
#define vii vector<pair<int,int> >
#define vi vector<int>
#define vll vector<ll>
#define vb vector<bool>
#define vvi vector<vector<int> >
#define vs vector<string>
#define all(v) v.begin(),v.end()
#define rep(i,l,r) for(int i=l;i<r;i++) 
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define nu 100001
#define mod 998244353 
#define mul(x,y) ((ll)(x)*(y))%mod
#define tr(c,i) for(auto i = (c).begin(); i != (c).end(); i++)
#define fastio  ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define INF 0x3f3f3f3f
ll MOD(ll a, ll b)
{
    if(a>b)
    return a-b;
    else
    return b-a;
}
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;
}
ll logg(ll a)
{
    ll x=0;
    while(a>1)
    {
        x++;
        a/=2;
    }
    return x;
 
}
int main()
{
    fastio;
    int a,b;
    cin>>a>>b;
    cout<<max(0,a-2*b);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define ALL(v) (v).begin(), (v).end()

using namespace std;
using ll = long long;

template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
const ll LINF = 1e18;

int main()
{
  int A, B; cin >> A >> B;
  cout << max(0, (A-2*B)) << endl;
}

Measured memory_bytes: 256
// Goods things are coming, just keep believing 
 
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
using namespace __gnu_pbds;
using namespace std;
 
 
#define FOR(i, x, n) for(ll i = x; i < n; i++) 
#define pb push_back
#define pf push_front
#define ll long long
#define hii cout << "hii" << endl
#define okay cout << "okay" << endl
// #define hey cout << "hey" << endl
#define pii pair<int, int>
#define pll pair<ll, ll>
// #define mpp make_pair
#define endl '\n'
#define ff first 
#define int long long
#define ss second
#define vi vector<int>
#define all(s) s.begin(), s.end()
#define si size()
 #define ld long double
#define INF 1000000000;
 
template <class T> ostream& operator << (ostream &os, const vector<T> &v) { for (T i : v) os << i << ' '; return os; }
template <class T> ostream& operator << (ostream &os, const set<T> &v) { for (T i : v) os << i << ' '; return os; }
template <class T, class S> ostream& operator << (ostream &os, const pair<T, S> &v) { os << v.first << ' ' << v.second; return os; }
template <class T, class S> ostream& operator << (ostream &os, const unordered_map<T, S> &v) { for (auto i : v) os << '(' << i.first << "=>" << i.second << ')' << ' '; return os; } 
 
 
 
#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <class Arg1> void __f(const char* name, Arg1&& arg1) { cerr << name << " : " << arg1 << endl; }
    template <class Arg1, class... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args) {
        const char* sep = strchr(names + 1, ',');
        cerr.write(names, sep - names) << " : " << arg1 << "  ";
        __f(sep + 1, args...);
    }
#else
#define trace(...) 0
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("avx2,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define _CRT_SECURE_NO_WARNINGS
#endif // ifndef ONLINE_JUDGE
 
typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;
 
 
 
const int N = 2e5 + 5;
const int LG = 20;
const int mod = 1e9 + 7;

int arr[N];

int n, m;
int diff[N];
int pref[N];

void solve()
{
	int a, b;
	cin  >> a >> b;
	cout << 6 - a - b << endl;
}
 
int32_t main()
{
	ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
	int t = 1;
	// cin >> t;
	while(t--)
	{
		solve();
	}
}

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

using namespace std;

int main()
{
    vector<int> count(5, 0);
    int n;
    long long answer, tmp;
    answer = 0;
    bitset<5> b;
    string name;
    
    cin >> n;
    for(int i=0; i<n; ++i){
        cin >> name;
        if(name[0] == 'M'){
            count[0]++;
        }
        else if(name[0] == 'A'){
            count[1]++;
        }
        else if(name[0] == 'R'){
            count[2]++;
        }
        else if(name[0] == 'C'){
            count[3]++;
        }
        else if(name[0] == 'H'){
            count[4]++;
        }
    }
    for(int i=0; i<32; ++i){
        b = static_cast<bitset<5>>(i);
        if(b.count() != 3){
            continue;
        }
        else {
            tmp = 1;
            for(int j=0; j<5; ++j){
                if(b[j] == 1){
                    tmp *= count[j];
                }
            }
            answer += tmp;
        }
    }
    cout << answer << endl;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(void) {
	char n;
	scanf("%c", &n);
	if (n == 'A') {
		printf("T\n");
	}
	else if (n == 'T') {
		printf("A\n");
	}
	else if (n == 'C') {
		printf("G\n");
	}
	else if (n == 'G') {
		printf("C\n");
	}
	return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<functional>
#include<cmath>
#include<random>
#include<map>
using namespace std;
#define int long long
const long long mod = 1000000007;

int kaijo[200005];
int ikaijo[200005];
int modp(int x, int n, int md) {
	if (n == 0)return 1;
	int res = modp(x*x%md, n / 2, md);
	if (n & 1)res = res*x%mod;
	return res;
}

signed main() {
	int h, w, a, b; cin >> h >> w >> a >> b;
	kaijo[0] = 1;
	for (int i = 1; i <= h+w; i++)kaijo[i] = (kaijo[i - 1] * i)%mod;
	for (int j = 0; j <= h + w; j++) {
		ikaijo[j] = modp(kaijo[j], mod - 2, mod);
	}
	int ans = 0;
	for (int i =  b + 1; i <= w; i++) {
		int x = h - a, y = i, X = a, Y = w-i+1;
		int cm = (kaijo[x + y - 2] * ikaijo[x - 1] %mod* ikaijo[y - 1])%mod;
		int CM = (kaijo[X + Y - 2] * ikaijo[X - 1]%mod * ikaijo[Y - 1])%mod;
		ans += ((cm * CM) % mod);
		ans %= mod;
			}
	cout << ans << endl;
}

Measured memory_bytes: 3328
#![allow(unused_imports)]

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

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $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, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (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")
    };
}

use std::cmp::{min, max};
use std::collections::{HashMap, HashSet, VecDeque, BinaryHeap};

fn main() {
    input!{
        s: chars
    }
    println!("{}", s.iter().take(3).collect::<String>());
}


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

int main(){
	int n, m;
	cin >> n >> m;
	
	int load[m][2];

	for(int i = 0; i < m; ++i)
		cin >> load[i][0] >> load[i][1];

	int flag[n];
	for(int i = 0; i < n; ++i)
		flag[i] = 0;

	for(int i = 0; i < m; ++i){
		flag[load[i][0] - 1] += 1;
		flag[load[i][1] - 1] += 1;
	}

	bool jud = 1;

	for(int i = 0; i < n; ++i){
		if(flag[i] % 2 == 1){
			jud = 0;
			cout << "NO\n";
			break;
		}
	}

	if(jud == 1)
		cout << "YES\n";

	return 0;
}	

Measured memory_bytes: 1408
#include <stdio.h>
#include <stdlib.h>

int main()
{
    int a, b;
    scanf("%d %d",&a,&b);
    if (((a + b)%3) == 0 || (a%3) == 0 || (b%3) == 0)
    {
        printf("Possible\n");
    }
    else
    {
        printf("Impossible\n");
    }
    return 0;
}


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

#define MAX_N 100000

using namespace std;

int  n, m;

vector <int> g[MAX_N + 1];

void add(int a, int b)
{
    g[a].push_back(b);
}

int viz[MAX_N + 1];
int que[MAX_N + 1];
int dist[MAX_N + 1];
int tata[MAX_N + 1];

void bfs()
{
    int st = 1, dr = 0;
    viz[1] = 1;
    dist[1] = 0;
    que[++ dr] = 1;

    while(st <= dr)
    {
        int cr = que[st ++];

        for(auto u : g[cr])
        {
            if(viz[u] == 0)
            {
                viz[u] = 1;
                que[++ dr] = u;
                dist[u] = dist[cr] + 1;
                tata[u] = cr;
            }
        }
    }

    if(dr != n)
    {
        cout << "No\n";
        exit(0);
    }
}

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

    for(int i = 1; i <= m; i ++)
    {
        int a, b;
        cin >> a >> b;
        add(a, b);
        add(b, a);
    }

    bfs();

    cout << "Yes\n";
    for(int i = 2; i <= n; i ++)
        cout << tata[i] << "\n";

    return 0;
}


Measured memory_bytes: 11376
#include<iostream>
#include<algorithm>
#include<vector>
#include<cstring>
using namespace std;
#define ll long long





int main() {


	ll n, k;
	cin >> n >> k;

	ll a[n];
	ll dp[n];

	for (ll i = 0; i < n; i++) {
		cin >> a[i];
	}
	dp[0] = 0;
	dp[1] = dp[0] + abs(a[1] - a[0]);

	for (ll i = 2; i < n; i++) {

		ll r = INT_MAX;

		for (ll j = 1; j <= k && (i - j) >= 0; j++) {
			r = min((dp[i - j] + abs(a[i] - a[i - j])), r);
		}

		dp[i] = r;
	}

	cout << dp[n - 1];


}


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

int	main()
{
	int N, M;
	cin >> N >> M;
	int A;
	int rest = N;
	for (int i = 0; i < M; ++i) {
		cin >> A;
		rest -= A;
		if (rest < 0) {
			cout << -1 << endl;
			return 0;
		}
	}
	cout << rest << endl;
	return 0;
}


Measured memory_bytes: 3636
import java.util.Scanner;
class Main{
    public static void main(String args[]) {
            Scanner scanner = new Scanner(System.in);

            int a = scanner.nextInt();
            int b = scanner.nextInt();
            int c = scanner.nextInt();
            
            if(a < b && b < c) {
               System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  }
}

Measured memory_bytes: 26240
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll mod = 1000000007;
const int INF = 1001001001;

template<class Type>
Type modpow(Type a, Type n, Type mod)
{
	Type res = 1;
	while (0 < n) {
		if (n & 1) {
			res = res * a % mod;
		}
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}

template<class Type>
Type gcd(Type x, Type y)
{
	Type r;
	if (x < y) swap(x, y);

	while (0 < y) {
		r = x % y;
		x = y;
		y = r;
	}
	return x;
}

template<class Type>
Type lcm(Type x, Type y)
{
	return x * y / gcd(x, y);
}

template<class Type>
bool is_prime(Type x)
{
	if (x == 2) return true;
	if (x < 2 || x % 2 == 0) return false;

	for (Type i = 3; i <= sqrt(x); i += 2) {
		if (x % i == 0) return false;
	}
	return true;
}

template<class Type>
vector<bool> eratos(Type n)
{
	vector<bool> isPrime(n + 1, true);
	isPrime[0] = isPrime[1] = false;
	for (Type i = 2; i <= n; i++) {
		if (isPrime[i]) {
			Type j = i + i;
			while (j <= n) {
				isPrime[j] = false;
				j = j + i;
			}
		}
	}
	return isPrime;
}

bool binary_search_judge(vector<int> a, int index, int key)
{
	if (key <= a[index]) return true;
	else return false;
}

int binary_search(vector<int> a, int key)
{
	int ng = -1;
	int ok = a.size();
	while (1 < abs(ng - ok)) {
		int mid = (ng + ok) / 2;
		if (binary_search_judge(a, mid, key)) ok = mid;
		else ng = mid;
	}
	return a[ok] == key;
}

int main()
{
	int n, m, l;
	cin >> n >> m >> l;

	vector<vector<ll>> a(n, vector<ll>(m));
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++) {
			cin >> a[i][j];
		}
	}

	vector<vector<ll>> b(m, vector<ll>(l));
	for (int i = 0; i < m; i++) {
		for (int j = 0; j < l; j++) {
			cin >> b[i][j];
		}
	}

	vector<vector<ll>> c(n, vector<ll>(l));
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < l; j++) {
			for (int k = 0; k < m; k++) {
				c[i][j] += a[i][k] * b[k][j];
			}
		}
	}

	for (int i = 0; i < n; i++) {
		for (int j = 0; j < l; j++) {
			if (j == l - 1) cout << c[i][j] << endl;
			else cout << c[i][j] << " ";
		}
	}
}


Measured memory_bytes: 3200
def main():
    n = int(input().strip())
    a = [int(i.strip()) for i in input().split(' ')]

    ans = 0
    for i in a:
        c = 0
        while True:
            if i > 0 and i % 2 == 0:
                c += 1
                i /= 2
            else:
                break
        ans += c

    print(ans)
    

if __name__ == '__main__':
    main()


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

int x[1005], y[1005];

int main(){
	int w, h, n;
	cin >> w >> h >> n;
	
	for(int i = 0; i < n; i++) cin >> x[i] >> y[i];
	
	int ans = 0;
	for(int i = 1; i < n; i++){
		int dx = x[i]-x[i-1];
		int dy = y[i]-y[i-1];
		if(dx*dy >= 0) ans += max(abs(dx),abs(dy));
		else ans += abs(dx)+abs(dy);
	}
	
	cout << ans << endl;
	
	return 0;
}


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

int main(){
    int N;
    cin >> N;
    vector<int> A(N);
    for (int i = 0; i < N; i++) cin >> A.at(i);
    int odd = 0;

    for (int i = 0; i < N; i++) {
        if (A.at(i) % 2 == 1) odd++;
    }
    if (odd % 2 == 0) cout << "YES" << endl;
    else cout << "NO" << endl;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#define rep(i,a,b) for(ll i=ll(a);i<ll(b);i++)
#define irep(i,a,b) for(ll i=ll(a);i>ll(b);i--)
using ll = long long;
using namespace std;

ll GCD(ll a, ll b) { return b ? GCD(b, a%b) : a; }
//sort(a, a + N, greater<ll>())   // descend
//sort(a, a+N)                    //  ascend

/* 
void comb(vector<vector <ll> > &v) {
	ll mod=1000000007;
	rep (i,0,v.size()) {
		v[i][0] = 1;
		v[i][i] = 1;
	}
	rep (k,1,v.size()) {
		rep (j,1,k) {
			v[k][j] = (v[k - 1][j - 1] + v[k - 1][j])%mod;
		}
	}
}
/*main内でnCn~nC0 生成 **
vector<vector<ll> > v(n + 1, vector<ll>(n + 1, 0));
comb(v);
*/


int main(){
	ll n;
	cin>>n;
	ll a[220000];
	rep(i,0,n)cin>>a[i];
	ll qq=0;
	ll ans=0;
	ll ans2=0;
	ll first=0;
	ll second=0;
	ll sss=0;


	rep(i,0,n){
		if(ans<=a[i]){
			second=ans;
			ans=a[i];
			sss=i;
		}
	}
		rep(i,0,n){
		if(a[i]!=ans &&ans2<=a[i]){
			ans2=a[i];
		}
	}
	ll cnt=0;
	rep(i,0,n){
		if(a[i]==ans){
			cnt++;
		}
	}
	rep(i,0,n){
		if(i==sss &&cnt<=1) cout<<ans2<<endl;
		else cout<<ans<<endl;
	}
}






Measured memory_bytes: 3200
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <cmath>
#include <climits>
#include <math.h>
#include <bitset>

#define X first
#define Y second
#define vsort(v) sort(v.begin(), v.end())
#define vrev(v) reverse(v.begin(), v.end())
#define P pair

// stoi(s): string to int
// stod(s): string to double

// INT_MAX
// INT_MIN
// LLONG_MAX
// LLONG_MIN
// DBL_MIN
// DBL_MAX
// LDBL_MIN
// LDBL_MAX

// A-Z: 65~90
// a-z: 97~122
// |a-z| = 26

// 2進数変換
// string s = bitset<20>(x).to_string();

using namespace std;
using ll = long long;

int main(int argc, const char *argv[])
{
    int n, m;
    cin >> n >> m;
    vector<P<ll, int>> v(n);
    for (int i = 0; i < n; i++)
    {
        cin >> v[i].X >> v[i].Y;
    }
    vsort(v);

    ll sum = 0;
    int cnt = 0;
    for (int i = 0; i < n && cnt < m; i++)
    {
        sum += v[i].X * min(v[i].Y, m - cnt);
        cnt += min(v[i].Y, m - cnt);
    }
    cout << sum << endl;
}


Measured memory_bytes: 1792
/********************************************
 *Author*        :ZZZZone
 *Created Time*  : 六 12/23 19:59:05 2017
 * Ended  Time*  : 六 12/23 20:05:07 2017
*********************************************/

#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <stack>
using namespace std;
typedef pair<int, int> PII;
typedef long long LL;
typedef unsigned long long ULL;

inline void OPEN(string s){
	freopen((s + ".in").c_str(), "r", stdin);
	freopen((s + ".out").c_str(), "w", stdout);
}

ULL n, m;

int main()
{
	while(~scanf("%llu %llu", &n, &m)){
		int ans = 1;
		while(true){
			n = n * 2LL;
			if(n > m) break;
			ans++;
		}
		printf("%d\n", ans);
	}
    return 0;
}


Measured memory_bytes: 256
'use strict'

function main(s) {

  const orders = s.split('\n').slice(1, -1).map(n => Number(n));
  const list = {};

  for (const num of orders) {
    if (list[num]) {
      delete list[num];
    } else {
      list[num] = num;
    }
  }

  const ans = Object.keys(list).length;
  console.log(ans);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));


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

double dist(pair<int, int> p1, pair<int, int> p2){
    double dx = p1.first - p2.first;
    double dy = p1.second - p2.second;
    double d = dx * dx + dy * dy;
    return sqrt(d);
}

int factorial(int n){
    int ans = 1;
    for(int i = 1; i <= n; i++) ans *= i;
    return ans;
}

int main(){
    int N; cin >> N;
    vector<pair<int, int>> p(N);
    for(int i = 0; i < N; i++){
        int x, y; cin >> x >> y;
        p[i] = make_pair(x, y);
    }

    double ans = 0;
    vector<int> v(N);
    for(int i = 0; i < N; i++) v[i] = i;
    do{
        for(int i = 0; i < N - 1; i++) ans += dist(p[v[i]], p[v[i + 1]]);
    }while(next_permutation(v.begin(), v.end()));

    ans /= factorial(N);
    cout << setprecision(10) << ans << endl;
}

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

typedef struct{
  double x;
  double y;
}Ten;

void kock(int,Ten,Ten);

int main(){
  int n;
  Ten p1,p2;
  p1.x=0.0;
  p1.y=0.0;
  p2.x=100.0;
  p2.y=0.0;

  scanf("%d",&n);
  printf("%.8f %.8f\n",p1.x,p1.y);
  kock(n,p1,p2);
  printf("%.8f %.8f\n",p2.x,p2.y);
  
  return 0;
}

void kock(int n,Ten p1,Ten p2){
  Ten s,t,u;
  if(n==0)
    return;
  s.x=(2*p1.x+1*p2.x)/3;
  s.y=(2*p1.y+1*p2.y)/3;
  t.x=(1*p1.x+2*p2.x)/3;
  t.y=(1*p1.y+2*p2.y)/3;
  u.x=(t.x-s.x)/2-(t.y-s.y)*(sqrt(3)/2)+s.x;
  u.y=(t.x-s.x)*(sqrt(3)/2)+(t.y-s.y)/2+s.y;
  
  kock(n-1,p1,s);
  printf("%.8f %.8f\n",s.x,s.y);
  kock(n-1,s,u);
  printf("%.8f %.8f\n",u.x,u.y);
  kock(n-1,u,t);
  printf("%.8f %.8f\n",t.x,t.y);
  kock(n-1,t,p2);
    
}



Measured memory_bytes: 2108
#include <cstdio>
#include <algorithm>  
#include <bitset>
#include <cassert>
#include <ctime>  
#include <cmath>  
#include <cstdlib>  
#include <cstring>  
#include <functional>  
#include <iostream>  
#include <deque>  
#include <stack>
#include <queue>  
#include <vector>  
#include <map>  
#include <set>  
#include <string>  
#include <unordered_map>  
#include <unordered_set>  
#pragma warning(disable:4996)

using namespace std;

#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define endl '\n'

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

const int INF = 1e9;
const int MAXN = 2e5 + 5;

int N, M, K, A[11][1005], ans=INF;
char s[1005];

int sum[11];
int cal(vector<int> &v) {
	memset(sum, 0, sizeof(sum));
	int ret = 0;
	for(int i=1; i<=M; i++) {
		for(int j=0; j+1<v.size(); j++) {
			int l = v[j]+1, r = v[j+1];
			for(int k=l; k<=r; k++) sum[j] += A[k][i];
		}

		bool pos = 1;
		for(int j=0; j+1<v.size(); j++) {
			if(sum[j] > K) {
				pos = 0;
				break;
			}
		}

		if(!pos) {
			memset(sum, 0, sizeof(sum));
			for(int j=0; j+1<v.size(); j++) {
				int l = v[j]+1, r = v[j+1];
				for(int k=l; k<=r; k++) sum[j] += A[k][i];
				if(sum[j] > K) return INF;
			}
			ret++;
		}
	}
	return ret + v.size()-2;
}

int main() {
	ios::sync_with_stdio(0); cin.tie(0);
	cin >> N >> M >> K;
	for(int i=1; i<=N; i++) {
		cin >> s+1;
		for(int j=1; j<=M; j++) A[i][j] = s[j]-'0';
	}
	for(int i=0; i<(1<<(N-1)); i++) {
		vector<int> v;
		v.push_back(0);
		for(int j=0; j<N-1; j++) if((1 << j) & i) v.push_back(j+1);
		v.push_back(N);
		ans = min(ans, cal(v));
	}
	cout << ans;
}

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

ll gcd(ll a, ll b){
    while (b){
        ll c = a;
        a = b;
        b = c % b;
    }
    return a;
}

int main(){
    int n;
    cin >> n;
    ll ret = 0;
    for (int i = 1; i <= n; i++){
        for (int j = 1; j <= n; j++){
            for (int k = 1; k <= n; k++){
                ret += gcd(gcd(i, j), k);
            }
        }
    }
    cout << ret << endl;
    return 0;
}

Measured memory_bytes: 3636
n, m = map(int, input().split())
ac = [False] * n
wa = [0] * n
u, v = 0, 0
for i in range(m):
    p, s = input().split()
    p = int(p)
    if ac[p - 1]:
        continue
    if s == 'AC':
        ac[p - 1] = True
        u += 1
        v += wa[p - 1]
    elif s == 'WA':
        wa[p - 1] += 1
print(u, v)

Measured memory_bytes: 4596
n, x = map(int, input().split())
a = list(map(int, input().split()))
ans = 0
if a[0] > x:
    ans += a[0] - x
    a[0] = x
for i in range(1, n):
    if a[i] + a[i - 1] > x:
        ans += a[i] + a[i - 1] - x
        a[i] = x - a[i - 1]
print(ans)

Measured memory_bytes: 14060
// In the name of GOD
#include<bits/stdc++.h>
using namespace std;

#define debug(x) cout<<#x<<" :: "<<x<<"\n";
#define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\n";
#define debug3(x,y,z) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<"\n";

#define     IOS         ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define 	setprecn(x) cout<<fixed<<setprecision(x);
#define 	ll          long long int
#define 	pb          push_back
#define 	pll         pair<ll,ll>
#define 	vll         vector<ll>
#define 	ff          first
#define 	ss          second
#define 	all(a)      (a).begin(),(a).end()
#define 	sz(x)       (ll)x.size()
#define 	mod         1000000007
#define 	inf         10000000000000007
#define 	rep(i,n)    for(ll i=0;i<n;i++)
#define 	repe(i,a,b) for(ll i=a;i<b;i++)
#define 	lbnd        lower_bound
#define 	ubnd        upper_bound
#define 	bs          binary_search

ll power(ll a,ll b,ll m=mod)
{
	if(b==0)
		return 1;
	if(b==1)
		return a;
	ll c=power(a,b/2,m);
	if(b%2==0)
		return((c%m)*(c%m))%m;
	return ((((c%m)*(c%m))%m)*(a%m))%m;
}

/********************************************************/
//	d.erase(unique(all(d)), d.end());



int main()
{
	IOS;
	ll n,k,m,i,j,c=0,cs=0,t;
	t=1;

	// cin>>t;
	string s,s1,s2;
	while(t--)
	{
		cin>>n>>s;
		// n=s.length();
		// ll a[n];
		s1=s.substr(0,n/2);
		s2=s.substr(((n/2)),n/2);
		if(n%2 || s1!=s2)
			cout<<"No";//<<s1<<"**"<<s2;
		else cout<<"Yes";

		if(t!=0)
	   		cout<<"\n";
	}
	return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#define ll long long
using namespace std;

int kai(int n) {
  int sum=0;
  for(int i=1;i<=n;i++) {
    sum+=i;
  }
  return sum;
}

int main() {
  int a,b;
  cin>>a>>b;
  cout<<kai(b-a-1)-a<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define f(i,x,n) for(int i=x;i<n;i++)
#define all(c) c.begin(),c.end()
#define int ll
#define print(x) cerr << (#x) << "is "<< x << "\n"
using ll = long long;
using pii = pair<int,int>;
const int MOD = 1e9+7, N = 1e5 + 10; 

int32_t main(){
   ios::sync_with_stdio(false);
   cin.tie(NULL);
   string s;
   cin >> s;
   int x; cin >> x;
   for(int i=0;i<s.length();i+=x){
      cout << s[i];
   }
   return 0;
} 

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define nl cout<<endl

#define pii pair<ll,ll>
#define vi  vector<ll>
#define vii vector<pii>
#define mi  map<ll,ll>
#define all(a)  (a).begin(),(a).end()

#define pb push_back
#define ff first
#define ss second
#define hell 1000000007

#define test4(x,y,z,a) cout<<"x is "<<x<<"		y is "<<y<<"		z is "<<z<<"		a is "<<a<<endl;
#define test3(x,y,z) cout<<"x is "<<x<<"		y is "<<y<<"		z is "<<z<<endl;
#define test2(x,y) cout<<"x is "<<x<<"		y is "<<y<<endl;
#define test1(x) cout<<"x is "<<x<<endl;
#define N 300009

ll power(ll a,ll b,ll m)
{
	ll ans=1;
	while(b)
	{
		if(b&1)
			ans=(ans*a)%m;
		b/=2;
		a=(a*a)%m;
	}
	return ans;
}
int main()
{	
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
        
	ll a,b,c,k;
	cin>>a>>b>>c>>k;

	ll ans=0;
	if(k>=a)
	{
		ans+=a;
		k-=a;
	}
	else
	{
		ans+=k;
		k=0;
		cout<<ans<<endl;
		return 0;
	}

	if(k>=b)
	{
		k-=b;
	}
	else
	{
		k=0;
		cout<<ans<<endl;
		return 0;
	}

	ans-=k;
	cout<<ans<<endl;
}

Measured memory_bytes: 3580
import java.util.Scanner;

public class Main {

	static Scanner scanner;
	public static void main(String[] args) {
	    scanner = new Scanner(System.in);

	    String o= gs();


        System.out.print(o.replaceAll(",", " "));

	   
	}

	// 文字列として入力を取得
	public static String gs() {
		return scanner.next();
	}

	// intとして入力を取得
	public static int gi() {
		return Integer.parseInt(scanner.next());
	}

	// longとして入力を取得
	public static long gl() {
		return Long.parseLong(scanner.next());
	}
}

Measured memory_bytes: 35852
N = int(input())
H = [list(map(int, input().split())) for _ in range(N)]

dp = [[0] * 3 for _ in range(N+1)]
# 0: umi, 1: yama, 2: HW

for i in range(1, N+1):
  for place in range(3):
    for place_y in range(3):
      if (place == place_y): continue
      dp[i][place] = max(
        dp[i][place],
        dp[i-1][place_y] + H[i-1][place]
      )

print(max(dp[-1]))


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

int main() {
    // input
    string O, E;
    cin >> O >> E;

    // solve & output
    for (int i = 0; i < O.length() + E.length(); ++i) {
        if (i % 2 == 0) cout << O[i / 2];
        else cout << E[i / 2];
    }

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  int a = 0;
  int b = 1000000000;
  for (int i = 0; i < N; i++) {
    int A;
    cin >> A;
    a = max(a,A);
    b = min(b,A);
  }
    
  cout << a - b << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
const double EPS = 1e-9;
typedef pair<int, int> P;
typedef unsigned int ui;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef long double ld;
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
//上、前、右、奥、左、下の順に
struct dice { int f1, f2, f3, f4, f5, f6; };
dice ident(int a, int b) {
	dice res;
	int c;
	if (a == 1) {
		if (b == 2)c = 3;
		else if (b == 3)c = 5;
		else if (b == 5)c = 4;
		else c = 2;
	}
	else if (a == 2) {
		if (b == 1)c = 4;
		else if (b == 4)c = 6;
		else if (b == 6)c = 3;
		else c = 1;
	}
	else if (a == 3) {
		if (b == 1)c = 2;
		else if (b == 2)c = 6;
		else if (b == 5)c = 1;
		else c = 5;
	}
	else if (a == 4) {
		if (b == 1)c = 5;
		else if (b == 5)c = 6;
		else if (b == 6)c = 2;
		else c = 1;
	}
	else if (a == 5) {
		if (b == 1)c = 3;
		else if (b == 3)c = 6;
		else if (b == 6)c = 4;
		else c = 1;
	}
	else {
		if (b == 2)c = 4;
		else if (b == 3)c = 2;
		else if (b == 5)c = 3;
		else c = 5;
	}
	res = { a,b,c,7 - b,7 - c,7 - a };
	return res;
}
dice rollfront(dice x) {
	dice res;
	res = { x.f4,x.f1,x.f3,x.f6,x.f5,x.f2 };
	return res;
}
dice rollback(dice x) {
	dice res;
	res = { x.f2,x.f6,x.f3,x.f1,x.f5,x.f4 };
	return res;
}
dice rollright(dice x) {
	dice res;
	res = { x.f5,x.f2,x.f1,x.f4,x.f6,x.f3 };
	return res;
}
dice rollleft(dice x) {
	dice res;
	res = { x.f3,x.f2,x.f6,x.f4,x.f1,x.f5 };
	return res;
}
int main() {
	int n;
	while (cin >> n, n) {
		int cnt[201][201] = {};
		int face[201][201] = {};
		rep(i, n) {
			int a, b; cin >> a >> b;
			dice x = ident(a, b);
			P now = { 100,100 };
			while (true) {
				int c = cnt[now.first][now.second];
				bool f = false;
				for (int k = 6; k >= 4;k--) {
					if (x.f2 == k && cnt[now.first - 1][now.second] < c) {
						now.first--; x = rollfront(x); f = true; break;
					}
					else if (x.f3 == k && cnt[now.first][now.second + 1] < c) {
						now.second++; x = rollright(x); f = true; break;
					}
					else if (x.f4 == k && cnt[now.first + 1][now.second] < c) {
						now.first++; x = rollback(x); f = true; break;
					}
					else if (x.f5 == k && cnt[now.first][now.second - 1] < c) {
						now.second--; x = rollleft(x); f = true; break;
					}
				}
				if (f)continue;
				break;
			}
			cnt[now.first][now.second]++; face[now.first][now.second] = x.f1;
		}
		int out[7] = {};
		rep(i, 201) {
			rep(j, 201) {
				out[face[i][j]]++;
			}
		}
		rep1(i, 6) {
			cout << out[i];
			if (i < 6)cout << " ";
		}
		cout << endl;
	}
	return 0;
}



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

int n,m,s[3001],pf[3001];
int comb[3001][3001];
vector<pair<int,int>> v;
const int mod=1e9+7;

int range1(int s,int e){ return pf[e]-pf[s-1]; }
int range0(int s,int e){ return e-s+1-range1(s,e); }

int dp[3001][3001];

int f(int now,int befleft1,int befleft0)
{
	if(now==v.size()) return 1;

	if(~dp[now][befleft1]) return dp[now][befleft1];

	int now1, now0;
	if(now==0 || v[now-1].second < v[now].first)
	{
		now1=range1(v[now].first, v[now].second);
		now0=range0(v[now].first, v[now].second);
	}
	else
	{
		now1=befleft1+range1(v[now-1].second+1, v[now].second);
		now0=befleft0+range0(v[now-1].second+1, v[now].second);
	}

	long long ans=0;
	if(now==v.size()-1 || v[now].second < v[now+1].first)
	{
		int should = v[now].second - v[now].first + 1;
		ans+=comb[should][now1]*1ll*f(now+1,0,0);
		ans%=mod;
	}
	else
	{
        int should = v[now+1].first - v[now].first;
        for(int i=max(0,should-now0); i<=min(should,now1); i++)
        {
			ans+=comb[should][i]*1ll*f(now+1, now1-i, now0-(should-i));
			ans%=mod;
        }
	}
	return dp[now][befleft1]=ans;
}

int main()
{
	memset(dp,-1,sizeof(dp));
    scanf("%d %d",&n,&m);
    for(int i=1;i<=n;i++)
    {
		scanf("%1d",&s[i]);
		pf[i]=pf[i-1]+s[i];
	}
	for(int i=1;i<=n;i++)
		for(int j=0;j<=i;j++)
		{
			if(j==0 || j==i) comb[i][j]=1;
			else comb[i][j]=(comb[i-1][j-1]+comb[i-1][j])%mod;
		}
    for(int i=1,l,r;i<=m;i++)
    {
		scanf("%d %d",&l,&r);
		if(v.empty()) v.push_back(make_pair(l,r));
		else if(v.back().second >= r) continue;
		else if(v.back().first == l) v.back().second = r;
		else v.push_back(make_pair(l,r));
	}
	printf("%d\n",f(0,0,0));
	return 0;
}


Measured memory_bytes: 63104