akhauriyash/Code-Regression huggingface dataset:
/*****/

#include <iostream>
#include <array>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <iomanip>	//cout << fixed << setprecision(桁数);
#include <stdexcept>

using namespace std;
using ll = long long;

#define nextline() (std::cerr << "\n")
#define debug(x) (#x " : " + (x))
#define debug_cout(x) (std::cerr << #x << " : " <<  (x) << "\n")
#define debug_tabCout(n, x) (std::cerr << strMulti("\t",n) << #x << " : " <<  (x) << "\n")
#define debug_headCout(h, x) (std::cerr << h << " : " <<  (x) << "\n")
#define debug_tabHeadCout(n, h, x) (std::cerr << strMulti("\t",n) << h << " : " <<  (x) << "\n")

#define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; i++)
#define rep1(i, n) for(int i=1, i##_len=(n); i<=i##_len; i++)
#define rrep(i, n) for(int i=(n)-1; i >= 0; i--)
#define rrep1(i, n) for(int i=(n); i > 0; i--)
#define all(x) (x).begin(), (x).end()
#define pair(a, b) make_pair(a, b);
//#define int long long
constexpr int INF = 2000000100;
constexpr ll DIV = 1000000007;	// 10e9+7
template<class T> bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> T divUp(T a, T b) { if (a % b == 0) { return a / b; } return a / b + 1; }
std::string strMulti(std::string t, int n) { std::string out = ""; for (int i = 0; i < n; i++) { out += t; } return out; }
template<class T> T math_P(T m, T n) { T ret = 1; for (T i = m; i > m - n; i--) { ret *= i; } return ret; }
template<class T> T math_C(T m, T n) { T ret = mathP(m, n); for (T i = 2; i <= n; i++) { ret /= i; } return ret; }
template<class T> bool compare_by_b(pair<T, T> a, pair<T, T> b) { if (a.second != b.second) { return a.second < b.second; } return a.first < b.first; }
template<class T> T math_gcd(T a, T b) { a = abs(a); b = abs(b); if (a < b) { std::swap(a, b); } T tmp; while (b != 0) { tmp = b; b = a % b; a = tmp; } return a; }
template<class T> T math_lcm(T a, T b) { a = abs(a); b = abs(b); if (a > b) { std::swap(a, b); } if (a == 1) { return b; } T i = a; while (i % b != 0) { i += a; } return i; }

/*****/

int Main()
{
	ll N, W;
	cin >> N >> W;
	vector<ll> w(N), v(w);
	rep(i, N)	cin >> w[i] >> v[i];

	vector<vector<ll>> dp(N + 1, vector<ll>(W + 1));

	for (int i = 0; i < N; i++)
	{
		for (int sum_w = 0; sum_w <= W; sum_w++)
		{
			if (sum_w - w[i] >= 0)
			{
				chmax(dp[i + 1][sum_w], dp[i][sum_w - w[i]] + v[i]);
			}

			chmax(dp[i + 1][sum_w], dp[i][sum_w]);
		}
	}

	cout << dp[N][W];

	return 0;
}

/*****/

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

	//std::cout << std::fixed << std::setprecision(10);

	Main();

	return 0;
}


Measured memory_bytes: 80256
N, M = map(int, input().split())
G = [[] for i in range(N)]
for i in range(M):
    a, b = map(int, input().split())
    G[a - 1].append(b - 1)
    G[b - 1].append(a - 1)
cnt = [0]
def dfs(V, s):
    V[s] = 1
    if sum(V) == N:
        cnt[0] += 1                    
    else:
        for adj in G[s]:
            if V[adj] == 0:             
                dfs(V[:adj] + [1] + V[adj + 1:], adj)  #ここで分岐がたくさん発生する
dfs([0] * N, 0)
print(cnt[0])

Measured memory_bytes: 3188
#include<iostream>
#include<cstdio>
using namespace std;
const int N=410,p=1e9+7;
int n,a[N],b[N],f[N/3][N][N],ah[N],bh[N];
inline void A(int &x,int y){x+=y;if (x>=p) x-=p;}
inline void D(int &x,int y){x-=y;if (x<0) x+=p;}
int main(){
	scanf("%d",&n);
	for (int i=1;i<=n;++i) scanf("%d",a+i),ah[a[i]]=i;
	for (int i=1;i<=n;++i) scanf("%d",b+i),bh[b[i]]=i;
	f[0][1][1]=1;
	for (int pa=1;pa<=n;++pa)
		for (int pb=1;pb<=n;++pb)
			for (int i=0;i*3<=n;++i)if (f[i][pa][pb]){
				int tmp=f[i][pa][pb],tmp2=1ll*tmp*i%p,tmp3=1ll*tmp2*(i-1)%p;
				if (a[pa]==b[pb]){
					if (i) A(f[i-1][pa+1][pb+1],tmp2);
					continue;
				}
				if (ah[b[pb]]<pa){
					A(f[i][pa][pb+1],tmp);
					continue;
				}
				if (bh[a[pa]]<pb){
					A(f[i][pa+1][pb],tmp);
					continue;
				}
				A(f[i+1][pa+1][pb+1],tmp);
				if (!i) continue;
				A(f[i-1][pa+1][pb],tmp2);
				A(f[i-1][pa][pb+1],tmp2);
				if (i>=2) D(f[i-2][pa+1][pb+1],tmp3);
			}
	int ans=f[0][n+1][n+1];
	for (int i=n/3+1;i<=n;++i) A(ans,f[0][i][n+1]),A(ans,f[0][n+1][i]);
	for (int i=n;i;i-=3) ans=1ll*ans*(i-1)%p*(i-2)%p;
	printf("%d",ans);
	return 0;
}

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

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

    int n;
    cin >> n;

    int sum = 0;
    for (int i = 1; i <= n; i++) {
        int cell;
        cin >> cell;
        if (i % 2 == 1 && cell % 2 == 1)
            sum++;
    }

    cout << sum << endl;
}


Measured memory_bytes: 3564
#include <bits/stdc++.h>
#define mod 1000000007
#define ll long long
#define mx 200010
using namespace std;
ll i,j,k,n,m,c,x,z;
double a[3007],dp[3007][3007];
double call(ll pos,ll tail)
{
    if(pos==n) return 1.0;
    double &ret = dp[pos][tail];
    if(ret!=-1) return ret;
    ret = 0;
    ret += a[pos]*call(pos+1,tail);
    if(tail<n/2) ret += (1.0-a[pos])*call(pos+1,tail+1);
    return ret;
}

int main()
{
    for(i=0;i<3001;i++)
    for(j=0;j<3001;j++)
    dp[i][j]=-1;
    cin>>n;
    for(i=0;i<n;i++)
    {
        cin>>a[i];
    }
    cout<<setprecision(20)<<call(0,0)<<endl;
    return 0;
}


Measured memory_bytes: 70912
from heapq import heappop,heappush

def dijkstr(G:list, source=0):
	INF = float("inf")
	V = len(G)
	D = [INF]*V
	D[source] = 0
	vis = [False]*V
	H = [(0,source)]
	while H:
		dist, cur = heappop(H)
		if vis[cur]:
			continue
		vis[cur] = True
		for nxt, cost in G[cur]:
			t = dist + cost
			if D[nxt] > t:
				D[nxt] = t
				heappush(H, (t, nxt))
	return D

def main():
	V,E,r,*L = map(int,open(0).read().split())
	INF = float("inf")
	G = [[] for _ in range(V)]
	for s,t,c in zip(*[iter(L)]*3):
		G[s].append((t,c))
	for i in dijkstr(G,r):
		if i==INF:
			print("INF")
		else:
			print(i)

if __name__=="__main__":main()



Measured memory_bytes: 167240
#include <stdio.h>
#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <queue>
#include <map>

//#include <bits/stdc++.h>
using namespace std;
#define print(x) cout<<(x)<<endl
#define prints(x, y) cout<<(x)<<" "<<(y)<<endl
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define r_rep(i, n) for(int i = n; i >= 0; i--)
#define ll long long int
#define pb push_back

const long long INF = 1LL << 60;

int main() {
  string s;
  cin >> s;
  vector<char> ans;

  rep(i, s.size()){
    if (s[i] == 'B') {
      if (ans.size() > 0)
        ans.pop_back();
    }
    else ans.push_back(s[i]);
  }

  rep(i, ans.size()){
    cout << ans[i];
  }
  cout << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <queue>
#include <assert.h>   
#include <vector>
#include <algorithm>
#include <time.h>
#include <numeric>
#include <string>
#include <cstring>
#include <stack>
#include <unordered_set>
#include <unordered_map>
#include <set>
#include <map>
#include <numeric>
#include <deque>
#include <iomanip>
#include <cstdlib>
#include <climits>
#include <cmath>
#include <cstdio>
using namespace std;


//#define double long double
//#define int long long
//#define int unsigned long long

#define ll long long
#define ld long double 
#define pi pair<int, int> 
#define pl pair<ll,ll>  
#define pd pair<ld,ld> 
#define str string  
#define mp make_pair
#define vi vector<int> 
#define vl vector<ll> 
#define vd vector<ld> 
#define vs vector<str> 
#define vpi vector<pi> 
#define vpl vector<pl> 
#define vpd vector<pd> 
#define si set<int> 
#define FF(i,j,n) for(signed i=j;i<=n;i++)  
#define DD(i,j,n) for(signed i=j;i>=n;i--) 
#define F(i,j,n) for(signed i=j;i<n;i++)   
#define D(i,j,n) for(signed i=j;i>n;i--) 
#define mem(a,b) memset(a,b,sizeof(a))
#define ndl cout << endl
#define ull unsigned long long 

const int inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3fLL;


#define sz(x) (signed)x.size()
#define all(x) begin(x), end(x)
#define rall(x) (x).rbegin(), (x).rend() 
#define rsz resize
#define ins insert 
#define ft front() 
#define bk back() 
#define X first
#define Y second
#define pf push_front 
#define pb push_back
#define eb emplace_back 
#define lb lower_bound 
#define ub upper_bound 
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define SHOWVECTOR(v) {std::cerr << #v << "\t: ";for(const auto& xxx : v){std::cerr << xxx << " ";}std::cerr << "\n";}
#define SHOWVECTOR2(v) {std::cerr << #v << "\t:\n";for(const auto& xxx : v){for(const auto& yyy : xxx){std::cerr << yyy << " ";}std::cerr << "\n";}}
//math

const int mod = 1e9 + 7;

ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
int pct(int x) { return __builtin_popcount(x); } 
int bit(int x) { return 31-__builtin_clz(x); } // floor(log2(x)) 
int cdiv(int a, int b) { return a/b+!(a<0||a%b == 0); } // division of a by b rounded up, assumes b > 0 


//DEBUG, compile with -DLOCAL
void DBG() { cerr << "]" << endl; }
template<class H, class... T> void DBG(H h, T... t) {
  cerr << to_string(h); if (sizeof...(t)) cerr << ", ";
  DBG(t...); }
#ifdef LOCAL 
#define dbg(...) cerr << "[" << #__VA_ARGS__ << "]: [", DBG(__VA_ARGS__)
#define HERE cout << "===GOTHERE===" << endl
#else
#define dbg(...) 42
#define HERE 42
#endif


 /* ============== END OF HEADER ============== */





const int maxn = 1e5*2+20;

int n,_,q,k;
int a[maxn];
int ans[maxn];

void solve(){
	cin >> n;
	FF(i,1,n){
		cin >> a[i];
	}
	int tt = a[1];
	FF(i,2,n){
		tt ^= a[i];
	}	
	FF(i,1,n){
		cout <<  (tt ^ a[i]) << " ";
	}
	ndl;

}

signed main(){
  //clock_t t1 = clock();  
	IOS
	solve();
  
  //cout << "THE ALGORITHM TOOK: " << (clock() - t1) * 1.0 / CLOCKS_PER_SEC * 1000 << "ms"<< endl;
	return 0;
}

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



int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll a, b; cin >> a >> b;
    int neg = max(0ll, min(b, -1ll) - a + 1);
    int poz = max(0ll, b - max(1ll, a) + 1);
    bool zero = (a <= 0 and 0 <= b);
    if (zero)
        return cout << "Zero" << '\n', 0;
    if (neg & 1)
        return cout << "Negative" << '\n', 0;
    else
        return cout << "Positive" << '\n', 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cstring>
#include <iostream>
#include <vector>
#include <cmath>
#include <math.h>
#include <utility>
#include <string>

using namespace std;

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



int comp(int initV,int years,double inter,int fee){
    int sum=0;
    sum = initV;
    for(int i=0;i<years;i++){
        sum = sum*(1+inter) - fee;
    }
    return sum;
}

int simp(int initV,int years,double inter,int fee){
    int A,interSum;
    A=initV;interSum=0;
    for(int i=0;i<years;i++){
        interSum+=A*inter;
        A-=fee;
    }
    return interSum+A;
}


int main(){
    int n,m,tmp,years;
    int initV;
    vector<int> ans;

    cin>>m;

    for(int i=0;i<m;i++){
        vector<int> tmpA;
        cin>>initV>>years>>n;
        for(int i=0;i<n;i++){
            int mode,fee;
            double inter;
            cin>>mode>>inter>>fee;
            if(mode == 0){
                tmp = simp(initV,years,inter,fee);
                tmpA.push_back(tmp);
            }else{
                tmp = comp(initV,years,inter,fee);
                tmpA.push_back(tmp);
            }
        }
        int max = *max_element(tmpA.begin(),tmpA.end());
        ans.push_back(max);
    }
    for(int i=0;i<ans.size();i++)cout<<ans[i]<<endl;
    return 0;
}


Measured memory_bytes: 3092
import math

X = int(input())

def era(n):
    O = [i + 2 for i in range(n-1)]
    P = []
    for i in range(int(math.sqrt(n))):
        P.append(O[0])
        O = [o for o in O if o % P[-1] != 0]
    for o in O:
        P.append(o)
    return P

P = era(2*X)
for i in range(len(P)):
    if X <= P[i]:
        print(P[i])
        break

Measured memory_bytes: 64332
// Problem : A - A?C
// Contest : AtCoder - AtCoder Beginner Contest 166
// URL : https://atcoder.jp/contests/abc166/tasks/abc166_a
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define db long double
#define pb push_back
#define pii pair<int,int>
#define vi vector<int>
#define vl vector<ll>
#define vii vector<pii>
#define mi map<int,int>
#define ml map<ll,ll>
#define mii map<pii,int>
#define fi first
#define se second
#define all(a) (a).begin(),(a).end()
#define sz(x) (int)x.size()
#define mod 1000000007
#define MAX 4294967295
#define EPS 1e-9
#define io ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define MAXN 15000005
#define inf 1e10
#define PI acos(-1.0)
#define int long long

string s;

signed main(){
    io;
    //freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
    cin>>s;
    if(s=="ABC") cout<<"ARC\n";
    else cout<<"ABC\n";
    return 0;
}


Measured memory_bytes: 3644
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long C = sc.nextLong();
        
        long x[] = new long[N+1];
        int v[] = new int[N+1];
        
        for(int i = 1; i <= N; i++) {
            x[i] = sc.nextLong();
            v[i] = sc.nextInt();
        }
        
        long right[][] = new long[N+1][2];
        long rightMax[][] = new long[N+1][2];
        for(int i = 1; i <= N; i++) {
            right[i][0] = x[i];
            right[i][1] = right[i-1][1] + v[i] - ( right[i][0] - right[i-1][0] );
            
            rightMax[i][0] = Math.max( rightMax[i-1][0], right[i][1] );
            rightMax[i][1] = Math.max( rightMax[i-1][1], right[i][1] - right[i][0] );
        }
        
        long left[][] = new long[N+1][2];
        long leftMax[][] = new long[N+1][2];
        for(int i = 1; i <= N; i++) {
            left[i][0] = C - x[N-i+1];
            left[i][1] = left[i-1][1] + v[N-i+1] - ( left[i][0] - left[i-1][0] );
            
            leftMax[i][0] = Math.max( leftMax[i-1][0], left[i][1] );
            leftMax[i][1] = Math.max( leftMax[i-1][1], left[i][1] - left[i][0] );
        }
        
        long ans = 0;
        for(int i = 0; i <= N; i++) {
            ans = Math.max( ans, rightMax[i][0] + leftMax[N-i][1] );
            ans = Math.max( ans, rightMax[i][1] + leftMax[N-i][0] );
        }
        
        System.out.println( ans );
    }
}


Measured memory_bytes: 73116
A, B, C, K = map(int, input().split())
result = 0

if 0 <= A and 0 <= B and 0 <= C:
    if 1 <= K and K <= A + B + C <= 2 * (10 ** 9):
        if min(A, K) == A:
            result = A
            K -= A
        else:
            result = K
            K = 0
        if K > 0:
            K -= B
        if K > 0:
            result -= K

print(result)

Measured memory_bytes: 9204
using System;
using System.Collections.Generic;

public class Program{
    public static void Main(){
        string[] line = Console.ReadLine().Trim().Split();
        var n = int.Parse(line[0]);
        var k = int.Parse(line[1]);
        double probability = 0.0;
        for(var i = 1; i <= n; i++){
            var coinCount = 0;
            var score = i;
            while(score < k){
                coinCount++;
                score *= 2;
            }
            probability += (double)1/n * Math.Pow(0.5,coinCount);
        }
        Console.WriteLine("{0}", probability);
        
        
    }
}


Measured memory_bytes: 13140
#include<stdio.h>
int main(void){
  int a,b,i;
  scanf("%d%d",&a,&b);
 double ret;
 for(int i=1;i<=a;i++){
double tmp=1.0/a;
int now=i;
while(now<b){
now*=2;
tmp/=2;
}
ret+=tmp;
}
printf("%.12f\n",ret);
return 0;
}

Measured memory_bytes: 128
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <iostream>
#include <vector>
using namespace std;

const int N = 1e6 + 7;

int cnt[N];
int k, t, a[N], ans = 0;

int main() {
	scanf("%d %d", &k, &t);
	for (int i = 0; i < t; i++) {
		scanf("%d", &a[i]);
	}
	int last = -1;
	while (k) {
		int which = -1;
		for (int i = 0; i < t; i++) {
			if (a[i] > 0 && i != last) {
				if (which == -1 || a[which] < a[i]) {
					which = i;
				}
			}
		}
		k--;
		if (which == -1) {
			ans++;
			a[last]--;
		} else {
			a[last = which] --;
		}
	}
	printf("%d\n", ans);
	return 0;
}


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

int main(int argc, char *argv[]) {
  int N;
  cin >> N;
  int A[N];
  for(int i = 0; i < N; i++) {
    cin >> A[i];
    A[i] -= (i + 1);
  }

  sort(A, A + N);

  long long ans = 0;
  for(int i = 0; i < N; i++) {
    ans += abs(A[i] - A[N/2]);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define rep(i,start,lim) for(lld i=start;i<lim;i++)
#define repd(i,start,lim) for(lld i=start;i>=lim;i--)
#define scan(x) scanf("%lld",&x)
#define print(x) printf("%lld ",x)
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define br printf("\n")
#define sz(a) lld((a).size())
#define YES printf("YES\n")
#define NO printf("NO\n")
#define all(c) (c).begin(),(c).end()
using namespace std;
#define INF         1011111111
#define LLINF       1000111000111000111LL
#define EPS         (double)1e-10
#define MOD         1000000007
#define PI          3.14159265358979323
using namespace std;
typedef long double ldb;
typedef long long lld;
lld powm(lld base,lld exp,lld mod=MOD) {lld ans=1;while(exp){if(exp&1) ans=(ans*base)%mod;exp>>=1,base=(base*base)%mod;}return ans;}
typedef vector<lld> vlld;
typedef pair<lld,lld> plld;
typedef map<lld,lld> mlld;
typedef set<lld> slld;
#define N 1000005
int main()
{
	lld s=0,m=0,a,b,c;
	cin>>a>>b>>c;
	s=a+b+c,m=max(a,max(b,c));
	cout<<s-m;
	return 0;
}

Measured memory_bytes: 256
/*　　　　　　　{:i:i:|i:i:/l/l--　 　 　--l/li:i:i|i:i:i:i}
　　　　　　 　 {:rx|:i:i ィi芥ミ 　 　 .ィi芥ミｉ:ｉ|ﾍ:i:i:}
.　　　 　 　 　 ｛ﾏ|ｉ:  {::’:} 　 　 　{:‘::} :ｉ:i:|〉｝:/
　　 　 　 　 　 乂|:i:| ｀¨¨¨¨´ 　 　　｀¨¨¨´  :i:ｉ:|ｼ/
　 　 　 　 　 　 ﾉ:|:i|　　　　　　′　　　 　   |:i:i:|ﾂ
　　　　　　　　/:/|:i:| ､　　　 　_ _ 　　　　  |:i:i:|
　 　 　　 　 /:/ .|:i:|/ ＼　　　 　 　     ｨ〔|:i:/
　　 　 　  　 〈;/ く刈＿ 个 　   -   　＜}　./|/_〉
　　     　　 r-っ'~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ|___
　　 　     /／ニつ　　　　　　 ､　　　　　　　ノﾆﾆ　＼
.　　　     |　　ニ⊃ 　./　/　 ──   /　/　　..⊆ﾆﾆ　　:|
.　　　     |　　丁´　 /|￣|￣  ─‐ /|￣|￣ 　 .￣|丁 　|
.　　　     |　　ﾉ.  　 |￣|￣  ─‐  |￣|￣ 　 　.|八 　|
.　　　     |　　||. 　 |￣|￣ |￣| |￣|￣ 　   .|　|
.　 　 　   |  　||   　￣￣￣　￣ 　￣￣￣　　  .|　|  |
.　 　 　  　    ||＿＿＿＿＿＿＿＿＿＿＿＿______|__　　 ',
　 　      ,′　 | ７ﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆ}  ,′
.　　     {　　　|/　}ﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆ{/ 　 　
*/
#include <iostream> // cout, endl, cin
#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

using namespace std;

#define rep(a) _rep(0,int(a))
#define _rep(a,b) for(int i=int(a);i<int(b);i++)
#define ll long long
#define fst first
#define snd second


//factorial
int fact(int n) {
	int a = 1;
	for (int i = 1;i <= n;i++) a *= i;
	return a;
}

int n,a, b;
int main() {
	cin >> n;
	if (n == 1) cout << "Hello World" << endl;
	else {
		cin >> a >> b;
		cout << (a + b) << endl;
	}
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n,m) for(int i=n;i<(int)(m);i++)
#define rrep(i,n,m) for(int i=((int)(n)-1);i>=m;i--)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
using namespace std;
int main(){
    ll a,b,c;
    cin>>a>>b>>c;
    cout<<min({(c%2)*a*b,(a%2)*b*c,(b%2)*c*a})<<endl;
}


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

int main() {
  int N;
  cin>>N;
  vector<int> p(N);
  vector<pair<int,int>> q(N-1);
  for(int i=0;i<N-1;i++){
    int a;
    cin>>a;
    q[i]=make_pair(a,i);
  }
  sort(q.begin(),q.end());
  for(int i=N-2;i>=0;i--){
    int a,b;
    tie(a,b)=q[i];
    p[b]=a;
    p[b+1]=a;
  }
  int Z=0;
  for(int i=0;i<N;i++){
    Z+=p[i];
  }
  cout<<Z<<endl;
}

Measured memory_bytes: 3572
#include<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i) 
#define PI acos(-1)

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

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

using vv = vector<vector<mint>>;
using vvv = vector<vv>;
using vvvv = vector<vvv>;

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

    ll l, r;
    cin>>l>>r;
    int d = 0;
    vector<int> s, t;
    while (r > 0) {
        s.push_back(r % 2);
        r /= 2;
        d++;
    }
    reverse(s.begin(), s.end());
    rep(i, d) {
        t.push_back(l % 2);
        l /= 2;
    }
    reverse(t.begin(), t.end());

    vvvv dp(d + 1, vvv(2, vv(2, vector<mint>(2))));  // ケタ、y==R、x==L、最初のケタが現れたか
    dp[0][0][0][0] = 1;
    rep(i, d) rep(j, 2) rep(k, 2) rep(l, 2) {
        mint prev = dp[i][j][k][l];
        rep(x, 2) rep(y, 2) {
            if (x && !y) continue;

            int ni = i + 1, nj = j, nk = k, nl = l;

            // dame
            if (!l && x != y) continue;
            if (!s[i] && !j && y) continue;
            if (t[i] && !k && !x) continue;
            
            // nj -> 1
            if (s[i] && !j && !y) nj = 1;
            // nk -> 1
            if (!t[i] && !k && x) nk = 1;
            // nl -> 1
            if (!l && x && y) nl = 1;
            dp[ni][nj][nk][nl] += prev;
        }
    }

    mint ans = 0;
    rep(i, 2) rep(j, 2) rep(k, 2) ans += dp[d][i][j][k];
    cout<<ans<<endl;
}

Measured memory_bytes: 256
// #include <bits/stdc++.h>
#include<iostream>
#include<iomanip>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<set>
#include<map>
#include<queue>
#define rep(i,n) for(int i=0;i<n;i++)
#define exf(x)	 for(auto&& tmp : x) { cout << tmp << endl; }	// 拡張for
#define PI 3.14159265358979323846264338327950288
const int MOD{ int(1e9 + 7) };	// = 1000000007
const int inf{ 2100000000 };	// = 2100000000 (MAX:2147483647)
typedef long long ll;
using namespace std;

// -------------------------------------------------- //
// ------------------ ここから本編 ------------------ //
// -------------------------------------------------- //

int main(void) {

	int N; cin >> N;
	vector<int>h(N); rep(i, N)cin >> h[i];

	int cnt = 0, i = 0;
	while (i < N) {
		if (h[i] == 0) {
			i++;
			continue;
		}

		for (int j = i; j < N; j++) {
			if (h[j] == 0) break;
			h[j]--;
		}
		cnt++;
	}

	cout << cnt << endl;
	return 0;
}


Measured memory_bytes: 3624
#include <bits/stdc++.h> // {{{
// clang-format off
#define ARG4(_1, _2, _3, _4, ...) _4
#define rep(...) ARG4(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define REP(i, a) FOR(i, 0, a)
#define FOR(i, a, b) for (int i = (a); i < (int)(b); ++i)
#define rrep(...) ARG4(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
#define RREP(i, a) RFOR(i, 0, a)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (int)(a); --i)
#define ALL(c) (c).begin(), (c).end()
#define TEN(n) ((ll)(1e##n))
#define pb emplace_back
#define mp make_pair
#define fi first
#define se second
#define USE1(T) template <typename T> inline
#define USE2(T, U) template <typename T, typename U> inline
#define mygc(c) (c) = getchar_unlocked()
#define mypc(c) putchar_unlocked(c)
 
template<typename T> using vec = std::vector<T>;
template<typename T> using withi = std::pair<T, int>;
using ll = long long;
USE2(T,U)bool chmax(T&x,U a){return x<a&&(x=a,1);}
USE2(T,U)bool chmin(T&x,U a){return a<x&&(x=a,1);}
USE1(T=int)T in(){T x;std::cin>>x;return x;}
USE1(T=int)vec<T>in(int n){vec<T>v;v.reserve(n);rep(i,n)v.pb(in<T>());return v;}
USE2(T,U=withi<T>)vec<U>zipi(const vec<T>&x,int s=0){int N=x.size();vec<U>v;v.reserve(N);rep(i,N)v.pb(x[i],s+i);return v;}
USE1(T)vec<T>ndvec(T v,int n){return vec<T>(n,v);}
USE2(T,...Ts)auto ndvec(T v,int n,Ts...ns)->vec<decltype(ndvec(v,ns...))>{return ndvec(ndvec(v,ns...),n);}
USE1(T)void pr(T x){std::cout<<x<<'\n';}
USE2(T,...Ts)void pr(T x,Ts...xs){std::cout<<x<<' ';pr(xs...);}
USE1(T=int)T rd(){T x=0,m=0,k;for(;;){mygc(k);if(k=='-'){m=1;break;}if('0'<=k&&k<='9'){x=k-'0';break;}}for(;;){mygc(k);if(k<'0'||'9'<k)break;x=x*10+k-'0';}return x;}
USE1(T=int)void wr(T x,char c='\n'){int s=0,m=0;char b[32];if(x<0)m=1,x=-x;for(;x;x/=10)b[s++]=x%10;if(!s)b[s++]=0;if(m)mypc('-');for(;s--;)mypc(b[s]+'0');mypc(c);}
// clang-format on
// }}}
struct IoSetup { // {{{
  IoSetup() {
    std::ios::sync_with_stdio(0);
    std::cin.tie(0);
    std::cout.precision(10);
    std::cerr.precision(10);
  }
} iosetup; //}}}
using namespace std;
const int inf = 1001001001;
const ll infl = 1001001001001001001ll;
const int dd[] = {0, 1, 0, -1, 0};

signed main() {
  int N = in();
  int A = 0;
  rep(i, N) {
    auto s = in<string>();
    if (s == "A") {
      A++;
    } else {
      if (A == 0) {
        pr("NO");
        return 0;
      }
      A--;
    }
  }
  if (A == 0) {
    pr("YES");
  } else {
    pr("NO");
  }

  return 0;
}

Measured memory_bytes: 3212
s = list(map(lambda x: ord(x) - 96, input()))
t = list(map(lambda x: ord(x) - 96, input()))
N = len(s)
M = len(t)
s.sort()
t.sort(reverse=True)
s.extend([0] * max(M - N, 0))
t.extend([0] * max(N - M, 0))
for i in range(max(N, M)):
	if s[i] == t[i]:
		continue
	print("Yes" if s[i] < t[i] else "No")
	break
else:
	print("No")


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

using namespace std;


int main(void)
{
    int n, x, y;
    cin >> n >> x >> y;

    if (x > y)
    {
        const int temp = x;
        x = y;
        y = temp;
    }
    x--; y--;

    vector<int> cnts(n - 1);
    for (int i = 0; i < n - 1; i++)
    {
        for (int j = i + 1; j < n; j++)
        {
            const int dist = min(j - i, abs(i - x) + abs(j - y) + 1);
            cnts[dist - 1]++;
        }
    }
    
    for (int i = 0; i < n - 1; i++)
    {
        cout << cnts[i] << endl;
    }
}


Measured memory_bytes: 256
#include<stdio.h>
int MIN(int a,int b){return a<b?a:b;}
int R=1,C=1,H[2000010],N[2000010];
//評価関数（いまはMIN）
int hyouka(int a,int b){
  if(C<b)return 1;
  if(C<a||b==0)return 0;
  return N[H[a]]<N[H[b]]?1:0;
}
//挿入関数
void hin(int a){
  int i=C++;
  for(N[H[0]=R]=a;hyouka(0,i/2);i/=2)H[i]=H[i/2];
  H[i]=R++;
}
//取り出す関数
int hout(){
  int rt=H[1],i,j=2,k=H[--C];
  for(i=1;hyouka(i,C);i=j)H[i]=H[j=i*2+1-hyouka(i*2,i*2+1)];
  H[j/2]=k;
  return rt;
}
int main(){
  int n,m,i,j;
  long long s=0,a,b[100010];
  scanf("%d %d",&n,&m);
  for(i=0;i<n;i++){
    scanf("%lld %lld",&a,&b[R]);
    hin(a);
  }
  for(i=0;i<n;i++){
    j=hout();
    a=MIN(m,b[j]);
    m-=a;
    s+=a*N[j];
  }
  printf("%lld\n",s);
  return 0;
}
    


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

int main(void){
  int N; cin >> N;
  vector<int> h(N);
  for(auto& _h: h){
    cin >> _h;
  }

  int ans = 0;
  for(int height = 1; height <= 100; height++){
    int prev = false;
    for(int i = 0; i < N; i++){
      if(h[i] < height){
        prev = false;
      }else{
        if(prev == false){
          ans++;
          prev = true;
        }else{
        }
      }
    }
  }
  cout << ans << endl;
}


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

using namespace std;
int countDigit(int n)
{
    int countr=0;
    while(n!=0)
    {
        n=n/10;
        countr++;
    }
    return countr;
}
int main()
{
    int n;
    cin>>n;
    int digitNum=countDigit(n);
        if(digitNum%2==0){
        if(digitNum==2)
            cout<<9<<endl;
        else if(digitNum==4)
            cout<<909<<endl;
        else
            cout<<90909<<endl;
        }else{
            if(digitNum==1)
                cout<<n<<endl;
            else if(digitNum==3)
                cout<<9+(n-100)+1<<endl;
            else
                cout<<9+900+(n-10000)+1<<endl;
        }

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
using namespace std;
typedef long long ll;

int main()
{
    ll n, m, d;
    cin >> n >> m >> d;
    if(d != 0) cout << fixed << setprecision(15) << (n - d) * 2.0 * (m - 1) / (n * n) << endl;
    else cout << fixed << setprecision(15) << (n - d) * 1.0 * (m - 1) / (n * n) << endl;
}

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

typedef long long ll;

using namespace std;

#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,l,n) for(int i=(l);i<(n);i++)


int main(){
    int X,Y,Z;
    cin >> X >> Y >> Z;
    cout << Z << " " << X << " " << Y << endl; 
    return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const int INF = (1<<30);
const ll INFLL = (1ll<<60);
const ll MOD = (ll)(1e9+7);

#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	a = (a<MOD)?a:(a-MOD);
	b = (b<MOD)?b:(b-MOD);
	a += b;
	a = (a<MOD)?a:(a-MOD);
}

int main(void){
	int n,i,k,h,ans=0;
	cin >> n >> k;
	for(i=0; i<n; ++i){
		cin >> h;
		if(h<k){
			continue;
		}
		++ans;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
N, M = map(int, input().split())

image = []
template = []

for _ in range(N):
  image.append([c for c in input()])

for _ in range(M):
  template.append([c for c in input()])
  
# 左上の座標が与えられる  
def is_match(a, b):
  for i in range(M):
    for j in range(M):
      if template[i][j] != image[a + i][b + j]:
        return False
  return True

def solve():
  for i in range(0, N - M + 1):
    for j in range(0, N - M + 1):
      if is_match(i, j):
        return True
  return False

if solve():
  print('Yes')
else:
  print('No')
  

Measured memory_bytes: 38896
#include <iostream>
#include <algorithm>
#include <map>
#include <utility>
#include <string>
#include <vector>

using namespace std;

const int INF = 1 << 29;

string f(string x, int L) {
    string result = "";
    vector<int> v;
    int maximum = 0, minimum = 0;

    for(int i = 0; i < x.size(); i++) {
        v.push_back(x[i] - '0');
    }
    for(int i = 0; i < L - x.size(); i++) {
        v.push_back(0);
    }
    sort(v.begin(), v.end());

    for(int i = 0; i < v.size(); i++) {
        maximum *= 10;
        minimum *= 10;
        maximum += v[v.size() - i - 1];
        minimum += v[i];
    }

    int pow = 1;
    int diff = maximum - minimum;

    for(int i = 0; i < v.size() - 1; i++) pow *= 10;

    for(int i = 0; i < v.size(); i++) {
        result += char((diff / pow) + '0');
        diff %= pow;
        pow /= 10;
    }
 
    return result;
}

int main() {
    string A, x, ans;
    int L;
    while(cin >> A >> L) {
        if(A == "0" && L == 0) break;

        int point = 0, diff = INF; 

        vector<string> memo;        
        memo.push_back(A);
        int res = INF;
      
        for(int i = 1; i <= 20; i++) {
            x = f(A, L);
            memo.push_back(x);
            A = x;
        }

        for(int i = 0; i < memo.size(); i++) {
            for(int j = i+1; j < memo.size(); j++) {
                if(memo[i] == memo[j] && diff > j - i) {
                    ans = memo[i];
                    diff = j - i;
                    point = i;
                }
            }
        }

        cout << point << ' ' << atoi(ans.c_str()) << ' ' << diff << endl;
    }
}

Measured memory_bytes: 1252
#include <stdio.h>

int main(void)
{
    int n;
    scanf("%d", &n);
    int i;
    int sum = 0;
    int l, r;
    for (i = 0; i < n; i++) {
        scanf("%d %d", &l, &r);
        sum += r - l + 1;
    }
    printf("%d\n", sum);
    return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_set>
#include<unordered_map>
#include<bitset>
using namespace std;
#define INF 1000000007
#define LINF 100000000000000007
#define MOD 1000000007
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define repb(i, n) for (int i = n - 1; i >= 0; i--)
//#define MODE 1
#ifdef MODE
#define DEB(X) cout<< #X <<": "<<X<<" ";
#define ARDEB(i,X) cout<< #X <<"["<<i<<"]: "<<X[i]<<" ";
#define END cout<<endl;
#else
#define DEB(X) {}
#define ARDEB(i,X) {}
#define END {}
#endif
//typedef long long int ll;
typedef pair<int,int> P;
struct edge{int to,cost;};
signed main(){
	
	int a,b;
    cin>>a>>b;
    if(a>9 || b>9)cout<<-1<<endl;
    else cout<<a*b<<endl;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, n) for(int i=0; i<int(n); i++)
#define RNG(i, f, t) for(int i=int(f); i<=int(t); i++)
bool RELAXED = false;
template<int,typename T> struct MINMAX{ T val; MINMAX(T val) : val(val) {} };
template<typename T> MINMAX<1,T> MAX(T val) { return MINMAX<1,T>(val); };
template<typename T> MINMAX<2,T> MIN(T val) { return MINMAX<2,T>(val); };
template<typename T, typename U> inline T& operator|=(T &lhs, MINMAX<1,U> rhs) { return lhs = (rhs.val > lhs ? (RELAXED=true,rhs.val) : (RELAXED=false,lhs)); }
template<typename T, typename U> inline T& operator|=(T &lhs, MINMAX<2,U> rhs) { return lhs = (rhs.val < lhs ? (RELAXED=true,rhs.val) : (RELAXED=false,lhs)); }
template<typename T> inline vector<T> readVector(int n) { vector<T> vec(n); FOR(i,n) cin>>vec[i]; return vec; }
template<typename T> void EXIT(T answer) { cout<<answer<<endl; exit(0); }
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<pii> vpii;
typedef signed long long int ll;

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

    ll n, m;
    cin>>n>>m;
    ll ans = n * (n-1) / 2+ m * (m-1) / 2;
    cout<<ans<<endl;

    return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
   string s,k;
   cin >> s;
   cin >> k;
   bool flag=true;
   for(int i=0;i<s.length();++i){
          if(s[i]!=k[i]){
              flag=false;
              break;
          }
   }
   if(flag) cout << "Yes\n";
   else cout << "No\n";


}


Measured memory_bytes: 3628
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int MOD = pow(10, 9) + 7;
//const int MOD = 998244353;
//const int MOD = ;
int mod(int A, int M) {return (A % M + M) % M;}
const int INF = 1LL << 60;
const string ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const string abc = "abcdefghijklmnopqrstuvwxyz";
template <class T> bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template <class T> bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
int divCeil(int A, int B) {return (A + (B - 1)) / B;}

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

  int a = A, b = B, c = C;
  int ans = 0;
  while (a % 2 + b % 2 + c % 2 == 0)
  {
    int _a = a / 2, _b = b / 2, _c = c / 2;
    a = _b + _c;
    b = _c + _a;
    c = _a + _b;
    if (a == A && b == B && c == c)
    {
      ans = -1;
      break;
    }
    ans++;
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include <algorithm>
#include <string>
using namespace std;
#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(int)(n); i++)
typedef long long ll;
const int INF = numeric_limits<double>::max();
const int MOD = (1e9 + 7);


int main(){
  int N, A, T, ans=1;
  double min = INF;
  cin >> N >> T >> A;
  double H[N];
  rep(i, N){
    cin >> H[i];
  }
  rep(i, N){
    if(min > (double)abs(A - T + (0.006*H[i]))){
      min = (double)abs(A - T + (0.006*H[i]));
      ans = i+1;
    }
  }
  cout << ans << endl;
       
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    //Rounding
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt(), a = sc.nextInt();
        if (x < a) System.out.println(0);
        else System.out.println(10);
    }
}


Measured memory_bytes: 21716
import java.util.*;

public class Main{

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(true){
            int n = sc.nextInt();
            int x = sc.nextInt();
            if(n == 0 && x == 0) break;
            int ans = 0;
            for (int i = 1; i <= n; i++) {
                for (int j = i+1; j <= n; j++) {
                    for (int k = j+1; k <= n; k++) {
                        if(i + j + k == x) ans++;
                    }
                }
            }
            System.out.println(ans);
        }
        sc.close();

    }

}



Measured memory_bytes: 26960
HW = input()
H,W = HW.split()
H = int(H)
W = int(W)

ma = []
swap = []

for i in range(H):
    row = input()
    ma.append([int(x) for x in row.split()])

for i in range(H):
    row = ma[i]
    for j in range(len(row)):
        coins = int(row[j])
        if coins%2 == 1:
            if j == len(row)-1:
                if i == H-1:
                    break
                swap.append([i+1, j+1, i+2, j+1])
                ma[i+1][j] += 1
            else:
                swap.append([i+1, j+1, i+1, j+2])
                ma[i][j+1] += 1
        
print(len(swap))
for w in swap:
    z = [str(u) for u in w]
    print(" ".join(z))

Measured memory_bytes: 29720
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <list>

using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); ++i)
typedef long long ll;

/*
 * N = 12000 = 1 * 12000, 2 * 600, ..... ,6 400 * 30 ....., 12000 * 1
 *
 */
int main() {
    //AとBできるだけ同じくらいの数にしたい。
    ll n;
    ll a = 0;
    ll b = n;

    cin >> n;

    for(int i = 1; i <= n; i++) {
        ll b = n / i;

        if(n % i == 0) a = i;

        if(i > b) break;
    }

    ll num = max(a, n/a); //A*Bのうちでかいほう

    int ans = 0;
    while(num >= 1) {
        num /= 10;
        ans += 1;
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
/*
[abc148] F - Playing Tag on Tree
*/

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;

const int MAX_N = 1e5 + 5;
const int MAX_V = MAX_N;
const int MAX_LOG_V = 32;

vector<int> g[MAX_V];
int par[MAX_LOG_V][MAX_V];
int dep[MAX_V];

void dfs_lca(int v, int p = -1, int d = 0) {
    par[0][v] = p;
    dep[v] = d;
    for (int to : g[v]) {
        if (to == p) {
            continue;
        }
        dfs_lca(to, v, d + 1);
    }
}

int lca(int u, int v) {
    if (dep[u] > dep[v]) {
        swap(u, v);
    }
    for (int k = 0; k < MAX_LOG_V; k++) {
        if (((dep[v] - dep[u]) >> k) & 1) {
            v = par[k][v];
        }
    }
    if (u == v) {
        return u;
    }
    for (int k = MAX_LOG_V - 1; k >= 0; k--) {
        if (par[k][u] != par[k][v]) {
            u = par[k][u];
            v = par[k][v];
        }
    }
    return par[0][u];
}

void init(int root) {
    dfs_lca(root);
    for (int k = 1; k < MAX_LOG_V; k++) {
        for (int v = 0; v < MAX_V; v++) {
            par[k][v] = (par[k - 1][v] < 0) ? -1 : par[k - 1][par[k - 1][v]];
        }
    }
}

int N;
int TK, AO;

ll solve() {
    init(AO);

    int ans = 0;
    for (int i = 0; i < N; i++) {
        int w = lca(i, TK);
        if (dep[w] > dep[TK] - dep[w]) {
            ans = max(ans, dep[i] - 1);
        }
    }
    ans = max(ans, 0);

    return ans;
}

int main() {
    cin >> N >> TK >> AO;
    TK--, AO--;
    for (int i = 0; i < N - 1; i++) {
        int a, b;
        cin >> a >> b;
        g[a - 1].push_back(b - 1);
        g[b - 1].push_back(a - 1);
    }

    cout << solve() << endl;

    return 0;
}


Measured memory_bytes: 22400
#include<bits/stdc++.h>
using namespace std;
#define ALL(obj) (obj).begin(), (obj).end()
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define REP(i, n) for(int i = 0; i < (n); ++i)

#define ABS(a) ((a < 0) ? ((-1)*(a)) : (a))

#define endl "\n"
#define pb push_back
#define rtn return
#define elif else if

#define MOD 1000000007
 
const int dx_4[]={1,0,-1,0}, dy_4[]={0,-1,0,1};
const int dx_8[]={1,1,0,-1,-1,-1,0,1}, dy_8[]={0,-1,-1,-1,0,1,1,1};

typedef long long ll;
typedef unsigned long long ull;

template <typename T>
inline T GCD(T a,T b){T c;while(b!=0){c=a%b;a=b;b=c;}return a;}
template <typename T>
inline T LCM(T a,T b){T c=GCD(a,b);a/=c;return a*b;}
template <typename T>
inline T nCr(T a,T b){T i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
template <typename T>
inline T nHr(T a,T b){return nCr(a+b-1,b);}
template <typename T>
inline T POW(T a,T b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}

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

	ll a, b, c, k;
	cin >> a >> b >> c >> k;
	if(k % 2 == 0) cout << a - b << endl;
	else cout << b - a << endl;
	rtn 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdlib>
#include<string>
#include<vector>
#include<map>
#include<unordered_map>
#include<queue>
#include<algorithm>
#include<iomanip>
using namespace std;
using ll = long long int;
const int mod = 1e9 + 7;
#define rep(i, a, b) for(int i = a;i < b; i++)

int main() {

	int n, d, ans = 0;
	cin >> n >> d;

	d = 2 * d + 1;

	ans = n / d;
	
	if (n % d != 0) ans++;

	cout << ans << endl;

	return 0;
}


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

using namespace std;

#define LL long long
#define int long long
#define fi first
#define se second
#define double long double
#define pll pair<LL, LL>
#define pii pair<LL, LL>
#define fastio ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);

constexpr int N = 1e6+5;
constexpr int M = 1e9+7;

// #define DEBUG 1  //调试开关
struct IO {
#define MAXSIZE (1 << 20)
#define isdigit(x) (x >= '0' && x <= '9')
    char buf[MAXSIZE], *p1, *p2;
    char pbuf[MAXSIZE], *pp;

    IO() : p1(buf), p2(buf), pp(pbuf) {}
    ~IO() { fwrite(pbuf, 1, pp - pbuf, stdout); }

    inline char gc() {
        if (p1 == p2) p2 = (p1 = buf) + fread(buf, 1, MAXSIZE, stdin);
        return p1 == p2 ? ' ' : *p1++;
    }
    inline bool blank(char ch) {
        return ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t';
    }
    template <class T>
    inline void read(T &x) {
    double tmp = 1;
    bool sign = 0;
    x = 0;
    char ch = gc();
    for (; !isdigit(ch); ch = gc())
        if (ch == '-') sign = 1;
    for (; isdigit(ch); ch = gc()) x = x * 10 + (ch - '0');
    if (ch == '.')
        for (ch = gc(); isdigit(ch); ch = gc())
        tmp /= 10.0, x += tmp * (ch - '0');
    if (sign) x = -x;
    }
    inline void read(char *s) {
    char ch = gc();
    for (; blank(ch); ch = gc())
        ;
    for (; !blank(ch); ch = gc()) *s++ = ch;
    *s = 0;
    }
    inline void read(char &c) {
    for (c = gc(); blank(c); c = gc())
        ;
    }
    inline void push(const char &c) {
    #if DEBUG  //调试，可显示字符
    putchar(c);
    #else
    if (pp - pbuf == MAXSIZE) fwrite(pbuf, 1, MAXSIZE, stdout), pp = pbuf;
    *pp++ = c;
    #endif
    }
    template <class T>
    inline void write(T x) {
    if (x < 0) x = -x, push('-');  // 负数输出
    static T sta[35];
    T top = 0;
    do {
        sta[top++] = x % 10, x /= 10;
    } while (x);
    while (top) push(sta[--top] + '0');
    }
    template <class T>
    inline void write(T x, char lastChar) {
    write(x), push(lastChar);
    }
} io;

int n;
string s;
unordered_set<string> st;

signed main() {
    fastio;
    cin >> n;
    for (int i = 1; i <= n; i++) {
        cin >> s;
        st.insert(s);
    }
    cout << st.size() << endl;
    return 0;
}

Measured memory_bytes: 17644
import java.util.*; import java.io.*; import java.math.*;
public class Main{
	//Don't have to see. start------------------------------------------
	static class InputIterator{
		ArrayList<String> inputLine = new ArrayList<String>(1024);
		int index = 0; int max; String read;
		InputIterator(){
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			try{
				while((read = br.readLine()) != null){
					inputLine.add(read);
				}
			}catch(IOException e){}
			max = inputLine.size();
		}
		boolean hasNext(){return (index < max);}
		String next(){
			if(hasNext()){
				return inputLine.get(index++);
			}else{
				throw new IndexOutOfBoundsException("There is no more input");
			}
		}
	}
	static HashMap<Integer, String> CONVSTR = new HashMap<Integer, String>();
	static InputIterator ii = new InputIterator();//This class cannot be used in reactive problem.
	static PrintWriter out = new PrintWriter(System.out);
	static void flush(){out.flush();}
	static void myout(Object t){out.println(t);}
	static void myerr(Object t){System.err.print("debug:");System.err.println(t);}
	static String next(){return ii.next();}
	static boolean hasNext(){return ii.hasNext();}
	static int nextInt(){return Integer.parseInt(next());}
	static long nextLong(){return Long.parseLong(next());}
	static double nextDouble(){return Double.parseDouble(next());}
	static ArrayList<String> nextStrArray(){return myconv(next(), 8);}
	static ArrayList<String> nextCharArray(){return myconv(next(), 0);}
	static ArrayList<Integer> nextIntArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Integer> ret = new ArrayList<Integer>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Integer.parseInt(input.get(i)));
		}
		return ret;
	}
	static ArrayList<Long> nextLongArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Long> ret = new ArrayList<Long>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Long.parseLong(input.get(i)));
		}
		return ret;
	}
	static String myconv(Object list, int no){//only join
		String joinString = CONVSTR.get(no);
		if(list instanceof String[]){
			return String.join(joinString, (String[])list);
		}else if(list instanceof ArrayList){
			return String.join(joinString, (ArrayList)list);
		}else{
			throw new ClassCastException("Don't join");
		}
	}
	static ArrayList<String> myconv(String str, int no){//only split
		String splitString = CONVSTR.get(no);
		return new ArrayList<String>(Arrays.asList(str.split(splitString)));
	}
	public static void main(String[] args){
		CONVSTR.put(8, " "); CONVSTR.put(9, "\n"); CONVSTR.put(0, "");
		solve();flush();
	}
	//Don't have to see. end------------------------------------------
	static void solve(){//Here is the main function
      int N = nextInt();
      int H = nextInt();
      int M = nextInt();
      myout((N - H + 1) * (N - M + 1));
	}
	//Method addition frame start


  
	//Method addition frame end
}


Measured memory_bytes: 32964