akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define ii pair<int,int>
#define iii pair<ii,int>
#define vii vector<pair<int,int> >
#define vi vector<int>
#define vvi vector<vector<int> >
#define vs vector<string>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define nu 100000
#define mod 1000000007
#define inf pow(10,8)
#define h pow(10,-8)
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)

int main()
{
	fastio;

	int a, b;
	cin >> a >> b;

	a *= b;

	if (a%2 == 0)
	{
		cout << "Even"; 
	}
	else
	{
		cout << "Odd"; 
	}
}

Measured memory_bytes: 256
#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 cnt = 0;
  rep(i, n) if(to_string(i+1).size() % 2 == 1) cnt++;

  cout << cnt << endl;

}


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

#ifdef ENABLE_DEBUG
template <typename T>
void debug(T value) {
  cerr << value;
}
template <typename T, typename... Ts>
void debug(T value, Ts... args) {
  cerr << value << ", ";
  debug(args...);
}
#define DEBUG(...)                              \
  do {                                          \
    cerr << " \033[33m (L" << __LINE__ << ") "; \
    cerr << #__VA_ARGS__ << ":\033[0m ";        \
    debug(__VA_ARGS__);                         \
    cerr << endl;                               \
  } while (0)
#else
#define debug(...)
#define DEBUG(...)
#endif

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int a, b, c, d, e, f;
  cin >> a >> b >> c >> d >> e >> f;
  double max_density = -1.0;
  int ans_water = -1, ans_sugar = -1;
  set<int> waters;
  for (int ta = 0; ta <= f; ta += 100 * a) {
    for (int tb = 0; ta + tb <= f; tb += 100 * b) {
      waters.insert(ta + tb);
    }
  }
  set<int> sugars;
  for (int sc = 0; sc <= f; sc += c) {
    for (int sd = 0; sc + sd <= f; sd += d) {
      sugars.insert(sc + sd);
    }
  }
  for (int water : waters) {
    int max_sugar = e * water / 100;
    for (int sugar : sugars) {
      if (sugar > max_sugar) break;
      if (water + sugar > f) break;
      if (water + sugar == 0) continue;
      double density = 100.0 * sugar / double(water + sugar);
      if (max_density < density) {
        max_density = density;
        ans_water = water;
        ans_sugar = sugar;
      }
    }
  }

  cout << (ans_water + ans_sugar) << " " << ans_sugar << endl;
  DEBUG(max_density);
}


Measured memory_bytes: 3716
#include <iostream>
#include <string>
#include <cstdlib>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
	vector<int> vec(3);
	cin >> vec[0] >> vec[1] >> vec[2];
	sort(vec.begin(), vec.end());
	cout << (vec[2] - vec[1]) + (vec[1] - vec[0]) << "\n";
}

Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)

func scanString() string   { sc.Scan(); return sc.Text() }
func scanRunes() []rune    { return []rune(scanString()) }
func scanInt() int         { a, _ := strconv.Atoi(scanString()); return a }
func scanInt64() int64     { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }
func scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }

func scanInts(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = scanInt()
	}
	return res
}

func debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

//•*¨*•.¸¸♪main•*¨*•.¸¸♪(　-ω-)ノ　(　・ω・)
func main() {
	defer wr.Flush()
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 10000), 1001001)

	n, y := scanInt(), scanInt()
	for i := 0; i < n+1; i++ {
		for j := 0; j < n+1-i; j++ {
			if y == 10000*i+5000*j+1000*(n-i-j) {
				fmt.Fprintln(wr, i, j, n-i-j)
				return
			}
		}
	}
	fmt.Fprintln(wr, -1, -1, -1)
}


Measured memory_bytes: 640
package main

import (
	"fmt"
	"sort"
	"strings"
)

func main() {
	var S string
	fmt.Scan(&S)

	t := strings.Split(S, "")
	sort.Strings(t)
	s := strings.Join(t, "")

	if s[0] == s[1] && s[2] == s[3] && s[0] != s[3] {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


Measured memory_bytes: 640
#include <stdio.h>
#define _USE_MATH_DEFINES
#include <math.h>
 
typedef struct{
    double x;
    double y;
}point;
 
void kock(int n,point p1,point p2){
    if(n==0) return;
    point s,t,u;
    s.x=(2*p1.x+1*p2.x)/3;
    s.y=(2*p1.y+1*p2.y)/3;
    t.x=(1*p1.x+2*p2.x)/3;
    t.y=(1*p1.y+2*p2.y)/3;
    u.x=(t.x-s.x)*cos(M_PI/3)-(t.y-s.y)*sin(M_PI/3)+s.x;
    u.y=(t.x-s.x)*sin(M_PI/3)+(t.y-s.y)*cos(M_PI/3)+s.y;
 
    kock(n-1,p1,s);
    printf("%lf %lf\n",s.x,s.y);
    kock(n-1,s,u);
    printf("%lf %lf\n",u.x,u.y);
    kock(n-1,u,t);
    printf("%lf %lf\n",t.x,t.y);
    kock(n-1,t,p2);
}
 
int main(void){
    int n;
    point p1={0,0},p2={100,0};
    scanf("%d",&n);
    printf("%lf %lf\n",p1.x,p1.y); 
    kock(n,p1,p2);
    printf("%lf %lf\n",p2.x,p2.y);
    return 0;
}



Measured memory_bytes: 2112
#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
#define PI 3.14159265359
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
  int R;
  cin >> R;
  double ans = 2 * PI * R;
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 3776
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <map>
#include <deque>
#include <string>
using namespace std;

#define REP(i,n) for(int i = 0; i < n; i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
typedef pair<int,int> pi;
typedef pair<ll,ll> pll;
typedef pair<string,string> pss;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pi> vpi;
typedef vector<ll> vll;
typedef vector<vll> vvll;

double EPS = 1e-9;
int INFi = 1000000005;
long long INFll = 1000000000000000005ll;
double PI = acos(-1);
int dirx[8] = {-1,0,0,1,-1,-1,1,1};
int diry[8] = {0,1,-1,0,-1,1,-1,1};
ll MOD = 1000000007;

int main(){
  string s;
  cin  >> s;
  map<char, int> mp;
  char c = 'a';
  REP(i,26){
    mp[c] = -100;
    c++;
  }

  int n = s.size();

  REP(i, n){
    if(mp[s[i]] >= i-2){
      cout << mp[s[i]]+1 << " " << i+1 << endl;
      return 0;
    }
    mp[s[i]] = i;
  }

  cout << "-1 -1" << endl;

  return 0;
}


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

using namespace std;

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

    vector<int> vec(n);
    for (auto &num : vec) {
        cin >> num;
    }

    vector<int> costs(n, 0);
    int prev = 0;

    for (int i = 0; i < n; i += 1) {
        costs[i] += abs(vec[i] - prev) + (i > 0 ? costs[i - 1] : 0);
        prev = vec[i];
    }

    for (int i = 0; i < n; i += 1) {
        int curr_cost = 0;

        if (i > 0 && i + 1 < n) {
            curr_cost = costs[n - 1]
                      - (costs[i + 1] - costs[i - 1])
                      + abs(vec[i + 1] - vec[i - 1])
                      + abs(vec[n - 1]);
        } else if (i == 0) {
            curr_cost = costs[n - 1]
                      - costs[i + 1]
                      + abs(vec[i + 1])
                      + abs(vec[n - 1]);
        } else {
            curr_cost = costs[i - 1]
                      + abs(vec[i - 1]);
        }

        cout << curr_cost << "\n";
    }

    return 0;
}


Measured memory_bytes: 2048
e1,e2,e3,e4=map(int,input().split())
if e1==e2 and e3==e4:
    print("yes")
elif e1==e3 and e2==e4:
    print("yes")
elif e1==e4 and e2==e3:
    print("yes")
else:
    print("no")


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

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

    ll K; cin >> K;
    int cnt = 1;
    ll ans = 0;
    if(K > 1){
        bool flag = 1;
        for(int i = 1; i < S.size(); i++){
            if(S[i-1] != S[i]){
                flag = 0;
                break;
            }
        }
        if(flag){
            cout << K * (ll)S.size() / 2 << endl;
            return 0;
        }
        if(S[0] == S[S.size()-1]){
            int t = 0;
            while(1){
                if(S[t] != S[t+1]) break;
                t++;
            }
            string T = S.substr(t + 1, S.size() - t - 1) + S.substr(0, t + 1);
            //cout << T;
            for(int i = 1; i < T.size();i++){
                if(T[i-1] == T[i]) cnt++;
                else{
                    ans += cnt / 2;
                    cnt = 1;
                }
            }
            ans += cnt / 2;
            ans = ans * K - cnt / 2 + (t + 1) / 2 + (cnt - t - 1) / 2;
            cout << ans << endl;
        }
        else{

        
        //cout << S << endl;

        for(int i = 1; i < S.size();i++){
            if(S[i-1] == S[i]) cnt++;
            else{
                ans += cnt / 2;
                cnt = 1;
            }
        }
        ans += cnt / 2;
        cout << ans * K << endl;
        }
    }
    else{
        for(int i = 1; i < S.size();i++){
            if(S[i-1] == S[i]) cnt++;
            else{
                ans += cnt / 2;
                cnt = 1;
            }
        }
        ans += cnt / 2;
        cout << ans * K << endl;
    }
}

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

const int M = (int)2e3;

int n, x, y;
bool vis[M + 5];
int dis[M + 5][M + 5];
int cnt[M + 5];

void bfs(int s, int* dis)
{
    memset(vis, 0, sizeof(vis));
    queue <int> q;
    q.push(s);
    vis[s] = 1, dis[s] = 0;
    while(!q.empty())
    {
        int u = q.front();
        q.pop();
        if(u < n && !vis[u + 1])
        {
            vis[u + 1] = 1;
            dis[u + 1] = dis[u] + 1;
            q.push(u + 1);
        }
        if(u > 1 && !vis[u - 1])
        {
            vis[u - 1] = 1;
            dis[u - 1] = dis[u] + 1;
            q.push(u - 1);
        }
        if(u == x && !vis[y])
        {
            vis[y] = 1;
            dis[y] = dis[u] + 1;
            q.push(y);
        }
        if(u == y && !vis[x])
        {
            vis[x] = 1;
            dis[x] = dis[u] + 1;
            q.push(x);
        }
    }
}

int main()
{
    scanf("%d %d %d", &n, &x, &y);
    for(int i = 1; i <= n; ++i) bfs(i, dis[i]);
    for(int i = 1; i <= n; ++i) for(int j = i + 1; j <= n; ++j) cnt[dis[i][j]]++;
    for(int i = 1; i <= n - 1; ++i) printf("%d\n", cnt[i]);
    return 0;
}


Measured memory_bytes: 16000
import java.io.IOException;
import java.util.Scanner;


public class Main{
	public static void main(String args[]) throws IOException{
		Scanner bf = new Scanner(System.in);
		while(bf.hasNext()){
			double v = Double.parseDouble(bf.nextLine());
			double y = v*v/19.6;
			int n = (int)Math.ceil((y+5)/5);
			System.out.println(n);
		}
	}
}

Measured memory_bytes: 17140
mod = 10**9 + 7
x, y = map(int, input().split())
move_count = 0
if (y + x) % 3 == 0:
    move_count = ((y + x) // 3)

move_a = (y - move_count) % mod
move_b = (x - move_count) % mod


def nck(n, k):
    numer, denom = 1, 1
    for i in range(k):
        numer = numer * (n - i) % mod
        denom = denom * (k - i) % mod
    return numer * pow(denom, mod-2, mod) % mod


ans = nck(move_count, min(move_a, move_b))
print(ans % mod)

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

int S[10][1000];
int cum[11][1001];
int res = 10000;

int count_num(int x,int y,int w,int z){
    return cum[x][y] + cum[w][z] - cum[x][z] - cum[w][y];
}

int debug_point = 0;
void debug(){
    cout << "debug: " <<  debug_point <<" >> ";
    int a;
    cin >> a;
    debug_point++;
}

int main(){
    int h,w,k;
    cin >> h >> w >> k;
    
    //debug();

    rep(i,h){
        string s;
        cin >> s;
        rep(j,w){
            //debug();
            S[i][j] = (s[j]-'0');
            cum[i+1][j+1] = S[i][j] + cum[i+1][j] + cum[i][j+1]-cum[i][j];
        }
    }

    rep(i,1<<(h-1)){
        vector<int> tate;
        tate.push_back(0);
        rep(j,h){
            if(i>>j&1){
                tate.push_back(j+1);
            }
        }
        tate.push_back(h);

        //debug();
        
        /*
        cout << "tate" << endl;
        for(auto t:tate) cout << t << " ";
        cout << endl;
        */
        vector<int> yoko;
        int temp_yoko=0;
        yoko.push_back(0);
        bool succes = true;
        
        //cutting greedy
        

        rep(j,w+1){
            int temp_num = 0;
            bool flag = false;
            rep(m,tate.size()-1){

                //cout << "cut:" << tate[m]<<":"<<temp_yoko<<":" << tate[m+1]<<":"<<j << endl;
                temp_num=count_num(tate[m],temp_yoko,tate[m+1],j);
                //cout << "num" << temp_num << endl;
                if (temp_num<=k) continue;
                else{
                    if(j-temp_yoko<2){
                        flag = true;
                        break;
                    }
                    temp_yoko = j-1;
                    j--;
                    yoko.push_back(j-1);
                }
            }
            if(flag){
                succes = false;
                break;
            }
       }

        if(succes){
            int temp = 0;
            temp = (tate.size()-2)+(yoko.size()-1);
            //cout <<"sucess:" << temp << endl;
            res = min(temp,res);
        }
    }
    cout << res << endl;

}


Measured memory_bytes: 384
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
using namespace std;

int N;
int p[20010];
int a[20010], b[20010];

int main() {
  cin >> N;
  for (int i=0; i<N; i++) cin >> p[i];
  for (int i=0; i<N; i++) {
    a[i] = i+1;
    b[i] = N-i;
  }
  for (int i=1; i<N; i++) {
    int prev = p[i-1]-1;
    int t    = p[i]-1;
    if (a[prev] + b[prev] >= a[t] + b[t]) {
      int d = (a[prev] + b[prev]) - (a[t] + b[t]) + 1;
      for (int i=0; i<N; i++) {
        if (i <= t) b[i] += d;
        if (i >= t) a[i] += d;
      }
    }
  }
  for (int i=0; i<N; i++) {
    cout << a[i] << (i == N-1 ? '\n' : ' ');
  }
  for (int i=0; i<N; i++) {
    cout << b[i] << (i == N-1 ? '\n' : ' ');
  }
  return 0;
}



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

const int N = 2e5 + 10;

int a[N], pos[N];

int main(){
	int n, cnt, maxx;
	scanf("%d",&n);
	for (int i = 1; i <= n; i++){
		scanf("%d",&a[i]);
		pos[a[i]] = i;
	}
	pos[0] = 0;
	maxx = 0; cnt = 0;
	for (int i = 1; i <= n; i++){
		if (pos[i] > pos[i - 1]) cnt++;
		else{
			maxx = max(maxx, cnt);
			cnt = 1;
		}
	}
	maxx = max(maxx, cnt);
	printf("%d\n", n - maxx);
	return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define ALL(obj) begin(obj), end(obj)
#define debug(x) cerr << #x << ": " << x << '\n'
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;

int main() {
    int N;
    cin >> N;
    vector<int> t(N);
    vector<double> v(N);
    int T = 0;
    for (int i = 0; i < N; i++) {
        cin >> t.at(i);
        T += t[i];
    }
    for (int i = 0; i < N; i++) {
        cin >> v.at(i);
    }

    vector<double> lim(2 * T + 1, 100000);
    int now = 0;
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < t[i]; j++) {
            chmin(lim[now], v[i]);
            chmin(lim[now + 1], v[i]);
            now += 2;
        }
    }

    vector<int> t_cum(N + 1);
    for (int i = 0; i < N; i++) {
        t_cum[i + 1] += t_cum[i] + t[i];
    }

    double vel = 0;
    for (int i = 1; i < N + 1; i++) {
        for (int now = 2 * t_cum[i - 1]; now < 2 * T + 1; now++) {
            chmin(lim[now], vel);
            vel += 0.5;
        }
        vel = v[i - 1];
    }
    for (int i = 1; i < N + 1; i++) {
        if (i == N) {
            vel = 0;
        } else {
            vel = v[i];
        }
        for (int now = 2 * t_cum[i]; now >= 0; now--) {
            chmin(lim[now], vel);
            vel += 0.5;
        }
    }

    double ans = 0;
    for (int i = 0; i < 2 * T; i++) {
        // cout << lim[i] << " ";
        ans += 0.25 * (lim[i] + lim[i + 1]);
    }
    //cout << endl;
    cout << setprecision(10) << ans << endl;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define sz(v) ((ll)v.size())
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define F first
#define S second
#define pii pair<ll,ll> 
const ll mod = 1000000007;
const ll mod1= 1000000009;
const ll base= 10529;
const ll base1=11699 ;
#define MAXN 2000004
#define trace1(x)                cerr << #x << ": " << x << "\n";
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << "\n";
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << "\n";
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << "\n";
ll dp[1002][1002];
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  ll k;
  cin>>s>>k;
  vector<ll> v;
  ll tmp=0;
  for(ll i=0;i<s.size();i++){
    if(i and s[i]!=s[i-1]) {v.pb(tmp);tmp=0;}
    tmp++;
  }
  v.pb(tmp);
  ll ans=0;
  if(v[0]==sz(s)){
    cout<<k*sz(s)/2;
    return 0;
  }
  if(s[0]!=s.back()) {
    for(auto it: v) ans+=it/2;
    ans*=k;
  }
  else{
    for(ll i=1;i<v.size()-1;i++)  ans+=v[i]/2;
      ans*=k;
      ans+=v[0]/2+v.back()/2+(v[0]+v.back())/2*(k-1);
  }
  cout<<ans;
}

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

#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define ppb pop_back()
#define ppf pop_front()
#define all(vec) vec.begin(), vec.end()
#define fol(i,a,b) for(int i=a;i<b;i++)
#define loop(i,a,b) for(int i=a;i>=b;i--)
#define forr(x,arr) for(auto& x:arr)
#define mod 1000000007
#define INF 0x3f3f3f3f3f3f3f3f
#define EPS 1e-7
#define sz(x) ((lli)(x).size())
#define endl '\n'

#ifdef SANJU
    #define localsys 1
#else
    #define localsys 0
#endif

using   lli     =   long long;
using   lld     =   long double;
using   ulli    =   unsigned long long int;
using   pll     =   pair<lli, lli>;
using   ttt     =   pair<lli, pll>;
using   vttt    =   vector<ttt>;
using   vll     =   vector<pll>;
using   vl      =   vector<lli>;
using   vi      =   vector<int>;
using   vvi     =   vector<vector<int>>;
using   cd      =   complex<lld>;

void sanjeev(int kkkk)
{
    int n,k;
    cin>>n>>k;

    vector<int>A;
    for(int i=0;i<n;i++)
    {
        int t;
        cin>>t;
        A.push_back(t);
    }

    vector<int>dp(k+1,0);

    for(int i=1;i<=k;i++)
    {
        for(int j=0;j<A.size();j++)
        {
            if(i>=A[j] && dp[i-A[j]]==0)dp[i]=1;
        }
    }

    if(dp[k]==1)cout<<"First"<<endl;
    else cout<<"Second"<<endl;

}

int main()
{
    if(!localsys) ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    cout << fixed << setprecision(10);
    int t=1;
    //cin>>t;
    fol(i,0,t) { sanjeev(i+1); }
    if(localsys) system("pause");
}


Measured memory_bytes: 640
import java.util.*;
import java.util.Collections;
import java.util.stream.Collectors;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    List<String> list = new ArrayList<String>();
    String ans = "Yes";
    for (int i = 0; i < N; i++) {
      list.add(sc.next());
    }
    List<String> list2 = list.stream().distinct().collect(Collectors.toList());
    if (list2.size() != N) {
      ans = "No";
    } else {
      for (int i = 1; i < N; i++) {
        String formar = list.get(i - 1);
        String latter = list.get(i);
        if (formar.charAt(formar.length() - 1) != latter.charAt(0)) {
          ans = "No";
          break;
        }
      }
    }
    System.out.println(ans);
  }
}


Measured memory_bytes: 27076
#include <iostream>
using namespace std;
int main ()
{
    unsigned long long  i,N, sum=0;;
    cin >> N;
    for(i=1;i<=N;i++)
    {
        if((i%3==0 ||i%5==0))
        {
            continue;
        }
        if(i%3==0)
        {
            continue;
        }
        else if(i%5==0)
        {
                continue;
        }
        else
            sum+=i;
    }
    cout << sum << endl;
   return 0;
}


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

int nC2(int n){
    return n*(n-1)/2;
}

int main(void){
    string s,t;
    cin>>s>>t;
    int count=0;
    for(int i=0;i<s.length();++i){
        if(s[i]!=t[i]) count++;
    }
    cout<<count<<endl;
}



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

using namespace std;

int n,m,dp[200009],ans;
vector<int>v[200002];

int dfs(int x){
  if(dp[x]!=-1) return dp[x];

  int res=0;
  for(int i=0;i<v[x].size();i++){
    res=max(res,dfs(v[x][i]) + 1 );
  }
  return dp[x] = res;
}


int main(){
  memset(dp,-1,sizeof(dp));
  cin>>n>>m;
  while(m--){
    int x,y;
    cin >> x >> y; x--; y--;
    v[x].push_back(y);
  }
  while(n--) ans = max(ans,dfs(n));

  cout<<ans<<endl;
}


Measured memory_bytes: 10240
/*
 ============================================================================
 Name        : alds1_4_a_linearSearch.c
 Author      : lovesaemi
 Version     :
 Copyright   : Your copyright notice
 Description : Hello World in C, Ansi-style
 ============================================================================
 */

#include <stdio.h>
#include <stdlib.h>

int search(int A[], int n, int key) {
	int i = 0;
	A[n] = key;
	while (A[i] != key) {
		i++;
	}
	return i != n;
}

int main(void) {
	int i, n, A[10000 + 1], q, key, sum = 0;
	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d", &A[i]);
	}
	scanf("%d", &q);
	for (i = 0; i < q; i++) {
		scanf("%d", &key);
		if (search(A, n, key)) {
			sum++;
		}
	}
	printf("%d\n", sum);
	return EXIT_SUCCESS;
}



Measured memory_bytes: 2048
#include <bits/stdc++.h>
using namespace std;
int n,dp[2003][2003],a[6003],ans,tg,MX[2003],cur;
vector<int>A,B,C;
void add(int x,int y,int z){A.push_back(x),B.push_back(y),C.push_back(z);}
int main(){
	cin>>n;
	for(int i=1;i<=3*n;i++)cin>>a[i]; 
	memset(dp,-1,sizeof(dp));
	memset(MX,-1,sizeof(MX));
	dp[a[1]][a[2]]=dp[a[2]][a[1]]=MX[a[1]]=MX[a[2]]=cur=0;
	for(int i=3;i<3*n;i+=3){
		if(a[i]==a[i+1]&&a[i]==a[i+2]){tg++;continue;}
		A.clear(),B.clear(),C.clear();
		sort(a+i,a+i+3);
		if(a[i]==a[i+1])for(int j=1;j<=n;j++)if(dp[j][a[i]]>=0)add(j,a[i+2],dp[j][a[i]]+1);
		if(a[i+1]==a[i+2])for(int j=1;j<=n;j++)if(dp[j][a[i+1]]>=0)add(j,a[i],dp[j][a[i+1]]+1);
		if(dp[a[i]][a[i]]>=0)add(a[i+1],a[i+2],dp[a[i]][a[i]]+1);
		if(dp[a[i+1]][a[i+1]]>=0)add(a[i],a[i+2],dp[a[i+1]][a[i+1]]+1);
		if(dp[a[i+2]][a[i+2]]>=0)add(a[i],a[i+1],dp[a[i+2]][a[i+2]]+1);
		add(a[i],a[i+1],cur),add(a[i+1],a[i+2],cur),add(a[i],a[i+2],cur);
		for(int j=i;j<i+3;j++)for(int k=1;k<=n;k++)if(MX[k]>=0)add(a[j],k,MX[k]);
		for(int j=0;j<(int)A.size();j++)if(dp[A[j]][B[j]]<C[j])
			dp[A[j]][B[j]]=dp[B[j]][A[j]]=C[j],MX[A[j]]=max(MX[A[j]],C[j]),MX[B[j]]=max(MX[B[j]],C[j]),cur=max(cur,C[j]);

	}
	for(int i=1;i<=n;i++){
		for(int j=i+1;j<=n;j++)if(dp[i][j]>=0)ans=max(ans,dp[i][j]);
		if(dp[i][i]>=0)if(i==a[3*n])ans=max(ans,dp[i][i]+1);
	}
	printf("%d",ans+tg);
}


Measured memory_bytes: 19644
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define rep1(i,n) for(int i=1;i<=(int)n;i++)
#define sp(n) cout << fixed << setprecision(n)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
typedef long long ll;
using namespace std;
int main(void){
    ll n;cin>>n;
    vector<ll> a(n),b(n),d(n);
    rep(i,n)cin>>a[i];
    rep(i,n)cin>>b[i];
    rep(i,n){
        d[i]=a[i]-b[i];
    }
    sort(d.begin(),d.end());
    ll tot=0,res=0;
    rep(i,n){
        if(d[i]>=0)break;
        res++;
        tot-=d[i];
    }
    reverse(d.begin(),d.end());
    rep(i,n){
        if(tot<=0)break;
        if(d[i]<=0)break;
        res++;
        tot-=d[i];
    }
    if(tot>0)cout<<-1<<endl;
    else cout<<res<<endl;
}

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

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    
    int H, W, h, w;
    cin >> H >> W >> h >> w;
    if(H % h == 0 && W % w == 0){ cout << "No" << endl; return 0; }
    cout << "Yes" << endl;
    if(H % h){
        for(int hh=1;hh<=H;++hh){
            int val = (hh % h == 0 ? -250000 * (h-1) - 1 : 250000);
            for(int ww=1;ww<=W;++ww) cout << val << " \n"[ww==W];
        }
    }else{
        for(int hh=1;hh<=H;++hh){
            for(int ww=1;ww<=W;++ww){
                int val = (ww % w == 0 ? -250000 * (w-1) - 1 : 250000);
                cout << val << " \n"[ww==W];
            }
        }
    }
    return 0;
}

Measured memory_bytes: 2048
//
//  main.cpp
//  tsundoku
//
//  Created by Bryan on 27/06/20.
//  Copyright © 2020 mac. All rights reserved.
//

#include <iostream>
#include <stdio.h>
using namespace std;

int main()
{
    long long N,M,K;
    scanf ("%lld %lld %lld", &N,&M, &K);
    long long arr[N+2];
    long long brr[M+2];
    arr[0] = 0;
    brr[0] = 0;
    long long temp;
    for (long long f = 1; f<=N;f++)
    {
        scanf ("%lld", &temp);
        arr[f] = temp+arr[f-1];
    }
    for (long long f = 1; f<=M;f++)
    {
        scanf ("%lld", &temp);
        brr[f] = temp+brr[f-1];
    }
    long long now,sisa,count;
    long long l,r,mid;
    long long ans = 0;
    for (long long f = N;f>=0;f--)
    {
        now = arr[f];
        sisa = K-arr[f];
        if (sisa>=0)
        {
            if (sisa<brr[1])
                count = f;
            else if (sisa>brr[M])
                count = f+M;
            else
            {
                l = 1;
                r = M+1;
                while (l<r)
                {
                    mid = (l+r)/2;
                    if (brr[mid]>sisa)
                        r = mid;
                    else
                        l = mid+1;
                }
                count = f+r-1;
                
            }
            if (count>ans)
                ans = count;
        }
    }
    printf ("%lld\n", ans);
    
}


Measured memory_bytes: 6944
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
//#define ll long long
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 (a>b) { a=b; return 1; } return 0; }
#define rep(i, n) REP(i, 0, n)
#define rep_rev(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
#define all(x) (x).begin(),(x).end()
ll t1,t2,t3;
const ll mod = 1000000007;
const int INF = 1e9;
const ll INFLONG = 1e18;

int main(){
  string s;
  cin >> s;
  vector<ll> sum(2019,0);
  ull len = s.size();

  ll tmp = 0;
  ll piv = 1;
  rep_rev(i,len){
    t1 += piv * (s[i] - '0');
    t1 %= 2019;
    sum[t1]++;
    piv *= 10;
    piv %= 2019;
  }
  sum[0]++;



  t2 = 0;
  ll ans = 0;
  rep(i,2019){
    ans += sum[i] * (sum[i]-1) / 2;
  }
  cout << ans << endl;
}


Measured memory_bytes: 3720
// #define _GLIBCXX_DEBUG
// #pragma GCC optimize("Ofast")
#pragma GCC diagnostic ignored "-Wsign-compare"
#include <bits/stdc++.h>
using namespace std;
using i64 = int_fast64_t;
#define rep(i, n) for (i64 i = 0; i < (i64)(n); ++i)
#define reps(i, s, n) for (i64 i = s; i < (i64)(n); ++i)

void solve() {
    string S;
    cin >> S;
    string T = "keyence";
    int N = (int)S.size();
    reps(i, 0, N) {
        reps(j, i, N + 1) {
            int idx = 0;
            bool keyence = false;
            rep(k, N) {
                if (i <= k and k < j) continue;
                if (idx == 7) {
                    keyence = false;
                    break;  // 文字が残っている
                }
                if (idx < 7 and S[k] == T[idx]) {
                    idx++;
                    if (idx == 7) {
                        keyence = true;
                    }
                }
                else {
                    break;
                }
            }
            if (keyence) {
                cout << "YES\n";
                return;
            }
        }
    }
    cout << "NO\n";
}
int main() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    // cout << fixed << setprecision(15);
    solve();
}

Measured memory_bytes: 3636
#include<iostream>
using namespace std;
int main()
{
    int W, H, x, y, r;
    cin >> W >> H >> x >> y >> r;
    if (x - r < 0)cout << "No" << endl;
    else if (x + r > W)cout << "No" << endl;
    else if (x - r >= 0 && x + r <= W)
    {
        if (y - r < 0)cout << "No" << endl;
        else if (y + r > H)cout << "No" << endl;
        else if (y - r >= 0 && y + r <= H)cout << "Yes" << endl;
    }
    return 0;
}

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

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int a,b,c;
  string s,t;
  cin >>a;
  a=1000-a%1000;
  if(a==1000)a=0;
  cout <<a;
}

Measured memory_bytes: 3652
#include <iostream>
using namespace std;
 
int main() {
	while(1){
		int matsudo, unco;
		int kousin[9] = {};
		unco = 0;
		cin >> matsudo;
		for(int tora = 0; tora < 9; tora++)
			cin >> kousin[tora];
		if(matsudo == 0){
			return 0;
		}
		for(int tora = 0; tora < 9; tora++){
			unco = unco + kousin[tora];
		}
		cout << matsudo - unco << endl;
	}
}

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

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 1000000007

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

bool naoppy(vector<ll> &v, ll mid) {
	vector<P> now;
	now.EB(0,-1);
	REP(i,v.size()){
		if(now.back().FI < v[i]){
			now.EB(v[i],0);
		}
		else {
			if(mid <= 1)return false;
			while(now.back().FI > v[i])now.pop_back();
			if(now.back().FI < v[i])now.EB(v[i],0);
			int tmp = now.back().FI;
			int top = now.back().FI;
			while(now.back().FI == top && now.back().SE == mid - 1){
				top = now.back().FI - 1;
				now.pop_back();
			}
			if(now.back().FI != top)now.EB(top,0);
			now.back().SE++;
			if(now.back().FI != tmp)now.EB(tmp,0);
			if(now.front().SE > -1)return false;
		}
		//REP(i,now.size())cout << "(" << now[i].FI << "," << now[i].SE << ") ";cout << endl;
	}
	return true;
}

int main(){
	
	ll n;cin >> n;
	vector<ll> v(n);
	REP(i,n)cin >> v[i];
	
	ll l = 0;
	ll r = 222222;
	
	while(r - l > 1){
		ll mid = (l + r) / 2;
		if(naoppy(v,mid))r = mid;
		else l = mid;
	}
	
	cout << r << endl;
	
	return 0;
}


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

using namespace std;

#define ll long long

void solve() {
	string s;
	cin >> s;
	cout << (s[0] == s[1] && s[1] == s[2] || s[1] == s[2] && s[2] == s[3] ? "Yes" : "No");
}

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

	int t = 1, i = 1;
	//cin >> t;
	while(t--) {
		//cout << "Case #" << i << ": ";
		solve();
		//i++;
	}
	return 0;
}



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

int n, px = 0, b[2];

string x;
int powmod(int x, int y, int mod) { //x^y
	int rv = 1;
	for (; y > 0; y >>= 1, x = (long long) x * x % mod)
		if (y & 1)
			rv = (long long) rv * x % mod;
	return rv;
}

int main() {
	cin >> n >> x;
	for (int i = 0; i < n; ++i)
		if (x[i] == '1')
			++px;
	for (int i = 0; i < n; ++i) {
		b[0] <<= 1;
		b[1] <<= 1;
		if (x[i] == '1') {
			++b[0];
			++b[1];
		}
		if (px != 1)
			b[0] %= (px - 1);
		b[1] %= (px + 1);
	}

	for (int i = 0; i < n; ++i) {
		int y, p;
		if (x[i] == '1') {
			if (px == 1) {
				cout << 0 << endl;
				continue;
			}
			p = px - 1;
			y = (b[0] - powmod(2, n - 1 - i, p)) % p;
			if (y < 0)
				y += p;
		} else {
			p = px + 1;
			y = (b[1] + powmod(2, n - 1 - i, p)) % p;
		}
		int c = 1;
		while (y) {
			y %= __builtin_popcount(y);
			++c;
		}
		cout << c << endl;
	}
}


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

long long a, b;

long long solve();
bool calc(long long x, long long y);

int main() {
  cin >> a >> b;

  cout << solve() << endl;
  return 0;
}

long long solve() {
  long long ans = 0;
  for(long long i = 0; (1LL << i) <= b; ++i) {
    bool ch = 0;
    if(a - 1 > 0) ch ^= calc(i, a - 1);
    if(b > 0) ch ^= calc(i, b);
    if(ch) ans += 1LL << i;
  }
  return ans;
}

bool calc(long long x, long long y) {
  if(x != 0) {
    long long now = y % (1LL << (x + 1));
    now -= (1LL << x) - 1;
    if(now < 0) now = 0;
    return now % 2;
  }
  long long now = y % 4;
  return now == 1 || now == 2;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
using lint = long long;
#define low lower_bound
#define upp upper_bound
#define rep(i, n) for (lint i = 0; i < lint(n); ++i)
#define Rep(i, n) for (lint i = lint(n); i >= 0; --i)
#define all(vec) (vec).begin(), (vec).end()
#define cend printf("\n");
#define prique(T) priority_queue<T, vector<T>, greater<T>>
#define prique2(T) priority_queue<T>

struct edge { int to; double cost; };
using P = pair<lint, lint>;
using D = pair<double, double>;
using DI = pair<double, int>;
//const lint mod = 998244353LL;
const lint mod = 1000000007LL;
const lint inf = 3LL * mod * mod;

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

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

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

lint inver[1000000]; bool inve[100000];
lint inv(lint x) {
	if (x == 0) return 0;
	else if (inve[x]) return inver[x];
	else {
		inve[x] = true;
		return inver[x] = modpow(x, mod - 2, mod);
	}
}

lint comb(lint n, lint r) {
	if (n < r) return 0;
	if (n == r) return 1;
	lint ans = fact[n] * inv(fact[n - r]) % mod * inv(fact[r]) % mod;
	if (ans < 0) return ans + mod;
	return ans;
}

lint nck[1010][1010];
void comb(lint n) {
	rep(i, n + 1) {
		rep(j, i + 1) {
			if (j == 0 || i == j) nck[i][j] = 1;
			else nck[i][j] = nck[i - 1][j - 1] + nck[i - 1][j];
		}
	}
}

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

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

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

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

double dis(D a, D b) { return sqrt((a.first - b.first) * (a.first - b.first) + (a.second - b.second) * (a.second - b.second)); }

int n, a[100010], b[100010], w;
P p[100010];
int cnt[3][4] = {
	0,1,2,3,
	0,0,1,2,
	0,0,0,1
};
lint ans = 1;
int main() {
	cin >> n;
	rep(i, n) {
		cin >> a[i];
		if (a[i] == 0) {
			p[i] = P(b[0], 0);
		}
		else {
			p[i] = P(b[a[i]], b[a[i] - 1]);
		}
		++b[a[i]];
	}
	rep(i, n) {
		if (a[i] == 0) {
			ans *= (3 - p[i].first);
		}
		else ans *= cnt[p[i].first][p[i].second];
		ans %= mod;
	}
	cout << ans << endl;
}

Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
  int n;
  cin>>n;
  ll a[n+5];
  ll ans=0;

  for(int i=0;i<n;i++)
  {
      cin>>a[i];
  }
  ll tem= a[0];
  for(int i=0;i<n;i++)
  {
      tem= max(a[i],tem);
      ans+= tem-a[i];
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 5172
#include<bits/stdc++.h>
using namespace std;
int ans[100010];
int main(){
	int n;
	scanf("%d",&n);
	int a,b,maxn=0,minn=0x7ffff;
	for(int i=0;i<n;++i){
		cin>>a>>b;
		maxn=max(maxn,b);
		minn=min(minn,a);
		for(int i=a;i<=b;++i)ans[i]=1;
	}
	int cnt=0;
	for(int i=minn;i<=maxn;++i)if(ans[i])++cnt;
	cout<<cnt<<endl;
	return 0;
} 

Measured memory_bytes: 640
n = int(input())
chars = "Xabcdefghijklmnopqrstuvwxyz"  # x番目がほしいときにchars[x-1]としたくないので、chars[0]は使わないことにします

n_rem = n  # 入力を直接操作すると、もし後々必要になったときに面倒なので
res = ""
while True:
  x = n_rem % 26
  if x == 0:
    x = 26
  res += chars[x]
  n_rem -= x
  
  if n_rem == 0:
    break
  n_rem //= 26
print(res[::-1])

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


int main(void) {
	
	char input[20];
	fgets(input, sizeof(input), stdin);
	int n;
	n = atoi(input);
	
	int i;
	int b, f, r, v;
	v = 0;
	int members[4][3][10] = {};
	for (i = 0; i < n; i++){
		fgets(input, sizeof(input), stdin);
		b = atoi(strtok(input, " "));
		f = atoi(strtok(NULL, " "));
		r = atoi(strtok(NULL, " "));
		v = atoi(strtok(NULL, " "));
		
		members[b-1][f-1][r-1] += v;
	}
	
	int j = 0;
	int k = 0;
	for (i = 0; i < 10; i++){
		printf(" %d", members[k][j][i]);
		
		if (i == 9){
			printf("\n");
			i = -1;
			j++;
		}
		
		if (j == 3){
			if (k < 3){
				printf("####################\n");
			}
			j = 0;
			k++;
		}
		
		if (k == 4){
			break;
		}
	}
	
	return 0;
}

Measured memory_bytes: 540
#include<stdio.h>

int main()
{
  int n,max=0,i,b,v,c;
  scanf("%d",&n);
  for(i=0;i<n;i++)
  {
    scanf("%d %d",&b,&v);
    if(max<v||(max==v&&c>b))
    {
      max=v;
      c=b;
    }
  }
  printf("%d %d\n",c,max);
  return 0;
}


Measured memory_bytes: 600
var input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
var obj = {
  "list" : input, "index" : 0, "max" : input.length,
  "hasNext" : function(){return (this.index < this.max);},
  "next" : function(){
    if(!this.hasNext()){throw "NoSuchElementException:次に要素は無いよ";}
    var returnObj = this.list[this.index];
    this.index++;
    return returnObj;
  }
}
Main();
function next(){return obj.next();}
function nextInt(){return myconv(next(),1);}
function nextStrArray(){return myconv(next(),2);}//半角スペース分割
function nextIntArray(){return myconv(next(),4);}//半角スペース + 数値化
function nextCharArray(){return myconv(next(),6);}//1文字分割
function hasNext(){return obj.hasNext();}
function myout(t){console.log(t);}//標準出力
function myerr(t){console.error(t);}//標準エラー出力
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す　1:数値へ変換
//2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字で分割  7:1文字で分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}
function Main(){
  var one = nextIntArray();
  var N = one[0];
  var K = one[1];
  var tmp = Math.ceil(N / 2);
  if(tmp >= K){
     myout("YES");
  }else{
     myout("NO");
  }
}


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

using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	
	int c[3][3], t;
	
	for(int i = 0; i < 3; i++)
		for(int j = 0; j < 3; j++)
			cin >> c[i][j];
			
	for (int i = 1; i < 3; i++)
	{
		t = c[i][0] - c[i - 1][0];
		
		for (int j = 1; j < 3; j++)
		{
			if (t != c[i][j] - c[i - 1][j])
			{
				cout << "No";
				return 0;
			}//if
		}//for j
	}//for i
	
	for (int i = 1; i < 3; i++)
	{
		t = c[0][i] - c[0][i - 1];
		
		for (int j = 1; j < 3; j++)
		{
			if (t != c[j][i] - c[j][i - 1])
			{
				cout << "No";
				return 0;
			}//if
		}//for j
	}//for i
	
	cout << "Yes";
	
	return 0;
}//main


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

#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_CAT_I(x,y) x ## y
//#define CPP_STR(x) CPP_STR_I(x)
//#define CPP_STR_I(args...) #args
//#define ASSERT(expr...) assert((expr))

using i8 = int8_t;
using u8 = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
using f32 = float;
using f64 = double;
//using f80 = __float80;

constexpr i64 INF = 1'010'000'000'000'000'017LL;
constexpr i64 MOD = 1'000'000'007LL;
constexpr f64 EPS = 1e-12;
constexpr f64 PI = 3.14159265358979323846;
constexpr char EL[] = "\n";

#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define all(x) (x).begin(),(x).end()
#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))
#define UNIQUE(x) (x).erase(unique(all(x)), (x).end());
#define REPIT(x) for(auto it=(x).begin(), end=(x).end(); it!=end; ++it)
#define perm(c) sort(all(c)); for(bool c##p=1;c##p;c##p=next_permutation(all(c)))

template<typename T = i64>
T IN() { T x; cin >> x; return (x); }

template<typename C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }
template<typename T, size_t N>
i64 SIZE(const T(&)[N]) { return static_cast<i64>(N); }

template<typename T, typename U, typename Comp = less<>>
bool chmax(T& xmax, const U& x, Comp comp = {}) {
	if (comp(xmax, x)) {
		xmax = x;
		return true;
	}
	return false;
}
template<typename T, typename U, typename Comp = less<>>
bool chmin(T& xmin, const U& x, Comp comp = {}) {
	if (comp(x, xmin)) {
		xmin = x;
		return true;
	}
	return false;
}

void print() {
  cout << EL;
}
template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
  cout << head;
  if (sizeof...(tail) != 0) cout << " ";
  print(forward<Tail>(tail)...);
}
template <class T>
void print(vector<T> &vec) {
  for (auto& a : vec) {
	cout << a;
	if (&a != &vec.back()) cout << " ";
  }
  cout << EL;
}
template <class T>
void print(vector<vector<T>> &df) {
  for (auto& vec : df) {
	print(vec);
  }
}

struct ProconInit {
	static constexpr int IOS_PREC = 15;
	static constexpr bool AUTOFLUSH = false;

	ProconInit() {
		cin.tie(nullptr);
		ios::sync_with_stdio(false);
		cout << fixed << setprecision(IOS_PREC);
		if (AUTOFLUSH)
			cout << unitbuf;
	}
} PROCON_INIT;
#pragma endregion

signed solve()
{
	string s;
	cin >> s;
	REP(i, SIZE(s))
	{
		if ((i % 2 == 0 && s[i] == 'L') ||
		    (i % 2 == 1 && s[i] == 'R'))
		{
			print("No");
			return 0;
		}
	}
	print("Yes");
	return 0;
}

#ifndef LOCALCODE
signed main()
{
	return solve();
}
#endif


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef unsigned long long int ulli;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef pair<int,int> pii;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define YN(x) cout<<(bool x?"Yes":"No")<<endl;
#define out(s) cout<<s<<endl;
#define pb push_back;
#define sp " ";
#define INF 10000000000
void vout(vector<int> v){
    for(int i=0;i<v.size();i++)
    cout<<v.at(i)<<endl;
}
int main(){
    int n;
    lli ans=0;
    cin>>n;
    vector<lli> a;
    rep(i,n){
        lli ai;
        cin>>ai;
        a.push_back(ai);
    }
    sort(a.begin(),a.end());
    ans=a.at(0);
    double check=0;
    rep(i,n){
        check+=log10(a.at(i));
        if(check>18){
            out(-1);
            return 0;
        }

    }
    for(int i=1;i<n;i++){
        ans*=a.at(i);
        if(ans<0||ans>1000000000000000000){
            ans=-1;
            break;
        }
    }
    out(ans);
}

Measured memory_bytes: 4380
#include <iostream>
using namespace std;
int main(void){
    long long int N;
    cin>>N;
    int P[N];
    int Q[N];
    for(int i=0;i<N-1;i++){
        Q[i]=0;
        cin>>P[i];
        Q[P[i]-1]++;
    }
    Q[N-1]=0;
    for(int i=0;i<N;i++){
        cout<<Q[i]<<endl;
    }
}


Measured memory_bytes: 5184
N, M = map(int, input().split())
A = [int(x) for x in input().split()]
A.sort(reverse=True)
sum_A = sum(A)

ans = "Yes"
for i in range(M):
    if A[i] < sum_A / (4 * M):
        ans = "No"
        break

print(ans)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
#define rep(i,m,n) for(int i=m;i<n;i++)
ll mod=1e9+7;

int main(){
  int n;
  string s,t;
  cin>>n>>s>>t;
  int i=0;
  ll ans;
  bool p;
  if(s[0]==t[0]){
    ans=3;
    p=true;
    i++;
  }
  else{
    ans=6;
    p=false;
    i+=2;
  }
  while(i<n){
    if(s[i]==t[i]){
      if(p){
        ans*=2;
        ans%=mod;
      }
      p=true;
      i++;
    }
    else{
      if(p){
        ans*=2;
        ans%=mod;
      }
      else{
        ans*=3;
        ans%=mod;
      }
      p=false;
      i+=2;
    }
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

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

  int x[N], y[M];
  for(int i = 0; i < N; i++) cin >> x[i];
  for(int i = 0; i < M; i++) cin >> y[i];

  for(int Z = X+1; Z <= Y; Z++) {
    int cnt_x = 0, cnt_y = 0;
    for(int i = 0; i < N; i++) {
      if(x[i] < Z) cnt_x++;
    }

    for(int j = 0; j < M; j++) {
      if(y[j] >= Z) cnt_y++;
    }

    if(cnt_x == N && cnt_y == M) {
      cout << "No War" << endl;
      return 0;
    }

  }
  cout << "War" << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <set>
#include <queue>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <climits>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
#include <numeric>
#include <functional>

using namespace std;
#define ALL(x)              (x).begin(),(x).end()
#define REP(i, n)           for (int (i) = 0 ; (i) < (ll)(n) ; ++(i))
#define REPN(i, m, n)       for (int (i) = m ; (i) < (ll)(n) ; ++(i))
#define INF                 (int)2e9
#define MOD                 (1000 * 1000 * 1000 + 7)
#define Ceil(x, n)          (((((x))+((n)-1))/n))
#define CeilN(x, n)         (((((x))+((n)-1))/n)*n)
#define FloorN(x, n)        ((x)-(x)%(n))
#define IsOdd(x)            (((x)&0x01UL) == 0x01UL)
#define IsEven(x)           (!IsOdd((x)))
#define M_PI                3.14159265358979323846
typedef long long           ll;
typedef pair<ll, ll>	    P;
#define fi                  first
#define se                  second

/*-----------------------------------------------------------------------------
　処理
 -----------------------------------------------------------------------------*/
int N;
void dfs(string s, int depth)
{
	if (s.size() == N) {
		cout << s << endl;
	} else {
		for (int i = 0; i <= depth; i++) {
			char addChar = 'a' + i;
			dfs(s + addChar, (i == depth) ? depth + 1 : depth);
		}
	}
}

int main()
{
	cin >> N;
	dfs("a", 1);
	return 0;
}



Measured memory_bytes: 1536
fn read_line() -> String {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim_right().to_owned()
}

trait Integer {
    fn count_digit(&self) -> u32;
    fn is_odd(&self) -> bool;
}

impl Integer for u32 {
    fn count_digit(&self) -> u32 {
        (*self as f32).log10().floor() as u32 + 1_u32
    }
    
    fn is_odd(&self) -> bool {
        (*self) & 1 == 1
    }
}

fn main() {
    let n: u32 = read_line().parse().unwrap();
    
    let count = (1..(n + 1))
        .filter(|&x| x.count_digit().is_odd())
        .count();

    println!("{}", count);
}


Measured memory_bytes: 4604