akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#define _USE_MATH_DEFINES
#include <math.h>
#include <iomanip>
#include <stdio.h>
#include <numeric>
#include <cmath>
#include <limits>
#include <bitset> 
#include <iterator> 
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include<deque>
#include <regex>
#include <list> 
#define rep(i,n) for(ll i=0;i<(n); ++i)
#define per(i,n) for(ll i=n-1;i>=0; --i)
#define all(x) (x).begin(),(x).end()
#define _GLIBCXX_DEBUG
using namespace std;
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 long long INF = 1LL << 60;
typedef long long ll;
const ll MOD = 1000000007;
ll getDigit(ll n) {
	ll cnt = 0;
	while (n != 0) {
		n /= 10;
		cnt++;
	}
	return cnt;
}
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}
typedef pair<double, long long> pair_t;
bool comp(const pair_t& a, const pair_t& b) {
	if (a.first == b.first)return  a.second > b.second;
	else {
		return a.first > b.first;
	}
}

int main() {
	ll n,sum=0,minSum=INF;
	cin >> n;
	vector<ll>x(n);
	rep(i, n)cin >> x[i];
	for (ll p = 1; p <= 100; p++) {
		for (ll i = 0; i < n; i++) {
			sum += pow((p-x[i]),2);
		}
		minSum = min(sum, minSum);
		sum = 0;
	}
	cout << minSum << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<stdlib.h>
using namespace std;
int main(){
  int sum=0,n,l;
  cin >> n >> l;
  for(int i=0;i<n;i++){
    sum+=l+i;
  }
  sum-=(l<0?(l+n-1<0?l+n-1:0):l);
  cout << sum << endl;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
#define rep(i,a,b) for (int i = (a); i < (b); i++)
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;
typedef complex<double> com;
const int mod = 1e9 + 7;
const int MOD = 998244353;
const int inf = 2e9;



int main(){
	int n; cin >> n;
	vector<int> a(n+1,0);
	rep(i, 0, n) {
		int p; cin >> p;
		a[p] = a[p - 1] + 1;
	}
	int ans = 0;
	rep(i, 0, n+1) ans = max(ans, a[i]);
	printf("%d", n-ans);
	return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <cctype>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <string>
#include <functional>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
typedef long long ll;
const int INF = 100000000, mod = 1000000007;
const ll LLINF = 1LL << 50;
using namespace std;


int main() {
    int x, y;
    cin >> x >> y;
    if (x%y == 0)cout << "-1" << endl;
    else cout << x << endl;
    return 0;
}


Measured memory_bytes: 256
import math
import fractions

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

def ValueToBits(x,digit):
    res = [0 for i in range(digit)]
    now = x
    for i in range(digit):
        res[i]=now%2
        now = now >> 1
    return res

def BitsToValue(arr):
    n = len(arr)
    ans = 0
    for i in range(n):
        ans+= arr[i] * 2**i
    return ans

def ValueToArray10(x, digit):
    ans = [0 for i in range(digit)]
    now = x
    for i in range(digit):
        ans[digit-i-1] = now%10
        now = now //10
    return ans
'''
def cmb(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p

p = 2
N = 10 ** 6 + 2
fact = [1, 1]  # fact[n] = (n! mod p)
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p)
inv = [0, 1]  # factinv 計算用

for i in range(2, N + 1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p)
'''


#a = list(map(int, input().split()))

a,b =  list(map(int, input().split()))

print(a*(a-1)//2 + b*(b-1)//2)








Measured memory_bytes: 64492
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<bitset>
#include<iomanip>
#include<list>
#include<deque>
using namespace std;
//#define MODE 1
#ifdef MODE
#define DEB(X) cout<< #X <<": "<<X<<" ";
#define DEB2(X) cout<<X<<" ";
#define END cout<<endl;
#else
#define DEB(X) {}
#define DEB2(X) {}
#define END {}
#endif
typedef long long ll;
#define int ll
#define uset unordered_set
#define umap unordered_map
//typedef std::pair<int,int> P;
struct edge{int to,cost;};
const int INF=100000000000000000;
const int INF2=9223372036854775807;
const int MOD=1000000007;
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define min(X,Y) (((int)(X)<(int)(Y))?(X):(Y))
#define max(X,Y) (((int)(X)>(int)(Y))?(X):(Y))
#define NP(X,Y) next_permutation(X,Y)
#define setdouble(X,Y) cout<<fixed<<setprecision(X)<<Y
int ceil2(int a,int b){if(a%b==0){return a/b;}else{return a/b+1;}}
int pow2(int a,int b){int r=1;for(int i=1;i<=b;i++){r*=a;}return r;}
int Log2(int a){int t=0;while(1){if(a==0||a==1){break;}a/=2;t++;}return t;}

int N;
int A[110][2];

signed main(){
	cin>>N;
	REP(i,N){
		cin>>A[i][0]>>A[i][1];
	}
	REP(i,N-2){
		if(A[i][0]==A[i][1]){
			if(A[i+1][0]==A[i+1][1]){
				if(A[i+2][0]==A[i+2][1]){
					cout<<"Yes"<<endl;
					return 0;
				}
			}
		}
	}
	cout<<"No"<<endl;
	return 0;
}


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

class Union_Find {
    
    private:
         vector<int> id, height;
         int cnt;

    public:
    Union_Find(int n) {

        cnt = 0;
        for(int i=0; i<n; i++){
            id.push_back(i);
            height.push_back(1);
        }            
    }   


    bool connected(int a, int b) {
        return root(a) == root(b);
    }

    void unite(int f, int s) {
        
        int root_f = root(f);
        int root_s = root(s);

        if(height[f] <= height[s]){
            id[root_f] = root_s;
            height[root_s] += height[root_f];
        }

        else if(height[f] > height[s]){
            id[root_s] = root_f;
            height[root_f] += height[root_s];
        }
    }

    int count() {
        for(int i=0; i<id.size(); i++)
            if(id[i] == i)
                cnt++;
        return cnt;
    }

    private:

    int root(int i) {

        while(id[i] != i)
        i = id[i];

        return i;
    }

};

int main(){
    int n;
    cin>>n;

    Union_Find uf(n);
    int q;
    cin>>q;

    for(int i=0; i<q; i++){
        
        int t,f,s;
        cin>>t>>f>>s;

        if(!t)
        uf.unite(f,s);

        else{
            if(uf.connected(f,s))
            cout<<"1\n";
            else cout<<"0\n";
        }
    }

    return 0;
}

Measured memory_bytes: 4840
/*
 * a.cpp
 *
 *  Created on: 2019/06/08
 *      Author: MEIP-users
 */




#include <bits/stdc++.h>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
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 INF (int)(1e9+10)
#define LINF (long long int)(112345678901234567)
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))


int main() {
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	while(1){
		c = c - b;
		if(c < 1){
			cout << "Yes" << endl;
			break;
		}
		a = a - d;
		if(a < 1){
			cout << "No" << endl;
			break;
		}
	}

	return 0;
}


Measured memory_bytes: 3632
#include <cmath>
#include <iostream>
#include <vector>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <bitset>
#include <algorithm>
#include <functional>
#include <utility>
#include <iomanip>
#define typeof(x) __typeof__(x)
#define int long long int
#define mod(x) ((x % MOD) + MOD) % MOD
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);--i)

#define ALL(c) (c).begin(),(c).end()
#define RALL(c) (c).rbegin(),(c).rend()
#define SZ(c) (int)((c).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define SORT(c) sort(ALL(c))
#define RSORT(c) sort(RALL(c))
#define LB(c,x) (int)(lower_bound(ALL(c),x)-(c).begin())
#define UB(c,x) (int)(upper_bound(ALL(c),x)-(c).begin())
#define COUNT(c,x) UB(c,x)-LB(c,x)
#define UNIQUE(c) SORT(c); (c).erase(unique(ALL(c)),(c).end());
#define COPY(c1,c2) copy(ALL(c1),(c2).begin())
#define PB push_back
#define MP make_pair
#define vec vector

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl;

using namespace std;

typedef pair<int,int> P;
struct edge {
  int to, cost;
};

const int INF = 1e18;
const int MOD = 1e9+7;

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


signed main()
{
  int N; cin >> N;
  string s; cin >> s;
  vec<bool> S(N);
  rep(i, 0, N) {
    S[i] = (s[i] == 'o') ? 0 : 1;
  }

  vec<bool> ans(N+1);
  rep(i, 0, 2) {
    rep(j, 0, 2) {
      fill(ALL(ans),0);
      ans[0] = i; ans[1] = j;
      rep(k, 1, N) {
        ans[k+1] = ans[k] ^ ans[k-1] ^ S[k];
      }
      if (ans[0] == ans[N] && (ans[N-1] ^ ans[0] ^ ans[1]) == S[0]) {
        rep(i, 0, N) {
          cout << ((ans[i] == 0) ? 'S' : 'W');
        }
        cout << endl;
        return 0;
      }
    }
  }
  cout << -1 << endl;
  return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
using vc = vector<char>;
using vvc = vector<vc>;
ll dx[4]={0,1,0,-1};
ll dy[4]={1,0,-1,0};
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

// a^{-1} mod を計算する

long long modinv(long long a, long long mod) {
    return modpow(a, mod - 2, mod);
}
map<ll,ll> insuu;
void prime_factor(ll n){
    ll k=n;
	for(ll i=2;i*i<=n;i++){
      ll cu=0;
	    while(k%i==0){
	        cu++;
	        k/=i;
	    }
      ll g=insuu[i];
      insuu[i]=max(g,cu);
	}
  ll h=insuu[k];
	if(k!=1) insuu[k]=max(h,1LL);
	return ;
}
int main(){
  ll n;
  cin>>n;
  vll a(n);
  rep(i,n) {
    cin>>a[i];
    prime_factor(a[i]);
  }
  ll g=1;
  for(auto p:insuu){
    rep(i,p.S){
      g*=p.F;
      g%=MOD;
    }
  }
  ll ans=0;
  rep(i,n){
    ans+=g*modinv(a[i],MOD)%MOD;
    ans%=MOD;
  }
  COUT(ans);
}


Measured memory_bytes: 1024
void main(){
	int n, k;
	readf("%d %d\n", &n, &k);
	double[] p = _scanln!double();
	double[] pw;
	double prev = 0.0;
	// 各サイコロの累積期待値
	foreach(i; 0..n){
		pw ~= (1 + p[i])/2 + prev;
		prev += (1 + p[i])/2;
	}
	double ans = 0.0;
	foreach(i; k-1..n){
		if(i<k)ans = max(ans, pw[i]);
		else ans = max(ans, pw[i]-pw[i-k]);
	}
	writefln("%f", ans);
}

import std.stdio, std.conv, std.algorithm, std.numeric, std.string, std.math, std.range;

// 1要素のみの入力
T _scan(T= int)(){
	return to!(T)( readln().chomp() );
}

// 1行に同一型の複数入力
T[] _scanln(T = int)(){
	T[] ln;
	foreach(string elm; readln().chomp().split()){
		ln ~= elm.to!T();
	}
	return ln;
}


Measured memory_bytes: 11752
#include <stdio.h>
int main(){
  int n ,i ,j ,most[10] ,most2[10] ,ans=0 ,ans2=0 ,tmp;

  for( i=0 ; i<10 ; i++ ){
    scanf( "%d" ,&most[i] );
  }

  for( i=0 ; i<9 ; i++ ){
    for( j=9 ; j>i ; j-- ){
      if( most[j] > most[j-1] ){
	tmp = most[j];
	most[j] = most[j-1];
	most[j-1] = tmp;
      }
    }
  }
 
 for( i=0 ; i<10 ; i++ ){
    scanf( "%d" ,&most2[i] );
  }

  for( i=0 ; i<9 ; i++){
    for( j=9 ; j>i ; j-- ){
      if( most2[j] > most2[j-1] ){
	tmp = most2[j];
	most2[j] = most2[j-1];
	most2[j-1] = tmp;
      }
    }
  }

  ans = most[1] + most[2] + most[0] + ans;
  ans2 = most2[1] + most2[2] + most2[0] + ans2;

  printf( "%d %d\n" ,ans ,ans2 );

  return 0;
}

Measured memory_bytes: 592
#include <bits/stdc++.h>
#define ll long long
#define sz size
#define pb push_back
#define mper make_pair
#define all(x) x.begin(), x.end()
#define fe first
#define se second
#define erba continue
using namespace std;

ll n, a, b, c, d;

string s;

void check1() {

    ll cnt = 0;

    for(int i = b - 1; i < d; ++i) {

        if(s[i] == '.') {

            cnt = 0;

        }

        else {cnt++;}

        if(cnt >= 2) {cout << "No";return;}
    }

    s[d - 1] = '#';

    cnt = 0;

    for(int i = a - 1; i < c; ++i) {

        if(s[i] == '.') {

            cnt = 0;

        }

        else {cnt++;}

        if(cnt >= 2) {cout << "No";return;}

    }

    cout << "Yes";


}

void check2() {

    bool check = 0;

    for(int i = b - 1; i < min(c, d); ++i) {

        if(s[i] == '.' && s[i - 1] == '.' && s[i + 1] == '.') {check = 1; a = i + 2; b = i + 1;}

    }

    if(a > b) {

        swap(a, b);
        swap(c, d);

    }


    if(!check) {cout << "No";return;}
    else {check1();}

}

int main() {

    cin >> n >> a >> b >> c >> d;

    cin >> s;

    if(s[a - 1] == '#' || s[b - 1] == '#' || s[c - 1] == '#' || s[d - 1] == '#') {cout << "No";return 0;}
    
    if(c < a || d < b) {cout << "No";return 0;}
    
    if(a > b) {

        swap(a, b);
        swap(c, d);

    }


    if(c < d) {check1();}
    else {check2();}

return 0;
}




Measured memory_bytes: 640
#include<stdio.h>

 

int main(void) {

int n;

int x;

int num;

int min = 1000001;

int max = -1000001;

long total = 0;

 

scanf("%d", &n);

for (x = 0; x < n; x++) {

scanf("%d", &num);

if (min > num) min = num;

if (max < num) max = num;

total += num;

}

printf("%d %d %ld\n", min, max, total);

 

return (0);

} 

Measured memory_bytes: 600
# @uthor : Kaleab Asfaw
from sys import stdin, stdout
# Fast IO
# from math import gcd

def input():
	a = stdin.readline()
	if a[-1] == "\n": a = a[:-1]
	return a
def print(*argv, end="\n", sep=" "):
	n = len(argv)
	for i in range(n):
		if i == n-1: stdout.write(str(argv[i]))
		else: stdout.write(str(argv[i]) + sep)
	stdout.write(end)
# Others
mod = 10**9+7
def lcm(x, y): return (x * y) / (gcd(x, y))
def fact(x, mod=mod):
	ans = 1
	for i in range(1, x+1): ans = (ans * i) % mod
	return ans
def arr2D(n, m, default=0):
	lst = []
	for i in range(n): temp = [default] * m; lst.append(temp)
	return lst
def sortDictV(x): return {k: v for k, v in sorted(x.items(), key = lambda item : item[1])}

def solve(n):
	return (((10**n) + (8**n)) - ((9**n)*2)) %(10**9+7)

n = int(input())
print(solve(n))

Measured memory_bytes: 83120
#include <iostream>

using namespace std;

int main(void) {
  long m, k;
  long i;
  
  cin >> m >> k;
  
  if (m == 0) {
    if (k == 0) {
      cout << 0 << ' ' << 0 << endl;
    } else {
      cout << -1 << endl;
    }
  } else if (m == 1) {
    if (k == 0) {
      cout << 0 << ' ' << 0 << ' ' << 1 << ' ' << 1 << endl;
    } else {
      cout << -1 << endl;
    }
  } else {
    if (k >= 2 << (m - 1)) {
      cout << -1 << endl;
    } else {
      for (i = 0; i < 2 << (m-1); i++) {
        if (i != k) {
          cout << i << ' ';
        }
      }
      cout << k << ' ';
      for (i--; i >= 0; i--) {
        if (i != k) {
          cout << i << ' ';
        }
      }
      cout << k << endl;
    }
  }
  
  return 0;
}
      

Measured memory_bytes: 1792
import java.io.*;
import java.math.BigInteger;
import java.util.*;
import java.util.Stack;


public class Main{
	public static class FastReader {
		BufferedReader br;
		StringTokenizer root;
		
 
		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
 
		String next() {
			while (root == null || !root.hasMoreTokens()) {
				try {
					root = new StringTokenizer(br.readLine());
				} catch (Exception r) {
					r.printStackTrace();
				}
			}
			return root.nextToken();
		}
 
		int nextInt() {
			return Integer.parseInt(next());
		}
 
		double nextDouble() {
			return Double.parseDouble(next());
		}
 
		long nextLong() {
			return Long.parseLong(next());
		}
 
		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (Exception r) {
				r.printStackTrace();
			}
			return str;
		}
	}
	
	public static PrintWriter out = new PrintWriter (new BufferedOutputStream(System.out));
	static int mod = (int) (1e9+7);
	static long cf = 998244353;
    static final long MAX = (long) 1e15;
    public static List<Integer>[] edges;
    public static int[][] parent;
    public static int col = 32;
    public static int[] Bit;
    public static long[] dp;
    
	public static void main(String[] args) {
	
	
	FastReader sc = new FastReader();
	
	char ch = sc.next().charAt(0);
	out.print(++ch);
      out.close();
	}

	
}

Measured memory_bytes: 21076
n = int(input())
d = {}
for i in range(n):
    s=input()
    if s not in d:
        d[s] = 1
    else:
        d[s] += 1
max_d = max(d.values())
print(*sorted([kv[0] for kv in d.items() if kv[1] == max_d]))


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

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;

const double PI = acos(-1);
#define MOD 1000000007  ///1e9+7

#define pb push_back
#define F first
#define S second
#define test int tc; cin>>tc; while(tc--)
#define forn(i,n) for(i=0;i<n;i++)
#define rforn(i,n) for(i=n-1;i>=0;i--)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define sz(x) x.size()
#define el <<'\n'
#define sp <<' '

#define mem(a,b) memset(a, b, sizeof(a))
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*(b/gcd(a,b)))
#define sqr(a) (a)*(a)

#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);

///******************************** C o d e ********************************///



main()
{
    string a;
    while(cin>>a){
        int i,s=0,c=0,n=sz(a);
        for(i=0;i<n-1;i++){
            if(a[i]=='?'){
                if(a[i+1]=='P'||a[i-1]=='P') a[i]='D';
                else{
                    a[i]='P';
                    a[i+1]='D';
                    i++;
                    continue;
                }
            }
        }
        if(a[i]=='?'){
            a[i]='D';
        }
        cout<<a el;
    }

}


///Thank you.


///Brainless_Loco Terminates Here!


Measured memory_bytes: 3756
N=int(input())
#奇数
ki=[i for i in range(1,N+1,2)]
yakusuu=[]
ans=[]

for i in ki:
  for j in range(1,i+1):
    if i%j==0:
      yakusuu.append(j)
  else:
    ans.append(str(len(yakusuu)))
    yakusuu=[]

print(ans.count("8"))
    

Measured memory_bytes: 3060
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
#define SZ(x) ((int)((x).size()))

template <typename T1, typename T2>
string print_iterable(T1 begin_iter, T2 end_iter, int counter) {
    bool done_something = false;
    stringstream res;
    res << "[";
    for (; begin_iter != end_iter and counter; ++begin_iter) {
        done_something = true;
        counter--;
        res << *begin_iter << ", ";
    }
    string str = res.str();
    if (done_something) {
        str.pop_back();
        str.pop_back();
    }
    str += "]";
    return str;
}

vector<int> SortIndex(int size, std::function<bool(int, int)> compare) {
    vector<int> ord(size);
    for (int i = 0; i < size; i++) ord[i] = i;
    sort(ord.begin(), ord.end(), compare);
    return ord;
}

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

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

template <typename S, typename T>
ostream& operator <<(ostream& out, const pair<S, T>& p) {
    out << "{" << p.first << ", " << p.second << "}";
    return out;
}

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

template<class TH>
void _dbg(const char* name, TH val){
    clog << name << ": " << val << endl;
}
template<class TH, class... TA>
void _dbg(const char* names, TH curr_val, TA... vals) {
    while(*names != ',') clog << *names++;
    clog << ": " << curr_val << ", ";
    _dbg(names+1, vals...);
}

#if DEBUG && !ONLINE_JUDGE
    ifstream input_from_file("input.txt");
    #define cin input_from_file

    #define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
    #define dbg_arr(x, len) clog << #x << ": " << print_iterable(x, x+len, -1) << endl;
#else
    #define dbg(...)
    #define dbg_arr(x, len)
#endif

///////////////////////////////////////////////////////////////////////////
//////////////////// DO NOT TOUCH BEFORE THIS LINE ////////////////////////
///////////////////////////////////////////////////////////////////////////


int main() {
    ios::sync_with_stdio(false);
    cin.tie(0); // Remove in problems with online queries!
    string S;
    cin >> S;
    int N = S.size();
    bool ok = true;
    int res = 0;
    for (int i = 0; i < N; i++) {
        if (ok) {
            ok = false;
            res++;
        } else if (S[i-1] != S[i]) res++;
        else {
            if (i == N-1) continue;
            i++;
            res++;
            ok = true;
        }
    }
    cout << res << "\n";
}


Measured memory_bytes: 720
#include<bits/stdc++.h>
#define mx 100000
#define pb push_back
#define siz(v) v.size();
typedef unsigned long  ull;
typedef long long int lli;
using namespace std;

void solve()
{
	int n,val;
	map<int,int>mp;
	cin>>n;
	for(int i=0;i<n-1;++i){
		cin>>val;
		mp[val]++;
	}
	for(int i=1;i<=n;++i)
		cout<<mp[i]<<"\n";
		
	mp.clear();
	
}


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


 return 0;
 }


Measured memory_bytes: 13044
#include<iostream>
#include<string>
#include<vector>
#include<queue>
#include<algorithm>
#include<map>
#include<set>
#include<cmath>
#include<iomanip>
#include<stack>
typedef long long ll;
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define sz(a) (int)a.size()
using namespace std;
ll INF = 1e18;

int main() {
	long double a, b;
	cin >> a >> b;
	ll ans = (ll)(a * b);
	cout << ans << endl;
}

Measured memory_bytes: 3732
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    int n;
    cin>>n;
    ll sum=0;
    for(int i=1; i<=n; i++)
    {
        for(int j=i;j<=n;j+=i)
            sum+=j;
    }
    cout<<sum<<endl;
}


Measured memory_bytes: 3592
//Ruthless Coding 
#include <bits/stdc++.h>

#define uni(x)      (x).resize(unique(ALL(x)) - (x).begin())
#define fprint(v)   for(auto x : v) cout << x << ' '
#define ALL(x)      (x).begin(), (x).end()
#define MP(x, y)    make_pair(x, y)
#define SZ(x)       int((x).size())
#define PB(x)       push_back(x)
#define ll          long long
#define S           second 
#define F           first
#define nl          '\n'

using namespace std;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
mt19937_64 rnd;

const int N = 2e5 + 5;
ll gc(ll a, ll b){
    if(b == 0) return a;
    return gc(b, a % b);
}
ll lcm(ll a, ll b){
    return a / gc(a, b) * b;
}
int main() {
    ios_base::sync_with_stdio(0);cin.tie(0);
    int n;
    cin >> n;
    ll ans = 1;
    for(int i = 0; i < n; i++){
        ll x;
        cin >> x;
        ans = lcm(ans, x);
    }
    cout << ans;
    return 0;
}
/*
    *** Most Impo.. -> check base case always
    1. Overflow Check (*, +)
    2. Index check (0 - based or 1 - based)
    3. Check for n = 1, 2, 3, 4....
    4. Corner Cases
*/

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define repr(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define reprrev(i,a,b) for(int i=b-1;i>=a;i--) // [a, b)
#define reprev(i,n) reprrev(i,0,n)
typedef long long ll;
typedef unsigned long long ull;
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; }

/* attention
    long longのシフト演算には気をつけよう
    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも
*/

const ll mod = 1e9+7;

void chmod(ll &M){
    if(M >= mod) M %= mod;
    else if(M < 0){
        M += (abs(M)/mod + 1)*mod;
        M %= mod;
    }
}

ll modpow(ll x, ll n){
    if(n==0) return 1;
    ll res=modpow(x, n/2);

    if(n%2==0) return res*res%mod;
    else return res*res%mod*x%mod;
}

int getl(int i, int N) { return i==0? N-1:i-1; };
int getr(int i, int N) { return i==N-1? 0:i+1; };


// 線分 ab の偏角 返り値は[-π, π]
double argument(const pair<double, double> &a, const pair<double, double> &b){
    double ax=a.first, ay=a.second, bx=b.first, by=b.second;
    return atan2(by-ay, bx-ax);
}

/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */


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

    int n, m; cin >> n >> m;
    string s; cin >> s;

    const int inf = 1<<29;
    vector<int> dp(n+4, inf);
    dp[n] = 0;
    queue<int> qu;
    qu.push(0);

    reprev(i, n) {
        while(true) {
            if (qu.empty()) { cout << -1 << endl; return 0; }
            if (qu.front() != inf && qu.size() <= m) break;
            qu.pop();
            
        }
        if (s[i]=='0') dp[i] = qu.front()+1;
        qu.push(dp[i]);
    }

    vector<int> ans;
    int x = 0;
    int rest = dp[0];
    while(x<n) {
        rest--;
        int i=1;
        while(dp[x+i]!=rest) { ++i; }
        ans.push_back(i);
        x = x+i;
    }
    for(int i=0; i<ans.size(); ++i) {
        if(i) cout << " ";
        cout << ans[i];
    }
    cout << endl;

    return 0;
}




Measured memory_bytes: 1484
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main()
{
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    string s;
    cin >> s;
    ll half = (s.size() - 1) / 2;
    for(ll i = 0; i < half; i++){
        string t = s.substr(0,half - i), u = s.substr(half - i, half - i);
        if(t == u)
        {
            cout << t.size() * 2 << endl;
            return 0;
        }
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const long long mod=1e9+7;

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

vector<int>oks(N+1,true);
for(int i=0;i<M;++i){
int a;cin>>a;
oks[a]=false;
}

vector<long long int>dp(N+1);
dp[0]=1;
for(int now=0;now<N;++now){
for(int next=now+1;next<=min(N,now+2);++next){
if(oks[next]){
				dp[next]+=dp[now];
				dp[next]%=mod;
			}
		}
	}

  cout<<dp[N]<<endl;
  return 0;
}

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

// varibable settings
#define int long long
const int INF=1e18;
const int MOD=1e9+7;

// define basic macro {{{
#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 _rrep(i,n) rrepi(i,0,n)
#define rrepi(i,a,b) for(int i=(int)((b)-1);i>=(int)(a);--i)
#define rrep(...) _overload3(__VA_ARGS__,rrepi,_rrep,)(__VA_ARGS__)
#define each(i,a) for (auto&& i : a)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
#define mt(a, b, c) make_tuple(a, b, c)
#define ceil(a,b) ((a)+(b)-1)/(b)
#define is_in(x, a, b) ((a)<=(x) && (x)<(b))
#define uni(x) sort(all(x));x.erase(unique(all(x)),x.end())
#define ub upper_bound
#define lb lower_bound
#define posl(A, x) (lower_bound(all(A), x)-A.begin())
#define posu(A, x) (upper_bound(all(A),x)-A.begin())
template<class T> inline void chmax(T &a, const T &b) { if((a) < (b)) (a) = (b); }
template<class T> inline void chmin(T &a, const T &b) { if((a) > (b)) (a) = (b); }

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long double ld;
typedef pair<int,int> pii;
typedef tuple<int,int,int> iii;

template<typename T> using PQ = priority_queue<T, vector<T>, greater<T>>;
struct Fast { Fast(){ std::cin.tie(0); ios::sync_with_stdio(false); } } fast;

#if defined(PCM) || defined(LOCAL)
  #include "lib/dump.hpp"
#else
  #define dump(...) 42
  #define dump_1d(...) 42
  #define dump_2d(...) 42
#endif
//}}}

signed main() {
  int n;cin>>n;
  vi a(n);
  vvi chs(n);
  rep(i, 1, n){
    cin>>a[i];a[i]--;
    chs[a[i]].pb(i);
  }

  auto dfs = [&](const auto& dfs, int x) -> int {
    if (sz(chs[x])==0){
      return 0;
    }

    vi cand;
    each(ch, chs[x]){
      int v = dfs(dfs, ch);
      cand.pb(v);
    }
    sort(all(cand), greater<int>());
    int res = -INF;
    rep(i, sz(cand)){
      chmax(res, cand[i]+i+1);
    }
    return res;
  };

  int ans = dfs(dfs, 0);
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 12416
a,b = map(int,input().split(" "))
c = 1
d = 1
for i in range(2,a+1):
    c = (c * i) % (10 ** 9 + 7)
for i in range(2,b+1):
    d = (d * i) % (10 ** 9 + 7)
if abs(a - b) >= 2:
    print(0)
elif a == b:
    print(((c * d) * 2) % (10 ** 9 + 7))
else:
    print((c * d) % (10 ** 9 + 7))

Measured memory_bytes: 3064
/* ex3_3
    sak_Citrus*/

#include <stdio.h>

int main(void){
    //nはintだとオーバーフローする
    long int n;
    int k;
    scanf("%ld %d",&n,&k);
    
    //解の初期化、kで何回割れるかが桁数に一致
    int ans = 0;
    while(1){
        n = n / k;
        ans += 1;
        if(n == 0)
            break;
    }
    //解出力+改行
    printf("%d\n",ans);
    return 0;
}

Measured memory_bytes: 128
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
#define ll long long
#define ge getchar 
#define pun putchar('\n')
#define pu putchar
#define puk putchar(' ')
char c;
int n,i,a,b,l,r,e,z,rr,x[120],y[120],d[120],h[120];
bool o,w;
ll g[50];
int sri(){c=ge();int x=0;while(c<'0')c=ge();while(c>='0')x=(x<<3)+(x<<1)+c-'0',c=ge();return x;}
void sc(ll x){int l=0;if(x==0)g[l=1]=0;while(x)g[++l]=x%10,x/=10;for(;l;l--)putchar(g[l]+'0');}
int main(){
	n=sri();rr=1000001000;w=1;
	for(i=1;i<=n;i++)x[i]=sri(),y[i]=sri(),h[i]=sri();
	for(a=0;a<=100&&w;a++){
		for(i=1;i<=n;i++)if(x[i]>a)d[i]=x[i]-a;else d[i]=a-x[i];
		for(b=0;b<=100&&w;b++){l=0;r=rr;o=1;
			for(i=1;i<=n;i++){
				if(y[i]>b)e=y[i]-b;else e=b-y[i];
				if(h[i]){
					z=h[i]+e+d[i];
					if(l<=z&&r>=z)l=r=z;else{o=0;break;}
				}else{
					z=e+d[i];
					if(r>z){
						r=z;if(l>r){o=0;break;}
					}
				}
			}
			if(o){w=0;
				sc(a);puk;sc(b);puk;sc(r);pun;
			}
		}
	}
    return 0;
}

Measured memory_bytes: 3620
#include<bits/stdc++.h>
using namespace std;
const int uchiha=1e3+5;
set<char> st;
int main(){
    int n;
    char s;
    cin>>n;
for(int i=0;i<n;i++){
    cin>>s;
    st.insert(s);
}
if(st.size()==3)
    cout<<"Three";
else
    cout<<"Four";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll MOD = 1e9 + 7;
//constexpr ll MOD = 998244353;
//constexpr ll MOD = ;
ll mod(ll A, ll M) {return (A % M + M) % M;}
constexpr ll INF = 1LL << 60;
template<class T> bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template<class T> bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
ll divceil(ll A, ll B) {return (A + (B - 1)) / B;}
#define FINALANS(A) do {cout << (A) << '\n'; exit(0);} while (false)

int main()
{
  string S;
  cin >> S;

  string s = "Sunny", c = "Cloudy", r = "Rainy";

  string ans;
  if (S == s)
    ans = c;
  else if (S == c)
    ans = r;
  else if (S == r)
    ans = s;

  cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define double long double
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define mod 1000000007
#define endl "\n"
#define F first
#define S second
#define pb push_back
#define loop(a,b) for(int i=a; i<b; i++)
#define loopr(a,b) for(int i=a;i>=b;i--)
void solve()
{
	int n;cin>>n;
	int A[n];
	double ans=1;
	//int lastans;
	double a;
	for(int i=0;i<n;i++)
	{
	  cin>>A[i];
	}
	sort(A,A+n);
	if(A[0]==0)
	{
	     cout<<"0\n";return;
	}
	for(int i=0;i<n;i++)
	{
	     ans=ans*(double)A[i];
	     if(ans>1e18)
	     {
	          cout<<"-1\n";return;
	     }
	}
	int an=(int)ans;
	cout<<an;
	return;
}
int32_t main() 
{ 
	fast;
	int t=1;
	//cin>>t;
	while(t--)
	{
		solve();
	}
	return 0; 
}

Measured memory_bytes: 4428
n, a, b = map(int, input().split())
x = max(n // (a + b) - 2, 1)
while a * x + b * x < n:
    temp = a * x + b * x
    x += 1
temp = a * x + b * x
if temp - b >= n:
    temp = temp - b
    print(a * x - (temp - n))
else:
    print(a * x)


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

int main() {
  
  string s;
  int S, N;	
	cin >> s;
  
  N = s.size();
  
  S = 0;
  for(int i = 0;i < N / 2;i++){
    if(s.at(i) != s.at(N - i - 1)){
    	S++;
    }
  }
    cout << S << endl;
}

Measured memory_bytes: 256
from collections import deque

H, W = map(int, input().split())
s = [input() for i in range(H)]

cnt = 0
for i in range(H):
    for j in range(W):
        if s[i][j] == '.':
            cnt += 1

dist = [[-1 for i in range(W)] for j in range(H)]
dx = [1, 0, -1, 0]
dy = [0, 1, 0, -1]

def bfs():
    q = deque()
    q.append([0, 0])
    dist[0][0] = 1
    while q:
        p = q.popleft()
        if p[0] == H-1 and p[1] == W-1:
            break
        for i in range(4):
            nx = p[0] + dx[i]
            ny = p[1] + dy[i]
            if 0 <= nx and nx < H and 0 <= ny and ny < W:
                if s[nx][ny] != '#' and dist[nx][ny] == -1:
                    q.append([nx, ny])
                    dist[nx][ny] = dist[p[0]][p[1]] + 1
    return dist[H-1][W-1]

d = bfs()
if d > 0:
    ans = cnt - d
else:
    ans = -1
print(ans)

Measured memory_bytes: 3316
#include <iostream>
using namespace std;
#define ll long long

void solve(){
  ll N, K;
  cin >> N >> K;

  if ( K % 2 != 0 ) {
    ll res = 0;
    for (ll i = 1; i <= N; ++i) {
      if (i % K == 0) res++;
    }
    cout << res * res * res << endl;
  } else {
    ll res1 = 0;
    ll res2 = 0;
    for (ll i = 1; i <= N; ++i) {
      if ((i - (K / 2)) % K == 0) res1++;
      else if(i % K == 0) res2++;
    }

    cout << (res1 * res1 * res1) + (res2 * res2 * res2) << endl;
  }
}

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

Measured memory_bytes: 256
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <bitset>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <iomanip>
#include <string>
#include <chrono>
#include <random>
#include <cmath>
#include <cassert>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <functional>
#include <sstream>

using namespace std;

class Solution {
public:
    int solve(int n, int K) {
        const long long MOD = 1000000007;

        int m = 0;
        while (m * 1LL * m <= n) {
            ++m;
        }
        --m;

        vector<int> P;
        for (int i = 1; i <= m; ++i) {
            P.push_back(i);
            P.push_back(n / i);
        }
        P.push_back(0);
        sort(P.begin(), P.end());
        P.resize(unique(P.begin(), P.end()) - P.begin());

        // for (auto x : P) {
        //     cout << x << " ";
        // }
        // cout << endl;
        // cout << "m " << m << endl;

        int N = P.size();

        vector<long long> dp(N, 0);
        dp[1] = 1;
        vector<long long> ndp(dp);

        for (int _ = 0; _ < K; ++_) {
            fill(ndp.begin(), ndp.end(), 0);

            long long sum = 0;
            for (int i = 0; i <= m; ++i) {
                (sum += dp[i]) %= MOD;
            }
        
            for (int i = m, j = m + 1; i > 0; --i) {
                if (j < N && P[i] * 1LL * P[j] <= n) {
                    (sum += dp[j]) %= MOD;
                    ++j;
                }
                ndp[i] = sum;
            }

            sum = 0;
            for (int i = 0; i <= m; ++i) {
                (sum += dp[i]) %= MOD;
            }

            for (int i = m + 1, j = m; i < N; ++i) {
                long long cnt = P[i] - P[i - 1];
                if (j >= 0 && P[j] * 1LL * P[i] > n) {
                    (sum += MOD - dp[j]) %= MOD;
                    --j;
                }
                // cout << P[i] << " " << cnt << " " << sum << endl;
                (ndp[i] = sum * cnt % MOD) %= MOD;
            }

            swap(dp, ndp);

            // for (int j = 0; j < N; ++j) {
            //     cout << j << ":" << dp[j] << endl;
            // }
        }

        long long res = 0;
        for (int i = 0; i < N; ++i) {
            (res += dp[i]) %= MOD;
        }

        return res;
    }

private:


};

int main(int argc, char** argv) {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n;
    int k;
    cin >> n >> k;
    Solution sol;
    cout << sol.solve(n, k) << "\n";


    return 0;
}

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

using namespace std;

int main()
{
	for(int n,m;cin>>n>>m,n|m;){
		pair<int,int> rs[n]; // (期待値,距離)
		for(int i=0;i<n;i++) cin>>rs[i].second>>rs[i].first;
		
		sort(rs,rs+n,greater<pair<int,int>>());
		int res=0;
		for(int i=0;i<n;i++){
			res+=rs[i].first*max(rs[i].second-m,0);
			m=max(m-rs[i].second,0);
		}
		
		cout<<res<<endl;
	}
	
	return 0;
}

Measured memory_bytes: 1240
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main(){
    string s;
    int a=0;
    cin >> s;
    for(int i=0;i<4;i++){
        if(s.at(i) == '+'){
            a++;
        }else{
            a--;
        }
    }
    cout << a << endl;
}

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

const int N=1e5+1e3+7;

long long a[N],vis[N],n,l,r;

int main()
{
	cin>>n;
	for(int i=1;i<=n;i++)
		cin>>a[i];
	sort(a+1,a+n+1);
	l=r=-1;
	for(int i=n;i>=1;i--)
	{
		if(a[i]==a[i-1]&&l==-1)
			l=a[i],i--;
		else
			if(a[i]==a[i-1])
				r=a[i];
		if(l!=-1&&r!=-1)
			break;
	}
	if(l!=-1&&r!=-1)
		cout<<l*r;
	else
		cout<<0;
}

Measured memory_bytes: 1024
void main() {
	auto a = ri;
	writeln(a + a*a + a*a*a);
}

// ===================================

import std.stdio;
import std.string;
import std.functional;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

long rl() {
	return readAs!long;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}

Measured memory_bytes: 2680
class C {
    static func solve() {
        let X = readLine()!.split(separator: " ").map { Int($0)! }.first!
        let ps = readLine()!.split(separator: " ").map { Int($0)! }.sorted()

        if ps.isEmpty {
            print(X)
            return
        }

        var temp = 500
        var diffTemp = 500
        ps.forEach { i in
            let diff = min(abs(X - i), diffTemp)
            if diff < diffTemp {
                temp = i
                diffTemp = diff
            }
        }
        var diff = 0
        while true {
            if !ps.contains(temp - diff) {
                print(temp - diff)
                break
            } else if !ps.contains(temp + diff) {
                print(temp + diff)
                break
            } else {
                diff += 1
            }
        }
    }
}

C.solve()


Measured memory_bytes: 8396
// ABC92 C

#include <iostream>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>

using namespace std;

int main() {
    int n;
    long a[200000];
    a[0] = 0;
    long diff[200000];

    cin >> n;
    int64_t sum = 0;
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
        diff[i] = abs(a[i] - a[i - 1]);

        sum += diff[i];
    }
    diff[n + 1] = abs(a[n]);
    sum += diff[n + 1];

    for(int i = 1; i <= n; i++) {
        cout << sum - diff[i] - diff[i + 1]+ abs(a[i + 1] - a[i - 1]) << endl;
    }
}


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

int main() {int k,x,i;
	// your code goes here
	cin>>k>>x;
	for(i=x-k+1;i<x+k;i++)
	{if(-1000000<=i<=1000000)
	    {cout<<i<<" ";}}
	return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define optimizar_io ios_base::sync_with_stdio(false);cin.tie(0);

typedef long long int ll;

bool check(int a[], int n, int k, int mid) {
	ll cortes = 0;
	if (mid == 0) {
		for (int i = 0; i < a[i]; i++) {
			cortes += 2 * a[i] + 1;
		}
	}
	else {
		for (int i = 0; i < n; i++) {
			if (a[i] <= mid) continue;
			cortes += a[i] / mid;
		}
	}
	return cortes <= k;
}

int main() {
	optimizar_io
	int n, k, a[200010];

	cin >> n >> k;
	for (int i = 0; i < n; i++) cin >> a[i];
	int left = 1, right = *max_element(a, a + n);
	while (left < right) {
		int mid = left + (right - left) / 2;
		if (check(a, n, k, mid))
			right = mid;
		else
			left = mid + 1;
	}
	cout << left << "\n";
	return 0;
}

Measured memory_bytes: 4424
import math
N, K = map(int, input().split())
A = list(map(int, input().split()))

#めぐる式二分探索
#indexが条件を満たすか判定
def isOK(mid, A):
  count = 0
  for i in range(N):
    if A[i] > mid:
      xx = A[i] / mid
      if xx % 1 != 0:
        xx += 1
      count += int(xx - 1)
      
  #print("c", count)
  if count > K:
    return False
  else:
    return True
  
#にぶたん
#A : 配列
def binary_search(A):
  N = 10 ** 9
  ng = -1
  ok = N
  while (abs(ok - ng) > 1):
    mid = int((ok + ng) / 2)
    if mid == 0:
      return 1
    #print(ng, ok, mid)
    if isOK(mid, A):
      ok = mid
    else:
      ng = mid
  return ok
  
#a = [1, 14, 32, 51, 51, 51, 243, 419, 750, 910]

print(binary_search(A))
  



Measured memory_bytes: 93700
#include <iostream>
//#include <set>
//#include <map>
//#include <iomanip>
#include <algorithm>
//#include <numeric>
//#include <queue>
//#include <stack>
//#include <math.h>
#include <vector>
//#include <string>
//#include <list>
//#include <deque>
//#include <unordered_map>
//typedef long long LL;
//typedef long double LD;
using namespace std;
 
//#define MOD 1000000007
//#define MAX 200100
//#define NIL -1

int main() {
    vector<int> abc(3);
    int ans;
    cin >> abc[0] >> abc[1] >> abc[2];
    sort(abc.begin(), abc.end());
    int tmp=2*abc[2]-abc[1]-abc[0];
    if(tmp%2!=0){
        ans=tmp/2+2;
    }else{
        ans=tmp/2;
    }

    cout << ans << endl;

    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 reps(i,s,n) for(int (i)=(s);(i)<(n);(i)++)
#define repr(i,n) for(int (i)=(n)-1;(i)>=0;(i)--)
#define forin(i,array) for(auto& x:array)
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define mod 1000000007
#define inf 10000000000000


typedef long long ll;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef pair<int,int> pint;
typedef pair<ll,ll> pll;
typedef vector<pint> vpint;

int n,k;
vint table(1e6+9);

int main(){
    cin>>n>>k;

    priority_queue<pint> q;
    priority_queue< pint,vector<pint>,greater<pint> > q2;

    rep(i,n){
        int x,y;
        cin>>x>>y;
        q.push(pint(y,x));
    }

    ll kind=0;
    ll sum_num=0;
    ll max_num=0;
    rep(i,k){
        pint p=q.top();q.pop();
        if(table[p.second]==0){
            kind++;
        }
        table[p.second]++;
        sum_num+=p.first;
        q2.push(pint(p.first,p.second));
    }
    max_num=sum_num+kind*kind;

    while(!q2.empty() && !q.empty()){
        pint old_one=q2.top();q2.pop();
        if(table[old_one.second]==1)continue;
        pint new_one=q.top();q.pop();
        if(table[new_one.second]==0){
            kind++;
            sum_num=sum_num+new_one.first-old_one.first;
            max_num=max(max_num,sum_num+(ll)kind*kind);
            q2.push(new_one);
            table[new_one.second]++;
        }
        else{
            q2.push(old_one);
        }

    }

    cout<<max_num<<endl;
    return 0;
}

Measured memory_bytes: 6516
#pragma GCC optimize ("O3")

#include <bits/stdc++.h>

using namespace std;

#ifdef LOCAL
#include <prettyprint.hpp>
#define debug(...)  cerr << "[" << #__VA_ARGS__ << "]: ", d_err(__VA_ARGS__);
#else
#define debug(...) 83;
#endif

void d_err() {
    cerr << endl;
}

template <typename H, typename... T>
void d_err(H h, T... t) {
    cerr << h << " ";
    d_err(t...);
}

template <typename T>
void print(T x) {
    cout << x << endl;
}

#define ALL(x) (x).begin(), (x).end()
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define bcnt __builtin_popcountll

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<ll,ll> Pll;
typedef pair<int,int> Pin;

ll INF = 1e16;
int inf = 1e9;
ll MOD = 1e9+7;

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

    int N;
    cin >> N;

    ll cnt = 0;
    REP(i, N) {
        ll a;
        cin >> a;

        while(a % 2 == 0) {
            cnt++;
            a /= 2;
        }
    }

    print(cnt);

}


Measured memory_bytes: 256