akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <deque>
#include <queue>
#include <array>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cstdint>
#include <cassert>
#include <random>

using namespace std;
using i64 = int64_t;
using i32 = int32_t;
template<class T, class U> void init_n(vector<T>& v, size_t n, U x) 
{ v = vector<T>(n, x); }
template<class T> void init_n(vector<T>& v, size_t n) { init_n(v, n, T()); }
template<class T> void read_n(vector<T>& v, size_t n, size_t o = 0) 
{ v = vector<T>(n+o); for (size_t i=o; i<n+o; ++i) cin >> v[i]; }
template<class T> void read_n(T a[], size_t n, size_t o = 0)
{ for (size_t i=o; i<n+o; ++i) cin >> a[i]; }
template<class T> T iabs(const T& x) { return max(x, -x); }
// #define abs gabs

i64 m, k;
int main() {
    cin >> m >> k;
    
    if (k >= (1 << m) || (k == 1 && m == 1)) {
        cout << -1 << endl;
        return 0;
    }

    if (m == 1 && k == 0) {
        cout << "0 0 1 1\n";
        return 0;
    }

    vector<int> a;
    for (int i = 0; i < (1 << m); ++i) {
        if (i == k) continue;
        a.push_back(i);
    }
    auto b = a;
    reverse(begin(b), end(b));
    for (int x : a) cout << x << ' ';
    cout << k << ' ';
    for (int x : b) cout << x << ' ';
    cout << k << '\n';
    return 0;
}

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

int main(void){
    int n;
    cin >> n;
    int pri[60000];
	for(int i=0;i<60000;++i){
		pri[i] = 1;
	}
	for(int i=2;i<60000;++i){
		if(pri[i]){
			for(int j=0;i*(j+2)<60000;j++){
				pri[i*(j+2)] = 0;
			}
		}
	}
    int cnt = 0;
    for(int i=2;i<60000;++i){
        if(!pri[i]) continue;
        if(i%5==1){
            cout << i;
            ++cnt;
            if(cnt==n){
                cout << endl;
                return 0;
            }else{
                cout << " ";
            }
        }
    }
}

Measured memory_bytes: 512
# include <iostream>
# include <vector>
# include <string>
# include <algorithm>
using namespace std;
int main() {
	int a;
	int f = 0, s = 0;
	for (int i = 0; i < 3; i++) {
		cin >> a;
		if (a == 5) {
			f++;
		}
		if (a == 7) {
			s++;
		}
	}
	if (f == 2 && s == 1) {
		cout << "YES" << endl;
	}
	else {
		cout << "NO" << endl;
	}
}

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

int main(){
    int n;
    string s;
    cin >> n >> s;
    string alp = {"ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"};
    string ans = "";
    rep(i,s.size()){
        rep(j,26){
            if(s[i] == alp[j]) ans += alp[j+n];
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1000000007;
const ll LINF=1LL<<60;
const int INF=1<<30;
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; }

int bfs(int N,int M,vector<vector<char>> field,int sx,int sy,int gx, int gy);

int main(){ 
    int N,M,sx,sy,gx,gy;
    
    cin >> N;
    cin >> M;
	cin>>sx>>sy>>gx>>gy;
    vector<vector<char>> field(N,vector<char>(M));
    for (int i = 0;i < N;i++){
        for (int j = 0;j < M;j++){
            cin >> field.at(i).at(j); 
        } 
    }

    int ans = bfs(N,M,field,sx-1,sy-1,gx-1,gy-1);
	if (ans == INF){
		cout << -1 << endl;
	}
	else cout << ans << endl;
}

int bfs(int N,int M,vector<vector<char>> field,int sx,int sy,int gx, int gy){
    int dx[4] = {1,0,-1,0}, dy[4] = {0,1,0,-1};
    int d[N][M];//距離の配列
    for (int i = 0;i < N;i++){
        for (int j = 0;j < M;j++){
            d[i][j] = INF;//初期化
        }
    }
    deque<P> que;
    que.push_front(P(sx,sy));
    d[sx][sy] = 0;

    //キューが空になるまでループ
    while(que.size()){
        P p = que.front();
        que.pop_front();//先頭を取り出す
        for (int i = 0;i < 4;i++){
            int nx = p.fs + dx[i], ny = p.sc + dy[i];
            //nx,nyが進めるマスか、行ったことのないマスかどうかを判定
            if (0 <= nx && nx < N && 0 <= ny && ny < M && field[nx][ny] != '#' && d[nx][ny] > d[p.fs][p.sc]){
                que.push_front(P(nx,ny));//追加
                d[nx][ny] = d[p.fs][p.sc];//距離を確定 
            }
        }
		for(int i = -2; i <= 2; i++) {
			for(int j = -2; j <= 2; j++) {
				if (0 <= p.fs + i && p.fs + i < N && 0 <= p.sc + j && p.sc + j < M &&d[p.fs + i][p.sc + j] > d[p.fs][p.sc] + 1 && field[p.fs + i][p.sc + j] != '#' && (i != 0 || j != 0)){
					que.push_back(P(p.fs + i,p.sc + j));
					d[p.fs + i][p.sc + j] = d[p.fs][p.sc] + 1;
				}
			}
		}
    }
    return d[gx][gy];
}

Measured memory_bytes: 9696
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		new Main().solve();
	}
	
	void solve(){
		Scanner sc=new Scanner(System.in);
		int a=sc.nextInt();
		int b=sc.nextInt();
		
		if(a%3==0 || b%3==0 || (a+b)%3==0){
			System.out.println("Possible");
		}else{
			System.out.println("Impossible");
		}
	}
}


Measured memory_bytes: 23636
#include<bits/stdc++.h>
using namespace std;
signed main(){
  int M;
  int D1;
  int D2;
  int count=0;
  cin>>M>>D1;
  D2=D1%10;
  D1=D1/10;
  if(M<=3){
  cout<<"0"<<"\n";
  }else{
  for(int i=4;i<=M;i++){
    for(int j=2;j<=D1;j++){
      if(D1!=j){
	for(int k=2;k<=9;k++){
	  if(i==j*k){
	      count++;
	  }
	}
      }
	else{
	  for(int k=2;k<=D2;k++){
	    if(i==j*k){
	      count++;
	      	    
	    }
	  }
	}
    }
  }
  cout<<count<<"\n";
  }
  return(0);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define P pair<ll,ll>
#define FOR(I,A,B) for(ll I = (A); I < (B); ++I)
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin()) //ai>=v  x is sorted
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin()) //ai>v  x is sorted
#define NUM(x,v) (POSU(x,v)-POSL(x,v))  //x is sorted
#define SORT(x) (sort(x.begin(),x.end())) // 0 2 2 3 4 5 8 9
#define REV(x) (reverse(x.begin(),x.end())) //reverse
#define TO(x,t,f) ((x)?(t):(f))
#define CLR(mat) memset(mat, 0, sizeof(mat))
#define FILV(x,a) fill(x.begin(),x.end(),a)
#define FILA(ar,N,a) fill(ar,ar+N,a)
#define NEXTP(x) next_permutation(x.begin(),x.end())
ll gcd(ll a,ll b){if(a<b)swap(a,b);if(a%b==0)return b;else return gcd(b,a%b);}
ll lcm(ll a,ll b){ll c=gcd(a,b);return ((a/c)*(b/c)*c);}//saisyo kobaisu
#define pb push_back
#define pri(aa) cout<<(aa)<<endl
#define mp(x,y) make_pair(x,y)
#define fi first
#define se second
const ll INF=1e18+7;
const ll MOD=1e9+7;
const ll N = 1000;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	ll n;
	map<ll,ll> m;
	cin>>n;
	FOR(i,0,n){
		ll k;
		cin>>k;
		m[k]++;
	}
	cin>>n;
	FOR(i,0,n){
		ll k;cin>>k;
		m[k]--;
		if(m[k]<0){
			cout<<"NO"<<endl;
			return 0;
		}
	}
	cout<<"YES"<<endl;
}

Measured memory_bytes: 12800
#include<bits/stdc++.h>
#include<iostream>
using namespace std;
#define int long long int
#define ld long double
#define all(x) (x).begin(), (x).end()
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define fi first
#define se second
#define mp make_pair
#define pb push_back
typedef pair<int,int> pii;
#define mxe(v) *max_element(v.begin(),v.end())
#define mne(v) *min_element(v.begin(),v.end())
#define ub upper_bound
#define lb lower_bound
#define present(c,x) (c.find(x) != c.end())
#define removeDuplicates(a) a.resize(unique(all(a))-a.begin())
#define endl '\n'	
#define fill(s,x,n) vector
 x(n); rep(i,0,n) cin>>x[i];
#define INF 1000000007 
#define MOD 998244353
#define INF64 1e18
#define setbits(x) (__builtin_popcount(x))

void solve(){
	int n;
	cin>>n;
	vector<vector<int>> compatible(n,vector<int> (n));

	rep(i,0,n){
		rep(j,0,n){
			cin>>compatible[i][j];
		}
	}

	int tot=1<<n;
	vector<int> dp(tot,0);
	dp[0]=1;
	rep(mask,0,tot){
		rep(i,0,n){
			if((mask&(1<<i))==0){
				dp[mask|(1<<i)]+=compatible[__builtin_popcount(mask)][i]*dp[mask];
				dp[mask|(1<<i)]%=INF;
			}
		}
	}

	cout<<dp[tot-1]<<endl;
}
 	
int32_t main(){
	
	ios_base::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
 
	int T;
	// cin>>T;
	T=1;
	while(T--){
		solve();
	}
}

Measured memory_bytes: 19452
'use strict';
console.log(function(args){
  const _tmp = args.trim().split('\n');
  const N = _tmp.shift()|0;
  const A = [], x = [], y = [];
  for ( let i = 0; i < N; i++ ) {
    A[i] = _tmp.shift()|0;
    x[i] = []; y[i] = [];
    for ( let j = 0; j < A[i]; j++ ) {
      const xy = _tmp[j].split(' ');
      x[i][j] = xy[0]-1; y[i][j] = xy[1]|0;
    }
    _tmp.splice(0,A[i]);
  }
  let K = 0;
  TEST: for ( let honest = 1; honest < 1<<N; honest++ ) {
    let k = 0;
    for ( let i = 0; i < N; i++ ) {
        if ( !(honest&1<<i) ) continue;
      k++;
      for ( let j = 0; j < A[i]; j++ ) {
        const Xij = x[i][j], Yij = y[i][j];
        const target = honest&(1<<Xij);
        if ( target!==(Yij<<Xij) ) continue TEST;
      }
    }
    if ( k > K ) K = k;
  }
  return K;
}(require('fs').readFileSync('/dev/stdin', 'utf8')));


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

#define FASTIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define rep(i,a,b) for(int i=a; i<b; i++)

int main()
{
	FASTIO
	string s, t, ans;
	cin >> s >> t;
	t.pop_back();
	ans = (s == t) ? "Yes" : "No";
	cout << ans << "\n";
	return 0;
}

Measured memory_bytes: 3656
from collections import defaultdict
import sys
from math import ceil
input = sys.stdin.readline

def main():
    # init
    n,h = map(int,input().split())
    a,b = [0 for _ in range(n)],[0 for _ in range(n)]
    for i in range(n):
        a[i],b[i] = map(int,input().split())
    b.sort(reverse=True)
    max_a = max(a)
    # memo
    

    # ans
    ans = 0
    for i in range(n):
        if b[i]>=max_a:
            h -= b[i]
            ans += 1
        if h<=0:
            print(ans)
            exit()
    ans += ceil(h/max_a)
    print(ans)
    
if __name__ == "__main__":

    main()

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

int main(){
    while(1){
        int H,W;
        cin>>H>>W;
        if(H==0 && W==0) break;
        for(int i=0;i<H;i++){
            for(int j=0;j<W;j++){
		if((i+j)%2 ==0) cout<<"#";
       		else cout<<".";
            }
            cout<<endl;
        }
        cout<<endl;
    }
    return 0;
}


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

vector<bool> seen, finished;
int pos;  // vertex in cycle
stack<int> hist;
vector<ll> score;
vector<vector<ll>> value;
const ll INFTY = 1000000000001;
vector<bool> infs;  // infinite score

void loop(stack<int> st) {  // score increase in cycle
  vector<int> cycle;
  while (!st.empty()) {  // restore cycle
    int t = st.top();
    cycle.push_back(t);
    st.pop();
    if (t == pos) break;
  }
  int s = cycle.size();
  cycle.push_back(cycle.at(0));
  ll sum = 0;
  rep(i,s) sum += value[cycle.at(i+1)][cycle.at(i)];
  if (sum > 0) rep(i,s) score[cycle.at(i)] = INFTY;
  return;
}

void dfs(const Graph &G, int v) {
  seen[v] = true;
  hist.push(v);
  for (auto nv : G[v]) {
    if (infs[nv]) {  // entered infinite score
      continue;
    }
    if (infs[v]) {  // from infinite score
      infs[nv] = true;
      dfs(G, nv);
      continue;
    }
    if (seen[nv] && !finished[nv]) {  // detected cycle
      pos = nv;
      loop(hist);
      continue;
    }
    if (score[nv] < score[v]+value[v][nv]) {
      score[nv] = score[v]+value[v][nv];
      dfs(G, nv);
    }
  }
  if (score[v] == INFTY && !infs[v]) {  // detected increasing cycle now
    infs[v] = true;
    dfs(G, v);
  }
  hist.pop();
  finished[v] = true;
}

int main() {
  int N, M;
  cin >> N >> M;
  Graph G(N);
  value.assign(N, vector<ll>(N));
  rep(i,M) {
    int a, b; ll c;
    cin >> a >> b >> c;
    --a, --b;  // 0-indexed
    G[a].push_back(b);
    value[a][b] = c;
  }

  seen.assign(N, false), finished.assign(N, false);
  score.assign(N, -INFTY);
  score[0] = 0;
  infs.assign(N, false);

  dfs(G,0);

  if (infs[N-1]) cout << "inf" << endl;
  else cout << score[N-1] << endl;
  return 0;
}


Measured memory_bytes: 8448
#include <iostream>
#include <cctype>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <string>
#include <functional>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#define YES cout<<"YES"<<endl
#define Yes cout<<"Yes"<<endl
#define NO cout<<"NO"<<endl
#define No cout<<"No"<<endl
typedef long long ll;
const int INF = 100000000, mod = 1000000007;
const ll LLINF = 1LL << 50;
using namespace std;


int main() {
    int n;
    cin >> n;
    int i = 1;
    while (1) {
        if (i*i > n) {
            cout << (i - 1)*(i - 1) << endl;
            break;
        }
        i++;
    }
    return 0;
}


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

#define ASC(vec) vec.begin(), vec.end()		// 昇順ソート 例：sort(ASC(vec));
#define DESC(vec) vec.rbegin(), vec.rend()	// 降順ソート 例:sort(DESC(vec));
#define rep(i, n) for(int i = 0; i < n; i++)
#define Rep(i, n) for(int i = 1; i < n; i++)
#define In(vec) rep(i, n) cin>>vec[i];
#define ANS(s) cout << s << endl
#define inc(a, b) cin >> a >> b;

const int mod = 1000000007;
const int inf = (int)1e9 + 7;
const long long INF = 1LL << 60;

typedef long long ll;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<bool> vb;
typedef vector<ll> vl;
typedef vector<vector<int> > vvi;
typedef vector<pair<int, int> > vii;

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

ll GCD(ll a, ll b) { return b ? GCD(b, a % b) : a; }
ll LCM(ll a, ll b) { return (a * b) / GCD(a, b); }
int round_int(int a, int b) { return (a + (b - 1)) / b; }


// 4,8方向に探索する際に用いる配列
//int dx[4] = { 0,  0, 1, -1 };
//int dy[4] = { 1, -1, 0,  0 };
//int dx[8] = { 1, 0, -1,  0, 1, -1, -1,  1 };
//int dy[8] = { 0, 1,  0, -1, 1,  1, -1, -1 };

// ────────────────────────────────────────────────────

int main() {
	int d, l;
	cin >> d >> l;

	cout << d / l + d % l << endl;
}



Measured memory_bytes: 3120
import re

def main():
    H, W, s, t = input().split()

    H, W = map(int, (H, W))
    s, t = map(lambda ch: ord(ch)-ord('A'), (s, t))

    a = [input() for i in range(H)]
    # b is transpose of a
    b = [''.join([a[i][j] for i in range(H)]) for j in range(W)]

    # Parse paths
    paths = []
    path_h_re = re.compile(r'o[A-Z]o(?:-+o[A-Z]o)+')
    path_v_re = re.compile(r'o[A-Z]o(?:\|+o[A-Z]o)+')
    for a_i in a: paths.extend(path_h_re.findall(a_i))
    for b_i in b: paths.extend(path_v_re.findall(b_i))
    paths = [re.sub(r'[^A-Z]+', '', e) for e in paths]

    # Make a graph
    INF = 50
    g = [[INF for j in range(26)] for i in range(26)]
    for path in paths:
        for u, v in zip(path[:-1], path[1:]):
            u = ord(u)-ord('A')
            v = ord(v)-ord('A')
            g[u][v] = g[v][u] = 1

    # Solve a shortest-path problem
    for k in range(26):
        g = [
            [min(g[i][j], g[i][k]+g[k][j]) for j in range(26)]
            for i in range(26)
        ]

    print(g[s][t])
    return 0

if __name__ == '__main__':
    exit(main())



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

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

    int ans=0;
    for(int i=0; i<s.size(); i++ ){
        if(s[i] != t[i]){
            ans++;
        }
    }
    cout << ans << endl;

}


Measured memory_bytes: 3912
#include <iostream>
#include <vector>
#include <math.h>

int main(){
  int n, d;
  int s = 0;
  std::cin>>n>>d;
  for(int i = 0;i < n;i++){
    int x,y;
    std::cin>>x>>y;
    if(sqrt(pow(x,2)+pow(y,2)) <= d)s++;
  }
  std::cout<<s<<std::endl;
}

Measured memory_bytes: 3160
import sys

class card:
    def __init__(self, types, value):
        self.types = types
        self.value = value

def quickSort(A, p, r):
    if p < r:
        q = partition(A, p, r)
        quickSort(A, p, q - 1)
        quickSort(A, q + 1, r)

def partition(A, p, r):
    x = A[r].value
    i = p - 1
    for j in range(p, r):
        if A[j].value <= x:
            i += 1
            swap(A, i, j)
    swap(A, i + 1, r)

    return i + 1

def swap(array, i, j):
    tmp = array[i]
    array[i] = array[j]
    array[j] = tmp

def checkStable(origin, sorted, N):
    for i in range(0, N - 1):
        if sorted[i].value == sorted[i + 1].value:
            if origin.index(sorted[i]) > origin.index(sorted[i + 1]):
                return False
    return True

if __name__ == "__main__":
    lines = sys.stdin.readlines()
    del lines[0]
    A = [card(c[0], int(c[2:])) for c in lines]
    origin = A[:]
    quickSort(A, 0, len(A) - 1)
    if checkStable(origin, A, len(A)):
        print "Stable"
    else:
        print "Not stable"
    for a in A:
        print a.types + " " + str(a.value)

Measured memory_bytes: 54544
#include<stdio.h>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
 
 
using namespace std;
 
//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
 
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}
 
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
 
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
 
//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
 
//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
 
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
 
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int main(void){
  int n,q;
  string s;
  cin>>n>>q;
  cin>>s;
  n=s.length();
  int dp[100000];
  REP(i, 100000)dp[i]=0;
  for(int i=0; i<s.length()-1; i++){
      if(s[i]=='A'&& s[i+1]=='C'){
        dp[i+1]=dp[i]+1;
      }
      else dp[i+1]=dp[i];
  }
  REP(i,q){
    int l, r;
    int ans=0;
    cin>>l>>r;
    cout<<dp[r-1]-dp[l-1]<<endl;
  }
  return 0;
}


Measured memory_bytes: 1408
#include<iostream>
#include<numeric>
#include<cmath>
#include<vector>
#include<string>

using namespace std;

int main() {
    
    string str;
    
    cin>>str;
    for(int i=0;i<str.size();i++){
    if(i%2==0){
    cout<<str[i];
    }
    }
    cout<<endl;
	return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define Hello ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define endl '\n'
#define ll long long
int numb(int n, int k){
    int cntr = 0;
    while(n < k){
        cntr ++;
        n *= 2;
    }
    return cntr;
}
int main(){
    Hello
    double n, k;
    cin >> n >> k;
    double ans = 0;
    for(int i = 1; i <= n; i++){
        double toPow = numb(i, k);
        ans += (1/n) * (pow(0.5, toPow));
    }
    cout << fixed << setprecision(9) << ans;
    return 0;
}


Measured memory_bytes: 4240
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <functional>

using namespace std;

#define fst first
#define scd second
#define PB push_back
#define MP make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define omajinai ios::sync_with_stdio(false);cin.tie(0)
#define rep(i,x) for(int i=0;i<(int)(x);++i)
#define rep1(i,x) for(int i=1;i<=(int)(x);++i)
#define rrep(i,x) for(int i=(int)x-1;i>=0;--i)
#define rrep1(i,x) for(int i=(int)x;i>=1;--i)

using ll=long long;
using ld=long double;
using vi=vector<int>;
using vvi=vector<vi>;
using pii=pair<int, int>;
using vpii=vector<pii>;

template<class T,class U>ostream&operator<<(ostream&os,const pair<T,U>p){os<<"("<<p.fst<<", "<<p.scd<<")";return os;}
template<class T>ostream&operator<<(ostream&os,const vector<T>v){rep(i,v.size()){if(i)os<<", ";os<<v[i];}return os;}
template<typename T>T&max(T&a,T&b){if(a>=b)return a;return b;}
template<typename T>T&min(T&a,T&b){if(a < b)return a;return b;}
template<typename T>bool chmax(T&a,T b){if(a < b){a=b;return true;}return false;}
template<typename T>bool chmin(T&a,T b){if(a > b){a=b;return true;}return false;}

constexpr int inf = 1e9;
constexpr ll linf = 3e18;
constexpr double eps = 1e-9;

int arr[101][101];
int dy[4] = {0, 1, 0, -1};
int dx[4] = {1, 0, -1, 0};

signed main()
{
    int H, W; cin >> H >> W;
    memset(arr,-1,sizeof arr);
    int N; cin >> N;
    vector<int> hoge;
    rep(i, N) {int tmp; cin>>tmp;rep(_,tmp)hoge.PB(i+1);}
    if (H == 1) {
        rep(i, H*W) {
            if (i) cout << ' ';
            cout<<hoge[i];
        }
        return 0;
    }
    int cury = 0-dy[3], curx = 0-dx[3], curdir=3;

    rep(i, H*W) {
        cury += dy[curdir];
        curx += dx[curdir];
        //printf("curdir=%d, (%d, %d)\n",curdir, cury, curx);
        //printf("hoge[%d]=%d\n",i,hoge[i]);
        //cout << "curdir = " << curdir << endl;
        //printf("cury=%d,curx=%d\n",cury,curx);
        //if (cury==1&&curx==3)cout<<'a'<<endl;
        if (arr[cury][curx] >= 0) {
            cury -= dy[curdir], curx -= dx[curdir];
            curdir++, curdir%=4;
            i--;continue;
        }
        arr[cury][curx] = hoge[i];
        if (cury == 0 and curx == 0) curdir++, curdir%=4;
        if (cury == 0 and curx == W-1) curdir++, curdir%=4;
        if (cury == H-1 and curx == 0) curdir++, curdir%=4;
        if (cury == H-1 and curx == W-1) curdir++, curdir%=4;
    }
    //cout <<"debug: "<<arr[1][3]<<endl;
    rep(i, H) {
        rep(j, W) {
            if (j) cout << ' ';
            cout << arr[i][j];
        }
        cout << endl;
    }
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0;i<n;i++)
#define all(cont) cont.begin(), cont.end()
#define unique(a)  sort(all(a)) , (a).erase(unique((a).begin(), (a).end()),(a).end())
#define rall(cont) cont.rbegin(), cont.rend()
#define sz(x) (int)(x).size()
#define fastio          ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define PB push_back
#define endl "\n"
#define f first
#define s second
#define mset(m,v) memset(m,v,sizeof(m))
#define mod 26
const int N = 2e5 + 5, INF = 1E9 + 7;
#define PI acos(-1.0)
long double EPS = 1e-9;
typedef long long ll;
#define int long long
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pair<int, int>> vpii;
#define pqll_max priority_queue<ll> // max heap. push(),pop(),top(),size(),empty()
#define pqll_min priority_queue<ll,vector<ll>,greater<ll> >
#define lb(v,val)   lower_bound(v.begin(),v.end(),val) //first equal to or lower than [------------
#define ub(v,val)   upper_bound(v.begin(),v.end(),val) //first greater than ------------)
#define bs(v,x) binary_search(v.begin(),v.end(),x)
inline ll add(ll x, ll y) { x += y; if (x >= mod) x -= mod; return x; }
inline ll sub(int x, int y) { x -= y; if (x < 0) x += mod; return x; }
inline ll mul(ll x, ll y) { return (x%mod * 1ll * y%mod) % mod; }
inline ll pwr(ll a, ll b) { ll x = 1 % mod; while (b) { if (b & 1) x = mul(x, a); a = mul(a, a); b >>= 1; }return x % mod; }
inline ll inv(ll a) { return pwr(a, mod - 2) % mod; }
ll gcd(ll a, ll b) { if (!a)return b % mod; return gcd(b%a, a) % mod; }
#define debug(x) cout << #x << " = " << x << endl;
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
	cout << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
	const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...);
}
#define in(container) for (auto &it : container) cin>>it;
#define out(container) for (auto it : container) cout << it << " "; cout << endl;
void solve() {
	int n;
	cin >> n;
	string ans;
	while (n) {
		
		int ok = n % 26;
				ans += 'a' + (ok-1+26)%26  ;
				if (!ok)n -= 26;
				else
				n -= ok ;
				n /= 26;
			}
	reverse(all(ans));
	cout << ans << endl;
}
signed main()
{
	fastio;
	//cout<<fixed<<setprecision(15);
	//clock_t begin = clock();
	int tc;
	tc = 1;
	//cin >> tc;
	while (tc--) {
		solve();
	}
	//clock_t end = clock();double elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;cerr << elapsed_secs;
}


//Error?
// clear lists for every test case
// print new line for each tc
// check for int or ll
// check if problem can be solved without any heavy DS like priority_queue or map



Measured memory_bytes: 3612
S = input()
N = int('10' + S, 2)

def make_alternate_binary(S):
    a = 0
    b = 0
    a += 1 << S + 1
    b += 1 << S + 1
    
    for i in range(S):
        a += (i % 2) << i
        b += ((i + 1) % 2) << i
    return a, b

co1, co2 = make_alternate_binary(len(S))
print(min(bin(N ^ co1).count('1'), bin(N ^ co2).count('1')))

Measured memory_bytes: 47724
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
 
# 入力
#N, M = map(int, input().split())
#N = int(input())
#S = str(input())
O = str(input())
E = str(input())

s = ""
for i in range(len(E)) :
  s += (O[i] + E[i])

if len(O) != len(E) :
  s += O[-1]

print (s)


Measured memory_bytes: 38256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define all(vec) vec.begin(), vec.end()
typedef long long ll;
const int mod7 = 1e9 + 7;
const int mod9 = 1e9 + 9;
const int inf = 1 << 30;
const ll INF = 1LL << 60;
template<typename T> T gcd(T a, T b) {return b ? gcd(b, a%b) : abs(a);}
template<typename T> T lcm(T a, T b) {return a / gcd(a, b) * b;}
template<typename T> bool chmax(T &a, T b) {if (a < b) {a = b; return true;} return false;}
template<typename T> bool chmin(T &a, T b) {if (a > b) {a = b; return true;} return false;}
template<typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val) {fill((T*)array, (T*)(array+N), val);}

struct UnionFind {
    vector< int > data;

    UnionFind(int sz) {
        data.assign(sz, -1);
    }

    bool unite(int x, int y) {
        x = find(x), y = find(y);
        if(x == y) return false;
        if(data[x] > data[y]) swap(x, y);
        data[x] += data[y];
        data[y] = x;
        return true;
    }

    int find(int k) {
        if(data[k] < 0) return k;
        return data[k] = find(data[k]);
    }

    bool same(int x, int y) {
        return find(x) == find(y);
    }

    int size(int k) {
        return -data[find(k)];
    }
};

int main() {
    int n, m;
    cin >> n >> m;
    UnionFind uf(n);
    int a[m], b[m];
    rep(i, m) {cin >> a[i] >> b[i]; a[i]--, b[i]--;}
    ll ans[m];
    ans[m-1] = (ll)n * (n - 1) / 2;
    for(int i = m - 2; i >= 0; i--) {
        if(uf.same(a[i + 1], b[i + 1])) ans[i] = ans[i + 1];
        else ans[i] = ans[i + 1] - uf.size(a[i + 1]) * uf.size(b[i + 1]);
        uf.unite(a[i + 1], b[i + 1]);
    }
    rep(i, m) cout << ans[i] << endl;
}

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

int main() {
  int n;
  cin >> n;
  int cnt = 0;
  rep(i,1,n+1) {
    int p;
    cin >> p;
    if (p != i) cnt++;
  }
  if (cnt <= 2) cout << "YES" << endl;
  else cout << "NO" << endl;
  return 0;
}

Measured memory_bytes: 3604
import sys
import copy
import  math
from _bisect import *
from collections import *
from operator import itemgetter
"""
from fractions import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)
"""
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

def judge(num):
    return bisect_right(rate, num) - 1


rate = [1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200, float("inf")]
li = [0] * 9
n = ni()
aaa = na()
for a in aaa:
    idx = judge(a)
    if idx == 8:
        li[idx] += 1
    else:
        li[idx] = 1
c = max(sum(li[:-1]), 1)
if sum(li[:-1]) == 0:
    print(c, li[-1])
else:
    print(c, c + li[-1])


Measured memory_bytes: 3440
import java.util.*;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int a[] = new int[n];
    int tmp;
    int L[] = new int[n-1];
    int R[] = new int[n-1];
    int x;
    int y;
    
    for (int i=0; i<n; i++) {
      a[i] = Integer.parseInt(sc.next());
    }
    
    L[0] = a[0];
    
    for (int i=1; i<n-1; i++) {
      x = L[i-1];
      y = a[i];
      if (x < y) {
        tmp = x;
        x = y;
        y = tmp;
      }
      L[i] = gcd(x, y);
    }
    
    R[0] = a[n-1];
    
    for (int i=1; i<n-1; i++) {
      x = R[i-1];
      y = a[n-1-i];
      if (x < y) {
        tmp = x;
        x = y;
        y = tmp;
      }
      R[i] = gcd(x, y);
    }
    
	int gcdval;
    int max = L[n-2];
    
    if (n==2) {
      System.out.println(Math.max(a[0], a[1]));
      return;
    } else {
      for (int i=0; i<n-2; i++){
        x = L[i];
        y = R[n-3-i];
        if (x > y) {
          tmp = x;
          x = y;
          y = tmp;
        }
        gcdval = gcd(x, y);
        
        if (gcdval > max) {
          max = gcdval; 
        }
      }
    }
    
    if (R[n-2] > max) {
      max = R[n-2];
    }
    
    System.out.println(max);
  }
  
  public static int gcd(int a, int b) {
    if (b == 0) {
      return a;
    } else {
      return gcd(b,a%b);
    }
  }

}


Measured memory_bytes: 46856
n = gets.to_i

edges = []
g = Array.new(n+1){ [] }
(n-1).times do |i|
  a, b = gets.split.map(&:to_i)
  a, b = b, a if a > b # 辺は頂点 i < j の形で入れる。
  g[a] << [b,i] # 隣接リストに
  g[b] << [a,i] # 反対向きにも隣接リストに.無向グラフなので
  # gに隣接頂点だけでなく、何番目の辺の情報をいれることもある。
  edges << a+b*100_000 # 辺リストにいれる。辺が識別されてて、最後に辺リストから辺を回して色をとりだす。
end

colors = Array.new(n-1) # Esge => color # 辺についてO(1)で使った色を見れる。O(1)はホントに?
colors_used = Hash.new # 頂点と色についてO(1)で使ったか確かめられる。
used = Array.new(n){false} # 頂点について探索済みかどうかO(1)でわかる。
que = [1] # 頂点1から見ていくので0が入っている # 探索待ちの未探索の頂点リスト

k = g.map(&:size).max # 答えとなる色の数
while v = que.shift # queにある頂点を取り出す. 破壊的メソッドなので先頭は削除される。なければnilを返す
  # k = g[v].size if k < g[v].size  # 隣接する頂点数より色数が小さければ色数を更新
  cur = 1 # 使ってない色がわからないので、とりあず色1から見ていく。
  g[v].each do |(w,idx)| # vの隣接頂点wを見ていく。
    next if used[w] #trueで、探索済みの頂点なら見ない。
    v<w ? (i,j = v,w) : (i,j = w,v) # i < jの並びで頂点を捉える。
    cur += 1 while colors_used[v+cur*100_000] == true # v周りの頂点で色をつかっていれば次の色に更新していく。塗る前に使ってない色にする。
    colors_used[v+cur*100_000] = true # vに色を使ったので記録する。
    colors_used[w+cur*100_000] = true # wに色を使ったので記録する。
    colors[idx] = cur # 辺に使った色をいれる。
    que.push(w) #探索待ちの未探索頂点リストに頂点wを入れる。
  end
  used[v] = true # 頂点vを探索済みにする。
end

puts k, colors

Measured memory_bytes: 43132
#include<iostream>
#include<array>
#include<vector>
#include <algorithm>
#include <stdio.h>
#include <string>
#include <utility>
#include <set>
#include <map>
#include <tuple>
#include<cmath>

using llint = long long int;
using namespace std;

namespace CsF {
#define MIN_INT -2147483648
#define MAX_INT 2147483647
#define FOR(I,J,K) for(int I = J;I < K;I++)
#define WriteLine(n) cout << n << "\n"; 

	string ConvertBit(int N, int e) {
		string s = "";
		int r = 0;
		while (N != 0) {
			r = N % e;
			s = to_string(r) + s;
			N -= r;
			N /= e;
		}
		return s;
	}

	int GCD(int a, int b) {
		if (a < b)swap(a, b);
		int r = a % b;
		while (r != 0) {
			a = b;
			b = r;
			r = a % b;
		}
		return b;
	}

	int LCM(int a, int b) {
		int n = a * b;
		return (n / GCD(a, b));
	}

	int Count(string s, char c) {
		int cou = 0;
		FOR(i, s.length(), 1) {
			if (s[i] == c)cou++;
		}
		return cou;
	}

	vector<int> SieveOfEratosthenes(int N) {
		vector<bool> memo(N + 1);
		vector<int> ret;
		memo[0] = true;
		memo[1] = true;
		for (int i = 2; i < N; i++) {
			if (memo[i])continue;
			ret.push_back(i);
			for (int b = 2; true; b++) {
				if (i*b <= N) {
					memo[i*b] = true;
				}
				else break;
			}
		}
		return ret;
	}

	vector<int> SpInput(int N) {
		vector<int> ret(N);
		FOR(i, N, 1) { cin >> ret[i]; }
		return ret;
	}
}

using namespace CsF;

string S;
llint dp[100010][4];

int main() {
	cin >> S;
	for (int i = 0; i < 100010; i++) dp[i][0] = dp[i][1] = dp[i][2] = dp[i][3] = 0;
	dp[0][0] = 1;
	for (int i = 0; i < S.size(); i++) {
		char c = S[i];
		//情報引継ぎ
		dp[i + 1][0] = dp[i][0];
		dp[i + 1][1] = dp[i][1];
		dp[i + 1][2] = dp[i][2];
		dp[i + 1][3] = dp[i][3];
		//更新
		if (c == 'A') {
			dp[i + 1][1] += dp[i][0];
		}
		else if (c == 'B') {
			dp[i + 1][2] += dp[i][1];
		}
		else if (c == 'C') {
			dp[i + 1][3] += dp[i][2];
		}
		//?の時
		else {
			//表の統合
			dp[i + 1][0] += dp[i][0] * 2;
			dp[i + 1][1] += dp[i][1] * 2;
			dp[i + 1][2] += dp[i][2] * 2;
			dp[i + 1][3] += dp[i][3] * 2;
			dp[i + 1][1] += dp[i][0];
			dp[i + 1][2] += dp[i][1];
			dp[i + 1][3] += dp[i][2];
		}
		dp[i + 1][0] = fmod(dp[i + 1][0], pow(10, 9) + 7);
		dp[i + 1][1] = fmod(dp[i + 1][1], pow(10, 9) + 7);
		dp[i + 1][2] = fmod(dp[i + 1][2], pow(10, 9) + 7);
		dp[i + 1][3] = fmod(dp[i + 1][3], pow(10, 9) + 7);
		//cout << c << endl;
		//cout << "dp[" << i << "] : " << "{ " << dp[i + 1][0] << " " << dp[i + 1][1] << " " << dp[i + 1][2] << " " << dp[i + 1][3] << " }" << endl;
	}
	cout << dp[S.size()][3] << endl;
	return 0;
}



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

int main(){
    string str;
    while(true){
        getline(cin,str);
        if(str==".") return 0;
        bool ok = true;
        stack<char> s;
        for(auto c:str){
            if(c=='('||c=='['){
                s.push(c);
            }else if(c==']'){
                if(s.size()&&s.top()=='[') s.pop();
                else{
                    ok=false;
                    break;
                }
            }else if(c==')'){
                if(s.size()&&s.top()=='(') s.pop();
                else{
                    ok=false;
                    break;
                }
            }
        }
        if(ok&&!s.size()){
            cout<<"yes"<<endl;
        }else{
            cout<<"no"<<endl;
        }
    }
    return 0;
}

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

using namespace std;
using ll = long long;

#define all(c) (c).begin(), (c).end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)
#define fr first
#define sc second

const ll INF = 1e9;
const ll MOD = 1e9 + 7;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

double s(double x, double y) { return x * sqrt(y * y - (x / 2) * (x / 2)) / 2; }
double a, l, x;
int main() {
    while (cin >> a >> l >> x) {
        double ans = s(a, l);
        ans += s(l, (l + x) / 2);
        ans += s(l, (l + x) / 2);
        printf("%.12f\n", ans);
    }
    return 0;
}

Measured memory_bytes: 3052
#include <iostream>

using namespace std;

int H, W;
char C[105][105];

int main()
{
	cin >> H >> W;

	for (int i = 1; i <= H; ++i)
		for (int j = 1; j <= W; ++j)
			cin >> C[i][j];

	for (int i = 1; i <= 2 * H; ++i)
	{
		for (int j = 1; j <= W; ++j)
			cout << C[(i + 1) / 2][j];

		cout << endl;
	}

	return 0;
}

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

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define FORR(i, a, b) for (int i = (int)(b)-1; i >= (int)(a); i--)

#define DEBUG(x) cout << #x << ": " << (x) << endl
#define DEBUG_VEC(v) cerr<<#v<<": ";REP(__i,(v).size())cerr<<((v)[__i])<<", ";cerr<<endl
#define PRINT(x) cout << x << endl
#define all(x) x.begin(),x.end()

int main() {
//変更範囲部分の幸福度は変わらない、境目のみに影響がある
//LR or RL を変えても意味がない
//L|R ---- R|L  もしくは R|L --- L|Rのみ変えられる？
//最大増える幸福度は２
    int N,K;
    cin >> N >> K;
    string s;
    cin >> s;

    int r2l = 0, l2r = 0; 
    int happiness = 0;
    //L...R であれば RL...LR と捉える
    REP(i,s.size()-1){
        if(s[i]==s[i+1])happiness++;
    }

    REP(i,s.size()-1){
        if(s[i]=='L'&&s[i+1]=='R'){
            l2r++;
        }
        if(s[i]=='R'&&s[i+1]=='L'){
            r2l++;
        }
    }
    int times = min(K,min(r2l,l2r));
    happiness += times*2;
    K -= times;
    r2l -= times;
    l2r -= times;

    if(r2l>0&&K>0){
        happiness++;
        K-= 1;
    }

    if(l2r>0&&K>0){
        happiness++;
        K-=1;
    }

    cout << happiness << endl;



}



Measured memory_bytes: 512
#balanced naibngor
counter=0
nodlist=[]
anslist=[]
n=int(input())
if n%2==0:
    #(1,n),(2,n-1),(n/2+1,n/2)
    nodlist.append(1)
    nodlist.append(2)
    nodlist.append(n)
    nodlist.append(n-1)
    anslist.append([1,2])
    anslist.append([1,n-1])
    anslist.append([2,n])
    anslist.append([n-1,n])
    counter+=4
    lists=[[i,n+1-i] for i in range(3,n//2+1)]
    for j in lists:
        a,b=j[0],j[1]
        for i in nodlist:
            anslist.append([i,a])
            anslist.append([i,b])
            counter+=2
        nodlist.append(a)
        nodlist.append(b)
    print(counter)
    for k in anslist:
        print(*k)

if n%2!=0:
    if n>=5:
        # n,(1,n-1),(2,n-2),,,,,(n+1/2,n-1/2)
        nodlist.append(1)
        nodlist.append(n-1)
        nodlist.append(n-2)
        nodlist.append(2)
        anslist.append([1,2])
        anslist.append([1,n-2])
        anslist.append([n-2,n-1])
        anslist.append([n-1,2])
        counter+=4
        lists=[[i,n-i] for i in range(3,(n+1)//2)]        
        for j in lists:
            a,b=j[0],j[1]
            for i in nodlist:
                anslist.append([i,a])
                anslist.append([i,b])
                counter+=2
            nodlist.append(a)
            nodlist.append(b)  
        for k in nodlist:
            anslist.append([k,n])
            counter+=1
        print(counter)
        for s in anslist:
            print(*s)
    if n==3:
        print(2)
        l=[1,3]
        L=[2,3]
        print(*l)
        print(*L)
    

Measured memory_bytes: 4144
# -*- coding: utf-8 -*-
N = int(input())
A = list(map(int, input().split(' ')))

S = [0]
for a in A:
    S.append(S[-1] + a)

import  collections
s_frq_dict = collections.Counter(S)
ans = 0

for frq in s_frq_dict.values():
    if frq > 1:
        ans += frq * (frq - 1) // 2

print(ans)






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

using namespace std;

long long cnt=0;
vector<int> G;

void InsertionSort(int A[], int n, int g){
  for(int i = g; i < n; i++){
    int v = A[i];
    int j = i - g;
    while(j >= 0 && A[j] > v){
      A[j+g] = A[j];
      j -= g;
      cnt++;
    }
    A[j+g] = v;
  }
}

void ShellSort(int A[], int n){
  for(int h = 1; h <= n; h=3*h+1){
    G.push_back(h);
  }
  
  for(int i = G.size()-1; i >= 0; i--){
    InsertionSort(A, n, G[i]);
  }
}

int main(){
  int n, A[1000000];
  cin >> n;
  for(int i = 0; i < n; i++){
    cin >> A[i];
  }

  ShellSort(A, n);

  cout << G.size() << endl;
  for(int i = G.size()-1; i >= 0; i--){
    cout << G[i];
    if(i){ cout << " "; }
  }
  cout << endl << cnt << endl;
  for(int i = 0; i < n; i++){
    cout << A[i] << endl;
  }
  
  return 0;
}



Measured memory_bytes: 7012
def call(n):
    i=1
    
    #終了条件
    #i==n
    for i in range(1,n+1):
        x=i
        #3の倍数なら表示して次のループ
        if x%3==0:
            print(f" {i}",end="")
            continue
        
        
        #0になるまで10割る
        while x!=0:
            #10で割ったあまりが3なら表示して次のループ
            if x%10==3:
                print(f" {i}",end="")
                break
                
            x=int(x/10)
            
    print("")
    

n=int(input())

call(n)


Measured memory_bytes: 5888
import sys

def is_prime(x):
    if(x <= 3 and x > 1):
        return True
    elif(x % 2 == 0 or x % 3 == 0 or x < 2):
        return False
    i = 5
    while(i * i <= x):
        if(x % i == 0 or x % (i + 2) == 0):
            return False
        i += 6
    return True

l = []
count = 0
for input in sys.stdin:
    l.append(int(input))
for data in range(1,len(l)):
    if(is_prime(l[data]) == True):
        count += 1
print count


Measured memory_bytes: 5096
import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {
	public static void main(String[] args) {
		var sc = new Scanner(System.in);
		var n = sc.nextInt();
		var l = IntStream.range(0, n).map(i -> sc.nextInt()).toArray();
		sc.close();

		Arrays.sort(l);
		var count = 0;
		for (var i = 0; i < n; i++) {
			for (var j = i + 1; j < n; j++) {
				for (var k = j + 1; k < n; k++) {
					if (l[i] < l[j] && l[j] < l[k] && l[i] + l[j] > l[k]) {
						count++;
					}
				}
			}
		}

		System.out.println(count);
	}
}


Measured memory_bytes: 36552
#include "bits/stdc++.h"
using namespace std;

#define show(x) cerr << #x << " = " << x << endl ;
#define input_from_file freopen("input.txt","r",stdin)
#define output_to_file freopen("output.txt" , "w",stdout)
#define output_to_error freopen("error.txt" , "w" ,stderr)
#define fastio ios_base::sync_with_stdio(0)
#define endl '\n'



int main()
{
	#ifdef LOCAL
        input_from_file;
        output_to_file;
        output_to_error;
    #endif
	fastio;cin.tie(0);cout.tie(0);
	int r ; cin >> r ; 
	cout << r * r;


	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef int ll;
#define fr(i,a,b) for(ll i=a; i<b; i++)
#define rf(i,a,b) for(ll i=a; i>=b; i--)
typedef std::vector<long long > vi ;
#define F first
#define S second
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define mod 1000000007
#define PB push_back
#define MP make_pair
#define PI 3.14159265358979323846
#define all(a) a.begin(),a.end()
#define mx(a) *max_element(all(a))
#define mn(a) *min_element(all(a))
#define endl '\n'
#define show(a) for(auto el:a)cout<<el<<" "
const ll INF=LLONG_MAX/2;
const ll N=2e5+1;
#define yesno(f) yes(f);no(f);
#define yes(f) if(f)cout<<"YES\n";
#define no(f) if(!f)cout<<"NO\n";
using  namespace std;
ll priority ( char alpha )
{
    if(alpha == '+' || alpha =='-')
    {
        return(1);
    }
 
    if(alpha == '*' || alpha =='/')
    {
        return(2);
    }
 
    if(alpha == '^')
    {
        return(3);
    }
 
    return 0;
}
int main()
{
    fast;
   ll t=1;
   //std::cin >> t;
   while(t--)
   {
       string s;
       ll x,n;
       std::cin >> s;
       n=s.length();
       if(s[n-1]=='s')
       {
           cout<<s;
           cout<<"es"<<"\n";
       }
       else
       cout<<s<<"s\n";
   }
}

Measured memory_bytes: 3660
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,x,n) for(int i=x;i<n;i++)
#define pb push_back
#define int long long
#define MAX 100
#define NIL -1
using namespace std;
const int INF=1000000007;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

int M[102][102];
int mincos[102];
bool used[102];
int n;

int prim(){
  rep(i,n){
    mincos[i]=INF;
    used[i]=false;
  }
  mincos[0]=0;
  int sum=0;
  while(1){
    int  v=-1;
    rep(i,n){
      if(used[i]==false&&(v==-1||mincos[i]<mincos[v]))v=i;
    }
    if(v==-1)break;
    used[v]=true;
    sum+=mincos[v];
    rep(i,n)mincos[i]=min(mincos[i],M[v][i]);
  }
  return sum;
}

signed main(){
  cin>>n;
  rep(i,n)rep(j,n){
    int e;
    cin>>e;
    M[i][j]=(e==-1?INF:e);
  }
  cout<<prim()<<endl;

  return 0;
}

Measured memory_bytes: 3140
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<vector>
#include<queue>
#include<map>
#include<iomanip>
#include<set>
#include "bits/stdc++.h"
#define rep(index,num) for(int index=0;index<num;index++)
#define rep1(index,num) for(int index=1;index<=num;index++)
#define scan(argument) cin>>argument
#define prin(argument) cout<<argument<<endl
#define kaigyo cout<<endl
#define eps 1e-7
#define mp(a1,a2) make_pair(a1,a2)
typedef long long ll;
typedef long double ld;
using namespace std;
typedef pair<ll,ll> pll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<pint> vpint;
typedef vector<pll> vpll;
ll INFl=1e+18+1;
int INF=1e+9+1;
const int MAX = 200000;
const int MOD = 1e+9+7;
ll fac[MAX], finv[MAX], inv[MAX];
void COMinit(){
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for(int i = 2; i < MAX; i++){
        fac[i] = fac[i-1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD/i) % MOD;
        finv[i] = finv[i-1] * inv[i] % MOD;
    }
}
long long COM(int n,int k){
    if(n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n-k] % MOD) % MOD;
}
int main(){
	COMinit();
	ll N,A,B,C;
	scan(N>>A>>B>>C);
	ll A100C[MAX],B100C[MAX];
	A100C[0]=1,B100C[0]=1;
	rep(i,N){
		A100C[i+1]=A100C[i]*A%MOD*inv[100-C]%MOD;
		B100C[i+1]=B100C[i]*B%MOD*inv[100-C]%MOD;
	}
	ll ans=0;
	for(int M=N;M<=2*N-1;M++){
		ans+=COM(M-1,N-1)*M%MOD*100%MOD*inv[100-C]%MOD*((A100C[N]*B100C[M-N]%MOD+A100C[M-N]*B100C[N]%MOD)%MOD)%MOD;
		ans%=MOD;
	}
	prin(ans);
	return 0;
}


Measured memory_bytes: 7424
#include<iostream>
#include<iostream>
#include<algorithm>
using namespace std;
int a[15];
int main()
{
    for(int i=0;i<10;i++)
        cin>>a[i];
    sort(a,a+10);
    for(int i=9;i>=7;i--)
        cout<<a[i]<<endl;
}

Measured memory_bytes: 1176
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
ll X[100005];
ll ans[100005];
int gcd(ll x, ll y) {
  return (y == 0) ? x : gcd(y,x % y);
}

int main() {
  ll n,x;
  cin >> n >> X[0];

  for(int i = 1; i <= n; i++) cin >> X[i];

  sort(X,X+n+1);

  for(int i = 1; i <= n; i++) {
    ans[i-1] = X[i] - X[i-1];
  }
  for(int i = 1; i < n; i++) {
    ans[i] = gcd(ans[i],ans[i-1]);
  }
  cout << ans[n-1] << endl;
			     
  
}


Measured memory_bytes: 1792
from collections import deque
from collections import defaultdict
import sys
input = sys.stdin.readline
N, M = list(map(int, input().split()))

T = defaultdict(list)
in_num = defaultdict(int)

for _ in range(M):
    x, y = list(map(int, input().split()))
    x -= 1
    y -= 1
    T[x].append(y)
    in_num[y] += 1

q = deque()

for n in range(N):
    if in_num[n] == 0:
        q.append(n)


DP = [0] * N

while q:
    v = q.popleft()
    t = T[v]
    for y in t:
        in_num[y] -= 1
        if in_num[y] == 0:
            q.append(y)
            DP[y] = max(DP[y], DP[v]+1)


print(max(DP))


Measured memory_bytes: 80348
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <iomanip>
#include <random>
#include <cstdio>
#include <cmath>
#include <map>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int) n; i++)

int main() {
    int a,b; cin >> a >> b;
    if (a == 1) a = 14;
    if (b == 1) b = 14;
    if (a > b)
    {
        cout << "Alice\n";
    } else if (b > a) {
        cout << "Bob\n";
    } else {
        cout << "Draw\n";
    }
    return 0;
}

Measured memory_bytes: 256