akhauriyash/Code-Regression huggingface dataset:
//Twitter@KonoLv1 2020年春卒で現在就職活動中！
 
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
 
int main(void){
    int i,j;            //  ループ文に使用
    int x,y,z,n,k,q;
    int count1,count2,count;   //  カウント用に使用
    int box[100001] = {};
    char s[200001] = {};        //  文字列
    char s2[200001] = {};        //  文字列
    int a,b,c;
    a = b = c = i = 0;
    int mode = 0;
    count = count1 = count2 = 0;
 
    //  入力処理
    
    scanf("%d %d %d",&n,&k,&q);
    for (i = 0; i < q; i++){
        scanf("%d",&x);
        box[x - 1] = box[x - 1] + 1;
    }
 
    //  計算処理
    count1 = k - q;

 //  出力処理

    for (i = 0; i < n; i++){
        box[i] = box[i] + count1;
        if (box[i] > 0){
            printf("Yes\n");
        }else{
            printf("No\n");
        }
    }

}

Measured memory_bytes: 896
#include "bits/stdc++.h"
using namespace std;
#define int long long
#define double long double
#define low lower_bound
#define upp upper_bound
#define rep(i,n) for (int i = 0; i < (int)(n); ++i)
#define Rep(i,n) for (int i = (int)(n); i >= 0; i--)
#define all(vec) vec.begin(), vec.end()
#define rever(vec) reverse(all(vec));
#define cend printf("\n");
#define prique(T) priority_queue<T, vector<T>, greater<T>>
#define prique2(T) priority_queue<T>
struct edge { int to, cost; };
using P = pair<int, int>;
using PP = pair<P, int>;
const int mod2 = 998244353;
const int mod = (int)1e9 + 7, inf = (int)1e16;

int modpow(int x, int n) {
	int ans = 1;
	while (n > 0) {
		if (n & 1) {
			ans *= x;
			if (mod <= ans) ans %= mod;
		}
		x *= x;
		if (mod <= x) x %= mod;
		n >>= 1;
	}
	return ans;
}

int fact[1000000];
void f_init(int n) {
	if (1000000 <= n) return;
	fact[0] = fact[1] = 1;
	for (int i = 2; i <= n; ++i) {
		fact[i] *= fact[i - 1];
		if (mod <= fact[i]) fact[i] %= mod;
	}
	return;
}

int comb(int n, int r) {
	if (n < r) return 0;
	int ans = fact[n] * modpow(fact[n - r], mod - 2) % mod * modpow(fact[r], mod - 2);
	if (ans < 0) return ans + mod;
	return ans;
}

int perm(int n, int r) {
	if (n < r) return 0;
	if (n - r < r) r = n - r;
	int ans= fact[n] * modpow(fact[n - r], mod - 2) % mod;
	if (ans < 0) return ans + mod;
	return ans;
}

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

int lcm(int a, int b) {
	return a * b / gcd(a, b);
}

bool pri(int p) {
	for (int i = 2; i * i <= p; ++i) if (p % i == 0) return false;
	return p > 1;
}

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

P operator+(const P& a, const P& b) {
	return P(a.first + b.first, a.second + b.second);
}
P operator-(const P& a, const P& b) {
	return P(a.first - b.first, a.second - b.second);
}


signed main() {
	int a, b;
	cin >> a >> b;
	int cnt = 1;
	a--;
	b--;
	if (b % a != 0) {
		cout << b / a + 1 << endl;
		return 0;
	}
	cout << b / a << endl;
}

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

int main() {
    
    ios::sync_with_stdio(0);
    cin.tie(NULL), cout.tie(NULL);
    
    string S;
    cin >> S;
    
    int ptr = 0;
    long long ans = 0;
    
    for(int i=0; i<S.size(); i++)
    {
        if(S[i] == 'W')
        {
            ans += (i - ptr);
            ptr++;
        }
    }
    
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 720
#include <bits/stdc++.h>
using namespace std;
#define ull unsigned long long
#define MOD (int)(1e9+7)
#define ceil(x, y) (x%y==0? (x/y) : (x/y+1))
#define FOR(i, N) for(int i = 0; i < N; ++i)
#define FOR1(i, N) for(int i = 1; i <= N; ++i)
#define vi vector <int>
#define pii pair <int, int>
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define mset(a, v) memset(a, v, sizeof(a))
#define all(v) (v).begin(), (v).end()
#define INF 2e9
#define EPS 1e-9
#define MAX 200009
#define int long long
/*#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
typedef cc_hash_table<int, int, hash<int>> ht; // while using, comment #define int long long  */

void __print(int 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 dbg(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define dbg(x...)
#endif
using namespace std;
bool tri(int a, int b, int c){
    if(a+b>c and b+c>a and c+a>b) return true;
    else return false;
}
int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #ifndef ONLINE_JUDGE
    	freopen("in.txt", "r", stdin);
    	freopen("out.txt", "w", stdout);
    #endif
    int T=1;
    // cin >> T;
    FOR1(tt, T){
    	// cout << "Case #" << tt << ": ";
        int n; cin >> n;
        int l[n+1];
        int ans = 0;
        FOR1(i, n) cin >> l[i];
        for(int i = 1; i <= n; i++){
            for(int j = i+1; j <= n; j++){
                for(int k = j+1; k <= n; k++){
                    if(l[i] != l[j] and l[j] != l[k] and l[k] != l[i] and tri(l[i], l[j], l[k])) ans++;
                }
            }
        }
        cout << ans;
    	cout << '\n';
    }
	return 0;
}


Measured memory_bytes: 3652
#include <iostream> 
#include <cstdio>
#include <sstream>

int main() {
  int a,b;
  while(scanf("%d %d", &a, &b) != EOF) {
    std::stringstream ss;
    ss << a+b;
    std::cout << ss.str().length() << std::endl;
  }
}

Measured memory_bytes: 3252
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>

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

using namespace std;

int main()
{
	int dp[100];
	dp[0] = 1;
	dp[1] = 2;
	dp[2] = 4;
	
	REP(i,3,30)
	{
		dp[i] = dp[i-1] + dp[i-2] + dp[i-3];
	}

	int n;
	while(cin >> n && n)
	{
		cout << (dp[n-1]/10/365) + 1 << endl;
	}

	return 0;
}

Measured memory_bytes: 1160
#include<iostream>
#include<algorithm>
#include<queue>
#include<vector>

using namespace std;

int n, m;
int x[200010];
vector<int>V, T;
int answer = 0;

int main(){
  cin >> n >> m;
  for(int i = 0; i < m; ++i){
    cin >> x[i];
    V.push_back(x[i]);
  }
  sort(V.begin(), V.end());
  for(int i = 0; i < m - 1; ++i){
    T.push_back(V[i + 1] - V[i]);
  }
  sort(T.begin(), T.end());
  for(int i = 0; i < m - 1 - (n - 1); ++i){
    //cout << T[i] << endl;
    answer += T[i];
  }
  
  cout << answer << endl;
}

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


int main() {
    int A, B, T;
    cin >> A >> B >> T;

    int cnt = T/A;
    int res = 0;
    for(int i=0; i<cnt; i++) {
        res += B;
    }
    cout << res << endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int inf = 1e9 + 7;
using pii = pair<int, int>;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rrep(i, st, n) for (int i = st; i < n; ++i)
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
int dx[] = {0, 0, -1, 1};
int dy[] = {1, -1, 0, 0};
const int mod = 1e6 + 3;
ll power(ll a,ll b){return b?power(a*a%mod,b/2)*(b%2?a:1)%mod:1;}

ll table[mod];
int main() {
    table[0] = 1;
    rrep(i, 1, mod) {table[i] = table[i - 1] * i % mod;}
    int q; cin >> q;
    while (q--) {
        ll x, d, n; cin >> x >> d >> n;
        //power(0, mod - 2) = 0
        if (d == 0) {cout << power(x, n) % mod << endl; continue;}
        x = x * power(d, mod - 2) % mod;
        if (x + n - 1 >= mod) {cout << 0 << endl; continue;}
        cout << table[x + n - 1] * power(table[x - 1], mod - 2) % mod * power(d, n) % mod << endl;
    }
}


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

#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 SORT(v, n) sort(v, v+n)
#define pb(a) push_back(a)
#define vi vector<int>
#define ddvi vector<vector<int>>

using namespace std;
typedef long long ll;
typedef pair<int, int> P;

#define rad_to_deg(rad) (((rad)/2/acos(-1))*360)

int main(){
cin.tie(0);
ios::sync_with_stdio(false);
// ここに処理を記述

	long double a, b, c;
	cin >> a >> b >> c;

	long double ans;
	long double up = 2*c/(a*a) - b;
	// cout << up << "\n";
	if(up<0){
		up = 2*c/(a*b);
		long double tan = up/b;
		ans = atan(tan);
		ans = rad_to_deg(ans);
		ans = 90.0 - ans;
	}
	else{
		long double tan = (b - up)/a;
		ans = atan(tan);
		ans = rad_to_deg(ans);
	}
	cout << setprecision(10);
	cout << ans << "\n";

return 0;
}

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

int dp[3005][3005];

int main() {
  int n, t;
  cin >> n >> t;
  vector<P> p(n);
  rep(i,n) {
    cin >> p[i].first >> p[i].second;
  }
  sort(p.begin(), p.end());
  int ans = 0;
  rep(i,n) {
    rep(j,t) {
      chmax(dp[i+1][j], dp[i][j]);
      int nj = j+p[i].first;
      if (nj < t) chmax(dp[i+1][nj], dp[i][j]+p[i].second);
    }
    int now = dp[i][t-1]+p[i].second;
    chmax(ans, now);
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 35456
#include<bits/stdc++.h>
#define endl '\n'
#define fo(i,n)        for(int i=0; i<n; i++)
#define foa(i,k,n)     for(int i=k; i<=n; i++)
#define fod(i,k,n)     for(int i=n; i>=k; i--)
#define clr(arr)       memset(arr, 0, sizeof arr)
#define hi(x)          cout<<" -> "<<#x<<" : "<<x<<endl;
using namespace std;
const int mod = 1e9 + 7;


void solve()
{
// #define T
	int cnt=0;
	string s,t;
	cin>>s>>t;
	for(int i=0; i<(int) s.size(); i++)
		if(s[i]!=t[i])
			cnt++;
	cout<<cnt;
	
}

int32_t main()
{
///////////////////////////////////////////////////////
#ifdef FIN
	freopen("in.txt", "r", stdin);
#endif
	ios_base::sync_with_stdio(false); cin.tie(nullptr);
///////////////////////////////////////////////////////

	int t = 1;
#ifdef T
	cin >> t;
#endif
	while (t--)
		solve();
	return 0;
}

Measured memory_bytes: 3800
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
#include <cstdlib>

using namespace std;

int main(){
  int a,b,c,d;
  cin >> a >> b >> c >> d;
  if(abs(a-c)<=d)  cout << "Yes" << endl;
  else if(abs(a-b)<=d && abs(c-b)<=d) cout << "Yes" << endl;
  else  cout << "No" << endl;
  
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <map>
#include <cmath>
#include <queue>
#include <utility>
#include <functional>
#include <deque>
#include <cctype>
#include <stack>
#include <bitset>

using ll = long long;
using namespace std;
typedef unsigned long long ull;
typedef pair<ll, ll>P;
const ll mod = 1000000007;
const ll INF = 1 << 30;
const ll INF2 = 9000000000000000000LL;
bool fl = true, flag = false;
int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };
struct edge { ll to, cost; };
string abc = "abcdefghijklmnopqrstuvwxyz";

int main() {
	ll n, K, ans = INF2;
	cin >> n >> K;
	vector<P>x(n);
	vector<ll>vx(n), vy(n);
	for (int i = 0;i < n;i++) {
		ll X, Y;
		cin >> X >> Y;
		x[i] = P(X, Y);
		vx[i] = X;
		vy[i] = Y;
	}
	sort(vx.begin(), vx.end());
	sort(vy.begin(), vy.end());
	for (int i = 0;i < n-1;i++)
		for (int j = i + 1;j < n;j++)
			for (int k = 0;k < n-1;k++)
				for (int l = k + 1;l < n;l++) {
					ll xmax = vx[j];
					ll xmin = vx[i];
					ll ymax = vy[l];
					ll ymin = vy[k];
					int count = 0;
					for (int m = 0;m < n;m++) {
						if (xmin <= x[m].first&&x[m].first <= xmax&&ymin <= x[m].second&&x[m].second <= ymax)count++;
					}
					if (count >= K)ans = min(ans, (ymax - ymin)*(xmax - xmin));
				}
	cout << ans << endl;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(){
  int a,b;
  char op;

  scanf("%d %c %d",&a,&op,&b);


  if(op == '+'){
    printf("%d\n",a+b);
  }
  if(op == '-'){
    printf("%d\n",a-b);
  }

  return 0;
}


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

int main(){   
    int T;
    cin >> T;
    while(T--){
        int N;
        vector<i64> A;
        string S;

        cin >> N;
        A.resize(N); 
        rep(i, N) cin >> A[i]; 
        cin >> S;

        reverse(A.begin(), A.end());
        reverse(S.begin(), S.end());

        vector<i64> st(1, 0);
        st.reserve(100000);
    
        rep(i, N){
            if(st.size() == 0) break;
            
            i64 x = A[i];
            for(const i64& v : st){
                x = min(x, x ^ v);
            }

            if(x != 0){
                if(S[i] == '1') st.clear();
                else st.emplace_back(x);
            } 
        }

        if(st.size() == 0) cout << 1 << endl;
        else cout << 0 << endl;
    }                                                                                                                                                                                                                                                                                                       
}


Measured memory_bytes: 3564
/*****************
 *   I<3   C++   *
 *  IWANT ANYAC  *
 * ILOVEPROGRAM! *
 *IT'SINTERESTING*
 * ILOVEPROGRAM! *
 *  INCONTESTS   *
 *   GETSCORE    *
 *    ACCODE     *
 *     LETS      *
 *      GO       *
 *****************/
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define LL long long
#define pb push_back
#define pob pop_back
#define mp make_pair
#define FILL(a,v) memset((void*)a,v,sizeof(a))
#define FILL0(a) FILL(a,0)
#define FILL1(a) FILL(a,-1)
#define ALL(a) (a).begin(),(a).end()
#define Inf 1e9
#define Mod 1000000007
#define foreach(it,x) for(typeof(x.begin()) it=x.begin();it!=x.end();it++)
#define FOR(i,x) for(int i=0;i<x;i++)
#define RFOR(i,x) for(int i=x-1;i>=0;i--)
#define FFOR(i,a,b) for(int i=a;i<b;i++)
#define FRFOR(i,a,b) for(int i=a-1;i>=b;i--)
#define SZ(a) ((int)(a).size())
#define FI first
#define SE second
#define OVER(a) return puts(a),0
#define fastio ios::sync_with_stdio(0)
#define filei(f) freopen(f,"r",stdin)
#define fileo(f) freopen(f,"w",stdout)
#define MASK(a) (1<<(a))
#define MASKX(x,a) ((x)<<(a))
#define BIT(a,b) ((a>>b)&1)
using namespace std;
typedef pair<int,int> pii;
typedef unsigned long long UINT;
typedef unsigned int Uint;
typedef long long INT;
typedef pair<INT,INT> PII;
typedef stringstream sst;
typedef istringstream iss;
typedef vector<int> vint;
typedef vector<INT> VINT;
typedef vector<pii> vpii;
typedef vector<PII> VPII;
typedef priority_queue<int> pqi;
typedef priority_queue<INT> PQI;
typedef priority_queue<pii> pqp;
typedef priority_queue<PII> PQP;
typedef priority_queue<int,vint,greater<int> > xqi;
typedef priority_queue<INT,VINT,greater<INT> > XQI;
typedef priority_queue<pii,vpii,greater<pii> > xqp;
typedef priority_queue<PII,VPII,greater<PII> > XQP;

int n,fromst;
vector<int> nei[100007];
stack<int> jian;
int dis[100007],cnt[100007];

int dfs(int la,int a)
{
	int cn=1;
	jian.push(a);
	if(a==n-1)
	{
		stack<int> haojian=jian;
		while(SZ(haojian)>(SZ(jian)+3)/2)
			haojian.pop();
		fromst=haojian.top();
	}
	for(int i=0;i<SZ(nei[a]);i++)
		if(nei[a][i]!=la)
			cn+=dfs(a,nei[a][i]),dis[nei[a][i]]=dis[a]+1;
	jian.pop();
	cnt[a]=cn;
	return cn;
}

int a,b;

int main()
{
	scanf("%d",&n);
	for(int i=0;i<n-1;i++)
	{
		scanf("%d%d",&a,&b);
		nei[a-1].push_back(b-1);
		nei[b-1].push_back(a-1);
	}
	dfs(-1,0);
	string mark;
	if(cnt[fromst]>=(n+1)/2)mark="Snuke";
	else mark="Fennec";
	cout<<mark<<endl;
	return 0;
}

Measured memory_bytes: 24164
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define dup(x,y) (((x)+(y)-1)/(y))
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
typedef pair<int, int> pii;
const double EPS = 1e-10;
const int INF = 1e9;
const ll LINF = 1e15;
const int MOD = 1000000007;
const double PI = acos(-1);
int dx[4] = {0,1,0,-1};
int dy[4] = {1,0,-1,0};

int main() {
	int n;
	cin >> n;
	vector<int> v(n);
	rep(i,n) cin >> v[i];
	rep(i,n) {
		if (v[i] % 2 != 0) {
			cout << "first" << endl;
			return 0;
		}
	}
	cout << "second" << endl;
}

Measured memory_bytes: 3768
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define vll vector<ll>
#define ub upper_bound
#define lb lower_bound
#define all(v) ((v).begin()),((v).end())
#define ff first
#define ss second
#define mp make_pair
#define pll pair<ll,ll> 
#define fo(i,n) for(ll i=0;i<n;i++)
#define Fo(i,s,e) for(ll i=(s);(s>e)?i>e:i<e;(s>e)?i--:i++)
ll mod1 = 1e9 + 7;
ll mod2 = 998244353;

//ll power(ll x,ll y){ll z=1;while(y>0){if(y%2)z=mul(z,x);x =mul(x,x) ;y/=2;}return z;}
ll gcd(ll a,ll b){if(a<b) return gcd(b,a);if(b==0) return a;return gcd(b,a%b);} 
ll min(ll a,ll b){if(a<b)return a;return b;}
ll max(ll a,ll b){if(a>b)return a;return b;}







int main(){
    string s;
    cin>>s;
    fo(i,3){
        if(s[i]=='7'){
            cout<<"Yes"<<endl;
            return 0;
        }
    }
    cout<<"No"<<endl;
	
	
}


Measured memory_bytes: 3624
#include<iostream>
#include<string>
#include<algorithm>
#include<iomanip>
using namespace std;
#define pi 3.141592653589793283462
int main(){
    int t;
    cin>>t;
    cout<<t/3600<<":"<<t/60%60<<":"<<t%3600%60<<endl;
    return 0;
}

Measured memory_bytes: 1164
#include<iostream>
#include<string>
#include<vector>
#include<cstdio>
#include<sstream>
#include<algorithm>
#include<cmath>
#include<map>
#include<functional>
#include<queue>
#include<stack>
#include<set>
using namespace std;
#define SZ(n)  (int)n.size()
#define dump(x) cerr<<#x<<" = "<<(x)<<endl;
#define debug(x)cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define MP make_pair
#define PB push_back
	
	char ta[130][130];
	int h,w,ny=0,nx=0,cnt=0;
	bool ok(int y,int x,int ny,int nx){if(ny+y>=0&&ny+y<=h-1&&nx+x>=0&&nx+x<=w-1)return 1;else return 0;}
	int main(){

	while(cin>>h>>w,h+w){
	cnt=0;
	ny=nx=0;
	for(int i=0;i<h;i++)for(int j=0;j<w;j++)cin>>ta[i][j];
	while(true){
		//cout<<ny<<" "<<nx<<endl;
		if(ta[ny][nx]=='.'){cout<<nx<<" "<<ny<<endl;break;}
		if(cnt>=50000){cout<<"LOOP"<<endl;;break;}
		if(ta[ny][nx]=='>')nx++;
		else if(ta[ny][nx]=='<')nx--;
		else if(ta[ny][nx]=='^')ny--;
		else if(ta[ny][nx]=='v')ny++;
		cnt++;
	}
	for(int i=0;i<130;i++)for(int j=0;j<130;j++)ta[i][j]=' ';
	}
	return 0;
} 

Measured memory_bytes: 1180
/* ALDS1_1_C */
import java.io.*;

class Main
{
  public static void main(String[] args)
  {
    try{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      int n = Integer.parseInt(br.readLine());
      int count = 0;

      for(int i = 0; i < n; i++){
        long x = Long.parseLong(br.readLine());
        if(isprime(x)) count++;
      }
      System.out.println(count);

    }catch(Exception e){
      System.out.println(e);
    }
  }

  public static boolean isprime(long x)
  {
    if(x == 2) return true;
    if(x < 2 || x % 2 == 0) return false;

    int i = 3;
    while(i <= Math.sqrt(x)){
      if(x % i == 0) return false;
      i = i + 2;
    }

    return true;
  }
}

Measured memory_bytes: 29516
#include <iostream>

using namespace std;

int main() {
    int A, B, C, X;
    cin >> A >> B >> C >> X;

    int count = 0;
    for (int Ai = 0; Ai <= A; Ai++) {
        for (int Bi = 0; Bi <= B; Bi++) {
            for (int Ci = 0; Ci <= C; Ci++) {
                if (500 * Ai + 100 * Bi + 50 * Ci == X) count++;
            }
        }
    }
    cout << count;
    return 0;
}

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

using namespace std;

typedef long long int_t;
const int_t mod = 998244353;

int_t fac[1000100], invf[1000100];

int_t C(int_t n, int_t m) {return fac[n] * invf[m] % mod * invf[n-m] % mod;}
int_t fpow(int_t a,int_t b, int_t p) {
    int_t ans = 1;
    for(;b;b>>=1, a = a * a % p) if(b & 1) ans = ans * a % p;
    return ans;
}

int main() {
    fac[0] = invf[0] = fac[1] = invf[1] = 1;
    for(int_t i=2;i<=1000000;i++) fac[i] = fac[i-1] * i % mod, invf[i] = (mod - mod / i) * invf[mod % i] % mod;
    for(int_t i=2;i<=1000000;i++) invf[i] = invf[i] * invf[i-1] % mod;
    int_t n, m, ans = 0;
    cin>>n>>m;
    for(int_t i=1;i<=min(n,m);i++) 
        (ans += C(2 * i, i) * C(n + m - 2 * i, n - i) % mod) %= mod;
    ans = ans * fpow(C(n+m, n), mod-2, mod) % mod * invf[2] % mod;
    ans = ans + max(n, m) % mod;
    cout << ans;
}

Measured memory_bytes: 16000
//Never stop chasing!-MdSourav.
#include <bits/stdc++.h>
#define ll long long int
#define ls long int
#define pb push_back
#define start ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ont int t;cin>>t;while(t--)

using namespace std;

int main()
{
	start;
    int s,w;
    cin >> s >> w;
    if(s>w)
	{
		cout << "safe";
	}
	else
	{
		cout << "unsafe";
	}


	return 0;
}


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

typedef long long ll;
typedef pair<ll, ll> P;


#define rep(i,n) for(ll (i)=0; (i)<(ll)(n); (i)++)
#define frep(i,m,n) for(ll (i)=(m); (i)<=(ll)(n); (i)++)
#define rrep(i,n) for(ll (i)=(n)-1; (i)>-1; (i)--)
#define frrep(i,m,n) for(ll (i)=(n); (i)>(ll)(m); (i)--)
#define ALL(x) (x).begin(), (x).end()

const ll INF = 100100100100100100;
const ll MOD = 1000000007;

// get abs
ll my_abs(ll a);
// a^n
ll a_n(ll a, ll n);
// get gcd
ll my_gcd(ll a, ll b);
// a^(-1) % MOD 
ll inv(ll a);
// (a+b+c)%MOD
ll madd(ll a, ll b, ll c);
// (a-b)%MOD
ll msub(ll a, ll b);
// (a*b*c)%MOD
ll mtime(ll a, ll b, ll c);


int main() {
    string x; cin >> x;
    vector<ll> s, t;
    ll n = x.size();
    
    ll tmp = 0; // 合計
    bool S = true; // Sを見ているか
    rep(i, n) {
        if(i == 0) {
            while(x[i] != 'S') i++;
        }
        if(S && x[i] == 'S') tmp++;
        else if(!S && x[i] == 'T') tmp++;
        else if(S && x[i] != 'S') {
            s.push_back(tmp);
            tmp = 1;
            S = false;
        }
        else if(!S && x[i] != 'T') {
            t.push_back(tmp);
            tmp = 1;
            S = true;
        }
    }
    if(!S) t.push_back(tmp);

    ll del = 0;
    rep(i, s.size()) {
        if(s[i] <= t[i]) del += s[i];
        else {
            del += t[i];
            if(i != s.size()-1) {
                s[i+1] += (s[i]-t[i]);
            }
        }
    }
    // rep(i, t.size()) cout << t[i] << endl;
    cout << n - 2*del << endl;
    return 0;
}

ll my_abs(ll a) {
    if(a >= 0) return a;
    else return -1 *a;
}

ll a_n(ll a, ll n) { 
    if(n == 0) return 1;
    
    ll ret = a, count = 1;
    while(count * 2 < n) {
        ret *= ret;
        count *= 2;
    }
    if(count == n) return ret;
    else return (ret * a_n(a, n-count));
}

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

ll inv(ll a) {
    return a_n(a, MOD-2);
}

ll madd(ll a, ll b, ll c) {
    ll ret = (a+b) % MOD;
    return (ret+c) % MOD;
}

ll msub(ll a, ll b) {
    if(a < b) return (a-b+MOD) % MOD;
    else return (a-b) % MOD;
}

ll mtime(ll a, ll b, ll c) {
    ll ret = (a*b) % MOD;
    return (ret*c) % MOD;
}


Measured memory_bytes: 4496
#include <iostream>
using namespace std;
int n, x;

int main()
{
  cin>>n;
  int ans = 0;
  for(int i=0;i<n;i++){
    cin>>x;
    while(x % 2 == 0){
      ans ++;
      x /= 2;
    }
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 256
# include "bits/stdc++.h"
using namespace std;
using LL = long long;
using ULL = unsigned long long;
const double PI = acos(-1);
template<class T>constexpr T INF() { return ::std::numeric_limits<T>::max(); }
template<class T>constexpr T HINF() { return INF<T>() / 2; }
template <typename T_char>T_char TL(T_char cX) { return tolower(cX); };
template <typename T_char>T_char TU(T_char cX) { return toupper(cX); };
typedef pair<LL, LL> pii;
const int vy[] = { -1, -1, -1, 0, 1, 1, 1, 0 }, vx[] = { -1, 0, 1, 1, 1, 0, -1, -1 };
const int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
int popcnt(unsigned long long n) { int cnt = 0; for (int i = 0; i < 64; i++)if ((n >> i) & 1)cnt++; return cnt; }
int d_sum(LL n) { int ret = 0; while (n > 0) { ret += n % 10; n /= 10; }return ret; }
int d_cnt(LL n) { int ret = 0; while (n > 0) { ret++; n /= 10; }return ret; }
LL gcd(LL a, LL b) { if (b == 0)return a; return gcd(b, a%b); };
LL lcm(LL a, LL b) { LL g = gcd(a, b); return a / g*b; };
# define ALL(qpqpq)           (qpqpq).begin(),(qpqpq).end()
# define UNIQUE(wpwpw)        sort(ALL((wpwpw)));(wpwpw).erase(unique(ALL((wpwpw))),(wpwpw).end())
# define LOWER(epepe)         transform(ALL((epepe)),(epepe).begin(),TL<char>)
# define UPPER(rprpr)         transform(ALL((rprpr)),(rprpr).begin(),TU<char>)
# define FOR(i,tptpt,ypypy)   for(LL i=(tptpt);i<(ypypy);i++)
# define REP(i,upupu)         FOR(i,0,upupu)
# define INIT                 std::ios::sync_with_stdio(false);std::cin.tie(0)

const LL mod = 1e9 + 7;
LL dp[101010][4];
string s;

int main(){
    INIT;
    cin >> s;
    dp[0][0] = 1;
    REP(i, (int)s.size()){
        REP(j, 4){
            if(s[i] != '?'){
                (dp[i + 1][j] += dp[i][j]) %= mod;
            }else{
                (dp[i + 1][j] += dp[i][j]*3) %= mod;
            }
        }
        if(s[i] == 'A' || s[i] == '?')(dp[i + 1][1] += dp[i][0]) %= mod;
        if(s[i] == 'B' || s[i] == '?')(dp[i + 1][2] += dp[i][1]) %= mod;
        if(s[i] == 'C' || s[i] == '?')(dp[i + 1][3] += dp[i][2]) %= mod;
    }
    cout << dp[(int)s.size()][3]%mod << endl;
}

Measured memory_bytes: 3664
#include<iostream>
#include<sstream>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<complex>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cassert>

#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define mp make_pair
#define pb push_back
#define each(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define dbg(x) cerr<<__LINE__<<": "<<#x<<" = "<<(x)<<endl

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
const int inf = (int)1e9;
const double INF = 1e12, EPS = 1e-9;

int n, x[30], y[30], r[30], c[30];
int flag[30], ans;
set<int> s;

void rec(int bit){
	ans = max(ans, n - __builtin_popcount(bit));
	if(s.count(bit)) return;
	s.insert(bit);
	rep(i, n) if((bit & 1 << i) && !(flag[i] & bit)) for(int j = i + 1; j < n; j++)
	if((bit & 1 << j) && c[i] == c[j] && !(flag[j] & bit)){
		rec(bit ^ 1 << i ^ 1 << j);
	}
}

int main(){
	while(cin >> n, n){
		rep(i, n) cin >> x[i] >> y[i] >> r[i] >> c[i];
		s.clear();
		memset(flag, 0, sizeof(flag));
		rep(j, n) rep(i, j){
			if(r[i] + r[j] - EPS > hypot(x[i] - x[j], y[i] - y[j]))
			flag[j] |= 1 << i;
		}
		ans = 0;
		rec((1 << n) - 1);
		cout << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 50364
#include <stdio.h>
#include <stdlib.h>


int main(void) {
  int  a, b, i;
  char str_a[6];
  char str_b[6];
  
  scanf("%s", str_a);
  scanf("%s", str_b);
  a = atoi(str_a);
  b = atoi(str_b);
  if(a < b) {
    for (i=0; i<b; i++) {
      printf("%d", a);
    }
  } else {
    for(i=0; i<a; i++) {
      printf("%d", b);
    }
  }
  
  return 0;
}

Measured memory_bytes: 128
# AGC029
# A
# Irreversible operation
import itertools

s_list = input()

gr = itertools.groupby(s_list)

num_b = 0
ans = 0

for key,group in gr:
    if key == "B":
        num_b += len(list(group))
    else:
        ans += num_b * len(list(group))
    
print(ans)

Measured memory_bytes: 5092
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cassert>
#include <fstream>
#include <climits>
#include <cstdio>
#include <vector>
#include <string>
#include <queue>
#include <memory>
#include <set>
#include <map>
#include <list>
#include <cmath>

using namespace std;

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

const int maxn=2e5+10;

ll n,k;

ll a[maxn],b[maxn];
int c[maxn];
vector<ll> v;

void add(ll x)
{
    while(x<maxn)
    {
        c[x]++;
        x+=(x&-x);
    }
}

int query(ll x)
{
    int ans=0;
    while(x>0) {
        ans+=c[x];
        x-=(x&-x);
    }
    return ans;
}

int main()
{
    //freopen("/Users/qianjay/Documents/apac/in","r",stdin);
    scanf("%lld%lld",&n,&k);
    memset(c,0,sizeof(c));
    for(int i=1;i<=n;i++){
        scanf("%lld",&a[i]);
        a[i]=a[i]-k+a[i-1];
        v.push_back(a[i]);
    }
    sort(v.begin(),v.end());
    ll ans=0;
    for(int i=0;i<=n;i++) {
        a[i]=lower_bound(v.begin(),v.end(),a[i])-v.begin()+1;
        ans+=query(a[i]);
        add(a[i]);
    }
    cout<<ans<<endl;
    return 0;
}

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

template<typename Integer, size_t maxN, Integer a = 4, Integer b = 7>
class Ans{
    Integer val[maxN];
public:
    constexpr Ans() : val(){
        for(int i = 0; i < maxN; ++i){
            for(int j = 0; j < maxN; ++j){
                if(i * a + j * b < maxN)val[i * a + j * b] = 1;
            }
        }
    }
    constexpr Integer operator[](size_t i) const {return val[i];}
};

constexpr auto dp = Ans<uint_fast64_t, 200>();
long long int N;

int main(){
    scanf("%lld", &N);
    puts(dp[N] ? "Yes" : "No");
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000001
using namespace std;

int***dp;
int N,M;

struct Info{
	Info(int arg_col,int arg_value){
		col = arg_col;
		value = arg_value;
	}
	int col,value;
};

int calc(Info left,Info right){
	return (left.value+right.value)*abs(left.col-right.col);
}

void func(){

	for(int i = 1; i <= N+1; i++){
		for(int k = 0; k < 10; k++){
			for(int p = 0; p <= M; p++){
				dp[i][k][p] = BIG_NUM;
			}
		}
	}

	vector<Info> V[N+1];

	int num,tmp_col,tmp_value;

	for(int row = 1; row <= N; row++){
		scanf("%d",&num);
		for(int i = 0; i < num; i++){
			scanf("%d %d",&tmp_col,&tmp_value);
			V[row].push_back(Info(tmp_col,tmp_value));
		}
	}

	for(int i = 0; i < V[1].size();i++){
		dp[1][i][M] = 0;
	}

	if(M > 0){
		for(int i = 0; i < V[2].size();i++){
			dp[2][i][M-1] = 0;
		}
	}

	int tmp;

	for(int row = 1; row <= N-2; row++){
		for(int a = 0; a <= M; a++){
			for(int b = 0; b < V[row].size();b++){


				for(int c = 0; c < V[row+1].size();c++){
					tmp = calc(V[row][b],V[row+1][c]);
					dp[row+1][c][a] = min(dp[row+1][c][a],dp[row][b][a]+tmp);
				}

				if(a != 0){

					for(int c = 0; c < V[row+2].size();c++){
						tmp = calc(V[row][b],V[row+2][c]);
						dp[row+2][c][a-1] = min(dp[row+2][c][a-1],dp[row][b][a]+tmp);
					}
				}
			}

		}
	}


	for(int a = 0; a <= M; a++){
		for(int b = 0; b < V[N-1].size();b++){


			for(int c = 0; c < V[N].size();c++){
				tmp = calc(V[N-1][b],V[N][c]);
				dp[N][c][a] = min(dp[N][c][a],dp[N-1][b][a]+tmp);
			}

			if(a != 0){

				dp[N+1][0][a-1] = min(dp[N+1][0][a-1],dp[N-1][b][a]);

			}
		}

	}


	for(int a = 0; a <= M; a++){ //75
		for(int b = 0; b < V[N].size();b++){

			dp[N+1][0][a] = min(dp[N+1][0][a],dp[N][b][a]);

		}
	}


	int minimum = BIG_NUM;
	for(int k = 0; k <= M; k++){
		minimum = min(minimum,dp[N+1][0][k]);
	}

	printf("%d\n",minimum);
}

int main(){

	dp = new int**[152];
	for(int i = 1; i <= 151; i++){
		dp[i] = new int*[10];
		for(int k = 0; k < 10; k++){
			dp[i][k] = new int[76];
		}
	}


	while(true){
		scanf("%d %d",&N,&M);
		if(N == 0 && M == 0)break;

		func();
	}

  return 0;
}

Measured memory_bytes: 3228
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
      	String a[] = sc.next().split("");
      	String b[] = sc.next().split("");
      	String c[] = sc.next().split("");
      	System.out.println(a[0].toUpperCase() + b[0].toUpperCase() + c[0].toUpperCase());
      
    }
}

Measured memory_bytes: 39040
//abc115_a.cpp
//Sat Dec 15 18:51:24 2018

#include <iostream>
#include <string>
#include <queue>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <math.h>
#define INTINF 2147483647
#define LLINF 9223372036854775807
using namespace std;
using ll=long long;
typedef pair<int,int> P;

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

	if (n==22){
		cout << "Christmas Eve Eve Eve" << endl;
	}else if (n==23){
		cout << "Christmas Eve Eve" << endl;
	}else if (n==24){
		cout << "Christmas Eve" << endl;
	}else if (n==25){
		cout << "Christmas" << endl;
	}

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
typedef pair<int,int> iii;
typedef vector<int> vi;
typedef vector<ii> vii;
#define getbit(n,i) (((n)&(1LL<<(i)))!=0)
#define setbit0(n,i) ((n)&(~(1LL<<(i))))
#define setbit1(n,i) ((n)|(1LL<<(i)))
#define togglebit(n,i) ((n)^(1LL<<(i)))
#define lastone(n) ((n)&(-(n)))
#define read freopen("debug\\in.txt","r",stdin)
#define write freopen("debug\\out.txt","w",stdout)
#define fi first
#define se second
#define getI(a) scanf("%d",&a)
#define getII(a,b) scanf("%d%d",&a,&b)
#define PI (acos(-1))
#define fastread ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define MOD (1000000007)
#define asz 500005
#define pb push_back
#define ppf pop_front
#define ppb pop_back
#define pf push_front
ll isused[500005];
vector<ll>adj[500005];
deque<ll>res;
int main() {
    fastread;
    ll t, n, i, j, k, l, m;
    cin>>n;
    ll sum=0;
    for(i=1;i<=n;i++){
        if(i%3!=0&&i%5!=0)
            sum+=i;
    }
    cout<<sum;
}


Measured memory_bytes: 15376
import os, sys, re, math

N = int(input())
h = list(map(lambda x: -1 * int(x),input().split(' ')))
cnt = 0

while sum(h) < 0:
	min_h = min(h)
	i = h.index(min_h)
	while i < len(h):
		if h[i] == min_h:
			h[i] += 1
			i += 1
		else:
			break
	cnt += 1

print(cnt)


Measured memory_bytes: 3188
#include <bits/stdc++.h>
#define ll long long
#define MAX 200010
#define rep(i,l,r) for(int (i)=(l);(i)<(r);(i)++)
using namespace std;

int main() {
    ll h,w,k;
    cin>>h>>w>>k;
    vector<string> s(h);
    rep(i,0,h) cin>>s[i];
    ll ans=1e9;
     
    rep(bit,0,pow(2,h-1)){
        ll buf=0;
        rep(i,0,h-1)if((bit>>i)&1)buf++;
        vector<ll> cho(buf+1,0); 
        ll bex=-1,now=0,ng=0;
        rep(j,0,w){
            rep(i,0,h){
                if(i>0&&(bit>>(i-1))&1) now++;
                if(s[i][j]=='1')cho[now]++;
            }
            rep(m,0,(int)cho.size()){
                if(cho[m]>k){
                    if(bex==j-1){
                        ng=1;
                        break;
                    }
                    else{
                        j--;
                        bex=j;
                        rep(bb,0,(int)cho.size())cho[bb]=0;
                        buf++;
                        break;
                    }
                }
            }
            if(ng)break;
            now=0;
        }
        if(!ng)ans=min(ans,buf);
        
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from math import *
import random

def readln():
    return list(map(int,(input().split(" "))))

def add(x,y):
    return (x + y) % 1000000007

N = int(input())
A = input()
B = input()

F = [0 for i in range(N)]
sum = [0 for i in range(N)]

F[0] = [[0 for j in range(3)] for i in range(3)]
if(A[0] == B[0]):
    for i in range(3):
        F[0][i][i] = 1
    sum[0] = 3
else:
    for i in range(3):
        for j in range(3):
            if(i != j):
                F[0][i][j] = 1
    sum[0] = 6

for idx in range(1,N):
    F[idx] = [[0 for j in range(3)] for i in range(3)]

    if(A[idx] == B[idx]):
        for i in range(3):
            for j in range(3):
                for k in range(3):
                    if((k != i) and (k != j)):
                        value = F[idx-1][i][j]
                        F[idx][k][k] = add(F[idx][k][k],value)
                        sum[idx] = add(sum[idx],value)
    else:
        if(A[idx] == A[idx-1]):
            for i in range(3):
                for j in range(3):
                    F[idx][i][j] = F[idx-1][i][j]
                    sum[idx] = sum[idx-1]
        else:
            for i in range(3):
                for j in range(3):
                    for k in range(3):
                        for l in range(3):
                            if((i != k) and (j != l) and (k != l)):
                                value = F[idx-1][i][j]
                                F[idx][k][l] = add(F[idx][k][l],value)
                                sum[idx] = add(sum[idx],value)
print(sum[N-1])


Measured memory_bytes: 5224
K = int(input())
number = input().split(" ")
A = int(number[0])
B = int(number[1])

a = int(A/K)
b = int(B/K)

if A%K == 0 or B%K == 0:
    print("OK")
else:
    if a == b:
        print("NG")
    else:
        print("OK")

Measured memory_bytes: 9060
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            int N = sc.nextInt();
            int M = sc.nextInt();
            System.out.println(N * (N - 1) / 2 + M * (M - 1) / 2);
        }
    }
}


Measured memory_bytes: 23252
#include <bits/stdc++.h>
#define fi first
#define se second
using namespace std;
using ll = long long;

int main() {
    ios::sync_with_stdio(0); cin.tie(0);
    string s;
    cin >> s;
    sort(begin(s), end(s));
    if(s[0] == s[1] && s[1] != s[2] && s[2] == s[3])
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}

Measured memory_bytes: 256
//インクルード(アルファベット順)
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<iterator>//集合演算(積集合,和集合,差集合など)
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//イテレータあるけど順序保持しないmap
#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列

using namespace std;
typedef long long ll;

//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
//xにはvectorなどのコンテナ
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値を求める
#define MIN(x) *min_element(ALL(x)) //最小値を求める
//定数
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
//略記
#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素



signed main(){
  char a;
  cin>>a;
  if(a>='a'&&a<='z'){
    cout<<"a";
  }else{
    cout<<"A";
  }
}

Measured memory_bytes: 3616
#include<bits/stdc++.h>
#define PB push_back

using namespace std;
typedef vector<int> VI;

int m, n;
string s, t;

int dp[2001][2001][2];
int ans = 0;

int main()
{
  cin >> m >> n;
  cin >> s >> t;
  
  for(int i = 0; i <= m; i++)
    for(int j = 0; j <= n; j++){
      if(i > 0){
	if(s[i - 1] == 'O' && dp[i - 1][j][1] > 0)
	  dp[i][j][0] = max(dp[i][j][0], dp[i - 1][j][1] + 1);
	else if(s[i - 1] == 'I')
	  dp[i][j][1] = max(dp[i][j][1], dp[i - 1][j][0] + 1);
      }
      
      if(j > 0){
	if(t[j - 1] == 'O' && dp[i][j - 1][1] > 0)
	  dp[i][j][0] = max(dp[i][j][0], dp[i][j - 1][1] + 1);
	else if(t[j - 1] == 'I')
	  dp[i][j][1] = max(dp[i][j][1], dp[i][j - 1][0] + 1);
      }
      
      ans = max(ans, dp[i][j][1]);
    }
  
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 32488
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Edge = pair<int, int>;
using Graph = vector<vector<Edge>>;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
const ll MOD = 1000000007;
const ll nmax = 8;
const ll INF = 1e9;
bool graph[nmax][nmax];
vector<vector<ll>> dist = vector<vector<ll>>(nmax, vector<ll>(nmax, INF));
void warshall_floyd(ll n)
{
    for (size_t i = 0; i < n; i++)
    {
        for (size_t j = 0; j < n; j++)
        {
            for (size_t k = 0; k < n; k++)
            {
                dist[j][k] = min(dist[j][k], dist[j][i] + dist[i][k]);
            }
        }
    }
}

class UnionFind
{
public:
    vector<ll> Parent;

    UnionFind(ll N)
    {
        Parent = vector<ll>(N, -1);
    }
    ll find(ll A)
    {
        if (Parent[A] < 0)
            return A;
        return Parent[A] = find(Parent[A]);
    }

    ll size(ll A)
    {
        return -Parent[find(A)];
    }

    bool Union(ll A, ll B)
    {
        A = find(A);
        B = find(B);
        if (A == B)
        {
            return false;
        }
        if (size(A) < size(B))
            swap(A, B);

        Parent[A] += Parent[B];
        Parent[B] = A;

        return true;
    }
};

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

ll lcm(ll a, ll b)
{
    ll g = gcd(a, b);
    return a / g * b;
}

ll mulMod(ll a, ll b)
{
    return (((a % MOD) * (b % MOD)) % MOD);
}

ll powMod(ll a, ll p)
{
    if (p == 0)
    {
        return 1;
    }
    else if (p % 2 == 0)
    {
        ll half = powMod(a, p / 2);
        return mulMod(half, half);
    }
    else
    {
        return mulMod(powMod(a, p - 1), a);
    }
}

ll ceil(ll a, ll b)
{
    return (a + b - 1) / b;
}

void solve(long long N, std::vector<long long> A)
{
    SORT(A);

    vector<ll> sum(N);
    sum[0] = A[0];
    ll ans = 0;
    for (int i = 1; i < N; i++)
    {
        sum[i] = sum[i - 1];
        sum[i] += A[i];
    }
    for (int i = 0; i < N - 1; i++)
    {
        if (sum[i] * 2 < A[i + 1])
            ans = i + 1;
    }

    cout << N - ans << endl;
}

int main()
{
    long long N;
    scanf("%lld", &N);
    std::vector<long long> A(N);
    for (int i = 0; i < N; i++)
    {
        scanf("%lld", &A[i]);
    }
    solve(N, std::move(A));
    return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
#include <vector> 
# include <cstdint>
#define FOR(i,l,r) for(int i=(l);i<(r);++i)
#define RFOR(i,l,r) for(int i=(l);i>=(int)(r);i--)
#define rep(i,n)  FOR(i,0,n)
#define rrep(i,n)  RFOR(i,n-1,0)

#define int long long
using namespace std;
const int MX = 1e6;
const int inf = 1e9;
const int mod = 998244353;
using ll = long long;
using P = pair<ll, ll>;
double PI = acos(-1);
signed main(){
    string s,t;
    cin >> s>>t;
    int ans = 0;
    rep(i,s.length()) {
        if(s[i]!=t[i])ans++;
    }
    cout << ans << endl;

    return 0;
}



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

#define i_cin(X) scanf("%d", &X)
#define i_cin2(X,Y) scanf("%d %d",&X,&Y)
#define i_cin3(X,Y,Z) scanf("%d %d %d",&X,&Y,&Z)
#define l_cin(X) scanf("%ld",&X)
#define s_cin(X) scanf("%s",&X)


#define  i_cout(X) printf("%d\n",X)
#define  i_cout2(X,Y) printf("%d %d\n",X,Y)
#define  l_cout(X) printf("%ld\n",X)
#define  s_cout(X) printf("%s\n",X)
#define  ll_cout(X) printf("%lld\n",X)

int i_cins(int n, int* A);

int main(void) {
	int   N,i,cnt;
	i_cin(N);
	if (N == 100000) {
		i_cout(90000 + 900 + 9);
		return 0;
	}
	if (N >= 10000) {
		i_cout((N-10000+1) + 900 + 9); 
		return 0;
	}
	if (N >= 1000) {
		i_cout(900 + 9);
		return 0;
	}
	if (N >= 100) {
		i_cout((N - 100 + 1) + 9);
		return 0;
	}
	if (N >= 10) {
		i_cout(9);
		return 0;
	}
	i_cout(N);
	return 0;
}



Measured memory_bytes: 128
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>
#include<complex>

using namespace std;

#define ll long long
#define ld long double
#define EPS 1e-9
#define INF 1e9
#define LINF (ll)INF*INF
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,a,n) for(int i=a;i<(n);i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

#define int ll //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef pair<pii,int> ppi;
typedef pair<int,pii> pip;
typedef vector<pii> vp;
typedef vector<vi> vvi;

int gcd(int a, int b){if(b==0) return a;return gcd(b,a%b);}
int lcm(int a, int b){return a/gcd(a,b)*b;}


signed main(void) {
    int a,b;
    cin >> a >> b;
    b--;
    a--;
    cout << (b+a-1)/a << endl;

}


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


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N,M;
    cin >> N >> M;
    vector<int> C(N+1,0),WC(N+1,0);
    int wa = 0,ac = 0;
    int p;
    string s;
    for (int i = 0; i < M; i++)
    {
        cin >> p >> s;
        if(C[p]) continue;
        if(s == "AC") {
            ++C[p];
            wa += WC[p];
            ++ac;
        }
        else ++WC[p];
    }
    cout << ac << " " << wa << endl;
    
    
}


    


Measured memory_bytes: 1024
package main

import (
	"bufio"
	"fmt"
	"log"
	"math"
	"os"
	"sort"
	"strconv"
)

// ----------------------------------------------------------------

func main() {
	N := nextInt()
	A := make([]int, N)
	parity := 0
	for i := range A {
		A[i] = nextInt()
		if A[i] < 0 {
			parity = 1 - parity
			A[i] = -A[i]
		}
	}
	sort.Ints(A)
	var ans int64
	for i := range A {
		if i == 0 && parity == 1 {
			ans -= int64(A[i])
		} else {
			ans += int64(A[i])
		}
	}
	fmt.Println(ans)
}

// ----------------------------------------------------------------

var dx = []int{0, 1, 0, -1, 0}
var dy = []int{1, 0, -1, 0, 0}
var inf = int(1e9)

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
}

var nextReader func() []byte

func init() {
	nextReader = newScanner()
	log.SetFlags(log.Lshortfile)
}

func newScanner() func() []byte {
	r := bufio.NewScanner(os.Stdin)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)
	return func() []byte {
		r.Scan()
		return r.Bytes()
	}
}

func nextBytes() []byte {
	return nextReader()
}

func nextString() string {
	return string(nextReader())
}

func nextInt64() int64 {
	v, _ := strconv.ParseInt(string(nextReader()), 10, 64)
	return v
}

func nextInt() int {
	v, _ := strconv.Atoi(string(nextReader()))
	return v
}

func nextInts(n int) []int {
	r := make([]int, n)
	for i := 0; i < n; i++ {
		r[i] = nextInt()
	}
	return r
}

func nextFloat64() float64 {
	f, _ := strconv.ParseFloat(string(nextReader()), 64)
	return f
}


Measured memory_bytes: 3072