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

using namespace std;

#define YES cout << "YES" << endl;
#define NO  cout << "NO"  << endl;
#define Yes cout << "Yes" << endl;
#define No  cout << "No"  << endl;
 
#define INF INT_MAX
#define MOD 1000000007
#define PI  acos(-1)

using ll  = long long;
using ull = unsigned long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

#define rep(i, n) for (ll i = 0; i < (n); i++)
#define rrep(i, n) for (ll i = (n)-1; i >= 0; i--)

int main(int argc, char *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    ll N;
    cin >> N;

    vector<ll> A(N), B(N), C(N);
    rep (i, N) {
        cin >> A[i];
    }
    rep (i, N) {
        cin >> B[i];
    }
    rep (i, N) {
        cin >> C[i];
    }

    sort(A.begin(), A.end());
    sort(B.begin(), B.end());
    sort(C.begin(), C.end());

    ll ans = 0;
    rep (i, N) {
        auto it1 = lower_bound(A.begin(), A.end(), B[i]);
        auto it2 = upper_bound(C.begin(), C.end(), B[i]);
        ans += (it1-A.begin())*(C.end()-it2);
    }

    cout << ans << endl;
    return 0;
}

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

#define INF 0x3FFFFFFF

using namespace std;

vector<vector<int>> adjlist;
vector<int> dist;

int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  adjlist.resize(n);
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    a--;
    b--;
    adjlist[a].push_back(b);
    adjlist[b].push_back(a);
  }

  dist.assign(n, INF);
  dist[0] = 0;
  queue<int> q;
  q.push(0);
  while (!q.empty()) {
    int v = q.front();
    q.pop();
    for (int w : adjlist[v]) {
      if (dist[w] == INF) {
        dist[w] = dist[v] + 1;
        if (dist[w] < 2) q.push(w);
      }
    }
  }
  if (dist[n - 1] == INF) printf("IMPOSSIBLE\n");
  else printf("POSSIBLE\n");
  return 0;
}


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

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

    int left, right;
    cin >> left >> right;
    for (int i = 1; i < m; i++) {
        int l, r;
        cin >> l >> r;
        
        if (left <= l) left = l;
        if (r <= right) right = r;
    }

    if (left > right) cout << 0 << endl;
    else cout << right - left + 1 << endl;

    return 0;
}

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

using namespace std;

#define rep(i, a, b) for (int i = (a); i < (b); ++i)
#define sz(s) (int)s.size()

int main() {
    string s;
    cin >> s;
    set<char> f;
    for (char c : s) f.insert(c);
    for (char c = 'a'; c <= 'z'; ++c)
    if (f.find(c) == f.end()) {cout << c; return 0;}
    cout << "None\n";
}

Measured memory_bytes: 512
N,K=map(int,input().split())
S=input()
if S[K-1]=="A":
  S=S[:K-1]+"a"+S[K:]
elif S[K-1]=="B":
  S=S[:K-1]+"b"+S[K:]
else:
  S=S[:K-1]+"c"+S[K:]
print(S)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define rep1(i, n) FOR(i, 1, n+1)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; --i)
#define whole(x) (x).begin(),(x).end()
#define rwhole(x) (x).rbegin(), (x).rend()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
#define P pair<int, int>
#define debug(var) cerr << "[" << #var << "] " << var << endl
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
const ll mod = 1000000007;
const int dx[] = {0,0,1,1};
const int dy[] = {0,1,0,1};


int main(){
    int n;
    cin >> n;
    string s;
    cin >> s;
    char z[2] = {'S', 'W'};
    rep(di, 4) {
        string ans(n+2, ' ');
        ans[0] = z[dx[di]];
        ans[1] = z[dy[di]];
        for (int i=2; i<n+2; i++) {
            char c1 = ans[i-1];
            char c2 = s[(i-1)%n];
            if ((c1=='S' && c2=='o') || (c1=='W' && c2=='x')) {
                ans[i] = ans[i-2];
            } 
            else {
                ans[i] = 'S';
                if (ans[i]==ans[i-2]) ans[i] = 'W';
            }
        }
        if (ans[0]==ans[n] && ans[1]==ans[n+1]) {
            ans.pop_back(); ans.pop_back();
            cout << ans << endl;
            return 0;
        }
    }
    cout << -1 << endl;
    return 0;
}


Measured memory_bytes: 3816
#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
long long s;
const long long u=1e9;
int main()
{
    cin>>s; 
    if(s==1e18)  cout<<"0 0 "<<u<<" 0 0 "<<u<<endl;
    else
    {
        cout<<"0 0 ";
        long long p=s/u,k=s%u;
        k=u-k;
        cout<<p+1<<" "<<u-(s%u)<<" ";
        cout<<1<<" "<<u<<endl;
        
    }
    return 0;

}

Measured memory_bytes: 3588
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF ((1LL<<62)-(1LL<<31))
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define bit(n,m)(((n)>>(m))&1)
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
ll pom(ll a,ll n,int m){ll x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
//#define MOD 998244353
#define MOD 1000000007
#define invp(a,p)pom(a,p-2,p)

int main(){
	int n;
	char s[110],t[110];
	scanf("%d%s%s",&n,s,t);
	rep(i,0,n)printf("%c%c",s[i],t[i]);
}

Measured memory_bytes: 128
//#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<set>

/*
#include<boost/multiprecision/cpp_int.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/rational.hpp>
namespace mp = boost::multiprecision;
using Real = mp::number<mp::cpp_dec_float<1024>>;
using Bint = mp::cpp_int;
*/

using namespace std;

#define int long long
#define REP(i,s,e) for((i)=(s);(i)<(e);(i)++)
#define RREP(i,s,e) for((i)=((s)-1);(i)>=(e);(i)--)
#define FOR(i,n) for((i)=(0);(i)<(n);(i)++)
#define RFOR(i,n) for((i)=((n)-1);(i)>=(0);(i)--)
#define MOD 1000000007

signed main(){
    int N;
    int A;
    
    cin>>N>>A;
    
    cout<<N*N-A<<endl;
}



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

int main() {
    vector<char> vec(19);
for (int i = 0; i < 19; i++) {
  cin >> vec.at(i);
}
	vec.at(5)=' ';
    vec.at(13)=' ';
  
for (int i = 0; i < 19; i++) {
  cout << vec.at(i);}
  
  cout << endl;
  
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;
inline int abs(int x) {
  return x<0? -x:x;
}
int main()
{
  int n,l1,l2,x,cost1,cost2,ccost;
  cin >> n>> l2;
  l1=-10000;
  cost1=cost2=0;
  for(int i=1; i<n; i++) {
    cin >> x;
    ccost=min(cost1+abs(l1-x),cost2+abs(l2-x));
    cost1=cost2;
    cost2=ccost;
    l1=l2;
    l2=x;
  }
  cout << ccost << '\n';
  return 0;
}


Measured memory_bytes: 256
#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);
  }

  vector<int> b(n);
  for(int i=0;i<n;i++){
    b.at(a.at(i)-1)=i+1;
  }
  
  for(int i=0; i<n-1; i++){
  cout <<b.at(i)<<" ";
  }

  cout<<b.at(n-1)<<endl;
  return(0);
}

Measured memory_bytes: 1664
#include <iostream>
#include <vector>

using namespace std;

struct vertex {
    bool visited;
    int d;
    int f;

    vertex() : visited(false), d(0), f(0) {}
};

int current_time = 1;

void dfs(vector<vector<int>>& g, vector<vertex>& info, int index) {
    if (info[index].visited)
        return;

    info[index].d = current_time;
    info[index].visited = true;
    ++current_time;

    for (int i = 0; i < g[index].size(); ++i)
        dfs(g, info, g[index][i]);
    info[index].f = current_time;
    ++current_time;
}

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

    vector<vector<int>> g(n + 1);
    for (int i = 0; i < n; ++i) {
        int u, k;
        cin >> u >> k;

        for (int j = 0; j < k; ++j) {
            int v;
            cin >> v;
            g[u].push_back(v);
        }
    }

    vector<vertex> result_info(n + 1);
    for (int i = 1; i <= n; ++i) {
        if (!result_info[i].visited)
            dfs(g, result_info, i);
    }

    for (int i = 1; i <= n; ++i)
        cout << i << ' ' << result_info[i].d << ' ' << result_info[i].f << '\n';
}



Measured memory_bytes: 3124
import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;
import java.util.Set;

//Filling Game
public class Main{
	
	int h, w, N, res;
	int[][] a, id;
	int[][] d = {{-1,0},{0,1},{1,0},{0,-1}};
	Set<Integer>[] adj;
	int[] col, bfs;
	boolean[] u;
	
	boolean ok(int i, int j){
		return 0<=i&&i<h&&0<=j&&j<w;
	}
	
	void fill(int i, int j, int ID, int col){
		a[i][j] = -1;
		id[i][j] = ID;
		for(int k=0;k<4;k++){
			int ni = i+d[k][0], nj = j+d[k][1];
			if(ok(ni, nj)&&a[ni][nj]==col)fill(ni, nj, ID, col);
		}
	}
	
	@SuppressWarnings("unchecked")
	void f(int depth, int sum){
//		System.out.println("Depth:"+depth+" Sum:"+sum+" N:"+N);
		if(sum==N){
			res = depth; return;
		}
		Arrays.fill(bfs, 1<<29);
		Queue<Integer> q = new LinkedList<Integer>();
		for(int i=0;i<N;i++)if(u[i]){
			bfs[i] = 0; q.add(i);
		}
		int max = 0;
		while(!q.isEmpty()){
			int v = q.poll();
			for(int x:adj[v]){
				if(bfs[x]==1<<29){
					bfs[x] = bfs[v]+1; q.add(x);
					max = Math.max(max, bfs[x]);
				}
			}
		}
		if(res<=depth+max)return;
		Set<Integer>[] nx = new Set[3];
		for(int i=0;i<3;i++)nx[i]=new HashSet<Integer>();
		for(int i=0;i<N;i++)if(u[i]){
			for(int x:adj[i]){
				if(!u[x])nx[col[x]].add(x);
			}
		}
		for(int c=0;c<3;c++)if(!nx[c].isEmpty()){
			for(int x:nx[c])u[x]=true;
			f(depth+1, sum+nx[c].size());
			for(int x:nx[c])u[x]=false;
		}
	}
	
	@SuppressWarnings("unchecked")
	void run(){
		Scanner sc = new Scanner(System.in);
		adj = new Set[150];
		for(;;){
			w = sc.nextInt(); h = sc.nextInt();
			if((w|h)==0)break;
			a = new int[h][w];
			id = new int[h][w];
			for(int i=0;i<h;i++)for(int j=0;j<w;j++){
				char c = sc.next().charAt(0);
				a[i][j] = c=='R'?0:c=='G'?1:2;
			}
			N = 0;
			col = new int[h*w];
			for(int i=0;i<h;i++)for(int j=0;j<w;j++)if(a[i][j]!=-1){
				col[N] = a[i][j];
				fill(i, j, N, a[i][j]);
				N++;
			}
			for(int i=0;i<N;i++)adj[i] = new HashSet<Integer>();
			for(int i=0;i<h;i++)for(int j=0;j<w;j++){
				for(int k=0;k<4;k++){
					int ni = i+d[k][0], nj = j+d[k][1];
					if(ok(ni, nj)&&id[i][j]!=id[ni][nj])adj[id[i][j]].add(id[ni][nj]);
				}
			}
//			for(int i=0;i<N;i++){
//				System.out.print("N:"+i+" |");
//				for(int x:adj[i])System.out.print(x+" ");
//				System.out.println();
//			}
//			printid();
			res = N;
			u = new boolean[N];
			u[0] = true;
			bfs = new int[N];
			f(0, 1);
			System.out.println(res);
		}
	}
	
	void printid(){
		for(int i=0;i<h;i++){
			for(int j=0;j<w;j++)System.out.print(id[i][j]+" ");
			System.out.println();
		}
		System.out.println();
	}
	
	void debug(Object...o){
		System.out.println(Arrays.deepToString(o));
	}
	
/*
10 10
B R G R B R G B R G
G B R B G B R G B R
R G B G B G B R G B
B R G R G R G B R G
G B R G R G B R G B
R G B R G B R B R G
B R G B R G B R G B
G B R G B R G B R G
B R G B G B R G B R
R B R G B G B R G B
0 0
 */
	
	public static void main(String[] args) {
		new Main().run();
	}
}

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

typedef long long ll;
typedef pair<int,int> ii;
typedef tree<ii,null_type,less<ii>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;

int main() {
	cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
	char c; cin>>c;
	c++;
	cout<<c<<endl;
	return 0;
}


Measured memory_bytes: 256
// https://atcoder.jp/contests/abc065/tasks/arc076_b

#include <iostream>
#include <cstring>
#include <cmath>
#include <vector>
#include <algorithm>
#include <numeric>
#include <array>
#include <queue>
using namespace std;
#define REP1(i,n) for(int i=1, i##_len=(n); i<i##_len; ++i)
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define pow(x) x*x
#define ll long long
static const int MAX = 100010;
static const ll INFTY = 1e18;

ll gcd(ll a, ll b){
    if(b == 0)return a;
    if(b > a) swap(a, b);
    gcd( b, a % b );
}

ll lcd(ll a, ll b){
    if(b > a) swap(a, b);
    ll tmp = a / gcd(a, b);
    return tmp * b; 
}

int main() {

    ll N;
    cin >> N;
    vector<ll> T(N);

    REP(i, N){  
        cin >> T[i];
    }

    ll _lcd = T[0];
    REP1(i, N){
        _lcd = lcd(_lcd, T[i]);
    }

    cout << _lcd << endl;


    
}
/*
                   _ooOoo_
                  o8888888o
                  88" . "88
                  (| -_- |)
                  O\  =  /O
               ____/`---'\____
             .'  \\|     |//  `.
            /  \\|||  :  |||//  \
           /  _||||| -:- |||||-  \
           |   | \\\  -  /// |   |
           | \_|  ''\---/''  |   |
           \  .-\__  `-`  ___/-. /
         ___`. .'  /--.--\  `. . __
      ."" '<  `.___\_<|>_/___.'  >'"".
     | | :  `- \`.;`\ _ /`;.`/ - ` : | |
     \  \ `-.   \_ __\ /__ _/   .-` /  /
======`-.____`-.___\_____/___.-`____.-'======
                   `=---='
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         pass System Test!
*/

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <vector>
#include <cstdlib>
#include <queue>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define STEP(i, n, step) for(int i=0; i < n; i+=step)
#define RANGE(n) for(int _=0; _<n ; _++)
#define FOR(i, m, n) for(int i = m; i < n; i++)

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

const long long INF = 1LL << 60;
const int INT_INF = 1 << 29;

const int MAX = 200010;
const int MOD = 998244353;


void solve() {
  int K;
  cin >>  K;
  REP(i,K){
    cout << "ACL";
  }
  cout << endl;
  return;
}
 
int main() {
    solve();
    return 0;
}


Measured memory_bytes: 3524
use std::io;

#[allow(unused_macros)]
macro_rules! input {
    ( $($x:expr ),*) => {
        {
            let temp_str = input_line_str();
            let mut split_result_iter = temp_str.split_whitespace();
                $(
                let buf_split_result = split_result_iter.next();
                let buf_split_result = buf_split_result.unwrap();
                    ($x) = buf_split_result.parse().unwrap();
                )*
        }
    };
}


fn main() {
  let a:i32;
  let b:i32;

  input!(a,b);

  println!("{}",a-b+1);
}


#[allow(dead_code)]
fn input_line_str() -> String {
    let mut s = String::new();
    io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

#[allow(dead_code)]
fn input_vector<T>(line: usize) -> Vec<Vec<T>>
where
    T: std::str::FromStr,
{
    let mut v: Vec<Vec<T>> = Vec::new();

    for _ in 0..line {
        let s = input_line_str();
        let split_result = s.split_whitespace();
        let mut vec_line: Vec<T> = Vec::new();
        for z in split_result {
            let buf = match z.parse() {
                Ok(r) => r,
                Err(_) => panic!("Parse Error"),
            };
            vec_line.push(buf);
        }
        v.push(vec_line);
    }
    v
}

Measured memory_bytes: 4352
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import random
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353

h, w, n = [int(sys.stdin.buffer.readline()) for _ in range(3)]
ans = math.ceil(n / max(h, w))
print(ans)


Measured memory_bytes: 25316
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		long n=scan.nextInt();
		long goukei=0;
		for(long i=1;i<n;i++){
			goukei+=i;
		}
		System.out.println(goukei);
	}
}

Measured memory_bytes: 23764
#include<bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 50;
typedef long long ll;
ll qpow(ll a, ll b, int mod)
{
    if(mod == 0) return 0LL;
    ll ans = 1;a %= mod;
    for(ll i = b;i;i >>= 1,a = a * a % mod)
        if(i & 1) ans = ans * a % mod;
    return ans % mod;
}
int vis[maxn];//__builtin_popcount(h)
int gao(int x){
    int ans = 0;
    while(x){
        int now = __builtin_popcount(x);
        ans++;
        x %= now;
    }
    return ans;
}
void init()
{
    for(int i = 1;i <= 2e5;i++){
        vis[i] = gao(i);
        //if(i <= 20) cout << vis[i] << endl;
    }
}
int sum[maxn];
int main()
{
    std::ios::sync_with_stdio(false);
    int n;
    init();
    cin >> n;
    string s;
    cin >> s;
    int cnt1 = 0;
    reverse(s.begin(), s.end());
    for(int i = 0;i < s.size();i++){
        if(s[i] == '1') cnt1++;
    }
    int cnt2 = cnt1 + 1;
    cnt1 = cnt1 - 1;
    ll ans1 = 0, ans2 = 0;
    for(int i = 0;i < s.size();i++){
        if(s[i] == '1'){
            ans1 += qpow(2LL, i, cnt1);
            ans2 += qpow(2LL, i, cnt2);
        }
    }
    for(int i = 0;i < s.size();i++){
        if(s[i] == '1'){
            ll now = ans1 - qpow(2LL, i, cnt1);
            if(cnt1) now %= cnt1;
            sum[i] = vis[now] + 1;
            if(cnt1 == 0) sum[i] = 0;
        }
        else{
            ll now = ans2 + qpow(2LL, i, cnt2);
            if(cnt2)
            now %= cnt2;
            sum[i] = vis[now] + 1;
        }
    }
    for(int i = s.size() - 1;i >= 0;i--){
        cout << sum[i] << endl;
    }
    return 0;
}


Measured memory_bytes: 5216
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int p;
  cin >> p;
  if(n < 10) {
    cout << p + 100 *(10 - n) << endl;
  }
  else {
    cout << p << endl;
  }
}


Measured memory_bytes: 256
N = int(input())

if (N <= 111):
  print(111)
elif(111 < N and N <= 222):
  print(222)
elif(222 < N and N <= 333):
  print(333)
elif(333 < N and N <= 444):
  print(444)
elif(444 < N and N <= 555):
  print(555)
elif(555 < N and N <= 666):
  print(666)
elif(666 < N and N <= 777):
  print(777)
elif(777 < N and N <= 888):
  print(888)
elif(888 < N and N <= 999):
  print(999)

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

int main(){
    int N, M;
    cin >> N >> M;
    vector<int> s(M);
    vector<int> c(M);
    rep(i,M){
        cin >> s[i] >> c[i];
    }

    vector<int> vals(N, -1);
    rep(i,M){
        int target_digit = s[i] - 1;
        int val = c[i];

        if(vals[target_digit]==-1 || vals[target_digit]==val){
            vals[target_digit] = val;
        }else{
            cout << -1 << endl;
            return 0;
        }
    }

    if(vals[0]==0 && N>1){
        cout << -1 << endl;
        return 0;
    }

    int ans = 0;

    if(N==1){
        if(vals[0]!=-1){ans = vals[0];}
    }else{
        rep(i,N){
            if(i!=0){
                if(vals[i]==-1){vals[i]=0;}
            }else{
                if(vals[i]==-1){vals[i]=1;}
            }
            ans += vals[i] * round(pow(10,N-1-i));
        }
    }

    cout << ans << endl;
    return 0;

}

Measured memory_bytes: 3712
import java.math.BigInteger;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int dataset = scanner.nextInt();
		for(int i=0; i<dataset; i++){
			BigInteger first = scanner.nextBigInteger();
			BigInteger second = scanner.nextBigInteger();
			BigInteger ans = first.add(second);
			if(ans.toString().length() > 80){
				System.out.println("overflow");
			}else{
				System.out.println(ans);
			}
		}
	}
}

Measured memory_bytes: 18464
/* << IN THE NAME OF GOD >> */
#include <bits/stdc++.h>
using namespace std;

#define err(x) cout << #x << " = " << x << '\n'


int  main(){ios::sync_with_stdio(0) ,cout.tie(0) ,cin.tie(0);
int a ,b;
    cin >> a >> b;
    a & 1 && b & 1 ? cout << "Yes" : cout << "No";
    


    return 0;
}








Measured memory_bytes: 256
#include<cmath>
#include<cstdio>
#include<cstring>
#include<set>
#include<map>
#include<queue>
#include<vector>
#include<assert.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define pb push_back
#define mp make_pair
#define sz(x) ((int)(x).size())
#define rep(i,l,r) for(int i=(l);i<(r);++i)
#define setIO(x) freopen(x".in","r", stdin);freopen(x".out","w",stdout);
typedef long long ll;
typedef unsigned long long ul;
typedef pair<int, int> pii;
const ul BASE = 107;
const ll LINF = 9e18 + 7;
const int N = 5e2 + 7;
const int INF = 1e9 + 7;
const int MOD = 1e9 + 7;
const double PI = acos(-1.0);
const double EPS = 1e-8;
//-----------------head-----------------
int n, m;
char a[N][N], b[N][N];
int main() {
	scanf("%d%d", &n, &m);
	rep(i, 0, n)
	{
		scanf(" %s", a[i]);
		memcpy(b[i], a[i], sizeof(char) * (m + 1));
	}
	rep(j, 0, m)
	{
		a[0][j] = b[n - 1][j] = '#';
		if (j & 1) {
			rep(i, 0, n - 1)
				a[i][j] = '#';
		} else {
			rep(i, 0, n - 1)
				b[n - i - 1][j] = '#';
		}
	}
	rep(i, 0, n)
		puts(a[i]);
	puts("");
	rep(i, 0, n)
		puts(b[i]);
	return 0;
}


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

int main()
{
    string S;
    int ans;
    
    while(1){
        cin>>S;

        if(S=="0")break;

        ans=0;

        for(int i=0;i<S.length();i++){
            ans+=S[i]-'0';
        }
        
        cout<<ans<<endl;
    }

    return 0;
}


Measured memory_bytes: 3220
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define F first
#define S second
#define int long long
#define ll long long
//#define int  unsigned long long
#define pb push_back
//#define double long double

using namespace std;
using namespace __gnu_pbds;
typedef  tree< int , null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
const int mod = 998244353;
const int N = 520005;
const int K = 25;
vector < int > g[N];
int dp[N];
int dfs(int v, int p = -1){
    int c = 0;
    for (auto u: g[v]){
        if (u == p) continue;
        c += dfs(u, v);
    }
    if (c > 1){
        cout << "First";
        exit(0);
    }
    c = (c + 1) % 2;
    return c;
}
main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    //freopen("input.txt", "r", stdin);
    int n;
    cin >> n;
    for (int i = 1; i < n; i++){
        int u, v;
        cin >> u >> v;
        g[u].pb(v);
        g[v].pb(u);
    }
    if (dfs(1) != 0) cout << "First"; else cout << "Second";
}


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

int n,m,q,T;
int i,j,k,flag,counter;
int a,b,d,t;
long long int sum;
char c;
string s;

vector <int> v;
set <int> st;
multiset <int> ms;
map <int,int> mp;
int mx;
int main(){
    cin>>n;
    // v.push_back(t);
    mx=0;
    for(i=0;i<n;i++){
        cin>>t;
        // d=t-v[i-1];
        // cout<<mx<<" "<<t<<endl;
        mx=max(mx,t);
        if(mx-t>1){
            cout<<"No"<<endl;
            return 0;
        }
        // if(d<-1){
            // cout<<"No"<<endl;
            // return 0;
        // }
        v.push_back(t);
    }
    cout<<"Yes"<<endl;
    return 0;
}

Measured memory_bytes: 892
//============================================================================
// Name        : ITP_1_11_B.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
using namespace std;

class dice {
public:
	int getTopFace(void);
	int getRightFace(int top, int front);
	void rotate(char dir);
	void setFaceNumber(int *number);
private:
	int face[6];
};

int dice::getTopFace(void) {
	return face[0];
}

void dice::rotate(char dir) {
	int temp;
	switch(dir) {
	case 'N' :
		temp=face[0];
		face[0]=face[1];
		face[1]=face[5];
		face[5]=face[4];
		face[4]=temp;
		break;
	case 'S' :
		temp=face[0];
		face[0]=face[4];
		face[4]=face[5];
		face[5]=face[1];
		face[1]=temp;
		break;
	case 'W' :
		temp=face[0];
		face[0]=face[2];
		face[2]=face[5];
		face[5]=face[3];
		face[3]=temp;
		break;
	case 'E' :
		temp=face[0];
		face[0]=face[3];
		face[3]=face[5];
		face[5]=face[2];
		face[2]=temp;
		break;
	}
}

void dice::setFaceNumber(int *number) {
	for(int i=0; i<6; ++i) {
		face[i]=number[i];
	}
}

int dice::getRightFace(int top, int front) {
	int pos_top, pos_front;
	string str;
	string target_str;
	for(int i=0; i<6; ++i) {
		if(face[i]==top) pos_top=i;
		if(face[i]==front) pos_front=i;
	}
	str = to_string(pos_top)+to_string(pos_front);
	target_str="01540";
	if((int)target_str.find(str)!=-1) {
		return face[2];
	}
	target_str="04510";
	if((int)target_str.find(str)!=-1) {
		return face[3];
	}
	target_str="02530";
	if((int)target_str.find(str)!=-1) {
		return face[4];
	}
	target_str="03520";
	if((int)target_str.find(str)!=-1) {
		return face[1];
	}
	target_str="12431";
	if((int)target_str.find(str)!=-1) {
		return face[0];
	}
	target_str="13421";
	if((int)target_str.find(str)!=-1) {
		return face[5];
	}
	return 0;
}

int main() {
	int num[6];
	int n,top,front;
	dice d;
	cin >> num[0] >> num[1] >> num[2] >> num[3] >> num[4] >> num[5];
	d.setFaceNumber(num);
	cin >> n;
	for(int i=0; i<n; ++i) {
		cin >> top >> front;
		cout << d.getRightFace(top,front) << endl;
	}
	return 0;
}

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

int main(){

  int x, y;
  while( cin >> x >> y, x+y ) {
    int field[16][16];
    int dp[16][16]={{0}};
    for(int i=0; i<y; i++) {
      for(int j=0; j<x; j++) {
	cin >> field[i][j];
      }
    }

    for(int i=0; i<x; i++) {
      if( field[0][i] != 1 ) dp[0][i] = 1;
    }


    for(int i=0; i<y-1; i++) {
      for(int j=0; j<x; j++) {
	if( field[i][j] == 1 ) continue;

	else if( field[i][j] == 2 ) {
	  if( field[i+2][j] != 1 ) {
	    dp[min(y-1, i+2)][j] += dp[i][j];
	  }
	}

	else {
	  if( j ) {
	    if( field[i+1][j-1] == 0 ) dp[i+1][j-1] += dp[i][j];
	  }
	  if( j < x-1 ) {
	    if( field[i+1][j+1] == 0 ) dp[i+1][j+1] += dp[i][j];
	  }
	  if( field[i+1][j] != 1 ) dp[i+1][j] += dp[i][j];
	}
      }
    }

    int sum = 0;
    for(int i=0; i<x; i++) {
      sum += dp[y-1][i];
    }

    cout << sum << endl;
  }
}

Measured memory_bytes: 1160
import sys
import heapq


# \n
def input():
    return sys.stdin.readline().rstrip()


def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    L = []
    heapq.heapify(L)
    for a in A:
        heapq.heappush(L, (-a, 1))

    for i in range(M):
        b, c = map(int, input().split())
        heapq.heappush(L, (-c, b))
    ans = 0
    count = 0
    while True:
        c, b = heapq.heappop(L)
        if count +b >=N:
            print(-ans - c*(N-count))
            exit()
        count += b
        ans +=b*c

if __name__ == "__main__":
    main()


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


int main()
{
    int x,y;
    scanf("%d%d",&x,&y);
    if(x>y)swap(x,y);
    if(x==1)
    {
        printf("%d\n",max(1,y-2));
    }
    else
    {
        long long d1=1ll*(x-2)*(y-2);
        printf("%lld\n",d1);
    }
	return 0;
}



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

  		int n = sc.nextInt();
      	boolean con = true;
      
      	n *= 100;
      	for(int i = 0; i < 99 && con;i++){
        	if(((n + i)%108) == 0){
              n = (n+i)/108;
              con = false;
            }
        }	
      
      	if(!con) System.out.println(n);
      	else System.out.println(":(");
        
	}
}


Measured memory_bytes: 35608
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <memory.h>
using namespace std;

int n,k;
vector<int> adj[2005];



int bfs(int v,int r,int prv=-1){
	if(r>0){
		int sum=1;
		for(int i=0;i<adj[v].size();i++){
			if(adj[v][i]!=prv){
				int s=bfs(adj[v][i],r-1,v);
				sum+=s;
			}
		}
	return sum;
	}
	else return 1;	
}



int main(){
	scanf("%d %d",&n,&k);
	for(int i=1;i<=n-1;i++){
		int a,b;
		scanf("%d %d",&a,&b);
		adj[a].push_back(b);
		adj[b].push_back(a);
	}
	if(k%2==0){
		int r=k/2,mint=1e6;
		for(int i=1;i<=n;i++){
			mint=min(mint,n-bfs(i,r));
		}
		printf("%d\n",mint);
	}
	else{
		int r=k/2,mint=1e6;
		for(int i=1;i<=n;i++){
			for(int j=0;j<adj[i].size();j++){
				mint=min(mint,n-bfs(i,r,adj[i][j])-bfs(adj[i][j],r,i)>=0?n-bfs(i,r,adj[i][j])-bfs(adj[i][j],r,i):0);
			}
		}
		printf("%d\n",mint);
	}
return 0;
}

Measured memory_bytes: 384
import java.util.Scanner;

/**
 *
 * @author k16075kk
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    static char[] xx = new char[]{'S', 'H', 'C', 'D'};

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (true) {
            int n = sc.nextInt();
            int x = sc.nextInt();
            if (n == 0 && x == 0) {
                break;
            }
            int count = 0;
            for (int i = 1; i <= n; i++) {
                for (int j = i + 1; j <= n; j++) {
                    for (int k = j + 1; k <= n; k++) {
                        if (i + j + k == x) {
                            count++;
                        }
                    }
                }
            }
            System.out.println(count);
        }

    }

}



Measured memory_bytes: 26840
n = int(input())
ss = []
for i in range(n):
    s,p = input().split()
    p = int(p)
    ss.append([i+1,s,p])
ss.sort(key=lambda x:x[2], reverse=True)
ss.sort(key=lambda x:x[1])
for i in range(n):
    print(ss[i][0])

Measured memory_bytes: 3060
#include<bits/stdc++.h>
    using namespace std;
    
    int main()
    {
    //	#ifndef ONLINE_JUDGE
    		//freopen("input.txt","r",stdin);
    		//freopen("output.txt","w",stdout);
    	//#endif
    		ios_base::sync_with_stdio(0);
    		cin.tie(0);
    	   int a,b,c,i,j,sum=0,ans;
           cin>>a>>b;
           string poe;
           cin>>poe;
           for(i=0;i<poe.size()-1;i++)
            if(poe[i]==poe[i+1]) sum++;
        ans=min(sum+2*b,a-1);
     cout<<ans;
    } 

Measured memory_bytes: 512
#include <iostream>
#include <string>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <functional>
#include <map>
#include <set>

using namespace std;

typedef long long i64;
typedef i64 int_t;
typedef vector<int_t> vi;
typedef vector<vi> vvi;

typedef pair<int_t, int_t> pi;

#define tr(c, i) for(auto i = (c).begin(); i != (c).end(); i++)
#define pb push_back
#define sz(a) i64((a).size())
#define all(c) (c).begin(), (c).end()
#define REP(s, e, i) for(i=(s); i < (e); ++i)

template<typename T> T gcd(T a, T b) {
  if(a < b) swap(a, b);
  if(b == 0) return a;
  return gcd(b, a % b);
}

int main(int argc, char *argv[]) {
  i64 K;
  cin >> K;
  i64 a, b, c, ans = 0;
  REP(1, K+1, a) {
    REP(1, K+1, b) {
      i64 g0 = gcd(a, b);
      REP(1, K+1, c) {
	ans += gcd(g0, c);
      }
    }
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 3632
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
#include <stack>
#include <utility>
#include <cmath>
#include <cstdio>

using namespace std;
typedef long long LL;
typedef pair<LL, LL> PII;
LL MOD = 1000000007;

int main() {
    
    int N, W;
    cin >> N >> W;
    //vector<int> v(N, 0), w(N, 0);
    int M = 100100;
    vector<vector<LL>> dp(N+1, vector<LL> (M, W+1));
    dp[0][0] = 0;
    for(int i=1; i<=N; i++) {
        LL w, v;
        cin >> w >> v;
        for(int j=0; j<M; j++)
            dp[i][j] = dp[i-1][j];
        for(int j=0; j<M-v; j++) {
            dp[i][j+v] = min(dp[i-1][j] + w, dp[i][j+v]);
        }

    }
    LL ans = 0;
    for(int j=0; j<M; j++)
        if(dp[N][j] <= W) {
            ans = j;

        }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 80256
/* imports all std modules {{{*/
import
  std.algorithm,
  std.array,
  std.ascii,
  std.base64,
  std.bigint,
  std.bitmanip,
  std.compiler,
  std.complex,
  std.concurrency,
  std.container,
  std.conv,
  std.csv,
  std.datetime,
  std.demangle,
  std.encoding,
  std.exception,
  std.file,
  std.format,
  std.functional,
  std.getopt,
  std.json,
  std.math,
  std.mathspecial,
  std.meta,
  std.mmfile,
  std.net.curl,
  std.net.isemail,
  std.numeric,
  std.parallelism,
  std.path,
  std.process,
  std.random,
  std.range,
  std.regex,
  std.signals,
  std.socket,
  std.stdint,
  std.stdio,
  std.string,
  std.system,
  std.traits,
  std.typecons,
  std.uni,
  std.uri,
  std.utf,
  std.uuid,
  std.variant,
  std.zip,
  std.zlib;
/*}}}*/

/+---test
20
---+/
/+---test
2
---+/
/+---test
99992
---+/

void main(string[] args) {
  const X = readln.chomp.to!long;

  auto th = new long[](200000);
  th[] = true;
  th[0..2] = false;
  foreach (i; 2..200000) {
    for (long j = i*2; j < th.length; j += i) {
      th[j] = false;
    }
  }
  (X + th[X..$].countUntil(true)).writeln;
}


Measured memory_bytes: 3708
import java.util.*;
import java.io.*;
import java.math.BigDecimal;
import java.nio.file.Files;
import java.nio.charset.StandardCharsets;
public class Main {
    BigDecimal asd = new BigDecimal(1000000000);
    public void sol(String s,long j) {
        asd= asd.multiply(asd);
        BigDecimal ans = new BigDecimal(1);
        boolean ret = false;
        String[] ss = s.split(" ");
        BigDecimal[] arr = new BigDecimal[ss.length];
        for (int i=0;i<ss.length;i++) {
            arr[i] = BigDecimal.valueOf(Long.parseLong(ss[i]));
            if (arr[i] == BigDecimal.ZERO) {
                System.out.println("0");
                return;
            }
        }
        for(BigDecimal k:arr){
            ans = ans.multiply(k);
            if(ans.compareTo(asd)>0){
                System.out.println("-1");
                return;
            }
        }
        System.out.println(ans);


    }

    public static void main(String[] args)  throws IOException {
        // Use the Scanner class
        Main aka = new Main();
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        long num = Long.parseLong(br.readLine());
        String s = br.readLine();
        //int tot = Integer.parseInt(br.readLine());

        aka.sol(s,num);
//        int i =1;
//        System.out.println();
//        while(tot>0){
//
//            String s = br.readLine();
//            String[] sr = s.split(" ");
//            List<Long> ls = new ArrayList<>();
//            for(String ss:sr){
//                ls.add(Long.parseLong(ss));
//            }
//            Main tt = new Main();
//            tt.sol(ls);
//            // String Buffer to store answer
//            StringBuffer sb = new StringBuffer();
////            Solution obj = new Solution();
////
////            System.out.println("Case #"+i+": "+obj.sol());
//            tot--;
//            i++;
//        }
    }

}


Measured memory_bytes: 61492
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)

def main():
    rr = []

    while True:
        n = I()
        if n == 0:
            break
        r = n
        for i in range(n):
            t = i**3
            if t > n:
                break
            u = n - t
            s = math.floor(u**0.5)
            v = u - s**2
            tr = i + s + v
            if r > tr:
                r = tr

        rr.append(r)

    return '\n'.join(map(str, rr))


print(main())




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

int bubbleSort(int A[], int N){
  int sw = 0;//swap回数
  bool flag = 1;
  for(int i = 0; flag; i++){
    flag = 0;
    for(int j = N - 1; j >= i + 1; j--){
      if(A[j] < A[j - 1]){
        swap(A[j], A[j - 1]);
        flag = 1;
        sw++;
      }
    }
  }
  return sw;
}

int main(){
  int A[100], N, sw;
  cin >> N;
  for(int i = 0; i < N; i++) cin >> A[i];
  
  sw = bubbleSort(A, N);
  
  //出力
  for(int i = 0; i < N; i++){
    if (i) cout << " ";
    cout << A[i];
  }
  cout << endl;
  cout << sw << endl;
  
  return 0;
}


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

// 二部マッチング
struct BipartiteMatching {
    vector<int> match;  // マッチングのペア
    vector<bool> used;  // dfsですでに調べたか
    bool dfs(const vector<vector<int>>& g, int v) {
        used[v] = true;
        for ( int u : g[v] ) {
            int w = match[u];
            if ( w < 0 || !used[w] && dfs(g, w) ) {
                match[v] = u;
                match[u] = v;
                return true;
            }
        }
        return false;
    }
    // void add_edge(vector<vector<int>>& g, int u, int v) {
    //     g[u].push_back(v);
    //     g[v].push_back(u);
    // }
    // 二部マッチング　g:二部グラフ（双方向グラフ）
    // 最大マッチングの辺の数を返す。matchにペアがセットされる。
    int MaxMatching(const vector<vector<int>>& g) {
        int vmax = g.size();
        int res = 0;
        match.assign(vmax, -1);
        for ( int v = 0; v < vmax; v++ ) {
            if ( match[v] < 0 ) {
                used.assign(vmax, false);
                if ( dfs(g, v) ) {
                    res++;
                }
            }
        }
        return res;
    }
};

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_7_A&lang=ja
int main() {
    int NX, NY, E, x, y;
    cin >> NX >> NY >> E;
    vector<vector<int>> G(NX+NY);
    for ( int i = 0; i < E; i++ ) {
        cin >> x >> y;
        y += NX;
        G[x].push_back(y);
        G[y].push_back(x);
    }
    BipartiteMatching bm;
    int ans = bm.MaxMatching(G);
    cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 3296
import java.lang.String.format
import java.util.*
import kotlin.math.*
import kotlin.system.exitProcess
 
private fun readLn() = readLine()!! // string line
private fun readInt() = readLn().toInt() // single int
private fun readStrings() = readLn().split(" ") // list of strings
private fun readInts() = readStrings().map { it.toInt() } // list of ints
private fun readLongs() = readStrings().map { it.toLong() } // list of ints
fun main(){
    val reader=Scanner(System.`in`)
    var a=reader.nextLong()
    var b=reader.nextLong()
    var c=reader.nextLong()
    var d=reader.nextLong()
    var e=reader.nextLong()
    var f=c*60+d-a*60-b
    if(f<0L){
        f+=1440
    }
    print(max(f-e,0L))
}

Measured memory_bytes: 36132
#include <stdio.h>

int main(void) {
	long long a, b, temp, r,x;
	scanf("%d %d", &a, &b);
	x = a * b;
	if(b>a){
		temp = a;
		a = b;
		b = temp;
	}
	while((r=a%b)!=0){
    	a=b;
    	b=r;
    }
	printf("%ld\n", x / b);

	return 0;    
}


Measured memory_bytes: 128
#include<stdio.h>
int main()
{
  int i,n,x,before,after,min;
  scanf("%d",&n);
  scanf("%d%d",&before,&after);
  if(before<after) min=before;
  else min=after;
  for(i=2;i<n;i++)
    {
      scanf("%d",&x);
      if(x>after) after=x;
      if(x-min>after-before)
	{
	  after=x;
	  before=min;
	}
      if(x<min) min=x;
    }
  printf("%d\n",after-before);
  return 0;
}

Measured memory_bytes: 596
#include <iostream>
#include <vector>
#include <queue>
using namespace std;

int main()
{
  int N;
  while (cin >> N && N != 0) {
    vector<vector<int> > g(N*N);
    for (int i = 0; i < N; i++) {
      for (int j = 0; j < N; j++) {
        int x, y;
        cin >> x >> y;
        g[i*N+j].push_back(y*N+x);
        g[y*N+x].push_back(i*N+j);
      }
    }
    vector<bool> visited(N*N, false);
    int ans = 0;
    for (int i = 0; i < N*N; i++) {
      if (!visited[i]) {
        visited[i] = true;
        queue<int> q;
        q.push(i);
        ++ans;
        while (!q.empty()) {
          const int n = q.front();
          q.pop();
          for (vector<int>::const_iterator it(g[n].begin()); it != g[n].end(); ++it) {
            if (!visited[*it]) {
              visited[*it] = true;
              q.push(*it);
            }
          }
        }
      }
    }
    cout << ans << endl;
  }
  return 0;
}

Measured memory_bytes: 0
w = input()

w = sorted(w, key = lambda x: x)
ans = 1
before = w[0]
for i in range(1, len(w)):
    if w[i] == before:
        ans += 1
    else:
        if ans % 2 != 0:
            print("No")
            exit()
        before = w[i]
        ans += 1

if ans % 2 != 0:
    print("No")
    exit()
print("Yes")

Measured memory_bytes: 38480
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <queue>
#define N 500005

using namespace std;

struct Segment_Tree{
#define ls pos << 1
#define rs pos << 1 | 1
	int val[N << 3]; 

	void build(int pos,int l,int r){
		if(l == r){
			val[pos] = N;
			return ;
		}
		int mid = (l + r) >> 1;
		build(ls, l, mid); build(rs, mid + 1, r);
		val[pos] = min(val[ls], val[rs]);
		return ;
	}

	void update(int pos,int l,int r,int p, int w){
		if(l == r){
			val[pos] = w; return ;
		}
		int mid = (l + r) >> 1;
		if(mid >= p) update(ls, l, mid, p, w);
		else update(rs, mid + 1, r, p, w);
		val[pos] = min(val[ls], val[rs]);
	}
	
	int query(int pos,int l,int r,int nl,int nr){
		if(l >= nl && r <= nr) return val[pos];
		int mid = (l + r) >> 1, tmp = N;
		if(mid >= nl) tmp = min(tmp, query(ls, l, mid, nl, nr));
		if(mid < nr) tmp = min(tmp, query(rs, mid + 1, r, nl, nr));
		return tmp;
	}
#undef ls
#undef rs
}T;

struct edge{
	int to, nxt;
}e[N << 1];

int n, k, cnt, tot;
int p[N], fir[N], ins[N], a[N], q[N];

void work();
void add(int ,int);
void tuopu();

int main(){
	scanf("%d%d", &n, &k);
	for(int i = 1; i <= n; ++i) scanf("%d", q + i), p[q[i]] = i;
	T.build(1, 1, n);
	for(int i = n; i; --i){
		int x;
		x = T.query(1, 1, n, max(1, p[i] - k + 1), p[i]);
		if(x != N) add(p[i], p[x]);
		x = T.query(1, 1, n, p[i], min(n, p[i] + k - 1));
		if(x != N) add(p[i], p[x]);
		T.update(1, 1, n, p[i], i);
	}
	tuopu();
	for(int i = 1; i <= tot; ++i) p[a[i]] = i;
	for(int i = 1; i <= n; ++i) printf("%d\n", p[i]);
	return 0;
}

void add(int u,int v){
	e[++cnt] = (edge){v, fir[u]}; fir[u] = cnt; ++ins[v];
	return ;
}

void tuopu(){
	priority_queue < int , vector < int > , greater < int > > Q;
	for(int i = 1; i <= n; ++i) if(!ins[i]) Q.push(i);
	while(!Q.empty()){
		int u = Q.top(); Q.pop(); a[++tot] = u;
		for(int i = fir[u]; i; i = e[i].nxt){
			int v = e[i].to;
			--ins[v];
			if(!ins[v]) Q.push(v);
		}
	}
	return ;
}


Measured memory_bytes: 26224
def resolve():
    import itertools
    N,M = map(int,input().split())
    N_list = [int(x) for x in range(N)]
    M_list = [int(y) for y in range(M)]

    n = len(list(itertools.combinations(N_list,2)))
    m = len(list(itertools.combinations(M_list,2)))
    print(n+m)

resolve()

Measured memory_bytes: 3444
#include <iostream>
#include <vector>
#include <algorithm>
#include <array>
#include <cmath>
using i64 = long long;
using namespace std;

const int maxn = 2e5;
int occur[maxn + 1] = {0};
int a[maxn], b[maxn];
int main() {
  int n;
  cin >> n;

  for (int i = 0; i < n; i++) {
    cin >> a[i];
    occur[a[i]] += 1;
  }

  copy(a, a + n, b);
  sort(b, b + n);
  
  i64 total = 0;
  for (int i = 0; i < n; i++) {
    if (i > 0 && b[i - 1] == b[i]) continue;
    total += (i64) occur[b[i]] * (occur[b[i]] - 1) / 2;
  }

  for (int i = 0; i < n; i++) {
      cout << total 
        - (i64) occur[a[i]] * (occur[a[i]] - 1) / 2 
        + (i64) (occur[a[i]] - 1) * (occur[a[i]] - 2) / 2 
      << '\n';
  }
}

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

using namespace std;

string t[4] = {"maerd", "remaerd", "esare", "resare"};

int main()
{
  string s;
  cin >> s;
  reverse(s.begin(), s.end());
  while (s.size())
  {
    bool del = false;
    for (int i = 0; i < 4; i++)
      if (s.substr(0, t[i].size()) == t[i])
      {
        s.erase(s.begin(), s.begin() + t[i].size());
        del = true;
      }
    if(!del)
      break;
  }
  cout << (s.size() == 0 ? "YES" : "NO") << endl;

  return 0;
}


Measured memory_bytes: 512
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <typeinfo>
#include <numeric>
#include <functional>
#include <unordered_map>
#include <bitset>
#include <stack>
#include <assert.h>
#include <unordered_set>
#include <random>



using namespace std;
using ll = long long;
using ull = unsigned long long;

const ll INF = 1e18;
const ll MOD = 1e9 + 7;

#define REP(i, n) for(ll i = 0; i < n; i++)














int main(){
    ll n, d;
    cin >> n >> d;
    d = d * 2 + 1;
    cout << (n % d == 0? n / d : n / d + 1) << endl;
}


Measured memory_bytes: 256
//solve AtCoderProblems in C/C++

#include <stdio.h>

int main(void){
    int K;
    scanf("%d",&K);
    float even = (float)K/(float)2;
    even = (int)even;
    
    int odd = K - even;
    printf("%d",(int)(even*odd));
    return 0;
}

Measured memory_bytes: 128
#include <iostream>
using namespace std;
int main(void){
    string s; cin >> s;
    string ans = "";
    for(char c : s) {
        if(c != 'B') {
            ans += c;
        } else {
            if(ans != "") {
                ans.erase( --ans.end() );
            }
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
n, k = map(int, input().split())
A = list(map(int, input().split()))

C = [0 for i in range(n)]   #Count
P = [-1 for i in range(n)]  #Patern
cp = 1  #current point
t = 0   #周期
while 1:
    #print('C = ', C)
    C[cp - 1] += 1
    if C[cp - 1] < 2:
        P[cp - 1] = t
    else:
        break
    cp = A[cp - 1]
    t += 1

pret = P[cp - 1]    #周期に入るまでの時間
t = t - pret
#print('pret = ', pret)
#print('t = ', t)
#print('P = ', P)

if k <= pret:
    l = k 
else:
    k = k - pret
    l = k % t
    P = list(map(lambda x: x - pret, P))
#print('P = ', P)

ans = 0
for i in range(n):
    if P[i] == l:
        ans = i + 1
        break
    else:
        pass
print(ans)

Measured memory_bytes: 32820
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt()-1;
		int B = sc.nextInt()-1;
		int C = sc.nextInt()-1;
		int D = sc.nextInt()-1;
		char[] S = sc.next().toCharArray();

		boolean ok = isReacheable(A, C, S, false) && isReacheable(B, D, S, D<C);
		
		System.out.println(ok ? "Yes" : "No");
		sc.close();
	}
	
	static boolean isReacheable(int s, int t, char[] c, boolean opponent) {
		boolean three = false;
		for(int i=s; i<t; i++) {
			if(i+1<=t && c[i+1]=='#') {
				if(i+2<=t && c[i+2]=='#') {
					return false;
				} else {
					i++;
				}
			} else {
				if(0<=i-1 && c[i-1]=='.' && c[i+1]=='.') {
					three = true;
				}
			}
		}
		if(0<t && t+1<c.length && c[t-1]=='.' && c[t+1]=='.') {
			three = true;
		}
		
		return !opponent || three;
	}
}

Measured memory_bytes: 26144
#include <algorithm>
#include <array>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>

#include <set>
#include <string>
#include <tuple>
#include <utility>
#include <vector>

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
using namespace std;

int main() {
    int L, R, d;

    cin >> L >> R >> d;
    int nL = (L-1) / d;
    int nR = R / d;
    cout << nR - nL << endl;
    return 0;
}


Measured memory_bytes: 3192
import collections
N = int(input())
s=[]
for i in range(N):
    s.append(input())
c=collections.Counter(s)
values, counts = zip(*c.most_common())
d=collections.Counter(counts)
numberOfMost=d[counts[0]]
ans =sorted([values[i] for i in range(numberOfMost)])
for i in range(numberOfMost):
    print(ans[i])

Measured memory_bytes: 59504