akhauriyash/Code-Regression huggingface dataset:
//
// Created by ryo on 2019/11/17.
//

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <functional>
#include <queue>
#include <string>
#include <cstring>
#include <numeric>
#include <cstdlib>
#include <cmath>
#include <map>
#include <unordered_map>
#include <set>
using namespace std;

typedef long long ll;

#define INF 10e17
#define rep(i,n) for(long long i=0; i<n; i++)
#define repr(i,n,m) for(long long i=m; i<n; i++)
#define END cout << endl
#define MOD 1000000007
#define pb push_back
#define sorti(x) sort(x.begin(), x.end())
#define sortd(x) sort(x.begin(), x.end(), std::greater<long long>())
#define debug(x) std::cerr << (x) << std::endl;
#define roll(x) for (auto&& itr : x) { debug(itr); }

template <class T> inline void chmax(T &ans, T t) { if (t > ans) ans = t;}
template <class T> inline void chmin(T &ans, T t) { if (t < ans) ans = t;}

const ll MAX = 1000100;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

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

    ll x, y;
    cin >> x >> y;

    COMinit();

    if ((x + y) % 3 != 0) {
        cout << 0 << endl;
    } else {
        ll t = (-x + 2 * y) / 3;
        ll s = (2 * x - y) / 3;

        //    cout << t << " " << s << endl;

        if (t < 0 || s < 0) {
            cout << 0 << endl;
            return 0;
        }

        cout << COM(t + s, t) << endl;
    }

}

// 計算ミスか...

Measured memory_bytes: 23680
# coding: utf-8
# Your code here!

n = int(input())
ta = 0
ha = 0
for i in range(n):
    a, b = list(input().split())
    if a == b:
        ta += 1
        ha += 1
    elif a > b:
        ta += 3
    else:
        ha += 3
print(ta,ha)


Measured memory_bytes: 5600
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n, c, k;
    cin >> n >> c >> k;
    int a[n];
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    sort(a, a + n);
    int i = 0, bus = 0;
    while (i < n)
    {
        int ptr = i + 1;
        while (ptr < (i + c) && ptr < n)
        {
            if (a[ptr] > (a[i] + k))
                break;
            ptr++;
        }
        bus++;
        i = ptr;
    }
    cout << bus << endl;
    return 0;
}

Measured memory_bytes: 640
#include <stdio.h>
#include <string.h>

int main(void){
	int n, q, m, date, flag[50][100], count, i, j, max, idx;
	while(1){
		scanf("%d%d",&n,&q);
		if(n == 0 && q == 0)
			break;
		memset(flag,0,sizeof(flag));
		for(i = 0;i < n;i++){
			scanf("%d",&m);
			for(j = 0;j < m;j++){
				scanf("%d",&date);
				flag[i][date - 1] = 1;
			}
		}
		max = -1;
		for(i = 0;i < 100;i++){
			count = 0;
			for(j = 0;j < n;j++){
				if(flag[j][i])
					count++;
			}
			if(max < count && count >= q){
				max = count;
				idx = i + 1;
			}
		}
		if(max == -1)
			printf("0\n");
		else
			printf("%d\n",idx);
	}
	return 0;
}

Measured memory_bytes: 1068
#include<iostream>
#include<vector>
using namespace std;
const int MAX_N=1e5;

int N;
int color[MAX_N]={};
vector<pair<int,int> > G[MAX_N];

void dfs(int v,int p, int c){
    color[v]=c; //根をcで塗る
    
    for(auto& it : G[v]){
        if(it.first==p) continue;//親に向かわない
        if(it.second%2==0) dfs(it.first,v,c);
        if(it.second%2!=0) dfs(it.first,v,1-c);
    }
}

int main(){
    cin >> N;
    for(int i=0;i<N-1;i++){
        int u,v,w;
        cin >> u >> v >> w;
        u--;v--;
        G[u].push_back(make_pair(v,w));
        G[v].push_back(make_pair(u,w)); //無向グラフ
    }
    dfs(0,-1,1);
    for(int i=0;i<N;i++){
        cout << color[i] << endl;
    }
}

Measured memory_bytes: 9088
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define ppb pop_back
#define pii pair<int, int> 
#define pll pair<long , long>
#define all(a) a.begin(), a.end()
#define int long long
#define ll long long
#define mod 998244353
#define endl "\n"
//#define int long long
#define loop(i,a,b) for(int i=a;i<b;i++)
#define bloop(i,a,b) for(int i=a;i>=b;i--)

using namespace std;


int32_t main() {
	//code
	int t=1;
	// cin>>t;
	while(t--)
	{
        int a,b,c,d,p1=0,p2=0;
        cin>>a>>b>>c>>d;
        while(true)
        {
             c=c-b;
            if(c<=0) {p2=1;break;}
            a=a-d;
            if(a<=0) {p1=1;break;}           
        }
        if(p1==0 || p2==1) cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
	    
	}
	return 0;
	
}

Measured memory_bytes: 3592
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();

        String result = ":(";
        if (a <= 8 && b <= 8) result = "Yay!";
      
        System.out.println(result);
    }
}


Measured memory_bytes: 35836
H,W = list(map(int,input().split()))

c=[]
for i in range(10):
    c.append(list(map(int,input().split())))
A=[]
for i in range(H):
    A.append(list(map(int,input().split())))


for i in range(10):
    for j in range(10):
        for k in range(10):
            c[j][k] = min(c[j][k], c[j][i]+c[i][k])
res=0
for i in range(H):
    for j in range(W):
        if(A[i][j]>=0):
            res+=c[A[i][j]][1]
print(res)


Measured memory_bytes: 3444
/**
 *      purpose : ABC 104 C
 *      author  : kyomukyomupurin
 *      created : 2018-10-21 21:42:52
**/

#include <bits/stdc++.h>
using namespace std;
#define int64 long long

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int D, G; cin >> D >> G;
    int p[D] = {}; int c[D] = {};
    for (int i = 0; i < D; ++i) cin >> p[i] >> c[i];
    int ans = 1e9;

    for (int bit = 0; bit < (1<<D); ++bit) {
        int sum = 0; int cnt = 0;
        for (int i = 0; i < D; ++i) {
            if (bit & (1<<i)){
                sum += c[i] + (i + 1) * 100 * p[i];
                cnt += p[i];
            }
        }

        for (int i = D - 1; i >= 0; --i){
            if (!(bit & (1<<i))){
                int pp = 0;
                while (pp < p[i] && sum < G){
                    sum += 100 * (i + 1); ++pp; ++cnt;
                }
            }
        }
        if (sum >= G) ans = min(ans, cnt);
    }
    cout << ans << '\n';
    
    return 0;
}

Measured memory_bytes: 256
case class Adj(u: Int, k: Int, vs: Seq[Int]) {
  def convertToMat(n: Int): Seq[Int] = gen(1, n, vs, Nil)

  def print(n: Int): Unit = println(convertToMat(n).mkString(" "))

  private def gen(i: Int, n: Int, vs: Seq[Int], line: Seq[Int]): Seq[Int] = {
    if (i > n) {
      line
    } else if(vs.headOption.contains(i)) {
      gen(i + 1, n, vs.tail, line :+ 1)
    } else {
      gen(i + 1, n, vs, line :+ 0)
    }
  }
}

object Adj {
  def apply(line: String): Adj = {
    val input = line.split(' ')
    Adj(input(0).toInt, input(1).toInt, input.drop(2).map(_.toInt))
  }
}

object Main extends App {
  private val lines = io.Source.stdin.getLines.toSeq
  private val n = lines.head.toInt

  lines.tail.foreach(Adj(_).print(n))
}

Measured memory_bytes: 61676
import numpy as np
A = int(input())
B = int(input())
C = int(input())
X = int(input())
count = 0
coin = np.array([500,100,50])
for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      if a + b + c == 0:
        continue
      else:
        if X == coin.dot(np.array([a,b,c])):
            count += 1
print(count)


Measured memory_bytes: 12396
from operator import itemgetter
n,m = map(int,input().split())
ab = []
for i in range(0,m):
    aa,bb = map(int,input().split())
    ab.append((aa,bb))
ab.sort(key=itemgetter(1))
ans = 0
last = 0
for i in range(0,m):
    s,t = ab[i]
    if last <= s:
        ans += 1
        last = t
print(ans)


Measured memory_bytes: 18212
using System;
using System.Collections.Generic;
using System.Linq;

namespace CSharpSample01
{
    

    class Program
    {

        const int INF = 1000000000;

        static int Solve(int N, int[] h)
        {
            int[] dp = new int[N];
            dp[0] = 0;
            for (int i = 1; i < N; i++) dp[i] = INF;
            
            for(int i = 1; i < N; i++)
            {
                if (i - 2 >= 0) dp[i] = Math.Min(dp[i], dp[i - 2] + Math.Abs(h[i] - h[i - 2]));
                dp[i] = Math.Min(dp[i], dp[i - 1] + Math.Abs(h[i] - h[i - 1]));
            }

            return dp[N - 1];
        }

        

        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            int[] h = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();

            Console.WriteLine(Solve(N, h));
            
        }
    }
}

Measured memory_bytes: 20064
import java.util.*;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int[] a = new int[17];
		int[] out = new int[101];
		int[] time = new int[]{19,39,25,36,22,42};
		ArrayList<Integer> wait = new ArrayList<Integer>();
		Arrays.fill(a, -1);
		int p, q;
		boolean flag;
		boolean check;
		for(int i=0;i<567;i++){
			for(int j=0;j<17;j++){
				if(a[j]==i) a[j] = -1;
			}
			if(i%5==0) wait.add(i/5);
			while(wait.size()!=0){
				check = false;
				p = wait.get(0);
				q = 2;
				if(p%5==1) q = 5;
				
				for(int j=0;j<18-q;j++){
					flag = true;
					for(int k=0;k<q;k++){
						if(a[j+k]!=-1) flag = false;
					}
					if(flag==true){
						out[p] = i+time[p%6];
						for(int k=0;k<q;k++) a[j+k] = out[p];
						check = true;
						wait.remove(0);
						break;
					}
				}
				if(check==false) break;
			}
		}

		
		while(sc.hasNext()){
			int n = sc.nextInt();
			System.out.println(out[n]- time[n%6] - n*5);
		}	
	}	
}

Measured memory_bytes: 18528
#include<bits/stdc++.h>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long
#define inf 2000000000
#define infLL 2000000000000000000
#define MAX 100005
#define sf(a) scanf("%d", &a)
#define sfl(a) scanf("%lld", &a)
#define pf(a) printf("%d ", a)
#define pfl(a) printf("%lld\n", a)
#define Case(t) printf("Case %d: ", t)
#define pii pair<int, int>
#define MOD 1000000007
#define mod 998244353
#define PI acos(-1.0)
#define eps 1e-9
#define mem(a, b) memset(a, b, sizeof(a))
#define FASTIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);

#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }

inline int Set(int N, int pos){return N=N | (1<<pos);}
inline int Reset(int N, int pos){return N=N & ~(1<<pos);}
inline bool Check(int N, int pos){return (bool)(N & (1<<pos));}

inline void normal(ll &a) { a %= mod; (a < 0) && (a += mod); }
inline ll modMul(ll a, ll b) { a %= mod, b %= mod; normal(a), normal(b); return (a * b) % mod; }
inline ll modAdd(ll a, ll b) { a %= mod, b %= mod; normal(a), normal(b); return (a + b) % mod; }
inline ll modSub(ll a, ll b) { a %= mod, b %= mod; normal(a), normal(b); a -= b; normal(a); return a; }
inline ll modPow(ll b, ll p) { ll r = 1; while (p) { if (p & 1LL) r = modMul(r, b); b = modMul(b, b); p >>= 1LL; } return r; }
inline ll modInverse(ll a) { return modPow(a, mod - 2); }
inline ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }

ll fast_exp(ll x, ll n, ll m)
{
    ll res = 1;
    while(n>0)
    {
        if(n%2==1)
            res = (res * x) % m;
        x = (x * x) % m;
        n/=2;
    }
    return res%m;
}

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args)
{
    cerr << *it << " = " << a << endl;
    err(++it, args...);
}

clock_t t_Start;
void Start()
{
    t_Start = clock();
}
void End()
{
    double Time = (double)(clock()-t_Start)/CLOCKS_PER_SEC;
    error(Time);
}

typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>orderedSet;
typedef tree<int,null_type,greater<int>,rb_tree_tag,tree_order_statistics_node_update>orderedSet1;

int main()
{
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    //Start();

    int n;
    cin>>n;
    vector<ll>a(n+1);
    map<ll, ll>mp, lil;
    for(int i = 0; i < n; i++)
    {
        cin>>a[i];
        mp[a[i]]++;
    }
    ll sum = 0;
    for(int i = 1; i <= n; i++)
    {
        ll tot = mp[i];
        lil[i] = (tot * (tot-1LL))/2LL;
        sum+=lil[i];
    }
    for(int i = 0; i < n; i++)
    {
        ll tot = mp[a[i]];
        ll val = ((tot-1LL) * (tot-2LL))/2LL;
        cout<<sum-lil[a[i]]+val<<endl;
    }

    //End();
    return 0;
}


Measured memory_bytes: 29184
#include <stdio.h>
#include <math.h>
int main(void){
	char c[2];
	int fr[1000][1000],n,i,j,k,ans;
	while(scanf("%d",&n)){
		if(n==0)break;
		ans=0;
		for(i=0;i<n;i++){
			k=0;
			for(j=0;j<n;j++){
				scanf("%1s",&c);
				if(c[0]=='.'){fr[i][j]=++k;if(fr[i][j]>ans)ans=fr[i][j];}else{k=0;fr[i][j]=0;}
			}
		}
		if(ans<2){printf("%d\n",ans);continue;}

		ans=0;
		for(j=0;j<n;j++){
			k=0;
			for(i=n-1;i>=0;i--){
				if(fr[i][j]){if(++k<fr[i][j])fr[i][j]=k;if(fr[i][j]>ans)ans=fr[i][j];}else{if(ans<k)ans=k;k=0;}
			}
		}
		if(ans<2){printf("%d\n",ans);continue;}

		ans=0;
		for(i=n-2;i>=0;i--){
			for(j=1;j<n;j++){
				if(fr[i][j]>fr[i+1][j-1]){
					fr[i][j]=fr[i+1][j-1]+1;
					if(fr[i][j]>ans)ans=fr[i][j];
				}
			}
		}
		printf("%d\n",ans);
	}
	return 0;
}

Measured memory_bytes: 4504
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
// const ll INF = 1e18;
//const ll MOD = 1e9+7;
//const double pi = 3.14159265358979;
using vl = vector<ll>;
# define rep(i, n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
# define reps(i, n) for(ll i=1, i##_len=(n); i<=i##_len; ++i)
# define rrep(i, n) for(ll i=((int)(n)-1); i>=0; --i)
# define rreps(i, n) for(ll i=((int)(n)); i>0; --i)
# define all(x) (x).begin(), (x).end()

ll N,M,Q;

vector<vl> v;
vl history;

void dfs(ll dep, ll x) {
    if (dep == N) {
        v.push_back(history);
        return;
    } else {
        for(ll i=x; i<=M; i++) {
            history[dep] = i;
            dfs(dep+1, i);
        }
    }
}

int Main() {
    cin >> N >> M >> Q;
    vl a(Q);
    vl b(Q);
    vl c(Q);
    vl d(Q);

    rep(i,Q) {
        cin >> a[i];
        cin >> b[i];
        cin >> c[i];
        cin >> d[i];
    }
    
    history.resize(N);
    dfs(0,1);
//
//    for (auto &e: v) {
//        for (auto u: e) {
//            cout << u << " ";
//        }
//        cout << endl;
//    }
//
    ll ans = 0;
    for (auto &e: v) {
        ll sum = 0;
        rep(i, Q) {
            if (e[b[i]-1]- e[a[i]-1] == c[i]) {
                sum += d[i];
            }
        }
        ans = max(ans, sum);
    }
    
    cout << ans << endl;
    
    return 0;
}

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


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

typedef long long ll;

static const int SIZE = (1 << 16);

int n, bit[102];
ll l[102], dp[102][SIZE + 2];

void solve(){
  memset(dp, -1, sizeof(dp));
  dp[0][0] = 0;

  for(int i = 0; i < n; i++){
    for(int j = 0; j < SIZE; j++){
      if(dp[i][j] == -1) continue;

      if((j & bit[i]) == 0){
        int cal = (j | bit[i]);
        dp[i + 1][cal] = max(dp[i + 1][cal], dp[i][j] + l[i]);
      }
      dp[i + 1][j] = max(dp[i + 1][j], dp[i][j]);
    }
  }

  ll res = 0;

  for(int j = 0; j < SIZE; j++){
    res = max(res, dp[n][j]);
  }

  cout<< res << endl;
}

int main(){
  while(cin >> n, n){
    for(int i = 0; i < n; i++){
      int m;
      cin >> m >> l[i];
      bit[i] = 0;

      for(int j = 0; j < m; j++){
        int s, e;
        cin >> s >> e;
        for(int k = s - 6; k < e - 6; k++){
          bit[i] |= (1 << k);
        }
      }
    }

    solve();
  }
}

Measured memory_bytes: 51000
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 1e9+7,MAX = 1e5;

int main()
{
	ll n;
	cin >> n;
	vector<ll> a(n);
	for(int i =0;i<n;i++)
	{
		cin >> a[i];
	}
	ll buff = 1;
	ll ans = 0;
	for(int i = 0;i<60;i++)
	{
		ll cnt0=0,cnt1 =0;
		for(int j=0;j<n;j++)
		{
			(a[j]&1?cnt1:cnt0)++;
			a[j]/=2;
		}
		ans = (ans + (cnt0*cnt1)%MOD*buff%MOD)%MOD;
		buff*=2;
		buff%=MOD;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 2560
{
  type Print = void | string | number | string[] | number[];
  const outs: Print[] = [];
  const _io = (i = 0) => {
    // eslint-disable-next-line @typescript-eslint/no-var-requires
    const str = require("fs").readFileSync("/dev/stdin", "utf8");
    const lines = str.trim().split("\n");
    const s = () => lines[i++] || "";
    const n = () => Number(s());

    const mn = (v: string[]) => v.map(Number);
    const sp = (v: string) => v.split(" ");

    const ss = () => sp(s());
    const nn = () => mn(ss());
    const nls = () => mn(lines.slice(i));
    const nnls = () => lines.slice(i).map((v: string) => mn(sp(v)));

    return { lines, s, n, ss, nn, nls, nnls };
  };
  const main = (): Print => {
    const r = _io();
    const length = r.lines[0];
    const text = r.lines[1];
    // 以下入れ替え
    return checkDoubleString(length, text);
  };

  /**
   * check double of  a string
   *
   * @param length - the string length
   * @param text - the string
   * @returns "Yes" or "No"
   *
   */
  const checkDoubleString = (length: number, text: string): string => {
    // 奇数なら繰り返しできない
    if (length % 2 !== 0) {
      return "No";
    } else {
      const [frontText, backText] = [
        text.substr(0, length / 2),
        text.substr(length / 2, length / 2),
      ];
      if (frontText === backText) {
        return "Yes";
      }
      return "No";
    }
  };

  outs.push(main());

  console.log(
    outs
      .map((line) => (typeof line === "object" ? line.join(" ") : String(line)))
      .join("\n")
  );
}


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

#define F first
#define S second
#define MP make_pair
#define PB emplace_back

using namespace std;

const int N = 1e5+100, D = 110;

long long int dp[N][D], mod = 1e9+7, d, pr[N];

int ok2(int x) {
    x%=mod;
    x+=mod;
    return x%mod;
}

int ok(int x) {
    x%=d;
    x+=d;
    return x%d;
}

int main () {
    string s;
    cin >> s;
    cin >> d;
    dp[0][0]=1;
    for(int i = 1 ; i <= s.size() ; i++ ) {
        for(int j = 0 ; j < d ; j++ ) {
            for(int k = 0 ; k < 10 ; k++ ) {
                dp[i][j]+=dp[i-1][ok(j-k)];
                dp[i][j]%=mod;
            }
        }
    }
    reverse(s.begin(),s.end());
    long long int car=0, ans=0;
    for(int i = s.size()-1 ; i >= 0 ; i--) {
        for(int j = 0 ; j < s[i]-'0' ; j++) {
            ans+=dp[i][ok(d-j-car)];
            ans%=mod;
        }
        car+=s[i]-'0';
        car%=mod;
    }
    cout << ok2(ans-1+(car%d==0));
}


Measured memory_bytes: 9728
#include <stdio.h>

int main(){
	int n,m,i,a,res;
	int sum=0;
	
	scanf("%d%d",&n,&m);
	
	for(i=0;i<m;++i){
		scanf("%d",&a);
		sum+=a;
	}
	res = n - sum;
	if(res>=0){
		printf("%d\n",res);
	}else{
		puts("-1");
	}
	
	return 0;
}

Measured memory_bytes: 1704
#include <iostream>
#include <vector>
#include <string>
#include <tuple>
#include <algorithm>
using namespace std;


int main() {
	string S;

	cin >> S;

	bool easy = true;
	for (int i=0; i<S.size()-1; i++) {
		if(S.at(i) == S.at(i+1)) {
			easy = false;
			break;
		}
	}

	if(easy) cout << "Good";
	else     cout << "Bad";



}

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

#define DT_MAX (10000)

int data[DT_MAX];
int out_data[DT_MAX];
int out_data_num;

int main()
{
	int n,i,k,flg;
	char buff[8192];
	double cnt;

	out_data_num = 0;
	gets(buff);
	sscanf(buff,"%d",&n);

	for (i=0 ; i<n ; i++) {
		gets(buff);
		sscanf(buff,"%d",&(data[i]));

	}

	for (i=0 ; i<n ; i++) {
		if (data[i] == 2) {
			out_data[out_data_num] = data[i];
			out_data_num++;
			continue;
		}
		if ((data[i] < 2)||((data[i] % 2)==0)) {
			continue;
		}

		cnt = (int)sqrt((double)data[i]);
		for (flg=1,k=3 ; k<cnt+1 ; k+=2) {
			if ((data[i] % (k))==0) {
				flg=0;
				break;
			}
		}
		if (flg==1) {
			out_data[out_data_num] = data[i];
			out_data_num++;
		}
	}


	printf("%d\n",out_data_num);
	return 0;
}

Measured memory_bytes: 644
//BELIEVE IN YOURSELF
//next_permutation

#include<bits/stdc++.h>
#define ll long long int
#define ld long double
#define pb push_back
#define pob pop_back
#define vi vector<ll>
#define mp make_pair
#define rep1(i,n) for(ll i=1;i<=n;i++)
#define rep(i,n) for(ll i=0;i<n;i++)
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define maxx 100005
#define se second
#define fi first
#define be begin()
#define en end()
#define sortv(v) sort(v.begin(),v.end());
#define w() ll _;cin>>_;while(_--)
#define edge pair<ll,ll>
#define pq priority_queue<ll>
#define mod 1000000007
#define Endl "\n"
#define cy cout<<"YES"<<endl;
#define cn cout<<"NO"<<endl;
#define lb(v,x) std::lower_bound(v.begin(),v.end(),x)
#define ub(v,x) std::upper_bound(v.begin(),v.end(),x)

using namespace std;


     
int main()
{
	fast;
		ll d,t,s;
		cin>>d>>t>>s;
		if(t*s>=d)
		{
			cout<<"Yes"<<endl;
		}
		else
		{
			cout<<"No"<<endl;
		}
	return 0;
}
     
     
     
     
     
     
     
     
     
     
     
     

Measured memory_bytes: 3648
// 特殊な剰余と原始根
// (924844033, 5)
// (998244353, 3)
// (1012924417, 5)
// (167772161, 3)
// (469762049, 3)
// (1224736769, 3)
#include <bits/stdc++.h>
using namespace std;

const int MOD = 998244353;
const int root = 3;

unsigned int add(const unsigned int x, const unsigned int y) { return (x + y < MOD) ? x + y : x + y - MOD; }

unsigned int sub(const unsigned int x, const unsigned int y) { return (x >= y) ? (x - y) : (MOD - y + x); }

unsigned int mul(const unsigned int x, const unsigned int y) { return (unsigned long long)x * y % MOD; }

unsigned int mod_pow(unsigned int x, unsigned int n) {
	unsigned int res = 1;
	while(n > 0) {
		if(n & 1) {
			res = mul(res, x);
		}
		x = mul(x, x);
		n >>= 1;
	}
	return res;
}

unsigned int inverse(const unsigned int x) { return mod_pow(x, MOD - 2); }

void ntt(vector<int>& a, const bool rev = false) {
	unsigned int i, j, k, l, p, q, r, s;
	const unsigned int size = a.size();
	if(size == 1) return;
	vector<int> b(size);
	r = rev ? (MOD - 1 - (MOD - 1) / size) : (MOD - 1) / size;
	s = mod_pow(root, r);
	vector<unsigned int> kp(size / 2 + 1, 1);
	for(i = 0; i < size / 2; ++i) kp[i + 1] = mul(kp[i], s);
	for(i = 1, l = size / 2; i < size; i <<= 1, l >>= 1) {
		for(j = 0, r = 0; j < l; ++j, r += i) {
			for(k = 0, s = kp[i * j]; k < i; ++k) {
				p = a[k + r], q = a[k + r + size / 2];
				b[k + 2 * r] = add(p, q);
				b[k + 2 * r + i] = mul(sub(p, q), s);
			}
		}
		swap(a, b);
	}
	if(rev) {
		s = inverse(size);
		for(i = 0; i < size; i++) {
			a[i] = mul(a[i], s);
		}
	}
}

vector<int> convolute(const vector<int>& a, const vector<int>& b) {
	const int size = (int)a.size() + (int)b.size() - 1;
	int t = 1;
	while(t < size) {
		t <<= 1;
	}
	vector<int> A(t, 0), B(t, 0);
	for(int i = 0; i < (int)a.size(); i++) {
		A[i] = a[i];
	}
	for(int i = 0; i < (int)b.size(); i++) {
		B[i] = b[i];
	}
	ntt(A), ntt(B);
	for(int i = 0; i < t; i++) {
		A[i] = mul(A[i], B[i]);
	}
	ntt(A, true);
	A.resize(size);
	return A;
}

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

	vector<int> a(n), b(m);

	for(int i = 0; i < n; i++) cin >> a[i];
	for(int i = 0; i < m; i++) {
		cin >> b[i];
	}
	auto c = convolute(a, b);
	for(int i = 0; i < n + m - 1; i++) {
		cout << c[i] << " ";
	}
}

Measured memory_bytes: 25212
/**
 *    Author: SULTAN AHMED
**/
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,sum=0;
    int a[50],b[50],c[50];
    scanf("%d",&n);
    for(int i=0;i<n;i++)scanf("%d",&a[i]);
    for(int i=0;i<n;i++)scanf("%d",&b[i]);
    for(int i=0;i<n-1;i++)scanf("%d",&c[i]);
    sum += b[a[0]-1];
    for(int i=1;i<n;i++)
    {
        sum+=b[a[i]-1];
        if(a[i]-1==a[i-1])sum+=c[a[i-1]-1];
    }
    printf("%d\n",sum);
    return 0;
}


Measured memory_bytes: 256
using System;
using System.Linq;

namespace ABC146
{
    class A
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            string S = Console.ReadLine();

            for (int i = 0; i < S.Length; i++)
            {
                if ('Z' < S[i] + N)
                {
                    Console.Write((char)(S[i] + N - 26));
                }
                else
                {
                    Console.Write((char)(S[i] + N));
                }
            }
            Console.WriteLine();
        }
    }
}


Measured memory_bytes: 13212
#include<stdio.h>

int main()
{
  int A[100], N, i, sw;

  scanf("%d",&N);
  for(i = 0 ; i < N ; i++)
    {
      scanf("%d",&A[i]);
    }
  
  sw = selectionSort(A,N);

  for(i = 0 ; i < N ; i++)
    {
      if(i > 0)
	{
	  printf(" ");
	}
      printf("%d",A[i]);
    }

  printf("\n");
  printf("%d\n",sw);

  return 0;
}

int selectionSort(int A[], int N)
{
  int i, j, temp, sw = 0, minj;

  for(i = 0 ; i < N - 1 ; i++)
    {
      minj = i;
      
      for(j = i ; j < N ; j++)
	{
	  if(A[j] < A[minj])
	    {
	      minj = j;
	    }
	}
      
      temp = A[i];
      A[i] = A[minj];
      A[minj] = temp;

      if(i != minj)
	{
	  sw++;
	}
    }
  return sw;
}

    


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


int main() {
    long long h, n;

    std::cin>>h>>n;

    std::vector<std::pair<long long, long long>> ab(n);
    for(auto& abab : ab) {
        std::cin>>abab.first>>abab.second;
    }

    std::vector<std::vector<int>> vv(n + 1, std::vector<int>(h + 1));
    for(int i = 0; i <= h; ++i) {
        vv[0][i] = std::numeric_limits<int>::max();
    }
    for(int i = 0; i <= n; ++i) {
        vv[i][0] = 0;
    }

    for(int i = 1; i <= n; ++i) {
        const auto& a = ab[i - 1].first;
        const auto& b = ab[i - 1].second;
        for(int j = 1; j <= h; ++j) {
            vv[i][j] = std::min<int>(
                    vv[i - 1][j],
                    b + (((j - a) <= 0) ? 0 : (vv[i][j - a]))
            );
        }
    }
    std::cout<<vv[n][h]<<std::endl;
}



Measured memory_bytes: 39424
#include<iostream>
#include<vector>
#include<queue>

using namespace std;

int main(){
	while(1){
		int ans = 0;
		int n; cin >> n;
		if (n == 0) break;
		for (int i = 1; i < n; i++){
			int sum = 0;
			for (int j = i; j < n; j++){
				sum += j;
				if (sum == n){
					ans++;
					break;
				}else if (sum > n){
					break;
				}
			}
		}
		cout << ans << endl;
	}
return 0;
}

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

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

using namespace __gnu_pbds;
using namespace std;

#define sint int32_t
#define int long long int
#define all(v) v.begin() , v.end()
#define vii vector<int>
#define pb push_back
#define pii pair<int,int>
#define F first
#define S second
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

int32_t main()
{   fastio;

    int n , x , t;
    cin>>n>>x>>t;
    cout<<(sint)ceil(n/float(x))*t<<"\n";
}



Measured memory_bytes: 3588
#include<iostream>

//関数の宣言
int func(int ans);

int main(){
	
	int a;
	int b;
	int ans;
	int truss;

	while (std::cin >> a >> b){
		
		ans = a + b;

		truss = func(ans);

		std::cout << truss << std::endl;
	}
}

//関数の定義
int func(int ans){
	if (0 <= ans&&ans <= 9){
		return 1;
	}
	else if (10 <= ans&&ans <= 99){
		return 2;
	}
	else if (100 <= ans&&ans <= 999){
		return 3;
	}
	else if (1000 <= ans&&ans <= 9999){
		return 4;
	}
	else if (10000 <= ans&&ans <= 99999){
		return 5;
	}
	else if (100000 <= ans&&ans <= 999999){
		return 6;
	}
	else if (1000000 <= ans&&ans <= 9999999){
		return 7;
	}
}


Measured memory_bytes: 3056
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long int
#define pii 3.14
#define mod (ll)(1e9 + 7)
#define inf (ll)(1e18)
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ordered_set tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update>
#define pi pair<int,int>
#define N (ll)(2e5+5)

void solve()
{
    ll a,b,c,k;
    cin>>a>>b>>c>>k;

    ll ans = min(k,a);
    k-=ans;
    k-=b;
    if(k>0)
        ans -= k;
    cout<<ans;
}

int main()
{
    fio;
    ll tc = 1;
    //cin>>tc;

    while(tc--)
    {
        solve();
    }
}


Measured memory_bytes: 3620
import math
from functools import reduce
import fractions

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)



n = int(input())

l = list(map(int, input().split()))

lcm = lcm_list(l)
a = lcm-1
mod_all = 0

for i in l:
    mod_all += a%i

print(mod_all)


Measured memory_bytes: 5332
/* Dsingh_24 */

#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define	endl		'\n'
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define hell        1000000007
#define rep(i,a,b)	for(ll int i=a;i<b;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define ios	    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;

#define N  100005

int main()
{
	ios
	ll n,a,b,c,d,i,j;
	cin>>n>>a>>b>>c>>d;a--,b--,c--,d--;
	string s;
	cin>>s;
	ll f=0;
	if(d>c)f=1;
	for(i=b;i<=d;i++)
		if(s[i]=='.'&&s[i+1]=='.'&&s[i-1]=='.')f=1;
	i=b;
	while(i<d){
		if(s[i+1]=='.')i++;else
		if(s[i+2]=='.')i+=2;else{
			cout<<"No";return 0;
		}
	}
	i=a;
	while(i<c){
		if(s[i+1]=='.')i++;else
		if(s[i+2]=='.')i+=2;else{
			cout<<"No";return 0;
		}
	}
	if(f)cout<<"Yes";else cout<<"No";
	return 0;
}

Measured memory_bytes: 592
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <bitset>
#include <string>
#include <cmath>
#include <complex>
#include <numeric>
#include <cassert>

#include <vector>
#include <array>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <utility>

#define PI 3.14159265358979323846
#define int64 long long
#define uint64 unsigned long long
#define coutfix(i) cout << fixed << setprecision(i)		//coutの浮動小数出力の桁数設定
using namespace std;

int main()
{
	int64 nn, aa, bb;
	cin >> nn >> aa >> bb;
	if((bb - aa) % 2 == 0)
	{
		cout << ((bb - aa) / 2) << endl;
	}
	else
	{
		cout << (min(aa - 1, nn - bb) + 1 + (bb - aa - 1) / 2) << endl;
	}
	return 0;
}

Measured memory_bytes: 3576
namespace AGC038.A
{
    using System;
    using System.Text;
    using static System.Console;
    using System.Collections.Generic;
    using System.Linq;

    public static class Ext
    {
        public static string JoinToZeroOne(this IEnumerable<bool> v)
        {
            StringBuilder stringBuilder = new StringBuilder();

            foreach (var item in v)
            {
                stringBuilder.Append(item ? "1" : "0");
            }
            return stringBuilder.ToString();
        }
    }

    class Program
    {
        static void Main(string[] args)
        {
            var l = ReadInputsAsInt();
            var H = l[0];
            var W = l[1];
            var A = l[2];
            var B = l[3];


            var result = Solve(H, W, A, B);

            Write(
                string.Join("\n", result.Select(i => i.JoinToZeroOne()))
                + "\n");
        }


        public static List<List<bool>> Solve(int h, int w, int a, int b)
        {
            var m = Enumerable.Repeat(Enumerable.Repeat(false, w).ToList(), h).Select(l => new List<bool>(l)).ToList();

            WriteRows(m, b);
            WriteColumns(m, a);
            return m;
        }
        static List<int> ReadInputsAsInt() => ReadLine().Split(' ').Select(x => int.Parse(x)).ToList();

        static void WriteRows(List<List<bool>> matrix, int rowCount)
        {
            for (int i = 0; i < rowCount; i++)
            {
                for (int j = 0; j < matrix[0].Count; j++)
                {
                    matrix[i][j] = !matrix[i][j];
                }
            }
        }

        static void WriteColumns(List<List<bool>> matrix, int columnCount)
        {
            for (int i = 0; i < matrix.Count; i++)
            {
                for (int j = 0; j < columnCount; j++)
                {
                    matrix[i][j] = !matrix[i][j];
                }
            }
        }
    }
}


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

using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using vint = vector<int>;
using vll = vector<ll>;
template<typename T> using uset = unordered_set<T>;
template<typename T1, typename T2> using umap = unordered_map<T1, T2>;

constexpr int INF = (1 << 30) - 1;
constexpr ll LLINF = 1LL << 60;
constexpr int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
constexpr int dx[] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr char el = '\n';
constexpr int mod = 1000000007;

template<typename T> T gcd(T a, T b) { return (b ? gcd(b, a % b) : a); }
template<typename T> T lcm(T a, T b) { return (a / gcd(a, b) * b); }
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }

int N, M, Q;
vector<vint> G(100005);
int color[100005] = {};
int size[100005] = {};
void bfs(int s, int d, int c) {
        if (size[s] >= d) return;
        queue<int> que;
        que.push(s);
        size[s] = d;
        if (color[s] == 0) color[s] = c;
        while (!que.empty()) {
                int v = que.front(); que.pop();
                for (auto &u : G[v]) {
                        int nd = size[v] - 1;
                        if (size[u] >= nd) continue;
                        size[u] = nd;
                        if (color[u] == 0) color[u] = c;
                        que.push(u);
                }
        }
}

int main() {
        cin >> N >> M;
        for (int i = 0; i < M; i++) {
                int a, b;
                cin >> a >> b; --a, --b;
                G[a].push_back(b);
                G[b].push_back(a);
        }
        cin >> Q;
        vint v(Q), d(Q), c(Q);
        for (int i = Q - 1; i >= 0; i--) {
                cin >> v[i] >> d[i] >> c[i]; --v[i];
        }

        for (int i = 0; i < Q; i++) {
                bfs(v[i], d[i] + 1, c[i]);
        }
        for (int i = 0; i < N; i++) {
                cout << color[i] << el;
        }
        return (0);
}

Measured memory_bytes: 8824
from sys import stdin, stdout
from collections import defaultdict
import math
from queue import Queue

n, m = map(int, stdin.readline().strip().split())
arr = list(map(int, stdin.readline().strip().split()))

threshold = 1 / (4 * m) * sum(arr)

arr = sorted(arr, reverse=True)

if arr[m - 1] >= threshold:
    stdout.writelines('Yes\n')
else:
    stdout.writelines('No\n')

Measured memory_bytes: 38384
import java.io.*;
import java.util.*;

public class Main {
    static ContestScanner in;
    static Writer out;
    public static void main(String[] args) {
        Main main = new Main();
        try {
            in = new ContestScanner();
            out = new Writer();
            main.solve();
            out.close();
            in.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    void solve() throws IOException {
        char[] s = in.nextToken().toCharArray();
        for (int i = 0; i < s.length / 2; i++) {
            if(s[i] != s[s.length - 1 - i]) {
                System.out.println("No");
                return;
            }
        }
        System.out.println("Yes");
    }
}

@SuppressWarnings("serial")
class MultiSet<T> extends HashMap<T, Long>{
    @Override public Long get(Object key){return containsKey(key)?super.get(key):0L;}
    public void add(T key,long v){put(key,get(key)+v);}
    public void add(T key){put(key,get(key)+1);}
    public void sub(T key){final long v=get(key);if(v==1)remove(key);else put(key,v-1);}
    public MultiSet<T> merge(MultiSet<T> set)
    {MultiSet<T>s,l;if(this.size()<set.size()){s=this;l=set;}else{s=set;l=this;}
        for(Entry<T,Long>e:s.entrySet())l.add(e.getKey(),e.getValue());return l;}
}

class Writer extends PrintWriter{
    public Writer(String filename)throws IOException
    {super(new BufferedWriter(new FileWriter(filename)));}
    public Writer()throws IOException{super(System.out);}
}
class ContestScanner implements Closeable{
    private BufferedReader in;private int c=-2;
    public ContestScanner()throws IOException
    {in=new BufferedReader(new InputStreamReader(System.in));}
    public ContestScanner(String filename)throws IOException
    {in=new BufferedReader(new InputStreamReader(new FileInputStream(filename)));}
    public String nextToken()throws IOException {
        StringBuilder sb=new StringBuilder();
        while((c=in.read())!=-1&&Character.isWhitespace(c));
        while(c!=-1&&!Character.isWhitespace(c)){sb.append((char)c);c=in.read();}
        return sb.toString();
    }
    public String readLine()throws IOException{
        StringBuilder sb=new StringBuilder();if(c==-2)c=in.read();
        while(c!=-1&&c!='\n'&&c!='\r'){sb.append((char)c);c=in.read();}
        return sb.toString();
    }
    public long nextLong()throws IOException,NumberFormatException
    {return Long.parseLong(nextToken());}
    public int nextInt()throws NumberFormatException,IOException
    {return(int)nextLong();}
    public double nextDouble()throws NumberFormatException,IOException
    {return Double.parseDouble(nextToken());}
    public void close() throws IOException {in.close();}
}


Measured memory_bytes: 21460
#include<stdio.h>

int d[100];
int f[100];
int n;
int graph[100][100]={0};

int time=1;

int dfs(int node){
	d[node]=time++;
	int i,j;
	for(i=0;i<n;i++){
		if(graph[node][i]==1 && d[i]==0){
			dfs(i);
		}
	}
	f[node]=time++;
}

int main(void){
	int u, k, v;
	int i, j;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d %d",&u,&k);
		for(j=0;j<k;j++){
			scanf("%d",&v);
			graph[u-1][v-1]=1;
		}
	}
	dfs(0);
	for(i=0;i<n;i++){
		if(d[i]==0){
			dfs(i);
		}
	}
	for(i=0;i<n;i++){
		printf("%d %d %d\n",i+1,d[i],f[i]);
	}
	return 0;
}

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

#include <bits/stdc++.h>

using namespace std;

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

void d_err() {
    cerr << endl;
}

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

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

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

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

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

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

    int ans = 700;
    REP(i, S.size()) if (S[i] == 'o') ans += 100;

    print(ans);
}


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

int main() {
    int d, t, s;
    cin >> d >> t >> s;
    if (d <= t*s) puts("Yes");
    else puts("No");
    return 0;
}

Measured memory_bytes: 3644
#if defined(LOCAL)
#include "C:\includes.hpp"
#include "C:\debug.hpp"
#define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#include <bits/stdc++.h>
#define deb(x...)
#endif
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)

using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long lint;
typedef vector<lint> vlint;
typedef vector<vlint> vvlint;
typedef pair<lint, lint> plint;
typedef double ld;

template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }

int main() {
    ios::sync_with_stdio(false);
  	cin.tie(0);
	char c;
	cin >> c;
	c++;
	cout << c << '\n';                     
	return 0;
}

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

int main() {
  int A,B;
  cin >> A >> B;
  if(A <= 5) {
    cout << 0 << endl;
  }
  else if( A > 5 && A <= 12) {
    cout << B / 2 << endl;
  }
  else {
    cout << B << endl;
  }
}


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

namespace Practice
{
    class Program
    {

        static void Main(string[] args)
        {
            SolveA(args);
            //SolveB(args);
            //SolveC(args);
            //SolveD(args);
        }


        static void SolveA(string[] args)
        {
            string sz = (Console.ReadLine());
            int n = int.Parse(sz);
            int[] a = new int[n];
            string[] szarr = Console.ReadLine().Split(' ');
            for(int i=0;i<szarr.Length;++i)
            {
                a[i] = int.Parse(szarr[i]);
            }

            selectionSort(a);

        }
        private static void selectionSort(int[] a)
        {
            int num = 0;
            for(int i=0;i<a.Length;++i)
            {
                int minj = i;
                for(int j=i;j<a.Length;++j)
                {
                    if( a[j] < a[minj])
                    {
                        minj = j;
                    }
                }
                if (i != minj)
                {
                    int tmp = a[i];
                    a[i] = a[minj];
                    a[minj] = tmp;
                    
                        num++;
                }
            }
            Writeline(a);
            Console.WriteLine(num);
        }
        private static void Writeline(int[] a)
        {
            string sz = "";
            for(int i=0;i<a.Length;++i)
            {
                sz += a[i];
                if( i < a.Length - 1)
                {
                    sz += " ";
                }
            }
            Console.WriteLine(sz);
        }
    }

}



Measured memory_bytes: 9176
import numpy as np

n = list(map(int, input().split())) # 整数
#print(n)
ans = 0
for i in range(2):
    if n[0] < n[1]:
        ans += n[1]
        n[1] -= 1
    else:
        ans += n[0]
        n[0] -= 1
print(ans)


Measured memory_bytes: 20988
/*http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_2_A&lang=jp*/
#include<iostream>

using namespace std;

void println(int *a,int n){
    for(int i=0;i<n;i++){
        cout<<a[i];
        if(i<n-1){
            cout<<" ";
        }
    }
    cout<<endl;
}

int main()
{
    int n;
    int a[100];
    int count=0;
    bool flag = true;

    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    for(int i = 0;flag == true; i++){
        flag = false;
        for(int j = n-1; i < j; j--){
            if(a[j]<a[j - 1]){
                int tmp=a[j];
                a[j]=a[j - 1];
                a[j - 1]=tmp;
                flag=true;
                count++;
            }
        }
    }
    println(a,n);
    cout<<count<<endl;
    return 0;
}

Measured memory_bytes: 1160
#include <iostream>
#include <algorithm>
using namespace std;
long long u[100010],d[100010],r[100010],mn[100010],mx[100010];
int main(){
	long long i,j,x,k,q,t,a,l;
	cin >> x >> k;
	for(i=1;i<=k;i++){
		cin >> r[i];
	}
	r[0] = 0;
	//前処理
	u[0] = 0; d[0] = x; mn[0] = 0; mx[0] = x;
	for(i=1;i<=k;i++){
		long long y = r[i]-r[i-1],k;
		if(i%2==1){
			mx[i] = max(mx[i-1]-y,(long long)0);
			mn[i] = max(mn[i-1]-y,(long long)0);
			u[i] = u[i-1]+mn[i]-(mn[i-1]-y);
			d[i] = d[i-1];
		}else{
			mx[i] = min(mx[i-1]+y,x);
			mn[i] = min(mn[i-1]+y,x);
			u[i] = u[i-1];
			d[i] = d[i-1]-(mx[i-1]+y-mx[i]);
		}
	}
		
	cin >> q;
	l = 0;
	for(j=0;j<q;j++){
		cin >> t >> a;
		for(i=l;i<=k;i++){
			if(r[i]>t){
				l = i-1;
				break;
			}
			if(i==k){
				l = i;
			}
		}
		if(u[l]>=d[l]){
			if(l%2==0){
				cout << max(mn[l]-t+r[l],(long long)0) << endl;
			}else{
				cout << min(mn[l]+t-r[l],x) << endl;
			}
		}else{
			if(a<=u[l]){
				if(l%2==0){
					cout << max(mn[l] - t + r[l],(long long)0) << endl;
				}else{
					cout << min(mn[l] + t - r[l],x) << endl;
				}
			}else if(a>=d[l]){
				if(l%2==0){
					cout << max(mx[l] - t + r[l],(long long)0) << endl;
				}else{
					cout << min(mx[l] + t - r[l],x) << endl;
				}
			}else{
				if(l%2==0){
					cout << max(mx[l]-(d[l]-a)-t+r[l],(long long)0) << endl;
				}else{
					cout << min(mx[l]-(d[l]-a)+t-r[l],x) << endl;
				}
			}
		}
	}
}

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

int main() {
    int N; cin >> N;
    vector<int> A(N);
    for (int i=0; i<N; i++) cin >> A[i];
    vector<int> color;
    color.push_back(A[0]);
    for (int i=1; i<N; i++) {
        auto it = lower_bound(color.begin(), color.end(), A[i]);
        if (it == color.begin()) {
            color.insert(it, A[i]);
        } else {
            it--;
            *it = A[i];
        }
    }
    cout << color.size() << endl;
}

Measured memory_bytes: 1276
N = int(input())
a = [input() for i in range(N)]
 
for num in range(N):
  if num > 0:
    if a[num] in a[:num-1]:
    	print('No')
    	break
  if num < N-1:
    if a[num][-1] != a[num+1][0]:
    	print('No')
    	break
  if num == N-1:
    print('Yes')

Measured memory_bytes: 3060
//BY: YASH JAIN, CF: yashjain0333
#include <bits/stdc++.h>
using namespace std;
#define May_the_fork_be_with_you ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define MOD 1000000007
#define ll long long
#define f first
#define s second
#define pb push_back
#define eb emplace_back
#define endl "\n"
// #define N 100

void solve(){
    int n,x,t; cin>>n>>x>>t;
    if(n%x){
        cout<<((n/x + 1)*t);
    }
    else cout<<(n/x)*t;
}

int32_t main(){
    May_the_fork_be_with_you
    int t = 1; 
    // cin>>t;
    while (t--)
        solve();
}


Measured memory_bytes: 3600