akhauriyash/Code-Regression huggingface dataset:
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
using namespace std;
#define REP(i,n) for(int i = 0; i < (int)n; i++)
#define FOR(i,a,b) for(int i = a; i < (int)b; i++)
#define pb push_back
#define mp make_pair
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef long long ll;
typedef unsigned long long ull;
const int IINF = 1<<28;
const ll MOD = 1000000007;
const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};

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

	vi v;
	REP(i, IINF) {
		if(i*i > 1<<15)
			break;
		v.pb(i*i);
	}
	int ans[1<<15+1] = {};
	REP(i, v.size()) {
		FOR(j, i, v.size()) {
			FOR(k, j, v.size()) {
				FOR(l, k, v.size()) {
					if(v[i]+v[j]+v[k]+v[l] > 1<<15)
						break;
					ans[v[i]+v[j]+v[k]+v[l]]++;
				}
			}
		}
	}
	int n;
	while(cin >> n, n)
		cout << ans[n] << endl;
	return 0;
}

Measured memory_bytes: 1476
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
#define all(x) (x).begin(), (x).end()
#define endl '\n'
const ll inf = LLONG_MAX;
const long double pi = M_PI;
void Yes() {cout << "Yes" << endl;}
void No() {cout << "No" << endl;}
void YES() {cout << "YES" << endl;}
void NO() {cout << "NO" << endl;}

int main() {
  ll k, s;
  cin >> k >> s;

  ll ans = 0;
  for (ll i = 0; i <= k; i++) {
    for (ll j = 0; j <= k; j++) {
      if (0 <= s - i - j && s - i - j <= k) ans++;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define re register
#define ls (o<<1)
#define rs (o<<1|1)
#define pb push_back
const double PI= acos(-1.0);
const int M = 1e5+7;
/*
int head[M],cnt=1;
void init(int n){cnt=1;for(int i=0;i<=n;i++)head[i]=0;}
struct EDGE{int to,nxt,w;}ee[M*2];
void add(int x,int y,int w){ee[++cnt].nxt=head[x],ee[cnt].w=w,ee[cnt].to=y,head[x]=cnt;}
*/

int main()
{
	ios::sync_with_stdio(false);
  	cin.tie(0);
  	ll a,b,c,d;
  	cin>>a>>b>>c>>d;
  	ll ans=-1e18;
  	ans=max(max(a*c,a*d),max(b*c,b*d));
  	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 3648
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
typedef long long ll;
ll n;
int f[25][25];
int solve(ll n){
	if(!n) return 0;
	ll o=1;int g=0;
	while(o*10<=n) o*=10,g++;
	int x=n/o;
	return max(g*9+x-1,x+solve(n%o));
}
int main(){
	scanf("%lld",&n);
	for(int i=1;i<=18;i++){
		for(int p=0;p<=9;p++){
			for(int j=0;j<=9;j++) f[i][p]=max(f[i][p],f[i-1][j]+p);
		}
	}
	printf("%d",solve(n));
	return 0;
} 

Measured memory_bytes: 764
#include <stdio.h>

int main(){
   int i,n,m,ok[100000],a,b,ans;
   long h[100000];

   scanf("%d %d",&n,&m);
   for (i=0;i<n;i++) {
      scanf("%ld",&h[i]);
      ok[i]=1;
   }
   for (i=0;i<m;i++) {
      scanf("%d %d",&a,&b);
      a--;b--;
      if (h[a]<=h[b]) ok[a]=0;
      if (h[a]>=h[b]) ok[b]=0;
   }
   for (ans=i=0;i<n;i++) ans+=ok[i];
   printf("%d\n",ans);
   return 0;
}


Measured memory_bytes: 2868
#include <iostream>
#define MAX_TEAM 51
#define MAX_PROBLEM 11
using namespace std;

int main(){
	while(1){
		//penaltyTime[???????????????][????????????]:?????????????????????????????£???????????????0??????accept[???????????????]:??????????????£?§£??°???time[???????????????]:????????????????¨?????????????
		int penaltyTime[MAX_TEAM][MAX_PROBLEM]={};
		int accept[MAX_TEAM]={};
		int time[MAX_TEAM]={};
		//M:???????????????????????????T:???????????°???P:????????°???R:?¨??????°
		int M,T,P,R;
		cin>>M>>T>>P>>R;
		
		if(!(M+T+P+R)) break; //????????°????????????
		
		//??\????????????????????§??????
		for(int r=0;r<R;r++){
			//m:???????????????t:??????????????????p:???????????????j:?????????0:??£?§£???
			int m,t,p,j;
			cin>>m>>t>>p>>j;
			if(j==0){
				accept[t]++;
				time[t]+=m+penaltyTime[t][p];
			}else{
				penaltyTime[t][p]+=20;
			}
		}
		
		//?????????????????§??????
		int acc=P;
		int count=0;
		while(1){ //????????£?§£??°????????????????????¨???
			int temp=0;
			bool isSame=false;
			if(acc<0 || count==T) break; //??£?§£??°0???????????????????????¨???????????¨?????????????????¨????????????????????????
			for(int j=1;j<=T;j++){ //????????????1??????????????????
				
				if(acc==accept[j]){
					if(temp==0){
						temp = j;
					}else if(time[temp]==time[j]){
						temp = j;
						isSame=true;
					}else if(time[temp]>time[j]){
						temp=j;
						isSame=false;
					}
				}
			}
			if(temp!=0){
				cout<<temp;
				count++;
				if(isSame){         //??????????????¨????????????????????¢???????????????????????´???=?¨????????????????
					cout<<"=";
				}else if(count!=T){ //??¨?????°?????????????????°??¨???????????´????¨???????????????????
					cout<<",";
				}else{
					cout<<endl;
				}
				accept[temp]=-1; //??¨?????????????????????????????£?§£??°???-1?????????
			}else{
				acc--; //?????¨??????????????£?§£??°???????????????????????????????????´?????????????????£?§£??°?????????
			}
		}
	}

	return 0;
}

Measured memory_bytes: 1160
#define  _USE_MATH_DEFINES
#define  _USE_MATH_DEFINES

#define  rep(i, n) for(int i = 0; i < n; i++)
#define  repx(i, a, n) for(int i = a; i < n; i++)
#define  loop while(1)
#define  lli long long int
#define  aryout(ary) rep(i, ary.size()) cout << ary[i] << (i < ary.size() - 1 ? " " : "\n");
 
#include <iostream>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <map>
#include <utility>
#include <set>

using namespace std;

vector<int> merge(vector<int> v1, vector<int> v2, int &cnt) {

  int v1i = 0, v2i = 0;
  int v1m = v1.size(), v2m = v2.size();

  vector<int> v3;
  while (v1i + v2i < v1m + v2m) {
    if (v1i == v1m) {
      v3.insert(v3.end(), v2.begin() + v2i, v2.end());
      cnt += v2m - v2i;
      break;
    }
    else if (v2i == v2m) {
      v3.insert(v3.end(), v1.begin() + v1i, v1.end());
      cnt += v1m - v1i;
      break;
    }
    else {
      if (v1[v1i] < v2[v2i]) {
        v3.push_back(v1[v1i]);
        v1i += 1;
      }
      else {
        v3.push_back(v2[v2i]);
        v2i += 1;
      }
      cnt += 1;
    }
  }
  return v3;
}

vector<int> merge_sort(vector<int> v, int &cnt) {
  if (v.size() > 1) {
    vector<int> v1, v2;
    int mid = v.size() / 2;
    v1.insert(v1.end(), v.begin(), v.begin() + mid);
    v2.insert(v2.end(), v.begin() + mid, v.end());

    return merge(merge_sort(v1, cnt), merge_sort(v2, cnt), cnt);
  }
  else {
    return v;
  }
}


int main() {

  int n;
  cin >> n;

  vector<int> v(n);
  rep(i, n) cin >> v[i];

  int cnt = 0;
  vector<int> ans = merge_sort(v, cnt);
  aryout(ans);
  cout << cnt << endl;

  return 0;
}



Measured memory_bytes: 17148
fun main(args:Array<String>) {
    val n= readLine()!!.toInt()
    var result = 0.0
    for(i in 1..n){
        val (x,u)=readLine()!!.split(" ")
        if(u=="JPY") {
            result += x.toDouble()
        }else{
            result += ( x.toDouble() * 380000.0 )
        }
    }
    println(result)
}

Measured memory_bytes: 37848
a=raw_input()
b=raw_input()
c=raw_input()

next = 'a'

while True:
    if next == 'a':
        next = a[0]
        a = a[1:]
        if len(a) == 0:
            print 'A'
            break
    elif next == 'b':
        next = b[0]
        b = b[1:]
        if len(b) == 0:
            print 'B'
            break
    else:
        next = c[0]
        c = c[1:]
        if len(c) == 0:
            print 'C'
            break

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

#define fast ios_base:: sync_with_stdio(false),cin.tie(0),cout.tie(0);
#define int long long
#define pb emplace_back
#define mp make_pair
#define ff first
#define ss second

typedef long long ll;
typedef long double ld;
int32_t main(){
	fast;
	int n,k;	cin >> n >> k;
	if(k==1){
		cout << 0;
		return 0;
	}
	cout << n-k;
}






Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define pii pair<ll ,int>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 1e6+5;
const ll mod=1e18;
ll n,m,a[maxn],b[100],f[maxn];
int main(){
    ios::sync_with_stdio(false);
    cin>>n;
    ll temp;
    b[1]=1;
    for(int i=2;i<=45;i++){
        b[i]+=b[i-1]+i;
    }
    for(int i=1;i<45;i++)
        for(int j=b[i];j<b[i+1];j++){
            f[j]=i;
        }
    for(ll i=2;i*i<=n;i++){
        if(n%i==0){
            m++;
        }
        while(n%i==0){
            a[m]++;
            n/=i;
        }
    }
    if(n!=1){
        m++;
        a[m]++;
    }
    ll ans=0;
    for(int i=1;i<=m;i++){
        ans+=f[a[i]];
    }
    cout<<ans<<'\n';
    return 0;
}


Measured memory_bytes: 3664
#include<iostream>
#include<sstream>
#include<vector>
#include<iterator>
#include<iomanip>
using namespace std;

int main(void)
{
    int N;
    cin >> N;

    double jpy, btc;
    jpy = btc = 0;
    for (int i = 0; i < N; i++) {
        double x;
        string u;
        cin >> x >> u;

        if (u == "JPY")
            jpy += x;
        else
            btc += x;
    }

    cout << fixed << setprecision(30) << jpy + 380000.0*btc << endl;

    return 0;
}


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

using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

#define REP(i, l, n) for(int i=(l), i##_len=(n); i<i##_len; ++i)
#define ALL(x) (x).begin(),(x).end()
#define pb push_back

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

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

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

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

int main(){
    int n; cin >> n;
    vector<int> lis(100010, 0);
    int key = pow(10010, 0.5);
    REP(x, 1, key+10){
        REP(y, 1, key + 10){
            REP(z, 1, key + 10){
                int mid = x * x + y * y + z * z + x * y + y * z + z * x;
                lis[mid]++;
            }
        }
    }
    REP(i, 1, n+1){
        cout << lis[i] << endl;
    }
}

Measured memory_bytes: 3792
// luogu-judger-enable-o2
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#define inf 0x7FFFFFFF
#define N 110000
using namespace std;
vector<int>a[N];
int l1[N],r1[N],l2[N],r2[N],val[N],n,u,v,k;
bool dfs1(int u,int fa){
//	printf("%d %d:\n",u,fa);
	l1[u]=-inf;r1[u]=inf;
	if(val[u]!=-inf) l1[u]=r1[u]=val[u];
//	for(int i=0;i<a[u].size();++i)
//		printf("  %d\n",a[u][i]);
	for(int i=0;i<a[u].size();++i){
		if(a[u][i]==fa) continue;
		if(!dfs1(a[u][i],u)) return false;
		if(l1[a[u][i]]==-inf) continue;
		l1[a[u][i]]-=1,r1[a[u][i]]+=1;
		if(r1[u]==inf) l1[u]=l1[a[u][i]],r1[u]=r1[a[u][i]];
		else{
			if(r1[a[u][i]]<l1[u] or r1[u]<l1[a[u][i]]) return false;
			if(abs(l1[u]-l1[a[u][i]])%2==1) return false;
			l1[u]=max(l1[u],l1[a[u][i]]);
			r1[u]=min(r1[u],r1[a[u][i]]);
		}
		l1[a[u][i]]+=1,r1[a[u][i]]-=1;
	}
	return true;
}
void dfs2(int u,int fa){
	if(l2[fa]==-inf) l2[u]=l2[fa],r2[u]=r2[fa];
	else{
		l2[u]=l2[fa]-1;r2[u]=r2[fa]+1;
	}
	l2[u]=max(l2[u],l1[u]);
	r2[u]=min(r2[u],r1[u]);
	
	if(val[u]!=-inf) l2[u]=r2[u]=val[u];
	for(int i=0;i<a[u].size();++i)	
		if(a[u][i]!=fa) dfs2(a[u][i],u);
}
int main(){
//	freopen("a.in","r",stdin);
	scanf("%d",&n);
	for(int i=1;i<n;++i){
		scanf("%d%d",&u,&v);
		a[u].push_back(v);
		a[v].push_back(u);
	}
	scanf("%d",&k);
	for(int i=1;i<=n;++i) val[i]=-inf;
	for(int i=1;i<=k;++i) scanf("%d%d",&u,&v),val[u]=v;
	int yu=dfs1(1,0);
	if(yu){
		printf("Yes\n");
		l2[0]=-inf;
		r2[0]=inf;
		dfs2(1,0);
		for(int i=1;i<=n;++i) printf("%d\n",l2[i]); 
	}
	else printf("No");
	return 0;
}

Measured memory_bytes: 16384
using System;
using System.Collections.Generic;
using System.Linq;

class Program {
    static int ReadInt() { return int.Parse(Console.ReadLine()); }
    static int[] ReadInts() { return Console.ReadLine().Split().Select(int.Parse).ToArray(); }
    static string[] ReadStrings() { return Console.ReadLine().Split(); }

    static long Calc(int[] xs) {
        long ans = 0;
        long sum = 0;
        for (int i = 0; i < xs.Length; i++) {
            if (xs[i] == 0) {
                ans += sum / 2;
                sum = 0;
            }
            else {
                sum += xs[i];
            }
        }
        ans += sum / 2;
        return ans;
    }

    static void Main() {
        int n = ReadInt();
        var xs = new int[n];
        for (int i = 0; i < n; i++) {
            xs[i] = ReadInt();
        }
        Console.WriteLine(Calc(xs));
    }
}

Measured memory_bytes: 7128
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <set>
#include <climits>
#include <queue>
#include <cstring>
#include <stack>
#include <map>
#include <ctime>
using namespace std;
#define rep(i,a,b) for(int i=a; i<=b; i++)
#define ii pair <int, int>
#define fi first
#define se second
#define ll unsigned long long
string s[2]={"Second", "First"};

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0);
//	freopen("Test.inp", "r", stdin);
//    freopen("Test.out", "w", stdout);
    int n, k;
    cin>>n>>k;
    vector <bool> b(k+1, false);
    vector <int> a(n);
    for(int &i:a) cin>>i;
    rep(i,a[0], k){
        for(int j:a) if(j<=i&&b[i-j]==0) b[i]=true;
    }
    cout<<s[b[k]];
	return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;

class Program
{
    static void Main(string[] args)
    {
        Program pg = new Program();
        pg.Exe();
    }
    public void Exe()
    {
        int num = int.Parse(Console.ReadLine());
        double ans = (num + Math.Pow(num, 2) + Math.Pow(num, 3));
        Console.WriteLine(string.Format("{0}",ans));
    }
}



Measured memory_bytes: 27904
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int D,N;
  cin >> D >> N;
  
  vector<int> T(D);
  for (int i = 0; i < D; i++) cin >> T.at(i);
  
  vector<vector<int>> ABC(N, vector<int>(3));
  for (int i = 0; i < N; i++) cin >> ABC.at(i).at(0)
                                   >> ABC.at(i).at(1)
                                   >> ABC.at(i).at(2);
  
  vector<vector<vector<int>>> dp( D , 
          vector<vector<int>>   ( N ,
                  vector<int>   ( N, -1)));
  
  for (int i = 0; i < N; i++) {
    if (ABC.at(i).at(0) <= T.at(0) && T.at(0) <= ABC.at(i).at(1)) {
      for (int j = 0; j < N; j++) {
        dp.at(0).at(i).at(j) = 0;
      }
    }
  }

  for (int i = 1; i < D; i++) {
    for (int j = 0; j < N; j++) {
      
      if (ABC.at(j).at(0) <= T.at(i) && T.at(i) <= ABC.at(j).at(1)) {

        for (int k = 0; k < N; k++) {
          dp.at(i).at(j).at(k) = 0;
        
          for (int l = 0; l < N; l++) {
            if (dp.at(i-1).at(k).at(l) == -1) continue;
            dp.at(i).at(j).at(k) = max(dp.at(i).at(j).at(k),
                                       dp.at(i-1).at(k).at(l) + abs(ABC.at(k).at(2) - ABC.at(j).at(2)));
          }
        }
        
      }
      
    }
  }
  
  int ans = 0;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      ans = max(ans, dp.at(D-1).at(i).at(j));
    }
  }
  
  cout << ans << endl;

  return 0;
}


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

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

  if ( (a*b)%2==0 ) {
    cout << "Even" << endl;
  }
  if ( (a*b)%2==1 ){
    cout << "Odd" << endl;
  }
}


Measured memory_bytes: 256
#AのリストにCのリストを加えて大きい順に並べ替えてNまでの和を求める
N,M = map(int,input().split())

#Aの入力
A_list = list(map(int,input().split()))

C_list = []

#Cのリストに追加する
for i in range(M):
    bi,ci = map(int,input().split())
    C_list.append([bi,ci])

#C_listをCの値でソート
C_list=sorted(C_list, reverse=True, key=lambda x:x[1])

count = 0
for bi,ci in C_list:
    count += bi
    if count > N:
        #countがNより大きくなったらNより大きくなった分だけ使う
        bi = N - count + bi
    A_list.extend([ci]*bi)

#A_Listを大きい順に並べ替える
A_list=sorted(A_list,reverse=True)

#N番目までの総和を求める
print(sum(A_list[0:N]))


Measured memory_bytes: 28284
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <iomanip>

using namespace std;

int main() {
	string S;
	cin >> S;
	string ans;
	int num0 = S[0] - '0';
	int num1 = S[1] - '0';
	int num2 = S[2] - '0';
	int num3 = S[3] - '0';
	int classify = 0;
	if (num0 == 0 && num1 > 0) classify += 2;
	else if (num0 == 1) {
		if (num1 <= 2) classify += 2;
	}
	if (num2 == 0 && num3 > 0) classify += 1;
	else if (num2 == 1) {
		if (num3 <= 2) classify += 1;
	}

	if (classify == 0) ans = "NA";
	else if (classify == 1) ans = "YYMM";
	else if (classify == 2) ans = "MMYY";
	else if (classify == 3) ans = "AMBIGUOUS";
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 3660
import java.util.*;
 
public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	String s = scan.nextLine();
      	int size = s.length();
      	char a = s.charAt(0);
      	char z = s.charAt(size - 1);
      	System.out.print(a);
      	System.out.print(size - 2);
      	System.out.print(z);
      	scan.close();
    } 
}

Measured memory_bytes: 24916
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<math.h>
#include<string.h>

#define maxn 200010
typedef long long ll;
int a[maxn];
ll f[maxn];
 
int open()
{
    freopen("datain.txt","r",stdin);
    freopen("dataout.txt","w",stdout);
}
int main(void)
{
    //open();
    ll mi,s;
    int i,n;
    scanf("%d",&n);
        memset(a,0,sizeof(a));
        memset(f,0,sizeof(f));
        for(i=0;i<n;i++)
            scanf("%d",&a[i]);
        for(i=0,s=0;i<n;i++)
        {
            s+=a[i];
            f[i+1]=s;
        }
        for(i=2,mi=labs(s-2*f[1]);i<n;i++)
            if(mi>labs(s-2*f[i])) mi=labs(s-2*f[i]);
        printf("%I64d\n",mi);

    return 0;
}

Measured memory_bytes: 2560
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Remoting.Metadata.W3cXsd2001;
using System.Web;

namespace Competitive
{
    internal class Solution
    {
        public int N;
        public int[,] M;
        public int[,] DP;

        public void Run()
        {
            N = Input.ReadInt();
            M = new int[2, N];
            for (int y = 0; y < 2; y++)
            {
                var vals = Input.ReadIntArray();
                for (int x = 0; x < N; x++)
                {
                    M[y, x] = vals[x];
                }
            }

            DP = new int[2, N];

            for (int y = 0; y < 2; y++)
                for (int x = 0; x < N; x++)
                {
                    int u = (y == 0 ? 0 : DP[y - 1, x]) + M[y, x];
                    int l = (x == 0 ? 0 : DP[y, x - 1]) + M[y, x];
                    DP[y, x] = Math.Max(u, l);
                }

            Console.WriteLine(DP[2 - 1, N - 1]);

        }
    }

    // libs ----------


    // common ----------

    internal static class Input
    {
        public static string ReadString()
        {
            string line = Console.ReadLine();
            return line;
        }

        public static int ReadInt()
        {
            string line = Console.ReadLine();
            return int.Parse(line);
        }

        public static int[] ReadIntArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(int.Parse).ToArray();
        }

        public static long ReadLong()
        {
            string line = Console.ReadLine();
            return long.Parse(line);
        }

        public static long[] ReadLongArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(long.Parse).ToArray();
        }

        public static double[] ReadDoubleArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(double.Parse).ToArray();
        }
    }

    internal class Program
    {
        public static void Main(string[] args)
        {
            var s = new Solution();
            s.Run();
        }
    }
}

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

#define int long long
#define pb push_back
#define ff first
#define ss second

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    
    int t=1;
    //cin>>t;
    
    while(t--)
    {
        int x;
        cin>>x;
        
        cout<<1-x;
    }
}

Measured memory_bytes: 3604
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define y1 kek
const int N = 2e5 + 7;
int num(char c) {
    if (c == 'L') return 0;
    else if (c == 'R') return 1;
    else if (c == 'U') return 2;
    else return 3;
}   
int n, m;
int x, y;
int len;
string s, t;
int x1, y1, x2, y2;
void upd1(char c) {
    if (c == 'L') {
        ++y1;
    }   
    else if (c == 'R') {
        --y2;
    }   
    else if (c == 'U') {
        ++x1;
    }   
    else {
        --x2;
    }
    x1 = max(x1, 1ll);
    x2 = min(x2, n);
    y1 = max(y1, 1ll);
    y2 = min(y2, m);     
}
void upd2(char c) {
    if (c == 'L') {
        ++y2;
    }   
    else if (c == 'R') {
        --y1;
    }   
    else if (c == 'U') {
        ++x2;
    }   
    else {
        --x1;
    }   
    x1 = max(x1, 1ll);
    x2 = min(x2, n);
    y1 = max(y1, 1ll);
    y2 = min(y2, m);     
}   
signed main() {
    #ifdef HOME
    freopen("input.txt", "r", stdin);
    #else
    ios_base::sync_with_stdio(0); cin.tie(0);
    #endif
    cin >> n >> m >> len >> x >> y >> s >> t;    
    x1 = 1; y1 = 1; x2 = n; y2 = m;
    for (int i = len - 1; i >= 0; --i) {
        upd2(t[i]);
        upd1(s[i]);    
        //cout << x1 << ' ' << y1 << ' ' << x2 << ' ' << y2 << '\n';
        if (x2 < x1 || y2 < y1) {
            cout << "NO\n";
            exit(0);
        }   
    }
    if (x1 <= x && x <= x2 && y1 <= y && y <= y2) {
        cout << "YES\n";
    }        
    else {
        cout << "NO\n";
    }   
}  

Measured memory_bytes: 920
#include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <iterator>

using namespace std;

#define ll long long

ll ans[15] = {};
int main() {
	ll r, d ,x;
	cin >> r >> d >> x;

	ans[0] = x;

	for (int i = 1; i <= 10; i++) {
		ans[i] = r * ans[i - 1] - d;
	}

	for (int i = 1; i <= 10; i++)
	{
		cout << ans[i] << endl; 
	}
}


Measured memory_bytes: 256
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
/*
//#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
*/

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
/*
//#if __cplusplus >= 201103L
#include <array>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
*/
using namespace std;
#define fi first
#define se second
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb(s) push_back(s)
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define mp(a,b) make_pair(a,b)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl

#define uni(x) x.erase(unique(all(x)),x.end())
template<class T,class U>inline void chmin(T &t,U f){if(t>f)t=f;}
template<class T,class U>inline void chmax(T &t,U f){if(t<f)t=f;}
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) > (b) ? (b) : (a))

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<P, int> PPI;

#define INF INT_MAX/3
#define MAX_N 1000
#define M_INF 1000000000
int n,m,v,i;
void solve(){
   cin.tie(0);
  ios::sync_with_stdio(false);
  cin>>n>>m;
  if(n>=m) cout<<10<<endl;
  else cout<<0<<endl;

}

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


Measured memory_bytes: 892
import java.util.Arrays;
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int X = sc.nextInt();
		int Y = sc.nextInt();
		int Z = sc.nextInt();
		
		int hako = 0;
		
		hako = X;
		X = Y;
		Y = hako;
		
		hako = X;
		X = Z;
		Z = hako;
		
		System.out.println(X);
		System.out.println(Y);
		System.out.println(Z);
	}
}


Measured memory_bytes: 35736
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cstdlib>

using namespace std;

int n, a, cnt;

int main() {
    scanf("%d", &n);
    while(n --)
        scanf("%d", &a), cnt ^= a & 1;
    if(cnt)
        puts("NO");
    else
        puts("YES");
}

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

//template< unsigned mod >
//struct RollingHash {
//	vector< unsigned > hashed, power;
//
//	inline unsigned mul(unsigned a, unsigned b) const {
//		unsigned long long x = (unsigned long long) a * b;
//		unsigned xh = (unsigned)(x >> 32), xl = (unsigned)x, d, m;
//		asm("divl %4; \n\t" : "=a" (d), "=d" (m) : "d" (xh), "a" (xl), "r" (mod));
//		return m;
//	}
//
//	RollingHash(const string &s, unsigned base = 10007) {
//		int sz = (int)s.size();
//		hashed.assign(sz + 1, 0);
//		power.assign(sz + 1, 0);
//		power[0] = 1;
//		for (int i = 0; i < sz; i++) {
//			power[i + 1] = mul(power[i], base);
//			hashed[i + 1] = mul(hashed[i], base) + s[i];
//			if (hashed[i + 1] >= mod) hashed[i + 1] -= mod;
//		}
//	}
//
//	unsigned get(int l, int r) const {
//		unsigned ret = hashed[r] + mod - mul(hashed[l], power[r - l]);
//		if (ret >= mod) ret -= mod;
//		return ret;
//	}
//
//	unsigned connect(unsigned h1, int h2, int h2len) const {
//		unsigned ret = mul(h1, power[h2len]) + h2;
//		if (ret >= mod) ret -= mod;
//		return ret;
//	}
//
//	int LCP(const RollingHash< mod > &b, int l1, int r1, int l2, int r2) {
//		int len = min(r1 - l1, r2 - l2);
//		int low = -1, high = len + 1;
//		while (high - low > 1) {
//			int mid = (low + high) / 2;
//			if (get(l1, l1 + mid) == b.get(l2, l2 + mid)) low = mid;
//			else high = mid;
//		}
//		return (low);
//	}
//};
//
//using RH = RollingHash< 1000000007 >;
//using RH2 = RollingHash< 1000000009 >;

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

	vector<vector<LL>>ssum(26, vector<LL>((int)s.size() + 1, 0)); {

		vector<vector<LL>>b(26, vector<LL>((int)s.size() + 1, 0));
		FOR(i, 0, (int)s.size()) {
			b[s[i] - 'a'][i]++;
		}
		FOR(i, 0, 26) {
			FOR(j, 0, (int)s.size()) {
				ssum[i][j + 1] += ssum[i][j] + b[i][j];
			}
		}
	}
	auto cntquery = [&](int c, int l, int r) {
		return ssum[c][r] - ssum[c][l];
	};
	auto query = [&](int c, int l, int r) {
		return lower_bound(ssum[c].begin() + l, ssum[c].begin() + r, ssum[c][l]+ 1LL) - ssum[c].begin();
	};
	LL ans = 0;
	LL si = 0;
	FOR(ti, 0, (int)t.size()) {
		bool found = 0;
		{ //[si,s)
			LL cnt = cntquery(t[ti] - 'a', si, (int)s.size());
			if (cnt) {
				LL fs = query(t[ti] - 'a', si, (int)s.size());
				ans += fs - si;
				si = fs;
				found = 1;
			}
		}
		if (!found) {
			//[0,si)
			ans += (LL)s.size() - si;
			LL cnt = cntquery(t[ti] - 'a', 0, si);
			if (cnt) {
				LL fs = query(t[ti] - 'a', 0, si);
				ans += fs;
				si = fs;
				found = 1;
			}
		}
		//cerr << ans << ", " << si << endl;
		if (!found) {
			ans = -1;
			break;
		}

	}
	//cerr << "case end" << endl;

	cout << ans << endl;
}




Measured memory_bytes: 42096
#include<stdio.h>
#include<string.h>
#define CH 256

int main(void){
    char a[CH];
    scanf("%s",a);
    if(strcmp(a, "SUN") == 0){
        printf("7\n");
    } else if(strcmp(a, "MON") == 0){
        printf("6\n");
    } else if(strcmp(a,"TUE") == 0){
        printf("5\n");
    } else if(strcmp(a, "WED") == 0){
        printf("4\n");
    } else if(strcmp(a, "THU") == 0){
        printf("3\n");
    } else if(strcmp(a,"FRI") == 0){
        printf("2\n");
    } else if(strcmp(a,"SAT") == 0){
        printf("1\n");
    }
    return 0;
}

Measured memory_bytes: 128
#include <stdio.h>

int main()
{
	int num, i;
	scanf("%d", &num);
	int data[num];
	for (i = 0; i < num; i++) {
		scanf("%d", &data[i]);
	}
	for (i = num - 1; i > 0; i--) {
		printf("%d ", data[i]);
	}
	printf("%d\n", data[0]);
	return 0;
}

Measured memory_bytes: 596
#include <iostream>
#include <cstdio>

using namespace std;

int main() {
    while(1) {
        string s;
        int m;
        cin >> s;
        if(s == "-") break;
        cin >> m;
        int h[110];
        for(int i = 0; i < m; i++) {
            cin >> h[i];
        }

        for(int i = 0; i < m; i++) {
            s += s.substr(0, h[i]);
            s.replace(0, h[i], "");
        }
        cout << s << endl;

    }
    return 0;
}


Measured memory_bytes: 3216
//             بسم الثالوث الاقدس

#include<iostream>	
#include<algorithm>
#include<cstdio>
#include<sstream>
#include<cmath>
#include<climits>
#include<string>
#include<iomanip>
#include<vector>
#include<map>
using namespace std;
//********************************************************************************************
//******************************************************************************************** 
/*
jesus help me.......
*/
typedef long long lld;
typedef char c;

				
bool prime(int x)
{
	if (x == 1)
		return false;
	else if (x == 2)
		return true;
	for (int i = 2; i*i <= x; i++)
	{
		if (x%i == 0)
			return false;

	}
	return true;
}
void fun2(int t)
{
	if (t == 1)
	{
		cout << "*";
		return;
	}
	cout << "*";
	return fun2(t - 1);
}

void fun(int s)
{
	map<int, int>asd;
	map<int, int>::iterator ir;
	ir = asd.begin();
	ir->first;
	if (s)
	{
		cout << s % 10 << endl;
		fun(s / 10);
		
	}
}
long long numb(long long i){
	if ( i == 2 || i == 1)
		return 1;
	else{
		long long n = i, z = 0;
		while (n>1){
			if (i%n == 0){
				z++;
			}
			n--;
		}
		return z;
	}

}
bool s(int x)
{
	int a, b, c, d;
	a = x % 10;
	b = x % 100 / 10;
	c = x % 1000 / 100;
	d = x / 1000;
	if (a != b&&a != c&&a != d&&b != c&&b != d&&c != d)
		return true;
	else
		return false;
}
bool st(string s, int k)
{
	int n=0;
	for (int i = 0; i < s.size(); i++)
	{
		if (s[i] == '4' || s[i] == '7')
			n++;
	}
	if (n <= k)
		return true;
	return false;
}

/*
jesus help me.......
jesus help me.......
jesus help me.......
*/

int main()
{
	std::ios_base::sync_with_stdio(0);
	cin.tie(NULL); cout.tie(NULL);
	
	string s;
	cin >> s;
	char c = s[0];
	int n = 1, a = 0;
	for (int i = 1; i < 4; i++)
	{
		if (s[i] == c)
		{
			n++;
		}
		else
		{
			n = 1;
			c = s[i];
		}
		if (n > a)
			a = n;
	}
	if (a >= 3)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;

	//system("pause");
	return 0;
}
/*
jesus help me.......
jesus help me.......
jesus help me.......
*/

Measured memory_bytes: 256
K,N=map(int,input().split())
A=list(map(int,input().split()))
A.append(A[0])
max=(K-A[-2])+A[0]
for i in range(N):
  if A[i]-A[i-1]>max:
    max=A[i]-A[i-1]
print(K-max)

Measured memory_bytes: 26420
import java.util.Scanner;
 
public class Main {
 
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in) ;
		System.out.println(calculate(sc.next()));
	}
	static String calculate(String s){
		int a = 0;
		int b = 0;
		for(char c: s.toCharArray()){
			a += c == 'A'? 1 : 0;
			b += c == 'B'? 1 : 0;
		}
		if(a == 2 && b == 1) return "Yes";
		if(a == 1 && b == 2) return "Yes";
		return "No";
	}
 
}

Measured memory_bytes: 23124
N = int(input())

"""
引き算のみ
N mod K == -1
N-1 mod K == 0
K はN-1の約数

割り算が含まれる
KはNの約数
大した個数ないので、確かめる。
"""

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

A = make_divisors(N-1)
B = make_divisors(N)
ANS = set(A)
for b in B:
  if b <= 1:
    continue
  wk = N
  while wk % b == 0:
    wk = wk // b
  if wk % b == 1:
    ANS.add(b)
    
print(len(ANS)-1) # 1を除く

Measured memory_bytes: 9284
import java.util.*;
import java.util.Map.Entry;
import java.io.*;
public class Main{
	public static void main(String[] args) {
		MyScanner sc=new MyScanner();
		PrintWriter pw=new PrintWriter(System.out);
		
		int n=sc.nextInt();
		int k=sc.nextInt();
		TreeMap<Integer, Integer> map=new  TreeMap<Integer, Integer>();
		while(n-->0){
			int x=sc.nextInt();
			map.put(x, map.getOrDefault(x, 0)+1);
		}
		ArrayList<Integer> c=new ArrayList<Integer>();
		for(Entry<Integer 	, Integer> e : map.entrySet()){
			c.add(e.getValue());
		}
		if(c.size()<=k)
			pw.println(0);
		else{
			Collections.sort(c);
			int ans=0;
			for(int i=0;i<c.size()-k;i++)
				ans+=c.get(i);
			pw.println(ans);
		}
		
		pw.flush();
		pw.close();
	}
	
	static class MyScanner{
		BufferedReader br;
		StringTokenizer st;
		
		MyScanner(){
			br=new BufferedReader(new InputStreamReader(System.in));
		}
		String next(){
			while(st==null || !st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (Exception e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}
		int nextInt(){
			return Integer.parseInt(next());
		}
		long nextLong(){
			return Long.parseLong(next());
		}
	}
}


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

using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using vint = vector<int>;
using vvint = vector<vint>;
using vvvint = vector<vvint>;
using vdouble = vector<double>;
using vvdouble = vector<vdouble>;
using vvvdouble = vector<vvdouble>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using uint = unsigned int;
using ull = unsigned long long;

template<typename T> using uset = unordered_set<T>;
template<typename T1, typename T2> using umap = unordered_map<T1, T2>;

constexpr int INF = (1 << 30) - 1;
constexpr ll LLINF = 1LL << 60;
constexpr int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
constexpr int dx[] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr char el = '\n';
constexpr int mod = 1000000007;

template<typename T> T gcd(T a, T b) { return (b ? gcd(b, a % b) : a); }
template<typename T> T lcm(T a, T b) { return (a / gcd(a, b) * b); }
template<typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) { return (a > b && (a = b, true)); }
template<typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) { return (a < b && (a = b, true)); }

template<typename T>
ostream& operator <<(ostream &os, vector<T> &v) {
	os << v[0];
	for (int i = 1; i < v.size(); i++) os << " " << v[i];
	return (os);
}

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

template<typename T1, typename T2>
istream& operator >>(istream &is, pair<T1, T2> &p) {
	return (is >> p.first >> p.second);
}


void Main() {
	int A, B, M; cin >> A >> B >> M;
	vint a(A), b(B); cin >> a >> b;
	
	int minv = *min_element(begin(a), end(a)) + *min_element(begin(b), end(b));
	for (int i = 0; i < M; i++) {
		int x, y, c;
		cin >> x >> y >> c; --x, --y;
		chmin(minv, a[x] + b[y] - c);
	}
	cout << minv << endl;
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(0);
	cout << fixed << setprecision(20);
	Main();
	return (0);
}


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

int main() 
{
  int wigth;
  while (cin >> wigth) {
    int i = 1;
    bool flag = false;
    while (i <= 512) {
      if (wigth & i) {
	if (flag) cout << " ";
	cout << i;
	flag = true;
      }
      i *= 2;
    }
    cout << endl;
  }

  return 0;
}

Measured memory_bytes: 1160
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<cmath>
#define RG register
#define IL inline
#define inf 2147483640
#define LL long long
#define pi acos(-1.0)
#define db double
#define N 305
using namespace std;
IL int gi()
{
	RG int res=0,w=1;
	RG char ch;
	for(ch=getchar();(ch<'0'||ch>'9')&&ch!='-';ch=getchar());
	if(ch=='-') w=-1,ch=getchar();
	for(;ch>='0'&&ch<='9';ch=getchar()) res=10*res+ch-48;
	return res*w;
}
LL map[N][N];
int n;LL ans=0;
int main()
{
	//freopen("2.in","r",stdin);
	//freopen("2.out","w",stdout);
	n=gi();
	for(RG int i=1;i<=n;++i)
		{
			for(RG int j=1;j<=n;++j)
				{
					map[i][j]=gi();
				}
		}
	RG int flag=0;
	for(RG int i=1;i<=n;++i)
		{
			for(RG int j=i+1;j<=n;++j)
				{
					flag=0;
					for(RG int k=1;k<=n&&!flag;++k)
						{
							if(k==i||k==j) continue;
							if(map[i][k]+map[k][j]==map[i][j])
								flag=1;
							else if(map[i][k]+map[k][j]<map[i][j])
								flag=2;
						}
					if(flag==2) {printf("-1\n");return 0;}
					if(!flag) ans+=map[i][j];
				}
		}
	printf("%lld",ans);
	//fclose(stdin);fclose(stdout);
	return 0;
}

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


int main() {
  double a,b,h,m;
  cin >> a >> b >> h >> m;
  double long_theta, short_theta;
  long_theta = m/60.0 * 2.0 * PI;
  short_theta = ((h/12.0) + (1.0/12.0)*(m/60.0)) * 2.0 * PI;
  //cout<< "st  " << short_theta << endl;
  double lx, ly, sx, sy;
  lx = b*cos(long_theta);
  ly = b*sin(long_theta);
  sx = a*cos(short_theta);
  sy = a*sin(short_theta);
  double ans;
  ans=sqrt((lx-sx)*(lx-sx) + (ly-sy)*(ly-sy));
  //cout << ans;
  printf("%.20f",ans);
  return 0;
}

Measured memory_bytes: 4100
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
const int mod = 1e9 + 7;
//const int mod = 998244353;
const ll infll = (1LL << 62) - 1;
const int inf = (1 << 30) - 1;
void YesNo(bool j){cout << (j ? "Yes" : "No") << endl; return;}
void yesno(bool j){cout << (j ? "yes" : "no") << endl; return;}
template<class Head> void pt(Head&& head){cout << head << endl; return;}

int a[12][12];

int main() {
    int n,m,x;
    cin >> n >> m >> x;
    vector<int> c(n);
    rep(i,n) {
        cin >> c[i];
        rep(j,m) cin >> a[i][j];
    }
    int tot=inf;
    rep(i,1<<n) {
        int ntot=0;
        vector<int> em(m,0);
        rep(j,n) {
            if(i>>j&1) {
                ntot+=c[j];
                rep(k,m) em[k]+=a[j][k];
            }
        }
        bool ok=true;
        rep(j,m) if(em[j]<x) ok=false;
        if(ok) tot=min(tot,ntot);
    }
    if(tot==inf) tot=-1;
    pt(tot);
    return 0;
}


Measured memory_bytes: 3612
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lvector vector<ll>
#define lque queue<ll>
#define lpque priority_queue<ll>
#define dlpque priority_queue<ll,lvector,greater<ll>>
#define P pair<ll,ll>
#define ALL(a) (a).begin(),(a).end()
#define rep(i,n) for(ll (i)=0; (i)<(n); ++(i))
#define print(a) cout << (a) << endl

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n,sum=0,ans=0;cin>>n;
  lvector A(n,0);rep(i,n) cin>>A[i];
  rep(i,n) {
    if(A[i]!=0) sum+=A[i];
    else {
      ans+=sum/2;
      sum=0;
    }
  }
  ans+=sum/2;
  print(ans);
  return 0;
}

Measured memory_bytes: 1024
from collections import Counter

bag = Counter()

N  = int(input())

word_s = []
word_t = []

for i in range(N):
    bag[input()] += 1

M  = int(input())
for i in range(M):
    bag[input()] -= 1

max = sorted(bag.items(), key=lambda item: item[1], reverse=True)[0][1]

if max > 0:
    print(max)
else:
    print(0)

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

int N, M;
vector<int> par;
vector<int> t_rank;

void init_union_find(int n) {
	par.resize(n);
	for (int i = 0; i < n; i++)
		par[i] = i;
	t_rank.resize(N, 0);
}

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

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

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

void input_init(void) {
	cin >> N >> M;
	init_union_find(N);
	int x, y, z;
	for (int i = 0; i < M; ++i) {
		cin >> x >> y >> z;
		--x;
		--y;
		unite(x, y);
	}
}

int solve(void) {
	int cnt = 0;
	for (int i = 0; i < N; ++i) {
		if (par[i] == i)
			++cnt;
	}
	return cnt;
}

int main(void) {
	input_init();
	int ans = solve();

	cout << ans << '\n';
	return 0;
}


Measured memory_bytes: 1024
from heapq import heapify, heappush, heappop


def main():
    n, m = [int(x) for x in input().split()]
    a = [(-int(x), int(x)) for x in input().split()]

    heapify(a)
    # print(a)

    for _ in range(m):
        x = (heappop(a))[1] // 2
        heappush(a, (-x, x))
        # print(a)

    print(sum([y for x, y in a]))


main()


Measured memory_bytes: 24212
#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin>>s;
  if(s[0]==s[1] || s[1]==s[2]||s[2]==s[3]){
    cout<<"Bad"<<endl;
  } else {
    cout<<"Good"<<endl;
  }
  return 0; 
}

Measured memory_bytes: 384
N = int(input())
S = input()

S_num = []
S_ans = []

alpha2num = lambda c: ord(c) - ord('A') + 1
num2alpha = lambda c: chr(c+64)

for i in range(len(S)):
    tmp = alpha2num(S[i]) + N
    if int(tmp) >= 27:
        tmp = int(tmp) - 26
    
    S_num.append(tmp)

for t in range(len(S)):
    S_ans.append(num2alpha(S_num[t]))

print("".join(S_ans))

Measured memory_bytes: 3188
const data = require('fs').readFileSync(0, 'utf-8')

const lines = data.split('\n').map(l => {
  const [x, op, y] = l.split(' ')
  return [Number(x), op, Number(y)]
})

lines.forEach(([x, op, y]) => {
  switch (op) {
    case '+':
      console.log(x + y)
      break
    case '-':
      console.log(x - y)
      break
    case '*':
      console.log(x * y)
      break
    case '/':
      console.log(Math.floor(x / y))
      break
    case '?':
      break
  }
})



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

#define VIC ios::sync_with_stdio(0);cin.tie(0);ios_base::sync_with_stdio(0);
#define sfi(x) scanf("%d", &x)
#define sfi2(x, y) scanf("%d%d", &x,&y)
#define sfl2(x, y) scanf("%I64d%I64d", &x,&y)
#define sfl(x) scanf("%I64d", &x)
#define sfd(x) scanf("%lf", &x)
#define sfd2(x, y) scanf("%lf%lf", &x, &y)
#define sfs(x) scanf("%s", &x)
#define wtf(s) freopen((s), "w", stdout)
#define rff(s) freopen((s), "r", stdin)
#define mod 998244353
#define pi (2 * acos(0))
typedef long double ld;
typedef long long ll;
const int N = 4e5 + 5;
//g++ -std=c++11 main.cpp && a.exe

vector<bool> prime (N + 1, true);
vector<int> primes;

void sieve(int n)
{
    prime[0] = prime[1] = false;
    for (int i = 2; i <= n; i++)
    {
        if (prime[i])
            primes.push_back(i);
        for (int j = i * i; j <= n && prime[i] && i * 1ll * i <= n; j += i)
    	    prime[j] = false;
    }
}


int main()
{
    VIC
    int n, c = 0;
    cin >> n;
    sieve(55555);
    int ind = 0;
    for (int i = 0; i < primes.size() && n; i++)
    {
      	if (primes[i] % 10 == 1)
        	cout << primes[i] << ' ', n--;
    }
    return 0;
}


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

#define MOD (1000000000+7)

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

	long long sum = N * (N + 1) / 2;
	long long ans = 0;
	for( long long i = K; i <= N + 1; i++ ) {
		long long mi = (i - 1) * i / 2;
		long long ma = sum - (N - i + 1) * (N - i) / 2;
		ans += ma - mi + 1;
		ans %= MOD;
	}

	cout << ans << endl;
}

Measured memory_bytes: 3644
#include<bits/stdc++.h>
using  namespace std;
using ll = long long;
ll h,w;
int main()
{
	//freopen("input.txt","r",stdin);
	cin>>h>>w;
	if(h==1 or w==1)
	{
		cout<<1<<endl;
	}
	else
	{
		ll a,b;
	if(h&1) a=h/2+1;
	else a=h/2;
	if(w&1) b=w/2+1;
	else b=w/2;
	ll c;
	if(w&1)
	 {
	 	c=(b+b-1)*(h/2);
	 if(h&1) c+=b;
	 cout<<c<<endl;
	 }
	 else
	 {
	 	c=(w/2)*h;
	 	cout<<c<<endl;
	 }
	}
	return 0;
 } 

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

int main(void){
	int n;
	long long int i;
	long long int ans=0;

	scanf("%d",&n);
	for(i=1;i<=n;i++){
		if(i%3==0){
			continue;
		}else if(i%5==0){
			continue;
		}else{
			ans=ans+i;
		}
	}
	printf("%lld",ans);
	return 0;
}

Measured memory_bytes: 1736
N = $stdin.read.strip.to_i

def f(x)
  x * (x + 1) / 2
end

sum_all = f(N)
sum_3 = f(N / 3) * 3
sum_5 = f(N / 5) * 5
sum_15 = f(N / 15) * 15

puts sum_all - sum_3 - sum_5 + sum_15


Measured memory_bytes: 14332
L,R = map(int,input().split())
ans = 2019
if (R-L+1 >= 2019):
    ans = 0
else:
    for i in range(R-L+1):
        for j in range(R-L-i):
            ans = min(ans,( ( (L+i)%2019) * ((L+i+j+1)%2019) ) % 2019 )
print(ans)


Measured memory_bytes: 2940
n = int(input())
A = [list(map(int, input().split())) for _ in range(n)]

ans = 0
cannot = 0
for i in range(n-1):
  for j in range(i+1,n):
    detour = min([A[i][k] + A[k][j] for k in range(n) if k!=i and k!=j]+[10**18])
    if detour<A[i][j]:
      cannot = 1
    elif detour>A[i][j]:
      ans += A[i][j]
if cannot:
  print(-1)
else:
  print(ans)


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

using ll = long long;

int main() {
  int N, K;
  scanf("%d%d", &N, &K);
  vector<ll> H(N, 0);
  for (int i = 0; i < N; i++) {
    scanf("%lld", &H.at(i));
  }

  sort(H.begin(), H.end(), greater<ll>());
  ll ans = 0LL;
  for (int i = K; i < N; i++) {
    ans += H.at(i);
  }

  printf("%lld", ans);
  return 0;
}


Measured memory_bytes: 1792