akhauriyash/Code-Regression huggingface dataset:
#pragma comment(linker, "/stack:200000000")
        #pragma GCC optimize ("Ofast")
        #pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
        #include <iostream>
        #include <iomanip>
        #include <sstream>
        #include <cstring>
        #include <vector>
        #include <deque>
        #include <queue>
        #include <set>
        #include <map>
        #include <valarray>
        #include <iterator>
        #include <functional>
        #include <limits>
        #include <algorithm>
        #include <numeric>
        #include <cmath>
        #include <cassert>
        #include <unordered_map>
        #include <unordered_set>
        #include <stack>
        using namespace std;
        #define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
         #define trace(x) cerr << #x << ": " << x << " " << endl;
     
        typedef int64_t ll;
     
        #define endl '\n'
        #define int ll
        ll mod=1e9+7;
        ll mod1=1e9+5;
        ll power(ll a,ll b)
        {
            if(b==0) return 1;
            else if(b%2==0)
                return power((((a%mod)*(a%mod))%mod),b/2)%mod;
            else return ((a%mod)*(power((((a%mod)*(a%mod))%mod),b/2)%mod))%mod;
        }
        
     int32_t main()
        {
            IOS
       
        
            int d[3];
            cin>>d[0]>>d[1]>>d[2];
            sort(d,d+3);
            int x=d[2]-d[0];;
            int y=d[2]-d[1];
            //cout<<x<<" "<<y;
            if(x%2==0 and y%2==0)
            {
                cout<<x/2+y/2;
                return 0;
            }
            if(x%2!=0 and y%2!=0)
            {
                cout<<(x-1)/2+(y-1)/2+1;
                return 0;
            }
            if(x%2!=0 and y%2==0)
            {
                cout<<(x-1)/2+y/2+2;
                return 0;
            }
            if(y%2!=0 and x%2==0)
            {
                cout<<(y-1)/2+x/2+2;
                return 0;
            }

        }

Measured memory_bytes: 256
from itertools import product

N, M = map(int, input().split())
S = []
for _ in range(M):
    xs = list(map(int, input().split()))
    S.append([x - 1 for x in xs[1:]])
P = list(map(int, input().split()))

counter = 0
for sw in product([True, False], repeat=N):
    for i in range(M):
        if sum(1 if sw[j] else 0 for j in S[i]) % 2 != P[i]:
            break
    else:
        counter += 1
print(counter)

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    vector<char> A;
    char prev = '?';
    rep(i, s.size()) {
        if (prev == 'B' && s[i] == 'C')
            A.back() = 'D';
        else
            A.push_back(s[i]);
        prev = s[i];
    }

    ll ans = 0, cnt = 0;
    bool judge = 0;
    for (int i = 0; i < A.size(); i++) {
        if (A[i] == 'A') {
            cnt++;
        } else if (A[i] == 'D') {
            ans += cnt;
        } else
            cnt = 0;
    }

    cout << ans << endl;
}


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

int main(){
	string s,t;
	cin >> s >> t;
	int a,b;
	cin >> a >> b;
	string u;
	cin >> u;
	if(u == s){
		cout << a-1 << ' ' << b << endl;
	}else{
		cout << a << ' ' << b-1 << endl;
	}
}


Measured memory_bytes: 3116
#include <algorithm>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>

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

using namespace std;

typedef long long ll;

const int mod = (int)1e9+7;

ll mod_pow(ll x, ll n, ll mod) {
  ll ret = 1;
  while (n > 0) {
    if (n & 1) {
      ret *= x;
      ret %= mod;
    }
    x = x*x % mod;
    n >>= 1;
  }
  return ret;
}

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

  int n; cin >> n;
  vector<ll> a(n);

  rep(i, n) { cin >> a[i]; }

  vector<ll> cnt_zero(61, 0);
  vector<ll> cnt_one(61, 0);

  rep(i, n) {
    rep(d, 61) {
      if ( (a[i]>>d) & 1 ) {
        cnt_one[d]++;
      } else {
        cnt_zero[d]++;
      }
    }
  }

  ll ans = 0;
  rep(d, 61) {
    ans += mod_pow(2, d, mod)*(cnt_zero[d]*cnt_one[d]%mod);
    ans %= mod;
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 2560
#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <numeric>
#include <climits>
#include <math.h>
#include <memory.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rrep(i, k, n) for(int i = (k); i < (int)(n); i++)
using namespace std;
using ll = long long;
int N, M;
int cnt = 0;
int ans = 0;
int i_index;
int tmp;
int dh[4] = {1, 0, -1, 0};
int dw[4] = {0, 1, 0, -1};
string board[64];
int main(){
    cin >> N;
    vector<int> v;
    rep(i, N){
        int z;
        cin >> z;
        z--;
        v.push_back(z);
    }
    int now = 0;
    int c = 0;
    for(;;){
        if(now == 1){
            cout << c << endl;
            break;
        }
        if(c >= N){
            cout << -1 << endl;
            break;
        }
        c++;
        now = v[now];
    }
    return 0;
}

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

bool p[40000];

void mkP(){
  memset(p, true, sizeof(p));
  p[0] = p[1] = false;

  for(int i = 2; i * i < 40000; i++){
    if(!p[i]) continue;
    for(int j = i + i; j < 40000; j += i){
      p[j] = false;
    }
  }
}

int main(){
  mkP();

  int n;

  while(cin >> n, n){
    int cnt = 0;

    for(int i = 2; i <= n; i++){
      int j = n - i;
      if(i > j) break;
      if(p[i] && p[j]) cnt++;
    }

    cout << cnt << endl;
  }
}

Measured memory_bytes: 1208
n = int(input())
mons = list(map(int,input().split()))
hero = list(map(int,input().split()))

kills=0
mons.insert(0,0)
hero.insert(0,0)
hero.append(0)

#print(mons)
#print(hero)

for i in range(1,n+2):
  if mons[i]>=hero[i-1]:
    kills+=hero[i-1]
    mons[i]-=hero[i-1]
  else:
    kills+=mons[i]
    mons[i]=0
  #print(mons)
  #print(hero)
  #print("kills="+str(kills))
  if mons[i]>=hero[i]:
    kills+=hero[i]
    mons[i]-=hero[i]
    hero[i]=0
  else:
    hero[i]-=mons[i]
    kills+=mons[i]
  #print(mons)
  #print(hero)
  #print("kills="+str(kills))
print(kills)

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

using namespace std;
typedef long long ll;


int main(){
    ll r,g,b,n;
    cin >> r >> g >> b >> n;
    ll ans = 0;
    for(int i=0;i<=n;++i){
        ll val = n - i*r;
        if(val < 0) break;
        for(int j=0;j<=n;++j){
            ll temp = val - j*g;
            if(temp < 0) break;
            if(temp%b==0) ans++;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
	ios_base::sync_with_stdio(false);
	int x, y;
	cin >> x >> y;
	int answer = 2000000000;
	if(x <= y){ answer = min(answer, y - x); }
	if(-x <= y){ answer = min(answer, y + x + 1); }
	if(x <= -y){ answer = min(answer, (-y) - x + 1); }
	if(-x <= -y){ answer = min(answer, (-y) - (-x) + 2); }
	cout << answer << endl;
	return 0;
}



Measured memory_bytes: 256
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In, ' '));
        }

        public void Solve(ConsoleInput cin)
        {
            var N = cin.ReadInt;
            var d = cin.ReadIntArray(N);
            var sum = 0;

            for (int i = 0; i < N - 1; i++)
            {
                for (int j = i + 1; j < N; j++)
                {
                    sum += d[i] * d[j];
                }
            }

            Console.WriteLine(sum);
        }
    }

    public class ConsoleInput
    {
        private readonly System.IO.TextReader _stream;
        private char _separator = ' ';
        private Queue<string> inputStream;
        public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue<string>();
        }
        public string Read
        {
            get
            {
                if (inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for (int i = 0; i < tmp.Length; ++i)
                    inputStream.Enqueue(tmp[i]);
                return inputStream.Dequeue();
            }
        }
        public string ReadLine { get { return _stream.ReadLine(); } }
        public int ReadInt { get { return int.Parse(Read); } }
        public long ReadLong { get { return long.Parse(Read); } }
        public double ReadDouble { get { return double.Parse(Read); } }
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret; }
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret; }
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret; }
    }
}

Measured memory_bytes: 11220
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>

using namespace std;

int main()
{
    int a;
    char comma;
    string blood;
    map<string, int> btype;
    btype["A"] = 0;
    btype["B"] = 0;
    btype["AB"] = 0;
    btype["O"] = 0;
    while(cin >> a >> comma >> blood)
    {
        ++btype[blood];
    }
    cout << btype["A"] << endl;
    cout << btype["B"] << endl;
    cout << btype["AB"] << endl;
    cout << btype["O"] << endl;
}

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

int main()
{
	int n;
	cin >> n;
	string str;
	cin >> str;
	int r = 0, g = 0, b = 0;
	for (char ch : str){
		if(ch == 'R') r++;
		else if(ch == 'G') g++;
		else b++;
	}
	long long ans = (long long)r * (long long)g * (long long)b;
	for (int dist = 1; dist < n; dist++){
		for (int i=0; i+dist+dist < n; i++){
			int j = i+dist;
			int k = j+dist;
			if(str[i] != str[j] && str[i] != str[k] && str[k] != str[j]) ans--;
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 3608
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define Would
#define you
#define please

int main() {
	//おまじない
	cin.tie(0);
	ios::sync_with_stdio(false);


	int X;
	cin >> X;

	int makkusu = (int)pow(X, 0.5);
	int suuretu[1001] = {};
	suuretu[1] = 1;
	rep1(i, makkusu) {
		int suuji = (i + 1);
		while (suuji < X) {
			suuji = suuji * (i + 1);
			if (suuji <= X) suuretu[suuji] = 1;
		}
	}

	for (int i = X; X > 0; i--) {
		if (suuretu[i] == 1) {
			cout << i << "\n";
			break;
		}
	}

	Would you please return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define Eunique(v) v.erase(unique(all(v)),v.end())
#define pvec(v) rep(i,v.size()){cout << v[i] << " ";};cout<<endl;
#define pb push_back
#define pf push_front
#define mod 1e9+7
#define m_p make_pair
 
typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<int,int> pii;
typedef vector<pii> vpii;
typedef pair<ll,ll> pll;
typedef vector<pll> vpll;
typedef vector<vector<int>> vvi;
typedef vector<vector<ll>> vvll;
const double pi = acos(-1.0);
 
ll gcd(ll x, ll y) { return (y == 0) ? x : gcd(y, x % y); }
ll lcm(ll x, ll y) { return x * y / gcd(x, y); }

bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false;

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return false;
        }
    }
    return true;
}

int main()
{
    ll n,x,ans=0;
    cin >> n >> x;
    vll a(n);
    rep(i,n) cin >> a[i];
    if(a[0]>x){
            ans+=a[0]-x;
            a[0]=x;
        }
    rep(i,n-1){
        if(a[i]+a[i+1]>x){
            ans+=a[i]+a[i+1]-x;
            a[i+1]-=(a[i]+a[i+1]-x);
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1024
S = input()
a=int(S[:2])
b=int(S[2:])

if 1<=a<=12:
    if 1<=b<=12:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if 1 <= b <= 12:
        print('YYMM')
    else:
        print('NA')



Measured memory_bytes: 2940
N = int(input())
H = list(map(int, input().split()))

q, c = 0, 0
if len(H) >= 2:
  i = 0
  while i < len(H) - 1 and q == 0:
    if c <= H[i]:
      c = H[i]
    if c > H[i+1] + 1:
      q += 1
    i += 1
    
if q == 0:
  print('Yes')
else:
  print('No')

Measured memory_bytes: 15020
#include<stdio.h>
 
int main(void)
{
    int n;
    int min;
    int max;
    long int sum = 0;
    int i;
    scanf("%d", &n);
    int ai[n];
     
 
    for(i = 0; i < n; i++)
    {
        scanf("%d ", &ai[i]);
        if(i == 0)
        {
            min = ai[0];
            max = ai[0];
        }
         
        if(ai[i] < min)
        {
            min = ai[i];
        }
         
        if(ai[i] > max)
        {
            max = ai[i];
        }
         
        sum += ai[i];
    }
    printf("%d %d %ld\n", min, max, sum);
    return 0;
}
 

 
  

Measured memory_bytes: 644
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    from math import floor

    n = int(readline())
    ans = 0
    for i in range(1, n + 1):
        first = i
        cnt = floor(n / i)
        last = cnt * i
        ans += cnt * (first + last) // 2
    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 63356
#include <bits/stdc++.h>
using namespace std;
#define int long long int
const int N=998244353;
int dp[3005][3005][3];
// i sum type
 main() {
	int n, s;
	cin>>n>>s;
	int arr[n];
	for(int i=0; i<n; i++){
		cin>>arr[i];
	}
	dp[0][0][0]=1;
	dp[0][0][1]=1;
	dp[0][arr[0]][1]=1;
	dp[0][arr[0]][2]=1;
	for(int i=1; i<n; i++){
		for(int j=0; j<=3000; j++){
			dp[i][j][0]=(dp[i][j][0]+dp[i-1][j][0])%N;
			dp[i][j][1]=(dp[i][j][1]+dp[i-1][j][0]+dp[i-1][j][1])%N;
			dp[i][j][2]=(dp[i][j][2]+dp[i-1][j][2]+dp[i-1][j][1])%N;
			if(j+arr[i]<=3000){
				dp[i][j+arr[i]][1]=(dp[i][j+arr[i]][1]+dp[i-1][j][0]+dp[i-1][j][1])%N;
				dp[i][j+arr[i]][2]=(dp[i][j+arr[i]][2]+dp[i-1][j][1]+dp[i-1][j][0])%N;
			}
		}
	}
	cout<<dp[n-1][s][2];
	return 0;
}

Measured memory_bytes: 214840
n=int(input())
xy=[[] for i in range(n)]
for i in range(n):
  a=int(input())
  for j in range(a):
    x,y=map(int,input().split())
    xy[i].append([x,y])
ans=0
for b in range(1<<n):
  cnt=bin(b).count("1")
  ok=True
  for j in range(n):
    if not ok:break
    if b&(1<<j):
      for x,y in xy[j]:
        if y==1 and b&(1<<x-1)==0:ok=False
        if y==0 and b&(1<<x-1):ok=False
  if ok:
    ans=max(cnt,ans)
print(ans)



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

using namespace std;

int main() {
    long n;
    cin >> n;
    vector<long> a(n), b(n), c(n-1);
    for (long i = 0; i < n; ++i) {
        cin >> a[i];
    }
    for (long i = 0; i < n; ++i) {
        cin >> b[i];
    }
    for (long i = 0; i < n-1; ++i) {
        cin >> c[i];
    }

    long ans = 0;
    for (long i = 0; i < n; ++i) {
        ans += b[a[i]-1];
        if (i == n-1) {
            break;
        }
        if (a[i]+1 == a[i+1]) {
            ans += c[a[i]-1];
        }
    }
    cout << ans << endl;
	return 0;
}

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

//ABC166E
int main(void) {
  long long n, a, k, i, cou=0, tmp;
  scanf("%lld", &n);
  long long right[n], left[n];

  for(i=0; i<n; i++){
    right[i]=0, left[i]=0;
  }

  for(i=0; i<n; i++){
    scanf(" %lld", &a);
    if(i-a>=0) left[i-a]++;
    if(i+a<n) right[i+a]++;
  }
  for(i=0; i<n; i++){
    cou+=left[i]*right[i];
    //printf("cou=%lld   left[%lld]=%lld right[%lld]=%lld\n",cou,i,left[i],i,right[i]);
  }
  printf("%lld", cou);
  return 0;
}

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

using namespace std;

int main(){
  int a;
  int b;
  int c;
  cin >> a >> b >> c;
  if(a+b+c < 22){
    cout << "win" << endl;
  }
  else{
    cout << "bust" << 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;
  map<string, int> mp;
  char last_word = '-';

  rep(i, 0, n) {
    string s;
    cin >> s;
    if (i) {
      if (s[0] != last_word) {
        cout << "No" << endl;
        return 0;
      }
    }
    last_word = s[((int)s.size()) - 1];
    mp[s]++;
    if (mp[s] > 1) {
      cout << "No" << endl;
      return 0;
    }
  }

  cout << "Yes" << endl;
}


Measured memory_bytes: 3668
using System;
using System.Linq;

class B
{
	static void Main()
	{
		Console.ReadLine();
		var s = new int[3].Select(_ => Console.ReadLine()).ToArray();
		Console.WriteLine(Enumerable.Range(0, s[0].Length).Sum(i => s.Select(x => x[i]).Distinct().Count() - 1));
	}
}


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

using namespace std;

#define _for(i,j,N) for(int i = (j);i < (N);i++)
#define _rep(i,j,N) for(int i = (j);i <= (N);i++)
#define ALL(x) x.begin(),x.end()
#define pb push_back
#define mk make_pair

typedef long long LL;
typedef pair<int,int> pi;

template<typename T>
ostream& operator<<(ostream& os,const vector<T>& v) {
    _for(i,0,v.size()) os << v[i] << " ";
    return os;
}

template<typename T>
ostream& operator<<(ostream& os,const set<T>& v){
    for(typename set<T>::iterator it = v.begin();it != v.end();it++)
    os << *it <<" ";
    return os;
}

template<typename T1,typename T2>
ostream& operator<<(ostream& os,const pair<T1,T2>& v){
    os << v.first <<" "<<v.second<<endl;
    return os;
}

int A,B,C;

int main()
{
    cin >> A >> B >> C;
    cout << min(min(A+B,A+C),B+C) << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define MAXN 100005
using namespace std;
inline int read(){
	int x=0,f=1;
	char ch=getchar();
	while (ch<'0'||ch>'9'){
		if (ch=='-') f=-1;
		ch=getchar();
	}
	while (ch>='0'&&ch<='9'){
		x=(x<<1)+(x<<3)+(ch^'0');
		ch=getchar();
	}
	return x*f;
}
int d[MAXN],vis[MAXN];
deque<int>Q;
inline void Push(int x,int pre,int len,bool flag){
	d[x]=min(d[x],d[pre]+len);
	if (flag) Q.push_front(x);
	else Q.push_back(x);
}
int main(){
	int K=read();
	memset(d,0x3f,sizeof(d));
	Q.push_front(1),d[1]=1;
	while (Q.size()){
		int x=Q.front();Q.pop_front();
		if (!vis[x]) vis[x]=true;
		else continue;
		if (!x){
			printf("%d\n",d[x]);
			return 0;
		}
		Push((x+1)%K,x,1,0);
		Push((x*10)%K,x,0,1);
	}
}

Measured memory_bytes: 1408
// #include<cstdio>

// int main(){
//     int count[26];
// 	for(int i = 0; i < 26; i++){
//         count[i] = 0;
// 	}
// 	char s[1201];
// 	while(fgets(s,1201,stdin) != NULL){
//         for(int i = 0; s[i] != '\0'; i++){
//             for(int j = 0; j < 26; j++){
//                 if(s[i] - 'A' == j || s[i] - 'a' == j){
//                     count[j] = count[j] + 1;
//                 }
//             }
//         }
//         for(int i = 0;i < 26;i++) {
//             printf("%c : %d\n",'a' + i,count[i]);
//         }
//     }

//     return 0;
// }


#include<cstdio>
int main(){
    int i,j,n,count[26];
    for(int i = 0; i < 26; i++){
        count[i] = 0;
 	}
    char ch;
    while(scanf("%c",&ch)!=EOF){
        if(ch>='a' && ch<='z'){
            count[ch-'a']++;
        }
        else if(ch>='A'&& ch<='Z'){
            count[ch-'A']++;
        }
    }
    for(j=0;j<26;j++){
        printf("%c : %d\n",j+'a',count[j]);
    }
    return (0);
}


Measured memory_bytes: 2676
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); ++i)
#define all(x) x.begin(),x.end()
#define ln '\n'
const long double PI = acos(-1.0L);
const long long MOD = 1000000007LL;
// const long long MOD = 998244353LL;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
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; }
////////////////////////////////////////////////////////////////////////////////////////////////////////////

ll x[2];
int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int N; cin >> N;
    vector<ll> A(N);
    rep(i,N) cin >> A[i];
    sort(all(A)); reverse(all(A));
    map<ll, int> dic;
    int cur = 0;
    rep(i,N) {
        dic[A[i]]++;
        if (dic[A[i]]==2) {
            x[cur] = A[i];
            dic[A[i]]=0;
            cur++;
        }
        if (cur == 2) break;
    }
    cout << x[0]*x[1] << ln;
}

Measured memory_bytes: 6272
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
#define MAXN 100
int n,x,a[MAXN+5],cnt;
int main()
{
    scanf("%d%d",&n,&x);
    for(int i=1;i<=n;i++)scanf("%d",&a[i]);
    sort(a+1,a+n+1);
    for(int i=1;i<=n;i++)
    if(x>=a[i])x-=a[i],cnt++;
    else break;
    if(cnt==n&&x)cnt--;
    printf("%d",cnt);
}


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

using namespace std;
int main()
{
	double N, K;
	cin >> N >> K;
	double ans = 0;
	for(double i = 1; i <= min(N, K - 1); i++)
	{
		ans += pow(0.5, ceil(log(K / i) / log(2)));
	}
	ans *= 1 / N;
	if(N > K - 1)
	{
		ans += (N - K + 1) / N;
	}

	printf("%.20f", ans);
	return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
#ifdef _DEBUG_
#define dump(val) cerr << __LINE__ << ":\t" << #val << " = " << (val) << endl
#else
#define dump(val)
#endif

using namespace std;

typedef long long int ll;

template<typename T>
vector<T> make_v(size_t a, T b) {
    return vector<T>(a, b);
}

template<typename... Ts>
auto make_v(size_t a, Ts... ts) {
    return vector<decltype(make_v(ts...))>(a, make_v(ts...));
}

const ll mod = 1000000007;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int H, W;
    cin >> H >> W;
    auto mp = make_v(H, W, ' ');
    REP(i, 0, H) {
        REP(j, 0, W) {
            cin >> mp[i][j];
        }
    }
    auto dp = make_v(H, W, 0LL);
    dp[0][0] = 1;
    REP(i, 0, H) {
        REP(j, 0, W) {
            if (mp[i][j] == '#') continue;
            int ni = i + 1;
            int nj = j + 1;
            if (ni != H) {
                dp[ni][j] = (dp[ni][j] + dp[i][j]) % mod;
            }
            if (nj != W) {
                dp[i][nj] = (dp[i][nj] + dp[i][j]) % mod;
            }
        }
    }

    cout << dp[H - 1][W - 1] << endl;

    return 0;
}


Measured memory_bytes: 9088
#include<bits/stdc++.h>
using namespace std;
const int maxn=100005;
int dp[maxn][3];
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(0);
    int n;
    cin>>n;
    vector<int>a(n),b(n),c(n);
    for(int i=0;i<n;i++)
    {
        cin>>a[i]>>b[i]>>c[i];
    }
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<3;j++)
        {
            if(i==0)
            {
                if(j==0)
                    dp[i][j]=a[i];
                else if(j==1)
                    dp[i][j]=b[i];
                else
                    dp[i][j]=c[i];

            }
            else
            {
                for(int k=0;k<3;k++)
                {
                    if(j==k)
                        continue;
                    else if(j==0)
                        dp[i][j]=max(dp[i][j],dp[i-1][k]+a[i]);
                    else if(j==1)
                        dp[i][j]=max(dp[i][j],dp[i-1][k]+b[i]);
                    else
                    dp[i][j]=max(dp[i][j],dp[i-1][k]+c[i]);

                }
            }
        }
    }
    int mx=0;
    mx=max(max(max(mx,dp[n-1][0]),dp[n-1][1]),dp[n-1][2]);
    cout<<mx<<endl;
    return 0;


}


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

ll MOD = 1e9+7;




int main(){
    ll H, W;
    vector<string> S;
    cin >> H >> W;
    S.resize(H);
    for(int i = 0; i < H; i++) cin >> S[i];

    vector<vector<int>> DP(H, vector<int>(W));
    if(S[0][0] == '#') DP[0][0] = 1;
    for(int i = 0; i < H; i++){
        for(int j = 0; j < W; j++){
            if(0 <= i-1 && 0 <= j-1){
                if(S[i][j] == '#'){
                    if(S[i-1][j] == '#' && S[i][j-1] == '#')DP[i][j] = min(DP[i-1][j], DP[i][j-1]);
                    else if(S[i-1][j] == '#' && S[i][j-1] == '.')DP[i][j] = min(DP[i-1][j], DP[i][j-1]+1);
                    else if(S[i-1][j] == '.' && S[i][j-1] == '#')DP[i][j] = min(DP[i-1][j]+1, DP[i][j-1]);
                    else if(S[i-1][j] == '.' && S[i][j-1] == '.')DP[i][j] = min(DP[i-1][j], DP[i][j-1])+1;
                }
                else DP[i][j] = min(DP[i-1][j], DP[i][j-1]);
            }
            else if(0 <= i-1){
                if(S[i][j] == '#') {
                    if(S[i-1][j] == '#')DP[i][j] = DP[i-1][j]; 
                    else DP[i][j] = DP[i-1][j]+1;
                }
                else DP[i][j] = DP[i-1][j];
            }
            else if(0 <= j-1){
                if(S[i][j] == '#') {
                    if(S[i][j-1] == '#')DP[i][j] = DP[i][j-1]; 
                    else DP[i][j] = DP[i][j-1]+1;
                }
                else DP[i][j] = DP[i][j-1];
            }
        }
    }
    cout << DP[H-1][W-1] << endl;
}


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

public class Main{

	public static void main(String[] args) throws IOException {
		long N = readInt(), M = readInt();
		long min = Math.min(N, M), max = Math.max(N, M);
		if(min == 1 && max == 1) println(1);
		else if(min <= 1) println(min*(max-2));
		else println((min-2)*(max-2));
		exit();
	}

	final private static int BUFFER_SIZE = 1 << 16;
	private static DataInputStream din = new DataInputStream(System.in);
	private static byte[] buffer = new byte[BUFFER_SIZE];
	private static int bufferPointer = 0, bytesRead = 0;
	static PrintWriter pr = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

	public static String readLine() throws IOException {
		byte[] buf = new byte[64]; // line length
		int cnt = 0, c;
		while ((c = Read()) != -1) {
			if (c == '\n')
				break;
			buf[cnt++] = (byte) c;
		}
		return new String(buf, 0, cnt);
	}

	public static String read() throws IOException {
		byte[] ret = new byte[1024];
		int idx = 0;
		byte c = Read();
		while (c <= ' ') {
			c = Read();
		}
		do {
			ret[idx++] = c;
			c = Read();
		} while (c != -1 && c != ' ' && c != '\n' && c != '\r');
		return new String(ret, 0, idx);
	}

	public static int readInt() throws IOException {
		int ret = 0;
		byte c = Read();
		while (c <= ' ')
			c = Read();
		boolean neg = (c == '-');
		if (neg)
			c = Read();
		do {
			ret = ret * 10 + c - '0';
		} while ((c = Read()) >= '0' && c <= '9');

		if (neg)
			return -ret;
		return ret;
	}

	public static long readLong() throws IOException {
		long ret = 0;
		byte c = Read();
		while (c <= ' ')
			c = Read();
		boolean neg = (c == '-');
		if (neg)
			c = Read();
		do {
			ret = ret * 10 + c - '0';
		} while ((c = Read()) >= '0' && c <= '9');
		if (neg)
			return -ret;
		return ret;
	}

	public static double readDouble() throws IOException {
		double ret = 0, div = 1;
		byte c = Read();
		while (c <= ' ')
			c = Read();
		boolean neg = (c == '-');
		if (neg)
			c = Read();

		do {
			ret = ret * 10 + c - '0';
		} while ((c = Read()) >= '0' && c <= '9');

		if (c == '.') {
			while ((c = Read()) >= '0' && c <= '9') {
				ret += (c - '0') / (div *= 10);
			}
		}

		if (neg)
			return -ret;
		return ret;
	}

	private static void fillBuffer() throws IOException {
		bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
		if (bytesRead == -1)
			buffer[0] = -1;
	}

	private static byte Read() throws IOException {
		if (bufferPointer == bytesRead)
			fillBuffer();
		return buffer[bufferPointer++];
	}

	public void close() throws IOException {
		if (din == null)
			return;
		din.close();
	}

	static void print(Object o) {
		pr.print(o);
	}

	static void println(Object o) {
		pr.println(o);
	}

	static void flush() {
		pr.flush();
	}

	static void println() {
		pr.println();
	}

	static void exit() throws IOException {
		din.close();
		pr.close();
		System.exit(0);
	}
}


Measured memory_bytes: 23252
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <functional>
using namespace std;

#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)
#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)
#define int long long int

template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}

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

int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
constexpr ll INF = 1001001001001001LL;
constexpr ll MOD = 1000000007LL;

signed main() {
    int r, g, b; cin >> r >> g >> b;
    int ret = 100*r + 10*g + b;
    if(ret%4 == 0) cout << "YES" << endl;
    else cout << "NO" << endl;
    return 0;
}

Measured memory_bytes: 256
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr=(input.trim()).split("\n").map(Number);
var n=0;
var arr=[0,0,0,0,0,0,0];
for(var i=0;i<Arr.length;i++){
   if(n==0){
      if(i!=0)arr.forEach(function(v){console.log(v);});
      if(Arr[i]==0)break;
      n=Arr[i];
      arr=[0,0,0,0,0,0,0];
    }else{
      n--;
      if(Arr[i]>=60)arr[6]++;
      else if(Arr[i]>=50)arr[5]++;
      else if(Arr[i]>=40)arr[4]++;
      else if(Arr[i]>=30)arr[3]++;
      else if(Arr[i]>=20)arr[2]++;
      else if(Arr[i]>=10)arr[1]++;
      else arr[0]++;
   }
}

Measured memory_bytes: 84040
#include <bits/stdc++.h>
using namespace std;
int main(){
  string s;	cin >> s;
  for(int i=0;i<s.size()-1;i++){
    if(s[i]==s[i+1]){
      cout << "Bad";
      return 0;
    }
  }
  cout << "Good";
}

Measured memory_bytes: 3592
#include<bits/stdc++.h>
using namespace std;
#define IOS std::ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define debug(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define IN freopen("in.txt", "r", stdin);
#define endl '\n'
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
typedef long long ll;
typedef vector<int> VI;
typedef pair<int, int> pii;
const int inf = 0x3f3f3f3f;

VI v;
int n;
void dfs(int x){
   if(x==n){
      for(auto it:v)cout<<char('a'+it);
      cout<<endl;
      return ;
   } 
   int Max=-1;
   for(auto it:v)Max=max(Max,it);
   for(int i=0;i<=Max+1;i++){
      v.pb(i);
      dfs(x+1);
      v.pop_back();
   }
}

int main(){
   IOS;
   cin>>n;
   dfs(0);
   return 0;
}

Measured memory_bytes: 1536
#include<bits/stdc++.h>
using namespace std;
#define For(start,end) for(int i = (int)start;i<(int)end;i++)
using Int = long long int;
using TDim = vector<vector<int>>;
int main(){
    string s;
    cin>>s;
    int  rencount=0;
    bool op=true;
    if(s.at(0)=='R')rencount++;
    if(s.at(1)=='R')rencount++;
    else op=false;
    if(s.at(2)=='R'&&op)rencount++;
    else if(s.at(2)=='R'&&!op)rencount=1;
    cout<<rencount<<endl;
}


Measured memory_bytes: 3624
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define mod 1000000007
#define f(i,a,b) for(ll i=a;i<b;i++)
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ii pair<ll,ll>
#define vii vector<ii>
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define MAX 1e9
 
ll modpow(ll base, ll exp, ll modulus) {base %= modulus;ll result = 1;while (exp > 0) {if (exp & 1) result = (result * base) % modulus;base = (base * base) % modulus;exp >>= 1;}return result;}
const ld pi=acos(-1);

int main(){
    IOS;
    string s;cin>>s;
    bool ok=0;
    f(i,0,s.size()){
        if(s[i]=='h' && s[i+1]=='i'){ok=1;i++;}
        else {ok=0;break;}
    }
    if(!ok)cout<<"No";
    else cout<<"Yes";
    return 0;  
} 





Measured memory_bytes: 256
/*
Author : Gaurav Singh
*/
#include<bits/stdc++.h>
using namespace std;
#define N 5005
#define MOD 1000000007
#define ll long long
#define ld long double
#define ull unsigned long long
#define li long int
#define str string
#define vll vector<ll>
#define pb push_back
#define frn(i,n) for(ll (i) = 0; (i) <(n) ; (i)=(i+1))
#define fr(i,n) for(ll (i) = 1; (i) <=(n) ; (i)=(i+1))
#define frev(i,n) for(ll (i) = n-1; (i) >=(0) ; (i)--)
#define fr1(j,a,b,c) for(ll (j) = a; (j) <c ; (i)=(i+b))
#define w(t) while(t--)
#define fast ios::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL)
void solve(){
    ll n,k;
    cin>>n;
    k=n%10;
    if(k==3){
        cout<<"bon";
    }
    else if(k==0 or k==1 or k==6 or k==8){
        cout<<"pon";
    }
    else{
        cout<<"hon";
    }
}
int main()
{   
   fast;
   int t=1;
    w(t){
        solve();
    }
   return 0;
}   
            

Measured memory_bytes: 3624
n, m, x, y = gets.split.map(&:to_i)
number_x = gets.split.map(&:to_i)
number_y = gets.split.map(&:to_i)
z = [*x+1..y]
r = []
z.each do |z|
  r << z if z > number_x.max && z <= number_y.min
end
puts r.empty? ? "War" : "No War"

Measured memory_bytes: 1788
n, m = map(int, input().split())
a = list(map(int, input().split()))

import heapq
a = [-i for i in a]

heapq.heapify(a)
for i in range(m):
  b = heapq.heappop(a) * (-1)
  heapq.heappush(a, b // 2 * (-1))
print(-sum(a))

Measured memory_bytes: 14252
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
#define int long long
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define all(x) (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define isYES(x) printf("%s\n",(x) ? "YES" : "NO")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define isYes(x) printf("%s\n",(x) ? "Yes" : "No")
#define isIn(x,y,h,w) (x >= 0 && x < h && y >= 0 && y < w)
#define debug(var) cout << "[" << #var << "] " << var << endl

const int INF = 1<<29;
const double EPS=1e-9;
const int MOD=998244353;

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

    int keta = 1;
    int tmp = N;
    while (tmp > 0) {
        tmp -= pow(26, keta);
        keta++;
    }
    keta--;
    string ans = "";
    rep(i, keta) ans += 'z';
    int now = 0;
    rep(i, keta) now += pow(26, i+1);
    keta--;

    while (keta >= 0) {
        while (N < now) {
            now -= pow(26, keta);
            ans[ans.size()-keta-1]--;
        }
        if (now == N) break;
        now += pow(26, keta);
        ans[ans.size()-keta-1]++;
        keta--;
    }
    cout << ans;
}

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

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

using namespace std;
typedef long double ld;
const ld INF = 1e+12;
typedef complex<ld> P;
typedef vector<P> VP;
const ld eps = 1e-8, pi = acos(-1.0);
ld dot (P a, P b) { return real(conj(a) * b); }

int main() {
  int n;
  ld r,t,theta;
  cin>>n>>r>>t;
  theta = t / 180.0 * pi;
  VP p;
  REP(i,n){
    ld x,y;
    cin>>x>>y;
    p.emplace_back(x,y);
  }
  int np1 = n+1;
  int v = np1*np1;
  vector<vector<int>> g(v);
  REP(i,n)REP(j,n)REP(k,n) {
    if (i == j) break;
    if (j == k) continue;
    P a = p[j] - p[i], b = p[k] - p[j];
    if ((dot(a,b)/abs(a*b)) > cos(theta)) {
      g[j*np1+i].push_back(k*np1+j);
    }
  }
  REP(i,n)REP(j,n) {
    if (j != i) g[i*np1+n].push_back(j*np1+i);
  }
  vector<ld> mind(v, INF);
  mind[n] = 0;
  REP(i,r+1) {
    vector<ld> tmp(v, INF);
    ld mint = INF;
    REP(j,v) {
      for (int nx : g[j]) {
        int now = nx % np1;
        int nxt = nx / np1;
        tmp[nx] = min(tmp[nx], mind[j] + abs(p[nxt] - p[now]));
        mint = min(mint, tmp[nx]);
      }
    }
    if (mint > r) {
      cout << i << endl;
      break;
    }
    swap(tmp, mind);
  }
  return 0;
}

Measured memory_bytes: 1368
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,k;
    cin>>n;
    int a[n+1]={0};
    for(int i=1 ; i<n ; i++)
    {
        cin>>k;
        a[k]++;
    }
    for(int j=1;j<n+1;j++)
        cout<<a[j]<<endl;
}


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

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

    bool ok = true;
    rep(i, s.size()) {
        int c = s[i] - '0';
        if (i == a) {
            if (s[i] != '-') ok = false;
        } else {
            if (!(c >= 0 && c <= 9)) ok = false;
        }
    }

    if (ok)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 256
def main():
    N = int(input())
    work = []
    for _ in range(N):
        A, B = map(int, input().split())
        work.append((B,A))

    work.sort()
    
    time = 0
    for b, a in work:
        if b < time + a:
            print('No')
            exit()
        time += a
    print('Yes')

    



if __name__ == "__main__":
    main()

Measured memory_bytes: 67416
N = gets.to_i

MAX = N
QN = Array.new(MAX + 1, 1)
(2..MAX).each do |v|
  v.step(by: v, to: MAX) do |a|
    QN[a] += 1
  end
end

c = 0
(1..(N-1)).each do |v|
  a = N - v
  c += QN[a]
end

puts c


Measured memory_bytes: 22924
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<math.h>
#include<vector>
#include<queue>
#include<map>
#include<stack>
#include<fstream>
#include<stdlib.h>
#include<set>
#include<climits>
#include<cmath>  
#include<memory.h> 
#include<sstream>
#include<time.h>
#include<iomanip>
using namespace std;
const unsigned long long BIGEST=1000000000000000000+1000000000000000000;
const long long BIGER=1000000000000000000;
const int BIG=1000000000;
const long long MOD=998244353;
const long long LMOD=154590409516822759;
//const long long LMOD=1000000007;
#define Fi first
#define Se second
#define P2 pair
#define Pii pair<int,int>
#define Pll pair<long long,long long>
#define Cb make_pair
#define ll long long
#define Ull unsigned long long
#define Sf scanf
#define Pf printf
#define Pb push_back
#define Psh push
#define Stc stack
#define Vct vector
#define Ret return
#define Re0 return 0
#define Sz size
#define Is insert
#define Que queue
#define Emp empty
#define Fro front
#define Rv reverse
#define Er erase
#define Bg begin
#define Srt sort
#define Pq priority_queue
#define Ins insert
#define Ite iterator
#define Cou count
#define Cot continue
#define Beg begin
int f[10005];
int main()
{
	int n;
	cin>>n;
	for(int x=1;x<=100;x++)
	{
		for(int y=1;y<=100;y++)
		{
			for(int z=1;z<=100;z++)
			{
				if(x*(x+y+z)+y*(y+z)+z*z<=10000)
				{
					f[x*(x+y+z)+y*(y+z)+z*z]++;
				}
			}
		}
	}
	for(int i=1;i<=n;i++)
	{
		cout<<f[i]<<endl;
	}
	return 0;
}

Measured memory_bytes: 3524
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long LL;
const LL base=(int)(1e9)+7;
const int maxn=1e5+10;
int h,w,n,tot;
LL a[maxn<<4],ans[20];
int main() {
    while (~scanf("%d%d%d",&h,&w,&n)) {
        memset(ans,0,sizeof(ans));
        tot=0;
        LL zero=(1LL*h-2)*(w-2);
        int x,y;
        for (int i=1;i<=n;i++) {
            scanf("%d%d",&x,&y);
            for (int j=0;j<3;j++) for (int k=0;k<3;k++)
                if (x-j>=1 && x-j<=h-2 && y-k>=1 && y-k<=w-2)
                    a[++tot]=base*(x-j)+(y-k);
        }
        sort(a+1,a+tot+1);
        int cnt=1;
        for (int i=1;i<=tot;i++) {
            if (a[i]==a[i+1]) cnt++;
            else ans[cnt]++, cnt=1, zero--;
        }
        printf("%lld\n", zero);
        for (int i=1;i<=9;i++) printf("%lld\n", ans[i]);
    }
    return 0;
}


Measured memory_bytes: 8320
// Undone
using System;
using System.Linq;
using System.Collections.Generic;
using System.Collections;
public class Program {
  public static void Main() {
    int[] TX = ReadIntArray();
    Console.WriteLine((double)TX[0]/TX[1]);
  }

  private static string ReadStr() { return Console.ReadLine(); }
  private static int ReadInt() { return int.Parse(Console.ReadLine()); }
  private static double ReadDouble() { return double.Parse(Console.ReadLine()); }
  private static long ReadLong() { return long.Parse(Console.ReadLine()); }
  private static char ReadChar() { return Console.ReadLine()[0]; }
  private static string[] ReadStringArray() { return Console.ReadLine().Split(' '); }
  private static int[] ReadIntArray() { return Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); }
  private static double[] ReadDoubleArray() { return Console.ReadLine().Split(' ').Select(double.Parse).ToArray(); }
  private static long[] ReadLongArray() { return Console.ReadLine().Split(' ').Select(long.Parse).ToArray(); }
  private static char[] ReadCharArray() { return Console.ReadLine().ToArray(); }
  private static string[] ReadCharStringArray() { return Console.ReadLine().ToCharArray().Select(c => c.ToString()).ToArray(); }
}


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

using namespace std;

#define INF 1001000100010001000
#define MOD 1000000007
#define EPS 1e-10
#define int long long
#define rep(i, N) for (int i = 0; i < N; i++)
#define Rep(i, N) for (int i = 1; i < N; i++)
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define pii pair<int, int>
#define vi vector<int>
#define vvi vector<vi >
#define vb vector<bool>
#define vvb vector<vb >
#define vp vector< pii >
#define all(a) (a).begin(), (a).end()
#define Int(x) int x; cin >> x;
#define int2(x, y) Int(x); Int(y);
#define int3(x, y, z) Int(x); int2(y, z);
#define in(x, a, b) ((a) <= (x) && (x) < (b))
#define fir first
#define sec second
#define ffir first.first
#define fsec first.second
#define sfir second.first
#define ssec second.second
#define Decimal fixed << setprecision(10)

//int dxy[5] = {0, 1, 0, -1, 0};
// cmd

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

    int2(n, k);
    vp data(n);
    rep(i, n) {
        cin >> data[i].fir;
        data[i].sec = i;
    }

    vi ans;
    int mm = -1;
    sort(all(data));
    reverse(all(data));
    rep(j, n) {
        if (data[j].fir) {
            ans.pb(data[j].sec);
            data[j].fir--;
        } else {
            std::cout << -1 << std::endl;
            return 0;
        }
    }
    mm = data.back().sec;

    rep(i, k) {
        sort(all(data));
        reverse(all(data));
        int mmn = 0;
        rep(j, n) {
            if (data[j].sec != mm && data[j].fir) {
                ans.pb(data[j].sec);
                data[j].fir--;
                mmn = data[j].sec;
            } else if (data[j].sec != mm) {
                std::cout << -1 << std::endl;
                return 0;
            }
        }
        mm = mmn;
    }

    cout << ans.size() << endl;
    rep(i, ans.size()) {
        std::cout << ans[i] + 1 << " ";
    }
    cout << endl;

    return 0;
}


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

vector<pair<long long, long long> > a(long long n) {
    vector<pair<long long, long long> > res;
    for (long long p = 2; p * p <= n; ++p) {
        if (n % p != 0) continue;
        int num = 0;
        while (n % p == 0) { ++num; n /= p; }
        res.push_back(make_pair(p, num));
    }
    if (n != 1) res.push_back(make_pair(n, 1));
    return res;
}


int main() {
    long long N;
    cin >> N;
  	long long res=0;
    auto pairs = a(N);
  	
  	for(auto p:pairs){
      long long e = p.second;
      long long tmp=0, cnt=1;
      while(e>=cnt){
        e -= cnt;
        cnt ++;
        tmp++;
      }
      res += tmp;
    }
  cout <<res<<'\n';
  return 0;
}

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

// #define int long long
#define rep(i, n) for (long long i = (long long)(0); i < (long long)(n); ++i)
#define reps(i, n) for (long long i = (long long)(1); i <= (long long)(n); ++i)
#define rrep(i, n) for (long long i = ((long long)(n)-1); i >= 0; i--)
#define rreps(i, n) for (long long i = ((long long)(n)); i > 0; i--)
#define irep(i, m, n) for (long long i = (long long)(m); i < (long long)(n); ++i)
#define ireps(i, m, n) for (long long i = (long long)(m); i <= (long long)(n); ++i)
#define SORT(v, n) sort(v, v + n);
#define REVERSE(v, n) reverse(v, v+n);
#define vsort(v) sort(v.begin(), v.end());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
#define PI (acos(-1))
#define FILL(v, n, x) fill(v, v + n, x);
#define sz(x) long long(x.size())

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vs = vector<string>;
using vpll = vector<pair<ll, ll>>;
using vtp = vector<tuple<ll,ll,ll>>;
using vb = vector<bool>;

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

const ll INF = 1e9;
const ll MOD = 1e9+7;
const ll LINF = 1e18;

vll G[100100];

signed main()
{
  cin.tie( 0 ); ios::sync_with_stdio( false );
  ll n,m; cin>>n>>m;
  rep(i,m){
    ll a,b; cin>>a>>b; a--,b--;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  
  vll ans(n,-1);
  queue<ll> q;
  q.push(0);
  vb visited(n);
  visited[0]=1;
  while(!q.empty()){
    ll v=q.front(); q.pop();
    for(auto nv: G[v]){
      if(visited[nv]) continue;
      visited[nv]=true;
      ans[nv]=v;
      q.push(nv);
    }
  }
  
  // irep(i,1,n){
  //   if(ans[i]==-1){
  //     cout<<"No"<<endl;
  //     return 0;
  //   }
  // }
  
  
  cout<<"Yes"<<endl;
  irep(i,1,n){
    cout<<ans[i]+1<<endl;
  }
  
}

Measured memory_bytes: 12932
N = gets.to_i
T = []
(N-1).times{
  T << gets.chomp.split(" ").map(&:to_i)
}

tmp = Array.new(N, 0)
ans = [0]
(N-2).downto(0){|i|
  wk = 0
  (i..(N-2)).each{|j|
    (wk = ans[0]; break) if wk < tmp[j]
    c, s, f = T[j]
    wk += s if wk == 0
    wk += (f - (wk % f)) if (wk % f) > 0
    tmp[j] = wk
    wk += c
  }
  ans.unshift(wk)
}

puts ans.join("\n")


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

using namespace std;

void solve() {
    string s;
    cin >> s;
    for (auto& x : s) {
        if (x == '7') {
            cout << "Yes";
            return;
        }
    }
    cout << "No";
}

int main() {
    ios::sync_with_stdio(NULL), cin.tie(0), cout.tie(0);
    cout.setf(ios::fixed), cout.precision(20);

    solve();
}


Measured memory_bytes: 3672
#coding:utf-8

import sys

N,X = map(int,input().split())
L = list(map(int,input().split()))

D = 0 #ジャンプする座標

for i in range(N):
    D += L[i]
    if D > X:
        print(i+1)
        sys.exit()

print(N+1)


Measured memory_bytes: 2940
#include <bits/stdc++.h>
#if !defined(ONLINE_JUDGE)
#include "debug.hpp"
#endif
using namespace std;

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



	int n;
	cin >> n;
	while (n--) {
		cout << "ACL";
	}











	return 0;
}


Measured memory_bytes: 3612