akhauriyash/Code-Regression huggingface dataset:
import java.util.Arrays;
import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    final Scanner scanner = new Scanner(System.in);
    int n = scanner.nextInt();
    int[] a = new int[n];
    for (int i = 0; i < n; i++) a[i] = scanner.nextInt();
    Arrays.sort(a);
    int[] sums = new int[2];
    int c = 0;
    for (int i = n - 1; i >= 0; i--) {
      sums[c] += a[i];
      c = 1 - c;
    }
    System.out.println(sums[0] - sums[1]);
  }
}


Measured memory_bytes: 21972
#include <bits/stdc++.h>
using namespace std;
typedef long long lli;
typedef long double lld;
#define mod 1000000007
#define mod2 998244353
#define fori(n) for (int i = 0; i < n; i++)
#define forj(n) for (int j = 0; j < n; j++)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define fast ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define endl "\n"
#define sortvec(a) sort(a.begin(), a.end())

void print(){cout<<endl;}
template<typename T,typename... Args>
void print(T a, Args... args) {cout<<a<<" ";print(args...);}
lli llipowerp(lli x, lli y, lli p)
{
    lli res = 1;
    x = x % p;
    while (y > 0)
    {
        if (y & 1) res = (res * x) % p;
        y = y >> 1;
        x = (x * x) % p;
    }
    return res;
}
lli binarySearch(vector<int> arr, int l, int r, int x)
{
    if (r >= l)
    {
        lli mid = l + (r - l) / 2;
        if (arr[mid] == x)
            return mid;
        if (arr[mid] > x)
            return binarySearch(arr, l, mid - 1, x);
        return binarySearch(arr, mid + 1, r, x);
    }
    return -1;
}
template <typename T>
inline void printvec(vector<T> inp){
    for(auto it:inp) cout<<it<<" ";
    cout << endl;
}
//---------------------------------------------------------------------------------


int main(){

    int s,w;
    cin>>s>>w;
    if(w>=s) cout<<"unsafe"<<endl;
    else cout<<"safe"<<endl;

}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll GCD(ll x,ll y){
    if(y == 0) return x;
    else return GCD(y,x%y);
}

ll LCM(ll a,ll b){
    return a / GCD(a,b) * b;
}

const int MOD = 1000000007;

bool isyymm(string x){
    string a = x.substr(2,4);
    if(atoi(a.c_str()) > 0 && atoi(a.c_str()) <= 12){
        return true;
    }else{
        return false;
    }
}

bool ismmyy(string x){
    string a = x.substr(0,2);
    if(atoi(a.c_str()) > 0 && atoi(a.c_str()) <= 12){
        return true;
    }else{
        return false;
    }
}


int main() {
    string s; cin >> s;
    if(isyymm(s)&&ismmyy(s)){
        cout << "AMBIGUOUS";
    }else if(isyymm(s)){
        cout << "YYMM";
    }else if(ismmyy(s)){
        cout << "MMYY";
    }else{
        cout << "NA";
    }
}




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

int main(){
  vector<int> m;
  vector<int> ans(9,0);

  for(int i = 0; i < 3; i++){
    for(int j = 0; j < 3; j++){
      int tmp;
      cin >> tmp;
      m.push_back(tmp);
    }
  }

  int N;
  cin >> N;
  for(int i = 0; i < N; i++){
    int tmpb;
    cin >> tmpb;
    for(int j = 0; j < 9; j++){
      if(m.at(j) == tmpb){
        ans.at(j) = 1;
      }
    }
  }


  bool chk = false;
  chk =chk||(ans[0] + ans[1] + ans[2] == 3);
  chk =chk||(ans[3] + ans[4] + ans[5] == 3);
  chk =chk||(ans[6] + ans[7] + ans[8] == 3);
  chk =chk||(ans[0] + ans[3] + ans[6] == 3);
  chk =chk||(ans[1] + ans[4] + ans[7] == 3);
  chk =chk||(ans[2] + ans[5] + ans[8] == 3);
  chk =chk||(ans[0] + ans[4] + ans[8] == 3);
  chk =chk||(ans[2] + ans[4] + ans[6] == 3);

  if(chk){
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) FOR(i, 0, (n))
#define FOR(i, a, b) for(int i=(a); i<(b); i++)
#define LAR(a, b) ((a)=max((a),(b)))
#define SML(a, b) ((a)=min((a),(b)))
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vl = vector<ll>;
using pii = pair<int, int>;
using vpii = vector<pair<int, int>>;
template<typename T>
using pque = priority_queue<T, vector<T>, greater<T>>;
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define ALL(a) (a).begin(), (a).end()
#ifdef LOCAL_DEBUG
#define DEBUG(...) printf(__VA_ARGS__)
#else
#define DEBUG(...)
#endif

char s[1024], t[1024];

int main(){
	scanf("%s%s", s, t);
	int n = strlen(s), m = strlen(t);
	int ans = INT_MAX;
	REP(j, n-m+1){
		int sm = 0;
		REP(i, m){
			sm += s[j + i] != t[i];
		}
		SML(ans, sm);
	}
	printf("%d\n", ans);
}


Measured memory_bytes: 3832
#include <bits/stdc++.h>
using namespace std;
 
int main() {
 	
  	string S;
  	cin >> S;
  	int a[200] = {0};
  
  	for(int i=0; i < S.size(); i++){
		a[S.at(i) - 'a']++;
    }
  	for(int i=0; i < 26; i++){

		if(!a[i]){
         	cout << (char)(i + 'a') << endl;
      		return 0;
        }
    }
		cout << "None" << endl;
		return 0;
}
  	

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

int n;
int S[1<<18];
std::priority_queue<int> Q;
std::vector<int> buf;

int main(){
  scanf("%d",&n);
  for(int i=0;i<(1<<n);i++) scanf("%d",S+i);
  std::sort(S, S+(1<<n), std::greater<int>());
  int k = 0;
  for(int i=0;i<(1<<n);){
    int j = i;
    for(i++; S[i] == S[j]; i++) ;
    S[k++] = i-j;
  }
  Q.push((1<<(n+1))-1);
  for(int i=0;i<k;i++){
    if(Q.size() < S[i]){
      puts("No");
      return 0;
    }
    for(int j=0;j<S[i];j++){
      int t = Q.top();
      Q.pop();
      for(t>>=1;t;t>>=1){
        buf.push_back(t);
      }
    }
    for(int x: buf) Q.push(x);
    buf.clear();
  }
  puts("Yes");
  return 0;
}


Measured memory_bytes: 2232
#include<cstdio>
#include<algorithm>
using namespace std;
int n,w[100010];
int c1[100010],c2[100010];
int a1,a2,b1,b2,pa1,pa2,pb1,pb2;
int main()
{
	scanf("%d",&n);
	for (int i=1;i<=n;i++)
	{
		scanf("%d",w+i);
		if (i&1) c1[w[i]]++;
		else c2[w[i]]++;
	}
	for (int i=1;i<=100000;i++)
	{
//		if (i&1)
//		{
			if (c1[i]>a1) a2=a1,pa2=pa1,a1=c1[i],pa1=i;
			else if (c1[i]>a2) a2=c1[i],pa2=i;
//		}
//		else
//		{
			if (c2[i]>b1) b2=b1,pb2=pb1,b1=c2[i],pb1=i;
			else if (c2[i]>b2) b2=c2[i],pb2=i;
//		}
	}
	if (pa1!=pb1) printf("%d\n",n-a1-b1);
	else printf("%d\n",min(n-a1-b2,n-a2-b1));
	return 0;
}

Measured memory_bytes: 1280
#include<bits/stdc++.h>
using namespace std;
const int N=2e6+10;
int n,m;
int fa[N],sum[N];
int find(int x){
	if(fa[x]!=x) fa[x]=find(fa[x]);
	return fa[x];
}
int main(){
	cin>>n>>m;
	for(int i=1;i<=n;i++)
		fa[i]=i;
	for(int i=1;i<=m;i++){
		int x,y;
		cin>>x>>y;
		int fx=find(x),fy=find(y);
		fa[fx]=fy;
	}
	for(int i=1;i<=n;i++){
		int fi=find(i);
		sum[fi]++;
	}
	sort(sum+1,sum+1+n);
	cout<<sum[n];
	return 0;
}

Measured memory_bytes: 11392
#include<bits/stdc++.h>
using namespace std;
int main(){
    long long n, m, sum = 0;
    cin >> n >> m;
    for(long long i = 0; i < m; i++){
        long long x;
        cin >> x;
        sum = sum + x;
    }
    if(sum > n){
        cout << "-1";
    }
    else{
        cout << n - sum;
    }
    return 0;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
#include <iostream>
#include <string>

typedef uint64_t u64;
typedef int64_t i64;
typedef uint32_t u32;
typedef int32_t i32;
typedef uint16_t u16;
typedef int16_t i16;
typedef uint8_t u8;
typedef int8_t i8;

using namespace std;

#define REP(idx, N) for (u64 idx = 0; idx < N; idx++)

int main() {
  u64 x;
  cin >> x;
  u64 m = 100;
  REP(i, 1000000000) {
    m = m * 1.01;
    if (m >= x) {
      cout << i + 1;
      return 0;
    }
  }

  return 0;
}


Measured memory_bytes: 3596
#include<bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#define dbg(x...) do { cout << "\033[32;1m " << #x << " -> "; err(x); } while (0)
void err() { cout << "\033[39;0m" << endl; }
template<template<typename...> class T, typename t, typename... A>
void err(T<t> a, A... x) { for (auto v: a) cout << v << ' '; err(x...); }
template<typename T, typename... A>
void err(T a, A... x) { cout << a << ' '; err(x...); }
#else
#define dbg(...)
#endif
typedef long long ll;
typedef pair<int,int> pi;
typedef vector<int> vi;
template<class T> using vc=vector<T>;
template<class T> using vvc=vc<vc<T>>;
template<class T> void mkuni(vector<T>&v)
{
    sort(v.begin(),v.end());
    v.erase(unique(v.begin(),v.end()),v.end());
}
template<class T>
void print(T x,int suc=1)
{
    cout<<x;
    if(suc==1) cout<<'\n';
    else cout<<' ';
}
template<class T>
void print(const vector<T>&v,int suc=1)
{
    for(int i=0;i<v.size();i++)
    print(v[i],i==(int)(v.size())-1?suc:2);
}
const int maxn=1e5+7;
int sg[maxn];
/*int k=4;
int getsg(int x)
{
    if(x<k) return 0;
    if(sg[x]!=-1) return sg[x];
    set<int> all;
    int cnt=x/k;
    for(int i=1;i<=cnt;i++)
    {
        all.insert(getsg(x-i));
    }
    for(int i=0;;i++) if(!all.count(i)) return sg[x]=i;
}*/
int getsg(int x,int k)
{
    if(x<k) return 0;
    if(x%k==0) return x/k;
    int var=x/k*k;
    int nxt=-1,L=0,R=k;
    while(L<=R)
    {
        int mid=L+R>>1;
        //dbg(L,R,x-1LL*mid*(x/k+1),var);
        if(x-1LL*mid*(x/k+1)>=var)
        {
            nxt=mid;
            L=mid+1;
        }
        else R=mid-1;
    }
    assert(nxt!=-1);
    x=min(x-x/k-1,x-nxt*(x/k+1));
    return getsg(x,k);
}
int main()
{
    //memset(sg,-1,sizeof(sg));
    //for(int i=1;i<=100;i++) dbg(i,getsg(i),i%k);
    int n;
    cin>>n;
    int sum=0;
    for(int i=0;i<n;i++)
    {
        int a,k;
        cin>>a>>k;
        sum^=getsg(a,k);
    }
    if(!sum)
        cout<<"Aoki\n";
    else cout<<"Takahashi\n";
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
int N, M;
int dp[100010];
vector<int> G[100010];

int rec(int v) {
    if (dp[v] != -1) return dp[v];
    int res = 0;
    for (int u : G[v]) {
        res = max(res, rec(u) + 1);
    }
    return dp[v] = res;
}

int main() {
    cin >> N >> M;
    for (int i = 0; i < M; i++) {
        int x, y; cin >> x >> y;
        x--, y--;
        G[x].push_back(y); 
    }

    fill(dp, dp + N, -1);
    int ans = 0;
    for (int i = 0; i < N; i++) ans = max(ans, rec(i));
    cout << ans << endl;
}

Measured memory_bytes: 8192
#include<bits/stdc++.h>
using namespace std;
int Int();
int ans = INT32_MAX;
vector<vector<int> > D;
void dfs(unordered_set<int> S, int last, int distance) {
    if (S.empty()) {
        ans = min(ans, distance);
    } else {
        for (const auto &s : S) {
            unordered_set<int> SS = S;
            SS.erase(s);
            dfs(SS, s, last == 0 ? 0 : distance+D[s][last]);
        }
    }
}
void solve() {
    int N = Int(), M = Int(), R = Int();
    D = vector<vector<int> >(N+1, vector<int>(N+1, INT32_MAX));
    unordered_set<int> S;
    for (int i = 0; i < R; i++) S.insert(Int());
    for (int i = 0; i < M; i++) {
        int a = Int(), b = Int(), c = Int();
        if (D[a][b] > c) D[a][b] = D[b][a] = c;
    }
    for (int k = 1; k < N+1; k++) {
        for (int i = 1; i < N+1; i++) {
            for (int j = 1; j < N+1; j++) {
                if ((long long)D[i][k]+D[k][j] < D[i][j]) {
                    D[i][j] = D[i][k]+D[k][j];
                }
            }
        }
    }
    dfs(S, 0, 0);
    printf("%d\n", ans);
}
int main() {
    solve();
    return 0;
}
inline int Int() {
    int x = 0, f = 1;
    char c = getchar();
    while (c < '0' || c > '9' ) {
        if (c == '-') f = -1;
        c = getchar();
    }
    while (c >= '0' && c <= '9') {
        x = x*10+c-'0';
        c = getchar();
    }
    return x*f;
}


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

#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
const int INF = 1e9;

int main() {
  ll a, b, c, d, ans = 0;
  cin >> a >> b >> c >> d;
  ans = max({a * c, a * d, b * c, b * d});

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

Measured memory_bytes: 3632
# coding: utf-8

# 標準入力 <int><int>
X, Y, A, B, C = map(int, input().split())

# 標準入力 <int> list[]
p = sorted([int(i) for i in input().split()])
q = sorted([int(i) for i in input().split()])
r = sorted([int(i) for i in input().split()])

l = p[A - X:] + q[B - Y:] + r

print(sum(sorted(l)[(X+Y) * -1:]))


Measured memory_bytes: 115564
#include <iostream>
#include <algorithm>
#include <cstring>

using namespace std;

char s[101];
char t[101];

void solve()
{
	sort(s, s + strlen(s));
	sort(t, t + strlen(t), greater<int>());
	if(strcmp(s, t) < 0) {
		cout << "Yes\n";
	}
	else {
		cout << "No\n";
	}
}

int main()
{
	cin >> s >> t;
	solve();
	return 0;
}

Measured memory_bytes: 256
import sys, os, math, bisect, itertools, collections, heapq, queue
from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal

# import fractions

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)
# lcm = lambda x, y: (x * y) // fractions.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


class UnionFind:
    def __init__(self, N):
        self.tree = list(range(N))

    def root(self, N):
        if self.tree[N] == N:
            return N
        else:
            self.tree[N] = self.root(self.tree[N])
            return self.tree[N]

    def same(self, x, y):
        return self.root(self.tree[x]) == self.root(self.tree[y])

    def unite(self, x, y):
        x = self.root(x)
        y = self.root(y)
        if x == y:
            return
        else:
            self.tree[x] = y


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

    N = ii()
    uf = UnionFind(N)
    X, Y = [], []

    # X間とY間の距離が短い順にソート
    # 頂点の番号も保持しておく
    for n in range(N):
        x, y = il()
        X.append((x, n))
        Y.append((y, n))
    X.sort()
    Y.sort()

    # 各頂点間の重み(道を作るお金)を計算し、繋がっている頂点を保持
    # 重みでソートを行う
    dist = []
    for n in range(1, N):
        dist.append((abs(X[n][0] - X[n - 1][0]), X[n][1], X[n - 1][1]))
        dist.append((abs(Y[n][0] - Y[n - 1][0]), Y[n][1], Y[n - 1][1]))
    dist.sort()

    # クラスカル法で、重みの小さい順に辺を繋げて木とする
    # UnionFind木を用いて既に繋がっているか否かを判定し
    # 最小全域木をつくる
    ret = 0
    for d, s, u in dist:
        if not uf.same(s, u):
            ret += d
            uf.unite(s, u)
    print(ret)


if __name__ == '__main__':
    main()


Measured memory_bytes: 69192
import std.stdio;
import std.string;
import std.algorithm;
import std.conv;
import std.range;
import std.math;

void main() {
    int n = readln.chomp.to!int;
    auto x = readln.chomp.split.map!(to!double).array;
    auto y = readln.chomp.split.map!(to!double).array;

    foreach (e; [ 1, 2, 3, double.infinity]) {
        writefln("%06f", mindis(x, y, n, e));
    }
}

double mindis(double[] x, double[] y, int len, double exp) {
    if (exp == double.infinity) {
        double[] res = new double[x.length];
        res[] = x[] - y[];
        return res.map!(abs).reduce!(max);
    } else {
        double res = 0;
        for (int i = 0; i < len; i++) {
            res += pow(abs(x[i] - y[i]), exp);
        }
        return pow(res, 1 / exp);
    }
}

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

using namespace std;

typedef long long LL;

const int N = 100010;

int n, k;

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

    int res = 0;
    while(n--)
    {
        int x;
        cin >> x;
        res += min(abs(x), abs(k - x));
    }

    cout << res * 2 << endl;

    return 0;
}


Measured memory_bytes: 384
fun main(args: Array<String>) {
    val sc = java.util.Scanner(System.`in`)
    val p = sc.nextInt()
    val q = sc.nextInt()
    val r = sc.nextInt()

    val ans = solve(p, q, r)
    println(ans)
}

fun solve(p: Int, q:Int, r:Int): Int {
    return listOf(p+q, p+r, q+r).sorted()[0]
}

Measured memory_bytes: 34004
#include<iostream>
using namespace std;
int main(){
long a[200001],n,min=1000000000,max=-10000000000;
cin>>n;
for(int i=0;i<n;i++){
cin>>a[i];

}
for(int i=0;i<n;i++){

  if(a[i]-min>max&&i!=0){
max=a[i]-min;



} 
if(a[i]<min)
min=a[i];
}
cout<<max<<'\n';

return 0;
}

Measured memory_bytes: 4660
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
//#include "MyMath.h"
//#include "DataStructure.h"
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <functional>
#include <stdio.h>
using namespace std;
typedef pair<int, int> p;
const int INF = 1000000000;
int dp[101][10001];
int main(){
	int n; cin >> n;
	vector<int> c;
	for (int i = 0; i < n; i++) {
		int x; cin >> x;
		c.push_back(x);
	}
	vector <int> line; line.push_back(c[0]);
	int len = 1;
	vector<int>::iterator it1 = c.begin() + 1;
	while (it1 != c.end()) {
		if (*(line.end() - 1) < *it1) { line.push_back(*it1); /*cout << "it1 " << *it1 << endl;*/ len++; }
		/*else if (*(line.end() - 1) > *it1) {
			cout << "it1 " << *it1 << endl;
			vector <int>::iterator it = lower_bound(line.begin(), line.end(), *it1);
			cout << "it  " << *it << endl;
			cout << line.size() << endl;
			line.insert(it, *it1);
			vector <int>::iterator it2 = upper_bound(line.begin(), line.end(), *it1);
			line.erase(it2);
		}*/
		else {
			*lower_bound(line.begin(), line.end(), *it1) = *it1;
		}
		it1++;
	}
	cout << len << endl;
	return 0;
}

Measured memory_bytes: 3888
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = (1 << 28);
string s;
ll k;
ll gosen=5000000000000000;
ll li=1000000000000000000;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >>s>>k;
    s=s.c_str();
    int i=0;
    ll now=0;
    while(true){
        int num=s[i]-'0';
        if(num==1) {
            now++;
            if(now>=k){
                 cout <<num<< "\n";
                 return 0;
            }
        }
        else{
             cout <<num<< "\n";
             return 0;
        }
        i++;
    }
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAX_LEN (100000)
#define NUM_MOD (1000000007L)

int main() {
  // read inputs
  int N;
  char cs[MAX_LEN + 1];
  scanf("%s", cs);
  N = strlen(cs);

  // solve
  long cnt = 1, cntA = 0, cntAB = 0, cntABC = 0;
  for (int i = 0; i < N; i++) {
    switch (cs[i]) {
      case 'A':
        cntA = (cntA + cnt) % NUM_MOD;
        break;
      case 'B':
        cntAB = (cntAB + cntA) % NUM_MOD;
        break;
      case 'C':
        cntABC = (cntABC + cntAB) % NUM_MOD;
        break;
      case '?':
        cntABC = (3 * cntABC + cntAB) % NUM_MOD;
        cntAB = (3 * cntAB + cntA) % NUM_MOD;
        cntA = (3 * cntA + cnt) % NUM_MOD;
        cnt = 3 * cnt % NUM_MOD;
        break;
    }
  }
  printf("%ld\n", cntABC);
}

Measured memory_bytes: 256
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
#from fractions import gcd
#from itertools import combinations # (string,3) 3回
#from collections import deque
#from collections import deque,defaultdict
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
print(input()[:3])


Measured memory_bytes: 8960
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define pli pair<ll, int>
#define pil pair<int, ll>
#define pll pair<ll, ll>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
#define endl '\n'
const int inf = 1000000007;
const ll INF = 1e18;
// int mod = 998244353;
int mod = 1000000007;
#define abs(x) (x >= 0 ? x : -(x))
#define lb(v, x) (int)(lower_bound(all(v), x) - v.begin())
#define ub(v, x) (int)(upper_bound(all(v), x) - v.begin())
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b); }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
template<typename T, typename U> T pow_(T a, U b) { return b ? pow_(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
ll modpow(ll a, ll b, ll _mod) { return b ? modpow(a * a % _mod, b / 2, _mod) * (b % 2 ? a : 1) % _mod : 1; }
template<class T, class U> ostream& operator << (ostream& os, const pair<T, U>& p) { os << p.F << " " << p.S; return os; }
template<class T> ostream& operator << (ostream& os, const vector<T>& vec) { rep(i, sz(vec)) { if (i) os << " "; os << vec[i]; } return os; }
template<typename T> inline istream& operator >> (istream& is, vector<T>& v) { rep(j, sz(v)) is >> v[j]; return is; }
template<class T, class T2> inline void add(T &a, T2 b) { a += b % mod; if (a >= mod) a -= mod; }
template<class T> void operator += (vector<T>& v, vector<T> v2) { rep(i, sz(v2)) v.eb(v2[i]); }

void solve();

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cout << fixed << setprecision(12); // debuged
    int T;
    T = 1;
    while (T--) solve();
}

// 蟻本p300 スライド最小値
// https://betrue12.hateblo.jp/entry/2019/11/25/225556
void solve() {
    int n, m;
    cin >> n >> m;
    string s;
    cin >> s;
    
    vector<int> dp(n + 1, inf);
    dp[n] = 0;
    deque<int> q;
    q.push_back(n);
    for (int i = n - 1; i >= 0; --i) {
        if (s[i] == '1') continue;
        while (sz(q) && i + m < q[0]) {
            q.pop_front();
        }
        if (sz(q) == 0) { // debuged
            cout << -1 << endl;
            return;
        }
        // cerr << "i " << i << endl; rep(j, sz(q)) cerr << q[j] << " "; cerr << endl;
        dp[i] = dp[q[0]] + 1;
        while (sz(q) && dp[q.back()] >= dp[i]) { // 末尾を取り除く
            q.pop_back();
        }
        q.push_back(i);
    }
    
    // debuged, 辞書順で最小のもの!!
    vector<int> ans;
    int now = 0;
    while (now != n) {
        for (int i = now + 1; i <= now + m; ++i) {
            if (dp[now] - 1 == dp[i]) {
                ans.eb(i - now);
                now = i;
                break;
            }
        }
    }
    cout << ans << endl;
}


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

int a[100001]={};

int main(){
  int N;
  std::cin>>N;
  int amax=0;
  for(int i=0;i<N;++i){
    std::cin>>a[i];
  }
  std::sort(a,a+N);
  int ans=0;
  int nownum=a[0],nowcnt=1;
  for(int i=1;a[i]!=0;++i){
    if(a[i]!=nownum){
      if(nowcnt<nownum)ans+=nowcnt;
      else if(nowcnt>nownum)ans+=nowcnt-nownum;
      //printf("%d\n", nownum);
      nownum=a[i];
      nowcnt=1;
    }else{
      nowcnt++;
    }
  }
  if(nowcnt<nownum)ans+=nowcnt;
  else if(nowcnt>nownum)ans+=nowcnt-nownum;
  std::cout<<ans<<std::endl;
  return 0;
}


Measured memory_bytes: 640
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstring>
#include <iterator>
#include <bitset>
#include <unordered_set>
#include <unordered_map>
#include <fstream>
#include <iomanip>
#include <cassert>
//#include <utility>
//#include <memory>
//#include <functional>
//#include <deque>
//#include <cctype>
//#include <ctime>
//#include <numeric>
//#include <list>
//#include <iomanip>

//#if __cplusplus >= 201103L
//#include <array>
//#include <tuple>
//#include <initializer_list>
//#include <forward_list>
//
//#define cauto const auto&
//#else

//#endif

using namespace std;


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

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
    v.assign(a, vector<T>(b, t));
}

template <class F, class T>
void convert(const F &f, T &t){
    stringstream ss;
    ss << f;
    ss >> t;
}

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define F first
#define S second
#define mkp make_pair
#define RALL(v) (v).rbegin(),(v).rend()
#define DEBUG
#ifdef DEBUG
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#else
#define dump(x) 
#define debug(x) 
#endif

#define MOD 1000000007LL
#define EPS 1e-8
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
#define maxs(x,y) x=max(x,y)
#define mins(x,y) x=min(x,y)

void mainmain(){
	int n;
	cin>>n;
	string a,b;
	cin>>a>>b;
	int p = 0;
	rep(i,n){
		if(a.substr(n-1-i)==b.substr(0,i+1)) p=i+1;
	}
	cout<<2*n-p<<endl;
}


signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(20);
    mainmain();
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops") 
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
#define int long long
#define fr(i,a,b) for(int i = a ; i <= b ; ++i)
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) begin(x), end(x)
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
#define pb push_back
#define fst first
#define snd second
using namespace __gnu_pbds;
using ordered_set =
 tree<int, null_type,less<int>,
 rb_tree_tag,tree_order_statistics_node_update>;
//find_by_order(k):returns iterator to kth element starting from 0
//order_of_key(k):returns count of elements strictly smaller than k
typedef long long ll;typedef pair<int, int> pii;
typedef vector<int> vi;typedef long double ld;
template<class T>
using min_heap = priority_queue<T,vector<T>,greater<T>>; 
template<typename T> T gcd(T a, T b){return(b?__gcd(a,b):a);}
template<typename T> T lcm(T a, T b){return(a*(b/gcd(a,b)));}
template<typename T> 
void remdup(vector<T>& v) {
	sort(all(v)); v.erase(unique(all(v)), v.end());
}
template<typename T> void re(vector<T> &v) {trav(i,v) cin >> i;}
void unsyncIO() { ios_base::sync_with_stdio(0); cin.tie(0); }
#ifdef np
#include "C:\Users\navodit\Desktop\mycodes\pr.h"
#else
#define trace(...)
#endif

#define MOD 1000000007  




void solve(){
	int n , m; 
	cin >> n >> m;
	vi h(n);re(h);
	vi vis(n,1);
	int cnt = 0 ;
	while(m--){
		int a ,b  ;
		cin >> a >> b; 
		a--;
		b--;
		if(h[a]<=h[b]) vis[a]=0;
		if(h[b]<=h[a]) vis[b]=0;
	}
	trav(i,vis)if(i)cnt++;
	cout << cnt << endl;
}


signed main() {
	unsyncIO();
	int tt =1 ;
	// cin >> tt;
	rep(i,0,tt) solve();













#ifdef np
	cout <<endl<<endl<< "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
	return 0;
}


Measured memory_bytes: 4740
import java.util.Scanner;
import java.util.Stack;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        while(true){
            boolean y_or_n = true;
            String str = sc.nextLine();
            if(str.equals(".")){
                break;
            }
            Stack<Character> st = new Stack<>();
            for(int i = 0; i < str.length(); i++){
                char c = str.charAt(i);
                if(c == '('){
                    st.push(c);
                }
                if(c == ')'){
                    if(st.empty() || st.pop() != '('){
                        y_or_n = false;
                    }
                }
                if(c == '['){
                    st.push(c);
                }
                if(c == ']'){
                    if(st.empty() || st.pop() != '['){
                        y_or_n = false;
                    }
                }
            }
            if(st.empty() && y_or_n){
                System.out.println("yes");
            }else{
                System.out.println("no");
            }
        }
        sc.close();
    }
}


Measured memory_bytes: 46824
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class Main {
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		ArrayList<Pyramid> pyramid = new ArrayList<Pyramid>();
		while(true){
			int x = Integer.parseInt(br.readLine());
			int h = Integer.parseInt(br.readLine());
			if(x == 0 && h == 0){
				break;
			}
			pyramid.add(new Pyramid(x, h));
		}
		for(Pyramid p : pyramid){
			System.out.printf("%.6f\n", p.getSurfaceArea());
		}
	}
}

class Pyramid{
	int x;
	int h;
	Pyramid(int x, int h){
		this.x = x;
		this.h = h;
	}
	public double getSurfaceArea(){
		double squareArea = x * x;
		return squareArea + (double)x * (Math.sqrt((squareArea + (double)(4 * h * h))));
	}
}

Measured memory_bytes: 11000
def main():
    n = int(input())
    a = [int(x) for x in input().split()]
    b = [int(x) for x in input().split()]
    c = [int(x) for x in input().split()]
    ans = 0
    latter = 60
    for i in range(n):
        now = a[i]-1
        ans += b[now]
        if latter+1 == now:
            ans += c[now-1]
        latter = now
    print(ans)
if __name__ == "__main__":
    main()

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

int main(){
  int H, W;
  cin >> H >> W;
  vector<vector<char>> a(H, vector<char>(W,'.'));
  
  for(int i = 0; i < H; i++){
    for(int j = 0; j < W; j++){
      cin >> a.at(i).at(j); 
    }
  }

  vector<bool> blankH(H, false), blankW(W, false);
  for(int i = 0; i < H; i++){
    for(int j = 0; j < W; j++){
      if(a.at(i).at(j) == '#'){
        blankH.at(i) = true;
        blankW.at(j) = true;
      }
    }
  }
  
  for(int i = 0; i < H; i++){
    for(int j = 0; j < W; j++){
      if(blankH.at(i) && blankW.at(j)){
        cout << a.at(i).at(j);
      }
    }
    if(blankH.at(i)) cout << endl;
  }
}

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


int main()
{
	int N;
	cin>>N;
	vector<ll> X(N);
	vector<ll> vec(N);
	rep(i,N)
	{
		cin>>X[i];
		vec[i]=X[i];
	}
	ll left_mid=0;
	ll right_mid=0;
	sort(vec.begin(),vec.end());
	left_mid=vec[N/2-1];
	right_mid=vec[N/2];
	map<ll,int> m;
	for(int i=0;i<vec.size();i++)
	{
		m[vec[i]]=i;
	}
	for(ll x : X)
	{
		if(m[x]<N/2)
		{
			cout<<right_mid<<endl;
		}
		else
		{
			cout<<left_mid<<endl;
		}
	}
	return 0;
}


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

int main()
{
    string S;
    cin >> S;
    int q;
    cin >> q;
    bool reverseStatus = false;
    while (q--) {
        int T;
        cin >> T;
        if (T == 1) {
            reverseStatus = !reverseStatus;
        }
        else {
            int F;
            string C;
            cin >> F >> C;
            if (F == 1) {
                if (reverseStatus) {
                    S.append(C);
                }
                else {
                    S.insert(0, C);
                }
            }
            else {
                if (reverseStatus) {
                    S.insert(0, C);
                }
                else {
                    S.append(C);
                }
            }
        }
    }
    if (reverseStatus) {
        reverse(S.begin(), S.end());
    }
    cout << S << endl;
}


Measured memory_bytes: 900
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;

int N;
map<int,int> G[100005];

void dfs(int now, int parent, int parent_color){
  int c = 0;
  if(c == parent_color) c++;
  FOR(it,G[now]){
    int nxt = it->first;
    if(nxt == parent) continue;

    int now_c = c;
    G[now][nxt] = c;
    G[nxt][now] = c;
    c++;
    if(c == parent_color) c++;
    //cout << now << "->" << nxt << " " << now_c << endl;
    dfs(nxt, now, now_c);
  }
}

int main(){
  cin >> N;
  vector<pair<int,int>> v;
  rep(i,N-1){
    int a, b;
    cin >> a >> b;
    v.emplace_back(a,b);
    G[a][b] = -1;
    G[b][a] = -1;
  }

  int mx = 0;
  int idx = 0;
  REP(i,1,N+1){
    if(mx < G[i].size()){
      mx = G[i].size();
      idx = i;
    }
  }

  dfs(idx, -1, -1);

  vector<int> ret(N+1,-1);
  rep(i,v.size()){
    ret[i] = G[v[i].first][v[i].second] + 1;
  }

  cout << mx << endl;
  rep(i,v.size()){
    cout << ret[i] << endl;
  }
  
  return 0;
}



Measured memory_bytes: 17528
program sample
    implicit none
    character(100)::s,t
    integer(8) :: i,j,k,m,n
    integer(8)::a,b,c,d
    integer(8),allocatable::x(:),y(:)
  
    read(*,*) n,k
    allocate(x(n))
    read(*,*)x
    m=0
    do i=1,n
        if(x(i)>=k)then
            m=m+1
        end if
    end do
    write(*,*)m
    stop
end program sample
  



Measured memory_bytes: 3704
n,*aa = map(int, open(0).read().split())

from itertools import accumulate
from collections import Counter
from math import comb

c = Counter(accumulate(aa))
c[0] += 1

ans = 0
for i,v in c.items():
    if v > 1:
        ans += comb(v,2)

print(ans)

Measured memory_bytes: 42400
import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;

// Bicycle
// 2013/09/10
public class Main{
	Scanner sc=new Scanner(System.in);

	int INF=1<<28;

	int n, m;
	int[] a, b;

	void run(){
		n=sc.nextInt();
		m=sc.nextInt();
		a=new int[m];
		b=new int[m];
		for(int i=0; i<m; i++){
			a[i]=sc.nextInt()-1;
			b[i]=sc.nextInt()-1;
		}
		solve();
	}

	void solve(){
		for(int k=0; k<m; k++){
			int N=n+1;
			V[] vs=new V[N*2];
			for(int i=0; i<N*2; i++){
				vs[i]=new V();
			}
			for(int i=0; i<N; i++){
				vs[i].add(vs[i+N], 1);
			}
			for(int i=0; i<k; i++){
				vs[a[i]+N].add(vs[b[i]], 1);
				vs[b[i]+N].add(vs[a[i]], 1);
			}
			vs[a[k]+N].add(vs[n], 1);
			vs[n+N].add(vs[a[k]], 1);
			vs[b[k]+N].add(vs[n], 1);
			vs[n+N].add(vs[b[k]], 1);
			int flow=fordFulkerson(vs, vs[n+N], vs[0]);
			println(flow>=2?"Yes":"No");
			if(k%100==0){
				System.gc();
			}
		}
	}

	int fordFulkerson(V[] vs, V s, V t){
		for(int flow=0;;){
			for(V v : vs)
				v.used=false;
			int f=dfs(s, t, INF);
			flow+=f;
			if(f==0||flow>=2)
				return flow;
		}
	}

	int dfs(V v, V t, int f){
		if(v==t){
			return f;
		}
		v.used=true;
		for(E e : v.es){
			if(!e.to.used&&e.cap>0){
				int d=dfs(e.to, t, min(f, e.cap));
				if(d>0){
					e.cap-=d;
					e.rev.cap+=d;
					return d;
				}
			}
		}
		return 0;
	}

	class V{
		ArrayList<E> es=new ArrayList<E>();
		boolean used;

		void add(V to, int cap){
			E e=new E(to, cap), rev=new E(this, 0);
			e.rev=rev;
			rev.rev=e;
			es.add(e);
			to.es.add(rev);
		}
	}

	class E{
		V to;
		E rev;
		int cap;

		E(V to, int cap){
			this.to=to;
			this.cap=cap;
		}
	}

	void println(String s){
		System.out.println(s);
	}

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

Measured memory_bytes: 146740
import math
a, b, c, d, e, f = [int(x) for x in input().split()]
threshold = e / (100 + e) * 100
max_concent = 0
max_total = 0
max_suger = 0
max_suger_try = int(threshold/100*f//c)
for i in range(31):
    for j in range(31):
        for k in range(max_suger_try):
            for l in range(max_suger_try):
                water = a * i * 100 + b * j * 100
                suger = c * k + d * l   
                if water == 0:
                    break
                concentration = suger / (water + suger) * 100
                if (water + suger > f or concentration > threshold) :
                    break
                else:
                    if concentration > max_concent:
                        max_concent = concentration
                        max_total = water + suger
                        max_suger = suger
if max_total == 0:
    max_total = a * 100
print("{} {}".format(max_total, max_suger))

Measured memory_bytes: 3064
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb emplace_back
#define INF (1e9+1)
//#define INF (1LL<<59)

int main(){
    int n;
    cin>>n;
    
    vector<pii> ans;
    rep(i,n){
        for(int j=i+1;j<n;j++){
            string s = string(n,'0');
            s[i] = s[j] = '1';
            cout<<"? "<<s<<endl;
            
            int res;
            cin>>res;
            if(res){
                ans.pb(pii(i,j));
            }
            if(ans.size()==n-1)goto end;
        }
    }
end:;
    cout<<"!";
    rep(i,ans.size()){
        cout<<" (";
        cout<<ans[i].first<<","<<ans[i].second;
        cout<<")";
    }
    cout<<endl;
}

Measured memory_bytes: 852
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  int temp;
  temp = n%10;
  if(temp == 2||temp==4||temp==5||temp==7||temp==9){
  	cout<<"hon";
  }
  else if(temp==0||temp==1||temp==6||temp==8){
  	cout<<"pon";
  }else{
  	cout<<"bon";
  }
  return 0;
  
    
}

Measured memory_bytes: 3584
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
using Graph = vector<vector<ll>>;
using P = pair<int,int>;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
#define MOD 1000000007
#define INF 1000000
#define PI 3.14159265358979323846264338327950L
#define MAX_N 200010
#define lb lower_bound 

int main()
{
  int n,k;cin>>n>>k;
  vector<int> p(n);
  for (int i=0;i<n;i++){
    cin>>p[i];
  }
  
  sort(p.begin(),p.end());
  int ans=0;
  for (int i=0;i<k;i++)
    ans += p[i];
  
  cout<<ans<<endl;
  
}

Measured memory_bytes: 3616
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
#include <queue>
#define pb push_back
#define int long long int
using namespace std;
typedef pair<int,int> pii;
 
int n;
struct mypair1{
  int x,y,z,index;
  mypair1(int a,int b,int c,int d){ x=a; y=b; z=c;index=d;}
  bool operator<( const mypair1& another) const {
    if(x==another.x) return y > another.y;
    return x > another.x;
  }
};
 
vector<mypair1> m1;
int hako[111111];
 
signed main(){
  cin>>n;
 
  int a,b;
  for(int i=0;i<n;i++){
    cin>>a>>b;
    m1.pb(mypair1(a+b,a,b,i));
  }
  sort(m1.begin(),m1.end());
 
  int res=0;
 
  for(int i=0;i<n;i++){
    if(i%2==0){
      res+=m1[i].y;
    }
    else{
      res-=m1[i].z;
    }
  }
 
  cout<<res<<endl;
  return 0;
}

Measured memory_bytes: 6512
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <stdio.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
#include <sstream>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define FOR(i,a,b) for(int i=a; i<(int)(b); i++)
#define ALL(x) (x).begin(),(x).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SORT(c) sort(ALL(x))
#define CLR(a) memset((a), 0 ,sizeof(a))
#define PB push_back
#define MP make_pair
#define SP << " " <<
const int INF = 1001001001;
const ll LINF = 100100100100100100;
const double EPS = 1e-10;
const double PI  = acos(-1.0);
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

__attribute__((constructor))
void initial(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}


signed main(){
	int K, X; cin>>K>>X;
	int left = -1000000; int right = 1000000;
	rep(i,2*K-1){
		int c = X-K+1+i;
		if((c>=left)&&(c<=right)) cout << c << " ";
	}
 cout << endl;
	return 0;
}


Measured memory_bytes: 256
#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);
	int N; cin>>N;
	vector<int> A(N);
	for (int i=0; i<N; i++)
		cin>>A[i];
	map<int,int> pre, suf;
	pre[0]=A[0];
	suf[N-1]=A[N-1];
	for (int i=1; i<N; i++)
		pre[i]=__gcd(pre[i-1],A[i]);
	for (int i=N-2; i>=0; i--)
		suf[i]=__gcd(suf[i+1],A[i]);
	int ret=0;
	for (int i=0; i<N; i++)
		ret=max(ret,__gcd(pre[i-1],suf[i+1]));
	cout<<ret<<"\n";
	return 0;
}

Measured memory_bytes: 9984
#include<bits/stdc++.h>
#define forr(i, a, b) for(int i = (a); i < (b); i++)
#define rep(i,n) for(int i = 0; i < (n); i++)
#define rrep(i,n) for(int i = 1; i <= (n); i++)
#define ALL(a) (a.begin()),(a.end())
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll, ll> LP;
const ll LINF = 1LL<<60;
const int INF = 1001001001;
const int MOD = 1000000007;

/* --------------------------------------------------- */

int main() {
    int n, m;
    cin >> n >> m;
    vector<bool> b(n + 1, false);
    vector<P> A(m);
    rep(i, m) {
        cin >> A[i].first >> A[i].second;
        if(A[i].second == n) b[A[i].first] = true;
    }
    rep(i, m) {
        if(A[i].first == 1 && b[A[i].second]) {
            puts("POSSIBLE");
            return 0;
        }
    }
    puts("IMPOSSIBLE");
    
    return 0;
}

Measured memory_bytes: 1792
#ifdef _DEBUG
#include "../../library/library/debug_template.cpp"
#define DMP(...) dump(#__VA_ARGS__, __VA_ARGS__)
#else
#define DMP(...) ((void)0)
#endif

#include <cassert>
#include <cstdio>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <queue>
#include <numeric>
#include <algorithm>
#include <bitset>

using namespace std;
using lint = long long;
constexpr int MOD = 1000000007, INF = 1010101010;
constexpr lint LINF = 1LL << 60;

struct init {
	init() {
		cin.tie(nullptr); ios::sync_with_stdio(false);
		cout << fixed << setprecision(10);
	}
} init_;

int main() {

	lint I, O, J, L, skip;
	cin >> I >> O >> skip >> J >> L >> skip >> skip;
	DMP(I, O, J, L);

	lint ans = 0;
	ans += O;
	ans += I / 2 * 2;
	ans += J / 2 * 2;
	ans += L / 2 * 2;

	auto majority = [](int&& a, int&& b, int&& c) {
		return a & b | b & c | c & a;
	};

	if (majority(I & 1, J & 1, L & 1) & !!I & !!J & !!L) ans += 1 + 2 * (I & J & L & 1);

	cout << ans << "\n";

	return 0;
}


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

int main(){
  int n;
  cin >> n;
  vector<ll> a(n);
  rep(i,n) cin >> a.at(i);
  vector<ll> vec(1000001);
  for( int p : a ){
    vec.at(p)++;
  }
  for(ll i=1;i<=1000000;++i){
    if( vec.at(i) == 0 ) continue;
    for(int j=i+i;j<=1000000;j+=i){
      vec.at(j) += vec.at(i);
    }
  }
  int ans = 0;
  for( int p : a ){
    if( vec.at(p) == 1 ) ++ans;
  }
  cout << ans << endl;

  return 0;
}


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

using namespace std;

#define INF ((1<<30)-1)  //int32_t
#define MOD 1000000007
#define MOD2 

#define all(a)  (a).begin(),(a).end()

#define mkp make_pair
#define pb push_back

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

int main(){

    bool flag=false;

    ll ans=0,sum=0;
    
    int a,b;
    cin >>a>>b;
    

    //cout <<fixed<<setprecision(16)<< << endl;
    //cout << ans << endl;

    if(a < 10 && b < 10)cout << a*b <<endl;
    else cout << -1 <<endl;
    
    return 0;
}


Measured memory_bytes: 256
import Data.List

main = do
  n <- readLn :: IO Int
  a <- map read . words <$> getLine :: IO [Int]
  b <- reverse . map read . words <$> getLine :: IO [Int]
  let ans = maximum $ map (solve a b n) [1..n]
  print ans

solve :: [Int] -> [Int] -> Int -> Int -> Int
solve a b n i =
  let aS = sum $ take i a
      bS = sum $ take (n-i+1) b
  in aS + bS


Measured memory_bytes: 1020
#include <bits/stdc++.h>
using namespace std;
int main(){
    int A,B,C,D;
    cin>>A>>B>>C>>D;
    while(1){
        C=C-B;
        if(C<=0){
            cout<<"Yes"<<endl;
            return 0;
        }
        A=A-D;
        if(A<=0){
            cout<<"No"<<endl;
            return 0;
        }
    }
    return 0;
}


Measured memory_bytes: 3636
import sys
INF = 1 << 60
MOD = 10**9 + 7 # 998244353
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
def resolve():
    n, k = map(int, input().split())
    P = list(map(lambda x : int(x) - 1, input().split()))
    C = list(map(int, input().split()))

    # doubling table
    nexts = [P]
    vals = [C]
    totals = [C]
    for _ in range(60):
        next, val, total = nexts[-1], vals[-1], totals[-1]
        nnext, nval, ntotal = [0] * n, [0] * n, [0] * n
        for i in range(n):
            nnext[i] = next[next[i]]
            nval[i] = val[i] + val[next[i]]
            ntotal[i] = max(total[i], val[i] + total[next[i]])
        nexts.append(nnext)
        vals.append(nval)
        totals.append(ntotal)

    # answer
    ans = -INF
    for now in range(n):
        score = 0
        for d in range(59, -1, -1):
            if k >> d & 1:
                ans = max(ans, score + totals[d][now])
                score += vals[d][now]
                now = nexts[d][now]
    print(ans)
resolve()

Measured memory_bytes: 102468
#include<cstdio>
#include<cmath>
#include<string>
#include<iostream>
#include<algorithm>
#include<utility>
#include<vector>
#include<map>
#include<set>
#include<limits>
#include<bitset>
#include<array>
#include<numeric>
#include<iomanip>
#include<functional>
#include<deque>

using namespace std;
typedef long long int ll;

#define C cout<<
#define E <<endl
#define CE cout<<endl
#define pb push_back

ll n,m,a,b,c,x,y,z,aa[200010],ab[200010],ac[2];
bool r,ra,rb,rc[200010];
string s,sa,sb,sc;
char ca,cb,cc,cd[1010][1010];
vector<ll> va,vb,vc,vd,ve,vaa,vbb;
set<int> st;

template<typename MAIN>
ostream & operator<<(ostream & osys,vector<MAIN> vtar){
    osys<<"[";
    for(int i=0;i<vtar.size();i++)osys<<vtar[i]<<(i==vtar.size()-1 ? "":",");
    osys<<"]";
    return osys;
}

int main(){
    cin>>s;
    r=true;
    for(int i=0;i<s.size();i++){
        if(i%2==0){
            if (!(s[i]=='R' or s[i]=='U' or s[i]=='D'))r=false;
        }
        if(i%2==1){
            if (!(s[i]=='L' or s[i]=='U' or s[i]=='D'))r=false;
        }
    }
    C (r ? "Yes":"No") E;

}


Measured memory_bytes: 256
H, W = gets.strip.split.map(&:to_i)

a = Array.new(H).map { gets.strip.split('') }

wc = Array.new(H){0}
H.times { |i| W.times { |j| wc[i] += 1 if a[i][j].eql?('#') } }

hc = Array.new(W){0}
W.times { |j| H.times { |i| hc[j] += 1 if a[i][j].eql?('#') } }

# for degug
# puts

H.times do |i|
  next if wc[i] == 0
  W.times do |j|
    print a[i][j] if hc[j] != 0
  end
  puts
end


Measured memory_bytes: 2684
#include <stdio.h>

int main(void){

	int a,b;
    scanf("%d %d", &a, &b);
    if(a<b){
          printf("a < b\n");
    }else if(a>b){
    	printf("a > b\n");
    }else{
		printf("a == b\n");
	}
    return 0;
}

Measured memory_bytes: 580