akhauriyash/Code-Regression huggingface dataset:
import copy
n=int(input())
a=list(map(int,input().split()))
b=[0]*n
c=[0]*n
d=[0]*n
for i in range(n):
 b[a[i]-1]+=1
for i in range(n):
 c[i]=b[i]*(b[i]-1)//2
 if b[i]==0:
  continue
 else:
  d[i]=(b[i]-1)*(b[i]-2)//2
sumc=sum(c)
for i in range(n):
 print(sumc-c[a[i]-1]+d[a[i]-1])
cnt=0
#print(b,c,d)


Measured memory_bytes: 84940
#include <bits/stdc++.h>
#define EB emplace_back
#define B0 B[0]
#define B1 B[1]

const int N = 200054, INF = 0x3f3f3f3f;

int n, Ac, Bc, Am = INT_MAX, Bm = INT_MAX;
int p[N];
bool prem[N];
char ans[N];

inline void up(int &x, const int y) {x < y ? x = y : 0;}
inline bool down(int &x, const int y) {return x > y ? x = y, 1 : 0;}
inline int min(const int x, const int y) {return x < y ? x : y;}

class BIT {
	private:
		typedef std::pair <int *, int> ppi;
		int n, x[N];
		std::vector <ppi> history;
	public:
		typedef size_t stamp_t;
		BIT () : n(0) {}
		inline void init(int size, int val) {n = size, std::fill(x + 1, x + (n + 1), val), history.clear();}

		int max(int h) {int s = INT_MIN; for (; h > 0; h &= h - 1) up(s, x[h]); return s;}
		stamp_t upd(int h, int v) {for (; h <= n; h |= h - 1, ++h) if (x[h] < v) history.EB(x + h, x[h]), x[h] = v; return history.size();}

		inline stamp_t stamp() {return history.size();}
		void undo(stamp_t t) {
			int *key, val;
			for (t = history.size() - t; t > 0; --t) std::tie(key, val) = history.back(), *key = val, history.pop_back();
		}
} B[2];

BIT::stamp_t rct0[N], rct1[N];

inline void push(int id, int bel) {ans[id] = bel | 48, bel ? Bc += down(Bm, p[id]) : Ac += down(Am, p[id]);}

int main() {
	int i, u, v, m = INT_MAX, all = 0; bool succ;
	scanf("%d", &n), B0.init(n, 0), B1.init(n, -INF);
	for (i = 0; i < n; ++i) scanf("%d", p + i), p[i] = n - p[i] + 1, all += prem[i] = down(m, p[i]);
	for (i = n - 1; i; --i) {
		u = B0.max(p[i]) + prem[i] + 1, v = B1.max(p[i]) + prem[i] + 1;
		if (u & 1) std::swap(u, v); assert(~u & v & 1);
		rct0[i] = B0.upd(p[i], u), rct1[i] = B1.upd(p[i], v);
	}
	for (i = 0; i < n; ++i) {
		all -= prem[i];
		B0.undo(rct0[i + 1]), B1.undo(rct1[i + 1]);
		m = Ac - Bc + (p[i] < Am) + all, succ  = m >= 0 && B[m & 1].max(min(Bm, n)) >= m;
		m = Bc - Ac - (p[i] < Am) + all, succ |= m >= 0 && B[m & 1].max(min(Am, n)) >= m;
		if (succ) push(i, 0);
		else {
			push(i, 1);
			m = Ac - Bc + all, succ  = m >= 0 && B[m & 1].max(min(Bm, n)) >= m;
			m = Bc - Ac + all, succ |= m >= 0 && B[m & 1].max(min(Am, n)) >= m;
			if (!succ) return puts("-1"), 0;
		}
	}
	assert(Ac == Bc);
	return puts(ans), 0;
}

Measured memory_bytes: 66456
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define mp make_pair
#define PI pair<ll,ll>
#define poly vector<ll>
#define mem(a) memset((a),0,sizeof(a))
#define For(i,l,r) for(int i=(int)(l);i<=(int)(r);i++)
#define Rep(i,r,l) for(int i=(int)(r);i>=(int)(l);i--)
#define pb push_back
#define fi first
#define se second
#define SZ(x) ((int)(x.size()))
inline char gc(){
    static char buf[100000],*p1=buf,*p2=buf;
    return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}
#define gc getchar
inline ll read(){
	ll x = 0; char ch = gc(); bool positive = 1;
	for (; !isdigit(ch); ch = gc())	if (ch == '-')	positive = 0;
	for (; isdigit(ch); ch = gc())	x = x * 10 + ch - '0';
	return positive ? x : -x;
}
inline void write(ll a){
    if(a<0){
    	a=-a; putchar('-');
	}
    if(a>=10)write(a/10);
    putchar('0'+a%10);
}
inline void writeln(ll a){write(a); puts("");}
inline void wri(ll a){write(a); putchar(' ');}
inline ull rnd(){
	return ((ull)rand()<<30^rand())<<4|rand()%4;
}
const int K=62;
string to[130];
int jb[K],sum;
int ask(string x){
	cout<<"? "<<x<<endl;
	return read();
}
int main(){
	#ifdef Brollan
		//freopen("1.in","r",stdin);
	#endif
	For(i,0,25)to[i]+='a'+i;
	For(i,26,51)to[i]+=i-26+'A';
	For(i,52,61)to[i]+=i-52+'0';
	For(i,0,K-1){
		string s;
		For(j,1,128)s+=to[i];
		jb[i]=128-ask(s);
		sum+=jb[i];
	}
	string ans;
	For(i,1,jb[0])ans+=to[0];
	For(i,1,K-1){
		For(oo,1,jb[i]){
			int l=0,r=ans.size();
			while(l<r){
				int mid=(l+r)>>1; mid++;
				string jj=ans.substr(0,mid);
				jj+=to[i]; For(j,mid,ans.size()-1)if(ans[j]==to[i][0])jj+=to[i];
				if(ask(jj)==sum-(int)jj.size())l=mid; else r=mid-1;
			}
			ans.insert(l,to[i]);
		}
	}
	cout<<"! "<<ans<<endl;
}


Measured memory_bytes: 3812
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define ins insert
#define pqueue(x) priority_queue<x,vector<x>,greater<x>>
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
#define vtpl(x,y,z) vector<tuple<x,y,z>>
#define rev(x) reverse(x);
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
using vpl=vector<pl>;
using vvpl=vector<vpl>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[8]={1,0,-1,0,1,1,-1,-1};
const ll dx[8]={0,-1,0,1,1,-1,1,-1};
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
vector<long long> divisor(long long n) {
    vector<long long> ret;
    for (long long i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i * i != n) ret.push_back(n / i);
        }
    }
    sort(ret.begin(), ret.end()); // 昇順に並べる
    return ret;
}
int main(){
  ll n,k,sum=0;cin >> n >>k;
  vl a(n);rep(i,n)cin >> a[i],sum+=a[i];
  vl div=divisor(sum);
  ll ans=0;
  for(auto p:div){
    vl rem;ll res=0;
    rep(i,n){
      rem.pb(a[i]%p);
      res+=a[i]%p;
    }
    sort(all(rem));rev(all(rem));
    ll sub=res/p;
    ll x=0;
    rep(i,n){
      if(sub>i)continue;
      x+=rem[i];
    }
    if(x<=k)chmax(ans,p);
  }
  cout << ans <<endl;
}

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

int A,B,K;

int main()
{
    scanf("%d%d%d",&A,&B,&K);

    for(int i = 0; i < min(K,B - K - A + 1); i++)printf("%d\n",A + i);
    for(int i = 0; i < K; i++)if(A <= B - K + 1 + i)printf("%d\n",B - K + 1 + i);
}


Measured memory_bytes: 256
import java.util.*;
import java.io.*;
import static java.lang.Math.*;

public class Main {
    static int[] max;
    static ArrayList<Integer>[] list;
    public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int n = sc.nextInt();
		int m = sc.nextInt();
		max = new int[n];
		list = new ArrayList[n];
		for(int i = 0; i < n; i++){
		    list[i] = new ArrayList<Integer>();
		}
		for(int i = 0; i < m; i++){
		    int from = sc.nextInt()-1;
		    int to = sc.nextInt()-1;
		    list[from].add(to);
		}
		//System.out.println(Arrays.deepToString(list));
		
		// 計算
		int result = 0;
		for(int i = 0; i < n; i++){
		    dfs(i);
		}
		for(int i = 0; i < n; i++){
		    result = max(result, max[i]);
		}
		
		// 出力
		System.out.println(result);
	}
	
	public static int dfs(int i){
	    if(max[i] != 0) return max[i];
	    int dist = 0;
	    for(Integer next : list[i]){
	        dist = max(dist, dfs(next)+1);
	    }
	    max[i] = dist;
	    return dist;
	}

	public static class Scanner {
		private BufferedReader br; private StringTokenizer tok;
		public Scanner(InputStream is) throws IOException { br = new BufferedReader(new InputStreamReader(is));}
		private void getLine() throws IOException { while(!hasNext()) tok = new StringTokenizer(br.readLine());}
		private boolean hasNext() { return tok != null && tok.hasMoreTokens();}
		public String next() throws IOException { getLine(); return tok.nextToken();}
		public int nextInt() throws IOException { return Integer.parseInt(next());}
		public long nextLong() throws IOException { return Long.parseLong(next());}
		public double nextDouble() throws IOException { return Double.parseDouble(next());}
	}
}


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

int MOD = 1e9+7;

map<long, int> pf(long n) {
  map<long, int> ma;
  for (long i = 2; i * i <= n; i++) {
    while (n % i == 0) ma[i]++, n /= i;
  }
  if (n != 1) ma[n]++;
  return ma;
}

long inv(long a) {
  long b = MOD, u = 1, v = 0;
  while (b) {
    long t = a / b;
    a -= t * b; swap(a, b);
    u -= t * v; swap(u, v);
  }
  u %= MOD;
  if (u < 0) u += MOD;
  return u;
}

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) cin >> A.at(i);
  vector<int> cnt(1e6+1);
  for (auto a : A) {
    for (auto [x, y] : pf(a)) cnt.at(x) = max(cnt.at(x), y);
  }
  long lcm = 1;
  for (int i = 0; i < 1e6+1; i++) {
    int tmp = cnt.at(i);
    while (tmp--) {
      lcm *= i;
      lcm %= MOD;
    }
  }
  long ans = 0;
  for (auto a : A) {
    auto i = inv(a);
    ans += lcm * i;
    ans %= MOD;
  }
  cout << ans << "\n";
}

Measured memory_bytes: 7232
import itertools

N, M = map(int, input().split())
k_list = [ list(map(int, input().split())) for _ in range(M)]
p_list = list(map(int, input().split()))

ans = 0
for node in list(itertools.product([0,1], repeat=N)):
  # 各組み合わせで試す ON:1, OFF:0
  ans_a = 0
  for i in range(M):
    # 各条件に当てはまっているか試す
    k = k_list[i]
    cnt = 0
    for j in range(k[0]):
      # スイッチがOnの個数を数える
      cnt += node[k[j+1]-1]
    if cnt % 2 == p_list[i]:
      ans_a += 1
  if ans_a == M:
    ans += 1
      
print(ans)

Measured memory_bytes: 3188
#include<stdio.h>
#include<string.h>
#include<iostream>
#include<algorithm>
#include<string.h>
#include<math.h>
#define ll long long
using namespace std;
int main()
{
    int n;
    scanf("%d",&n);
    ll a[100005],i;
    ll b[100005];
    for(i=0; i<n; i++)
        scanf("%lld",&a[i]),b[i]=0;
    if(a[0]!=0)
            printf("0\n");
    else
    {
        ll ans=1;
        for(i=0;i<n;i++)
            b[a[i]]++;
         if(b[0]>1) cout << "0" ; 
        else{
        for(i=1;i<n;i++)
        {
            ans*=b[a[i]-1];
            ans%=998244353;
        }
            
        printf("%lld\n",ans);}
    }
    return 0;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define brep(i,n) for(int i=n-1;i>=0;i--)
#define rep1(i,n) for(int i=1;i<n;i++)
#define cY cout<<"Yes"<<endl
#define cN cout<<"No"<<endl
#define ll long long

unsigned const int MOD = 1e9+7;



int main(void){
    ll a,b,ans,k;
    cin >> k >> a >> b;
    k++;
    ans = a;
    if(b-a>=2){
        if((k-a)%2 ==1)ans += ((k-a)/2)*(b-a)+1;
        else ans+=(k-a)*(b-a)/2;
    }
    else ans = k;
    cout << ans <<endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const ll MOD = 1000000007;

int main(){
    ll N, M;
    cin >> N >> M;
    if(N > M){
        swap(N, M);
    }
    if(N == 1 && M == 1){
        cout << 1 << endl;
    }else if(N == 1){
        cout << M - 2 << endl;
    }else{
        cout << (N - 2) * (M - 2) << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include<iostream>

int main(){
    int W,H;
    while(true){
        std::cin>>H>>W;
        if(W==0&&H==0)break;
        else{
            for(int i=0;i<H;i++){
                for(int j=0;j<W;j++){
                    if(i==0||i==H-1){
                        std::cout<<"#";
                    }
                    else{
                        if(j==0||j==W-1){
                            std::cout<<"#";
                        }
                        else{
                            std::cout<<".";
                        }
                    }
                }
                std::cout<<"\n";

            } 
        } 
        std::cout<<"\n";
    }
   
}


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

using LL = long long;
constexpr LL MAXN = 1e12;

void solve(int k){
    queue<LL> Q;
    if (k <= 9) {cout << k << endl; return;}
    else for(int i = 1; i <= 9; ++ i) Q.push(i);
    int cnt = 9;
    while (!Q.empty()){
        LL temp = Q.front(); Q.pop();
        for (int i = -1; i <= 1; ++ i){
            int one = temp % 10 + i;
            if (one >= 0 && one < 10) {
                    Q.push(1LL * temp * 10+ one);
                    ++ cnt;
                    if (cnt == k){cout << 1LL * temp * 10+ one << endl; return;}
            }
        }
    }
}

int main(){
    int k; cin >> k;
    solve(k);
    return 0;
}

Measured memory_bytes: 768
#include <iostream>
#include <math.h>


int main(void){
    double a,b,x;
    std::cin >> a;
    std::cin >> b;
    std::cin >> x;

    double theta;
    if(x/a > 0.5*a*b){
        theta = 180.0 * atan( 2.0*(b/a - x/(a*a*a)) ) / M_PI;    
    }else{
        theta = 180.0 * atan((a*b*b)/(2.0*x)) /M_PI;
    }
    printf("%10.10lf\n",theta);
    
}

Measured memory_bytes: 384
// #include "pch.h"
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <climits>
#include <string>
#include <cmath>
#include <bitset>
#include <complex>
#include <functional>
#include <ctime>
#include <cassert>
#include <fstream>
#include <stack>
#include <random>

typedef long long ll;
typedef std::pair<int, int> Pii;
typedef std::pair<long long, long long> Pll;
typedef std::pair<double, double> Pdd;

#define rip(i, n, s) for (int i = (s);i < (int)( n ); i++)
#define all(a) a.begin(), a.end()
#define MM << " " <<

template<typename T>
using MaxHeap = std::priority_queue<T>;
template<typename T>
using MinHeap = std::priority_queue<T, std::vector<T>, std::greater<T>>;

template<typename T>
inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template<typename T>
inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}

template<typename T>
void vdeb(std::vector<T> &da) {
    for (int i = 0;i < da.size();i++) {
        if (i == da.size() - 1) std::cout << da[i];
        else std::cout << da[i] << ' ';
    }
    std::cout << '\n';
}
template<typename T>
void vdeb(std::vector<std::vector<T>> &da) {
    for (int i = 0;i < da.size();i++) {
        std::cout << i << ' ';
        vdeb(da[i]);
    }
    std::cout << '\n';
}

using namespace std;

int h, w, k; 

int check(vector<string> &da, int a, int b) {
    int ans = 0;
    rip(i,h,0) {
        rip(j,w,0) {
            if(((a >> i)&1)==0 && ((b >> j)&1) == 0) {
                if(da[i][j] == '#') ++ans;
            }
        }
    }
    return ans;
}

int main() {
    int n; cin >> n;
    vector<ll> da(n);
    rip(i,n,0) cin >> da[i];
    MaxHeap<Pll> pq;
    ll ans = 0;
    sort(all(da));
    reverse(all(da));
    pq.push({da[0], da[0]});
    rip(i, n, 1) {
        auto now = pq.top(); pq.pop();
        ans += now.first;
        pq.push({da[i], now.first});
        pq.push({da[i], now.second});
    }
    cout << ans << endl;
}

Measured memory_bytes: 9028
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.next();
		int n = str.length();
		String s1 = str.substring(0, (n - 1) / 2);
		String s2 = str.substring((n + 3) / 2 - 1, n);
		//System.out.println(s1);
		//System.out.println(s2);
		char[] a = s1.toCharArray();
		char[] b = s2.toCharArray();
		int a1 = 0;
		int b1 = 0;//回文になっていなければ①増やす→0ならば回文
		for (int i = 0; i < (n - 1) / 4; i++) {
			if (a[i] != a[(n - 1) / 2 - 1 - i]) {
				a1++;
			}
		}
		for (int i = 0; i < (n - 1) / 4; i++) {
			if (b[i] != b[(n - 1) / 2 - 1 - i]) {
				b1++;
			}
		}
		char[] c = str.toCharArray();
		int c1 = 0;
		for (int i = 0; i < (n - 1) / 2; i++) {

			if (c[i] != c[n - 1 - i]) {
				c1++;
			}
		}
		if (a1 == 0 && b1 == 0 && c1 == 0) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

	}

}


Measured memory_bytes: 21972
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
using ll=long long;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define MOD  1000000007
const ll INF=1e18;
template<class T>void show(vector<T>v){for (int i = 0; i < v.size(); i++){cerr<<v[i]<<" ";}cerr<<endl;}
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b){ a = b; return 1; } return 0; }

vector<ll> ans;

void dfs(ll n) {
  if (n > 3234566667) return;
  ans.pb(n);
  ll d = n % 10;
  if (d != 0) dfs(n * 10 + d - 1);
  if (d != 9) dfs(n * 10 + d + 1);
  dfs(n * 10 + d);
}

int main(int argc, char const *argv[]) {
  ll k; cin >> k;
  rep(i, 9) dfs(i + 1);
  sort(all(ans));
  cout << ans[k-1] << endl;
  return 0;
}


Measured memory_bytes: 1400
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC150A
{
    class Program
    {
        static void Main(string[] args)
        {
            int k, x;

            var word = Console.ReadLine().Split(' ');

            k = int.Parse(word[0]);
            x = int.Parse(word[1]);

            if (500 * k >= x)
            {
                Console.WriteLine("Yes");
            }

            else
            {
                Console.WriteLine("No");
            }

            Console.ReadKey();
        }
    }
}


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

int main(){
    int N;
    cin >> N;
    int ans = 1000 - (N % 1000);
    if (ans == 1000) ans = 0;
    cout << ans << endl;
}

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

int main(){
  int N,M;
  cin >> N >> M;
  
  vector<vector<int>> A(M,vector<int>(2));
  for(int i=0;i<M;i++){
    for(int j=0;j<2;j++){
      cin >> A[i][j];
    }
  }
  
  bool juko=true;
  
  for(int i=0;i<M;i++){
    for(int j=0;j<i;j++){
      if(A[i][0]==A[j][0]&&A[i][1]!=A[j][1]){
        juko=false;
      }
    }
  }
  
  int sum=0;
  
  for(int i=1;i<N+1;i++){
    for(int j=0;j<M;j++){
      if(A[j][0]==i){
        sum=sum+A[j][1]*pow(10,N-i);
        break;
      }
    }
  }
  
  if(sum<pow(10,N-1)&&N!=1){
    sum=sum+pow(10,N-1);
  }
  
  for(int i=0;i<M;i++){
    if(A[i][0]>N){
      juko=false;
    }
      else if(A[i][0]==1&&A[i][1]==0&&N>=2){
        juko=false;
      }
    }
 
  
  
  
  if(juko==true){
    cout << sum << endl;
  }
  else{
    cout << -1 << endl;
  }
}
        
    


Measured memory_bytes: 256
/*  chuckie   */
#include <bits/stdc++.h>
//#define CHUCKIE
 
#define cint(d) scanf("%d", &d)
#define cint2(a, b) scanf("%d %d", &a, &b)
#define cint3(a, b, c) scanf("%d %d %d", &a, &b, &c)
#define cint4(a, b, c, d) scanf("%d %d %d %d", &a, &b, &c, &d)
 
#define clong(d) scanf("%lld", &d)
#define clong2(a, b) scanf("%lld %lld", &a, &b)
#define clong3(a, b, c) scanf("%lld %lld %lld", &a, &b, &c)
#define clong4(a, b, c, d) scanf("%lld %lld %lld %lld", &a, &b, &c, &d)
 
const long long MOD = 10e9 + 7;
#define MODSET(d) if ((d) >= MOD) d %= MOD;
#define MODR(d) ((d)>=MOD?(d)%MOD:(d))
#define MODNEGSET(d) if ((d) < 0) d = ((d % MOD) + MOD) % MOD;
#define MODADDSET(d) if ((d) >= MOD) d -= MOD;
#define MODADDWHILESET(d) while ((d) >= MOD) d -= MOD;
 
#define foreach(it,c) for(__typeof((c).begin()) it = (c).begin(); it!=(c).end(); it++) 
#define MAX 1000000
#define ll long long
#define mp make_pair
#define pb push_back
 
using namespace std;

ll negmod(ll number, ll mod)
{
    if(number >= 0) return number % mod;
    return (mod + (number % mod)) % mod;
}



// To compute (a * b) % mod
ll mulmod(ll a, ll b, ll mod)
{
    ll res = 0; // Initialize result
    a = a % mod;
    while (b > 0)
    {
        // If b is odd, add 'a' to result
        if (b % 2 == 1)
            res = (res + a) % mod;
 
        // Multiply 'a' with 2
        a = (a * 2) % mod;
 
        // Divide b by 2
        b /= 2;
    }
 
    // Return result
    return res % mod;
}
 
 
int main()
{
	#ifdef CHUCKIE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
	
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	int n;
	cin>>n;
	
	int cnt[27],cnttemp[27];
	memset(cnt,0,sizeof(cnt));
	memset(cnttemp,0,sizeof(cnttemp));
	
	
	string temp;
	cin>>temp;
	
	for(int i=0;i<temp.length();i++)
	cnt[temp[i]-'a']++;
	
	for(int i=1;i<n;i++)
	{
		cin>>temp;
		memset(cnttemp,0,sizeof(cnttemp));
		for(int j=0;j<temp.length();j++)
		{
			cnttemp[temp[j]-'a']++;
		}
		
		for(int j=0;j<26;j++)
		{
			cnt[j]=min(cnt[j],cnttemp[j]);
		}
		
		
	}
	
	for(int i=0;i<26;i++)
	{
		if(cnt[i]>0)
		{
			for(int j=0;j<cnt[i];j++)cout<<(char)('a'+i);
		}
	}
	
	cout<<endl;
	
	cout<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define FOR(i,a,b) for(int i=a; i<(int)(b); i++)
#define ALL(x) (x).begin(),(x).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define CLR(a) memset((a), 0 ,sizeof(a))
#define PB push_back
#define MP make_pair
#define SP << " " <<
const int INF = 1001001001;
const ll LINF = 100100100100100100;
#define EPS (1e-10)
const long double PI  = acos(-1.0L);
typedef pair<int,int> PII;
typedef pair<ll,ll> PLL;
typedef pair<double,double> PDD;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
#define chmax(a,b) a = (((a)<(b))?(b):(a))
#define chmin(a,b) a = (((a)>(b))?(b):(a))

__attribute__((constructor))
void initial(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

signed main(){
	VI a(3); cin>>a[0]>>a[1]>>a[2]; sort(ALL(a));
	if(a[0]==5&&a[1]==5&&a[2]==7) cout<<"YES"<<endl;
	else cout<<"NO"<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
long long int power(long long int x,long long int y) 
{ 
    long long int res = 1;     // Initialize result 
  // x=x;
    while (y > 0) 
    { 
        // If y is odd, multiply x with result 
        if (y & 1) 
            res = (res*x); 
   
        // y must be even now 
        y = y>>1; // y = y/2 
        x = (x*x);  // Change x to x^2 
    } 
    return res; 
}
long long int power(long long int x,long long int y,long long int m) 
{ 
    long long int res = 1;     // Initialize result 
   x=x%m;
    while (y > 0) 
    { 
        // If y is odd, multiply x with result 
        if (y & 1) 
            res = (res*x)%m; 
   
        // y must be even now 
        y = y>>1; // y = y/2 
        x = (x*x)%m;  // Change x to x^2 
    } 
    return res; 
}
void primeFactors(int n)  
{  
    // Print the number of 2s that divide n  
    while (n % 2 == 0)  
    {  
        cout << 2 << " ";  
        n = n/2;  
    }  
  
    // n must be odd at this point. So we can skip  
    // one element (Note i = i +2)  
    for (int i = 3; i <= sqrt(n); i = i + 2)  
    {  
        // While i divides n, print i and divide n  
        while (n % i == 0)  
        {  
            cout << i << " ";  
            n = n/i;  
        }  
    }  
  
    // This condition is to handle the case when n  
    // is a prime number greater than 2  
    if (n > 2)  
        cout << n << " ";  
}

long long int gcd(long long int a, long long int b){ 
    if (a == 0) 
        return b;  
    return gcd(b % a, a);  
 } 
 long long int lcm(long long int a, long long int b)  
 { 
     long long int temp;
    
    return (a*b)/gcd(a, b);  
 }
 
int main() {
   long long int i,j;
 //long long int b[1000000];
 //set<long long int >s;
       long long int f=0,p=0,z,o=0;
       double pie=3.141592653589793238;
    long long int n,m,l=0,k,c,min1=10000000000000,max2=-100;
    cin>>n>>m;
  if(max(n,m)>9||min(n,m)<1)
    cout<<"-1";
  else
    cout<<(n*m);
   
 return 0;
}

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

int main() {
  int N, M;
  
  cin >> N >> M;
  
  if (N<M) {
    for(int i = 0; i<M; i++)cout << N;
  } else {
    for(int i = 0; i<N; i++)cout << M;
  }
  cout << endl;
}

Measured memory_bytes: 256
# n = 50
# a = b = 1
# c = [1, 1]
# a_ = []
# b_ = []
# # print("#{a} #{b} ")
# (1..n).each do |i|
#     a = (2*i) * a
#     a_ << 2 * i
#     b = (2*i+1) * b
#     b_ << 2*i+1
#     c << a << b
#     # print("#{a} #{b} ")
# end

# p c.size
# p c[-2]
# p a_
# p b_

n = gets.to_i

if n.odd?
    puts 0
    exit
end


k = 1
ans = 0
while (n / k)>0 do
    
    k *= 5
    ans += n / k /2
end

puts ans







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

// 総数を1000000007（素数）で割った余り
const long long mod = 1e9 + 7;

using ll = long long;
using pii  = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pii>
#define vpll vector<pll>

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; i++)
#define rep1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; i++)
#define repr(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rep1r(i, n) for (int i = ((int)(n)); i >= 1; i--)

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RSORT(x) sort(rall(x));
#define pb push_back
#define mp make_pair

#define INF (1e9)
#define PI (acos(-1))
#define EPS (1e-7)

ull gcd(ull a, ull b) { return b ? gcd(b, a % b) : a; }
ull lcm(ull a, ull b) { return a / gcd(a, b) * b; }

const string YES = "Yes";
const string NO = "No";

bool isPalindrome(string s) {
    bool ans = true;
    rep(i, s.size()) {
        if (s[i] != s[s.size()-i-1]) ans = false;
    }
    return ans;
}

int main(){
    string s;
    cin >> s;
    bool ans = true;
    if (!isPalindrome(s)) ans = false;
    if (!isPalindrome(s.substr(0, s.size()/2))) ans = false;
    if (!isPalindrome(s.substr(s.size()/2+1, s.size()/2))) ans = false;
    cout << (ans?YES:NO) << endl;
    return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;

namespace MyProject
{
    class Program
    {
        static void Main(string[] args)
        {
#if Local
            var sw = new Stopwatch();
            sw.Start();
            Console.SetIn(new StreamReader("input.in"));
#endif

            var solver = new Solver();
            solver.Solve();
#if Local
            Console.WriteLine($"{sw.ElapsedMilliseconds}ms");
#endif
        }
    }

    class Solver
    {
        public void Solve()
        {
            // 入力
            Console.ReadLine();
            var item = Console.ReadLine();

            // 人数の計算
            var red = item.Count(c => c == 'R');
            var blue = item.Length - red;

            // 赤い帽子を被っている人が青い帽子を被っている人より多いか
            string answer = red > blue ? "Yes" : "No";

            // 出力
            Console.WriteLine(answer);
        }
    }
}


Measured memory_bytes: 13268
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdlib>
#include <map>
#include <iomanip>
#include <set>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define int long long
#define pie 3.141592653589793238462643383279
#define mod 1000000007
#define INF 1145141919364364
#define all(vec) vec.begin(),vec.end()
#define P pair<int,int>
#define S second
#define F first
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
int lcm(int x, int y) {
	return x / gcd(x, y)*y;
}
bool prime(int x) {
	for (int i = 2; i <= sqrt(x); i++) {
		if (x%i == 0)return false;
	}
	return true;
}

int kai(int x) {
	if (x == 1)return 1;
	return kai(x - 1)*x%mod;
}

int mod_pow(int x, int y, int moder) {
	int res = 1;
	while (y > 0) {
		if (y & 1)res = res * x%moder;
		x = x * x%moder;
		y >>= 1;
	}
	return res;
}

int comb(int x, int y) {
	if (y > x)return 0;
	if (x == y)return 1;
	return kai(x)* mod_pow(kai(x - y), mod - 2, mod) % mod * mod_pow(kai(y), mod - 2, mod) % mod;
}

int n, k;
pair<int, int> t[114514];
int a[114514];
vector<int> cnt;
priority_queue<P> mu;
priority_queue<P, vector<P>, greater<P>> ta;

signed main() {
	cin >> n >> k;
	rep(i, n) {
		cin >> t[i].first >> t[i].second;
		mu.push({ t[i].second,t[i].first });
	}
	int cnt1 = 0;
	rep(i, k) {
		P p = mu.top(); mu.pop();
		cnt1 += p.first;
		a[p.second]++;
		ta.push(p);
	}
	int cnt2 = 0;
	rep(i, n) {
		if (a[i + 1])cnt2++;
	}
	cnt.push_back(cnt1 + cnt2 * cnt2);
	while (mu.size() && ta.size()) {
		int to = INF;
		while (ta.size()) {
			P p = ta.top(); ta.pop();
			if (a[p.second] > 1) {
				to = p.first;
				a[p.second]--;
				break;
			}
		}
		if (to == INF)break;
		cnt1 -= to;
		int ti = INF;
		while (mu.size()) {
			P p = mu.top(); mu.pop();
			if (a[p.second] == 0) {
				ti = p.first;
				a[p.second]++;
				break;
			}
		}
		if (ti == INF)break;
		cnt1 += ti;
		cnt2++;
		cnt.push_back(cnt1 + cnt2 * cnt2);
	}
	int ans = 0;
	rep(i, cnt.size()) {
		ans = max(ans, cnt[i]);
	}
	cout << ans << endl;
}

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

using namespace std;


typedef long long ll;
ll mod=1e9+0LL;
ll MOD=1e18+0LL;
#define line printf("\n")
double pi=acos(-1);
ll md=1000000007;
ll gcd(ll a,ll b){
    //if(b>a) swap(a,b);
    return b==0?abs(a):gcd(b,a%b);
}
ll poW(ll a ,ll n)
{
    if(n==0) return 1;
    if(n%2==0)
    {
        ll b=poW(a,n/2);
        return (b*b)%md;
    }
    return (poW(a,n-1)*a)%md;
}

char gap=' ';






















//vector<int>v[200100];
//bool visit[200100]={0};
//int vc[200100]={0};
//
//
//int cnt;
//void dfs(int s,int c=0)
//{
//    if(visit[s]) return;
//    cnt++;
//        visit[s]=1;
//
//        for(int i=0;i<v[s].size();i++) {
//                dfs(v[s][i]);
//        }
//
//}


int main()
{
    int cs=1;
    //scanf("%d",&cs);
    while(cs--)
    {
       int i,n;
       int a[5];
       for(i=0;i<5;i++) {cin>>a[i];if(!a[i]) n=i+1;}
       cout<<n;
    }
}


Measured memory_bytes: 3552
#include <iostream>
#include <vector>

using namespace std;
int main(){
    int H, W, N, tmp,n;
    cin >> H >> W;
    cin >> N;
    vector< vector<int> > map(H, vector<int>(W));
    vector<int> a(N);
    for(int i= 0;i<N;i++) cin >> a[i];
    n = 0;
    for (int i = 0;i<H;i++){
        if(i%2 == 0){
            for(int j =0;j<W;j++){
                map[i][j] = n + 1;
                a[n]--;
                if(a[n] == 0) n++;
            }
        }else{
            for(int j =W - 1;j>=0;j--){
                map[i][j] = n + 1;
                a[n]--;
                if(a[n] == 0) n++;
            }
        }
    }
    for (int i = 0;i<H;i++){
        for(int j =0;j<W;j++){
            cout << map[i][j];
            if(j < (W - 1)) cout <<" ";
        }
        cout << endl;
    }
}


Measured memory_bytes: 384
#include <iostream>

#define REP(i, a, b) for ( int i = (a); i < (b); i++ )
#define REVREP(i, a, b) for ( int i = (a); i > (b); i--)

using namespace std;

int main(void) {
	int X, A;
    scanf("%d %d", &X, &A);

    if ( X < A ) puts("0");
    else puts("10");

	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 all(v) begin(v),end(v)
using ll = long long;

int main() {
  int n,d,x;cin>>n>>d>>x;
  vector<int>a(n);
  rep(i,n)cin>>a[i];
  int cnt=0;
  rep(i,n){
    int ans=1;
    while(1){
      if(ans>d)break;
      cnt++;
      ans+=a[i];
    }
  }
  cout<<cnt+x<<endl;
}

Measured memory_bytes: 3628
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<queue>
#include<stack>
using namespace std;
int main()
{
	int a,b,c,flag=0;
	cin >> a >> b >> c;
	if(a==b&&a==c)
		flag=0;
	else if(a==b+c||b==a+c||c==a+b)
		flag=1;
	if(flag)
		cout << "Yes";
	else
		cout << "No";
	return 0;
}

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

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

    int n;
    cin >> n;
    vector<int> v;
    int total = 0;

    for(int i = 0; i < n; i++){
        int d;
        cin >> d;
        v.push_back(d);
    }

    for(int i = 0; i < v.size(); i++){
        for(int j = i+1; j < v.size(); j++){
            total = total + (v[i]*v[j]);
        }
    }

    cout << total;

}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

  public static void main(String[] args) throws IOException {
    
    try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

      StrSplitToInt str;
      int n = Integer.parseInt(br.readLine());
      int[] seqA = new int[n];
      str = new StrSplitToInt(br.readLine(), " ");
      for(int i=0; i<n; i++) {
        seqA[i] = str.nextInt();
      }

      int q = Integer.parseInt(br.readLine());
      str = new StrSplitToInt(br.readLine(), " ");
      StringBuilder result = new StringBuilder();
      for(int i=0; i<q; i++) {
        if( solve(n, seqA, 0, str.nextInt()) )
          result.append("yes\n");
        else
          result.append("no\n");
      }
      System.out.print(result);
    }
  }

  private static boolean solve(int n, int[] a, int i, int m) {
    if( m == 0 ) return true;
    if( i >= n ) return false;

    boolean res = solve(n, a, i+1, m) || solve(n, a, i+1, m-a[i]);

    return res;
  }
}
 
class StrSplitToInt {
  final String s;
  final String split;
  final int endPos;
  final int splitLen;
  int currentPos;
  int nextPos;
 
  public StrSplitToInt(String s,String split) {
    this.s = s;
    this.split = split;
    currentPos = 0;
    nextPos = s.indexOf(split, currentPos);
    endPos = s.length();
    splitLen = split.length();
  }
 
  public int nextInt() {
    if( currentPos < endPos ) {
      int ret = Integer.parseInt( s.substring(currentPos, nextPos) );
      currentPos = nextPos + splitLen;
      nextPos = s.indexOf(split, currentPos);
      if(nextPos == -1) nextPos = endPos;
 
      return ret;
    }
    else
      return -1;
  }
}


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

using namespace std;

int main()
{
	int n, m, s, t;
	
	while(1){
		cin >> n >> m;
		if(n == 0 && m == 0){
			break;
		}
		queue<int> que, qu1, qu2, qu3;
		
		for(int i = n; i >= 1; i--){
			que.push(i);
		}
		while(m--){
			cin >> s >> t;
			for(int i = 0; i < s-1; i++){
				qu1.push(que.front());
				que.pop();
			}
			for(int i = 0; i < t; i++){
				qu2.push(que.front());
				que.pop();
			}
			while(!que.empty()){
				qu3.push(que.front());
				que.pop();
			}
			while(!qu2.empty()){
				que.push(qu2.front());
				qu2.pop();
			}
			while(!qu1.empty()){
				que.push(qu1.front());
				qu1.pop();
			}
			while(!qu3.empty()){
				que.push(qu3.front());
				qu3.pop();
			}
		}
		cout << que.front() << endl;
	}
	
	return 0;
}

Measured memory_bytes: 0
using System;

namespace SmallLargeOrEqual
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = Console.ReadLine();
            var a_b = input.Split(new Char[] { ' ' });
            var a = decimal.Parse(a_b[0]);
            var b = decimal.Parse(a_b[1]);

            if (a > b)
            {
                Console.WriteLine("a > b");
            }
            else if (a < b)
            {
                Console.WriteLine("a < b");
            }
            else
            {
                Console.WriteLine("a == b");
            }
        }
    }
}



Measured memory_bytes: 16016
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int n;
vector<int> c[100010];
int dx[2][100010];

void DFS(int x,int len,int t){
	dx[t][x]=len;
	for(int i=0;i<c[x].size();i++){
		if(dx[t][c[x][i]]==114514810)
		DFS(c[x][i],len+1,t);
	}
}

int main(){
	cin>>n;
	for(int i=0;i<n-1;i++){
		int a,b;cin>>a>>b;a--,b--;
		c[a].push_back(b);
		c[b].push_back(a);
	}
	for(int i=0;i<n;i++){
		dx[0][i]=114514810,dx[1][i]=114514810;
	}
	DFS(0,0,0);DFS(n-1,0,1);
	int fen=0,snuke;
	for(int i=0;i<n;i++){
		if(dx[0][i]<=dx[1][i])fen++;
	}
	snuke=n-fen;
	if(fen<=snuke)cout<<"Snuke"<<endl;
	else cout<<"Fennec"<<endl;
	return 0;
}


Measured memory_bytes: 12800
#include <bits/stdc++.h>
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (int i = (int)(a); i < (int)(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define ll long long
#define lld long double
#ifdef DEBUG
#define line() cout << "[" << __LINE__ << "] ";
#define dump(i) cout << #i ": " << i << " ";
#define dumpl(i) cout << #i ": " << i << endl;
#else
#define line(i)
#define dump(i)
#define dumpl(i)
#endif
using namespace std;

template <typename Monoid>

struct SegmentTree
{
    using F = function<Monoid(Monoid, Monoid)>;
    int sz;
    vector<Monoid> seg;

    const F f;
    const Monoid M1;

    SegmentTree(int n, const F f, const Monoid &M1) : f(f), M1(M1)
    {
        sz = 1;
        while (sz < n)
            sz *= 2;
        seg.assign(2 * sz, M1);
    }
    void set(int k, const Monoid &x)
    {
        seg[k + sz] = x;
    }
    void build()
    {
        for (int k = sz - 1; k > 0; k++)
        {
            seg[k] = f(seg[2 * k + 0], seg[2 * k + 1]);
        }
    }
    void update(int k, const Monoid &x)
    {
        k += sz;
        seg[k] = x;
        while (k >>= 1)
        {
            seg[k] = f(seg[2 * k + 0], seg[2 * k + 1]);
        }
    }
    Monoid query(int a, int b)
    {
        Monoid L = M1, R = M1;
        for (a += sz, b += sz; a < b; a >>= 1, b >>= 1)
        {
            if (a & 1)
                L = f(L, seg[a++]);
            if (b & 1)
                R = f(seg[--b], R);
        }
        return f(L, R);
    }
    Monoid operator[](const int &k) const
    {
        return seg[k + sz];
    }
};

int f(int a, int b)
{
    return a + b;
}

int main()
{
    map<int, int> mp;
    int N, Q;
    cin >> N;
    vector<SegmentTree<int>> segs(26, SegmentTree<int>(N, f, 0));
    string s;
    cin >> s;
    rep(i, N)
    {
        segs[s[i] - 'a'].update(i, 1);
    }
    cin >> Q;
    rep(i, Q)
    {
        // rep(j, N) cerr << mp[j] << " ";
        //cerr << endl;
        //rep(j, N) cerr << a[j] << " ";
        //cerr << endl;

        int type;
        cin >> type;
        if (type == 1)
        {
            int x;

            char c, old;
            cin >> x >> c;
            x--;
            old = s[x];
            if (old != c)
            {
                s[x] = c;
                segs[c - 'a'].update(x, 1);
                segs[old - 'a'].update(x, 0);
            }
        }
        else
        {
            int ans = 0;
            int x, y;
            cin >> x >> y;
            x--;
            y--;
            int ttt = 0;
            rep(j, 26)
            {
                ttt += segs[j].query(x, y + 1);
                if (segs[j].query(x, y + 1) > 0)
                {
                    ans++;
                    //cerr << (char)('a' + j) << endl;
                }
            }
            //cerr << x << " " << y << endl;
            //cerr << ttt << endl;
            cout << ans << endl;
        }
    }
    return 0;
}

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

set<int> s;

int main()
{
    int n, m, k;
    scanf("%d%d%d", &n, &m, &k);
    for(int i = 0; i <= n; i++)
        for(int j = 0; j <= m; j++)
            s.insert(i * m - i * j + j * (n - i) );
    puts(s.count(k) ? "Yes" : "No");
    return 0;
}


Measured memory_bytes: 13056
N, K = [int(v) for v in input().split()]

count = [0] * N

for _ in range(K):
    d = int(input())
    for v in input().split():
        j = int(v) - 1
        count[j] += 1

sunuke = 0
for i in count:
    if i == 0:
        sunuke += 1

print(sunuke)


Measured memory_bytes: 9156
// created_by  Rishi_Mohan

#include<bits/stdc++.h>

#define    ll           long long
#define    db1(x)       cout<<#x<<"="<<x<<'\n'
#define    db2(x,y)     cout<<#x<<"="<<x<<","<<#y<<"="<<y<<'\n'
#define    db3(x,y,z)   cout<<#x<<"="<<x<<","<<#y<<"="<<y<<","<<#z<<"="<<z<<'\n'
#define    rep(i,n)     for(int i=0;i<(n);++i)
#define    repA(i,a,n)  for(int i=a;i<=(n);++i)
#define    repD(i,a,n)  for(int i=a;i>=(n);--i)

using namespace std;

void solve()
{
   	int n;
   	cin >> n;
   	double ans = (double) ((float)(22*2*n)/7);
   	//double ans = (float)(3.14 * 2 * n);
   	cout << fixed << setprecision(6) << ans ;
}

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

Measured memory_bytes: 3800
N = int(input())
A = [int(i) for i in input().split()]

sum_dict = {}
diff_dict = {}
for i in range(N):
    try:
        sum_dict[i + A[i]] += 1
    except:
        sum_dict[i + A[i]] = 1
    try:
        diff_dict[i - A[i]] += 1
    except:
        diff_dict[i - A[i]] = 1
ans = 0
for key in sum_dict:
    try:
        ans += sum_dict[key] * diff_dict[key]
    except:
        pass
print(ans)

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

enum inf = 1_001_001_001;
enum infl = 1_001_001_001_001_001_001L;
enum mod = 1_000_000_007L;


void main() {
    int n, q;
    scan(n, q);
    auto a = readln.split.to!(int[]).sort();
    auto x = iota(q).map!(i => readln.chomp.to!int).array;

    auto kogo = new long[](n + 1);
    kogo[1] = a[0];
    foreach (i ; 2 .. n + 1) {
        kogo[i] = kogo[i-2] + a[i-1];
    }

    auto usiro = new long[](n + 1);
    foreach (i ; 1 .. n + 1) {
        usiro[i] = usiro[i-1] + a[n - i];
    }

    bool check(int x, int k) {
        if (n - 2*k + 1 < 0) {
            return false;
        }
        return (2*x <= a[n - k] + a[n - 2*k + 1]);
    }

    foreach (xi ; x) {
        int ok = 1, ng = n + 1;

        while (abs(ok - ng) > 1) {
            int mid = (ok + ng) / 2;
            if (check(xi, mid)) {
                ok = mid;
            }
            else {
                ng = mid;
            }
        }

        int k = ok;
        auto r = max(0, n - 2*k);

        long ans = usiro[k] + kogo[r];
        writeln(ans);
    }
}


void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}

void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}

bool chmin(T, U...)(ref T x, U args) {
    bool isChanged;

    foreach (arg ; args) {
        if (x > arg) {
            x = arg;
            isChanged = true;
        }
    }

    return isChanged;
}

bool chmax(T, U...)(ref T x, U args) {
    bool isChanged;

    foreach (arg ; args) {
        if (x < arg) {
            x = arg;
            isChanged = true;
        }
    }

    return isChanged;
}

long powmod(long x, long y, long mod = 1_000_000_007L) {
    long res = 1L;

    while (y > 0) {
        if (y & 1) {
            (res *= x) %= mod;
        }
        (x *= x) %= mod;
        y >>= 1;
    }

    return res;
}

Measured memory_bytes: 6952
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <map>
#include <vector>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;++i)
#define ALL(v) v.begin(),v.end()
#define mod 1000000007

//各桁の和
ll digsum(ll x){
  int sum=0;
  while(x>0){
    sum+=x%10;
    x/=10;
  }
  return sum;
}

int main(){
  ll x;
  cin >> x;
  if(x%digsum(x)==0)cout << "Yes" << endl;
  else cout << "No" << endl;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cassert>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <numeric>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

using namespace std;

#define int long long int
#define rep(i, n) for (int i = 0; i < n; ++i)
#define all(x) (x).begin(), (x).end()
#define capi(x) int x;cin>>x
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

using vi = vector<int>;

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

#define P (1'000'000'007)

int dp[3003][3003] = {0};

signed main() {
    int n, k;
    cin >> n >> k;
    vi vh;

    rep(i, n) {
        capi(h);
        vh.push_back(h);
    }

    vi dp(n + 1, INT_MAX);

    dp[0] = 0;

    rep(i, n - 1) {
        rep(j, k) {
            if (i - j >= 0) {
                chmin(dp[i + 1], dp[i - j] + abs(vh[i - j] - vh[i + 1]));
            }
        }
    }

    cout << dp[n - 1];

    return 0;
}

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

int main()
{
  int a,b,c,n=1,T[4000];
  
  cin>>a>>b>>c;
  while(n<4000){
    for(int i=0;i<a;i++,n++)T[n]=1;
    for(int i=0;i<b;i++,n++)T[n]=0;
    if(n>3800)break;
  }

  for(int i=c;i<4000;i+=60){
    if(T[i]==1){
      cout<<i<<endl;
      break;
    }
    if(i>3600){
      cout<<"-1"<<endl;
      break;
    }
  }
  return 0;
}

Measured memory_bytes: 1176
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        String in = s.nextLine();
        int a = Integer.parseInt(in.split(" ")[0]);
        int b = Integer.parseInt(in.split(" ")[1]);

        if (a > 9 || a < 1 || b < 1 || b > 9) {
            System.out.println(-1);
        } else {
            System.out.println(a*b);
        }
    }
}


Measured memory_bytes: 21716
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <numeric>
#include <typeinfo>
#include <cstdlib>
#include <cmath>

int main(){
    int n, k;
    double a = 0.0;
    std::cin >> n >> k;
    for(int i=1; i<=n; i++){
        int t = i;
        int c = 0;
        while(t<k){
            t*=2;
            c++;
        }
        a += 1.0/n * std::pow(0.5, c);
    }
    printf("%.12lf\n", a);
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fo(i,a,b) for(i=a;i<=b;i++)
#define fd(i,a,b) for(i=a;i>=b;i--)
#define max(a,b) (a>b?a:b)
#define min(a,b) (a<b?a:b)
using namespace std;
typedef long long ll;
inline int read(){
	int n=0,f=1;char c;
	for(c=getchar();c!='-'&&(c<'0'||c>'9');c=getchar());
	if (c=='-') f=-1,c=getchar();
	for(;c>='0'&&c<='9';c=getchar()) n=(n<<3)+(n<<1)+(c&15);
	return n*f;
}
void pint(int x){
	if (x>=10) pint(x/10);
	putchar(x%10+48);
}
const int N=2e5+5;
vector<int>g[N];
int i,n,fa[N],mx[N],ans[N],an[N];
int df(int x,int s){
	if (x>s) return 0;
	int S=1,f=fa[x];
	for(int i=0;i<g[x].size();i++){
		int y=g[x][i];
		if (y!=f) S+=df(y,s);
	}return an[x]=S;
}
void dfs(int x){
	int f=fa[x];
	mx[x]=max(x,mx[f]);
	for(int i=0;i<g[x].size();i++){
		int y=g[x][i];
		if (y!=f) fa[y]=x,dfs(y);
	}
}
void work(int x){
	int f=fa[x],ff=fa[f];
	if (x!=1){
		ans[x]=ans[f];
		if (mx[ff]<x){
			ans[x]++;
			for(int i=0;i<g[x].size();i++){
				int y=g[x][i];
				if (y!=f) ans[x]+=df(y,mx[f]);
			}
		}else if (mx[f]!=mx[ff]){
			ans[x]-=an[x];
			ans[x]+=df(x,mx[f]);
		}
	}
	for(int i=0;i<g[x].size();i++){
		int y=g[x][i];
		if (y!=f) work(y);
	}
}
int main(){
	n=read();
	fo(i,2,n){
		int x=read(),y=read();
		g[x].push_back(y),g[y].push_back(x);
	}
	dfs(1);
	work(1);
	fo(i,2,n) pint(ans[i]),putchar(i<n?' ':'\n');
}

Measured memory_bytes: 31232
#"a" 97 "z" 122
s = list(ord(i) for i in input())
k = int(input())

for i in range(len(s)-1):
  if s[i] == ord("a"): continue
  t = ord("z")+1-s[i]
  if k >= t:
    s[i] = 97
    k -= t
if k > 0:
  k %= 26
  s[-1] += k
  if s[-1] > ord("z"):
    s[-1] -= 26
print("".join(list(map(chr, s))))

Measured memory_bytes: 4788