akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

typedef long long LL;
const LL mod=1000000007;
#define MAX 10000
#define NIL -1
const double PI  = acos(-1.0);
const int INF = 1e9 + 7;
//-------------------------------------------


LL high,mid,low;
LL k;

int main(){

    cin.tie(0);
    ios::sync_with_stdio(false);

    cin >> high >> mid >> low;
    cin >> k;



    if( k%2 == 0 || k == 0){

        if( abs(high - mid) > 1e18) {
                cout << "Unfair" << endl;
                goto last;
        }

        cout << high - mid << endl;
    }else{

        //dump(k);
        //dump(k%2);

        if( abs(high - mid) > 1e18){
                cout << "Unfair" << endl;
                goto last;
        }

        cout << mid - high << endl;

    }

    last:



    return 0;
}


Measured memory_bytes: 256
solve :: String -> Int -> Int
solve s d = min d $ maximum $ scanl f 0 $ sd where
  sd = zip s $ drop d s
  f x (a, b)
    | a == b = x + 1
    | otherwise = 0

main = do
  n <- readLn
  s <- getLine
  print $ maximum $ [solve s d | d <- [0..n-1]]


Measured memory_bytes: 1276
from bisect import bisect_left
from random import randint, random
from time import time
 
start = time()

D = int(input())
*C, = map(int, input().split())
S = [list(map(int, input().split())) for _ in range(D)]
T = [randint(1, 26) for _ in range(D)]

days = [[0] for _ in range(26)]

def init():
    global T, days
    score = 0
    last = [0] * 26
    for d, t in enumerate(T, 1):
        score += S[d - 1][t - 1]
        last[t - 1] = d
        for c, l in zip(C, last): score -= c * (d - l)
        days[t - 1].append(d)
    for i in range(26): days[i].append(D+1)
    return score

def diff(d, q):
    global T, C, S, days
    dif = 0
    p = T[d - 1]
    dif += S[d - 1][q - 1] - S[d - 1][p - 1]
    
    idx_p = bisect_left(days[p - 1], d)
    bef_p, aft_p = days[p - 1][idx_p - 1], days[p - 1][idx_p + 1]
    
    idx_q = bisect_left(days[q - 1], d)
    bef_q, aft_q = days[q - 1][idx_q - 1], days[q - 1][idx_q]
    dif += C[q - 1] * (d - bef_q) * (aft_q - d) - C[p - 1] * (d - bef_p) * (aft_p - d)
    
    return idx_p, idx_q, dif
    
score = init()
while time() - start < 1.8:
    d, q = randint(1, D), randint(1, 26)
    idx_p, idx_q, dif = diff(d, q)
    if dif > 0 or (dif < 0 and random() < 0.05):
        p = T[d - 1]
        T[d - 1] = q
        del days[p - 1][idx_p]
        days[q - 1].insert(idx_q, d)
        score += dif
print(*T, sep='\n')

Measured memory_bytes: 9800
// Math = ♥️

#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 ll long long
#define ld long double
typedef pair<ll, ll> ii;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<vii> vvii;
#define pq priority_queue
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(), (c).end()
#define sz(c) ((ll)c.size())
#define ordered_set                              \
    tree < ll, null_type, less<ll>, rb_tree_tag, \
        tree_order_statistics_node_update
const ll MOD = (ll)(1e9 + 7);

struct dsu {
    vi p, size;

    dsu(ll n) {
        p.resize(n);
        size.resize(n, 1);
        iota(all(p), 0);
    }

    ll find(ll u) {
        if (u != p[u]) {
            return p[u] = find(p[u]);
        }
        return u;
    }

    void merge(ll u, ll v) {
        u = find(u), v = find(v);

        if (u == v) {
            return;
        }

        if (size[v] > size[u]) {
            swap(u, v);
        }

        p[v] = u;
        size[u] += size[v];
    }
};

vector<pair<ii, ll>> edge;
ll n, m;

ll kruskal(ll u) {
    dsu df(n);

    ll ret = 0;
    ret += edge[u].ss;
    df.merge(edge[u].ff.ff, edge[u].ff.ss);

    for (auto it : edge) {
        if (df.find(it.ff.ff) != df.find(it.ff.ss)) {
            ret += it.ss;
            df.merge(it.ff.ff, it.ff.ss);
        }
    }

    return ret;
}

ll binpow(ll a, ll b) {
    ll ret = 1;
    a %= MOD;
    while (b > 0) {
        if (b & 1ll) {
            ret *= a;
            ret %= MOD;
        }

        a *= a;
        a %= MOD;
        b >>= 1ll;
    }

    return ret;
}

bool mycomp(pair<ii, ll> &a, pair<ii, ll> &b) {
    return a.ss < b.ss;
}

int main(void) {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    ll x;
    cin >> n >> m >> x;

    edge.resize(m);

    for (auto &it : edge) {
        cin >> it.ff.ff >> it.ff.ss >> it.ss;
        it.ff.ff--, it.ff.ss--;
    }

    sort(all(edge), mycomp);
    ll B = 0, A = 0, C = 0;
    for (int i = 0; i < m; i++) {
        ll te = kruskal(i);
        if (te == x) {
            B++;
        } else if (te > x) {
            A++;
        } else {
            C++;
        }
    }

    ll ans = 1;

    if (B == 0) {
        ans = 0;
    } else if (C == 0) {
        ans *= ((binpow(2ll, B) - 2) + MOD) % MOD;
        ans %= MOD;
        ans *= binpow(2ll, A);
        ans %= MOD;
    } else {
        ans *= ((binpow(2ll, B) - 1) + MOD);
        ans %= MOD;
        ans *= 2;
        ans %= MOD;
        ans *= binpow(2ll, A);
        ans %= MOD;
    }

    cout << ans << "\n";
}


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

int n, k, x[100009], y[100009], I[4009][4009], J[4009][4009], maxn; char c[100009];

int areas(int p, int q, int r, int s, int ty) {
	if (ty == 1) {
		return I[p][q] + I[r][s] - I[p][s] - I[r][q];
	}
	if (ty == 2) {
		return J[p][q] + J[r][s] - J[p][s] - J[r][q];
	}
	return 0;
}

int main() {
	cin >> n >> k;
	for (int i = 0; i < n; i++) {
		cin >> x[i] >> y[i] >> c[i];
		x[i] %= (2 * k); y[i] %= (2 * k);
		if (c[i] == 'W') {
			I[x[i]][y[i]]++; I[x[i] + 2 * k][y[i]]++;
			I[x[i]][y[i] + 2 * k]++; I[x[i] + 2 * k][y[i] + 2 * k]++;
		}
		if (c[i] == 'B') {
			J[x[i]][y[i]]++; J[x[i] + 2 * k][y[i]]++;
			J[x[i]][y[i] + 2 * k]++; J[x[i] + 2 * k][y[i] + 2 * k]++;
		}
	}
	for (int i = 0; i < 4009; i++) {
		for (int j = 1; j < 4009; j++) {
			I[i][j] += I[i][j - 1];
			J[i][j] += J[i][j - 1];
		}
	}
	for (int i = 1; i < 4009; i++) {
		for (int j = 0; j < 4009; j++) {
			I[i][j] += I[i - 1][j];
			J[i][j] += J[i - 1][j];
		}
	}
	for (int i = 0; i < 2 * k; i++) {
		for (int j = 0; j < 2 * k; j++) {
			int P1 = areas(i + k * 0, j + k * 0, i + k * 1, j + k * 1, 1);
			int P2 = areas(i + k * 1, j + k * 0, i + k * 2, j + k * 1, 2);
			int P3 = areas(i + k * 0, j + k * 1, i + k * 1, j + k * 2, 2);
			int P4 = areas(i + k * 1, j + k * 1, i + k * 2, j + k * 2, 1);
			maxn = max(maxn, P1 + P2 + P3 + P4);
		}
	}
	cout << maxn << endl;
	return 0;
}

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

#define int long long
#define sp ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define cps CLOCKS_PER_SEC
#define mod (int)(1000000007)
#define f first
#define s second
#define debug1(x) cerr<<x<<"\n"
#define debug2(x,y) cerr<<x<<" "<<y<<"\n"
#define debug3(x,y,z) cerr<<x<<" "<<y<<" "<<z<<"\n"
#define nl cerr<<"\n";
#define pq priority_queue
#define inf 9999999999999999
#define test cerr<<"abcd\n";
#define pi pair<int,int>
#define pii pair<int,pi>
#define pb push_back
#define mxn 505
#define mxnn 2000005
int dp[21][1<<21],n,mat[21][21];
int func(int ind,int mask){
if(ind == n){
    return (mask ==((1<<n)-1));
}
if(dp[ind][mask] != -1) return dp[ind][mask];
int ans = 0;
for(int i = 0;i<n;i++){
    if(mat[ind][i] && ((mask&(1<<i))==0)){
        ans = (ans+func(ind+1,mask|(1<<i)))%mod;
    }
}
return dp[ind][mask] = ans;
}
int32_t main(){
memset(dp,-1,sizeof dp);
cin >>n;
for(int i =0;i<n;i++) for(int j = 0;j<n;j++) cin >>mat[i][j];
cout<<func(0,0);
return 0;
}


Measured memory_bytes: 344320
N,M = (int(x) for x in input().split())

p_y_list = [0]*M
y_count = [1]*(N+1)

for i in range(M):
    p,y = (int(x) for x in input().split())
    p_y_list[i] = [p,y,i]
p_y_list.sort(key = lambda x:x[1])

for i in p_y_list:
    i[1] = y_count[i[0]]
    y_count[i[0]] += 1

p_y_list.sort(key = lambda x:x[2])
for i in p_y_list:
    print(str(i[0]).rjust(6,"0") + str(i[1]).rjust(6,"0"))

Measured memory_bytes: 26684
// package atcoder.beginner_170;

import java.io.*;
import java.util.HashSet;
import java.util.StringTokenizer;

public class Main {

    public static void main (String[] args) throws Exception {

        String s = "10\n" +
                "33 18 45 28 8 19 89 86 2 4";

//        br = new BufferedReader(new StringReader(s));
        br = new BufferedReader(new InputStreamReader(System.in));
        bw = new BufferedWriter(new OutputStreamWriter(System.out));

        rl(); int N=nin();
        int[] set = new int[1_000_001];
        rl();
        int A[] = new int[N];
        for (int i=0; i<N; ++i) {
            int v=nin();
            A[i] = v;
            if (set[v] < 2) {
                for (int j=v; j<=1_000_000; j+=v) {
                    ++set[j];
                }
            }
        }

        int counter = 0;
        for (int i=0; i<N; ++i) {
            if (set[A[i]]==1) ++counter;
        }

        bw.write(Integer.toString(counter));
        bw.newLine();
        bw.flush();

    }

    static BufferedReader br;
    static BufferedWriter bw;
    static StringTokenizer st;
    static void rl() throws Exception{
        st = new StringTokenizer(br.readLine());
    }
    static long nlo(){
        return Long.parseLong(st.nextToken());
    }
    static int nin(){
        return Integer.parseInt(st.nextToken());
    }
    /*private static void te(){
      }*/
    static double ndo(){
        return Double.parseDouble(st.nextToken());
    }
    static char[] nca(){
        return st.nextToken().toCharArray();
    }
    static String nstr(){
        return st.nextToken();
    }
}

Measured memory_bytes: 58904
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = ll(1e12)+1;
const ll mod = ll(1e9) + 1;
#define rep0(i,n) for(ll (i) = 0; (i) < (n); ++(i))
#define rrep0(i,n) for(ll (i) = (n) - 1; (i) >= 0; --(i))
#define rep1(i,n) for(ll (i) = 1; (i) <= (n); ++(i))
#define rrep1(i,n) for(ll (i) = (n); (i) >= 1; --(i))
#define nfor(i,a,b) for(ll (i) = (a); (i) < (b); ++(i))
#define pf(x) cout << (x) << endl
#define all(x) (x).begin(),(x).end()

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

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

ll factorial(ll n){
    ll t = 1;
    rep1(i, n){
        t *= i;
        t %= mod;
    }
    return t;
}

ll power(ll a, ll b){
    a %= mod;
    if(b == 0){
        return 1;
    }
    ll ans = power(a, b / 2);
    ans = ans * ans % mod;
    if(b % 2 == 1){
        ans = ans * a % mod;
    }
    return ans;
}

ll combination(ll a, ll b){
    if((a == b) || (b == 0)){
        return 1;
    }
    if(a < b) return 0;
    ll ans = 1;
    for(ll i = 0; i < b; i++) {
        ans *= (a - i);
        ans %= mod;
        ans *= power(i + 1, mod - 2);
        ans %= mod;
    }
    return ans;
}
int main(){
    ll ans = INF;
    ll A,B,M;
    cin >> A >> B >> M;
    vector<ll> a(A),b(B);
    rep0(i, A)cin >> a[i];
    rep0(i, B)cin >> b[i];
    rep0(i, M){
        ll x,y,c;
        cin >> x >> y >> c;
        ans = min(ans,a[x - 1] + b[y - 1] - c);
    }
    sort(all(a));
    sort(all(b));
    ans = min(ans,a[0] + b[0]);
    pf(ans);
    return 0;
}


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

int main()
{
  int N=0;
  // int aa;
  double aa,n,ans=0;

  while(cin >> n){

    ans=n/9.8;
    aa=4.9*ans*ans;
    // cout << aa << endl;    
    N=0;
    while(5*N-5<=aa)N++;

    cout << N << endl;

  }





}

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

using namespace std;

int main() {
    int n , k; cin>>n>>k;
    vector<int>v(n);
    for(int& i : v){
        cin>>i;
    }
    vector<int>dp(n , INT_MAX);
    dp[0] = 0;
    for(int i = 0 ; i < n ; ++i){
        for(int j = 1 ; j <= k; ++j){
            int l = i + j;
                if(l < n)dp[l] = min(dp[l] , dp[i] + abs(v[i] - v[l]));
        }
    }
    cout<<dp[n - 1]<<endl;

}

Measured memory_bytes: 1024
#import numpy as np
from collections import deque

H, W = map(int, input().split())
Ch, Cw = map(int, input().split())
Dh, Dw = map(int, input().split())

Ch -= 1
Cw -= 1
Dh -= 1
Dw -= 1

maze = [input() for _ in range(H)]

INF = 10 ** 12

score = [[INF] * W for _ in range(H)]

score[Ch][Cw] = 0

candidates = deque()
candidates.append((Ch, Cw))

walk = [(0, 1), (0, -1), (-1, 0), (1, 0)]
warp = [(i, j) for i in range(-2, 3) for j in range(-2, 3) if (i, j) not in [(0, 0)] + walk]

while candidates:
    h, w = candidates.popleft()
    # move
    for dh, dw in walk:
        y = h + dh
        x = w + dw
        s = score[h][w]
        if y < 0 or H <= y:
            continue
        if x < 0 or W <= x:
            continue        
        if maze[y][x] == '.' and score[y][x] > s:
            score[y][x] = s
            candidates.appendleft((y, x))
    # warp
    for dh, dw in warp:
        y = h + dh
        x = w + dw
        s = score[h][w]
        if y < 0 or H <= y:
            continue
        if x < 0 or W <= x:
            continue
        if maze[y][x] == '.' and score[y][x] > s + 1:
            score[y][x] = s + 1
            candidates.append((y, x))

if score[Dh][Dw] == INF:
    print(-1)
else:
    print (score[Dh][Dw])




Measured memory_bytes: 88752
import java.util.*;

public class Main {

    public static void main(String[] args)
    {
        //変数
        int count=0;
        boolean sw=false;
        int max=Integer.MIN_VALUE;
        int min=Integer.MAX_VALUE;
        String answer="";
        List<Integer> list1=new ArrayList<>();
        List<Integer> list2=new ArrayList<>();
        int array1[]=new int[5];
        int array2[]=new int[5];
        List<String> slist=new ArrayList<>();
        //入力
        Scanner sc=new Scanner(System.in);
        int N=sc.nextInt();
        String S=sc.next();
        int K=sc.nextInt();
        //処理
        String s1=null;
        s1=S.substring(K-1,K);
        String s2="*";
        for(int i=0;i<N;i++)
        {
            String s3=S.substring(i,i+1);
            if(s1.equals(s3))
            {
                answer+=s3;
            }
            else
            {
                answer+=s2;
            }
        }
        //System.out.println(s1);
        //Collections.sort(a);
        //System.out.println(Arrays.toString(list1.toArray()));
        //System.out.println(Arrays.toString(array1));
		//System.out.println(Arrays.deepToString(a));
        System.out.println(answer);
    }
}

Measured memory_bytes: 22996
#include<bits/stdc++.h>
using namespace std;
#define ll long long int     
int main(){
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)cin>>a[i];
    sort(a,a+n,greater<ll>());
    vector<ll>v;
    for(int i=0;i<n-1;){
        if(a[i]==a[i+1]){
            v.push_back(a[i]);
            i=i+2;
        }else i++;
        if(v.size()>=2)break;
    }
    ll area=1;
    for(int i=0;i<v.size();i++)area*=v[i];
    if(v.size()==2)cout<<area;
    else cout<<0;
}

Measured memory_bytes: 640
#include <stdio.h>
#define MAX 10000

int main(){                                 	
	int i,j;
	int n1,n2,cnt;
	int num1[MAX],num2;
	
	scanf("%d",&n1);
	for(i=0;i<n1;i++){
		scanf("%d",&num1[i]);
	}
	
	cnt = 0;
	scanf("%d", &n2);
	while(n2--){ //インクリメントを後置に変更
		scanf("%d", &num2);
		for(j = 0; j < n1; ++j) {
			if(num1[j] == num2) {
			++cnt;
			
			break;
			}
		}	
	}
  	printf("%d\n", cnt);
 	return 0;
}


Measured memory_bytes: 2104
#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <numeric>
#include <functional>
#include <map>
#include <set>
#define Rep(i, n) for(int i=0;i<n;++i)
#define rep(i, n) for(int i=1;i<=n;++i)
#define ll long long int
#define INF 100000000
#define INFLL 100000000000
#define MOD 1000000007
#define PI 3.14159265359
#define All(a) (a).begin(), (a).end()

using namespace std;
using P = pair<ll, ll>;
 
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};

struct Edge {
  int to;     
  ll weight; 
  Edge(int t, ll w) : to(t), weight(w) { }
};

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



int X, Y;

int main () {
  cin >> X >> Y;

  ll ans = 0;
  if (X == 1) {
    ans += 300000;
  } else if (X == 2) {
    ans += 200000;
  } else if (X == 3) {
    ans += 100000;
  }

  if (Y == 1) {
    ans += 300000;
  } else if (Y == 2) {
    ans += 200000;
  } else if (Y == 3) {
    ans += 100000;
  }

  if (X == 1 && Y == 1) {
    ans += 400000;
  }

  cout << ans << "\n";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a),i##formax=(b);i<i##formax;i++)
#define FORR(i,a,b) for(int i=(a),i##formax=(b);i>=i##formax;i--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pcnt __builtin_popcount
#define sz(x) (int)(x).size()
#define maxs(x,y) x=max(x,y)
#define mins(x,y) x=min(x,y)
#define show(x) cout<<#x<<" = "<<x<<endl;
#define all(a) (a.begin()),(a.end())
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define perm(c) sort(all(c));for(bool c##p=1;c##p;c##p=next_permutation(all(c)))
#define bitComb(a,n,k) for(int a##x,a##y,a=(1<<k)-1;a<(1<<n);a##x=a&-a,a##y=a+a##x,a=(((a&~a##y)/a##x)>>1)|a##y)
#define uniq(v) sort(all(v));v.erase(unique(all(v)), v.end())
#define bit(n) (1LL<<(n))
#define randInt(l,r) (uniform_int_distribution<ll>(l,r)(rnd))
#define randDouble(l,r) (uniform_real_distribution<double>(l,r)(rnd))
#define dout(d) printf("%.12f\n",d)

typedef long long ll;
typedef __int128_t lll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
template<class T>using V=vector<T>;
template<class T>using VV=V<V<T>>;
template<class T,class Y>ostream& operator<<(ostream& o,const pair<T,Y>& p){return o<<"("<<p.fi<<", "<<p.se<<")";}
template<typename A,size_t N,typename T>void Fill(A (&array)[N],const T&v){fill((T*)array,(T*)(array+N),v);}
lll gcd(lll a,lll b,lll &x,lll &y){if(!b){x=1;y=0;return a;}lll d=gcd(b,a%b,y,x);y-=a/b*x;return d;}
ll gcd(ll a,ll b){lll x=0,y=0;return gcd(a,b,x,y);}
ll modInv(ll a,ll m){lll x,y;gcd(a,m,x,y);return (x%m+m)%m;}
ll modPow(lll a,lll n,ll m){if(!a)return a;lll p=1;for(;n>0;n>>=1,a=a*a%m)if(n&1)p=p*a%m;return(ll)p;}
bool isPrime(ll n){if(n<2||n%2==0)return n==2;lll t=n-1,d=t/(t&-t);for(lll a:{2,325,9375,28178,450775,9780504,1795265022})if(a%n){for(t=d,a=modPow(a,t,n);t!=n-1&&a!=1&&a!=n-1;a=a*a%n,t=t*2%n);if(a!=n-1&&t%2==0)return 0;}return 1;}
const int IINF = 1e9+6;
const ll LINF = 1e18;
const int MOD = 1e9+7;
const double PI = acos(-1);
const double EPS = 1e-10;
static random_device rd;
static mt19937 rnd(rd());

const int N = 1e5;
int a, b, c;
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> a >> b >> c;
  cout << (a<=c && c<=b ? "Yes" : "No") << endl;
}

Measured memory_bytes: 256
// -*- coding:utf-8-unix -*-

use num::Float;
use proconio::input;
use std::collections::VecDeque;
use std::collections::{BTreeSet, HashSet};
use std::io::*;
use std::str::FromStr;
// ABC086C - Traveling
// https://atcoder.jp/contests/abs/fasks/arc089_a

fn switch<T>(flag: bool, t: T, f: T) -> T {
    if flag {
        t
    } else {
        f
    }
}

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}
#[allow(dead_code)]
fn read_string() -> Vec<char> {
    read::<String>().chars().collect()
}
#[allow(dead_code)]
fn read_vector<T: FromStr>(number: usize) -> Vec<T> {
    (0..number).map(|_| read()).collect()
}

fn main() {
    let xs: Vec<usize> = read_vector(5);
    for index in 0..5 {
        if xs[index] != index + 1 {
            println!("{}", index + 1)
        }
    }
}


Measured memory_bytes: 2048
import itertools
N, M = list(map(int, input().split(" ")))

switches = []
for _ in range(M):
    l = list(map(int, input().split(" ")))
    switches.append(l[1:])


points = list(map(int, input().split(" ")))
# スイッチの数はN個。このkonおスイッチにon/offの状態があるので2^N
# これの全部の組み合わせを出して、条件を全て満たせる組み合わせがあればクリア
count = 0
for i in range(2**N):
    for j, switch in enumerate(switches):
        n = 0
        for k in switch:
            n += i >> (k - 1) & 1
        if n % 2 == points[j]:
            continue
        else:
            break
    # breakによって抜けなかった時
    else:
        count += 1
print(count)


Measured memory_bytes: 39536
/*
 * a.cc: 
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>

using namespace std;

/* constant */

const int MAX_N = 44;

/* typedef */

/* global variables */

int fs[MAX_N + 1];

/* subroutines */

/* main */

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

  fs[0] = fs[1] = 1;

  for (int i = 2; i <= n; i++)
    fs[i] = fs[i - 1] + fs[i - 2];

  printf("%d\n", fs[n]);
  return 0;
}

Measured memory_bytes: 1144
#include <iostream>
#include <algorithm>
#include <climits>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
using namespace std;
typedef struct job {
    string name;
    int t;
} Job;

queue<Job> qu;
int main() {
    int n, q;
    cin >> n >> q;
    for (int i = 0; i < n; ++i) {
        string nm;
        int t;
        cin >> nm >> t;
        Job j = {nm, t};
        qu.push(j);
    }
    int time = 0;
    while(!qu.empty()) {
        struct job j = qu.front();qu.pop();
        if(j.t <= q) {
            time += j.t;
            cout << j.name << " " <<  time << endl;
        } else {
            j.t -= q;
            time += q;
            qu.push(j);
        }
    }

    return 0;
}



Measured memory_bytes: 6232
import java.util.Scanner;
class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();
    int a[] = new int[n+1];
    for(int i = 1; i <= n; i++) {
      a[i] = sc.nextInt();
    }

    int count = 0;
    for(int i = 1; i <= n; i++) {
      if(i%2 == 1 && a[i]%2 == 1) count++;
    }

    System.out.println(count);
  }
}


Measured memory_bytes: 35640
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i, s, n) for(int i = s, i##_len=(n); i < i##_len; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(v) (v).begin(), (v).end()
#define SORT(v) sort(ALL(v))
#define PB push_back
#define MP make_pair
using ll = long long;
using Pii = pair<int, int>;
const int MOD = 1000000007;
const int INF = 1000000000;

const ll LLINF = 1000000000000000000;
using P = pair<ll, int>;
struct edge{
    int to, cost;
    edge(int To, int Cost) : to(To), cost(Cost){};
};


int V;
vector<vector<edge>> G;
vector<ll> d;

void dijkstra(int s){ //頂点sからの距離を求める
    //P first: 距離　second: 頂点
    priority_queue<P, vector<P>, greater<P>> que;
    fill(ALL(d), LLINF);
    d[s] = 0;
    que.push(MP(0, s));

    while(!que.empty()){
        P p = que.top(); que.pop();
        int v = p.second;
        if(d[v] < p.first) continue;
        REP(i, G[v].size()){
            edge e = G[v][i];
            if(d[e.to] > d[v] + e.cost){
                d[e.to] = d[v] + e.cost;
                que.push(MP(d[e.to], e.to));
            }
        }
    }
}

int main(){
    cin >> V;
    G.resize(V);
    d.resize(V);
    REP(i, V-1){
        int u, v, w; cin >> u >> v >> w;
        --u; --v;
        G[u].PB(edge(v, w)); G[v].PB(edge(u, w));
    }
    dijkstra(0);
    REP(i, V){
        if(d[i] % 2) cout << 1 << "\n";
        else cout << 0 << "\n";
    }
    return 0;
}


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

using namespace std;
#define sqr(x) ((x)*(x))
#define cube(x) ((x)*(x)*(x))
#define GCD(a, b) __gcd(a, b)
#define LCM(a, b) ((a)*(b)/GCD(a,b))
#define MP make_pair
#define n1 first
#define n2 second
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define SI set<int>
#define SL set<ll>
#define MS multiset
#define MSI multiset<int>
#define MSLL multiset<ll>
#define PB push_back
#define PF push_front
#define VI vector<int>
#define VPI vector<pair<int,int>>
#define VLL vector<ll>
#define SZ(x) ((int)x.size())

typedef long long ll;

typedef unsigned long long ull;
typedef long double ld;
typedef double db;
const int INF = 1e9;
const int MOD = 1000000007;
const int N = 202055;
const int M = 1211;

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

    int cnt = 0;
    for (int i = 0; i < n/2; i++){
        if (s[i] == s[n/2+i]) cnt++;
    }

    if (cnt == n/2 && n % 2 == 0) cout << "Yes"; else
        cout << "No";


    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
int n, m, x;
cin >> n >> m >> x;
int c[15], a[15][15];
for (int i =0; i<n; i++){
  cin >> c[i];
  for (int j =0; j<m; j++) cin >> a[i][j];
}
int ans = 100000100;
for (int bit =0; bit<(1<<n); bit++){
  vector<int> skill(m,0);
  int cost = 0;
  for (int i=0; i<n; i++){
    if((bit>>i)&1) {
      for (int j=0; j<m; j++){
        skill[j]+=a[i][j];
      }
      cost += c[i];
    }
  }
  
  bool can =true;
  for (int i=0; i<m; i++){
    if(skill[i]<x) {can = false;break;}
  }
  if(can) ans = min(ans, cost);
}
  cout << (ans == 100000100? -1: ans) << endl;
}

Measured memory_bytes: 3620
#include<stdio.h>
#include<stdlib.h>
int stack[110];
int top=0;

void push(int x){
  top += 1;
  stack[top]=x;
}

int pop(){
  top -= 1;
  return stack[top+1];
}

int main(){
  
  char c[110];
  int a,b;
  
  while(scanf("%s",c)!=EOF){

    switch(c[0]){
    case '+':
      b=pop();
      a=pop();
      push(a+b);
      break;
      
    case '-':
      b=pop();
      a=pop();
      push(a-b);
      break;
     
    case '*':
      b=pop();
      a=pop();
      push(a*b);
      break;

    default:
      push(atoi(c));
      break;
    }
  }

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

    



Measured memory_bytes: 2084
#include<bits/stdc++.h>
using namespace std;
string s,t,l;
int a,b;
int main(){
	cin>>s>>t>>a>>b>>l;
	if (s==l)
		cout<<max(0,a-1)<<' '<<b<<endl;
	else
		cout<<a<<' '<<max(0,b-1)<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<ll>;
using vii = vector<vi>;
using Pll = pair<ll, ll>;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(v) v.begin(), v.end()
#define sz(x) ((int) x.size())
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define F first
#define S second
const int MOD = 1e9+7;
const int INF = 2e9;
template<class T> void print(const T& t){ cout << t << endl; }
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; }
int gcd(int a,int b){return b?gcd(b,a%b):a;}

int main(){
  ll n;
  cin >> n;
  ll ans = 0;
  vi s(n);
  rep(i, n){
    cin >> s[i];
    ans += s[i];
  }
  if(ans%10!=0){
    print(ans);
  }
  else{
    sort(all(s));
    bool z = true;
    rep(i, n){
      if((ans-s[i])%10!=0){
        print(ans - s[i]);
        z = false;
        break;
      }
    }
    if(z){
      print(0);
    }
  }
}

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

typedef long long ll;

template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl

const int maxn = 1e6 + 5;
int n,a[maxn],b[maxn]; ll tot;

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

  cin>>n;
  for (int i=1; i<=n+1; i++) cin>>a[i];
  for (int i=1; i<=n; i++) cin>>b[i];
  for (int i=n; i>=1; i--) {
    int dx = min(a[i+1],b[i]);
    tot += dx;
    a[i+1]-=dx; b[i]-=dx;
    dx = min(a[i],b[i]);
    tot += dx;
    a[i]-=dx; b[i]-=dx;
  }
  
  cout<<tot<<endl;
  

  return 0;
}


Measured memory_bytes: 4736
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define mod 1000000007
ll n;
vector<vector<ll> > iden(n+1);
void func(vector<vector<ll> > &a,vector<vector<ll> > &b)
{
	ll i,j,k;
	vector<vector<ll> > c(n+1);
	for(i=1;i<=n;i++)
		c[i]=vector<ll>(n+1);
	for(i=1;i<=n;i++)
	{
		for(j=1;j<=n;j++)
		{
			for(k=1;k<=n;k++)
				c[i][j]=(c[i][j]+a[i][k]*b[k][j])%mod;
		}
	}
	a=c;
}
void matexp(vector<vector<ll> > &a,ll k)
{
	ll i,j;
	if(k%2==0)
	{
		func(a,a);
		matexp(a,k/2);
	}
	else
	{
		if(k!=1)
		{
			vector<vector<ll> > b=a;
			func(a,a);
			matexp(a,(k-1)/2);
			func(a,b);
		}
	}
}
int main()
{
	ll i,j,sum=0,k;
	cin>>n>>k;
	vector<vector<ll> > adj(n+1);
	for(i=1;i<=n;i++)
		adj[i]=vector<ll>(n+1);
	for(i=1;i<=n;i++)
	{
		for(j=1;j<=n;j++)
			cin>>adj[i][j];
	}
	matexp(adj,k);
	for(i=1;i<=n;i++)
	{
		for(j=1;j<=n;j++)
			sum=(sum+adj[i][j])%mod;
	}
	cout<<sum<<endl;
}


Measured memory_bytes: 1536
import java.io.IOException;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        final int N = nextInt();
        final int Q = nextInt();
        final long[] C = new long[N]; // counter
        final int P[] = new int[N]; // parent
        Arrays.fill(P, -1);

        List<Integer>[] G = new List[N]; // Graph
        for (int i = 0; i < N; i++) {
            G[i] = new ArrayList<Integer>();
        }
        for (int i = 0; i < N - 1; i++) {
            int a = nextInt() - 1;
            int b = nextInt() - 1;
            G[a].add(b);
            G[b].add(a);
        }

        for (int i = 0; i < Q; i++) {
            int p = nextInt() - 1;
            int x = nextInt();

            C[p] += x;
        }

        Queue<Integer> que = new LinkedList<>();
        que.add(0);
        for (;!que.isEmpty();) {
            int v = que.poll();
            for (int w: G[v]) {
                if (w == P[v]) {
                    continue;
                }
                C[w] += C[v];
                P[w] = v;
                que.add(w);
            }
        }

        StringBuilder out = new StringBuilder();
        for (int i = 0; i < N; i++) {
            out.append(C[i]).append(" ");
        }
        System.out.println(out.substring(0, out.length() - 1));
    }

    static int nextInt() {
        int c;
        try {
            c = System.in.read();
            while(c != '-' && (c < '0' || c > '9')) c = System.in.read();
            if(c == '-') return -nextInt();
            int res = 0;
            while(c >= '0' && c <= '9') {
                res = res * 10 + c - '0';
                c = System.in.read();
            }
            return res;
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return -1;
    }
}

Measured memory_bytes: 88048
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;

int n;
int a[10000];
int b[10001];
int ans = 1e9;

int c(int x, int y){ //change b[x] to y return remaining
	b[x] = y;
	int e = n;
	bool f = true;
	while(f){
		f = false;
		int d = 1;
		int p = b[0];
		for(int i=1; i<n+1; ++i){
			if(b[i] == 4) continue;
			if(b[i] == p) ++d;
			else{
				if(d > 3){
					f = true;
					int j = 0, l = i-1;
					while(j < d){
						if(b[l] == 4){
							--l;
							continue;
						}
						b[l] = 4;
						++j;
						--l;
						--e;
/*						for(int k=0; k<n; ++k) printf("%d ", b[k]);
						printf("\n");
*/					}
				}
				d = 1;
			}
			p = b[i];
		}
	}
/*	if(x == 5){
		for(int i=0; i<n; ++i) printf("%d ", b[i]);
		printf("\n");
	}
*/	return e;
}

int main(){
	while(1){
		memset(a, 0, sizeof(a));
		scanf("%d", &n);
		if(n == 0) return 0;
		for(int i=0; i<n; ++i) scanf("%d", &a[i]);
		ans = 1e9;

		for(int i=0; i<n; ++i)
			for(int j=1; j<4; ++j){
				for(int k=0; k<n; ++k) b[k] = a[k];
				if(a[i] != j){
					ans = min(ans, c(i, j));
				}
//				printf("%d %d\n", i, j);
//				printf("%d\n", ans);
			}
		printf("%d\n", ans);
	}
}

Measured memory_bytes: 2820
let hantei a b = if (a + b) mod 3 = 0 then "Possible"
else if a mod 3 = 0 then "Possible"
else if b mod 3 = 0 then "Possible"
else "Impossible"
                 
let main () = 
Scanf.sscanf (read_line()) "%d %d" (fun a b -> print_string(hantei a b));;
                 
let () = main ()

Measured memory_bytes: 384
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>

#define REP(i,n) for(long long i=0;i<n;++i)
#define REPR(i,n) for(long long i=n;i>=0;--i)
#define REPI(itr,v) for(auto itr=v.begin();itr!=v.end();++itr)
#define REPIR(itr,v) for(auto itr=v.rbegin();itr!=v.rend();++itr)
#define FOR(i,a,b) for(long long i=a;i<b;++i)
#define SORT(v,n) sort(v, v+n)
#define SORTV(v) sort(v.begin(), v.end())
#define ALL(v) v.begin(),v.end()
#define llong long long
#define INF 999999999
#define MOD 1000000007
#define pb push_back
#define pf push_front
#define MP make_pair
#define SV(v) {for(long long sitr=0;sitr<v.size();++sitr){cin>>v[sitr];}}

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

using namespace std;

typedef pair<int,int> pii;

llong dp[3010][3010];

int main(){

  int n;
  cin >> n;

  vector<llong> v(n);
  REP(i,n){
    cin >> v[i];
  }

  for(int len = 1; len <= n; ++len){
    for(int i = 0; i + len <= n; ++i){
      int j = len + i;
      if((n - len) % 2 == 0){
          if(i + 1 == n - 1)
            dp[i][j] = v[i];
          else
            dp[i][j] = max(dp[i+1][j] + v[i], dp[i][j-1] + v[j-1]);
      }else{
          if(i + 1 == n - 1)
            dp[i][j] =  - v[i];
          else
            dp[i][j] = min(dp[i+1][j] - v[i], dp[i][j-1] - v[j-1]);
      }
    }
  }

  /*
  ///これは遷移おかしい
  REP(i,n){
    for(int j = i; j <= n; ++j){
      if(j == 0) continue;
      int len = j - i;

      if((n - len) % 2 == 0){
        if(i+1 == n){
          dp[i][j] = dp[i][j-1] + v[j-1];
        }
        else
          dp[i][j] = max(dp[i+1][j] + v[i], dp[i][j-1] + v[j-1]);
      }else{
        if(i + 1 == n)
          dp[i][j] = dp[i][j-1] - v[j-1];
        else
          dp[i][j] = min(dp[i+1][j] - v[i], dp[i][j-1] - v[j-1]);
      }
    }
  }
  */
  cout << dp[0][n] << endl;
  
  return 0;
}



Measured memory_bytes: 70016
#include <algorithm>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <map>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <list>
#define INF 10000000000ll
#define MOD 1000000007ll
#define EPS 1e-10
#define REP(i,m) for(long long i=0; i<m; i++)
#define FOR(i,n,m) for(long long i=n; i<m; i++)
#define DUMP(a) for(long long dump=0; dump<(ll)a.size(); dump++) { cout<<a[dump]; if(dump!=(ll)a.size()-1) cout<<" "; else cout<<endl; }
#define ALL(v) v.begin(),v.end()
#define pb push_back
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;
typedef long double ld;
using namespace std;

int main(){
	int n;
	cin >> n;
	int max = 0;
	while(n > (max * (max+1) / 2)) max++;
	int exp = (max * (max+1) / 2) - n;
	REP(i, max){
		if((i+1) != exp) cout << i+1 << endl;
	}
	return 0;
}


Measured memory_bytes: 256
#include <iostream> // cout, endl, cin
#include <iomanip>
#include <string>        // string, to_string, stoi
#include <vector>        // vector
#include <algorithm>     // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility>       // pair, make_pair
#include <tuple>         // tuple, make_tuple
#include <cstdint>       // int64_t, int*_t
#include <cstdio>        // printf
#include <map>           // map
#include <queue>         // queue, priority_queue
#include <set>           // set
#include <stack>         // stack
#include <deque>         // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset>        // bitset
#include <cctype>        // isupper, islower, isdigit, toupper, tolower
#include <math.h>
#include <numeric>
using namespace std;
#define _GLIBCXX_DEBUG
#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++)
const int INF = 1001001001;
const int BG = 1000000007;

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

    cout << (a + b) * h / 2 << endl;
}


Measured memory_bytes: 256
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i, n) for (ll i = 0; i < n; i++)
#define rrep(i, n) for (ll i = n - 1; i >= 0; i--)
#define Rep(i, r, n) for (ll i = r; i < n; i++)
#define RRep(i, r, n) for (ll i = n - 1; i <= r; i--)
#define debug(x) cout << #x << ' ' << '=' << ' ' << (x) << endl;
#define fs first
#define sc second
#define int long long
#define pb push_back
const int dx[] = {0, -1, 0, 1};
const int dy[] = {1, 0, -1, 0};
const int MOD = (1000000007);
//const int MOD = (998244353);
//const int INF = (1 << 30)-1;
const int INF = (1LL << 60)-1;
const double EPS = (1 >> 30);

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

using Graph = vector<vector<pair<int, int>>>;

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(15);
    //---------------------------------------------
    
    int n,m;
    cin>>n>>m;
    vector<P> a(m);
    rep(i,m) {
        int x, y;
        cin >> x >> y;
        a[i] = P(x, y);
    }
    vector<P> b(n);
    rep(i,n){
        b[i].fs=1;
    }
    b[0].sc=1;
    rep(i,m){
        int x=a[i].fs;
        int y=a[i].sc;
        x--,y--;
        if(b[x].fs==1&&b[x].sc==1){
            b[x].sc=0;
            b[y].sc=1;
        }
        else if(b[x].sc==1){
            b[y].sc=1;
        }
        b[x].fs--;
        b[y].fs++;
    }
    ll ans=0;
    rep(i,n){
        if(b[i].sc==1){
            ans++;
        }
    }
    cout<<ans<<endl;

}

Measured memory_bytes: 1792
import java.util.*;

public class Main {
    public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    int C = sc.nextInt();
    int K = sc.nextInt();

    int max = Math.max(A,Math.max(B,C));
    int hoka = A + B + C - max;    

    for(int i=0; i<K; i++){
        max *= 2;
    }
    System.out.println(max+hoka);
    }
}


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

int main()
{
    long long int n,m,k,l,sum;
    cin>>n>>m>>k>>l;
    long long int p=max(max(n,m),max(n,k));
    sum=m+n+k-p;
    for(int i=0;i<l;i++)
        p*=2;
    cout<<sum+p;
    return 0;
}


Measured memory_bytes: 256
object Main {

  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)

    // b以下のxの倍数の個数 - a以下のxの倍数の個数
    val a, b, x = sc.nextLong()
    val result = (b / x) - (a / x) + (if (a % x == 0) 1 else 0)
    println(result)
  }

}

Measured memory_bytes: 55340
#include<iostream>
#include<iomanip>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<vector>
#include<cctype>
#define szxb 13
using namespace std;
int a[szxb];
signed main()
{
	scanf("%d%d%d",&a[1],&a[2],&a[3]),sort(a+1,a+4),printf("%d",(a[1]+a[2]));
	return putchar(10),0;
}

Measured memory_bytes: 256
A = [int(v) for v in input()]

flag = False
for i in range(2):
  if flag:
    break
  total = A[0]
  if i == 0:
    total += A[1]
  else:
    total -= A[1]
  for j in range(2):
    if flag:
      break
    total2 = total
    if j == 0:
      total2 += A[2]
    else:
      total2 -= A[2]
    for k in range(2):
      total3 = total2
      if k == 0:
        total3 += A[3]
      else:
        total3 -= A[3]
      if total3 == 7:
        print(A[0], end='')
        if i == 0:
          print('+{}'.format(A[1]), end='')
        else:
          print('-{}'.format(A[1]), end='')
        if j == 0:
          print('+{}'.format(A[2]), end='')
        else:
          print('-{}'.format(A[2]), end='')
        if k == 0:
          print('+{}=7'.format(A[3]))
        else:
          print('-{}=7'.format(A[3]))
        flag = True
        break

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

#define rep(i,n) for(long long int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(long long int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(long long int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define P pair<int,int>
#define Abs(a,b) max(a,b)-min(a,b)
#define YES(condition) if(condition){cout << "YES" << endl;}else{cout << "NO" << endl;}
#define Yes(condition) if(condition){cout << "Yes" << endl;}else{cout << "No" << endl;}
#define Cout(x) cout<<(x)<<endl

typedef long long ll;

using namespace std;

const int INF = 1e9,MOD = 1e9 + 7;
const ll LINF = 1e18;

//while(x!=0){
            //sum+=x%10;
           // x/=10;
        //}
        //各桁の和

//pair<int,int> p[100000];
//P r[100000];
//cin >> tmp;
//p[i]=make_pair(tmp,i);
//cout << p[i].second+1 << endl;//ペアの右側つまりiを出力

//s.find(w[i])==string::npos
//findの使い方

//for(int i=0;i<n;i++){
   // b[i]=x%2;
    //x/=2;
  //}二進数

long long int n,cnt=0,cntt=0,ans=0,a[10000000],b,c,cmp,data,m,h,w,x,y,xcmp,ycmp,sum=0;

string s;

vector<int> z;

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

       cin >> n;
       rep(i,n){
           cin >> a[i];
           if(a[i]%4==0){
               cnt++;
           }
           else if(a[i]%2==0){
               cntt++;
           }
       }
       if(cnt>=n/2){
           Cout("Yes");
       }
       else{
           if(cntt==0){
               Cout("No");
           }
           else{
               if(cnt>=(n-cntt+1)/2){
                   Cout("Yes");
               }
               else{
                   Cout("No");
               }
           }
       }
return 0;
}


Measured memory_bytes: 1024
#include <stdio.h>

int main(void) {

	int number;
	scanf("%d", &number);

	int array[100];
	for (int i = 0; i<number; i++) {
		scanf("%d", &array[i]);
	}

	int count = 0;
	int tmp;
	int flag = 1;
	while (flag) {
		flag = 0;
		for (int j = 0; j<(number - 1); j++) {
			if (array[j]>array[j + 1]) {
				tmp = array[j + 1];
				array[j + 1] = array[j];
				array[j] = tmp;

				count++;
				flag = 1;
			}		
		}
	}

	for (int m = 0; m<number; m++) {
	if(m == number - 1){
			printf("%d\n",array[m]);
		}
		else {
			printf("%d ", array[m]);
		}
	}

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


	return 0;
}


Measured memory_bytes: 2104
#include <stdio.h>

int main(void)
{
	int b, f, r, v, w[4][3][10] = { {{0}} }, n, i, m, t;

	scanf("%d", &n);

	for (i = 0; i < n; i++)
	{
		scanf("%d %d %d %d", &b, &f, &r, &v);

			w[b - 1][f - 1][r - 1] = w[b - 1][f - 1][r - 1] + v;

		if (w[b - 1][f - 1][r - 1] < 0)
		{
			w[b - 1][f - 1][r - 1] = 0;
		}

		if (w[b - 1][f - 1][r - 1] >9)
		{
			w[b - 1][f - 1][r - 1] = 9;
		}
	}
	for (i = 0; i < 4; i++)
	{
		for ( m = 0; m < 3; m++)
		{
			for (t = 0; t < 10; t++)
			{
				printf(" %d", w[i][m][t]);
			}
			printf("\n");
		}
		if (i!=3)
		{
			printf("####################\n");
		}
	}
	
	return 0;
}


Measured memory_bytes: 2104
H,W,N = map(int, input().split())
s_r,s_c = map(int, input().split())
S = input()
T = input()

r,c = s_r,s_c



for i in range(N):
    if S[i] == "L":
        c -= 1
    elif S[i] == "U":
        r -= 1
    if not (1<= r <= H and 1<= c <= W):
        print("NO")
        exit()
    if T[i] == "R":
        if c < W:
            c += 1
    elif T[i] == "D":
        if r < H:
            r += 1
r,c = s_r,s_c
for i in range(N):
    if S[i] == "R":
        c += 1
    elif S[i] == "D":
        r += 1
    if not (1<= r <= H and 1<= c <= W):
        print("NO")
        exit()
    if T[i] == "L":
        if 1 < c:
            c -= 1
    elif T[i] == "U":
        if 1 < r:
            r -= 1
print("YES")

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

using ll = long long;
using ull = unsigned long long;

const double PI = acos(-1);
const int inf = 2e9;
const ll INF = 2e18;
const ll MOD = 1e9+7;

#define sz(s) (s).size()
#define pb push_back
#define fi first
#define se second
#define REP(i,n) for (int i = 0; i<n; i++)
#define ALL(a) begin(a), end(a)

int main (void) {
    int N,A,B,C,D;
    string S;
    cin >> N >> A >> B >> C >> D >> S;
    A--; B--; C--; D--;
    if (C < D) {
        bool flag = true;
        for (int i=A+1; i<=D; i++) {
            if (S[i] == '#' && S[i-1] == '#') flag = false;
        }
        if (flag) cout << "Yes" << endl;
        else cout << "No" << endl;
        return 0;
    }
    else {
        bool flag = true;
        for (int i=A+1; i<=C; i++) {
            if (S[i] == '#' && S[i-1] == '#') flag = false;
        }
        if (!flag) {
            cout << "No" << endl;
            return 0;
        }
        bool flag2 = false;
        for (int i=B; i<=D-1; i++) {
            if (S[i] == '.' && S[i-1] == '.' && S[i+1] == '.') flag2 = true;
        }
        //if (S[B+1] == '.') flag2 = true;
        if (S[D-1] == '.') flag2 = true;
        if (flag2) cout << "Yes" << endl;
        else cout << "No" << endl;
        return 0;
    }
    return 0;
}

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

void solve() {
	ll n, p;
	cin >> n >> p;
	vector<pair<ll, ll>> v;
	if (n == 1) {
		cout << p << endl;
		return;
	}
	ll cur = p;
	for (ll i = 2; i * i <= p; i++) {
		ll t = 0;
		while (cur % i == 0) {
			t++;
			cur /= i;
		}
		v.push_back(pair<ll, ll> (i, t));
	}
	ll ans = 1;
	for (auto k: v) {
		if (k.second >= n) ans *= (pow(k.first, (k.second / n)));
	}
	cout << ans << endl;
}

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

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

int main(){
  int N;
  int sum = 0;
  cin >> N;
  vector<int> A(N);
  vector<int> B(N-1);
 
  for(int i = 0; i < N-1; i++)    //O(N)
    cin >> B[i];

  for(int i = 0; i < N-1; i++){    //計算量O(N)
    if(i == 0)
      A[i] = A[i+1] = B[i];
    else{
      if(A[i] > B[i])
        A[i] = A[i+1] = B[i];
      else
        A[i+1] = B[i];
    }
    sum += A[i];
  }

  cout << sum + A[N-1] << endl;
  return 0;

}

Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;
int main(void)
{
    int n; cin >> n;
    string s; cin >> s;
    int cur = s[0]-'a';
    int ans = 1;
    for(int i=1;i<n;i++){
        if(cur!=s[i]-'a'){
            ans++;
            cur = s[i] -'a';
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 512