akhauriyash/Code-Regression huggingface dataset:
# abc157_a.py
# https://atcoder.jp/contests/abc157/tasks/abc157_a

# A - Duplex Printing /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点 : 100点

# 問題文
# 高橋君は、全 Nページから成る書類を両面印刷します。両面印刷では、1 枚の紙に 2ページ分のデータを印刷することが出来ます。
# 最小で何枚の紙が必要か求めてください。

# 制約
#     Nは整数
#     1≤N≤100

# 入力
# 入力は以下の形式で標準入力から与えられる。
# N

# 出力
# 答えを出力せよ。

# 入力例 1
# 5

# 出力例 1
# 3

# 1枚目の紙に 1,2 ページ目のデータを印刷し、 2 枚目の紙に 3,4 ページ目のデータを印刷し、 
# 3 枚目の紙に 5 ページ目のデータを印刷すれば、 3枚の紙に全てのデータを印刷することが出来ます。

# 入力例 2
# 2

# 出力例 2
# 1

# 入力例 3
# 100

# 出力例 3
# 50


global FLAG_LOG
FLAG_LOG = False


def log(value):
    # FLAG_LOG = True
    # FLAG_LOG = False
    if FLAG_LOG:
        print(str(value))


def calculation(lines):
    # S = lines[0]
    N = int(lines[0])
    # N, M = list(map(int, lines[0].split()))
    # values = list(map(int, lines[1].split()))
    # values = list(map(int, lines[2].split()))
    # values = list()
    # for i in range(N):
    #     values.append(int(lines[i]))
    # valueses = list()
    # for i in range(N):
    #     valueses.append(list(map(int, lines[i+1].split())))

    result = -(N//(-2))

    return [result]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['5']
        lines_export = [3]
    if pattern == 2:
        lines_input = ['2']
        lines_export = [1]
    if pattern == 3:
        lines_input = ['100']
        lines_export = [50]
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(1)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main()


Measured memory_bytes: 9204
#include<stdio.h>
#include <iostream>
#include<string>
#include<vector>
#include<map>
#include<algorithm>
#include <random>
#include <chrono>

#define rep(n) for(int i=0;i<n;i++)

using namespace std;
int main() {
	int k;
	string ans,s;
	cin >> k>>s;
	rep(s.size()) {
		if (i < k) {
			cout << s.at(i);
		}
		else {
			cout << "...";
			break;
		}
	}


}


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

int x,y;

int main(){

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

    cin>>x>>y;
    for(int i=0;i<=x;i++){
        if(i*2+(x-i)*4==y){
            cout<<"Yes\n";
            return 0;
        }
    }
    cout<<"No\n";

    return 0;
}

Measured memory_bytes: 3644
#include <iostream>
#include <string>
#include <cctype>
#include <memory>
#include <vector>
#include <array>
#include <algorithm>
#include <iomanip>

//auto in = freopen("input", "r", stdin);

using namespace std;

int main(){
	cout << setprecision(20);
	while(true){
		int n, w;
		cin >> n >> w;
		if(n==0 && w==0) break;

		vector<int> list;
		for(int i=0; i<n; ++i){
			int v;
			cin >> v;
			int index = v/w;
			while(list.size()<=index) list.push_back(0);
			++list[index];
		}

		int max_height = 0;
		for(int i=0; i<list.size(); ++i){
			max_height = max(max_height, list[i]);
		}

		double sum = 0;
		for(auto i=0; i<list.size(); ++i){
			double kosa = (list.size()-(i+1))/((double)list.size() - 1);
			sum += kosa * list[i];
		}

		cout << sum/max_height + 0.01 << endl;
	}
}

Measured memory_bytes: 1272
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<sstream>
#include<numeric>
#include<cassert>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define rep(i,s,n) for(int i=(s); i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()
#define IN(x,s,g) ((x) >= (s) && (x) < (g))
#define ISIN(x,y,w,h) (IN((x),0,(w)) && IN((y),0,(h)))
#define print(x) printf("%d\n",x)

using namespace std;

typedef unsigned int uint;
typedef long long ll;

const int _dx[] = {0,1,0,-1};
const int _dy[] = {-1,0,1,0};

int getInt(){
  int ret = 0,c;
  c = getchar();
  while(!isdigit(c)) c = getchar();
  while(isdigit(c)){
    ret *= 10;
    ret += c - '0';
    c = getchar();
  }
  return ret;
}

int solve(string s, int n, int i, int g){
  int m = s.size();
  int now = 0;
  REP(j,m-1){
    now = (now + n + (j == i ? 1 : 0)) % s.size();
    if(s[now] == 'G') g--;
    s.erase(s.begin() + now);
    if(g == 0) return s.size();
    now %= s.size();
  }
  return s[0] == 'B' ? 1 : 0;
}

int main(){
  int cc; cin>>cc;
  while( cc --> 0 ){
    int n; string str;
    cin>>n>>str;

    const int m = str.size();
    int ans = 0;
    int g = count(ALL(str), 'G');

    REP(i,m) ans = max(ans, solve(str, n-1, i, g));

    print(ans);
  }
  return 0;
}

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

using namespace std;

int main() 
{   
        long long n,b,r;
        cin>>n>>b>>r;
        long long ans = (n/(b+r)) * b;
        long long rem = n%(b+r);
        ans += min(rem,b);
        cout<<ans<<endl;
        return 0;
}

Measured memory_bytes: 256
from functools import partial
from itertools import islice


def take(n, iterable):
    return list(islice(iterable, n))


def chunked(iterable, n):
    return iter(partial(take, n, iter(iterable)), [])


def distance(x, y):
    return abs(x[0] - y[0]) + abs(x[1] - y[1])


def solve(s):
    h, w, d, *aqlr = map(int, s.split())
    a, q, lr = aqlr[:h * w], aqlr[h * w], aqlr[h * w + 1:]
    n = h * w
    pos = [0] * (n + 1)
    for i, _a in enumerate(a):
        pos[_a] = (i // w, i % w)
    cost = [0] * (n + 1)
    for i in range(d + 1, n + 1):
        cost[i] = cost[i-d]+distance(pos[i - d], pos[i])
    ans = []
    for l, r in chunked(lr, 2):
        ans.append("%d" % (cost[r] - cost[l]))
    return "\n".join(ans)


n, m, d = map(int, input().split())
l = '{} {} {}\n'.format(n, m, d) + '\n'.join([input() for _ in range(n)])
q, = map(int, input().split())
l += '\n{}\n'.format(q) + '\n'.join([input() for _ in range(q)])
print(solve(l))


Measured memory_bytes: 37108
#include <iostream>
#include <string>
#include <math.h>
using namespace std;
 
int main(){
    int N;
	cin >> N;
    int A[100];
    int max_num = 0;
    int min_num = 1000000000;
    for(int i = 0;i < N;i++) cin >> A[i];
    for(int i = 0;i < N;i++){
      min_num = min(min_num,A[i]);
      max_num = max(max_num,A[i]);
    }
    cout << abs(min_num-max_num) << endl;
  	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }

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

  int n;
  cin >> n;
  vector<int> a(n + 1);
  rep(i, 0, n) cin >> a[i + 1];

  vector<int> b(n + 1);
  repr(i, 1, n + 1) {
    int sum_val = 0;
    for (int j = i + i; j <= n; j += i) {
      sum_val ^= b[j];
    }
    b[i] = sum_val ^ a[i];
  }

  vector<int> ans;
  rep(i, 1, n + 1) {
    if (b[i])
      ans.push_back(i);
  }
  cout << ans.size() << endl;
  rep(i, 0, ans.size()) {
    if (i > 0)
      cout << " ";
    cout << ans[i];
  }
  cout << endl;
}


Measured memory_bytes: 3320
#include<iostream>
#include<string>
#include<vector>
using namespace std;
int main() {
  int N,K,C;
  string S;
  cin >> N >> K >> C >> S;
  vector<int> L(N+1,0),R(N+1,0);
  int i,c = 0;
  for(i=0;i<N;i++) {
    if(S[i] == 'o' && c <= 0) {
      L[i+1] = L[i] + 1;
      c = C + 1;
    }
    else L[i+1] = L[i];
    c--;
  }
  c = 0;
  for(i=0;i<N;i++) {
    if(S[N-i-1] == 'o' && c <= 0) {
      R[i+1] = R[i] + 1;
      c = C + 1;
    }
    else R[i+1] = R[i];
    c--;
  }
  for(i=0;i<N;i++) {
    if(S[i] == 'o') {
      if(L[i] + R[N-i-1] < K)cout << i+1 << endl;
    }
  }
}

Measured memory_bytes: 3332
#include<bits/stdc++.h>
using namespace std;
int main(){
  int A,B;
  int sum=0;
  cin>>A>>B;
  for(int i=A;i<B+1;i++){
    if((i%10==i/10000)&((i/1000)%10==(i%100)/10)){
      sum=sum+1;
    }
    else{
    }
  }
  cout<<sum<<endl;
}

Measured memory_bytes: 256
#include<stdio.h>
int main()
{
int a,b;
scanf("%d%d",&a,&b);
if(a<b)
{
printf("a < b\n");
}
else if(a==b)
{
printf("a == b\n");
}
else if(a>b)
{
printf("a > b\n");
}
return 0;
}

Measured memory_bytes: 580
#include <iostream>
#include <vector>
#include <string>
#include <math.h>
#include <algorithm>
#include <set>
#include <iomanip>
#include <stdio.h>
#include <sstream>
#include <bits/stdc++.h>
using namespace std;
int main(void){
  long long int n;
  cin>>n;
  map<long long int,long long int> hoge;
  long long int all=0;
  for(long long int i=0; i<n; i++){
    long long int a;
    cin>>a;
    hoge[a]++;
    all+=a;
  }
  long long int q;
  cin>>q;
  for(long long int i=0; i<q; i++){
    long long int b,c;
    cin>>b>>c;
    if(hoge.count(b)){
      long long int pre=hoge[b];
      hoge[b]=0;
      all-=pre*b;
      all+=pre*c;
      hoge[c]+=pre;
    }
    cout<<all<<endl;
  }
}

Measured memory_bytes: 8764
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define co(a) cout<<a<<endl
#define sz size()
#define bgn begin()
#define en end()
#define pb(a) push_back(a)
#define pp() pop_back()
#define V vector
#define P pair
#define V2(a,b,c) V<V<int>> a(b,V<int>(c))
#define V2a(a,b,c,d) V<V<int>> a(b,V<int>(c,d))
#define incin(a) int a; cin>>a
#define yuko(a) setprecision(a)
#define uni(a) a.erase(unique(a.begin(),a.end()),a.end())
//#define min min<int>
//#define max max<int>
template<class T>
 void cou(vector<vector<T>> a){
  int b=a.size();
  int c=a[0].size();
  fo(i,b){
    fo(j,c){
      cout<<a[i][j];
      if(j==c-1)
        cout<<endl;
      else
        cout<<' ';
    }
  }
}
/*template<>
 void cou(vector<vector<char>> a){
  int b=a.size();
  int c=a[0].size();
  fo(i,b){
    fo(j,c){
      cout<<a[i][j];
      if(j==c-1)
        cout<<endl;
      else
        cout<<' ';
    }
  }
}*/
 int wari(int a,int b) {
   if(a%b==0)
     return a/b;
   else
     return a/b+1;
 }
 int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
 int souwa(int a){
  return a*(a+1)/2;
 }
 /*int lcm(int a,int b){
  int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
  int gcm(int a,int b){
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }*/
 bool prime(int a){
   if(a<2)
     return false;
   else if(a==2)
     return true;
   else if(a%2==0)
     return false;
   double b=sqrt(a);
    for(int i=3;i<=b;i+=2){
      if(a%i==0){
        return false;
      }
    }
   return true;
 }
struct Union{
  vector<int> par;
  Union(int a){
	par= vector<int>(a,-1);
  }
  int find(int a){
    if(par[a]<0)
      return a;
    else
      return par[a]=find(par[a]);
  }
  bool same(int a,int b){
    return find(a)==find(b);
  }
  int Size(int a){
    return -par[find(a)];
  }
  void unite(int a,int b){
    a=find(a);
    b=find(b);
    if(a==b)
      return;
    if(Size(b)>Size(a))
      swap<int>(a,b);
    par[a]+=par[b];
    par[b]=a;
  }
};
int ketas(int a){
  string b=to_string(a);
  int c=0;
  fo(i,keta(a)){
    c+=b[i]-'0';
  }
  return c;
}
int gcm(int a,int b){
    if(b==0)
        return a;
    return gcm(b,a%b);
}
int lcm(int a,int b){
    return a/gcm(a,b)*b;
}
/*struct aa{
	vector<int> gt;
  aa(int n){
	gt= vector<int>(n, 1);
  }
	void c(V<int> d,int b){
	if(d[b]==0){
		gt[d[b]-1]++;
		gt[gt.sz-1]++;
	}
	else{
		gt[d[b]-1]++;
		c(d,d[d[b]]-1);
	}
}
void cok(int a){
	cout<<gt[a-1]<<endl;
	fo(i,a-1)
	cout<<gt[i]<<endl;
}
};
*/
/*struct dfs(){

}*/
signed main(){
  char a,b;
  cin>>a>>b;
  if(a=='H'&&b=='H')
    cout<<'H'<<endl;
  else if(a=='H'&&b=='D')
    cout<<'D'<<endl;
  else if(a=='D'&&b=='H')
    cout<<'D'<<endl;
  else
    cout<<'H'<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define all(c) c.begin(),c.end()
#define init(c) memset(c,0,sizeof c)
#define S second
#define F first
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
const int N=20000005;
ll n,k,x,t,a,b,m;
string s;
vi v;

void solve(){
	cin >> n;
	string ans="";
	while(n){
		n--;
		int rem = n%26;
		n/=26;
		ans+=(rem+'a');
	}
	reverse(all(ans));
	cout << ans;
}



int main(){

	int t= 1;
	while(t--){
		solve();
	}
	
	return 0;
}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
#define lli long long int
# define rep(i,n) for(int i=0;i<n;i++)
void solve(){
    lli x,k,d;
    cin>>x>>k>>d;
    x = abs(x);

    lli straight = min(k,x/d);
    k-=straight;
    x-=straight*d;

    if(k%2==0)
    cout<<x<<endl;
    else{
        cout<<abs(x-d)<<endl;
    }
}
int main()
{
    int t;
    //cin>>t;
    t=1;
    while(t--){
        solve();
    }
}

Measured memory_bytes: 3596
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <map>
using namespace std;

int main()
{
	int n;
	cin >> n;
	if (n < 1200) {
		cout << "ABC";
		return 0;
	}
	else if (n < 2800) {
		cout << "ARC";
		return 0;
	}
	cout << "AGC";
	return 0;
	
	
}

Measured memory_bytes: 256
Asq = []
for i in range(3) :
    Asq.append(list(input().split()))

N = int(input())
b = []
c = 0
y = 0
for k in range(N) :
    b.append(input())
    for i in range(3) :
        for j in range(3) :
            if Asq[i][j] == b[k] :
                s = Asq[i][j]
                Asq[i][j] = '#'
                c += 1

if c >= 3 :
    for i in range(3) :
        if (Asq[i][0] == '#') and (Asq[i][1] == '#') and (Asq[i][2] == '#') :
            y = 1
        elif (Asq[0][i] == '#') and (Asq[1][i] == '#') and Asq[2][i] == '#' :
            y = 1
    if Asq[0][0] == '#' and Asq[1][1] == '#' and Asq[2][2] == '#' :
        y = 1
    elif Asq[0][2] == '#' and Asq[1][1] == '#' and Asq[2][0] == '#' :
        y = 1

if y == 1 :
    print('Yes')
else :
    print('No')

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

using namespace std;

pair <int , int> a[100000];

vector <int> st;

bool ccw(complex <double> a , complex <double> b , complex <double> c)
{
  b -= a;
  c -= a;
  c *= conj(b);
  if(c.imag() <= 0)
  {
      return true;
  }
  return false;
}

void check(int i)
{
    while(st.size() >= 2)
    {
        int s = st[st.size()-2];
        int e = st[st.size()-1];
        complex <double> S = complex <double>(a[s].second , a[s].first);
        complex <double> E = complex <double>(a[e].second , a[e].first);
        complex <double> N = complex <double>(a[i].second , a[i].first);
        if(ccw(S , E , N))
        {
            break;
        }
        st.pop_back();
  }
  st.push_back(i);
}

int main()
{
    ios::sync_with_stdio(false) , cin.tie(0) , cout.tie(0);
    int n;
    cin>>n;
    for(int i = 0 ; i < n ; i++)
    {
        cin >> a[i].second >> a[i].first;
    }
    sort(a , a + n);
    for(int i = 0 ; i < n ; i++)
    {
        check(i);
    }
    for(int i = n - 2 ; i >= 0 ; i--)
    {
        check(i);
    }
    cout << st.size() - 1 << endl;
    for(int i = st.size() - 1 ; i > 0 ; i--)
    {
        cout << a[st[i]].second << " " << a[st[i]].first << endl;
    }
    return 0;
}



Measured memory_bytes: 4056
import itertools, re

abcd = input()
abcd = [int(x) for x in abcd]
p = list(itertools.product([1,-1], repeat=3))

f = abcd[0]
fs = str(abcd[0])
for i in range(len(p)):
  for j in range(3):
    f += abcd[j+1]*p[i][j]
    if p[i][j] <0:
      fs += '-' + str(abcd[j+1])
    else:
      fs += '+' + str(abcd[j+1])
  if f == 7:
    print(fs + '=7')
    exit()
  else:
    f = abcd[0]
    fs = str(abcd[0])


Measured memory_bytes: 3188
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define pb push_back
#define f(i,x,n) for(int i=x;i<n;i++)
#define all(c) c.begin(),c.end()
#define int ll
using ld = long double;
using ll = long long;
using pii = pair<int,int>;
const int MOD = 1e9+7, N = 1e5 + 10; 
const double PI = acos(-1);

int32_t main(){
   ios::sync_with_stdio(false);
   cin.tie(NULL);
   int a,b,x;
   cin >> a >> b >> x;
   int v = a*a*b;
   cout << setprecision(14) << fixed;
   if(v<=2*x){
      ld y = 2*x-b*a*a;
      y = y/(a*a);
      ld ans = atan((b-y)/a);
      // cout << ans << '\n';
      ans = ans*180;
      ans = ans/PI;
      cout << ans << '\n';
   }else{
      ld y = a*a*b-2*x;
      y = y/(a*b);
      ld ans = atan((a-y)/b);
      ans = ans*180;
      ans = ans/PI;
      ans = 90-ans;
      cout << ans << '\n';
   }
   return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define printVec(v) printf("{"); for (const auto& i : v) { std::cout << i << ", "; } printf("}\n");
#define degreeToRadian(deg) (((deg)/360)*2*M_PI)
#define radianTodegree(rad) (((rad)/2/M_PI)*360)
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; }
using namespace std;
using P = pair<int,int>;
using ll = long long;
const ll INF = 1LL<<60;
const int MOD = 1e9 + 7;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

//cin.tie(0);ios::sync_with_stdio(false);
//cout << fixed << setprecision(15) << y << endl;
int main() {
  string s, t;
  cin >> s >> t;

  int ans = -1;
  bool ok = true;
  for (int i = 0; i < s.size(); i++) {
    int cnt = 0;
    for (int j = 0; j < t.size(); j++) {
      if (i + j < s.size()) {
	if (s[i + j] == t[j]) {
	  cnt++;
	}
	continue;
      }
      ok = false;
    }
    if (ok) ans = max(ans, cnt);
  }
  cout << t.size() - ans << endl;
  return 0;
}


Measured memory_bytes: 3600
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:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input!{
        x: i64,
        y: i64
    }
    if (x - y).abs() <= 1 {
        println!("Brown");
    } else {
        println!("Alice");
    }
}


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

int main(){
	int n;	cin>>n;
	int w[n];	for(int i=0;i<n;i++)cin>>w[i];

	int s1=0;

	int ans=1000;
	for(int i=0;i<n-1;i++){
		s1+=w[i];
		int s2=0;
		for(int j=i+1;j<n;j++){
			s2+=w[j];
		}

		if(abs(s1-s2)<ans)ans=abs(s1-s2);
	}

	cout<<ans<<endl;

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

using namespace std;
using ll = long long;
using vpii = vector<pair<int, int>>;
using vpll = vector<pair<ll, ll>>;
// ceil() 切り上げ, floor() 切り捨て
// next_permutation(all(x))

int		main(void)
{
	ll N;
	cin >> N;
	ll A;
	for (ll i = 1; i*i <= N; i++)
	{
		if (N%i == 0)
			A = i;
	}
	cout << A-1 + N/A-1 << endl;
}



Measured memory_bytes: 256
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

al, ar = A + -(T * V), A + (T * V)
bl, br = B + -(T * W), B + (T * W)

ans = "NO"
if A < B:
    if ar >= br:
        ans = "YES"
elif B < A:
    if al <= bl:
        ans = "YES"
else:
    ans = "YES"

print(ans)


Measured memory_bytes: 9192
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
using namespace std;

const int INF = INT_MAX / 2;

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

    vector<int> a(26, 0), b(26, 0);
    for(int i=0; i<n; ++i){
        ++ a[s[i]-'a'];
        ++ b[t[i]-'a'];
    }
    sort(a.begin(), a.end());
    sort(b.begin(), b.end());

    vector<vector<int> > dp(27, vector<int>(27, INF));
    dp[0][0] = 0;
    for(int i=0; i<27; ++i){
        for(int j=0; j<27; ++j){
            if(i < 26)
                dp[i+1][j] = min(dp[i+1][j], dp[i][j] + a[i]);
            if(j < 26)
                dp[i][j+1] = min(dp[i][j+1], dp[i][j] + b[j]);
            if(i < 26 && j < 26)
                dp[i+1][j+1] = min(dp[i+1][j+1], dp[i][j] + abs(a[i] - b[j]));
        }
    }
    cout << (dp[26][26] / 2) << endl;

    return 0;
}

Measured memory_bytes: 1524
#include <stdio.h>

int main(int argc, const char * argv[]) {
    char S[3];
    scanf("%s", S);
    
    int num = 0;
    int sf = 0;
    for (int i=0; i<3; i++) {
        
        if (sf == 1) {
            if (S[i] == 'R') {
                num++;
            } else {
                sf = 0;
            }
        }
        
        if (sf == 0) {
            if (S[i] == 'R') {
                num = 1;
                sf = 1;
            }
        }
        
        
    }
    
    printf("%d\n", num);
    return 0;
}


Measured memory_bytes: 1732
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define vi vector<int>
#define vl vaector<long>
#define vll vector<long long int>
#define vC  vector<char>
#define FastIO ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define db(...) ZZ(#__VA_ARGS__, __VA_ARGS__)
ll pow(ll x, ll y,ll m) { ll res = 1;x=x%m; while (y > 0) { if (y & 1) res = ((res%m) * (x%m))%m; y = y >> 1; x = ((x%m) * (x%m))%m; } return res%m; }
template <typename Arg1> void ZZ(const char* name, Arg1&& arg1){std::cerr << name << " = " << arg1 << endl;}
template <typename Arg1, typename... Args>void ZZ(const char* names, Arg1&& arg1, Args&&... args)
{
	const char* comma = strchr(names + 1, ',');
	std::cerr.write(names, comma - names) << " = " << arg1;
	ZZ(comma, args...);
}
const ll INF = 0xFFFFFFFFFFFFFFFL;
clock_t time_p=clock();
void abhigyan10()
{time_p=clock()-time_p;cerr<<"Time Taken : "<<(float)(time_p)/CLOCKS_PER_SEC<<"\n";}
ll seed;
mt19937 rng(seed=chrono::steady_clock::now().time_since_epoch().count());
inline ll rnd(ll l=0,ll r=INF){return uniform_int_distribution<ll>(l,r)(rng);}
#define clrbuf cin.ignore(numeric_limits<streamsize>::max(),'\n');
#define preciset(x) cout<<setprecision(x)<<fixed;
const ll mod =1000000007;
ll f[200005];
int main()
{
        FastIO
        ll n,i,ans=0;
        cin>>n;
        vll a(n+1);
        for(i=1;i<=n;i++) {cin>>a[i];f[a[i]]++;}

        for(i=1;i<=n;i++)
        {
        	ans += max(0LL,f[i]*(f[i]-1)/2);

        }
        
        for(i=1;i<=n;i++)
        {
        	cout<<ans- max(0LL,(f[a[i]]*(f[a[i]]-1)/2))+ max(0LL,((f[a[i]]-1)*(f[a[i]]-2)/2))<<"\n";
        }

        return 0;
    }

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

#define INF 1000000000

int main() {

	string S;
	cin >> S;
	int k = S.length() - 2, ans = INF;
	
	for (int i = 0; i < k; i++) {
		int a = stoi(S.substr(i, 3));
		ans = min(ans, abs(753 - a));
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
const long long LINF = 1e18;
#define dump(x)  cout << 'x' << ' = ' << (x) << ` `;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
typedef long long ll;
using namespace std;
typedef pair<ll, ll> P;

template<typename T>
void print(vector<T> &x) {
    int n = x.size();
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(vector<vector<T>> &x) {
    int n = x.size();
    rep(i,n) {
        rep(j,x[i].size()) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

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; }

vector<string> s;
ll sumU[2222][2222] = {0};
ll sumR[2222][2222] = {0};
ll sumD[2222][2222] = {0};
ll sumL[2222][2222] = {0};
 
int n,m;

void sumLRUD() {
    // U
    for (int j = 0; j < m; ++j) {
        for (int i = 1; i < n; ++i) {
            if (s[i][j] == '.') {
                if (s[i-1][j] == '#') sumU[i][j] = sumU[i-1][j];
                else sumU[i][j] = sumU[i-1][j]+1;
            }
        }
    }
 
    // D
    for (int j = 0; j < m; ++j) {
        for (int i = n-2; i >= 0; --i) {
            if (s[i][j] == '.') {
                if (s[i+1][j] == '#') sumD[i][j] = sumD[i+1][j];
                else sumD[i][j] = sumD[i+1][j]+1;
            }
        }
    }
 
    // L
    for (int i = 0; i < n; ++i) {
        for (int j = 1; j < m; ++j) {
            if (s[i][j] == '.') {
                if (s[i][j-1] == '#') sumL[i][j] = sumL[i][j-1];
                else sumL[i][j] = sumL[i][j-1]+1;
            }
        }
    }
 
    // R
    for (int i = 0; i < n; ++i) {
        for (int j = m-2; j >= 0; --j) {
            if (s[i][j] == '.') {
                if (s[i][j+1] == '#') sumR[i][j] = sumR[i][j+1];
                else sumR[i][j] = sumR[i][j+1]+1;
            }
        }
    }
}

int main(int argc, char const *argv[]) {
    cin >> n >> m;
    s.resize(n);
    rep(i,n) cin >> s[i];
    sumLRUD();
    ll ans = 0;
    rep(i,n) {
        rep(j,m) {
            ll L = sumL[i][j]; ll R = sumR[i][j];
            ll U = sumU[i][j]; ll D = sumD[i][j];
            chmax(ans,L+R+U+D);
        }
    }
    cout << ans+1 << endl;
    return 0;
}

Measured memory_bytes: 149760
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <functional>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <list>
#include <set>
using namespace std;



int main(int argc, char *args[]) {
	int N;
	int A[10000];
	int counter = 0;
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> A[i];
		
	}
	for (int i = 0; i < N; i++) {
		while (1) {
			if (A[i] % 2 == 0) {
				A[i] = A[i] / 2;
				counter += 1;
			}
			else {
				break;
			}
		}
	}
	cout << counter << endl;
}


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

class Dice{
    public:
    int a[7];//-,up,flont,right,left,back,down
    void roll(char d);
    void rotate(void);
};

void Dice::rotate(void){
    int tmp;
    tmp=a[2];
    a[2]=a[3];
    a[3]=a[5];
    a[5]=a[4];
    a[4]=tmp;
}

void Dice::roll(char d){
    int tmp;
    if(d=='N'){
        tmp=a[1];
        a[1]=a[2];
        a[2]=a[6];
        a[6]=a[5];
        a[5]=tmp;
    }
    else if(d=='S'){
        tmp=a[1];
        a[1]=a[5];
        a[5]=a[6];
        a[6]=a[2];
        a[2]=tmp;
    }
    else if(d=='W'){
        tmp=a[1];
        a[1]=a[3];
        a[3]=a[6];
        a[6]=a[4];
        a[4]=tmp;
    }
    else if(d=='E'){
        tmp=a[1];
        a[1]=a[4];
        a[4]=a[6];
        a[6]=a[3];
        a[3]=tmp;
    }
}

bool compare(Dice d0,Dice d1){
    int i,j,k;
    char d[7]="NWWWNN"; //NWWWN
    bool b=0;
    
    for(j=0;j<6;j++){
        for(k=0;k<4;k++){
            b=1;
            for(i=1;i<7;i++){
                if(d0.a[i]!=d1.a[i]){
                    b=0;
                }
            }
            if(b){
                return true;
            }
            d0.rotate();
        }
        d0.roll(d[j]);
    }
    return false;
}

int main(void){
    int n;
    bool ans;
    Dice dice[100];
    cin>>n;
    int i,j;
    for(i=0;i<n;i++){
        for(j=1;j<7;j++){
            cin>>dice[i].a[j];
        }
    }
    
    for(i=0;i<n;i++){
        for(j=0;j<n;j++){
            if(i!=j){
                if(compare(dice[i],dice[j])){
                    cout<<"No"<<endl;
                    return 0;
                }
            }
        }
    }
    
    cout<<"Yes"<<endl;
    return 0;
}



Measured memory_bytes: 3116
#include<bits/stdc++.h>
using namespace std;
const int b = 2e6;
int base[b];
/**
7 111111111111111
*/
int main () {
    int k;
    cin >> k;

    if (k % 7 == 0) k /= 7;

    int cur = 1;
    int sum = 0;

    for (int i = 1 ; i < b ; ++ i) {
        sum += cur;
        sum %= k;
        cur = cur * 10 % k;
        if (sum == 0) return !printf("%d\n", i);
    }
    printf("-1");
}


Measured memory_bytes: 3756
import java.util.*;

public class Main {
	// public static void printArray(int[] a) {
	// 	for (int i = 0; i < a.length; i++) {
	// 		System.out.print(a[i] + ", ");
	// 	}
	// 	System.out.println();
	// }

	// public static<T> void printArrayT(T[] a) {
	// 	for (int i = 0; i < a.length; i++) {
	// 		System.out.print(a[i] + ", ");
	// 	}
	// 	System.out.println();
	// }

	// public static class Triple implements Comparable<Triple> {
	// 	public int A, B, C;
	// 	Triple(int A, int B, int C) {
	// 		this.A = A;
	// 		this.B = B;
	// 		this.C = C;
	// 	}

	// 	@Override
	// 	public String toString() {
	// 		return String.format("(%d, %d, %d)", A, B, C);
	// 	}

	// 	@Override
	// 	public int compareTo(Triple o) {
	// 		int a = this.A - o.A;
	// 		if (a != 0) return a;
	// 		int b = this.B - o.B;
	// 		if (b != 0) return b;
	// 		return this.C - o.C;
	// 	}
	// }

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] A = new int[N];
		for (int i = 0; i < N; i++) {
			A[i] = sc.nextInt();
		}
		int[] L = new int[N];
		int[] R = new int[N];
		for (int i = 1; i < N; i++) {
			L[i] = Math.max(L[i-1], A[i-1]);
		}
		for (int i = N-2; i >= 0; i--) {
			R[i] = Math.max(R[i+1], A[i+1]);
		}
		StringBuilder buff = new StringBuilder();
		for (int i = 0; i < N; i++) {
			buff.append(Math.max(L[i], R[i]));
			buff.append('\n');
		}
		System.out.print(buff);
	}
}


Measured memory_bytes: 95700
#include <cstdio>
#include <functional>
#include <algorithm>
#include <vector>
#include <limits>
#include <numeric>
#include <type_traits>
#include <iostream>
#include <queue>
#include <bits/stdc++.h>
#define INF (1ll<<60)
#define MOD 1000000007
#define BOUND 27182818284

typedef long long ll;
typedef long long int lli;

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

template<class T>bool umax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool umin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

using namespace std;

// gcd
int gcd(int a, int b){
    if(a==0)
        return b;
    return gcd(b%a,a);
}
// gcd array
int findGCD(int arr[], int n){
    int result = arr[0];
    for (int i=1; i < n; i++)
        result = gcd(arr[i], result);

    return result;
}

// sort big to small
// sort(A,A+N, greater<int>());

// v.front() = -BOUND;
// v.back() = BOUND;

// Iterator
// v.begin
// v.end

int main() {
    unsigned int N,D,X;
    cin >> N >> D >> X;
    int ans=X;
    vector<int>A(N);

    for(int i=0; i<N; i++){
        cin >> A[i];
        ans += ((D-1) / A[i] +1);
    }


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



Measured memory_bytes: 256
var obj = init();
Main();
function nextInt(){return myconv(next(),1);}
function nextStrArray(){return myconv(next(),2);}//半角スペース分割
function nextIntArray(){return myconv(next(),4);}//半角スペース + 数値化
function nextCharArray(){return myconv(next(),6);}//1文字分割
function next(){return obj.next();}
function hasNext(){return obj.hasNext();}
function myin(){return require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");}
function init(){
  var inputFile = myin();
  var returnObj = {
    "list" : inputFile, "index" : 0, "max" : inputFile.length,
    "hasNext" : function(){return (this.index < this.max);},
    "next" : function(){if(!this.hasNext()){return "";}else{var returnInput = this.list[this.index];this.index++;return returnInput;}}
  };
  return returnObj;
}
function myout(t){console.log(t);}//標準出力
function myerr(t){console.error(t);}//標準エラー出力
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す　1:数値へ変換
//2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字で分割  7:1文字で分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}
function Main(){
  var one = nextIntArray();
  var H = one[0];
  var W = one[1];
  var list = {};
  for(var i = 0; i < H; i++){
    var tmp = nextCharArray();
    for(var j = 0; j < W; j++){
      if(list[tmp[j]] == null){
        list[tmp[j]] = 1;
      }else{
        list[tmp[j]]++;
      }
    }
  }
  var four = 0;
  var two = 0;
  var one = 0;
  var Hhalf = Math.ceil(H / 2);
  var Whalf = Math.ceil(W / 2);
  myerr("Hhalf : " + Hhalf);
  myerr("Whalf : " + Whalf);
  if(H % 2 == 1 && W % 2 == 1){
    four = (Hhalf - 1) * (Whalf - 1);
    two = (Hhalf - 1) + (Whalf - 1);
    one = 1;
  }else if(H % 2 == 1 && W % 2 != 1){
    four = Whalf * (Hhalf - 1);
    two = Whalf;
  }else if(H % 2 != 1 && W % 2 == 1){
    four = Hhalf * (Whalf - 1);
    two = Hhalf;
  }else{
    four = Hhalf * Whalf;
  }
  var keys = Object.keys(list);
  /*myerr(list);
  myerr(four);
  myerr(two);
  myerr(one);*/
  var isContain = false;
  while(four > 0){
    for(var i = 0; i < keys.length; i++){
      if(list[keys[i]] >= 4){
        list[keys[i]] -= 4;
        four--;
        isContain = true;
      }
    }
    if(isContain){
      isContain = false;
    }else{
      myout("No");
      return;
    }
  }
  //myerr(list);
  while(two > 0){
    for(var i = 0; i < keys.length; i++){
      if(list[keys[i]] >= 2){
        list[keys[i]] -= 2;
        two--;
        isContain = true;
      }
    }
    if(isContain){
      isContain = false;
    }else{
      myout("No");
      return;
    }
  }
  while(one > 0){
    for(var i = 0; i < keys.length; i++){
      if(list[keys[i]] >= 1){
        list[keys[i]] -= 1;
        one--;
        isContain = true;
      }
    }
    if(isContain){
      isContain = false;
    }else{
      myout("No");
      return;
    }
  }
  
  myout("Yes");
}


Measured memory_bytes: 21064
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <unordered_map>

using namespace std;
using ll = long long;
// constexpr int MOD = 1e9+7;

void _cin(){} template <class Head, class... Tail> void _cin(Head&& head, Tail&&... tail){ cin >> head; _cin(forward<Tail>(tail)...); }
void _cout(){ cout << "\n"; } template <class Head, class... Tail> void _cout(Head&& head, Tail&&... tail){ cout << head; _cout(forward<Tail>(tail)...); }
int gcd(int a, int b){ return (b == 0) ? a : gcd(b, a % b); }

#define For(i, n) for(int i = 0; i < (n); i ++)
#define Rep(n) For(_, n)
#define Range(c) c.begin(), c.end()
#define RevRange(c) c.rbegin(), c.rend()
#define Contains(c, x) (find(Range(c), x) != c.end())
#define Search(rb, re, x) distance(rb, find(rb, re, x))
#define Sort(a) sort(Range(a))
#define DeSort(a) sort(RevRange(a))
#define Reverse(c) reverse(Range(c))
#define Vec2(T, n, m, xs) vector<vector<T>> xs(n, vector<T>(m))
#define Sum(a) accumulate(Range(a), 0)
#define Cusum(T, xs, sxs) vector<T> sxs(xs.size()+1); For(i, (int)xs.size()) sxs[i+1] = sxs[i] + xs[i]
#define Cin(T, ...) T __VA_ARGS__; _cin(__VA_ARGS__)
#define Cins(T, n, xs) vector<T> xs(n); For(i, n) cin >> xs[i]
#define Cins2(T, n, xs, ys) vector<T> xs(n), ys(n); For(i, n) cin >> xs[i] >> ys[i]
#define Cins3(T, n, xs, ys, zs) vector<T> xs(n), ys(n), zs(n); For(i, n) cin >> xs[i] >> ys[i] >> zs[i]
#define Cinss(T, n, m, xs) Vec2(T, n, m, xs); For(i, n) For(j, m) cin >> xs[i][j]
#define Cinm(T, n, map) unordered_map<T, int> map; Rep(n){ Cin(T, x); map[x] ++; }
#define Cout(...) _cout(__VA_ARGS__)
#define Couts(xs) for(const auto &e : xs) cout << e << " "; cout << "\n"
#define Coutyn(cond) Cout((cond) ? "yes" : "no")
#define CoutYn(cond) Cout((cond) ? "Yes" : "No")
#define CoutYN(cond) Cout((cond) ? "YES" : "NO")

int main(void){
    Cin(int, n, q);
    Cin(string, s);
    vector<int> r(n+1);
    for(int i = n-1; i > 0; i --){
        r[i-1] = r[i] + ((s[i-1] == 'A' && s[i] == 'C') ? 1 : 0);
    }
    Rep(q){
        Cin(int, a, b);
        Cout(r[a-1] - r[b-1]);
    }
}

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

int main() 
{
    int N, M;
    cin >> N >> M;
    vector<int> ac(N);
    vector<int> pena(N);
    for (int i = 0; i < M; i++) {
        int p;
        string s;
        cin >> p >> s;
        p--;
        if (ac[p]) {
            continue;
        }
        if (s == "AC") {
          ac[p] = 1;
        } else {
          pena[p]++;
        }
    }
    
    int AC = 0, PENA = 0;
    for (int i = 0; i < N; i++) {
      AC += ac[i];
        if (ac[i]) {
            PENA += pena[i];
        }
    }
    cout << AC << " " << PENA << endl;
    
}

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

#define ll long long 

ll n;
ll a[100005];
ll dp[100005];
const ll Inf = 1e10;

ll MinCostToReachFromNToZero(ll N){
  	if(dp[N] != -1)return dp[N];
	if(N <= 0) return 0;
  	ll ans = abs(a[N] - a[N-1]) + MinCostToReachFromNToZero(N-1);
    if(N-2 >= 0){
  		ll ans2 = abs(a[N] - a[N-2]) + MinCostToReachFromNToZero(N-2);
  		ans = min(ans,ans2);
    }
    //cout << N << " " << ans << endl;
  	return dp[N] = ans;
}

int main(){
	cin >> n;
  	for(ll i = 0; i < n; i++)cin >> a[i];
  	for(ll i = 0; i < n+1; i++)dp[i] = -1;
  
	cout << MinCostToReachFromNToZero(n-1) << endl;
  	return 0;
}


Measured memory_bytes: 9788
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = (int)(a); i <= (int)(n); ++i)
#define rrep(i, a, n) for (int i = (int)(a); i >= (int)(n); --i)
#define debug(x) cerr << #x << " = " << x << "\n"
#define debugv(x) \
  rep(f, 0, (x.size() - 1)) cerr << x[f] << (f == (x.size() - 1) ? "\n" : " ")
#define all(x) x.begin(), x.end()
#define int long long
using namespace std;
typedef pair<int, int> pii;
typedef vector<int> vi;
const int MX = 1e5 + 5, INF = 5 << 28, MOD = 1e9 + 7;

int N, M, K;
vi A, B;
string S, T;

void input() {
  int x, y, z;
  cin >> S;
  ;
}
bool used[26] = {};
void solve() {
  bool ans = true;
  for (auto x : S) {
    int i = x - 'a';
    if (used[i]) ans = false;

    used[i] = true;
  }

  cout << (ans ? "yes" : "no") << endl;

  ;
  ;
}
signed main() {
  input();
  solve();
  return 0;
}

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

int main() {
	int a;
	cin >> a;
	char s[100], t[100];
	cin >> s >> t;
	rep(i, a) {
		cout << s[i] << t[i];
	}
	cout << endl;
	return 0;
} 

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


int main() {
    int n, mini = 200;
    cin >> n;
    vector<int> s(n);

    rep(i,n){
        cin >> s[i];
        if(s[i] % 10 != 0){
            mini = min(mini, s[i]);
        }
    }
    int sum = accumulate(s.begin(), s.end(), 0);
    if(sum % 10 != 0) cout << sum << endl;
    else cout << (mini == 200 ? 0 : sum - mini) << endl;
}


Measured memory_bytes: 256
import sys
sys.setrecursionlimit(10000)

memo = {}

def judge(x):
	if x < 0:
		return False
	elif x == 0:
		return True
	else:
		if x not in memo:
			memo[x] = judge(x - 100) or judge(x - 101) or judge(x - 102) or judge(x - 103) or judge(x - 104) or judge(x - 105)
		return memo[x]


if __name__ == "__main__":
	X = int(input())
	if judge(X):
		print(1)
	else:
		print(0)

Measured memory_bytes: 3828
#include <stdio.h>
#include <stdbool.h>
#define SIZE 101

int cnt = 1;

typedef struct tStack_
{
    int data[SIZE];
    int top;
}tStack;

typedef struct tTimeStamp_
{
    int start;
    int end;
}tTimeStamp;

typedef struct tNode_
{
    int u;
    int k;
    int v[SIZE];
}tNode;

bool IsFull(tStack *s){
    return (s->top >= SIZE - 1);
}

bool IsEmpty(tStack *s){
    return (s->top == 0);
}

void Push(tStack *s, int value){
    if(IsFull(s)){
        return;
    }
    else{
        s->top++;
        s->data[s->top] = value;
    }
}

int Pop(tStack *s){
    if(IsEmpty(s)){
        return -1;
    }
    else{
        s->top--;
        return s->data[s->top + 1];
    }
}

void DFS(tStack *s, tTimeStamp ts[], tNode data[]){
    int node = Pop(s) - 1;
    int ref = 1;

    if(ts[node].start > 0 || ts[node].end > 0){ return; }

    ts[node].start = cnt++;
    while(1){
        if(ref > data[node].k){ break; }
        Push(s, data[node].v[ref - 1]);
        DFS(s, ts, data);
        ref++;
    }
    ts[node].end = cnt++;
}

int main(){
    tStack s = {{0}, 0};
    tTimeStamp ts[SIZE] = {{0, 0}};
    tNode data[SIZE];
    bool endFlag = true;
    int n;

    scanf("%d", &n);
    for(int i = 0; i < n; i++){
        scanf("%d %d", &data[i].u, &data[i].k);
        for(int j = 0; j < data[i].k; j++){
            scanf("%d", &data[i].v[j]);
        }
    }

    Push(&s, 1);
    while(endFlag){
        DFS(&s, ts, data);
        for(int i = 0; i < n; i++){
            if(ts[i].start == 0 || ts[i].end == 0){
                Push(&s, i + 1);
                break;
            }
            else if(i == n - 1){
                endFlag = false;
            }
        }
    }

    for(int i = 0; i < n; i++){
        printf("%d %d %d\n", i + 1, ts[i].start, ts[i].end);
    }

    return 0;
}


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

int main()
{
    char text[1000];
    char word[20];
    
    scanf("%s", &word);
    //printf("word:%s\n", word);

    int sum=0;

    while(1){
        scanf("%s", &text);
        //printf("text:%s\n", text);

        if(strcmp(text, "END_OF_TEXT")==0){
            printf("%d\n", sum);
            break;
        }
        else{
            //printf("bef:%s\n", text);
            for(int i=0;i<strlen(text);i++){
                if(text[i]<97){
                    text[i]=text[i] + 32;
                }
            }
            //printf("aft:%s\n", text);
            //printf("%s, %s, %d\n", text, word, strcmp(text, word));

            if(strcmp(text, word)==0){
                sum = sum + 1;
            }
        }
    }

    return 0;
}


Measured memory_bytes: 2028
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;

struct Node
{
  int key;
  Node *parent, *left, *right;
};

Node *root, *nil;

void newTree()
{
  nil = (Node *)malloc(sizeof(Node));
  nil->parent = nil->left = nil->right = nil;
}

void insert(int i)
{
  Node *n = (Node *)malloc(sizeof(Node));
  n->key = i;
  n->left = nil;
  n->right = nil;

  Node *node = root;
  Node *parent = nil;
  while (node != nil)
  {
    parent = node;
    if (n->key < node->key)
      node = node->left;
    else
      node = node->right;
  }
  n->parent = parent;

  if (parent == nil)
    root = n;
  else if (n->key < parent->key)
    parent->left = n;
  else
    parent->right = n;
}

void preorderPrint(Node *n)
{
  if (n != nil)
  {
    printf(" %d", n->key);
    preorderPrint(n->left);
    preorderPrint(n->right);
  }
}

void inorderPrint(Node *n)
{
  if (n != nil)
  {
    inorderPrint(n->left);
    printf(" %d", n->key);
    inorderPrint(n->right);
  }
}

int main()
{
  int m, num;
  char order[7];
  scanf("%d", &m);

  for (int i = 0; i < m; i++)
  {
    scanf("%s", order);
    if (order[0] == 'i')
    {
      scanf("%d", &num);
      insert(num);
    }
    else
    {
      inorderPrint(root);
      printf("\n");
      preorderPrint(root);
      printf("\n");
    }
  }

  return 0;
}

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

#define DUMP(x) cerr << #x << "=" << x << endl
#define DUMP2(x, y) cerr<<"("<<#x<<", "<<#y<<") = ("<<x<<", "<<y<<")"<< endl
#define BINARY(x) static_cast<bitset<16> >(x)

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for (int i=m;i<(int)(n);i++)

#define in_range(x, y, w, h) (0<=(int)(x) && (int)(x)<(int)(w) && 0<=(int)(y) && (int)(y)<(int)(h))
#define ALL(a) (a).begin(),(a).end()

typedef long long ll;
const int INF   = 1e9;
const ll  INFLL = 1e18;
typedef pair<int, int> PII;
int dx[4]={0, -1, 1, 0}, dy[4]={-1, 0, 0, 1};

int main()
{
    ios::sync_with_stdio(false);

    int N; cin >> N;
    map<int, int> cnt;

    rep(i, N) {
        int A; cin >> A;
        cnt[A-1]++;
        cnt[A]++;
        cnt[A+1]++;
    }

    int ans = 0;
    for (auto m : cnt) {
        ans = max(ans, m.second);
    }
    cout << ans << endl;
}

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



int main()
{	
	int n,m;

	cin>>n>>m;
	int tot = 0;
	while(m--){
		int a;
		cin>>a;

		tot +=a;
	}

	if(tot >n){
		cout<<-1;
	}
	else{
		cout<<n-tot;
	}
}

Measured memory_bytes: 3640
import java.util.Scanner;

public class Main {
    public static void debug(String str) {
        System.out.println(str);
    }

    public static void main(String[] args) {

        long A;
        long B;

        try (Scanner sc = new Scanner(System.in)) {
            A = sc.nextLong();
            B = sc.nextLong();
        }
        long result;

        if((A >= 1 && A <= 9)&&(B >= 1 && B <= 9)){
            result = A * B;
        }else{
            result = -1;
        }


        System.out.println(result);

    }


}


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

int main(){
  string S;
  cin >> S;
  if(S=="SUN") cout << 7 << endl;
  else if(S=="MON") cout << 6 << endl;
  else if(S=="TUE") cout << 5 << endl;
  else if(S=="WED") cout << 4 << endl;
  else if(S=="THU") cout << 3 << endl;
  else if(S=="FRI") cout << 2 << endl;
  else if(S=="SAT") cout << 1 << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N,x;cin>>N;int W[N];
  cin>>W[0];
  for(int i=1;i<N;i++){
    cin>>W[i];W[i]+=W[i-1];
  }
  x=W[N-1];
  for(int i=0;i<N;i++)x=min(x,abs(W[N-1]-2*W[i]));
  cout<<x<<endl;
}

Measured memory_bytes: 256