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

template <typename T>
T BinarySearch(T lo, T hi, std::function<bool(T)> pred) {
  while (lo + 1 < hi) {
    T mid = (hi - lo) / 2 + lo;
    if (pred(mid)) {
      lo = mid;
    } else {
      hi = mid;
    }
  }
  return lo;
}

// #undef DEBUG  // Uncomment this line to forcefully disable debug print.
#if DEBUG
template <typename T>
void debug(T value) {
  std::cerr << value;
}
template <typename T, typename... Ts>
void debug(T value, Ts... args) {
  std::cerr << value << ", ";
  debug(args...);
}
#define dbg(...)                              \
  do {                                        \
    cerr << #__VA_ARGS__ << ": ";             \
    debug(__VA_ARGS__);                       \
    cerr << " (L" << __LINE__ << ")" << endl; \
  } while (0)
#else
#define dbg(...)
#endif

void read_from_cin() {}
template <typename T, typename... Ts>
void read_from_cin(T& value, Ts&... args) {
  std::cin >> value;
  read_from_cin(args...);
}
#define in(type, ...) \
  type __VA_ARGS__;   \
  read_from_cin(__VA_ARGS__);

template <typename T>
void write_to_cout(const T& value) {
  std::cout << value << std::endl;
}
template <typename T, typename... Ts>
void write_to_cout(const T& value, const Ts&... args) {
  std::cout << value << ' ';
  write_to_cout(args...);
}
#define out(...) write_to_cout(__VA_ARGS__);

#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)

using ll = long long;

using namespace std;

int main() {
  in(ll, n, k);
  vector<ll> a(n), f(n);
  rep(i, n) cin >> a[i];
  rep(i, n) cin >> f[i];
  sort(all(a));
  sort(all(f), greater<ll>());
  auto check = [&](ll x) {
    ll training = 0;
    rep(i, n) {
      if (a[i] * f[i] > x) {
        training += a[i] - x / f[i];
      }
    }
    return training > k;
  };
  ll x = BinarySearch<ll>(0, 1e12L+1, check);
  if (!check(x)) {
    out(x);
  } else {
    out(x + 1);
  }
}


Measured memory_bytes: 3328
n = int(input())
c = []
s = []
f = []

for i in range(n-1):
    tc,ts,tf = map(int,input().split(' '))
    c.append(tc)
    s.append(ts)
    f.append(tf)

ans = []
for i in range(n-1):
#    print(i)
    time=s[i]+c[i]
    for j in range(i+1,n-1):
#        print(time)
#        print(max(s[j],(((time-0.1)/f[j])+1)*f[j]))
        time = max(s[j],(int((time-0.1)/f[j])+1)*f[j]) + c[j]
    ans.append(time)

ans.append(0)

for i in range(len(ans)):
    print(ans[i])


Measured memory_bytes: 3188
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef long long ll;
using namespace std;
int main()
{
  int X, Y;
  cin >> X >> Y;
  for (int i = 0; i <= X; i++)
  {
    if (2 * i + 4 * (X - i) == Y)
    {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 3636
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
struct student
{
	int i;
	int ai;
};
student stu[100010];

bool cmp(student& a, student& b)
{
	return a.ai < b.ai;
}

int main()
{
	int n;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		stu[i].i = i + 1;
		cin >> stu[i].ai;
	}
	sort(stu, stu + n, cmp);
	for (int i = 0; i < n; i++)
	{
		cout << stu[i].i << " ";
	}
}

Measured memory_bytes: 1536
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int A = scanner.nextInt();
		int B = scanner.nextInt();
		int C = scanner.nextInt();
		int[] num = {A,B,C};	
	
		Arrays.sort(num);	
		System.out.println(num[0]+num[1]+num[2]*10);		
	}
}

Measured memory_bytes: 21588
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define rep(i, n) for(int i=0;i<n;++i)
#define rrep(i, n) for(int i=n;i>=0;--i)
const int inf=1e9+7;
const ll mod=1e9+7;
const ll mod1=998244353;
const ll big=1e18;
const double PI=2*asin(1);

int main() {
  int C[3][3];
  for(int i=0;i<3;++i) {
    for(int j=0;j<3;++j) {
      cin>>C[i][j];
    }
  }
  bool can = true;
  int sum = 0;
  for(int i=0;i<3;++i) {
    for(int j=0;j<3;++j) {
      sum += C[i][j];
    }
  }
  if(sum%3!=0) can = false;
  sum = 0;
  for(int i=0;i<2;++i) {
    for(int j=0;j<2;++j) {
      sum += C[i][j];
    }
  }
  if(sum%2!=0) can = false;
  sum = 0;
  for(int i=1;i<3;++i) {
    for(int j=0;j<2;++j) {
      sum += C[i][j];
    }
  }
  if(sum%2!=0) can = false;
  sum = 0;
  for(int i=1;i<3;++i) {
    for(int j=1;j<3;++j) {
      sum += C[i][j];
    }
  }
  if(sum%2!=0) can = false;
  sum = 0;
  for(int i=0;i<2;++i) {
    for(int j=1;j<3;++j) {
      sum += C[i][j];
    }
  }
  if(sum%2!=0) can = false;
  if(can) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}



Measured memory_bytes: 3612
require 'set'

def main(str)
  k = str.to_i
  currents = Set.new([1, 2, 3, 4, 5, 6, 7, 8, 9])
  results = currents
  loop do
    nexts = Set.new
    currents.each do |x|
      m = x % 10
      n = 10 * x
      case m
      when 0
        nexts << n + 0
        nexts << n + 1
      when 9
        nexts << n + 9
        nexts << n + 8
      else
        nexts << n + m + 1
        nexts << n + m
        nexts << n + m - 1
      end
    end
    results += nexts
    currents = nexts
    break  if results.length > 10 ** 5
  end
  results.sort[k - 1]
end

puts main($stdin.read.chomp)

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

#if defined(DEBUG)

#include <unistd.h>
#include <sys/fcntl.h>
#define DLOG(...)        cerr << dbgFormat(__VA_ARGS__) << endl
#define DCALL(func, ...) func(__VA_ARGS__)

template <class... Args>
string dbgFormat(const char* fmt, Args... args) {
  size_t len = snprintf(nullptr, 0, fmt, args...);
  char buf[len + 1];
  snprintf(buf, len + 1, fmt, args...);
  return string(buf);
}

#else  // defined(DEBUG)

#define DLOG(...)
#define DCALL(func, ...)

#endif // defined(DEBUG)

int main(int argc, char *argv[]) {
#if defined(DEBUG)
  // GDB on Cygwin ignores redirection at run command.
  if (argc == 2) dup2(open(argv[1], 0), 0);
#else
  // For performance.  We should not use C-style stdio functions
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
#endif
  cout << setprecision(20);

  int M, D;
  cin >> M >> D;
  int ans = 0;
  for (int d1 = 2; d1 <= 9; d1++) {
    for (int d0 = 2; d0 <= 9; d0++) {
      int d = d1 * 10 + d0;
      if (d > D) break;
      if (d1 * d0 <= M) ans++;
    }
  }
  cout << ans << endl;

  return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<queue>
#include<stack>
using namespace std;
#define MOD 1000000007
#define INF (1<<29)
#define LINF (1LL<<60)
#define EPS (1e-10)
typedef long long Int;
typedef pair<Int, Int> P;


Int n, k;
int main(){
    cin >> n >> k;
    cout << n - k + 1 << endl;
    return 0;
}


Measured memory_bytes: 256
def last_word?(cur)
  @lines[cur[0]].size == cur[1]
end

def last_line?(cur)
  cur[0] == @lines.size - 1
end

buf = ''
cur = [0, 0]
@lines = []
while l = gets.chomp
  break if l == 'END_OF_TEXT'
  @lines << l
end

while cmd = gets.chomp
  break if cmd == '-'
  case cmd
  when 'a'
    cur[1] = 0
  when 'e'
    cur[1] = @lines[cur[0]].size
  when 'p'
    cur[0] == 0 ? cur[1] = 0 : cur = [cur[0] - 1, 0]
  when 'n'
    last_line?(cur) ? cur[1] = 0 : cur = [cur[0] + 1, 0]
  when 'f'
    unless last_word?(cur)
      cur[1] += 1
    else
      unless last_line?(cur)
        cur = [cur[0] + 1, 0]
      end
    end
  when 'b'
    if cur[1] != 0
      cur[1] -= 1
    else
      if cur[0] != 0
        cur = [cur[0] - 1, @lines[cur[0] - 1].size]
      end
    end
  when 'd'
    if last_word?(cur) && !last_line?(cur)
      l = @lines.delete_at(cur[0] + 1)
      @lines[cur[0]] += l
    elsif !last_word?(cur)
      @lines[cur[0]].slice!(cur[1])
    end
  when 'k'
    if last_word?(cur) && !last_line?(cur)
      l = @lines.delete_at(cur[0] + 1)
      @lines[cur[0]] += l
      buf = "\\n"
    elsif !last_word?(cur)
      buf = @lines[cur[0]].slice!(cur[1]..-1)
    end
  when 'y'
    if buf == "\\n"
      @lines.insert(cur[0] + 1, @lines[cur[0]].slice!(cur[1]..-1))
      cur = [cur[0] + 1, 0]
    elsif buf != ''
      @lines[cur[0]].insert(cur[1], buf)
      cur[1] += buf.size
    end
  end
end

puts @lines

Measured memory_bytes: 8736
#include<algorithm>
#include<cstring>
#include<cctype>
#include<cstdio>
#define rep(i,x,y) for(int i=x; i<=y; ++i)
#define repd(i,x,y) for(int i=x; i>=y; --i)

using namespace std;
const int N=10005,mod=998244353;
char sa[N],sb[N];
typedef long long LL;
int n,m,len,bin[N<<2];
LL a[N<<2],b[N<<2],c[N<<2],G[N<<2],wn[15][50005],flv[N<<2],ans;
LL inva[N<<2],inv[N<<2],A[N<<2],_a[N<<2],f[N<<2],g[N<<2],h[N<<2];

LL getmi(LL a,LL x)
{
    LL rt=1;
    while(x)
    {
        if(x&1) rt=rt*a%mod;
        a=a*a%mod,x>>=1;
    }
    return rt;
}
 
void FFT(LL a[],int len,int tp)
{
    rep(i,0,len-1) bin[i]=bin[i>>1]>>1|((i&1)*(len>>1));
    rep(i,0,len-1) if(i<bin[i]) swap(a[i],a[bin[i]]);
    for(int i=1,cnt=0; i<len; ++cnt,i<<=1)
    {
        for(int j=0; j<len; j+=i<<1)
        {
            LL w=i,x,y;
            rep(k,0,i-1)
            {
                x=a[j+k],y=a[i+j+k]*wn[cnt][w],w+=tp;
                a[j+k]=(x+y)%mod,a[i+j+k]=(x-y)%mod;
            }
        }
    }
    if(tp==-1)
    {
        LL x=getmi(len,mod-2);
        rep(i,0,len-1) a[i]=a[i]*x%mod;
    }
}
 
void get_inv(LL a[],LL b[],int n)
{
    if(n==1)
    {
        b[0]=getmi(a[0],mod-2);
        return;
    }
    get_inv(a,b,n>>1);
    rep(i,0,n-1) G[i]=a[i];
    rep(i,n,2*n-1) G[i]=0;
    FFT(G,n<<1,1),FFT(b,n<<1,1);
    rep(i,0,2*n-1) b[i]=b[i]*(2-b[i]*G[i]%mod)%mod;
    FFT(b,n<<1,-1);
    rep(i,n,2*n-1) b[i]=0;
} 
 
void get_ln(LL a[],LL b[],int n)
{
    rep(i,0,2*n-1) inva[i]=_a[i]=0;
    get_inv(a,inva,n);
    rep(i,0,n-2) _a[i]=a[i+1]*(i+1)%mod;
    _a[n-1]=0,FFT(inva,n<<1,1),FFT(_a,n<<1,1);
    rep(i,0,2*n-1) b[i]=inva[i]*_a[i]%mod;
    FFT(b,n<<1,-1);
    rep(i,n,2*n-1) b[i]=0;
    repd(i,n-1,1) b[i]=b[i-1]*inv[i]%mod;
    b[0]=0;
}
 
void get_exp(LL a[],LL b[],int n)
{
    if(n==1)
    {
        b[0]=1;
        return;
    }
    get_exp(a,b,n>>1);
    rep(i,0,2*n-1) A[i]=0;
    get_ln(b,A,n);
    rep(i,0,n-1) A[i]=(a[i]-A[i])%mod;
    A[0]=(A[0]+1)%mod;
    FFT(b,n<<1,1),FFT(A,n<<1,1);
    rep(i,0,2*n-1) b[i]=b[i]*A[i]%mod;
    FFT(b,n<<1,-1);
    rep(i,n,2*n-1) b[i]=0;
}
 
void prepare()
{
	for(len=1; len<=n; len<<=1);
	flv[0]=1;
	int lim=max(len,n+m+1);
	rep(i,1,lim) flv[i]=flv[i-1]*i%mod;
	inv[lim]=getmi(flv[lim],mod-2);
	repd(i,lim,1) inv[i-1]=inv[i]*i%mod;   
	rep(i,0,14)
    {
        wn[i][1<<i]=1;
        LL w=getmi(3,(mod-1)/(1<<i+1));
        rep(j,1,(1<<i)-1) wn[i][(1<<i)+j]=wn[i][(1<<i)+j-1]*w%mod;
        w=getmi(w,mod-2);
        rep(j,1,(1<<i)-1) wn[i][(1<<i)-j]=wn[i][(1<<i)-j+1]*w%mod;
    }
}

int main()
{
	scanf("%s",sa+1);
	scanf("%s",sb+1);
	len=strlen(sa+1);
	rep(i,1,len) if(sa[i]=='1' && sb[i]=='1') ++n; else if(sa[i]=='1') ++m;
	prepare();
	rep(i,0,n) f[i]=inv[i+1];
	rep(i,0,len-1) inv[i]=getmi(i,mod-2);
	get_ln(f,g,len);
	rep(i,0,len-1) g[i]=g[i]*m%mod;
	get_exp(g,h,len);
	rep(i,0,n)
		ans=(ans+h[i])%mod;
	ans=ans*flv[n+m]%mod*flv[n]%mod*flv[m]%mod;
	printf("%lld\n",(ans+mod)%mod);
	return 0;
}	 

Measured memory_bytes: 8192
#include <bits/stdc++.h>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
using ll = long long;
using P = pair<ll, ll>;
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() {
    int n; cin >> n;
    map<string, int> mcnt;
    for(int i = 0; i < n; ++i) {
        string s; cin >> s;
        mcnt[s]++;
    }

    cout << "AC x " << mcnt["AC"] << endl;
    cout << "WA x " << mcnt["WA"] << endl;
    cout << "TLE x " << mcnt["TLE"] << endl;
    cout << "RE x " << mcnt["RE"] << endl;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main()
{
  string s;
  cin >> s;
  if (s <= "2019/04/30") {
    cout << "Heisei" << endl;
  } else {
    cout << "TBD" << endl;
  }
  return 0;

}


Measured memory_bytes: 256
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
# from fractions import gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))
ZIP = lambda: zip(*(MAP() for _ in range(n)))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    a = INPUT()

    for i in ascii_uppercase:
        if i == a:
            print("A")
            break
    else:
        print("a")


if __name__ == '__main__':
    main()


Measured memory_bytes: 9976
/*
author: Apoorv Singh
*/
 
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace std;
using namespace __gnu_pbds;
 
typedef vector <long long> vi;
typedef pair <long long, long long> pii;
#define pb push_back   
#define all(c) c.begin(), c.end()
#define For(i, a, b) for (long long i = a; i < b; ++i)
#define Forr(i, a, b) for (long long i = a; i > b; --i)
#define um unordered_map
#define F first
#define S second
#define int long long
#define inf LLONG_MAX
#define endl "\n"
#define min(a,b) (a < b ? a : b)
#define max(a,b) (a > b ? a : b)
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define _CRT_SECURE_NO_WARNINGS

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

template <class X>
void printarr(X arr[], int n) {
	for (int i = 0; i < n; ++i)
		cout << arr[i] << ' ';
	cout << endl;
}

template <typename X> ostream& operator << (ostream& x,const vector<X>& v){ for (X a : v) x << a << ' '; return x;} 
template <typename X, typename Y> ostream& operator << (ostream& x, const vector< pair<X, Y> >& v) {for (pair <X, Y> it : v) x << it.first << ' ' << it.second << endl; return x;} 
template <typename T, typename S> ostream& operator << (ostream& os, const map<T, S>& v) { for (pair <T, S> it : v) os << it.first << " => " << it.second << endl; return os; }
 
template <class T, class cmp = less<T>> using ordered_set = tree<T, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
 
int modulo = 1e9 + 7;

int fpow(int a, int n) {
	int ans = 1;
	while (n) {
		if (n&1) ans = (ans*a)%modulo;
		a = (a*a)%modulo; n = n >> 1;
	}
	return ans;
}

signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int n; cin >> n;
	cout << (n*(n-1))/2;
	return 0;
}

Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
#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++)

#include <bits/stdc++.h>
using namespace std;



int main() {
    long long X;

    cin >> X;

    long long gohyaku = X / 500;
    long long goen = (X%500)/5;

    cout << gohyaku*1000+goen*5 << endl;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define REP(i,a) for(int i = 0; i < (a);i++)
#define ALL(a) (a).begin(),(a).end()
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const int MOD = 1e9 + 7;
using Graph = vector < vector<int>>;
/*第二引数で第一引数を割ったときの切り上げの計算*/
long long int maxtime(long long int x, long long int y) {
	return(x + y - 1) / y;

}
/*最大公約数*/
long long int lcm(long long int number1, long long int number2) {
	long long int m = number1;
	long long int n = number2;

	if (number2 > number1) {
		m = number2;
		n = number1;
	}
	long long int s = -1;
	while (s != 0) {
		s = m % n;
		m = n;
		n = s;
	}
	return m;
}
/*最大公倍数*/
long long int gcd(long long int number1, long long int number2) {
	long long int m = number1;
	long long int n = number2;
	return m / lcm(m, n) * n;
}
int k[100030];
int s[100030];
int main() {
	int N;
	cin >> N;
	vector<string> S(N);
	vector<int> K(N);
	double sum = 0;
	for (int i = 0; i < N; i++) {
		string a;
		double b;
		cin >> b >> a;
		if (a == "BTC") {
			sum = sum + 380000 * b;
		}
		else {
			sum = sum + b;
		}
	}
	cout << sum;
}


Measured memory_bytes: 256
import sys
input = sys.stdin.readline

N = int(input())

Slist = []
for i in range(N):
    Slist.append(input())
    # if S in Slist.keys():
    #     Slist[S] += 1
    #     if Slist[S] > maxNum:
    #         maxNum = Slist[S]
    # else:
    #     Slist[S] = 1
Slist.sort()

max_cnt = 1
cnt = 1
s_old = Slist[0]
max_Slist = []

for i in range(1,N):
    if Slist[i] == s_old:
        cnt += 1
    else:
        if cnt > max_cnt:
            max_cnt = cnt
            max_Slist = [s_old]
        elif cnt == max_cnt:
            max_Slist.append(s_old)
        s_old = Slist[i]
        cnt = 1

if Slist[N-1] == s_old:
    if cnt > max_cnt:
        max_Slist = [s_old]
    elif cnt == max_cnt:
        max_Slist.append(s_old)

for str in max_Slist:
    print(str)


Measured memory_bytes: 72016
#include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stdio.h>
#include <string>
#include <vector>

#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using LP = pair<ll, ll>;
const double PI = 3.1415926535897932;


int main()
{
	int N, K;
	cin >> N >> K;

	int ans = 0;
	while (N > 0) {
		N = N / K;
		ans++;
	}

	cout << ans << endl;

	return 0;
} 

Measured memory_bytes: 3564
#define ffor(i,a,b) for (int i=(a);i<(b);i++)
#define rfor(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define rep(i,n) for (int i=0;i<(n);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cmath>
#include<string>
#include<stack>
#include<queue>
#define SIZE 100001
#define MOD 1000000007
#define INF 100000000
using namespace std;

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

	int a,b,c;
	cin >>  a >> b >> c;

	if((b-a) == (c-b))
	{
		cout << "YES" << endl;
	}
	else cout << "NO" << endl;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,m,i;
  cin>>n>>m;
  int u[n],a[m];
  memset(u,0,sizeof(u));
  for(i=0;i<m;i++) scanf("%d",a+i);
  for(i=m-1;i>=0;i--)
    if(!u[a[i]-1])  printf("%d\n",a[i]),u[a[i]-1]=1;
  for(i=0;i<n;i++) if(!u[i]) printf("%d\n",i+1);
  return 0;
}

Measured memory_bytes: 4392
#include <iostream>
#include <string>
#include <cstring>
#include <vector>
#include <numeric>
#include <cstdlib>
#include <map>
#include <set>
#include <algorithm>
#include <math.h>

using namespace std;

int main(){
    int N;

    cin >> N;

    int sum = 0;

    for(int i = 1; i <= N; i++){
        int count = 0;
        for(int j = 1; j <= i; j++){
            if(i%j == 0){
                count++;
            }
        }
        if(count == 8 && i%2 == 1){
            sum++;
        }
    }

    cout << sum << endl;
 
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

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

    private void run() {
        Scanner scanner = new Scanner(System.in);
        String number = scanner.next();
        if((number.charAt(0) == number.charAt(1) && number.charAt(1) == number.charAt(2)) ||
                (number.charAt(1) == number.charAt(2) && number.charAt(2) == number.charAt(3))
        ) {
            System.out.println("Yes");
            return;
        }
        System.out.println("No");
    }
}

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

int main()
{
    stack<int> entry,exits,out;
    int n;
    while(cin>>n)
    {
        if(n)
        {
            entry.push(n);
        }
        else
        {
            exits.push(entry.top());
            entry.pop();
        }
    }
    while(!exits.empty())
    {
        out.push(exits.top());
        exits.pop();
    }
    while(!out.empty())
    {
        cout<<out.top()<<endl;
        out.pop();
    }
    return 0;
}

Measured memory_bytes: 1200
#include <bits/stdc++.h>
#define ALL(obj) begin(obj), end(obj)
#define debug(x) cerr << #x << ": " << x << '\n'
using namespace std;
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...));
}
template <class T>
bool chmax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return 1;
    }
    return 0;
}

using ll = long long;
using ull = unsigned long long;
const int INF = 1e9;
// const int MOD = 1e9 + 7;

using P = pair<ll, ll>;
int main() {
    ll N, K;
    cin >> N >> K;
    vector<P> p(N);
    for (int i = 0; i < N; i++) {
        int a, b;
        cin >> a >> b;
        p[i] = P(a, b);
    }
    sort(ALL(p));
    ll now = 0;
    for (int i = 0; i < N; i++) {
        if (now < K && K <= now + p[i].second) {
            cout << p[i].first << endl;
            return 0;
        } else {
            now += p[i].second;
        }
    }
}


Measured memory_bytes: 1792
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#pragma warning( disable:4996 )
#define SWAP(a,b) (a += b,b = a - b,a -= b)
#define MIN(a, b) ((a) < (b) ? (a) : (b))
int mypow(int a, int b) {
	int ans = 1;
	for (; b > 0; b--) {
		ans *= a;
	}
	return ans;
}
int main(void) {
	
	
	int n, m;
	int k[11];
	int s[11][11];
	int p[11];
	scanf("%d %d", &n, &m);
	for (int i = 0; i < m; i++) {
		scanf("%d", &k[i]);
		for (int j = 0; j < k[i]; j++) {
			scanf("%d", &s[i][j]);
		}

	}
	for (int i = 0; i < m; i++) {
		scanf("%d", &p[i]);
	}
	int ans = 0;
	for (int i = 0; i < mypow(2, n); i++) {//all pattern
		for (int j = 0; j < m; j++) {//all light
			int swcount = 0;
			for (int h = 0; h < k[j]; h++) {//all need switch
				if (((mypow(2, s[j][h] - 1)) & i) > 0) {
					swcount++;
				}
			}
			if (swcount % 2 != p[j])goto bad;
		}
		ans++;
bad:
		continue;
		
	}
	printf("%d\n", ans);
}

Measured memory_bytes: 128
use proconio::input;

#[allow(unused_imports)]
use std::collections::HashSet;

use std::cmp;


fn main() {
    input! {
        n: usize,
        k: usize,
    }
    solve(n, k);
}


fn prepare(m: usize, k: usize, p :u64) -> Vec<Vec<u64>> {
    let mut v : Vec<Vec<u64>> = Vec::<Vec<u64>>::with_capacity(m + 1);
    let v0 : Vec<u64> = vec![1; 1];
    v.push(v0);
    for i in 1..m+1 {
        let mut vi : Vec<u64> = vec![0; i+1];
        for j in 0..i/2+1 {
            vi[j] = 
            if j == 0 {
                1
            } else {
                (v[i-1][j-1] + v[i-1][j]) % p
            };
            vi[i-j] = vi[j];
        }
        v.push(vi);
    }
    return v;
}

fn solve(n: usize, k: usize) {
    let p : u64 = (10u32.pow(9u32) + 7) as u64;

    // 1. Calculate values of combinations
    let m = cmp::max(k-1, n-k+1);
    let c = prepare(m, k, p);

    // 2. Calculate possible ways
    for i in 1..k+1 {
        let b = c[k-1][i-1];
        let r = if i > n-k+1 { 
            0
        } else {
            c[n-k+1][i]
        };
        let t = b * r % p;
        println!("{}", t);
    }
}


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

//最大公約数を求める
long gcd(long a, long b){
    if(b == 0){
        return a;
    }else{
        return gcd(b, a % b);
    }
}
 
int main(){

    long A, B;

    cin >> A;
    cin >> B;

    cout << (A * B) / gcd(A, B) << endl;

    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <list>
#include <map>     
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <iomanip>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define ld long double
#define rep(a,t) for(int a=0;a<t;a++) 
#define forever while(true)
#define Sort(a) sort(a.begin(),a.end())
#define Reverse(a) reverse(a.begin(),a.end())
#define pb push_back
int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	set<string>strs;
	int n;
	cin >> n;
	rep(i, n) {
		string how, word;
		cin >> how >> word;
		if (how[0] == 'i') { strs.insert(word); }
		else if(strs.find(word) != strs.end()){
			cout << "yes" << endl;
		}
		else {
			cout << "no" << endl;
		}
	}
	return 0;
}


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

typedef long long ll;

#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define tt int t; cin>>t; while(t--)
#define nl cout<<"\n";
#define sp cout<<" ";
#define rep(i, a, b) for(long long i=a; i<b; i++)

const int INF = 1e9 + 7;
const int MOD = 1e9 + 7;
double PI = 4*atan(1);

int main()
{
    optimize();

    int n, m, x, y;
    cin>> n>> m>> x>> y;

    int x1[n+1], y1[m+1];

    for(int i= 0; i<n; i++)
        cin>> x1[i];
    x1[n]= x;


    for(int i= 0; i<m; i++)
        cin>> y1[i];
    y1[m]= y;

    sort (x1, x1+n+1);
    sort (y1, y1+m+1);


    cout << (y1[0] -x1[n] > 0 ? "No War\n" :"War\n" );

    return 0;
}




Measured memory_bytes: 3648
#include <algorithm>
#include <climits>
#include <iostream>
#include <string>
#include <utility>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <iomanip>
#include <cmath>
#include <stack>
#define rep(i,n) for (int i=0; i<(n); ++i)
using namespace std;
using ll = long long int;

template <class T> ostream &operator<<(ostream &os, vector<T> &v) {
  for (auto i = v.begin(); i != v.end(); i++) {
    os << *i << " ";
  }
  return os;
}

const long long MOD = 1000000007;

int main(){
  int n;
  cin>>n;
  vector<ll> v(n);
  rep(i,n) cin>>v[i];
  ll ans = 0;
  rep(i,n) {
    if(v[v[i]-1]-1==i) {
      ans++;
    }
  }
  std::cout << ans/2 << std::endl;
  return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <array>
#include <deque>
#include <stack>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <numeric>
#include <utility>
#include <cmath>
#include <iomanip>
#include <cassert>
#include <complex>
#include <bitset>
#include <functional>

using namespace std;
using ll=long long int;

template <typename T>
T powint(T a, ll n) {
    T ret = 1;
    while (n > 0) {
        if (n & 1) ret *= a; 
        a *= a;
        n >>= 1;
    }
    return ret;
}

template <ll mod>
class ModInt {
private:
    ll num;
public:
    ModInt() {};
    ModInt(ll n) { num = n % mod; }
    ModInt inv() const { return powint(*this, mod-2); }
    explicit operator ll() const { return num; }

    ModInt& operator+=(const ModInt& a) {
        num += a.num; 
        if (num >= mod) num -= mod; 
        return *this;
    }
    ModInt& operator-=(const ModInt& a) {
        if (num < a.num) num += mod;
        num -= a.num;
        return *this;
    }
    ModInt& operator*=(const ModInt& a) {
        num = num * a.num % mod;
        return *this;
    }
    ModInt& operator/=(const ModInt& a) { return *this *= a.inv(); }
    friend ModInt operator+(const ModInt& a, const ModInt& b) { return ModInt(a) += b; }
    friend ModInt operator-(const ModInt& a, const ModInt& b) { return ModInt(a) -= b; }
    friend ModInt operator*(const ModInt& a, const ModInt& b) { return ModInt(a) *= b; }
    friend ModInt operator/(const ModInt& a, const ModInt& b) { return ModInt(a) /= b; }

    friend ostream& operator<<(ostream& os, const ModInt& a) { return os << a.num; }
    friend istream& operator>>(istream& is, ModInt& a) {
        ll tmp;
        is >> tmp;
        a.num = tmp % mod;
        return is;
    }
};
using mint = ModInt<998244353>;

int main() {
    int n;
    cin >> n;
    vector<int> d(n);
    for (auto &e: d) cin >> e;

    if (d[0] != 0) {
        cout << 0 << endl;
        return 0;
    }

    int m = *max_element(d.begin(), d.end());
    vector<int> a(m+1, 0);
    for (int i = 0; i < n; ++i) {
        a[d[i]]++;
    }

    if (a[0] != 1) {
        cout << 0 << endl;
        return 0;
    }

    mint ans = 1;
    for (int i = 1; i <= m; i++) {
        ans *= powint<mint>(a[i-1], a[i]);
    }
    
    cout << ans << endl;

    return 0;
}


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

using namespace std;

#define MAX_N 200000

typedef long long ll;

ll pow2(int n) {
    if (n == 0) return 1;
    else {
        ll x = pow2(n/2);
        if (n%2 == 0) return x*x;
        else return x*x*2;
    }
}

int main() {
    int N, i=0, j=0, mid, match=0;
    bool used[MAX_N] = {0};
    ll target=pow2(30);
    scanf("%d",&N);
    ll A[N];
    for (i=0; i<N; i++) {
        scanf("%lld",&A[i]);
    }
    sort(A,A+N,greater<ll>());
    while (target > 1) {
        target/=2;
        if (A[j] < target) continue;
        for ( ; A[j]>target && j < N; j++) {
            if (used[j]) continue;
            long low = lower_bound(A+mid,A+N,2*target-A[j],greater<ll>()) - A;
            long up = upper_bound(A+mid,A+N,2*target-A[j],greater<ll>()) - A;
            for ( ; (used[low] || low == j) && low < up; low++);
            if (low == up) continue;
            match++;
            used[j] = true; used[low] = true;
        }
        mid = 0;
        for ( ; A[j] == target; j++) if (!used[j]) mid++;
        match += mid/2;
        i = j;
    }
    printf("%d\n",match);
}

Measured memory_bytes: 2048
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<sstream>
using namespace std;
int cnv(string str){
    int rec;
    stringstream ss(str);
    ss>>rec;
    return rec;
}
int main(){
    string str;
    int l;
    while(cin>>str>>l,l){
        map<string,int>M;
        M[str]=0;
        int cnt=1;
        while(true){
            while(str.length()<l)str="0"+str;
            sort(str.begin(),str.end());
            int v1,v2;
            v1=cnv(str);
            reverse(str.begin(),str.end());
            v2=cnv(str);
            int ans=v2-v1;
            stringstream ss;
            ss<<ans;
            ss>>str;
            if(M.find(str)!=M.end()){
                cout<<M[str]<<" "<<ans<<" "<<cnt-M[str]<<endl;
                break;
            }
            else{
                M[str]=cnt;
                cnt++;
            }
        }
    }
    return 0;
}

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

using namespace std;

#define MAX 10000
#define INFTY (1<<29)

class DisjointSet {
public:
	vector<int> rank, p;

	DisjointSet() {}
	DisjointSet(int size) {
		rank.resize(size, 0);
		p.resize(size, 0);
		for (int i = 0; i < size; i++)makeSet(i);
	}

	void makeSet(int x) {
		p[x] = x;
		rank[x] = 0;
	}

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

	void unite(int x, int y) {
		link(findSet(x), findSet(y));
	}

	void link(int x, int y) {
		if (rank[x] > rank[y]) {
			p[y] = x;
		}
		else {
			p[x] = y;
			if (rank[x] == rank[y]) {
				rank[y]++;
			}
		}
	}

	int findSet(int x) {
		if (x != p[x]) {
			p[x] = findSet(p[x]);
		}
		return p[x];
	}
};

class Edge {
public:
	int source, target, cost;
	Edge(int source = 0, int target = 0, int cost = 0):
	source(source),target(target),cost(cost){}
	bool operator<(const Edge &e)const {
		return cost < e.cost;
	}
};

int kruskal(int N, vector<Edge> edges) {
	int totalCost = 0;
	sort(edges.begin(), edges.end());

	DisjointSet dset = DisjointSet(N + 1);

	for (int i = 0; i < N; i++)dset.makeSet(i);

	int source, target;
	for (int i = 0; i < edges.size(); i++) {
		Edge e = edges[i];
		if (!dset.same(e.source, e.target)) {
			totalCost += e.cost;
			dset.unite(e.source, e.target);
		}
	}
	return totalCost;
}

int main() {
	int N, M, cost;
	int source, target;

	cin >> N >> M;

	vector<Edge> edges;
	for (int i = 0; i < M; i++) {
		cin >> source >> target >> cost;
		edges.push_back(Edge(source, target, cost));
	}

	cout << kruskal(N, edges) << endl;

	return 0;
}


Measured memory_bytes: 5424
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,l,r) for(long long i=(l);i<(r);++i)
#define REP(i,n) FOR(i,0,n)
#define int long long
const int MOD=1e9+7;
const int INF=1e15;

signed main(){
    int N,K,C;cin>>N>>K>>C;
    string S,Q;cin>>S;
    Q=S;
    reverse(Q.begin(),Q.end());
    vector<int>lvec;
    int j=0;
    for(int i=0;i<N&&j<K;i++){
        if(S[i]=='o'){
          	lvec.push_back(i+1);
            j++;
            i+=C;
        }
    }
    lvec.resize(j);
    vector<int>rvec;
    int k=0;
    for(int i=0;i<N&&k<K;i++){
        if(Q[i]=='o'){
            rvec.push_back(N-i);
            k++;
            i+=C;
        }
    }
    rvec.resize(k);
    reverse(rvec.begin(),rvec.end());
    REP(i,min(j,k)){
        if(lvec[i]==rvec[i]) cout<<lvec[i]<<endl;
    }
}

Measured memory_bytes: 5236
// ???????????????????????¶?????????

#include <cstdio>
#include <cmath>
#include <vector>

// double
struct P{
    P(){}
    P(double _r, double _i):r(_r), i(_i){}
    void real(const double& v){r = v;}
    void imag(const double& v){i = v;}
    double r, i;
};

double real(const P& p){return p.r;}
double imag(const P& p){return p.i;}
double norm(const P& p){double r = real(p), i = imag(p); return r * r + i * i;}
double dist(const P& p){return std::sqrt(norm(p));}

P operator+(const P& lhs, const P& rhs){
    return P(real(lhs)+real(rhs), imag(lhs)+imag(rhs));
}
P operator-(const P& lhs, const P& rhs){
    return P(real(lhs)-real(rhs), imag(lhs)-imag(rhs));
}
P operator-(const P& p){
    return P(-real(p), -imag(p));
}

double cross(const P& lhs, const P& rhs){
    return real(lhs)*imag(rhs) - imag(lhs)*real(rhs);
}

double dot(const P& lhs, const P& rhs){
    return real(lhs)*real(rhs) + imag(lhs)*imag(rhs);
}

const double EPS = 1e-9, D_THETA = 0.06, D_R = 0.06;

int N;
P ps[300];
std::vector<P> is;

void addIntersection(int i, int j){
    if(dist(ps[i]-ps[j]) > 2.0){return;}
    
    P m{(real(ps[j])-real(ps[i])) / 2, (imag(ps[j])-imag(ps[i])) / 2}, n{-imag(m), real(m)};
    {
        double d = dist(n);
        n.real(real(n) / d);
        n.imag(imag(n) / d);
    }

    double t = std::sqrt(1 - norm(m));
    for(int k=-1;k<=1;k+=2){
        P p{t * k * real(n), t * k * imag(n)};
        P q = ps[i] + m + p;
        // printf("%.6f, %.6f\n", real(q), imag(q));
        is.push_back(q);
    }
}

int count(P p){
    int res = 0;
    for(int i=0;i<N;i++){
        if(dist(ps[i]-p) < 1.0 + EPS){res++;}
    }
    return res;
}

int main(){
    while(scanf("%d", &N), N){
        is.clear();
        
        for(int i=0;i<N;i++){
            double x, y;
            scanf("%lf %lf", &x, &y);

            ps[i].real(x);
            ps[i].imag(y);
        }

        for(int i=0;i<N;i++){
            for(int j=i+1;j<N;j++){
                addIntersection(i, j);
            }
        }
        
        int res = 1;
        for(auto i : is){
            res = std::max(res, count(i));
        }

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

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

string shuffle(string str, int h){
    string head = str.substr(0, h);
    string tail = str.substr(h, str.size()-h);
    return tail + head;
}

int main(){
    string cards;
    int m, h;

    while(1){
        cin >> cards;
        if (cards == "-") break;

        cin >> m;
        
        for (int  i = 0; i < m; i++){
            cin >> h;
            cards = shuffle(cards, h);
        }
        cout << cards << endl;
    }

}



Measured memory_bytes: 3164
#include <bits/stdc++.h>
                 
    using namespace std;
                         
    #define pb push_back
    #define pi 3.14159265358979323846
    #define ll long long
    #define mp make_pair
    #define pf push_front
    #define MOD 1000000007
    #define MAX 100000000
    #define MIN -1000000000
    #define LLINF 0x3f3f3f3f3f3f    
    #define INF 0x3f3f3f3f
    #define ld long double
    #define MAXN 1010
    #define MAXM 1010

    int main()
    {
        ios_base::sync_with_stdio(false);
        cin.tie(NULL);
        cout.tie(NULL);
        int d, t, s;
        cin >> d >> t  >> s;
        if(s*t >= d){	
        	cout << "Yes" << endl;
        }else{	
        	cout << "No" << endl;
        }
        return 0;
    }


Measured memory_bytes: 3640
import math
n=int(input())
na=int(math.sqrt(n))
ans=[0]*(n+1)
for x in range(1,na+1):
  for y in range(1,na+1):
    for z in range(1,na+1):
      k=x**2+y**2+z**2+x*y+y*z+z*x
      if k<=n:
        ans[k]+=1
for i in range(1,n+1):
  print(ans[i])

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

#define endl '\n'
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define test cout<<"test"<<endl;
#define fi first
#define se second
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define rep(i,n,m) for(ll i = n; i < (ll)(m); i++)
#define rrep(i,n,m) for(ll i = m - 1; i >= (ll)(n); i--)
using ll = long long;
using ld = long double;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const ll INF = 1e18;
using P = pair<ll, ll>;
template<typename T>
void chmin(T &a,T b){if(a>b)a=b;}
template<typename T>
void chmax(T &a,T b){if(a<b)a=b;}
void pmod(ll &a,ll b){a=(a+b)%MOD;}
void pmod(ll &a,ll b,ll c){a=(b+c)%MOD;}
void qmod(ll &a,ll b){a=(a*b)%MOD;}
void qmod(ll &a,ll b,ll c){a=(b*c)%MOD;}
ll median(ll a,ll b, ll c){return a+b+c-max({a,b,c})-min({a,b,c});}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
template<typename T1,typename T2>
void ans(bool x,T1 y,T2 z){if(x)cout<<y<<endl;else cout<<z<<endl;}  
template<typename T>
void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++)
{cout<<v[i][0];for(ll j=1;j<w;j++)cout spa v[i][j];cout<<endl;}};
void debug(vector<string>&v,ll h,ll w){for(ll i=0;i<h;i++)
{for(ll j=0;j<w;j++)cout<<v[i][j];cout<<endl;}};
template<typename T>
void debug(vector<T>&v,ll n){if(n!=0)cout<<v[0];
for(ll i=1;i<n;i++)cout spa v[i];cout<<endl;};
template<typename T>
vector<vector<T>>vec(ll x, ll y, T w){
  vector<vector<T>>v(x,vector<T>(y,w));return v;}
ll gcd(ll x,ll y){ll r;while(y!=0&&(r=x%y)!=0){x=y;y=r;}return y==0?x:y;}
vector<ll>dx={1,0,-1,0,1,1,-1,-1};
vector<ll>dy={0,1,0,-1,1,-1,1,-1};
template<typename T>
vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
template<typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v(ts...))>(a,make_v(ts...));
}

int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  //cout<<fixed<<setprecision(10);
  ll res=0,buf=0;
  bool judge = true;
  string s;cin>>s;
  judge=false;
  rep(i,0,s.size()-1){
    if(s.substr(i,2)=="AC")judge=true;
  }
  ans1(judge);
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
void call(int n);
int main() {
    int n;
    std::cin >> n;
    call(n);
}
void call(int n) {
    for (int i = 1, x = i; i <= n; ++i, x = i) {
        bool break_loop = false;
        if (x % 3 == 0) {
            std::cout << ' ' << i;
            continue;
        }
        for (; x; x /= 10) {
            if (break_loop) {
                break;
            }
            if (x % 10 == 3) {
                std::cout << ' ' << i;
                break_loop = true;
                continue;
            }
        }
    }
    std::cout << std::endl;
}



Measured memory_bytes: 3080
k,a,b=map(int,input().split())
if b-a<=2:
    print(1+k)
else:
    c=1
    if a-1>=k:
        print(1+k)
    else:
        k-=a-1
        c=a
        c+=(k//2)*(b-a)
        k-=(k//2)*2
        print(c+k)


Measured memory_bytes: 2940
#include<iostream>
#include<algorithm>
#include<string> 
#include<map>
#include<set>
#include<vector>
#include<string.h> 
#include<math.h>
#include<stdio.h> 
#include<queue>
using namespace std;
int main()
{string s;cin>>s;int a=0,b=0,c=0;
for(int i=0;i<3;i++){
	if(s[i]=='a')a=1;
	if(s[i]=='b')b=1;
	if(s[i]=='c')c=1;
}
if(a&&b&&c)cout<<"Yes";
else cout<<"No";
system("pause");
return 0;
}

Measured memory_bytes: 504
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using static System.Console;
using static System.Math;

namespace Y.T
{
    public class MainClass
    {
        public static void Main(string[] args)
        {
            long[] input = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToArray();
            string Output = "";
            for (int i = 0; i < input[0]; i++)
            {
                Output += "ACL";
            }
            Console.WriteLine(Output);
        }
    }
}

Measured memory_bytes: 28080
import math
import string
import collections
from collections import Counter
from collections import deque
from decimal import Decimal


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]
a, b = map(int, input().split())
x = a*b
y = (a+b)*2
print(x, y)



Measured memory_bytes: 7016
H, W = [int(i) for i in input().strip().split(" ")]

if W == 1 or H == 1:
    print(1)
elif W % 2 == 0:
    w = W // 2
    print(H * w)
else:
    w1 = W // 2 + 1
    w2 = w1 - 1
    if H % 2 == 0:
        h = H // 2
        print(h * w1 + h * w2)
    else:
        h1 = H // 2 + 1
        h2 = h1 - 1
        print(h1 * w1 + h2 * w2)


Measured memory_bytes: 3064
#include <stdio.h>
#define ll long long

int main(){
	int n,p;
	scanf("%d%d",&n,&p);
	int od=0,ev=0;
	for(int i=0;i<n;i++){
		int t;
		scanf("%d",&t);
		if(t%2)od++;
		else ev++;
	}
	ll ans=0,crr=p?od:1;
	for(int i=p;i<=od;i+=2){
		//od個からi個選ぶ
		ans+=crr;
		crr=crr*(od-i)*(od-1-i)/(i+1)/(i+2);
	}
	printf("%lld",ans<<ev);
}

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

int main(){
    long long N,M;
    cin >> N >> M;
    if(N == 1 && M == 1) cout << 1 << '\n';
    else if (N == 1 || M == 1) cout << max(M, N) - 2 << '\n';
    else cout << N*M - 2*N - 2*M + 4 << '\n';
    return 0;
}

Measured memory_bytes: 3544
#include <cstdio>
int main(){int a,b,c,d,i;scanf("%d%d%d",&a,&b,&c);i=c-60;d=a+b;while((i+=60)<3600){if(0<=i%d&&i%d<=a){break;}}printf("%d\n",i>3599?-1:i);return 0;}

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

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int A, B, K;
    cin >> A >> B >> K;
    int i = 100;
    int count = 0;
    while(i >= 0)
    {
        if(A % i == 0 && B % i == 0)
        {
            count++;
            if(count == K){
                break;
            }
        }
        i--;
    }
    cout << i << endl;
    return 0;
}


Measured memory_bytes: 256
n = int(input())
a = input().split()
a = [int(m) for m in a]
rea = []
for i in range(n):
    rea.append([i, a[i]])

rea.sort(reverse=True)
b = []
c = []
for i in range(n):
    if i % 2 == 0:
        b.append([rea[i][0], rea[i][1]])
    else:
        c.append([rea[i][0], rea[i][1]])

c.sort()

nb = []
nc = []
for i in range(len(b)):
    nb.append(b[i][1])
for i in range(len(c)):
    nc.append(c[i][1])
nd = nb + nc
for i in range(n):
    print(nd[i], end = ' ')

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

#define INF 1999999999
#define REP(i,n) for(int i=0;i<n;i++)

int main() {
    long long int ans = 0;
    string olds, t;
    cin >> olds >> t;
    vector < vector < int > >  ls(26, vector<int>() );
    string s = "A" + olds + olds;
    REP(i, s.size()){
        ls[s[i] - 'a'].push_back(i);
    }
    //REP(i, 26)REP(j, ls[i].size()) cout << ls[i][j] << endl; 
    int now = 0;
    REP(i, t.size()){
        int mozi = t[i] - 'a';
        if(ls[mozi].size() == 0){
            ans = -1;
            break;
        }
        else{
            auto itr = upper_bound(ls[mozi].begin(),ls[mozi].end(), now);
            auto hoe = ls[mozi][itr - ls[mozi].begin()];
            ans += hoe - now;
            if(hoe > olds.size()){
                now = (int)hoe - olds.size();
            }
            else {
                now = (int)hoe;
            }
            
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 1980
#include<cmath>
#include<cstdio>

using namespace std;

int main()
{
	int q;
	scanf("%d", &q);

	for (int i = 0; i < q; i++)
	{
		int x0, y0, x1, y1, x2, y2, x3, y3;

		scanf("%d %d %d %d %d %d %d %d", &x0, &y0, &x1, &y1, &x2, &y2, &x3, &y3);

		int l01x = x1 - x0, l01y = y1 - y0, l23x = x3 - x2, l23y = y3 - y2;

		if (l01x*l23y - l01y*l23x == 0)
		{
			printf("2\n");
		}
		else if (l01x*l23x + l01y*l23y == 0)
		{
			printf("1\n");
		}
		else
		{
			printf("0\n");
		}
	}
}

Measured memory_bytes: 1016
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <map>
#include <cstdlib>
#include <queue>
#include <stack>
using namespace std;

int main(){
	int N;
	string s;
	cin>>N>>s;
	vector<int> east(N+1);
	east[0]=0;
	for(int i=0;i<N;i++){
		east[i+1]=east[i];
		if(s[i]=='E')east[i+1]++;
	}
	int minimum = 1000000;
	for(int i=0;i<N;i++){
		int a = 0;
		a+=i-east[i];
		a+=east[N]-east[i+1];
		if(minimum>a){
			minimum=a;
		}
	}
	cout<<minimum<<endl;
	
	
	return 0;
}


Measured memory_bytes: 1796
#include <bits/stdc++.h>
using namespace std;
#define si(x)       scanf("%d",&x)
#define su(x)       scanf("%u",&x)
#define sll(x)      scanf("%lld",&x)
#define sl(x)       scanf("%ld",&x)     
#define sc(x)       scanf("%c",&x)
#define ss(x)       scanf("%s",x)
#define sf(x)       scanf("%f",&x)
#define slf(x)      scanf("%lf",&x)
#define pri(x)      printf("%d\n",x)
#define prl(x)      printf("%lld\n",x)
#define ll          long long int
#define mod(x,n)    (x+n)%n
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define pll         pair<long long,long long>
#define pil         pair<int,long long>
#define pli         pair<long long,int>
#define vi          vector<int>
#define vl          vector<long long>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
#define M           1000000007
 
map<ll,int>m;
map<ll,int>::iterator it;
int main()
{
    //ios_base::sync_with_stdio(false);
    //cin.tie(NULL);
    //cout.tie(NULL);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
	int n; si(n);
	ll temp;
	for(int i=1;i<=n;i++){
		sll(temp);
		m[temp]++;
	}
	int ans=0;
	for(it=m.begin();it!=m.end();++it){
		if((it->S)%2==1) ans++;
	}
	pri(ans);
    return 0;
}

Measured memory_bytes: 6528