akhauriyash/Code-Regression huggingface dataset:
/*

This Submission is to determine how many 120/240 min const. delivery point there are.

//info
120 req. steps <= 5
*/
#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <bitset>
using namespace std;
typedef string::const_iterator State;
#define Ma_PI 3.141592653589793
#define eps 0.00000001
#define LONG_INF 1e18
#define GOLD 1.61803398874989484820458
#define MAX_MOD 998244353
#define MOD 998244353
#define seg_size 262144
#define REP(a,b) for(long long a = 0;a < b;++a)

unsigned long xor128() {
	static unsigned long x = time(NULL), y = 362436069, z = 521288629, w = 88675123;
	unsigned long t = (x ^ (x << 11));
	x = y; y = z; z = w;
	return (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)));
}
long long dp[3][200000] = {};
int main(){
	string s;
	cin >> s;
	dp[0][0] = 0;
	REP(i, 3) {
		REP(q, 200000) {
			dp[i][q] = -LONG_INF;
		}
	}
	dp[0][0] = 0;
	for (int i = 0; i < s.length(); ++i) {
		int q = i;
		dp[1][i + 1] = max(dp[1][i + 1], max(dp[2][i], dp[0][i]) + 1);
			dp[2][i + 2] = max(dp[2][i + 2], max(dp[1][i], dp[0][i]) + 1);
			if (q > 0 && s[q - 1] != s[q]) {
				dp[1][i + 1] = max(dp[1][i + 1], dp[1][i] + 1);
			}
			if (q > 1 && q+1 < s.length()&&(s[q - 2] != s[q] || s[q - 1] != s[q + 1])) {
				dp[2][i + 2] = max(dp[2][i + 2], dp[2][i] + 1);
			}
	}
	cout << max({ dp[0][s.length()],dp[1][s.length()],dp[2][s.length()] }) << endl;
	return 0;
}


Measured memory_bytes: 5252
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define rep1(i,n) for(int i=1;i<=(int)n;i++)
#define rep2(i,j,n) for(int j=i;j<n;j++)
#define rep3(i,j,n) for(int j=i;j<=n;j++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define sp(n) cout << fixed << setprecision(n)
typedef long long ll;
using namespace std;
int main(void){
    string s;cin>>s;
    int n=s.size()/2;
    rep(i,n/2){
        if(s[i]!=s[n-1-i]){
            cout<<"No"<<endl;
            return 0;
        }
    }
    rep(i,n/2){
        if(s[n+1+i]!=s[2*n-i]){
            cout<<"No"<<endl;
            return 0;
        }
    }
    n=s.size();
    rep(i,n/2){
        if(s[i]!=s[n-i-1]){
            cout<<"No"<<endl;
            return 0;
        }
    }
    cout<<"Yes"<<endl;
}


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

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

const int mod = 1e9 + 7;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
    b[i] = abs(i - (n - i - 1));
  }
  sort(a, a + n);
  sort(b, b + n);
  REP(i, n) {
    if (a[i] != b[i]) {
      puts("0");
      return 0;
    }
  }
  int ans = 1;
  REP(i, n / 2) ans = ans * 2 % mod;
  printf("%d\n", ans);
  return 0;
}



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

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;

#define pb push_back
#define eb emplace_back
#define ff first
#define ss second
#define mp make_pair
#define endl '\n'

const double PI = acos(-1);
const double eps = 1e-9;
const int inf = 2000000000;
const ll infLL = 9000000000000000000;
#define MOD 1000000007
//#define harmonic(n) 0.57721566490153286l+log(n)

#define mem(a,b) memset(a, b, sizeof(a) )
#define sqr(a) ((a) * (a))

#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);

//int dx[]={1,0,-1,0};int dy[]={0,1,0,-1}; ///4 Direction
//int dx[]={1,1,0,-1,-1,-1,0,1};int dy[]={0,1,1,1,0,-1,-1,-1};///8 direction
//int dx[]={2,1,-1,-2,-2,-1,1,2};int dy[]={1,2,2,1,-1,-2,-2,-1};///Knight Direction
//int dx[]={2,1,-1,-2,-1,1};int dy[]={0,1,1,0,-1,-1}; ///Hexagonal Direction

inline int in() { int x; scanf("%d", &x); return x; }
inline ll inl() { ll x;scanf("%I64d",&x); return x;}
inline double ind() { double x;scanf("%lf",&x);return x;}

inline bool EQ(double a, double b) { return fabs(a-b) < 1e-9; }
inline bool isLeapYear(ll year) { return (year%400==0) || (year%4==0 && year%100!=0); }
inline void normal(ll &a) { a %= MOD; (a < 0) && (a += MOD); }
inline ll modMul(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a*b)%MOD; }
inline ll modAdd(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a+b)%MOD; }
inline ll modSub(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); a -= b; normal(a); return a; }
inline ll modPow(ll b, ll p) { ll r = 1; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1; } return r; }
inline ll modInverse(ll a) { return modPow(a, MOD-2); }
inline ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }

int gcd(int a,int b) { return b==0 ? a:gcd(b,a%b);}
int power( int x, int n)
{
    if(n==0)return 1;
    else if(n%2==0)
    {
        int y=power(x,n/2);
        return y*y;
    }
    else
        return x*power(x,n-1);
}
//abcdefghijklmnopqrstuvwxyz//

main()
{
    #ifdef CP
    freopen("in.txt","r",stdin);
    freopen("out.txt","w",stdout);
    #endif // CP
    int n=in();
    for(int i=0;i<n;i++)
        printf("ACL");
    printf("\n");
}


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

int main(){
  int A,B,q,c;
  cin >> A >> B;
  int L[5];
  c=0;
  for (int N = A; N < B+1;N++){
    q=N;
    for(int i = 0; i < 5; i++){
      L[i]=q%10;
      q /= 10;
    }
    if(L[0]==L[4] and L[1]==L[3]){
      c+=1;
    }
  }
  cout << c << endl;
}


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

#define sc second
#define fr first

#define ll long long
#define pi pair<int,int>
#define ppi pair<pi,pi>
#define mp make_pair
using namespace std;

int G[10][1000];
int cnt[11];
int main(){

    ios::sync_with_stdio(0);
    cin .tie(0),cout.tie(0);

    int H , W , k; cin >> H >> W >> k;
    for(int i =0 ;i < H ;i++)
        for(int j=0 ;j< W;j++)
            {
               char c; cin >> c;
               G[i][j] = (c == '1' ? 1 : 0);
            }
    int L = H - 1;
    int Ans = 1e9;
    for(int Mask = 0;Mask < (1 << L);Mask++)
    {
        int ans = __builtin_popcount(Mask);
        memset(cnt,0,sizeof cnt);
        bool ok = 1;
        for(int i = 0;i < W;i++)
        {
            int  Tmp = 0;
            int idx = 0;
            bool ok2 = 0;
            for(int j = 0;j < H;j++)
            {
                Tmp += G[j][i];
                if(Tmp > k)
                    ok = 0;
                if(Mask & (1 << j))
                {
                    if(cnt[idx] + Tmp > k)
                        ok2 = 1;
                    Tmp = 0;
                    idx++;
                }
            }
            if(Tmp  > k)
                ok = 0;
            if(Tmp + cnt[idx] > k)ok2 = 1;
            if(!ok)break;
            idx = 0 , Tmp = 0;
            for(int j = 0;j < H;j++)
            {
                Tmp += G[j][i];
                if(Mask & (1 << j))
                {
                    if(ok2) cnt[idx] = Tmp;
                    else    cnt[idx] += Tmp;
                    Tmp = 0;
                    idx++;
                }
            }
            if(ok2) cnt[idx] = Tmp;
            else    cnt[idx] += Tmp;
            if(ok2)ans++;
        }
        //cout << Mask << ' ' << ans << '\n';
        //for(int i = 0;i < 10;i++)
          //  cout << cnt[i] << ' ' ;
       // cout << '\n';
        if(ok)
        {
            Ans = min(Ans , ans);
        }
    }
    cout << Ans << '\n';
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<queue>

using namespace std;

typedef long long ll;
typedef pair<ll,int> P;//firstは最短距離,secondは頂点の番号

struct edge{
    int to;
    ll cost;
};

const int MAX_V=1e5;//問題の制約用
const ll INF=1e18;
int V;//使う頂点数
vector<edge> G[MAX_V];//グラフ
ll d[MAX_V];//距離を詰める

void dijkstra(int s){//始点sからの最短距離を求める。
    priority_queue<P, vector<P>, greater<P> > que;
    fill(d,d+V,INF);
    d[s]=0;
    que.push(P(0,s));
    while(!que.empty()){
        P p=que.top(); que.pop();
        int v = p.second;
        if(d[v]<p.first) continue;//それが最短距離でなければ無視
        for(int i=0;i<G[v].size();i++){
            edge e=G[v][i];
            if(d[e.to] > d[v] + e.cost){
                d[e.to] = d[v] + e.cost;
                que.push(P(d[e.to],e.to));
            }
        }
    }
}


int main(){
    cin>>V;
    for(int i=0;i<V-1;i++){
        int a,b;
        ll c;
        cin>>a>>b>>c;
        a--; b--;
        edge e;
        e.to=b; e.cost=c;
        G[a].push_back(e);
        e.to=a; e.cost=c;
        G[b].push_back(e);
    }
    int Q,K;
    cin>>Q>>K;
    K--;
    dijkstra(K);
    for(int i=0;i<Q;i++){
        int x,y;
        cin>>x>>y;
        x--; y--;
        cout<<d[x]+d[y]<<endl;
    }
    return 0;
}


Measured memory_bytes: 11120
n, k = map(int, input().split())
X = list(map(int, input().split()))
ans = 10**9
for i in range(n-k+1):
  l = X[i]
  r = X[i+k-1]
  tmp = min(abs(l)+abs(l-r), abs(r)+abs(l-r))
  ans = min(tmp, ans)
print(ans)

Measured memory_bytes: 14224
#!/usr/bin/env python3
import sys


def solve(A: int, B: int):
    return A * B


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    print(solve(A, B))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()


Measured memory_bytes: 9180
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = (n); i >= 0; i--)
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define ALL(obj) begin(obj), end(obj)
using namespace std;
using ll = long long;
using ull = unsigned long long;

const int INF = 200000000;
const int MOD = 1e9 + 7;

// 多次元 vector 生成
template <class T> vector<T> make_vec(size_t a) { return vector<T>(a); }
template <class T, class... Ts> auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
// return gcd(a,b)
long long gcd(long long a, long long b) {
    // O(log min(a,b))
    if (b == 0) {
        return a;
    } else {
        return gcd(b, a % b);
    }
}
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int N;
    cin >> N;
    vector<int> A(N), dif(N - 1);
    REP(i, N) { cin >> A.at(i); }

    sort(ALL(A));
    int ans = A[0];
    REP(i, N - 1) { ans = gcd(A[i + 1], ans); }
    cout << ans << endl;
    return 0;
}


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

int main(){
	cin.tie(0),ios::sync_with_stdio(false);
	int n; cin>>n;
	vector<int>s(n);
	int sum=0;
	for(auto&i:s)cin>>i,sum+=i;
	if(sum%10==0){
		int mn=1e9;
		for(auto&i:s)if(i%10!=0)mn=min(mn,i);
		if(mn!=1e9)sum-=mn;
	}
	cout<<(sum%10!=0?sum:0)<<"\n"s;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
int main(){
    double x1,y1,x2,y2,ans;
    cin>>x1>>y1>>x2>>y2;
    ans=(x2-x1)*(x2-x1)+(y2-y1)*(y2-y1);
    ans=sqrt(ans);
    cout<<setprecision(20)<<ans<<endl;
}

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

void main()
{
  auto rd = readln.split.map!(to!int);
  auto w = rd[0], h = rd[1], x = rd[2], y = rd[3], r = rd[4];
  writeln(x >= r && x <= w - r && y >= r && y <= h - r ? "Yes" : "No");
}

Measured memory_bytes: 2516
#include<iostream>
#include<cmath>
#include<algorithm>
#include<string>
#include<stack>
using namespace std;
int main(){
  int n;cin>>n;
  int b[105];
  int i,j,k,l;
  stack<int> ans;
  for(i=1;i<n+1;i++){
  cin>>b[i];
  }

  for(i=n;i>0;i--){
    bool check=false;
    for(j=i;j>0;j--){
      //cout<<j<<" "<<b[j]<<endl;
      if(b[j]==j){
        check=true;
        //cout<<i<<" "<<b[j]<<" "<<j<<endl;
        ans.push(j);
        for(k=j;k<i;k++){
            b[k]=b[k+1];
        }
      }
      if(check) break;
    }
  }

  if(ans.size()!=n) cout<<-1<<endl;
  else {
    while(ans.size()) {
      cout<<ans.top()<<endl;
      ans.pop();
    }
  }

}


Measured memory_bytes: 256
#include <stdio.h>
int main (int argc, char * argv[])
{
    int i,a,b,c,d=0;
    scanf("%d %d %d",&a,&b,&c);
    for(i=a;i<=b;i++){
        if(c%i==0){
            d++;
        }
    }
    printf("%d\n",d);
    return 0;
}



Measured memory_bytes: 2096
import math
import fractions
import bisect
import collections
import itertools
import heapq
import string
import sys
import copy
from collections import deque
sys.setrecursionlimit(10**7)
MOD = 10**9+7
def gcd(a,b):return fractions.gcd(a,b) #最大公約数
def lcm(a,b):return (a*b) // fractions.gcd(a,b) #最小公倍数
def iin(): return int(input()) #整数読み込み
def ifn(): return float(input()) #浮動小数点読み込み
def isn(): return input().split() #文字列読み込み
def imn(): return map(int, input().split()) #整数map取得
def fmn(): return map(float, input().split()) #浮動小数点map取得
def iln(): return list(map(int, input().split())) #整数リスト取得
def iln_s(): return sorted(iln()) # 昇順の整数リスト取得
def iln_r(): return sorted(iln(), reverse=True) # 降順の整数リスト取得
def fln(): return list(map(float, input().split())) # 浮動小数点リスト取得
def join(l, s=''): return s.join(l) #リストを文字列に変換
def perm(l, n): return itertools.permutations(l, n) # 順列取得
def perm_count(n, r): return math.factorial(n) // math.factorial(n-r) # 順列の総数
def comb(l, n): return itertools.combinations(l, n) # 組み合わせ取得
def comb_count(n, r): return math.factorial(n) // (math.factorial(n-r) * math.factorial(r)) #組み合わせの総数
def two_distance(a, b, c, d): return ((c-a)**2 + (d-b)**2)**.5 # 2点間の距離
def m_add(a,b): return (a+b) % MOD

ABCD = input()

for i in range(2**3):
    total = int(ABCD[0])
    op = []
    tmp = i
    for j in range(3):
        if tmp & 1 == 1:
            op.append('+')
            total += int(ABCD[j+1])
        else:
            op.append('-')
            total -= int(ABCD[j+1])
        tmp = tmp >> 1
    if total == 7:
        print(ABCD[0] + op[0] + ABCD[1] + op[1] + ABCD[2] + op[2] +ABCD[3] + '=7')
        break


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

using namespace std;

#define pb push_back
#define fi first
#define se second
#define debug(x) cerr<<#x << " := " << x << endl;
#define bug cerr<<"-----------------------"<<endl;



typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int inf = 0x3f3f3f3f;
const ll inff = 0x3f3f3f3f3f3f3f3f;
const int mod = 1e9+7;
/**********showtime************/

            const int maxn =  1e5+9;
            int a[maxn];
int main(){
            int n;  scanf("%d", &n);
            if(n % 2 == 1)
            {
                puts("0");
                return 0;
            }

            for(int i=1; i<=n; i++) scanf("%d", &a[i]);
            sort(a+1, a+1+n);

            int up = a[n/2+1], down = a[n/2];
            printf("%d\n", up - down);
            return 0;
}


Measured memory_bytes: 640
# -*- coding: utf-8 -*-
import numpy as np

A, B, H, M = map(int, input().split())

hun = 60*H+M

state_zisin = hun/720
state_hunsin = (hun%60)/60

kakudo = min(abs(state_zisin-state_hunsin), 1-abs(state_zisin-state_hunsin))
pi = 3.141592653589793238462643383279
w = kakudo*2*pi
c = (A**2+B**2-2*A*B*np.cos(w))**(0.5)
print("{}".format(c))


Measured memory_bytes: 27208
use std::cmp;
use std::collections::HashMap;
use std::collections::VecDeque;
use std::io::Read;
use std::usize::MAX;

macro_rules! input {(source = $s:expr, $($r:tt)*) => {let mut iter = $s.split_whitespace();let mut next = || { iter.next().unwrap() };input_inner!{next, $($r)*}};($($r:tt)*) => {let stdin = std::io::stdin();let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));let mut next = move || -> String{bytes.by_ref().map(|r|r.unwrap() as char).skip_while(|c|c.is_whitespace()).take_while(|c|!c.is_whitespace()).collect()};input_inner!{next, $($r)*}};}
macro_rules! input_inner {($next:expr) => {};($next:expr, ) => {};($next:expr, $var:ident : $t:tt $($r:tt)*) => {let $var = read_value!($next, $t);input_inner!{$next $($r)*}};}
macro_rules! read_value {($next:expr, ( $($t:tt),* )) => {( $(read_value!($next, $t)),* )};($next:expr, [ $t:tt ; $len:expr ]) => {(0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()};($next:expr, chars) => {read_value!($next, String).chars().collect::<Vec<char>>()};($next:expr, usize1) => {read_value!($next, usize) - 1};($next:expr, [ $t:tt ]) => {{let len = read_value!($next, usize);(0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()}};($next:expr, $t:ty) => {$next().parse::<$t>().expect("Parse error")};}

fn solve() {
    input! {
        n: usize,
        a: [u64;n]
    }

    let mut left = vec![0; n];
    left[0] = a[0];
    let mut right = vec![0; n];
    right[0] = a[n - 1];

    for i in 1..n {
        left[i] = gcd(left[i - 1], a[i]);
        right[i] = gcd(right[i - 1], a[n - 1 - i]);
    }

    let mut ans = 1;
    for i in 0..n {
        let left_gcd = if i == 0 { 0 } else { left[i - 1] };
        let right_gcd = if i == n - 1 { 0 } else { right[n - 1 - i - 1] };

        if gcd(left_gcd, right_gcd) > ans {
            ans = gcd(left_gcd, right_gcd);
        }
    }

    println!("{}", ans);

    //println!("{:?} {:?}", left, right);
}

fn main() {
    let thd = std::thread::Builder::new().stack_size(104_857_600);
    thd.spawn(|| solve()).unwrap().join().unwrap();

    /*
    // 入力を一括で読み込む場合
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();
    let mut input = buf.split_whitespace();

    // inputに対しnext()で読み込んでいく
    let q: usize = input.next().unwrap().parse().unwrap();
    */
}

const LARGE_PRIME: u64 = 1_000_000_007;

// @〜でsnippet
// 最大公約数
fn gcd(a: u64, b: u64) -> u64 {
    let mut aa: u64 = if a > b { a } else { b };
    let mut bb: u64 = if a > b { b } else { a };
    while bb != 0 {
        let tmp = bb;
        bb = aa % tmp;
        aa = tmp;
    }
    return aa;
}

// 最小公倍数
fn lcm(a: u64, b: u64) -> u64 {
    a / gcd(a, b) * b
}


Measured memory_bytes: 10620
#include<iostream>
#include<algorithm>
#include<string>
#include<math.h>
#include<vector>
using namespace std;

int main(void)
{
    int a[3];
    cin >> a[0] >> a[1] >> a[2];
    sort(a,a+3);
    cout << (a[1] - a[0]) + (a[2] - a[1]) << endl;
    return 0; 
}


Measured memory_bytes: 256
import java.io.*;
import java.util.*;

public class Main {
	public void run() throws Exception {
		FastScanner file = new FastScanner();
		int N = file.nextInt(), K = file.nextInt();
		long[] h = new long[N + 1];
		long[] dp = new long[N + 1];
		for(int i = 1; i <= N; i++) h[i] = file.nextLong();
		Arrays.fill(dp, Long.MAX_VALUE);
		dp[1] = 0;
		dp[2] = Math.abs(h[1]-h[2]);
		for(int i = 3; i <= N; i++) {
			for(int j = 1; j <= K; j++) {
				if(i-j > 0) dp[i] = Math.min(dp[i-j] + Math.abs(h[i]-h[i-j]), dp[i]);
			}
		}
		System.out.println(dp[N]);
	}
	class FastScanner {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public FastScanner() {
			reader = new BufferedReader(new InputStreamReader(System.in), 32768);
			tokenizer = null;
		}

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

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}

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


Measured memory_bytes: 34468
/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include <iostream>

using namespace std;

int main()
{
    int i,j,k;
    cin>>i>>j;
    if(i!=1 && j!=1)
    cout<<1;
    else if(i!= 2&& j!=2)
    cout<<2;
    else if(i!=3 && j!=3)
    cout<<3;

    return 0;
}


Measured memory_bytes: 256
n = int(input())
ans = 1
a = []
d = {}
for i in range(n):
  x,l = map(int, input().split())
  a.append((x+l,x-l))
if n == 1:
  print(ans)
else:
  a.sort(key=lambda x:(x[0],x[1]))
  gl = a[0][0]
  st = a[0][1]
  for i in range(1,n):
    if gl<=a[i][1]:
      ans += 1
      gl = a[i][0]
  print(ans)

Measured memory_bytes: 25024
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <climits>
#include <cstdlib>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define DEBUG 1
using namespace std;
constexpr int kMod = 1000000007;
typedef long long LL;

template<typename T>
istream& operator >> (istream& is, vector<T>& vs){
  for(T& v: vs) is >> v;
  return is;
}

template<typename T>
ostream& operator << (ostream& os, const vector<T>& vs){
  for (const T& v : vs) os << v << " ";
  return os;
}

int main() {
  int D; cin >> D;
  vector<LL> c(26); cin >> c;
  vector<vector<LL>> s(D, vector<LL>(26, 0));
  for (int i = 0; i < D; ++i) cin >> s[i];
  vector<int> t(D); cin >> t;

  int M; cin >> M;
  for (int i = 0; i <= M; ++i) {
    vector<LL> last(26, 0);
    if (i != 0) {
      int d, q; cin >> d >> q; --d;
      t[d] = q;
    }
    LL v = 0;
    for (int d = 1; d <= D; ++d) {
      int i = d - 1;
      int j = t[i] - 1;
      last[j] = d;
      v += s[i][j];
      for (int k = 0; k < 26; ++k) {
        v -= c[k] * (d - last[k]);
      }
    }
    if (i != 0) cout << v << endl;
  }
}


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

int main(){
  string S;
  cin>>S;
  int out=0;
  int N=S.size();
  if(N>9)out++;
  int che=0;
  int i=0;
  if(S[i]=='A')i++;
  if(S[i]=='K')i++;
  else out++;
  if(S[i]=='I')i++;
  else out++;
  if(S[i]=='H')i++;
  else out++;
  if(S[i]=='A')i++;
  if(S[i]=='B')i++;
  else out++;
  if(S[i]=='A')i++;
  if(S[i]=='R')i++;
  else out++;
  if(S[i]=='A')i++;
  if(i<N)out++;
  if(out)cout<<"NO"<<endl;
  else cout<<"YES"<<endl;
}


Measured memory_bytes: 256
#include <cstdio>  
#include <cmath>  
#include <iostream>  
#include <algorithm>  
#include <cstring>  
#include <cctype>  
#include <stack>  
using namespace std;  
  
typedef long long ll;  
const int qq = 1e5 + 10;  
ll diff[qq];  
ll num[qq];  
ll n;  
  
int main(){  
    scanf("%lld", &n);  
    ll sum = 0;  
    for(int i = 0; i < n; ++i)   scanf("%lld", num + i), sum += num[i];  
    for(int i = 0; i < n - 1; ++i)  
        diff[i] = num[i + 1] - num[i];  
    diff[n - 1] = num[0] - num[n - 1];  
    ll k = (1 + n) * n / 2;  
    if(sum % k != 0){  
        printf("NO\n");  
        return 0;  
    }  
    k = sum / k;  
    for(int i = 0; i < n; ++i){  
        if(k == diff[i])    continue;  
        ll c = k - diff[i];  
        if(c < 0 || c % n != 0){  
            printf("NO\n");  
            return 0;  
        }  
    }  
    printf("YES\n");  
    return 0;  
}  



Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define INF 100000007
#define rep(i, N) for(ll i = 0; i < N; i++)
#define rep2(i, j, k) for(ll i = j; i < k; i++)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = inx(x, y)
#define print(x) cout << x << "\n"
#define print2(x, y) cout << x << " " << y << "\n"
#define printv(vec) rep(i, vec.size()) cout << vec[i] << " "; print("");
#define ALL(v) v.begin(), v.end()
#define SUM(v) accumulate(ALL(v), 0)
#define MAX(v) *max_element(ALL(v))
#define MIN(v) *min_element(ALL(v))
#define SORT(v) sort(ALL(v))
#define REV(v) reverse(ALL(v))
typedef long long ll;
using namespace std;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vs = vector<string>;
using vvs = vector<vector<string>>;

ll median(vl v){
    ll n = v.size() / 2;
    nth_element(v.begin(), v.begin() + n, v.end());
    return v[n];
}

void solve(){
	
	ll N, in_;
	cin >> N;
	vl A(N);
	rep(i, N){
		cin >> in_;
		A[i] = in_ - i - 1;
	}
	ll b = median(A);
	ll ans = 0;
	rep(i, N)  ans += abs(b - A[i]);
	print(ans);

}

int main(){
	
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	solve();
    
	return 0;
	
}





Measured memory_bytes: 6280
#include<cstdio>
#include<iostream>
using namespace std;
int main(){
	int sum=0,t,s,a_sum=0,ave,count=0;
	while(scanf("%d,%d",&t,&s) != EOF){
		sum += t*s;
		a_sum += s;
		count++;
	}
	ave = (int)((double)a_sum/count+0.5);
	cout << sum << endl << ave << endl;
}

Measured memory_bytes: 0
from math import floor,ceil,sqrt,factorial,log
from collections import Counter, deque
from functools import reduce
import numpy as np
import itertools
def S(): return input()
def I(): return int(input())
def MS(): return map(str,input().split())
def MI(): return map(int,input().split())
def FLI(): return [int(i) for i in input().split()]
def LS(): return list(MS())
def LI(): return list(MI())
def LLS(): return [list(map(str, l.split() )) for l in input()]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def LLSN(n: int): return [LS() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]

N = I()
for i in range(1,100):
    v = 1000 * i

    if N <= v:
        print(v-N)
        exit()
        

Measured memory_bytes: 27068
/* 
chirag11032000
Chirag Thakur
*/

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

using ll = long long;
using db = double;
using pii = pair < int, int >;
using pll = pair < ll, ll >;

template < typename T > using OrderedSet = tree < T, null_type, less < T >, rb_tree_tag, tree_order_statistics_node_update >;
template < typename T > using MinPriorityQueue = priority_queue < T, vector < T >, greater < T > >;

#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template < typename Arg1 >
void __f(const char* name, Arg1&& arg1) {
	cerr << name << " : " << arg1 << std::endl;
}
template < typename Arg1, typename... Args >
void __f(const char* names, Arg1&& arg1, Args&&... args) {
	const char* comma = strchr(names + 1, ',');
	cerr.write(names, comma - names) << " : " << arg1 << " | ";
	__f(comma + 1, args...);
}
#else
#define trace(...)
#endif

#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define unique_sort(x) sort(all(x)), x.resize(distance(x.begin(), unique(all(x))))

const db PI = acos(-1);
const ll LINF = LLONG_MAX;
const int INF = INT_MAX, MOD = 1e9 + 7, N = 1e5 + 10;

void test_case();

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	test_case();
	cerr << "Time taken: " << int((clock() * 1000.) / CLOCKS_PER_SEC) << "ms\n";
	return 0;
}

void test_case() {
	int n, m;
	cin >> n >> m;
	vector < pii > v(n);
	for (auto &el: v) {
		cin >> el.first >> el.second;
	}
	sort(all(v));
	ll cost = 0;
	for (int i = 0; i < n; ++i) {
		int ded = min(v[i].second, m);
		m -= ded;
		cost += 1ll * ded * v[i].first;
	}
	cout << cost << "\n";
}

Measured memory_bytes: 1024
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;
 
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
 
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }
 
 
 
string str;
int main ()
{
    cin >> str;
    bool ok = false;
    if (str[0] == '9') ok = true;
    if (str[1] == '9') ok = true;
    if (ok) puts("Yes");
    else puts("No");
}
 
 
 
 

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <cstdio>
#include <string>
#include <cmath>
#include <queue>
#include <tuple>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <random>
#include <set>
#include <stack>

//#include <bits/stdc++.h>
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repr(i, n) for (int i = (n) - 1; i >= 0; i--)
#define FOR(i,i0,n) for(int (i)=(i0);(i)<(n);(i)++)
#define FORR(i,i0,n) for(int (i)=(n)-1; (i)>=(i0);(i)--)
#define SORT(x) sort(x.begin(),x.end())
#define SORTR(x) sort(x.begin(),x.end(),greater<int>())
#define rn return
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#include <time.h>
typedef std::pair<int,int> pii;
using namespace std;
using ll = long long;


int main(){
    int h,w;
    cin >> h >> w;
    const int mod = (int) 1e9 + 7;
    vector<string> g(h);
    rep(i,h) cin >> g[i];
    ll dp[h][w];
    memset(dp,0LL,sizeof dp);
    dp[0][0] = 1;
    for(int i = 0; i < h; i++){
        for(int j = 0; j < w; j++){
            if (g[i][j] == '#') continue;
            int pj = j-1;
            int pi = i-1;
            if (pj >= 0) dp[i][j] += dp[i][pj];
            if (pi >= 0) dp[i][j] += dp[pi][j];
            dp[i][j] %= mod;
        }
    }

    cout << dp[h-1][w-1];
    

}

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

int main(){
    string s;
    cin >> s;
    for(char c = 'a'; c <= 'z'; c++) {
        if(!(~s.find(c))) {
            cout << c << endl;
            exit(0);
        }
    }
    cout << "None" << endl;
}


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

#ifdef _PRINTDEBUG
  #include "lib/printdebug.hpp"
#else
  #define printdebug(...) 1
#endif
#define MOD_1_000_000_007 (1000000007)
#define IINF (1<<28)
#define LINF (1LL<<60)
#define rep(i, n)      REP(i, 0, (n))
#define repc(i, n)     REPC(i, 0, (n))
#define REP(i, n, m)   for (int i = (int)(n); i <  (int)(m); i++)
#define REPC(i, n, m)  for (int i = (int)(n); i <= (int)(m); i++)
#define REPCM(i, n, m) for (int i = (int)(n); i >= (int)(m); i--)
#define yesno(cond)       YESNO((cond), "Yes", "No")
#define YESNO(cond, a, b) cout << ((cond) ? (a) : (b)) << "\n"

namespace solver {
  using namespace std;
  typedef long long ll;

  int N, K, D[9];

  void init() {
    cin >> N >> K;
    rep(i, K) {
      cin >> D[i];
    }
  }

  bool satisfied(int n) {
    if(n == 0) return true;
    int last = n % 10;
    rep(i, K) if(last == D[i]) return false;
    return satisfied(n / 10);
  }

  void solve() {
    REP(i, N, 100000) if(satisfied(i)) {
      cout << i << "\n";
      return;
    }
  }
}

int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  solver::init();
  solver::solve();
  return 0;
}

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

int main() {
    ll N;
    cin >> N;
    if(N%2==0){
      cout << N << endl;
    } else {
      cout << 2*N << endl;
    }
}

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

long decompositPrime(long n);
long gcd(long a,long b);

int main(){

  long a,b;
  
  cin >> a >> b;
  
  cout << decompositPrime(gcd(a,b)) + 1 << endl;
    
    return 0;
}

long gcd(long a,long b){
  if(a < b){
    long t = a;
    a = b;
    b = t;
  }
  
  long r = a % b;
  while(r != 0){
    a = b;
    b = r;
    r = a%b;
  }
  return b;
}

long decompositPrime(long n)
{
  	map<long,long> so;
    long a = 2;
    while (n >= a * a) {
        if (n % a == 0) {
            so[a]++;
            n /= a;
        } else {
            a++;
        }
    }
  	if(n != 1)so[n]++;
  return so.size();
}



Measured memory_bytes: 256
#include "bits/stdc++.h"
#define fi first
#define se second
#define all(x) x.begin(), x.end()
using namespace std;
using ull = unsigned long long;
using ll = long long;
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;

int main(){
    int N;
    cin >> N;
    map<ll, int> count;
    ll remove = 0;
    for(int i = 0; i < N; i++){
        ll A;
        cin >> A;
        if(A > N){
            remove++;
        }else{
            count[A]++;
        }
    }
    for(auto p : count){
        ll x = p.first;
        int y = p.second;
        if(y >= x){
            remove += y - x;
        }else{
            remove += y;
        }
    }
    cout << remove << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <bitset>
#include<vector>
#include<utility>
#include<fstream>
#include<queue>
#include <iomanip>
#include<numeric>
#include<set>
using namespace std;
typedef long long ll;
#define rep(i,k) for(i=0;i<k;i++)
#define P pair<ll,ll>
ll mod = 1000000007;
P p[200005];

ll i, b[1005], c, k, j, n, m, z = 0, mi = 0, t, cc, th;
ll a;
vector<ll> va, vb, vc, vj;
string s;
char ca[10000];
priority_queue<ll> q;




int main() {
	cin >> c>>t;
	if (c <= (2 * t)) cout << 0;
	else cout << c - (2 * t);



	return 0;
}

Measured memory_bytes: 256
import java.io.*;
import java.util.*;
 
public class Main {
 
	static long mod = (long) 1e9 + 7;
	static PrintWriter out = new PrintWriter(System.out);
	static Reader scn = new Reader();
 
	public static void main(String[] args) throws IOException {
		StringBuilder king = new StringBuilder();
		int r = scn.nextInt();
		out.println(2 * Math.PI * r);
		out.flush();
	}
 
	public static class Reader {
 
		final private int BUFFER_SIZE = 1 << 16;
		private DataInputStream din;
		private byte[] buffer;
		private int bufferPointer, bytesRead;
 
		public Reader() {
			din = new DataInputStream(System.in);
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = bytesRead = 0;
		}
 
		public Reader(String file_name) throws IOException {
			din = new DataInputStream(new FileInputStream(file_name));
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = bytesRead = 0;
		}
 
		public String readLine() throws IOException {
			byte[] buf = new byte[100000 + 1];
			int cnt = 0, c;
			while ((c = read()) != -1) {
				if (c == '\n')
					break;
				buf[cnt++] = (byte) c;
			}
			return new String(buf, 0, cnt);
		}
 
		public int nextInt() throws IOException {
			int ret = 0;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();
			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');
			if (neg)
				return -ret;
			return ret;
		}
 
		public long nextLong() throws IOException {
			long ret = 0;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();
			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');
			if (neg)
				return -ret;
			return ret;
		}
 
		public double nextDouble() throws IOException {
			double ret = 0, div = 1;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();
 
			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');
 
			if (c == '.')
				while ((c = read()) >= '0' && c <= '9')
					ret += (c - '0') / (div *= 10);
			if (neg)
				return -ret;
			return ret;
		}
 
		private void fillBuffer() throws IOException {
			bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
			if (bytesRead == -1)
				buffer[0] = -1;
		}
 
		private byte read() throws IOException {
			if (bufferPointer == bytesRead)
				fillBuffer();
			return buffer[bufferPointer++];
		}
 
		public void close() throws IOException {
			if (din == null)
				return;
			din.close();
		}
 
		public int[] nextIntArray(int n) throws IOException {
			int[] arr = new int[n];
			for (int i = 0; i < n; i++)
				arr[i] = nextInt();
			return arr;
		}
 
		public long[] nextLongArray(int n) throws IOException {
			long[] arr = new long[n];
			for (int i = 0; i < n; i++)
				arr[i] = nextLong();
			return arr;
		}
 
		public int[][] nextInt2DArray(int m, int n) throws IOException {
			int[][] arr = new int[m][n];
			for (int i = 0; i < m; i++)
				for (int j = 0; j < n; j++)
					arr[i][j] = nextInt();
			return arr;
		}
	}
}

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

int main(){
	double xa,ya,ra,xb,yb,rb;
	int n;
	cin>>n;
	while(n--){
		cin>>xa>>ya>>ra>>xb>>yb>>rb;
		double d = sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb));
		if(d+rb < ra)cout<<2;
		else if(d+ra < rb)cout<<-2;
		else if(d <= ra+rb)cout<<1;
		else cout<<0;
		cout<<endl;
	}
	return 0;
}

Measured memory_bytes: 1232
#include <iostream>
#include <string>
#include <cmath>

using namespace std;

int main()

{
    int n;
    cin >> n;
    /*for (int i = 1; i <= 100; i++)
    {
        int count = 0;

        for (int j = 1; j <= (2 * i - 1); j++)
        {
            if ((2 * i - 1) % j == 0)
            {
                count += 1;
            }
            if (count == 8)
            {
                cout << 2 * i - 1 << endl;
                break;
            }
        }
    }*/
    if (n < 105)
    {
        cout << 0;
    }
    else if (n < 135)
    {
        cout << 1;
    }
    else if (n < 165)
    {
        cout << 2;
    }
    else if (n < 189)
    {
        cout << 3;
    }
    else if (n < 195)
    {
        cout << 4;
    }
    else if (n < 201)
    {
        cout << 5;
    }
}


Measured memory_bytes: 256
#pragma once
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <deque>
typedef long long ll;
using namespace std;

const int INF = 10e8;
int table[9][9];
bool used[9];
int n;
int count(int v,int c) {

	if (c == n) {
		return 1;
	}
	int res = 0;
	for (size_t i = 1; i <= n; i++)
	{
		if (!used[i] && table[v][i] == 1) {
			used[i] = true;
			res += count(i, c + 1);
			used[i] = false;
		}
	}
	return res;
}
void OnestrokePath(){
	int m;
	cin >> n >> m;
	for (size_t i = 0; i < m; i++)
	{
		int a, b;
		cin >> a >> b;
		table[a][b] = 1;
		table[b][a] = 1;
	}
	used[1] = true;
	cout << count(1, 1) << endl;
}

int main() {
	OnestrokePath();
	return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define rep(i,k,n) for (ll i = k; i < n; ++i)
#define inputar(a,n) ll a[n];rep(i,0,n)cin>>a[i]
#define PI 3.14159265
const int MOD=1e9+7;
const int N=1e5+5;


#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(a)  (a).begin(),(a).end()

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

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

int main()
{
    IOS;
    string s;
    cin>>s;
    if(s=="A") cout<<"T"<<endl;
    else if(s=="C") cout<<"G"<<endl;
    else if(s=="T") cout<<"A"<<endl;
    else if(s=="G") cout<<"C"<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define f(a, n) for (int a=0; a<n; a++)
#define F(a, n) for (int a=1; a<=n; a++)
using namespace std;
map<int, int> mp;
vector<int> V;
int n, k, x, cnt;
int main(){
	cin>>n>>k;
	f(i, n) {
		cin>>x;
		mp[x]++;
	}
	for (auto x: mp){
		V.push_back(x.second);
	}
	sort (V.begin(), V.end());
	F(i, min(k, (int)V.size())){
		cnt += V[V.size() - i];
	}
	cout<<n-cnt<<endl;
}


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

int main() {
	string s;
	cin >> s;
	int n = s.size();
	vector<int> ans(n);
	int r = 0;
	rep(i, n) {
		if(s[i] == 'R') {
			r++;
		} else {
			ans[i] += r/2;
			ans[i-1] += (r+1)/2;
			r = 0;
		}
	}
	int l = 0;
	for(int i = n-1; i >= 0; i--) {
		if(s[i] == 'L') {
			l++;
		} else {
			ans[i] += l/2;
			ans[i+1] += (l+1)/2;
			l = 0;
		}
	}
	rep(i, n) printf("%d%c", ans[i], (i==n-1) ? '\n' : ' ');
	return 0;
}

Measured memory_bytes: 1024
#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<map>
#include<tuple>
#include<algorithm>
#include<cmath>
#include<limits>
#include<set>
#include<queue>
using namespace std;
#define int long  long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
typedef pair<int, int>P;
const int INF = 1e8;

signed main() {
	int X;
	cin >> X;
	if (X == 1) {
		cout << 1;
		return 0;
	}
	priority_queue<int>q;
	int num;
	for(int i=2;i * i<=X;i++){
		int j = 2;
		while (1) {
			num = pow(i, j);
			if (num > X)break;
			q.push(num);
			j++;
		}
	}
	cout << q.top();
}

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

#define check cout<<"-------"<<endl
#define debug(x) cout<<x<<endl;
#define loop(i,x,n) for(int i = x; i < n; i++)
#define lop(i,n) repi(i,0,n)
#define fix(x) cout<<fixed<<setprecision(x);

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++) {
                cout<<'#';
            }
            cout<<endl;
        }
        cout<<endl;
    }
    
    return 0;
}


Measured memory_bytes: 3084
#include <bits/stdc++.h>
#define ALL(a)  (a).begin(),(a).end()
using namespace std;
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;
template <typename T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template <typename T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;
const int INT_INF = 1 << 30;
#define MOD 1000000007LL
#define endl "\n"

int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);

  ll K;
  cin >> K;
  cout << 50 << endl;
  ll num = 49LL + K / 50LL;
  vll a(50, num);
  ll d = K % 50LL;
  for(int i = 0; i < 50; i++){
    ll plus = 51 - d;
    if(i < d) a.at(i) += plus;
    else a.at(i) -= d;
  }
  for(int i = 0; i < 50; i++){
    cout << a.at(i);
    if(i != 49) cout << ' ';
    else cout << endl;
  }
  
  /* 実験
  priority_queue<ll> que1;
  for(int i = 0; i < 50; i++){
    que1.push(100);
  }
  int counter = 0;
  while(que1.top() > 49){
    priority_queue<ll> que2;
    que2.push(que1.top() - 50);
    que1.pop();
    while(!que1.empty()){
      que2.push(que1.top() + 1);
      que1.pop();
    }
    counter++;
    if(!que1.empty()) cout << "error" << endl;
    que1 = que2;
  }
  cout << counter << endl;
  */
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(void)
{
	long long N;
	scanf("%lld",&N);
	for(long long h=1;h<=3500;h++)
	{
		for(long long w=1;w<=3500;w++)
		{
			long long temp=N*h*w;
			long long temp2=4*h*w-N*w-N*h;
			if(temp2>0&&temp%temp2==0)
			{
				printf("%lld %lld %lld\n",h,temp/temp2,w);
				return 0;
			}
		}
	}
	return 0;
}

Measured memory_bytes: 256
// atcoder/abc050/B/main.cpp
// author: @___Johniel
// github: https://github.com/johniel/

#include <bits/stdc++.h>

#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))

using namespace std;

typedef long long int lli;
typedef unsigned long long ull;
typedef complex<double> point;

template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << "," << p.second << ")"; return os; }
template<typename P, typename Q> istream& operator >> (istream& is, pair<P, Q>& p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; each (i, v) os << i << ","; os << ")"; return os; }
template<typename T> istream& operator >> (istream& is, vector<T>& v) { each (i, v) is >> i; return is; }

template<typename T> inline T setmax(T& a, T b) { return a = std::max(a, b); }
template<typename T> inline T setmin(T& a, T b) { return a = std::min(a, b); }

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

  int n;
  while (cin >> n) {
    vector<int> t(n);
    cin >> t;
    int m;
    cin >> m;
    vector<pair<int, int>> v(m);
    cin >> v;
    lli sum = accumulate(t.begin(), t.end(), 0LL);
    each (i, v) {
      --i.first;
      cout << sum - t[i.first] + i.second << endl;
    }
  }

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
int main(){

long double A, B, H, M, hk, mk, k, ans;
cin >> A >> B >> H >> M;
//なんにも考えずに全部doubleで定義して入力
//hkは分針の角度,mkは時針の角度,kはその差で,ansが答え出力用

mk = M * 6;
hk = H * 30;
hk = hk + mk/12;
k = fabs(hk - mk);
//ここまでで時計の針の角度を算出

k = k*(2*M_PI/360);
//角度をラジアンに変換
ans = 2 * A * B * cos(k);
A = A * A;
B = B * B;
ans = A + B - ans;
//ここまで余弦定理(c^2=a^2+b^2-2ab cos(a))
ans = sqrt(ans);
//平方根が答え

 printf("%.10Lf\n", ans);

}

Measured memory_bytes: 4156
A, B = map(int, input().split())
digits = len(format(B, 'b'))
def func(x):
    low = x // 4 * 4
    from functools import reduce
    ret = reduce(lambda x, y: x ^ y, range(low, x + 1))
    return ret

ans = func(B) ^ func(A - 1)

print(ans)

Measured memory_bytes: 3572