akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(k,i,n) for(ll i=k;i<n;++i)
int main(void){
    ll n;
    cin>>n;
    ll a[2][n];
    rep(0,i,2){
        rep(0,j,n){
            cin>>a[i][j];
        }
    }
    ll b[n];
    rep(0,i,n)b[i]=i+1;
    ll ans[2];
    rep(0,i,2){
        ll c=0;
        do{
            ++c;
            bool T=true;
            rep(0,j,n){
                if(b[j]!=a[i][j])T=false;
            }
            if(T==true)ans[i]=c;
        }while(next_permutation(b,b+n));
    }
    cout<<abs(ans[0]-ans[1])<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <map>
#include <set>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <fstream>
#include <bitset>
#include <queue>
#include <stack>
#include <deque>
#include <complex>
#include <iomanip>

using std::cin;
using std::cout;
using std::cerr;
using std::endl;

using std::map;
using std::set;
using std::bitset;
using std::vector;
using std::string;
using std::multimap;
using std::multiset;
using std::deque;
using std::queue;
using std::stack;
using std::pair;
using std::iterator;

using std::sort;
using std::stable_sort;
using std::reverse;
using std::max_element;
using std::min_element;
using std::unique;
using std::ios_base;
using std::swap;
using std::min;
using std::max;
using std::fill;

using std::setprecision;
using std::fixed;

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

namespace MySpace{

};

#define F(i, n) for (int (i) = 0; (i) != (n); (i)++)
#define fi first
#define se second
#define re return
#define all(x) (x).begin(), (x).end()
#define int long long

ll n, m, a, b;

signed main()
{
    //ios_base::sync_with_stdio(false);
    //cin.tie(0);
    //cout.tie(0);
    cin >> n >> m >> a >> b;
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < m; j++)
        {
            int q = (i < b) ^ (j < a);
            cout << q;
        }
        cout << "\n";
    }
}


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



signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(20);
    
    ll n,k;
    cin>>n>>k;
    if((n-1)*(n-2)/2<k){
        cout << -1 << endl;
        return 0;
    }
    vector<pair<int,int>> v;
    ll cnt=(n-1)*(n-2)/2;
    for(int i=1;i<n;i++){
        v.push_back(make_pair(0,i));
    }
    int now = 1;
    while(cnt>k){
        for(int i=now+1;i<n && cnt>k;i++){
            v.push_back(make_pair(now,i));
            cnt--;
        }
        now++;
    }
    cout << v.size() << endl;
    for(auto i:v){
        cout << i.first+1 << " " << i.second+1 <<"\n";
    }
}

Measured memory_bytes: 384
#include <stdio.h>

long long gcd (long long a, long long b) {
	long long c = a%b;
	if (c==0)
		return b;
	return gcd (b,c);
}

long long lcm (long long a, long long b) {
	return a/gcd (a,b)*b;
}

int main () {
	int N;
	long long l = 1;
	scanf ("%d", &N);
	for (int i=0; i<N; i++) {
		long long tmp;
		scanf ("%lld", &tmp);
		l = lcm (l, tmp);
	}
	printf ("%lld\n", l);
	return 0;
}


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

using namespace std;

const int N = 200010;

string s;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin >> s;
    long long res = 0;
    int cur = 0;
    for (int i = 0; i < s.size(); i++) {
        if (s[i] == 'A') cur++;
        else if (s[i] == 'C') {
            cur = 0;
        } else {
            if (i + 1 < s.size() && s[i + 1] == 'C') {
                res += cur;
                i++;
            } else {
                cur = 0;
            }
        }
        // cerr << i << ' ' << cur << endl;
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 720
#include <bits/stdc++.h>
#define REP(i, n) for(long long i=0; i<n; i++)
#define REPR(i, n) for(long long i=n-1; i>=0; i--)
#define FOR(i, m, n) for(long long i=m; i<=n; i++)
#define FORR(i, m, n) for(long long i=m; i>=n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define VSORTR(v) sort(v.rbegin(), v.rend());
#define ALL(v) (v).begin(),(v).end()
#define FIN ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

using namespace std;
using ll = long long;
using ull = unsigned long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;
const ll mod = 1e9+7;
const ll inf = 1e15;
ll power(ll a,ll b){return b?power(a*a%mod,b/2)*(b%2?a:1)%mod:1;}



vll Eratosthenes(ll N){
    vll arr(N,1);

	for(ll i = 2; i < sqrt(N); i++){
		if(arr[i]){
			for(ll j = 0; i * (j + 2) < N; j++){
				arr[i *(j + 2)] = 0;
			}
		}
	}
    return arr;
}

int main(){FIN
    ll n;cin>>n;
    vll arr = Eratosthenes(55560);
    vll ans(0);
    ll idx=2;
    while(ans.size()<n){
        if (arr[idx]==1 && idx%5==1) {
            ans.push_back(idx);
        }
        idx++;
    }
    REP(i,n){
        cout<<ans[i]<<' ';
    }
    cout<<endl;
    return 0;
}

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

using namespace std;

typedef long long ll;

const ll MOD = 1000000007;

const int dx[4] = {+1, 0, -1, 0};
const int dy[4] = {0, -1, 0, +1};

int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    int n; cin >> n;
    vector<ll> a(n);
    for(int i=0;i<n;i++) cin >> a[i];
    sort(a.begin(), a.end());
    vector<ll> b, rb;
    for(int i=0;i<n/2;i++){
        b.push_back(a[i]);
        b.push_back(a[n-1-i]);
        rb.push_back(a[n-1-i]);
        rb.push_back(a[i]);
    }
    if(n %2){
        b.push_back(a[n/2]);
        rb.push_back(a[n/2]);
    }

    ll bscore = 0, rbscore = 0;

    for(int i=0;i<n-1;i++){
        bscore += abs(b[i+1] - b[i]);
    }
    for(int i=0;i<n-1;i++){
        rbscore += abs(rb[i+1] - rb[i]);
    }

    ll ans = max(bscore, rbscore);

    // cout << bscore << " " << rbscore << endl;
    for(int i=1;i<=n-1;i++){
        int diff = 0;
        diff += abs(b[n - i] - b[(n - i + 1) %n]);
        diff -= abs(b[n - i] - b[n - i - 1]);
        ans = max(ans, bscore + diff);
        bscore = bscore + diff;
    }

    for(int i=1;i<=n-1;i++){
        int diff = 0;
        diff += abs(rb[n - i] - rb[(n - i + 1) %n]);
        diff -= abs(rb[n - i] - rb[n - i - 1]);
        ans = max(ans, rbscore + diff);
        rbscore = rbscore + diff;
    }

    cout << ans << endl;
}

Measured memory_bytes: 2804
#include <bits/stdc++.h>
using namespace std;
const int md = 1e9 + 7;
inline void add(int &a, int b) {
  a += b;
  if (a >= md) a -= md;
}
inline int mul(int a, int b) {
  return (int)((long long)a * b % md);
}
int n;
vector<vector<int>> mtxm (vector<vector<int>> a, vector<vector<int>> b) {
  vector<vector<int>> ret(n, vector<int>(n, 0));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      for (int k = 0; k < n; k++) {
        add(ret[i][j], mul(a[i][k], b[k][j]));
      }
    }
  }
  return ret;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long k;
  cin >> n >> k;
  vector<vector<int>> a(n, vector<int>(n));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> a[i][j];
    }
  }
  vector<vector<int>> b(n, vector<int>(n, 0));
  for (int i = 0; i < n; i++) {
    b[i][i] = 1;
  }
  for (; k; k >>= 1) {
    if (k & 1){
      b = mtxm(b, a);
    }
    a = mtxm(a, a);
  }
  int ret = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      add(ret, b[i][j]);
    }
  }
  cout << ret << '\n';
  return 0;
}


Measured memory_bytes: 384
#include<iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <map>
#include <bitset>
#include <stack>
#include <queue>
#include <fstream>
#include <functional>

using namespace std;
using ll = long long;

#define all(x) (x).begin(),(x).end()
#define PRI(n) cout << n << " "<<endl;
#define PRI2(n, m) cout << n << " " << m << " "<<endl;

#define REP(i, n)  for(int i = 0; i < (int)n; ++i)
#define FOR(i, t, n)  for(int i = t; i <= (int)n; ++i)

const char alphabet[26] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',
                           's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
const ll MOD = 1e9 + 7;

struct edge;
struct UnionFind;

bool isPrime(ll x);

ll GCD(ll a, ll b);

ll LCM(ll a, ll b);

ll nCr(int n, int r);


struct UnionFind {
    vector<int> par;
    vector<int> rank;

    UnionFind(int N) {
        for (int i = 0; i < N; ++i) {
            par.push_back(i);
            rank.push_back(0);
        }
    }

    int find(int x) {
        if (par[x] == x)return x;
        else return par[x] = find(par[x]);
    }

    void unite(int x, int y) {
        x = find(x);
        y = find(y);
        if (x == y)return;
        if (rank[x] < rank[y])par[x] = y;
        else {
            par[y] = x;
            if (rank[x] == rank[y])rank[x]++;
        }
    }

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

int M, N;
int F[100][10];
int P[100][10];
int A[100010];

int main() {
    cin >> N >> M;
    FOR(i, 0, N) {
        FOR(j, 0, N - i) {
            if (M == 10000 * i + 5000 * j + 1000 * (N - i - j)) {
                cout << i << " " << j << " " << N - i - j << endl;
                return 0;
            }
        }
    }
    cout << -1 << " " << -1 << " " << -1 << endl;

    return 0;
}

struct edge {
    int to, cost;
    bool flag = false;
};

bool isPrime(ll x) {
    if (x == 0)return 0;
    if (x == 1)return 0;
    if (x == 2)return 1;
    if (x % 2 == 0)return 0;
    FOR(i, 3, x - 1) {
        if (x % i == 0)return 0;
    }
    return 1;
}

ll GCD(ll a, ll b) {
    if (b == 0)return a;
    return GCD(b, a % b);
}

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

ll nCr(int n, int r) {
    vector<ll> C(r + 1);
    C[0] = 1;
    FOR(i, 1, n) for (int j = min(i, r); j < 1; --j)C[j] = (C[j] + C[j - 1]) % MOD;
    return C[r];
}


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

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


#define rep(i,n) for(ll (i)=0; (i)<(ll)(n); (i)++)
#define frep(i,m,n) for(ll (i)=(m); (i)<=(ll)(n); (i)++)
#define rrep(i,n) for(ll (i)=(n)-1; (i)>-1; (i)--)
#define frrep(i,m,n) for(ll (i)=(n); (i)>(ll)(m); (i)--)
#define ALL(x) (x).begin(), (x).end()

const ll INF = 100100100100100100;
const ll MOD = 1000000007;

// get abs
ll my_abs(ll a);
// a^n
ll a_n(ll a, ll n);
// get gcd
ll my_gcd(ll a, ll b);
// a^(-1) % MOD 
ll inv(ll a);
// (a+b+c)%MOD
ll madd(ll a, ll b, ll c);
// (a-b)%MOD
ll msub(ll a, ll b);
// (a*b*c)%MOD
ll mtime(ll a, ll b, ll c);


int main() {
    string s, t; cin >> s >> t;
    ll ans = 0;
    rep(i, s.size()) {
        if(s[i] != t[i]) {
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

ll my_abs(ll a) {
    if(a >= 0) return a;
    else return -1 *a;
}

ll a_n(ll a, ll n) { 
    if(n == 0) return 1;
    
    ll ret = a, count = 1;
    while(count * 2 < n) {
        ret *= ret;
        count *= 2;
    }
    if(count == n) return ret;
    else return (ret * a_n(a, n-count));
}

ll my_gcd(ll a, ll b) {
    if(b == 0) return a;
    return my_gcd(b, a%b);
}

ll inv(ll a) {
    return a_n(a, MOD-2);
}

ll madd(ll a, ll b, ll c) {
    ll ret = (a+b) % MOD;
    return (ret+c) % MOD;
}

ll msub(ll a, ll b) {
    if(a < b) return (a-b+MOD) % MOD;
    else return (a-b) % MOD;
}

ll mtime(ll a, ll b, ll c) {
    ll ret = (a*b) % MOD;
    return (ret*c) % MOD;
}


Measured memory_bytes: 3848
#include <stdio.h>
#include <limits.h>
#define N 500000

void Merge(int *,int ,int ,int );
void MergeSort(int *,int ,int );

int s[N], count;

int main(){
  int i,n,left=0,right;
  scanf("%d",&n);
  right=n;
  for(i=0;i<n;i++){
    scanf("%d",&s[i]);
  }
  MergeSort(s,left,right);
  for(i=0;i<n-1;i++) printf("%d ",s[i]);
  printf("%d\n%d\n",s[n-1],count);
  return 0;
}

void Merge(int *s,int left,int mid,int right){
  int i,n1,n2,k,j;
  n1=mid-left;
  n2=right-mid;

  int L[n1+1],R[n2+1];

  for(i=0;i<n1;i++){
    L[i]=s[left+i];
  }
  for(i=0;i<n2;i++){
    R[i]=s[mid+i];
  }
  L[n1]=INT_MAX;
  R[n2]=INT_MAX;
  i=0;
  j=0;
  for(k=left;k<right;k++){
    if(L[i]<=R[j]){
      s[k]=L[i];
      i++;
    }
    else{
      s[k]=R[j];
      j++;
    }
    count++;
  }
}

void MergeSort(int *s,int left,int right){
  long mid;
  if(left+1<right){
    mid=(left+right)/2;
    MergeSort(s,left,mid);
    MergeSort(s,mid,right);
    Merge(s,left,mid,right);
  }
}

Measured memory_bytes: 6496
#include<bits/stdc++.h>
using namespace std;
int main(){
  string w[7]={"SAT","FRI","THU","WED","TUE","MON","SUN"};
  string s;
  cin>>s;
  for(int i=0;i<7;i++){
    if(s==w[i]){
      cout<<i+1<<endl;
    }
  }
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ls rt<<1
#define rs rt<<1|1
#define lson rt<<1,l,M
#define rson rt<<1|1,M+1,r
#define PI acos(-1)
#define MM int M=(l+r)>>1;
#define fu(i,r,t) for(int i=r;i<=t;i++)
#define fd(i,r,t) for(int i=r;i>=t;i--)
#define fh(i,be,e) for(int i=head[be];~i;i=e[i].next)
#define fa(i,V) for(auto i:V)
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define endl '\n'
#define lcm(a,b) (a*b)/__gcd(a,b)
#define cp(i,ans) printf("%.if",ans);
#define cpp(i,ans) cout<<setprecision(i)<<fixed<<ans<<endl;
#define ppb pop_back
#define ppf pop_front
#define pb push_back
#define pf push_front
#define pq priority_queue
#define lowbit(x) (x)&(-x)
#define all(V) V.begin(),V.end()
#define ms multiset
#define mod(x) ((x+mo_num)%mo_num)
#define vc vector
#define vct vector<int>
#define out(i) cout<<(i)<<endl;
#define fi first
#define se second
#define fun(i) fu(i,1,n)
#define fut(i) fu(i,1,t)
#define fum(i) fu(i,1,m)
#define ld long double
#define umap unordered_map
#define P pair<int,int>
#define SET set<int>
#define mp map<int,int>
#define mk make_tuple
#define low lower_bound
#define upp upper_bound
#define yn(key) out(key?"YES":"NO")
#define in(i) i+1,i+1+n
#define im(i) i+1,i+1+m
#define bffs(i) __builtin_ffs(i)
#define bcount(i) __builtin_popcount(i)
#define bone(i) ((1<<i)-1)
using namespace std;
const int INF=LLONG_MAX-1e10;
const int dx[]={0,0,-1,1},dy[]={-1,1,0,0};//up down left right
const int maxn=1e6+1e5;
const int mo_num=1e9+7;
int n,m,t,a[maxn],b[maxn],ans;

main()
{
    IOS
    string s,tt;
    cin>>s>>tt;
    int len=s.length();
    fu(i,0,len-1)
    {
        if(s[i]!=tt[i]){
            out("No")
            return 0;
        }
    }
    out(tt.length()==len+1?"Yes":"No")
    return 0;
}

Measured memory_bytes: 3636
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

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

    static class CSumOfGcdOfTuplesEasy {
        public long gcd(long a, long b) {
            if (a == 0)
                return b;
            return gcd(b % a, a);
        }

        public void solve(int testNumber, InputReader in, PrintWriter w) {

            long k = in.nextLong();
            long ans = 0;
            for (long i = 1; i <= k; i++) {
                for (long j = 1; j <= k; j++) {
                    for (int l = 1; l <= k; l++) {
                        ans += gcd(gcd(i, j), l);
                    }
                }
            }

            w.println(ans);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new InputMismatchException();

            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }

                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;

            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}



Measured memory_bytes: 32672
#include<bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef pair<int, int> P;
 
#define mod 1000000007
#define inf 1000000000
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define popcount(x) __builtin_popcountll(x)
 
const long double PI = acos(-1);
 
ll gcd(ll a,ll b){return b ? gcd(b,a%b) : a;}
ll lcm(ll a,ll b){return a / gcd(a,b) * b;}

int main(){
  ll n;
  cin >> n;
  for(ll i = 1; i <= n; i++){
    if((int)(i * 1.08) == n) {
      cout << i << endl;
      return 0;
    }
  }
  cout << ":(" << endl;
  return 0;
}

Measured memory_bytes: 256
T=["KIHBR","AKIHBR","KIHABR","KIHBAR","KIHBRA","AKIHABR","AKIHBAR","AKIHBRA","KIHABAR","KIHABRA","KIHBARA","AKIHABAR","AKIHABRA","AKIHBARA","KIHABARA","AKIHABARA"]
S=input()
if S in T:
    print("YES")
else:
    print("NO")

Measured memory_bytes: 2940
def main():
    H, W, N = (int(i) for i in input().split())
    sr, sc = (int(i) for i in input().split())
    S = input()
    T = input()
    from collections import Counter
    S_C = Counter(S)
    if sc <= S_C['L']:
        move = 0
        for s, t in zip(S, T):
            if s == "L":
                move += 1
            if sc <= move:
                return print("NO")
            if t == "R":
                move -= 1
                if -move == W - sc + 1:
                    move += 1
    if W - sc + 1 <= S_C['R']:
        move = 0
        for s, t in zip(S, T):
            if s == "R":
                move += 1
            if W - sc + 1 <= move:
                return print("NO")
            if t == "L":
                move -= 1
                if -move == sc:
                    move += 1
    if sr <= S_C['U']:
        move = 0
        for s, t in zip(S, T):
            if s == "U":
                move += 1
            if sr <= move:
                return print("NO")
            if t == "D":
                move -= 1
                if -move == H - sr + 1:
                    move += 1
    if H - sr + 1 <= S_C['D']:
        move = 0
        for s, t in zip(S, T):
            if s == "D":
                move += 1
            if H - sr + 1 <= move:
                return print("NO")
            if t == "U":
                move -= 1
                if -move == sr:
                    move += 1
    print("YES")


if __name__ == '__main__':
    main()


Measured memory_bytes: 44748
n,m=map(int,input().split())
city=[]
for i in range(m):
    a=i
    b,c=map(int,input().split())
    city.append([a,b,c])
city=sorted(city,key=lambda x:(x[1],x[2]))
judge=1
count=1
for i in range(m):
    if city[i][1]==judge:
        city[i].append(count)
        count+=1
    else:
        city[i].append(1)
        judge=city[i][1]
        count=2
for i in range(m):
    city[i].append(str(city[i][1]).zfill(6)+str(city[i][3]).zfill(6))
city=sorted(city,key=lambda x:x[0])
for i in range(m):
    print(city[i][4])

Measured memory_bytes: 38272
import java.util.*;

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

Measured memory_bytes: 22740
//1208_2


#include<stdio.h>

int main()
{
	int N,rad=0,add=0,rad2=0;
	int P[10000];
	int i;

	scanf("%d", &N);

	for (i = 0; i < N; i++)
	{
		scanf("%d", &P[i]);
		
		if (rad <= P[i])
		{
			rad = P[i];
		}

		add += P[i];
	}

	rad2 = rad / 2;
	add = add - rad + rad2;

	printf("%d\n", add);

	return 0;
}

Measured memory_bytes: 128
"use strict";
var input=require("fs").readFileSync("/dev/stdin","utf8");
var cin=input.split(/ |\n/),cid=0;
function next(){return +cin[cid++];}
function nextstr(){return cin[cid++];}
function nextbig(){return BigInt(cin[cid++]);}
function nexts(n,a){return a?cin.slice(cid,cid+=n):cin.slice(cid,cid+=n).map(a=>+a);}
function nextm(h,w,a){var r=[],i=0;if(a)for(;i<h;i++)r.push(cin.slice(cid,cid+=w));else for(;i<h;i++)r.push(cin.slice(cid,cid+=w).map(a=>+a));return r;}
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill().map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill().map(x=>"+r+")";return eval(r);}

var myOut = main();
if(myOut !== undefined)console.log(String(myOut));

function main(){
  var n = next();
  var z = next();
  var w = next();
  var a = nexts(n);
  if(n === 1)return Math.abs(w-a[0]);
  return Math.max(Math.abs(w-a[n-1]),Math.abs(a[n-1]-a[n-2]));
}

Measured memory_bytes: 30336
#include<bits/stdc++.h>
using namespace std;
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pl;

#define sl(x) scanf("%lld",&x)
#define pl(x) printf("%lld\n",x)
#define sz(x) ((int)x.size())
#define s(x) sort(x.begin(),x.end())
#define all(v) v.begin(),v.end()
#define rs(v) { s(v) ; r(v) ; }
#define r(v) {reverse(all(v));}
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define f(i,n) for(int i=0;i<n;i++)
#define rep(i,a,b) for(int i=a;i<=b;i++)

const ll mod = 1000000007;
const ll inf = (ll)5e16;
const ld eps = 1e-12;
const ll N = 1000005;
const ll LOGN = 19;
const ld PI = 3.14159265358979323846;
ll mul(ll a, ll b, ll m) { return (ll)(a * b) % m;}
ll add(ll a, ll b, ll m) { a += b; if(a >= m) a -= m; if(a < 0) a += m; return a;}
ll power(ll a, ll b, ll m) { if(b == 0) return 1; if(b == 1) return (a % m); ll x = power(a, b / 2, m); x = mul(x, x, m); if(b % 2) x = mul(x, a, m); return x;}
ll q, k, m[N];
int main()
{
    ios_base::sync_with_stdio(0);

    cin >> q >> k;
    f(i, q)
    {
        ll a, b;
        cin >> a >> b;
        m[a] += b;
    }
    ll done = 0;
    for(ll i = 1; i < N; i++)
    {
        done += m[i];
        if(done >= k)
        {
            cout << i << "\n";
            return 0;
        }
    }
    return 0;
}


Measured memory_bytes: 1024
S = input()
N = int(input())
for n in range(N):
    *w, = input().split()
    a, b = int(w[1]), int(w[2])
    if w[0] == 'replace':
        r = w[3]
        S = S[:a]+r+S[b+1:]
    if w[0] == 'reverse':
        S = S[:a]+S[a:b+1][::-1]+S[b+1:]
    if w[0] == 'print':
        print(S[a:b+1])



Measured memory_bytes: 5612
fun main(args: Array<String>) {
    codefestival2016qualc_a()
}

fun codefestival2016qualc_a() {
    val s = readLine()!!

    val indexOfFirstC = s.indexOfFirst { it == 'C' }
    val indexOfFirstF = s.indexOfLast { it == 'F' }
    val answer = if (indexOfFirstC != -1 && indexOfFirstF != -1 && indexOfFirstC < indexOfFirstF) "Yes" else "No"

    println(answer)
}


Measured memory_bytes: 33736
<?php
$n = fgets(STDIN);
$inputNumbers = [];
for ($i = 0; $i < $n; $i++) {
    $inputNumbers[] = trim(fgets(STDIN));
}

$uniqueNumbers = [];
for( $i = 0; $i < count($inputNumbers); $i++) {
    $num = $inputNumbers[$i];
    
    $hasSame = false;
    for( $j = 0; $j < count($uniqueNumbers); $j++) {
        if($num == $uniqueNumbers[$j]) {
            $hasSame = true;
            break;
        } else {
            
        }
    }
    if (!$hasSame) {
        $uniqueNumbers[] = $num;
    }
}
echo(count($uniqueNumbers));
?>

Measured memory_bytes: 4728
abc = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
val = [i for i in range(len(abc))]

dic = dict(zip(abc, val))
#dic
C = input()
#dic[C]
keys = [k for k, v in dic.items() if v == dic[C]+1]
print(keys[0])

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

const int N = 1e5 + 33;
int t[N],dp[N],n, k;

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n;	
	for(int i = 1; i <= n; i++) {
		cin >> t[i];	
	}
	fill(dp , dp + n + 3, (int)1e9 + 33);
	dp[1] = 0;
	for(int i = 1; i <= n; i++) {	
		dp[i] = min(dp[i], min(abs(t[i] - t[max(i - 1, 1)]) + dp[max(i - 1,1)], abs(t[i] - t[max(i - 2, 1)]) + dp[max(i - 2, 1)]));
	}	
	cout << dp[n];
}


Measured memory_bytes: 1024
#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

int main(int argc, char* argv[])
{
    int N; cin >> N;

    vector<int> A(N);
    for (int i = 0; i < N; i++) {
        cin >> A[i];
    }

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

    cout << A[A.size()-1]-A[0] << endl;

    return 0;
}


Measured memory_bytes: 256
#define ll				long long
#define MOD				1000000007
#define VTX_MAX			100000
#define EDGE_MAX		100000

#include <float.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

typedef struct Edge {
	int vno;
	struct Edge *next;
	int len;
} Edge;

typedef struct Vtx {
	Edge *edge;
	char color;
} Vtx;

Vtx vtxs[VTX_MAX];
int vcnt;
Edge edges[EDGE_MAX * 2];
int ecnt;

FILE *in, *ans;
int tno;

int out(const char *s) {
#ifdef TEST
	char buf[8192];
	fgets(buf, sizeof(buf), ans);
	if (strcmp(buf, s)) {
		printf("err\n");
	}
#else
	printf(s);
#endif
	return 0;
}

int outi(int i) {
	char s[128];
	sprintf(s, "%d\n", i);
	out(s);
	return 0;
}

int outd(double d) {
	char s[128];
	sprintf(s, "%.10lf\n", d);
	out(s);
	return 0;
}

int outll(ll l) {
	char s[128];
	sprintf(s, "%lld\n", l);
	out(s);
	return 0;
}

int geti() {
	int i;
	fscanf(in, "%d", &i);
	return i;
}

ll getll() {
	ll l;
	fscanf(in, "%lld", &l);
	return l;
}

int getstr(char *s) {
	fscanf(in, "%s", s);
	return 0;
}

int addedge(int vfno, int vtno, int len) {

	edges[ecnt].vno = vtno;
	edges[ecnt].len = len;
	edges[ecnt].next = vtxs[vfno].edge;
	vtxs[vfno].edge = &edges[ecnt];
	ecnt++;

	return 0;
}

int set(int vno, char color) {

	if (vtxs[vno].color > 0) {
		return 0;
	}
	vtxs[vno].color = color;

	Edge *edge = vtxs[vno].edge;
	while (edge != NULL) {
		if (edge->len % 2 == 0) {
			set(edge->vno, color);
		}
		else {
			if (color == 1) {
				set(edge->vno, 2);
			}
			else {
				set(edge->vno, 1);
			}
		}

		edge = edge->next;
	}

	return 0;
}

int fnc() {

	int i;

	memset(vtxs, 0, sizeof(vtxs));
	ecnt = 0;

	vcnt = geti();

	for (i = 0; i < vcnt - 1; i++) {
		int vno1 = geti() - 1;
		int vno2 = geti() - 1;
		int len = geti();
		addedge(vno1, vno2, len);
		addedge(vno2, vno1, len);
	}

	for (i = 0; i < vcnt; i++) {
		set(i, 2);
	}

	for (i = 0; i < vcnt; i++) {
		outi(vtxs[i].color - 1);
	}

	return 0;
}

int main() {

#ifdef TEST
	for (tno = TEST_SNO; tno <= TEST_ENO; tno++) {
		char str[128];
		sprintf(str, "test%d.txt", tno);
		in = fopen(str, "r");
		sprintf(str, "ans%d.txt", tno);
		ans = fopen(str, "r");
		fnc();
		fclose(in);
		fclose(ans);
	}
	printf("end\n");
#else
	in = stdin;
	fnc();
#endif

	return 0;
}


Measured memory_bytes: 8832
N, W = map(int, input().split())
INF = 10 ** 9 + 7
wvLst = [list(map(int, input().split())) for _ in range(N)]
dp = [[INF for i in range(10 ** 5 + 1)] for _ in range(N + 1)]

dp[0][0] = 0
for i in range(N):
    for j in range(10 ** 5 + 1):
        if j - wvLst[i][1] >= 0:
            dp[i + 1][j] = min(dp[i + 1][j], dp[i][j - wvLst[i][1]] + wvLst[i][0])
        dp[i + 1][j] = min(dp[i + 1][j], dp[i][j])
ans = 0
for i in range(10 ** 5 + 1):
    if dp[N][i] <= W:
        ans = i

print(ans)

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

int main(){
	int k,flag;
	double x1,y1,x2,y2,x3,y3,a,b,m,n,p,q,r;
	scanf("%d",&k);
	while(k--){
		scanf("%lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3);
		flag=0;
		if(x2-x1==0){
			q=(y1+y2)/2; 
			flag=1;
		}
		if(x3-x2==0){
			q=(y2+y3)/2; 
			flag=2;
		}
		if(y2-y1==0) {
			p=(x1+x2)/2;
			flag+=3;
		}
		if(y3-y2==0){
			p=(x2+x3)/2;
			flag+=6;
		}
		if(flag==0){
			a=-(x2-x1)/(y2-y1);
			b=-(x3-x2)/(y3-y2);
			m=(y1+y2)/2-a*(x1+x2)/2;
			n=(y2+y3)/2-b*(x2+x3)/2;
		}
		switch(flag){
			case 0:p=(n-m)/(a-b);q=a*p+m;break;
			case 1:b=-(x3-x2)/(y3-y2);n=(y2+y3)/2-b*(x2+x3)/2;p=(q-n)/b;break;
			case 2:a=-(x2-x1)/(y2-y1);m=(y1+y2)/2-a*(x1+x2)/2;p=(q-m)/a;break;
			case 3:b=-(x3-x2)/(y3-y2);n=(y2+y3)/2-b*(x2+x3)/2;q=b*p+n;break;
			case 4:break;
			case 6:a=-(x2-x1)/(y2-y1);m=(y1+y2)/2-a*(x1+x2)/2;q=a*p+m;break;
			case 7:break;
			default: break;
		}
		r=sqrt((p-x1)*(p-x1)+(q-y1)*(q-y1));
		printf("%.3f %.3f %.3f\n",p,q,r);
	}
	return 0;
}

Measured memory_bytes: 664
import itertools
import numpy as np
import math

def main():
    N = int(input())

    coordinate = []
    for _ in range(N):
        coordinate.append(tuple(map(int, input().split())))

    distance = [[None]*N for _ in range(N)]

    for i in range(N):
        x1, y1 = coordinate[i]
        for j in range(N):
            x2, y2 = coordinate[j]
            distance[i][j] = math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)

    C = [i for i in range(N)]

    sum = 0
    for c in itertools.permutations(C):
        c_1 = c[0]
        for j in range(1, len(c)):
            c_2 = c[j]
            sum += distance[c_1][c_2]
            c_1 = c_2
    print(sum/math.factorial(N))

    return 0
if __name__ == '__main__':
    main()

Measured memory_bytes: 12432
#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;

const long long mod=1e9+7;
long long inverseMod(long long x,long long mod);
long long nCr(long long n,long long r,long long mod){
    //when r is lesser and is greater
    long long res=1;
    if(r>n-r)r=n-r;
    long long div=1;
    for(long long  i=0;i<r;i++){
        res=(res*(n-i))%mod;
    }

    for(long long i=1;i<=r;i++){
        div=(div*i)%mod;
    }



    return (res*inverseMod(div,mod))%mod;


}



//long long factorial[100002];



long long power(long long x,long long n,long long mod){
//(x^n)%mod
long long result=1;

    while(n){
        if(n%2)
            result=(result*x)%mod;
        x=(x*x)%mod;
        n/=2;
    }
    return result;
}

long long inverseMod(long long x,long long mod){

return power(x,mod-2,mod);
}



int main() {
    fast

    long long n,a,b;
    cin>>n>>a>>b;


    //cout<<nCr(n,a,mod)<<" "<<nCr(n,b,mod);
    long long res=power(2,n,mod)-1;
    long long resullt=(res-nCr(n,a,mod)-nCr(n,b,mod))%mod;
    resullt=(resullt+mod)%mod;

    cout<<resullt;

	return 0;
}









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

int main(){
  int n; cin>>n;
  int i=pow(2*n,0.5),ans;
  while(true){
    if(i*(i+1)<2*n&&2*n<=(i+1)*(i+2)){cout<<i+1<<endl;break;}
    else{i--;}
  }
}



Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main() {
   int a, b, c;
   cin >> a >> b >> c;

   int isPoor = 0;

   if (a == b && b != c) isPoor = 1;
   if (b == c  && c != a) isPoor = 1;
   if (c == a && a != b) isPoor = 1;

   if (isPoor) cout << "Yes";
   else cout << "No";

}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <cassert>
#include <memory>
#include <stack>
#include <set>
using namespace std;

int S[1000000];
bool b_search(const int size, const int key) {
  int left = 0; int right = size;

  while(left < right) {
    int mid = (left+right) / 2;
    if(key == S[mid]) {
      return true;
    } else if(key > S[mid]) {
      left = mid+1;
    } else {
      right = mid;
    }
  }
  return false;
}

int main() {
  int n;
  cin >> n;
  for(int i=0; i < n; i++) {
    cin >> S[i];
  }
  int q; cin >> q;
  int T[1000000];
  for(int i=0; i<q; i++) {
    cin >> T[i];
  }

  int cnt = 0;
  for(int i=0; i<q; i++) {
    if(b_search(n, T[i])) {
      cnt++;
    }
  }

  printf("%d\n", cnt);
}



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

struct init_ { init_(){ cin.tie(nullptr); ios::sync_with_stdio(false); } } init_;

int main() {
    string x;
    cin >> x;
    int s_sub_t = 0;
    int min_s_sub_t = 0;
    for (char c : x) {
        if (c == 'S') s_sub_t++; else s_sub_t--;
        min_s_sub_t = min(min_s_sub_t, s_sub_t);
    }
    cout << 2 * -min_s_sub_t << '\n';
}


Measured memory_bytes: 720
#include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;

int main(){
	while(1){
		long n, k;
		long a[100000];
		long b[100000]; //??????????´?
		
		scanf(" %ld %ld", &n, &k);
		if(n==0) break;
		for(long i=0; i<k; ++i) scanf(" %ld", &a[i]);
		sort(a, a+k);
		
		bool w=false;
		if(a[0]==0) w=true;
		
		for(long i=0; i<k-1; ++i) b[i]=a[i+1]-a[i]-1;

		//for(long i=0; i<k; ++i) printf("a[%ld]=%ld\n",i,a[i]);
		//for(long i=0; i<k-1; ++i) printf("b[%ld]=%ld\n",i,b[i]);

		long ans=0;		
		for(long i=0; i<k-1; ++i){
			if(i!=0 && b[i-1]==0) continue;
			
			if(w && i==0) continue;
			
			long now=i;
			long diff=1;
			if(w) diff--;
			
			while(now<k-1 && diff<2){
				if(diff+b[now]>1) break;
				else diff+=b[now++];	
			}	
			//printf("%ld :: %ld\n", i, now);
			
			long tmp=now-i+1;
			if(w && diff>0) tmp++;
			
			if(ans<tmp) ans=tmp;
			//printf("  %ld\n", ans);
		}
		
		printf("%ld\n", ans);
	}
}

Measured memory_bytes: 2464
#include<stdio.h>
#include<ctype.h>
main(){
    char ch;
 
    while(1){
        scanf("%c",&ch);
        if(islower(ch)){
            ch = toupper(ch);
        }
        else if(isupper(ch)){
            ch = tolower(ch);
        }
        printf("%c",ch);
 
        if(ch == '\n') break;
    }
    return 0;
}

Measured memory_bytes: 2616
#include <stdio.h>
#include <iostream>
#include <string.h>
#include <string>
#include <math.h>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <stdlib.h>
#include <time.h>
#include <limits.h>
#include <assert.h>
using namespace std;
int y, m, d;
int main() {
	scanf("%d/%d/%d", &y, &m, &d);
	if (m > 4) puts("TBD");
	else puts("Heisei");
	return 0;
}

Measured memory_bytes: 256
x,y=map(int,input().split())
if x==2 or y==2:
  print("No")
elif (x==4 or x==6 or x==9 or x==11) and (y==4 or y==6 or y==9 or y==11):
  print("Yes")
elif (x==4 or x==6 or x==9 or x==11) or (y==4 or y==6 or y==9 or y==11):
  print("No")
else:
  print("Yes")

Measured memory_bytes: 3060
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <stack>
using namespace std;
char op[]="+-*/";
char item[105];
bool is_op(char c)
{
    for(int i=0;i<strlen(op);i++)
    {
        if(op[i]==c) return true;
    }
    return false;
}
int main()
{
//    freopen("in.txt","r",stdin);
    stack<int> ss;
    while(~scanf("%s",item))
    {
        if(strlen(item)==1)
        {
            if(!is_op(item[0]))   ss.push(atoi(item));
            else
            {
                int op2=ss.top();ss.pop();
                int op1=ss.top();ss.pop();
                switch(item[0])
                {
                case '+':
                    {
                        ss.push(op1+op2);
                        break;
                    }
                     case '-':
                    {
                        ss.push(op1-op2);
                        break;
                    }
                     case '*':
                    {
                        ss.push(op1*op2);
                        break;
                    }
                     case '/':
                    {
                        ss.push(op1/op2);
                        break;
                    }
                }
            }
        }
        else{
             ss.push(atoi(item));
        }
    }
    printf("%d\n",ss.top());
    return 0;
}

Measured memory_bytes: 3244
#include <iostream>
int main() {
    int n;
    std::cin >> n;
    int num;
    int sum = 0;
    int max = -1;
    while (n--) {
        std::cin >> num;
        sum += num;
        max = num > max ? num : max;
    }
    std::cout << (max * 2 < sum ? "Yes" : "No") << '\n';
    return 0;
}


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

//マクロ
//型エイリアス
using ll = long long;
using P=pair<long long,long long>;
using vl=vector<long long>;
//ショートカット
#define rep(i,n) for(int i=0;i<n;i++)
#define rep2(i,k,n) for(int i=k;i<n;i++) //半開区間
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(),v.rend()
#define pb push_back
//入力
#define vin(v,N) for(long long i=0;i<N;i++) cin>>v.at(i)
#define lin(n) long long n;cin>>n
#define vlin(v,N) vector<long long>v(N);for(long long i=0;i<N;i++)cin>>v.at(i)

//関数
//最大公約数
long long gcd(long long m,long long n){
  long long a=max(m,n);
  long long b=min(m,n);
  long long r=a%b;
  while(r!=0){
    a=b; b=r; r=a%b;
  }
  return b;
}
// 最小公倍数
long long lcd(long long m,long long n){
  return m*n/gcd(m,n);
}
//xのn乗
long long power(long long x,long long N){
  long long ret=1;
  for(long long i=0;i<N;i++)   
    ret*=x;
  return ret;
}
//nCr
long long C(long long n, long long r);
//nCr (mod)
long long modC(long long n, long long r) {
    vector<long long> f(n+1),inv(n+1),invf(n+1);
    f[0]=f[1]=1;
    invf[0]=invf[1]=1;
    inv[1]=1;
    for (long long i=2;i<n+1;i++) {
        f[i]=(i*f[i-1])%mod;
        inv[i]=mod-((mod/i)*inv[mod%i])%mod;
        invf[i]=(inv[i]*invf[i-1])%mod;
    }
    long long cmb=f[n]*(invf[r]*invf[n-r]%mod)%mod;
    if (n>=r) return cmb;
    else return 0;
}
//素因数分解(mapで返す)
map<long long,long long> factor(long long p){
  ll p1=p;
  map<long long,long long>ret;
  for(long long i=2;i*i<=p1;i++){
     while(p%i==0){
      ret[i]++;
      p/=i;
    }
  }
  if(p!=1)
  ret[p]++;
  return ret;
}
//素数判定
bool is_prime(long long N){
  for(long long i=2;i*i<=N;i++){
    if(N%i==0)
      return false;
  }
  return true;
}
//最大値更新
void chmax(long long &a,long long b){
  a=max(a,b);
}
//最小値更新
void chmin(long long &a,long long b){
  a=min(a,b);
}

//メイン関数
int main(){
  //doubleの桁数
  cout<<fixed<<setprecision(10);
  
  lin(a);lin(b);lin(c);
  if(a+b+c>21)
    cout<<"bust";
  else
    cout<<"win";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(v) v.begin(), v.end()
typedef long long ll;
typedef pair<int, int> P;
typedef pair<long long, long long> Pll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<long long> vll;
typedef vector<vector<long long>> vvll;
const long long INF = 1LL << 60;
const int INT_INF = 1 << 30;
const double PI = acos(-1.0);

int n;
vector<string> vec;

void dfs(string x, char y){
    if (x.size() == n){
        vec.push_back(x);
        return;
    }
    for(char c = 'a'; c <= y + 1; c++){
        dfs(x + c, (c == y + 1 ? y + 1: y));
    }
}

int main() {
    cin >> n;
    dfs("a", 'a');
    sort(all(vec));
    rep(i, vec.size()){
        cout << vec.at(i) << endl;
    }
}


Measured memory_bytes: 7324
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }
int main(int argc, char* argv[]) {
   string s;
   cin >> s;
   if(s[3]<='9'){
       if(s[6]>='5'||s[5]=='1'){
           cout << "TBD" << endl;
       }
       else cout << "Heisei" <<endl;
   }
   else
        cout << "TBD" <<endl;
    return 0;
}


Measured memory_bytes: 256
/* Author Sanjay Shukla
 Verdit: AC
 */
#include<bits/stdc++.h>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <iostream>
#include <istream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <tuple>
#include <iomanip>
#include <random>
#include <math.h>
#include <stdio.h>
 
using namespace std;
 
#define ll long long
#define rep(i, n) for(ll i = 0; i < (n); i++)
ll MOD = 1e9 + 7;
int INF = 1 << 30;
ll INFL = 1LL << 60;
ll MODP = 998244353;

long long moduloMultiplication(long long a, 
                            long long b, 
                            long long c) 
{ 
    ll res=0;
   res = ( ( a % c ) * ( b % c ) ) % c;
  
    return res; 
} 
int main()
{
    ll sum=0,n,sum1=0;
    cin>>n;
    vector <int> v;
    rep(i,n)
    {
        int x;
        cin>>x;
        v.push_back(x);
        sum1+=x;
    }
    // cout<<sum1<<endl;
    for(ll i = 0; i < (n-1); i++)
    {
        sum1 = (sum1-v[i]);
         sum += moduloMultiplication(v[i],sum1,MOD);
        //  cout<<sum<<endl;
    }
    cout<<sum%MOD<<endl;


}

Measured memory_bytes: 4196
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
    string s;
    cin>>s;
    for(int i=0; i<s.size()-1; i++)
    {
        if(s[i] == 'A')
        {
            if(s[i+1]=='B')
            {
                cout<<"Yes"<<endl;
                return 0;
            }
        }
        if(s[i]=='B')
        {
            if(s[i+1]=='A')
            {
                cout<<"Yes"<<endl;
                return 0;
            }
        }
    }
    cout<<"No"<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define MP make_pair
#define PB push_back
#define INF INT_MAX
#define PI 3.1415926535897932384626433832795
#define MOD 1000000007

using namespace std;

typedef pair <int, int> pii;
typedef long long ll;
typedef unsigned long long ull;


int main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    #ifdef cbaaabc
    freopen("debug.inp","r",stdin);
    freopen("debug.out","w",stdout);
    #endif
    #define int long long
    int x,ht = 100;
    int ans = 0;
    cin >> x;
    while (ht<x)
    {
        ht = ht+ht/100;
        ++ans;
    }
    cout << ans;
    return 0;
}



















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

vector<pair<long long,long long> >v;

void f()
{
    for(int i=0;i<v.size();i++)
    {
        for(int j=i-1;j>=0;j--)
        {
            if(v[i].first==v[j].first)
            {
                if(v[i].second>v[j].second)
                {
                    swap(v[i].second,v[j].second);
                }
            }
            else
            {
                break;
            }
        }
    }
}

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

    for(int i=0;i<n;i++)
    {
        long long a,b;
        cin>>a>>b;
        v.push_back(make_pair(a+b,a-b));
    }
   sort(v.begin(),v.end());
   f();

   //for(int i=0;i<v.size();i++)cout<<v[i].first<<" "<<v[i].second<<endl;

   long long flag=1,counter=v[0].first;
   for(int i=1;i<v.size();i++)
   {
       if(counter<=v[i].second)
       {
           flag++;
           counter=v[i].first;
       }
   }
   cout<<flag<<endl;
}


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

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

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin>>n;  
    vector<int> v(n);  
    rep(i,n) cin>>v[i];
    int mi = 1e9;
    for(int i=-100; i<101; i++){
        int cst = 0;
        rep(j,n) {
            int x = abs(v[j]-i);
            cst += (x*x);
        }
        mi = min(cst, mi);
    }
    cout<<mi;
    return 0;
}

Measured memory_bytes: 3652
X, K, D = [int(_) for _ in input().split()]
X = abs(X)
if X - K * D >= 0:
    ans = X - K * D
else:
    c1, ans = divmod(X, D)
    c2 = (K - c1) % 2
    if c2:
        ans = abs(ans - D)
print(ans)


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

#define rep(i, a, b) for (int i = (a); i < (b); i++)

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

  int ans = 0;
  rep(i, 1, n)
  {
    ans += (n - 1) / i;
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    long double r;
    cin>>r;

    long double pi=3.1416,x;

    x=2*pi*r;

    //cout<<setprecision(10)<<fixed;
    cout<<x<<endl;









    return 0;
}


Measured memory_bytes: 3792
#include<bits/stdc++.h>
#define rep(i,n) for(int (i) = 0;(i) < (n);(i)++)
using namespace std;
typedef long long ll;
// cd test ; rm -R ./*; cd .. 

int main(void) {
  ll x;
  cin >> x;

  ll ans = 0;
  ans += (x / 11) * 2;
  if (x % 11 == 0) ans += 0;
  else if (x % 11 <= 6) ans += 1;
  else ans += 2;

  cout << ans << endl;

  return 0;
}

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

// 型定義
typedef long long ll;
typedef pair<ll, ll> P;

// forループ
#define REP(i,n) for(ll i=0; i<(ll)(n); ++i)

// 定数宣言
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

// グラフ表現
using Graph = vector<vector<int>>;

// グラフの辺表現
using Edge = map<pair<int,int>,int>;

// n次元配列の初期化。第２引数の型のサイズごとに初期化していく。
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

// 最大公約数
ll gcd(ll a,ll b){
   if (a%b == 0) return(b);
   else return(gcd(b, a%b));
}

// 最小公倍数
ll lcm(ll a, ll b){
    return a/gcd(a, b) * b;
}

int main()
{
    cout << fixed << setprecision(15);
    ll N;
    cin >> N;

    map<ll, ll> M;

    REP(i, N){
        ll a;
        cin >> a;
        M[a]++;
    }

    ll count = 0;
    ll doublecount = 0;
    for(auto iter=M.begin(); iter!=M.end(); iter++){
        count++;
        doublecount += iter->second - 1;
    }
    if(doublecount % 2 == 0){
        cout << count << endl;
    }
    else{
        cout << count-1 << endl;
    }
    return 0;
}

Measured memory_bytes: 9812