akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep_r(i, n) for(int i = n-1; i >= 0; i--)
#define rep1(i, n) for(int i = 1; i <= (int)(n); i++)
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((ll)(x).size())
#define bit(n) (1LL<<(n))
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

#define INF bit(60)
#define pb push_back
#define mod 1000000007

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

using namespace std;
using uif=uint_fast64_t;
using ll=long long int;
using tTree=__gnu_pbds::tree< ll , __gnu_pbds::null_type, less< ll >, __gnu_pbds::rb_tree_tag, __gnu_pbds::tree_order_statistics_node_update>;

int qp(int a,ll b){int ans=1;do{if(b&1)ans=1ll*ans*a%mod;a=1ll*a*a%mod;}while(b>>=1);return ans;}
int qp(int a,ll b,int mo){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}

int gcd(int a,int b){return b?gcd(b,a%b):a;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};


#define FACSIZE 2002

ll invfac[FACSIZE];
ll fac[FACSIZE];

ll mod_pow(ll ,ll );
ll mod_add(ll ,ll );
ll mod_mul(ll ,ll );
ll mod_div(ll ,ll );
void make_fact(ll );
void make_invfact(ll );



int main(void){

  string s;
  cin>>s;
  char prev=-1;

  ll LPos;
  ll RPos;

  vector<ll> ans(s.size(),0);

  unordered_set<ll> unse;
  for( ll i=0;i<s.size();i++ ){
    auto c=s[i];
    if(prev=='R'&& c=='L')
    {
      LPos=i;
      RPos=i-1;
      unse.insert(i);
    }
    else if(prev=='L'&& c=='R'){
      
      for(auto x:unse){
        if( x%2 == LPos%2 ){
          ans[LPos]++;
        }
        else ans[RPos]++;
      }
      unse.clear();
      unse.insert(i);
    }
    else if(c=='R'){
      unse.insert(i);
    }
    else if(c=='L'){
      unse.insert(i);
    }

    prev=c;
  }

  if(!unse.empty()){
    for(auto x:unse){
        if( x%2 == LPos%2 ){
          ans[LPos]++;
        }
        else ans[RPos]++;
      }
    unse.clear();
  }

  for(auto x:ans){
    cout << x << " ";
  }
  cout << endl;

  return 0;

}

ll mod_pow(ll x,ll r){
  if(r==0) return 1;
  else if(r==1) return x%mod;
  else if(r%2==0){
    ll t=mod_pow(x,r/2)%mod;
    return t*t %mod;
  } 
  else{
    ll t=mod_pow(x,r/2)%mod;
    ll k= t*t %mod;
    return k*x%mod;
  } 
}
ll mod_add(ll a,ll b){
  return (a+b)%mod;
}

ll mod_mul(ll a,ll b){
  return (a*b)%mod;
}

ll mod_div(ll a,ll b){
  return mod_mul(a,mod_pow(b,mod-2));
}

void make_fact(ll n){
  fac[0]=1;
  rep(i,n){
    fac[i+1]=mod_mul(fac[i],i+1);
  }  
}

void make_invfact(ll n){
  invfac[n]= mod_pow( fac[n] ,mod-2);
  for(int i=n-1;i>=0;i--){
    invfac[i]=mod_mul(invfac[i+1],i+1);
  }

}

Measured memory_bytes: 5412
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using static System.Math;

namespace CsharpSpiral {
    partial class Program {
        static void Main(string[] args) {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = true };
            Console.SetOut(sw);
            new Program().Solve(new ConsoleInput(Console.In, ' '));
            Console.Out.Flush();
        }
        public void Solve(ConsoleInput cin) {
            while(true) {
                var cards = cin.Read.ToCharArray();
                if(new string(cards) == "-") break;
                var m = cin.ReadInt;
                var h = 0;
                for(int i = 0; i < m; i++) {
                    h += cin.ReadInt;
                }
                h %= cards.Length;
                var res = new string(cards.Skip(h).ToArray()) + new string(cards.Take(h).ToArray());
                Console.WriteLine(res);
            }
        }
    }

    static class ExtendClass {
        public static void Swap<T>(this T[] X, int i, int j) {
            T tmp = X[i];
            X[i] = X[j];
            X[j] = tmp;
        }
        public static string Join<T>(this T[] X, string separator = " ") => string.Join(separator, X);
        public static S[] Clone<S>(this S[] src) where S : struct {
            var res = new S[src.Length];
            Array.Copy(src, res, src.Length);
            return res;
        }
    }

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



Measured memory_bytes: 20808
#include<iostream>
#include<cstdio>
using namespace std;
int main(){
  double a[10],v[2];
  for(;;){
    if(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&a[0],&a[1],&a[2],&a[3],&a[4],&a[5],&a[6],&a[7],&a[8],&a[9],&v[0],&v[1]) == EOF) break;
    double x = 0;
    for(int i=0; i<10; i++) x+=a[i];
    x = x/(v[0]+v[1])*v[0];
    for(int i=0; i<10; i++){
      x-=a[i];
      if(x<0.0001){
	cout <<i+1<<endl;
	break;
      }
    }
  }
  return 0;
}

Measured memory_bytes: 1228
listS = list(map(int, input().split("/")))
if listS[0] > 2019:
    print("TBD")
else:
    if listS[0] == 2019:
        if listS[1] > 4:
            print("TBD")
        else:
            print("Heisei")
    else:
        print("Heisei")

Measured memory_bytes: 3060
import java.util.*;

public class Main {

    void solve() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        int[] V = new int[N];
        for (int i = 0; i < N; i++) {
            V[i] = sc.nextInt();
        }

        List<Integer> sums = new ArrayList<>();
        for (int countA = 0; countA <= K; countA++) {
            for (int countB = 0; countB <= (K - countA); countB++) {
                int countCD = K - countA - countB;

                // 持っている宝石の価値のリスト
                List<Integer> havings = new ArrayList<>();

                // キューを作成
                Deque<Integer> queue = new ArrayDeque();
                for (int i = 0; i < N; i++) {
                    queue.addLast(V[i]);
                }

                // 操作A
                for (int i = countA; i > 0; i--) {
                    Integer tmp = queue.pollFirst();
                    if (tmp == null) {
                        break;
                    }
                    havings.add(tmp);
                }

                // 操作B
                for (int i = countB; i > 0; i--) {
                    Integer tmp = queue.pollLast();
                    if (tmp == null) {
                        break;
                    }
                    havings.add(tmp);
                }
                // 操作CD
                Collections.sort(havings);
                // リスト走査しながら、エントリを削除したいので、Iterator を使用。
                Iterator<Integer> iter = havings.iterator();
                while (iter.hasNext()) {
                    if (iter.next() < 0 && countCD > 0) {
                        iter.remove();
                    } else {
                        break;
                    }
                    countCD--;
                }
                int sum = 0;
                for (Integer having : havings) {
                    sum += having;
                }
                sums.add(sum);
            } // 内 for
        } // 外 for

        Collections.sort(sums, Collections.reverseOrder());
        System.out.print(sums.get(0));
    }

    // Main
    public static void main(String[] args) {
        new Main().solve();
    }
}

Measured memory_bytes: 38028
// https://ynucpc.github.io/blog/2018/04/15/cp_vscode/
// http://www.atmarkit.co.jp/ait/articles/1509/08/news019.html

#include <bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define rep1(i,n) for(ll i=1;i<=(ll)(n);i++)
#define rep3(i,n,m) for(ll i=(n);i<(ll)(m);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << (x) << endl
// #define max(a, b) ((a) > (b) ? (a) : (b))
// #define min(a, b) ((a) < (b) ? (a) : (b)) 
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){
	return o<<"("<<p.fs<<","<<p.sc<<")";
}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){
	o<<"{";
	for(const T& v:vc) o<<v<<",";
	o<<"}";
	return o;
}
using ll = long long;
template<class T> using V = vector<T>;
template<class T> using VV = vector<vector<T>>;
int _stoi(string s, int tmp=10){
	istringstream stm(s);
	int res;
	stm >> res;
	return res;
}
double _stod(string s, int tmp=10){
	istringstream stm(s);
	double res;
	stm >> res;
	return res;
}
template<typename T>string to_string(const T& n){
	std::ostringstream stm;
	stm << n;
	return stm.str();
}

// 降順ソート: sort(A, A+N, greater<>());
// min: *min_element(A, A+N)
// argmin: min_element(A, A+N)-A

ll gcd(ll a, ll b){
	if (a==0){
		return b;
	}else{
		return gcd(b%a, a);
	}
}


int main(){	
	// ll A; cin >> A;
	// cout << "hello" << _stoi("14") << max({1,3}) << endl;
	ll N, M, C;
	cin >> N >> M >> C;
	ll B[M];
	rep(i, M)cin >> B[i];
	ll ans=0;
	rep(i, N){
		ll an=0;
		rep(i, M){
			ll a;
			cin >> a;
			an += a*B[i];
		}
		if(an+C>0)ans++;
	}
	cout << ans << endl;

}








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

#define vi vector<int>
#define pb push_back

string s;
ll ans = 0;


void dfs(int li,int index, ll sum){
        if(li == s.length()) {
                ans += sum;
        }
        if(li+index > s.length()) {
                return;
        }
        // + 入れないとき
        dfs(li,index+1,sum);
        // + 入れるとき
        ll num = atoll(s.substr(li,index).c_str());
        dfs(li+index,1,sum+num);
}

int main(){
        cin >> s;
        dfs(0,1,0);
        cout << ans << endl;
        return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <string.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i, m, n) for(int i = m; i < n; i++) 
#define mod 1000000007
#define pi 3.1415926535
typedef long long ll;
int main(){
    int N,K;
    cin>>N>>K;
    int count=0;
    FOR(i,1,N+1){
        if(i+K-1<=N){
            count++;
        }
    }
    cout<<count<<endl;
    
    return 0;
}

Measured memory_bytes: 256
x,y,a,b,c=map(int,input().split())

a_list=list(map(int,input().split()))
a_list=sorted(a_list)
b_list=list(map(int,input().split()))
b_list=sorted(b_list)
a_list=a_list[-x:]
b_list=b_list[-y:]
c_list=list(map(int,input().split()))
for i in range(c):
    c_list[i]=-c_list[i]
import heapq
heapq.heapify(a_list)
heapq.heapify(b_list)
heapq.heapify(c_list)

flag=True
while flag and c_list:
    x=heapq.heappop(c_list)
    x=x*(-1)
    #ｃ_listの中でのもっとも大きい値
    min_a=heapq.heappop(a_list)
    min_b=heapq.heappop(b_list)
    if min(min_a,min_b)>=x:
        flag=False
        heapq.heappush(a_list,min_a)
        heapq.heappush(b_list,min_b)
    else:
        if min_a>=min_b:
            heapq.heappush(a_list,min_a)
            heapq.heappush(b_list,x)
         
        elif min_a<min_b:
            heapq.heappush(b_list,min_b)
            heapq.heappush(a_list,x)

sum_a=sum(list(a_list))
sum_b=sum(list(b_list))

print(sum_a+sum_b)
            

    




Measured memory_bytes: 106708
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
bool bo[100];
#define ll long long int

int main()
{
	int n,m;
	cin>>n>>m;
	char a[n+10][n+10],b[m+10][m+10];
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<n;j++)
		{
			cin>>a[i][j];
		}
	}
	for(int i=0;i<m;i++)
	{
		for(int j=0;j<m;j++)
		{
			cin>>b[i][j];
		}
	}
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<n;j++)
		{

				int cnt=0;
				for(int k=0;k<m;k++)
				{
					for(int l=0;l<m;l++)
					{
						if(i+k>=n || j+l>=n)
						{
							cnt=1;
							break;
						}
						if(a[i+k][j+l]!=b[k][l])
						{
							cnt=1;
							break;
						}
					}
					if(cnt==1) break;
				}
				if(cnt==0)
				{
					cout<<"Yes"<<endl;
					return 0;
				}
			
		}
	}
	cout<<"No"<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) a.begin(), a.end()
#define MS(m,v) memset(m,v,sizeof(m))
#define D10 fixed<<setprecision(10)
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> pii;
const int MOD = 1000000007;
const int INF = MOD + 1;
const ld EPS = 1e-12;
template<class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<class T> T &chmax(T &a, const T &b) { return a = max(a, b); }

/*--------------------template--------------------*/

int A, T, G, C, m;
int dp[51][51][51][51];
map<string, int> mp;
vector<vs> v;
vs tar;

ll solve(int i, int a, int t, int g, int c)
{
	ll res = 0;
	if (a > A || t > T || g > G || c > C) return 0;
	if (i == tar.size())
	{
		if (a == A&&t == T&&g == G&&c == C) return 1;
		else return 0;
	}
	if (dp[a][t][g][c] >= 0) return dp[a][t][g][c];
	REP(j, tar[i].size())
	{
		if (tar[i][j] == 'A') res += solve(i + 1, a + 1, t, g, c);
		if (tar[i][j] == 'T') res += solve(i + 1, a, t + 1, g, c);
		if (tar[i][j] == 'G') res += solve(i + 1, a, t, g + 1, c);
		if (tar[i][j] == 'C') res += solve(i + 1, a, t, g, c + 1);
		res %= MOD;
	}
	return dp[a][t][g][c] = res%MOD;
}

bool f;
vs search(int i)
{
	vs res;
	REP(j, v[i].size())
	{
		if (v[i][j][0] == '[') res.push_back(v[i][j].substr(1, v[i][j].size() - 2));
		else
		{
			int nx = mp[v[i][j]];
			vs tmp = search(nx);
			if (tmp == vs{ "-1" } || res.size() + tmp.size() > A + T + G + C) return vs{ "-1" };
			res.insert(res.end(), ALL(tmp));
		}
	}
	return res;
}

int main()
{
	MS(dp, -1);
	cin >> A >> T >> G >> C >> m;
	string s;
	int tmp = -1;
	v.resize(m);
	while (cin >> s)
	{
		if (s.back() == ':')
		{
			tmp++;
			s.pop_back();
			mp[s] = tmp;
		}
		else
		{
			v[tmp].push_back(s);
		}
	}
	f = true;
	tar = search(0);
	if (!f)
	{
		puts("0");
		return 0;
	}
	cout << solve(0, 0, 0, 0, 0) % MOD << endl;
	return 0;
}

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

int64_t gcd(int64_t X, int64_t Y){
  int64_t X0=max(X, Y);
  int64_t Y0=min(X, Y);
  if(X0%Y0==0){
    return Y0;
  }
  else{
    return gcd(Y0, X0%Y0);
  }
}

int64_t isprime(int64_t X){
  int64_t S=(int64_t)sqrt(X);
  int64_t Ans=1;
  for(int64_t i=2; i<=S; i++){
    if(X%i==0){
      Ans=0;
      break;
    }
  }
  return Ans;
}

int main(){
  int64_t Ans=0;
  int64_t A, B;
  cin >> A >> B;
  int64_t L=gcd(A, B);
  for(int64_t i=2; i<=min(L, (int64_t)1000000); i++){
    if(L%i==0){
      Ans++;
      while(L%i==0){
        L=L/i;
      }
    }
  }
  for(int64_t i=L; i>1000000; i--){
    if(L%i==0){
      Ans++;
      while(L%i==0){
        L=L/i;
      }
      i=L+1;
    }
  }
  cout << Ans+1 << endl;
}

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

int main() {
    int n;
    cin >> n;
    long long ans = 1;
    vector<long long> v;
    for (int i = 0; i < n; i++) {
        long long k;
        cin >> k;
        if (k == 0) {
            cout << 0 << endl;
            return 0;
        }
        v.push_back(k);
    }

    for (int i = 0; i < n; i++) {
        if (v.at(i) > (long double) 1000000000000000000.0 / ans) {
            cout << -1 << endl;
            return 0;
        } 
        ans *= v.at(i);
    }
    cout << ans << endl;
}

Measured memory_bytes: 4196
import java.util.Scanner;
class Main {
   public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] S = new int[n]; 
		
		for(int i = 0; i < n; i++){
			S[i] = scan.nextInt();
		}
		
		int q = scan.nextInt();
		int[] T = new int[q];
		
		for(int i = 0; i < q; i++){
			T[i] = scan.nextInt();
		}
		
		int result = 0;
		for(int i = 0; i < T.length; i++){
			result += linearSearch(S, T[i]);
		}
		
		System.out.println(result);
	}

	static int linearSearch(int data[], int serch){
		
		for(int i = 0; i < data.length; i++){
			if(data[i] == serch){
				return 1;
			}
		}
		
		return 0;
	}
}

Measured memory_bytes: 39900
#include<bits/stdc++.h>
#define ll long long 
#define vl vector
#define pb push_back
#define ff first
#define ss second
using namespace std;
int main()
{
    ll n;
    cin>>n;
    ll count=0;
    ll sum=0;
    while(1)
    {
        count++;
        sum+=n;
        if(sum%360==0) break;
    }
    cout<<count;
    
}

Measured memory_bytes: 3568
/* Bismillahir Rahmanir Rahim */

#include <bits/stdc++.h>

#define f	first
#define s	second

using namespace std;

typedef pair<long long, long long>pii;

const int N = 105;

long long n, W;
long long a[N], v[N];
vector<long long>val[N];

int main(){
	scanf("%lld %lld", &n, &W);
	map<int, int>mp;
	for(int i=1;i<=n;i++){
		scanf("%lld %lld", &a[i], &v[i]);
		val[ a[i] - a[1] ].push_back( v[i] );
	}
	for(int i=0;i<=3;i++){
		sort(val[i].begin(), val[i].end());
		val[i].push_back(0);
		reverse(val[i].begin(), val[i].end());
		for(int j=1;j<val[i].size();j++) val[i][j] += val[i][j-1];
	}
	long long ret = 0;
	for(int i=0;i<val[0].size();i++){
		for(int j=0;j<val[1].size();j++){
			for(int k=0;k<val[2].size();k++){
				long long tot = 0;
				tot += 1LL * i * a[1];
				tot += 1LL * j * (a[1] + 1);
				tot += 1LL * k * (a[1] + 2);
				if(tot > W) break;
				long long left = (W - tot) / (a[1] + 3);
				if(left >= val[3].size()) left = max(0, int(val[3].size()) - 1);
				long long ans = val[0][i] + val[1][j] + val[2][k] + val[3][left];
				ret = max(ret, ans);
			}
		}
	}
	cout << ret << endl;
	return 0;
}



Measured memory_bytes: 256
#include<stdio.h>
int main(){
int a[3];
int m=0,n=0;
for(int i=0;i<3;i++)
scanf("%d",&a[i]);
for(int i=0;i<3;i++){
if(a[i]==5)
m++;
if(a[i]==7)
n++;
}
if(m==2&&n==1)
printf("YES\n");
else
printf("NO\n");
return 0;	
} 

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int a[10];
int main(){
	for (register int i=1; i<=3; ++i) scanf("%d",&a[i]);
	sort(a+1,a+3+1);
	if (a[2]==a[1] && a[2]!=a[3] || a[2]==a[3] && a[2]!=a[1]) puts("Yes");
	else puts("No");
return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define int ll
#define rep(i,n) for(int i=0;i<n;i++)
#define all(in) in.begin(), in.end()
constexpr int INF = (numeric_limits<int>::max() == INT_MAX ? (int)1e9 : (long long)1e18);
constexpr long double eps = 1e-6;
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
template<typename Head, typename Value> auto vectors(const Head &head, const Value &v) { return vector<Value>(head, v); }
template<typename Head, typename... Tail> auto vectors(Head x, Tail... tail) { auto inner = vectors(tail...); return vector<decltype(inner)>(x, inner); }
using ld  = long double;using pii = pair<int,int>;using piii = pair<int,pii>;
int W,H;
int dx[]={0,0,1,-1}, dy[]={1,-1,0,0};
bool valid(int x,int y){return (0<=x&&x<W)&&(0<=y&&y<H);}
void fast_io(){ios::sync_with_stdio(false); cin.tie(nullptr);}
signed main(){
    int N,M; cin >> N >> M;
    cout << 1 + ((N - M) / (M - 1) + ((N - M) % (M - 1) != 0 )) << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) for(int i = 0; i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define show(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
const int INF = 2000000000;
using namespace std;


class Edge{
    public:
        int to, cost;
        Edge(int to, int cost) : to(to) ,cost(cost) {}
};

typedef vector<vector<Edge>> AdjList;
vector<int> dis;

bool bellmanFord(AdjList g, int n, int s) { // n???????????°???s???????§???????
    dis = vector<int>(n, INF);
    dis[s] = 0; // ????§????????????¢???0
    rep(i,n){
        rep(v,n){
            rep(k,g[v].size()){
                Edge e = g[v][k];
                if (dis[v] != INF && dis[e.to] > dis[v] + e.cost) {
                    dis[e.to] = dis[v] + e.cost;
                    if (i == n - 1) return true; // n??????????????´??°???????????????????????????????????¨
                }
            }
        }
    }
    return 0;
}

int main(){
    int v, e, r;
    cin >> v >> e >> r;
    AdjList g(v);
    rep(i,e){
        int a, b ,c;
        cin >> a >> b >> c;
        g[a].emplace_back(b,c);
    }
    if(bellmanFord(g, v, r) == 1) cout << "NEGATIVE CYCLE" << endl;
    else{
        for(auto it:dis){
            if(it == INF) cout << "INF" << endl;
            else cout << it << endl;
        }
    }
}

Measured memory_bytes: 3224
#include<bits/stdc++.h>
#define mod 998244353
#define maxn 502030

using namespace std;
typedef long long ll;
ll a[maxn],n,k,ans;

ll pow_(ll x,ll y){
    ll rt=1;
    while (y){
        if (y&1) rt=rt*x%mod;
        y>>=1; x=x*x%mod;
    }
    return rt;
}

int main()
{
    scanf("%d%d",&k,&n); a[0]=1; ans=pow_(2,n-1);
    for (int i=1;i<=n;i++) a[i]=a[i-1]*(n-i+1)%mod*pow_(i,mod-2)%mod;
    for (int i=k&1;i<k;i+=2) ans=(ans-a[i]+mod)%mod;
    cout << ans << endl;
}


Measured memory_bytes: 4096
#include <bits/stdc++.h>
#define ALL(obj) begin(obj), end(obj)
using namespace std;
template <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
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;
}

using ll = long long;
using ull = unsigned long long;
const int INF = 2100100100;
const int MOD = 1e9 + 7;

ll N, M, K, Q;
string S;
int size;
vector<vector<int>> w, b, W, B;

int get_sum(const vector<vector<int>> &S, int i1, int j1, int i2, int j2) {
    return S[i2][j2] - S[i1][j2] - S[i2][j1] + S[i1][j1];
}

int main() {
    cin >> N >> K;
    vector<int> x(N), y(N);
    vector<char> c(N);
    for (int i = 0; i < N; i++) {
        cin >> x.at(i) >> y.at(i) >> c.at(i);
        x[i] %= 2 * K;
        y[i] %= 2 * K;
    }

    size = K * 2;
    w = make_vec<int>(size, size);
    b = make_vec<int>(size, size);
    W = make_vec<int>(size + 1, size + 1);
    B = make_vec<int>(size + 1, size + 1);
    for (int i = 0; i < N; i++) {
        if (c[i] == 'W') {
            w[x[i]][y[i]]++;
        } else if (c[i] == 'B') {
            b[x[i]][y[i]]++;
        }
    }

    for (int i = 0; i < size; i++) {
        for (int j = 0; j < size; j++) {
            W[i + 1][j + 1] = W[i][j + 1] + W[i + 1][j] - W[i][j] + w[i][j];
            B[i + 1][j + 1] = B[i][j + 1] + B[i + 1][j] - B[i][j] + b[i][j];
        }
    }

    int ans = 0;
    for (int i = 0; i <= K; i++) {
        for (int j = 0; j <= K; j++) {
            int sum = 0;
            sum += get_sum(W, i, j, i + K, j + K);
            sum += get_sum(W, 0, 0, i, j);
            sum += get_sum(W, 0, j + K, i, size);
            sum += get_sum(W, i + K, 0, size, j);
            sum += get_sum(W, i + K, j + K, size, size);
            sum += get_sum(B, 0, j, i, j + K);
            sum += get_sum(B, i, 0, i + K, j);
            sum += get_sum(B, i + K, j, size, j + K);
            sum += get_sum(B, i, j + K, i + K, size);
            chmax(ans, sum);
        }
    }
    for (int i = 0; i <= K; i++) {
        for (int j = 0; j <= K; j++) {
            int sum = 0;
            sum += get_sum(B, i, j, i + K, j + K);
            sum += get_sum(B, 0, 0, i, j);
            sum += get_sum(B, 0, j + K, i, size);
            sum += get_sum(B, i + K, 0, size, j);
            sum += get_sum(B, i + K, j + K, size, size);
            sum += get_sum(W, 0, j, i, j + K);
            sum += get_sum(W, i, 0, i + K, j);
            sum += get_sum(W, i + K, j, size, j + K);
            sum += get_sum(W, i, j + K, i + K, size);
            chmax(ans, sum);
        }
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 64000
#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

int main() {
    int N = 0;
    cin>>N;
    vector<pair<int,int> > frnds(N);
    for (int n = 0; n < N; n++) {
        int a,b;
        cin>>a>>b;
        frnds[n] = make_pair(a,b);
    }
    sort(frnds.begin(), frnds.end());
    for (int max = N + 1; max >= 1; max--) {
        int miss = 0;
        for (int n = N-1; n>= 0; n--) {
            if (!(frnds[n].first <= max && max <=frnds[n].second)) {
                miss++;
                if (N - miss + 1 < max) break;
            }
        }
        if (N - miss + 1 >= max) {
            cout<<max-1<<endl;
            break;
        }
    }
}

Measured memory_bytes: 3600
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef vector<char> vc;
typedef queue<ll> ql;
typedef deque<ll> dql;
typedef priority_queue<ll/*, vl, greater<ll>*/> pql; //降順(/*昇順*/)
typedef set<ll> sl;
typedef pair<ll, ll> pl;
typedef vector<vl> vvl;
typedef vector<pl> vpl;
#define rep(i, n) for(ll i = 0; i < ll(n); i++)
#define rep2(i, n) for(ll i = 1; i <= ll(n); i++)
//#define rep(i, k, n) for(ll i = k-1; i < ll(n); i++)
//#define rep2(i, k, n) for(ll i = k; i <= ll(n); i++)
#define all(v) (v).begin(), (v).end()
bool chmin(ll &a, ll b) {if(b < a) {a = b; return 1;} return 0;}
bool chmax(ll &a, ll b) {if(b > a) {a = b; return 1;} return 0;}
const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;
//const ll MOD = 998244353;
const ll MAX = 1e9;
const char newl = '\n';

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  
  vl a(6);
  rep(i, 6) cin >> a[i];
  cout << (a[4]-a[0]<=a[5] ? "Yay!" : ":(") << newl;
  return 0;
}


Measured memory_bytes: 3612
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(), a.end()
#define rrng(a) a.rbegin(), a.rend()
#define maxs(x, y) (x = max(x, y))
#define mins(x, y) (x = min(x, y))
#define limit(x, l, r) max(l, min(x, r))
#define lims(x, l, r) (x = max(l, min(x, r)))
#define isin(x, l, r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)), x.end())
#define show(x) cout << #x << " = " << x << endl;
#define PQ(T) priority_queue<T, v(T), greater<T>>
#define bn(x) ((1 << x) - 1)
#define dup(x, y) (((x) + (y)-1) / (y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<T> vt;

int main() {
  int n,m;
  cin>>n>>m;
  vl A(n);
  rep(i,n)cin>>A[i];
  map<ll,int> mp;
  priority_queue<ll> q;
  rep(i,m){
    int b;ll c;
    cin>>b>>c;
    mp[c]+=b;
  }
  for(auto it : mp){
    q.push(it.fi);
  }
  sort(rng(A));
  rep(i,n){
    if(q.empty())break;
    ll x = q.top();
    if(A[i] < x){
      A[i] = x;
      mp[x]--;
      if(mp[x] <= 0)q.pop();
    }
  }
  ll ans = 0;
  rep(i,n)ans+=A[i];
  cout<<ans<<endl;
  return 0;
}

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

int main(){
    int N;
    cin >> N;
    int x[N];

    rep(i,N){
        cin >> x[i];
    }

    int counter = 0;
    while(true){
        bool dividable = true;
        rep(i,N){
            if (x[i] % 2 == 0){
                x[i] /= 2;
            } else {
                dividable = false;
            }
        }
        if (!dividable){
            break;
        }
        counter++;
    }
    cout << counter << endl;
}

Measured memory_bytes: 256
d,g=map(int,input().split())
ans=10000
p=[]
c=[]
for i in range(d):
    a,b=map(int,input().split())
    p.append(a)
    c.append(b)
for i in range(2**d):
    x=0
    cou=0
    l=[]
    for j in range(d):
        if ((i>>j)&1):
            x+=c[j]+p[j]*(j+1)*100
            cou+=p[j]
        else:
            l.append(j)
    l.sort(reverse=True)
    k=0
    while x<g:
        for _ in range(p[l[k]]):
            if x>=g:
                break
            cou+=1
            x+=(100*(l[k]+1))
        k+=1
        if k>=len(l):
            break
    ans=min(ans,cou)
print(ans)


Measured memory_bytes: 41328
L=input().split(' ')

X = int(L[0])
Y = int(L[1])

if X < Y:
    tmp = Y
    Y = X
    X = tmp

M = X*Y

R = X%Y
while(R!=0):
    X=Y
    Y=R
    R=X%Y
    
print(int(M/Y))

Measured memory_bytes: 3064
N, X, Y = list(map(int, input().split()))

# N = 2000
# X = 100
# Y = 1900


X -= 1
Y -= 1

# @profile


def main(N, X, Y):
    ans = [0]*N
    for i in range(N):
        for j in range(i+1, N):
            d = min(j-i, abs(X-i)+abs(Y-j)+1)
            ans[d] += 1

    for a in ans[1:]:
        print(a)


main(N, X, Y)


Measured memory_bytes: 3444
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))

def temperature(x):
    return t - x * 0.006

ans = 0
for i in range(1, n):
    if abs(a - temperature(h[ans])) > abs(a - temperature(h[i])):
        ans = i
print(ans + 1)


Measured memory_bytes: 3444
#include <bits/stdc++.h>
        using namespace std;
   #define int long long
   #define PP pair<int,pair<int,int>>
const int MAX = 510000;
const int MOD =  1000000007;


     signed main(){
   int n,e,t;
   cin>>n>>e>>t;
   int x[n+1],ans[n+1];
   for(int i=1;i<=n;i++)cin>>x[i];
   ans[0]=e;int j=1,ansx=MOD*MOD;bool used[n+1]={};
   priority_queue<pair<int,int>,vector<pair<int,int>>,greater<pair<int,int>>>que;
   for(int i=1;i<=n;i++){
     que.push(make_pair(2*x[i]+t,i));
     while(que.top().first<=2*x[i]){
       ansx=min(ans[que.top().second -1]-2*x[que.top().second],ansx);
       used[que.top().second]=true;
       que.pop();
     }
     while(used[j])j++;
     ans[i]=min(ans[j-1]+t,ansx+2*x[i]);
  
   }

   cout<<ans[n]<<endl;
   
                  
}


        


Measured memory_bytes: 2676
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pb push_back
#define x first
#define y second
#define pii pair<int, int>
#define p3i pair<pii, int>
#define pll pair<ll, ll>
#define p3l pair<pll, ll>
#define lseg L, (L+R)/2, N*2+1
#define rseg (L+R)/2+1, R, N*2+2
#define ub upper_bound
#define lb lower_bound
#define pq priority_queue
#define MN 1000000007
#define fox(k, x) for (int k=0; k<x; ++k)
#define fox1(k, x) for (int k=1; k<=x; ++k)
#define foxr(k, x) for (int k=x-1; k>=0; --k)
#define fox1r(k, x) for (int k=x; k>0; --k)
#define ms multiset
#define flood(x) memset(x, 0x3f3f3f3f, sizeof x)
#define drain(x) memset(x, 0, sizeof x)
#define rng() (rand() >> 3)*rand()
#define scan(X) do{while((X=getchar())<'0'); for(X-='0'; '0'<=(_=getchar()); X=(X<<3)+(X<<1)+_-'0');}while(0)
char _;
#define pi 3.14159265358979323846

int n, a, b, dp[100005];
bool mark[100005], mark2[100005];
vector<int> v[100005];
void dfs(int N, int P){
    bool spec=1;
    fox(l, v[N].size()){
        if (v[N][l]==P) continue;
        dfs(v[N][l], N);
        dp[N]+=dp[v[N][l]];
        if (P==-1)
            mark2[N]|=mark2[v[N][l]];
        if (mark[v[N][l]]){
            mark[N]=1;
        } else if (spec){
            spec=0;
        } else {
            if (P==-1)mark2[N]=1;
            mark[N]=1; dp[N]++;
        }
    }
    if (v[N].size()>1)
        mark2[N]|=spec;
    //cout <<N << ' ' << mark2[N] << ' ' << dp[N]<< endl;
}
int main(){
    scanf("%i", &n);
    fox(l, n-1){
        scanf("%i%i", &a, &b);
        v[a].pb(b);
        v[b].pb(a);
    }
    fox(l, n){
        if (v[l].size()>1){
            dfs(l, -1);
            cout << dp[l]+!mark2[l];
            return 0;
        }
    }
    cout << 1;
    return 0;
}
/*
9
0 1
0 2
2 3
2 4
4 5
2 6
6 7
6 8
*/


Measured memory_bytes: 13952
#include <bits/stdc++.h>
#define REP(i, a, n) for (long long i = (a); i < (long long)(n); ++i)
#define REPC(i, a, n) for (long long i = (a); i <= (long long)(n); ++i)
#define ALL(t) t.begin(), t.end()
#define RALL(t) t.rbegin(), t.rend()
#define MATINIT(type, row, col, init) \
  vector<vector<type>>(row, vector<type>(col, init));
#define Yes(cond) cout << (cond ? "Yes" : "No") << endl;
#define YES(cond) cout << (cond ? "YES" : "NO") << endl;
using namespace std;
using LL = long long;
using ULL = unsigned long long;
template <class T>
using VEC = std::vector<T>;
template <class T>
using MAT = std::vector<std::vector<T>>;
void DUMP() { cerr << endl; }
template <class Head, class... Tail>
void DUMP(Head &&head, Tail &&... tail) {
  cerr << head << ", ";
  DUMP(std::move(tail)...);
}
template <typename T>
ostream &operator<<(ostream &os, vector<T> &vec) {
  os << "{";
  for (auto v : vec) os << v << ",";
  os << "}";
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, set<T> &s) {
  os << "{";
  for (auto p : s) os << p << ",";
  os << "}";
  return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, map<T1, T2> &m) {
  os << "{";
  for (auto p : m) os << p << ",";
  os << "}";
  return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, pair<T1, T2> p) {
  os << "[" << p.first << " " << p.second << "]";
  return os;
}

int main() {
  string S;
  cin >> S;
  int Q;
  cin >> Q;
  bool rev = 0;
  string fr = "", rear = "";
  REP(i, 0, Q) {
    int T;
    cin >> T;
    if (T == 1) {
      rev = !rev;
      swap(fr, rear);

    } else {
      int F;
      char C;
      cin >> F >> C;
      if (F == 1) {
        fr.push_back(C);
      } else {
        rear.push_back(C);
      }
    }
  }

  reverse(ALL(fr));
  if (!rev) {
  } else {
    reverse(ALL(S));
  }
  cout << fr << S << rear << endl;

  return 0;
}


Measured memory_bytes: 1088
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define sz(x) int(x.size())
#define pb push_back
#define eb emplace_back
using ll=long long;
using P = pair<int,int>;
#define chmax(x,y) x = max(x,y)
#define chmin(x,y) x = min(x,y)
const ll MOD=1000000007;
const ll mod=1000000007;

struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }
 
  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

//二項係数
const int MAX = 110000;
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[n - k] % MOD) % MOD;
}

vector<vector<int>> to;
mint ans=1;
int N,K;

void dfs(int v,int p=-1){
    if(to[v].size()>=K){ans=0;}
    int s=to[v].size();
        if(p==-1){
            ans*=COM(K-1,s);
        }
        else{
            s--;
            ans*=COM(K-2,s);
        }
    for(int u:to[v]){
        if(u==p)continue;
        
        dfs(u,v);
    }
    return;
}

int main() {
    
    cin>>N>>K;
    to.resize(N,vector<int>(0));
    rep(i,N-1){
        int a,b;
        cin>>a>>b;
        --a;--b;
        to[a].pb(b);
        to[b].pb(a);
    }
    COMinit();
    ans*=K;
    dfs(0);
    cout<<ans<<endl;

    //cout<<COM(3,3)<<endl;
}

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

using namespace std;

int main()
{
    char s[16];
    
    scanf("%s", s);
    
    int ct = 0, len = strlen(s);
    
    for (int i = 0; i <= (len - 1) / 2; i++){
        if (isalpha(s[i]) && s[i] == s[len - i - 1]) continue;
        if (s[i] == '(' && s[len - i - 1] == ')') continue;
        if (s[i] == ')' && s[len - i - 1] == '(') continue;
        ct++;
    }
    
    printf("%d\n", ct);
    
    return (0);
}

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

using namespace std;

typedef long long ll;
const ll INF = 1LL<<60;

ll gcd(ll a, ll b) {
  if(b == 0) return a;
  return gcd(b, a % b);
}

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


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

    int N;
    cin >> N;

    vector<ll> X(N), X_sorted(N);

    int tmp;
    for(int i = 0; i < N; i++){
        cin >> X[i];
        X_sorted[i] = X[i];
    }

    sort(X_sorted.begin(), X_sorted.end());

    vector<ll> ord(N);
    iota(ord.begin(), ord.end(), 0);

    sort(ord.begin(), ord.end(), [&](ll x, ll y){
        return X[x] < X[y];
    });

    vector<ll> ord_2(N);
    iota(ord_2.begin(), ord_2.end(), 0);

    sort(ord_2.begin(), ord_2.end(), [&](ll x, ll y){
        return ord[x] < ord[y];
    });

    // for(int i = 0; i < N; i++){
    //     cout << ord_2[i] << endl;
    // }

    for(int i = 0; i < N; i++){
        if(ord_2[i] <= N/2-1){
            cout << X_sorted[N/2] << endl;
        }else{
            cout << X_sorted[N/2-1] << endl;
        }
    }


    return 0;
}


Measured memory_bytes: 8448
import math
a,b = [int(i) for i in input().split()]
mina = math.ceil(a*100/8)
if (a+1)*100/8%1==0:
    maxa = (a+1)*100/8-1
else:
    maxa = math.floor((a+1)*100/8)

minb = math.ceil(b*100/10)
if (b+1)*100/10%1==0:
    maxb = (b+1)*100/10-1
else:
    maxb = math.floor((b+1)*100/10)

#print(mina,maxa,minb,maxb)

if minb<=mina and mina<=maxb:
    print(int(mina))
elif mina<=minb and minb<=maxa:
    print(int(minb))
else:
    print("-1")


Measured memory_bytes: 3064
#include<stdio.h>
int main() {
	int x,h,m,s;
	scanf("%d", &x);
	h = x / 3600;
	x %= 3600;
	m = x / 60;
	s = x % 60;
	printf("%d:%d:%d\n", h, m, s);
	return 0;
}


Measured memory_bytes: 2736
package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)

	a := make([]int, n)

	for i := 0; i < n; i++ {
		var tmp int
		// fmt.Scanf関数
		// &をつけて、変数からポインタを抽出した状態で使う
		// 第一引数の方には、%dや%sのように、型を指定
		fmt.Scanf("%d", &tmp)
		if tmp%2 == 0 {
			a = append(a, tmp)
		}
		//fmt.Scan(&a[i])
	}

	ans := "APPROVED"
	for _, m := range a {
		if m%3 != 0 && m%5 != 0 {
			ans = "DENIED"
			break
		}
	}

	fmt.Println(ans)

}


Measured memory_bytes: 512
// lcmとかはg++ -std=c++17 default.cppみたいなかんじで
//vector<vector<ll>> piyo(tate,vector<ll> (yoko));

#include <bits/stdc++.h>
#define mod 1000000007
#define INF 100000001
#define ll long long
#define ln cout<<endl;
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define double long double
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
using namespace std;
int dp[120][1050];

int main() {
    cin.tie(0);
   	ios::sync_with_stdio(false);
    //double mini=INF;
    int maxi=0,f=0,sum=0,mini=INF;
    string str,str1,str2;
    int i;
    int n;
    int a,b,d,c;
    int e,weight;
    ll h,w;
    cin>>str1>>str2;
    if(str1.length()>str2.length()){
        cout<<str1[0];
        rep(i,str2.length()){
            cout<<str2[i]<<str1[i+1];
        }
    }
    else {rep(i,str1.length()){
        cout<<str1[i]<<str2[i];
    }}
ln;
    return 0;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 31 09:15:46 2020

@author: black
"""
def check(x):
    div = [1]
    for j in range(1, x):
        if (x)%(j+1) == 0:
            div.extend([j+1])
    return len(div)




N = int(input())
ans = []

for x in range(1, N+1):
    if x%2 == 1:
        if check(x) == 8:
            ans.extend([x])


print(len(ans))

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

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

    vector<int> a(n);
    for(int i=0; i<n; i++){
        cin>>a[i];
    }

    int count=1,value=0;
    vector<int> note={0};

    while(a[value]!=2){
        value=a[value]-1;
        count++;
        if(count>n){
            count=-1;
            break;
        }
    }

    cout<<count<<endl;
}


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

using namespace std;

#define fastio cin.tie(NULL); cout.tie(NULL); ios_base::sync_with_stdio(0)
typedef long long ll;
//#define int ll
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vector<int>> matrix;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define all(c) c.begin(),c.end()
#define mp make_pair
#define pb push_back
#define f first
#define tcase int t; cin>> t; for( ; t; --t)
#define s second
#define endl '\n'
const int MAX = 1e6+1;
const int INF = 0x3f3f3f3f;
const double PI = acos(-1);
const double DEG = 180/PI;
const int MOD = 1e9+7;
int mod(int x, int m){ if(x >= 0) return x % m; if(-x < m) return m-(-x); return mod(x%m, m);}
int gcd (int a, int b) {while(b){a = mod(a, b); swap(a, b);} return a;}
int lcm (int a, int b) {return a / gcd(a, b) * b;}
int fexp(int base, int exp, int m){
	int total = 1;
	while(exp > 0){
		if(exp % 2 == 1){
			total = mod(((mod(total, m)) * (mod(base, m))), m);
			exp--;
		}
		base= mod((mod(base, m) * mod(base, m)), m);
		exp /= 2;
	}
	return mod(total, m);
}

int n;

int32_t main(){
	fastio;
	int k, q;
	cin>> n>> k>>q;
	vi a(n+1, 0);
	for(int i = 1; i<=q; ++i){
		int x;
		cin>> x;
		a[x]++;
	}

	for(int i = 1; i<=n; ++i) cout<< (q - a[i]+1 <= k?"Yes\n" : "No\n");
	return 0;
}

Measured memory_bytes: 1024
package main

import (
	"fmt"
	"math"
)

func main() {
	var N int
	fmt.Scan(&N)
	a := make([]int, N)
	for i := 0; i < N; i++ {
		fmt.Scan(&a[i])
	}
	xor := 0
	for i := 0; i < N; i++ {
		xor ^= a[i]
	}
	// log.Println(xor)
	if xor == 0 {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

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

func pow(a, b int) int {
	return int(math.Pow(float64(a), float64(b)))
}

func lcm(a, b int) int {
	return a * b / gcd(a, b)
}
func gcd(a, b int) int {
	if a < b {
		a, b = b, a
	}
	for b != 0 {
		a, b = b, a%b
	}
	return a
}
func max(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r < a[i] {
			r = a[i]
		}
	}
	return r
}
func min(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r > a[i] {
			r = a[i]
		}
	}
	return r
}
func sum(a []int) (r int) {
	for i := range a {
		r += a[i]
	}
	return r
}
func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

type Pair struct {
	a, b int
}

type pairs []Pair

func (p pairs) Len() int {
	return len(p)
}
func (p pairs) Swap(i, j int) {
	p[i], p[j] = p[j], p[i]
}

func (p pairs) Less(i, j int) bool {
	if p[i].a == p[j].a {
		return p[i].b < p[j].b
	}
	return p[i].a < p[j].a
}


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

struct node{
  unsigned int key;
  struct node *next;
  struct node *prev;
};

typedef struct node * NodePointer;

NodePointer nil;

NodePointer listSearch(int key){
  NodePointer n;
  for(n=nil;n->next != nil; n=n->next){
    if(n->next->key==key) return n;
  }
  return NULL;
}

void init(){
  nil = malloc(sizeof(struct node));
  nil->next = nil;
  nil->prev = nil;
}

void printList(){
  NodePointer cur = nil->next;
  int isf = 1;
  while(1){
    if ( cur == nil ) break;
    if ( isf == 0)  printf(" ");
    printf("%d", cur->key);
    cur = cur->next;
    isf = 0;
  }
  printf("\n");
}

void deleteNode(NodePointer t){
  if(t==nil->next){
    nil->next=t->next;
    t->next->prev=nil;
  }else if(t==nil->prev){
    nil->prev=t->prev;
    t->prev->next=nil;
  }
  free(t);
}

void deleteFirst(){
  NodePointer t = nil->next;
  if ( t == nil ) return;
  deleteNode(t);
}

void deleteLast(){
  NodePointer t = nil->prev;
  if ( t == nil ) return;
  deleteNode(t);
}

void delete(int key){
  NodePointer n,delnode;
  if((n=listSearch(key))!=NULL){
    delnode=n->next;
    n->next=delnode->next;
    delnode->next->prev=n;
    free(delnode);
  }else return;
}


void insert(int key){
  NodePointer x;
  x = malloc(sizeof(struct node));
  x->key=key;
  x->next=nil->next;
  x->prev=nil;
  nil->next->prev=x;
  nil->next=x;
}

int main(){
  int n, i,key,j;
  char k[10];
  int size = 0;
  char com[20];
  int np = 0, nd = 0;
  scanf("%d", &n);
  init();
  for ( i = 0; i < n; i++ ){
    scanf("%s", com);
    if ( com[0] == 'i' ) {
      scanf("%s",k);
      key=k[0]-'0';
      for(j=1;k[j]!=0;j++){
        key=key*10;
        key+=k[j]-'0';
      }
      insert(key);
      np++;
      size++;
    }
    else if ( com[0] == 'd' ) {
      if (strlen(com) > 6){
        if ( com[6] == 'F' ) deleteFirst();
        else if ( com[6] == 'L' ) deleteLast();
      } else {
        scanf("%s",k);
        key=k[0]-'0';
        for(j=1;k[j]!=0;j++){
          key=key*10;
          key+=k[j]-'0';
        }
        delete(key);
        nd++; 
      }
      size--;
    }
  }
  
  printList();
  return 0;
}



Measured memory_bytes: 33104