akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <cstring>
#include <iomanip>

using namespace std;
// ascending order
#define vsort(v) sort(v.begin(), v.end())
// descending order
#define vsort_r(v) sort(v.begin(), v.end(), greater<int>())
#define vunique(v) unique(v.begin(), v.end())
#define mp make_pair
#define ts(x) to_string(x)
#define rep(i, a, b) for(int i = (int)a; i < (int)b; i++)
#define repm(i, a, b) for(int i = (int)a; i > (int)b; i--)
#define bit(a) bitset<8>(a)
#define des_priority_queue priority_queue<int, vector<int>, greater<int> >
#define all(v) (v).begin(), (v).end()
typedef long long ll;
typedef pair<int, int> P;
const ll INF = 1ll << 60;

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

int N;
vector<int> a;

double dp[310][310][310];

double rec(int i, int j, int k) {
    if(dp[i][j][k] >= 0) return dp[i][j][k];
    if(i == 0 and j == 0 and k == 0) return 0.0;

    double rsl = 0.0;
    if(i > 0) rsl += rec(i - 1, j, k) * i;
    if(j > 0) rsl += rec(i + 1, j - 1, k) * j;
    if(k > 0) rsl += rec(i, j + 1, k - 1) * k;
    rsl += N;
    rsl *= 1.0 / (i + j + k);

    return dp[i][j][k] = rsl;
}

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

    cin >> N;
    int one = 0, two = 0, three = 0;
    rep(i, 0, N) {
        int a;
        cin >> a;
        if(a == 1) one++;
        else if(a == 2) two++;
        else three++;
    }
    memset(dp, -1, sizeof(dp));

    cout << fixed << setprecision(20) << rec(one, two, three) << endl;
}


Measured memory_bytes: 233088
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) {
        FastScanner fs = new FastScanner();
        String s = fs.next();

        if (s.charAt(s.length()-1) == 's') {
            System.out.println(s+"es");

        } else {
            System.out.println(s+"s");
        }

    }


    static class FastScanner {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer("");
        String next() {
            while (!st.hasMoreTokens())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }
        int[] readArray(int n) {
            int[] a=new int[n];
            for (int i=0; i<n; i++) a[i]=nextInt();
            return a;
        }
        long nextLong() {
            return Long.parseLong(next());
        }
    }

}


Measured memory_bytes: 36528
#include <iostream>
#include <vector>
#include <iomanip>
#include <stack>
#include <array>
#include <deque>
#include <forward_list>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iterator>
#include <string>
#include <cstring>
#include <fstream>
#include <random>
#include <time.h>
#include <complex>
#include <cmath>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n;i>0;i--)
#define arep(a,i,n) for(int i=(a);i<(n);i++)
#define SORT(v) sort((v).begin(),(v).end())
#define TEMP(type,x,y) do {temp temp=x,x=y,y=temp}while(0)
const ll INF = (1LL << 50);

int main() {

	string s;
	cin >> s;

	int n = s.size();
	int count1 = 0;
	int count2 = 0;
	REP(i, n) {
		if (i % 2 == 0) {
			if (s[i] == '0') count1++;
			if (s[i] == '1') count2++;
		}
		else {
			if (s[i] == '1') count1++;
			if (s[i] == '0') count2++;
		}
	}

	cout << min(count1, count2) << endl;


	return 0;

}

Measured memory_bytes: 512
// include
// ------------------------------------------------
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <math.h>

using namespace std;

// func
// ------------------------------------------------
int CalcSumOfDigit(int n);      // 各桁の和を計算する。

// define
// ------------------------------------------------
#define all(a)        (a).begin(),(a).end()
#define rall(a)       (a).rbegin(),(a).rend()
#define pb            push_back
#define sz(a)         int((a).size())
#define rep(i,n)      for(int(i)=0;(i)<(n);(i)++)
#define repe(i,n)     for(int(i)=0;(i)<=(n);(i)++)
#define vsort(v)      sort((v).begin(),(v).end())
#define rvsort(v)     sort(rall((v)))
#define vi            vector<int>

const int INF = 1e9;

// code
// ------------------------------------------------
int main() {

  int a[100] = {0};

  rep(i,3)
  {
    int b;
    cin >> b;
    a[b - 1] = 1;
  }

  int cnt = 0;
  rep(i,100)
  {
    if(a[i] == 1)
      cnt++;
  }

  cout << cnt;

  return 0;
}

// funcの実体
// ------------------------------------------------
int CalcSumOfDigit(int n)
{
  int s = 0;
  while(n)
  {
    s += n % 10;
    n = n / 10;
  }
  return s;
}

Measured memory_bytes: 256
#include <cstring>
#include <iostream>

using i64 = long long;

const i64 MOD = 1000000007;

const int N = 1000000 + 7;

int n;
i64 p[N][4], g[N][4];
i64 fac[N], ifc[N];
i64 pow(i64 a, i64 k) {
	i64 t = 1;
	for (; k; a = a * a % MOD, k >>= 1) if (k & 1) t = t * a % MOD;
	return t;
}
i64 bin(i64 n, i64 m) {
	return n < m || m < 0 ? 0 : fac[n] * ifc[m] % MOD * ifc[n - m] % MOD;
}

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

	scanf("%d", &n);
	for (int i = fac[0] = 1; i <= n; ++i) fac[i] = fac[i - 1] * i % MOD;
	ifc[n] = pow(fac[n], MOD - 2);
	for (int i = n - 1; ~i; --i) ifc[i] = ifc[i + 1] * (i + 1) % MOD;

	p[0][0] = 1;
	for (int i = 1; i <= n; ++i) for (int j = 0; j < 3; ++j)
		( p[i][j] = p[i - 1][0] + p[i - 1][1] + p[i - 1][2] - p[i - 1][j] ) %= MOD;

	i64 ans = 0;
	for (int k = 1; k <= n; ++k)
		( ans += pow(k, MOD - 2) * bin(n, k) % MOD * p[k][1] ) %= MOD;
	ans = ans * pow(pow(3, n) * n % MOD, MOD - 2) % MOD;
	printf("%lld", ans);
	return 0;
}


Measured memory_bytes: 49792
from heapq import heappush, heappop

def resolve():
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    heap = []
    for i in a:
        heappush(heap, [-i, i, 0])

    for i in range(m):
        num, x, cnt = heappop(heap)
        heappush(heap, [num / 2, x, cnt + 1])

    ans = 0
    for i in range(n):
        num, x, cnt = heappop(heap)
        ans += int(num)
    print(-ans)


if __name__ == "__main__":
    resolve()


Measured memory_bytes: 22884
import java.util.Scanner;

class Main {

  public static void main(String[] args) {
    new Main().run();
  }

  private static Scanner sc = new Scanner(System.in);

  private void run() {
    String s = sc.next();
    for (int i = 0; i < s.length(); i++) {
      if (i % 2 == 0) {
        System.out.print(s.charAt(i));
      }
    }
    System.out.println();
  }
}


Measured memory_bytes: 47344
#include<bits/stdc++.h>
using namespace std;
#define lp(i,n) for(int i=0;i<n;i++)
#define lpin(a,i,n) for(int i=0;i<n;i++){cin>>a[i];}


int main(){
  int a[100];
  lp(i,100){
    a[i]=0;
  }
  int count=0;
  lp(i,12){
    int x;
    cin>>x;
    a[x]++;
    if(a[x]%4==0) count++;
  }
  if(count==3) cout<<"yes"<<endl;
  else cout<<"no"<<endl;
    
	  
  return 0;
}



Measured memory_bytes: 3092
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <string>
#include <cmath>
using namespace std;
#define MOD 1000000007
#define INF 1<<30
#define LINF (ll)1<<62
#define MAX 510000
#define rep(i,n) for(ll i=0; i<(n); i++)
#define REP(i,a,b) for(ll i=(a); i<(b); i++)
#define all(x) (x).begin(),(x).end()
#define uni(q) unique(all(q)),q.end()
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll, ll> P;
typedef vector<pair<ll, ll>> vpl;



int main(){
    ll n; cin >> n;
    ll cnt = 0;
    rep(i,n){
        ll a; cin >> a;
        if(a % 2 == 1) cnt++;
    }
    if(cnt % 2) puts("NO");
    else puts("YES");
}


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

using namespace std;

#define ll long long

int N, M, X, buff;
vector<int> vec;

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

    for(int i = 0; i < M; i++){
        cin >> buff;
        vec.push_back(buff);
    }

    auto itr = lower_bound(vec.begin(),vec.end(), X);

    cout << min(itr - vec.begin(), vec.end() - itr) << endl;
}


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

int n, p;

bool isPrime(int x) {
	if (x <= 1) return false;
	for (int i = 2; i * i <= x; i++) {
		if (x % i == 0) return false;
	}
	return true;
}

int main() {
	while (cin >> n >> p) {
		if (n == -1) break;
		
		vector<int> nums;
		for (int i = n + 1; nums.size() < p; i++) {
			if (isPrime(i)) {
				nums.push_back(i);
			}
		}
		
		vector<int> sums;
		for (int i = 0; i < nums.size(); i++) {
			for (int j = i; j < nums.size(); j++) {
				sums.push_back(nums[i] + nums[j]);
			}
		}
		sort(sums.begin(), sums.end());
		
		cout << sums[p - 1] << endl;
	}
	return 0;
}

Measured memory_bytes: 3220
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>

#include <iostream>
#include <string>

#include <algorithm>
#include <deque>
#include <map>
#include <queue>
#include <set>
#include <vector>

#define PB push_back
#define MP make_pair

#define FOR(i, b, e) for(int i=(b);i<(e);i++)
#define REP(i, n) FOR(i,0,n)

#define ALL(v) (v).begin(),(v).end()

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;

typedef pair<int, int> PII;

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef vector<PII> VPII;

const int MOD = 1000000009;
const int INF = 1e9;

const double EPS = 1e-9;
const double PI = acos(-1.0);

LL gcd(LL a, LL b) { return b ? gcd(b, a % b) : a; }
LL lcm(LL a, LL b) { return a / gcd(a, b) * b; }

int X;

bool p[2000001];

int main() {
    REP (i, 200001) {
        p[i] = true;
    }
    p[0] = p[1] = false;
    FOR (i, 2, 200001 / 2) {
        if (p[i]) {
            for (int j = i + i; j < 200001; j += i) {
                p[j] = false;
            }
        }
    }
    cin >> X;
    FOR (i, X, 200001) {
        if (p[i]) {
            cout << i << endl;
            break;
        }
    }
    return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <iomanip>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <tuple>

using namespace std;
typedef long long ll;

#define MAX_N 10000
int a[MAX_N];



int main() {

  // -----------------------------
  cin.tie(nullptr);
  ios::sync_with_stdio(false);

  // input
  int a, b;
  cin >> a >> b;

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

  if ( a < b ) {
    for ( int i = 0; i < b; i++) {
      cout << a; 
    }
  }
  else {
    for ( int i = 0; i < a; i++) {
      cout << b; 
    }
  }

  cout << endl;
  
  return 0;
  
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
typedef long long ll;
#define MOD 1000000007
using namespace std;
int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    for(int i = 0; i < n; i++) {
        cin >> a[i];
    }
    int ans = 0;
    for(int i = 0; i < n; i++) {
        if(i % 2 == 0 && a[i] % 2 == 1) {
            ans++;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3592
#nは数列Aの長さ　Bの長さはn-1
n = int(input())
bn = list(map(int,input().split()))

an =[bn[0]]


for x in range(n-2):
    if bn[x+1] >= bn[x] :
        an.append(bn[x])
    else:
        an.append(bn[x+1])

an.append(bn[-1])

print(sum(an))

Measured memory_bytes: 9124
#include<bits/stdc++.h>
#define int long long
using namespace std;

signed main()
{
    int N; cin>>N;
    vector<int> cnt(13);
    cnt[0]++;
    for(int i=0;i<N;i++){
	int d; cin>>d;
	cnt[d]++;
    }

    if(cnt[0]>1 or cnt[12]>1){
	cout<<0<<endl;
	return 0;
    }
    for(int i=1;i<=11;i++){
	if(cnt[i]>2){
	    cout<<0<<endl;
	    return 0;
	}
    }

    int ans=0;
    const int K=11;
    for(int S=0;S<(1<<K);S++){
	vector<int> v={0,24};
	for(int i=0;i<K;i++){
	    if(cnt[i+1]==2){
		v.push_back(i+1);
		v.push_back(24-(i+1));
	    }
	    if(cnt[i+1]==1){
		if(S>>i&1) v.push_back(i+1);
		else v.push_back(24-(i+1));
	    }
	}
	if(cnt[12]) v.push_back(12);
	sort(v.begin(),v.end());
/*
	for(int i=0;i<v.size();i++) cout<<v[i]<<' ';
	cout<<endl;
*/
	int min_diff=24;
	for(int i=0;i<v.size()-1;i++){
	    min_diff=min(min_diff,v[i+1]-v[i]);
	}
	ans=max(ans,min_diff);
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
#coding: utf-8
N, M, X = map(int, input().split())
L = []
ans = float("inf")
flag = False
for i in range(N):
    L.append(list(map(int, input().split())))
    # print(A)
for i in range(2**N):
    bit = i
    use = []
    skill = [0 for _ in range(M)]
    money = 0
    for j in range(N):
        if (bit >> j & 1) == 1:
            money += L[j][0]
            for k in range(1, M+1):
                skill[k-1] += L[j][k]
    tmp = True
    for k in range(M):
        if skill[k] < X:
            tmp = False
    if tmp:
        flag = True
        ans = min(ans, money)
if flag:
    print(ans)
else:
    print(-1)




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

using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(3);
  double a, b, c, d, e, f, x, y;
  while (cin >> a >> b >> c >> d >> e >> f) {
    x = (c * e - b * f) / (a * e - d * b);
    y = (a * f - c * d) / (a * e - b * d);
    if (!x) x = 0;
    if (!y) y = 0;
    cout << x << ' ' << y << '\n';
  }
  return 0;
}



Measured memory_bytes: 3236
#include<iostream>
#include<vector>
#include<string>
#include<cmath>
#include<algorithm>
#include <numeric>
#include<map>
 
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<n;i++)
#define all_map(itr,mp) for(auto itr=mp.begin();itr!=mp.end();itr++)
#define ALL(a) (a).begin(),(a).end()

vector<int> dx = {0, 0, -1, +1, +1, +1, -1, -1};  
vector<int> dy = {-1, +1, 0, 0, -1, +1, -1, +1}; 

int main(){
    int h, w;
    cin >> h >> w;
    string s[h];
    rep(i, h)cin >> s[i];

    rep(i, h){
        rep(j, w){
            if(s[i][j] == '#'){
                cout << '#';
                continue;
            }
            int bomb = 0;
            rep(k, 8){
                int nx = i + dx[k];
                int ny = j + dy[k];
                if(nx >= 0 && nx < h && ny >= 0 && ny < w){
                    if(s[nx][ny] == '#')bomb++;
                }
            }
            cout << bomb;
        }cout << endl;
    }

}

Measured memory_bytes: 256
import java.util.*;
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] h = new int[n];
    int prev = sc.nextInt();
    for (int i = 1; i < n; i++) {
      int num = sc.nextInt();
      if (prev - num >= 1) {
        System.out.println("No");
        return;
      }
      if (prev == num) prev = num;
      else prev = num - 1;
    }
    System.out.println("Yes");
  }
}


Measured memory_bytes: 48332
-- mC2 + nCc
local n, m = io.read("*n", "*n")
local nC2, mC2 = 0, 0
if n >= 2 then
    nC2 = 1
    nC2 = n * (n - 1) / 2
end

if m >= 2 then
    mC2 = m * (m - 1) / 2
end

print(nC2 + mC2)

Measured memory_bytes: 256
N = int(input())
xys = [list(map(int, input().split())) for _ in range(N)]

xys = sorted(xys, key= lambda x: x[0])

answer = 0
a = []
b = []
for xy in xys:
    a.append(xy[0] + xy[1])
    b.append(xy[0] - xy[1])
    
print(max(max(a)-min(a), max(b)-min(b)))

Measured memory_bytes: 141340
#include<cstdio>
#include<iostream>
using namespace std; 
typedef long long ll;
int main()
{
	ll a,b,x;cin>>a>>b>>x;
	ll e,f;//e:a以上最小的x倍数是x的几倍
	//f:b以下最小的x倍数是x的几倍
	e= a%x? a/x+1 : a/x;
	f=b/x;
	cout<<f-e+1<<endl;
	return 0;
}//19.3.21 21:23
//较强思维
//这种题适合多刷 

Measured memory_bytes: 256
#include <stdio.h>

using namespace std;

int main(){
	int n,taro_point = 0,hanako_point = 0,j;
	char taro_card[101],hanako_card[101];
	scanf("%d",&n);
	for(int i = 0; i < n; i++){
		scanf("%s %s",taro_card,hanako_card);
		for(j = 0; taro_card[j] != '\0' && hanako_card[j] != '\0' && taro_card[j] == hanako_card[j];j++);
		if(taro_card[j] == '\0'){
			if(hanako_card[j] == '\0'){
				taro_point += 1;
				hanako_point += 1;
			}else{
				hanako_point += 3;
			}
		}else if(hanako_card[j] == '\0'){
			taro_point += 3;
		}else if(hanako_card[j] > taro_card[j]){
			hanako_point += 3;
		}else{
			taro_point += 3;
		}
	}
	printf("%d %d\n",taro_point,hanako_point);
}

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

int main(){
  int a, b, n, q, r, sum;
    while( cin >> a >> b >> n ){
	q = a/b;
	r = a%b;
	sum = 0;
	for ( int i = 0; i < n; i++ ){
	    r *= 10;
	    sum += r/b;
	    r = r%b;
	}
	cout << sum << endl;
    }
    return 0;
}

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

static const ll INFTY = (1 << 21);

static const int MAX = 100000;
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;

ll n, m;
vector<ll> p;
vector<P> adj[MAX];
vector<ll> d;

void dijkstra()
{
    priority_queue<P> PQ;
    int color[n];
    int d[n];
    rep(i, n)
    {
        d[i] = INFTY;
        color[i] = WHITE;
    }
    d[0] = 0;
    PQ.push(make_pair(0, 0));
    color[0] = GRAY;

    while (!PQ.empty())
    {
        P f = PQ.top();
        PQ.pop();
        int u = f.second;
        color[u] = BLACK;

        if (d[u] < f.first * (-1))
            continue;

        rep(j, adj[u].size())
        {
            int v = adj[u][j].first;
            if (color[v] == BLACK)
                continue;
            if (d[v] > d[u] + adj[u][j].second)
            {
                d[v] = d[u] + adj[u][j].second;
                p[v] = u;
                PQ.push(make_pair(d[v] * (-1), v));
                color[v] = GRAY;
            }
        }
    }

    rep(i, n)
    {
        if (i == 0)
            continue;
        if (p[i] == -1)
        {
            cout << "No" << endl;
            return;
        }
    }

    cout << "Yes" << endl;

    rep(i, n)
    {
        if (i == 0)
            continue;
        cout << p[i] + 1 << endl;
    }
}

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

    p = vector<ll>(n, -1);

    rep(i, m)
    {
        ll a, b;
        cin >> a >> b;
        a--;
        b--;
        adj[a].push_back(make_pair(b, 1));
        adj[b].push_back(make_pair(a, 1));
    }

    dijkstra();

    return 0;
}

Measured memory_bytes: 14344
#include "bits/stdc++.h"
using namespace std;
#define LL long long

bool Check(string s,LL n){
    string r=s;
    reverse(r.begin(),r.end());
    if(s==r)return true;
    else return false;
}
 

void solve() {
    string s;
    cin>>s;
    int n=s.size();
    
    if(Check(s,n)){
        string m=s.substr(0,(n-1)/2);
        if(Check(m,m.size())){
            string l=s.substr((((n+3)/2)-1),n-1);
            if(Check(l,l.size())){
                cout<<"Yes"<<"\n";
                return;
            }
        }
    }
    cout<<"No"<<'\n';
}

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

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define pw (ll)pow 
#define MAX 1000005
using namespace std;

bool prime[MAX];

void sieve()	{
	prime[1]=true;
	int x=sqrt(MAX);
	for(int i=2; i<=x; i++)	{
		for(int j=i*i; j<MAX; j+=i) prime[j]=true;
	}
}

int main()	
{
	sieve();
	int n,x;
	cin >> x >> n;
	int a[n];
	for(int i=0; i<n; i++)	cin >> a[i];
	vector<bool> b(101,false);
	for(int i=0; i<n; i++)	b[a[i]]=1;
	int mn=10000;
	vector<int> s;
	for(int i=0; i<1000; i++)	{
		if(mn>=abs(i-x) && !b[i])	mn=abs(i-x);
	}
	for(int i=0; i<1000; i++)	{
		if(abs(i-x)==mn && !b[i]) s.push_back(i);
	}
	if(s.size()>0)	{
		sort(s.begin(),s.end());
		cout << s[0] << endl;;
	}
	return 0;
}

Measured memory_bytes: 4596
#include "bits/stdc++.h"
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define all(s) s.begin(), s.end()
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<P> vp;
const int MX = 100005, INF = 1001001001;
const ll LINF = 1e18;
const double eps = 1e-10;
const int DIV = 1e9+7;


int main() {
    string s, t;
    cin >> s >> t;
    int n = s.size();
    vi x(n); vi y(n);
    rep(i, n) {
        x[i] = s[i] - 'a';
        y[i] = t[i] - 'a';
    }

    vi mx;
    rep(i, n) {
        if (find(mx.begin(), mx.end(), x[i]) == mx.end()) mx.pb(x[i]);
        x[i] = find(mx.begin(), mx.end(), x[i]) - mx.begin();
    }
    vi my;
    rep(i, n) {
        if (find(my.begin(), my.end(), y[i]) == my.end()) my.pb(y[i]);
        y[i] = find(my.begin(), my.end(), y[i]) - my.begin();
    }

    bool flag = true;
    rep(i, n) if(x[i] != y[i]) flag = false;
    if (flag) cout << "Yes" << endl;
    else cout << "No" << endl;
}


Measured memory_bytes: 2312
#!/usr/bin/env python3
import sys


def solve(X: str, Y: str):
    if int('0x' + X, 16) < int('0x' + Y, 16):
        print('<')
    elif int('0x' + X, 16) > int('0x' + Y, 16):
        print('>')
    else:
        print('=')

    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = next(tokens)  # type: str
    Y = next(tokens)  # type: str
    solve(X, Y)


if __name__ == '__main__':
    main()


Measured memory_bytes: 3060
import Control.Applicative
import Control.Monad
import Data.List

func xs =
  if odd (length xs) then
    and $ zipWith (==) xs (0:(map (\x -> if odd x then x+1 else x) [1..]))
  else
    and $ zipWith (==) xs ((map (\x -> if even x then x-1 else x) [1..]))

power 0 = 1
power n = (2 * (power (n-1))) `mod` (10^9+7)

main = do
  n <- (read::String->Int) <$> getLine
  as <- (map (read::String->Int)) . words <$> getLine
  
  print $
    if func (sort as) then
      power (n`div`2)
    else
      0


Measured memory_bytes: 29052
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<string>
#include<vector>
#include<stack>
#include<bitset>
#include<cstdlib>
#include<cmath>
#include<set>
#include<list>
#include<deque>
#include<map>
#include<queue>
using namespace std;
typedef long long ll;
const double PI = acos(-1.0);
const double eps = 1e-6;
const int INF = 1000000000;
const int mod = 1e9+7;
const int maxn = 2e5+5;
int main() {
	string s1,s2;
	cin>>s1>>s2;
	int cnt = 0;
	for(int i=0;i<s1.length();i++){
		if(s1[i]!=s2[i]) cnt++;
	}
	cout<<cnt<<endl;
}



Measured memory_bytes: 3916
min_num = 10
num = 0
for i in range(5):
    a = int(input())
    if a % 10 == 0:
       num += a
    else:
        num += ((a//10) + 1) * 10
        min_num = min(min_num, a%10)


print(num+min_num-10)


Measured memory_bytes: 2940
// Problem : C - Rally
// Contest : AtCoder Beginner Contest 156
// URL : https://atcoder.jp/contests/abc156/tasks/abc156_c
// Memory Limit : 1024.000000 MB 
// Time Limit : 2000.000000 milisec 
// Powered by CP Editor (https://github.com/coder3101/cp-editor)

#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define pb push_back
#define mp make_pair
#define y1 y114514
#define y2 y1919810
typedef pair <int, int> PII;
#define all(x) (x.begin(),  x.end())
#define lsh(i) (1 << (i))
#define lshll(i) (1LL << (i))
#define repn(i, n) for (int (i) = 1; (i) <= (int)n; (i)++)
#define rep(i, n) for (int (i) = 0; (i) < (int)n; (i)++)
#define range(i, s, t)  for (int (i) = s; (i) <= (int)t; (i)++)
const int INF = 0x3f3f3f3f;
const long double EPS = 1e-6;
long long qread() {
	char c = getchar();
	int neg = 1;
	long long val = 0;
	while (c != '-' && !isdigit(c)) c = getchar();
	if (c == '-') c = getchar(), neg = -1;
	while (isdigit(c)) val = (val << 3) + (val << 1) + c - '0', c = getchar();
	return neg * val;
}
const int N = 110;
int x[N], n;
int main() {
	n = qread();
	rep(i, n) x[i] = qread();
	int ans = INF;
	repn(p, 100) {
		int res = 0;
		rep(i, n) res += (x[i] - p) * (x[i] - p);
		ans = min(ans, res);
	}
	cout << ans << endl;
	return 0;
}


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

using namespace std;

int main() {
    int n;
    cin >> n;
    
    map<long long, long long> mp;
    for (int i = 1; i <= n; ++i) {
        long long p;
        cin >> p;
        mp[p] = i;
    }

    // a[n]の出力
    for (long long i = 1; i <= n; ++i) {
        cout << n * i;
        (i == n) ? (cout << endl) : (cout << " ");
    }

    // b[n]の出力
    for (long long i = 1; i <= n; ++i) {
        cout << -n * i + mp[i] + n * n;
        (i == n) ? (cout << endl) : (cout << " ");
    }
    return 0;
}

Measured memory_bytes: 1920
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

int main(){
  int i,j,n;
  vector <int> v;
  
  cin>>n;
  v.push_back(1);
  
  for(i=2;i<101;i++){
    if(i*i>n)
      break;
    j=i*i;
    while(j<=n){
      v.push_back(j);
      j=j*i;
    }
  }
    sort(v.begin(),v.end(),greater<int>());
  cout<<v[0]<<endl;
  return 0;
}

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

#define _LL long long

_LL* mallocint(int si)
{
    return (_LL*) malloc(si * sizeof(_LL));
}

_LL* inputint(int n)
{
    _LL *ans = mallocint(n);
    for( int i = 0; i < n; i++ ) cin >> ans[i];
    return ans;
}

int main()
{
    int n, m, k;
    cin >> n >> m >> k;
    _LL *a  = inputint(n);
    _LL *b = inputint(m);

    _LL *asum = new _LL[n];
    _LL *bsum = new _LL[m];

    _LL sum = 0;
    for(int i = 0; i < n; i++)
    {
        sum += a[i];
        asum[i] = sum;
    }

    sum = 0;
    for(int i = 0; i < m; i++)
    {
        sum += b[i];
        bsum[i] = sum;
    }

    int aindex = 0;
    int bindex = m - 1;
    int ans = 0;
    while( bindex >= 0 && bsum[bindex] > k ) bindex--;
    ans = bindex + 1;

    while( aindex < n && asum[aindex] <= k )
    {
        while( bindex >= 0 && asum[aindex] + bsum[bindex] > k ) bindex--;
        ans = max(aindex + 1 + bindex + 1, ans);
        aindex++;
    }
    cout << ans;

    return 0;
}

Measured memory_bytes: 9884
#pragma region

#include "bits/stdc++.h"
using namespace std;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define _rep3(i, begin, end) for (register int i = (begin), i##_end = (end); i < i##_end; i++)
#define _irep3(i, begin, end) for (register int i = (end)-1, i##_begin = (begin); i >= i##_begin; i--)
#define _rep2(i, n) _rep3(i, 0, n)
#define _irep2(i, n) _irep3(i, 0, n)
#define _overload3(_1, _2, _3, name, ...) name
#define rep(...) _overload3(__VA_ARGS__, _rep3, _rep2, )(__VA_ARGS__)
#define irep(...) _overload3(__VA_ARGS__, _irep3, _irep2, )(__VA_ARGS__)
#define out(x) cout << (x) << '\n';
#define debug(x) cerr << #x << " = " << (x) << " (line: " << __LINE__ << ") " << endl;
typedef long long ll;

template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
  for (auto &v : vec) is >> v;
  return is;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  os << "vec[ ";
  rep(i, vec.size()) i == 0 ? os << vec[i] : os << ", " << vec[i];
  os << " ]";
  return os;
}

#pragma endregion

#define MOD 1000000007
#define INF 2147483647

template <typename T>
ostream &operator<<(ostream &os, const multiset<T> &set) {
  os << "{ ";
  for (auto &&s : set) &s == &(*set.begin()) ? os << s : os << ", " << s;
  os << " }";
  return os;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(16);

  ll N;
  string S;
  cin >> N >> S;
  string abc = "ABC";

  ll ans = 0;
  rep(i, N - 2) {
    bool ok = true;
    rep(j, 3) {
      if (S[i + j] != abc[j]) {
        ok = false;
        break;
      }
    }
    if (ok) ans++;
  }
  out(ans);
}


Measured memory_bytes: 256
n = int(input())
log = {}
for _ in range(n):
  s = input()
  if s in log:
    log[s] += 1
  else:
    log[s] = 1
    
dic2 = sorted(log.items(), key=lambda x:x[1])
max_s = []
m = dic2[-1][1]
for i in dic2[::-1]:
  if i[1] == m:
    max_s.append(i[0])
  else:
    break
max_s.sort()
for s in max_s:
  print(s)

Measured memory_bytes: 46556
n=int(input())
*a,=map(int, input().split())
upd=[1 if a[i+1]-a[i]>0 else (0 if a[i+1]-a[i]==0 else -1) for i in range(n-1)]
#print(upd)
lastbuy=-1
lastsell=-1
now=1000
stock=0
for i in range(n-1):
    #print(now,stock,a[i])
    if upd[i]==1 and stock==0:
        lastbuy=i
        stock+=(now//a[i])
        now-=(now//a[i])*a[i]
    elif upd[i]==-1 and stock>0:
        lastsell=i
        now+=stock*a[i]
        stock=0

if stock>0:
    now+=max(a[lastbuy:])*stock
print(now)

Measured memory_bytes: 61984
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define se second
typedef long long ll;
const int maxn = 100005;
typedef pair<int, int>par;
const ll mod = 1e9+7;

char s[maxn], t[maxn];
int main()
{
    cin.tie(0);
    ios_base::sync_with_stdio(0);
    #ifdef acm
    freopen("a.in", "r",stdin);
    #endif // acm

    ll A, B, C, K;
    cin >> A >> B >> C >> K;
    if( A >= K ){
        cout << K << "\n";
        return 0;
    }

    if( A+B >= K ){
        cout << A << "\n";
        return 0;
    }

    ll f = K - A - B;

    cout << A - f << "\n";

    return 0;
}


Measured memory_bytes: 3612
#include <bits/stdc++.h>
using namespace std;
// define
#define int long long
#define UNIQUE(v) v.erase(unique(all(v)), v.end());
#define ZIP(v) sort(all(v)),UNIQUE(v)
#define ADD(a, b) a = (a + b) % mod
#define SUB(a, b) a = (a+mod-b)%mod
#define MUL(a, b) a = (a * b) % mod
#define rollcall cout << "I'm Sucu." << endl;
#define repi(i,m,n) for(int i = m;i < n;i++)
#define drep(i,n,m) for(int i = n;i >= m;i--)
#define rep(i,n) repi(i,0,n)
#define rrep(i,n) repi(i,1,n+1)
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(), v.rend()
#define dmp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define pf(x) push_front(x)
#define fi first
#define se second
// debug
template <typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &p){
  os << "(" << p.first << "," << p.second << ")";return os;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v){
  for (auto it = v.begin();it != v.end();++it){
    if(it != v.begin())os << " ";os << *it;
      }return os;
}
template <typename T, typename U>
ostream &operator<<(ostream &os, const map<T, U> &mp){
  for(auto x: mp)os << "(" << x.first << "," << x.second << ")" << endl;
  return os;
}
template<typename T, int SIZE>
int array_length(const T (&)[SIZE]){return SIZE;}
template<typename T, int N>
void PRINTF(const T (&a)[N], int s = N, int t = -1, bool f = true){
	if(t == -1){rep(i,s){if(i)cout << " ";cout << a[i];}}
	else repi(i,s,t){if(i!=s)cout << " ";cout << a[i];}
	if(f)cout << "\n";
}
template<typename T, int N1, int N2>
void PRINTF(const T (&a)[N1][N2], int h = N1, int w = N2){
	rep(i,h){rep(j,w){cout << a[i][j] << " \n"[j==w-1];}}
}
// typedef
typedef complex<double> Point;
typedef pair<int, int> P;
typedef pair<int, P> PP;
typedef pair<P, int> Pi;
typedef vector<int> vi;
typedef deque<int> dq;
const int inf = 1e9+7;
const int INF = 1e18+7;


int f[200], s[200];
void init(){
  f[0] = 1;
  rrep(i,50){
    f[i] = 2*f[i-1]+1;
  }
  s[0] = 1;
  rrep(i,50){
    s[i] = 2*s[i-1]+3;
  }
}

int solve(int x, int L){
  int l = s[L-1];
  if(L == 0)return 1;
  if(x <= 1)return 0;
  if(x == l+2)return f[L-1]+1;
  if(x == s[L])return f[L];
  if(x < l+2)return solve(x-1, L-1);
  if(x > l+2)return f[L-1]+1+solve(x-l-2, L-1);
  return 0;
}

signed main(){
  init();
  int n, X;
  scanf("%lld%lld", &n, &X);
  int ans = solve(X, n);
  printf("%lld\n", ans);
  return 0;
}






Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <cerrno>
#include <cfenv>
#include <cstring>
#include <bitset>

using namespace std;
int main()
{

    ///vector<int> A(N);
    /*
    double A, B, K, restA, restB;
    cin >> A;
    cin >> B;
    cin >> K;

    if (K <= A)
    {
        restA = A - K;
        restB = B;
    }
    else if (K <= A+B)
    {
        restA = 0;
        restB = B + (A - K);
    }
    else
    {
        restA = 0;
        restB = 0;
    }

    if (restA < 0)
    {
        restA = 0;
    }
    if (restB < 0)
    {
        restB = 0;
    }



    cout << restA << " " << restB;
    return 0;
    */

    int N;
    string ans = "No";
    cin >> N;

    for (int i = 1; i <= 9; i++)
    {
        if (N % i == 0 && N / i <= 9)
        {
            ans = "Yes";
        }

    }
    cout << ans;
    return 0;

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using ll = long long;
using namespace std;
int main(){
   	int N, M;
  	string blue, red;
  	cin >> N;
  	map<string, int> table;
  	int m = 0;
  	for(int i = 0; i < N; ++i){
      cin >> blue;
      table[blue]++;
  	}
	cin >> M;
  	for(int i = 0; i < M; ++i){
      cin >> red;
      table[red]--;
  	}
  	map<string, int>::iterator itr;
  	for(itr = table.begin(); itr != table.end(); ++itr){
      m = max(m, itr->second);
    }
 
    cout << m << endl;
}

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

using namespace std;


int main() {
    int N, t1, t2;
    cin >> N;
    vector<double> nn(N);
    
    for(int i=0; i<N; i++)cin >> nn.at(i);

    sort(nn.begin(), nn.end());

    double ans = nn[0];
    for(int i=1; i<N; i++){
        ans = (ans+nn[i]) / 2.0;
    }
    printf("%.10f\n", ans);

    return 0;
}


Measured memory_bytes: 256
from collections import Counter

def solve():
    N = int(input())
    A = list(map(int, input().split()))
    counter = Counter(A)
    comb_2 = lambda n:n*(n-1)//2 if n > 1 else 0
    A_comb = sum(comb_2(v) for v in counter.values())
    # print(A_comb)
    
    for a in A:            
        q = counter[a]
        ret = A_comb -comb_2(q) + comb_2(q-1)
        
        print(ret, flush=True)
        
solve()

Measured memory_bytes: 34240
#include <iostream>

using namespace std;

int main()
{
    int a;
    int b;
    int c;
    cin >> a >> b >> c;
    if (a <= 500 && a >= 1 && b <= 500 && b >= 1){
        if (c <= 1000){

    if (a + b >= c){
        cout << "Yes";
    }else{
        cout << "No";
    }
    }
    }
    return 0;
}


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

int main(){
    int a, b;
    cin >> a >> b;
    if (a > 8 || b > 8)
    {
        cout << ":(" << endl;
    }
    else
    {
        cout << "Yay!" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>

int main(){
   std::string S;
   std::cin >> S;
   std::string subS = "";
   int i = 0;
   int k = 0;
   while (i < S.size()){
      k++;
      if (subS == S.substr(i, 1)){
         subS = S.substr(i, 2);
         i += 2;
         if (i > S.size()){
            k--;
         }
      } else{
         subS = S.substr(i, 1);
         i++;
      }
   }
   std::cout << k << std::endl;

}



Measured memory_bytes: 640
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<set>
#include<iomanip>
#define rep(i, a, n) for(int i = a; i < n; i++)
using namespace std;
int main(){
  int a, b;
  cin >> a >> b;
  int c = a * 500;
  if(c >= b){
    cout << "Yes\n";
  }
  else{
    cout << "No\n";
  }
}
  
  
  

Measured memory_bytes: 3632
// Bismillahir Rahmanir Rahim
#include<bits/stdc++.h>
using namespace std;
int ar[1000001];
int main()
{
    //freopen("a.txt","r",stdin);
    for(int i=0;i<1000001;i++)ar[i]=0;
    int n,x;
    cin>>n;
    for(int i=0;i<n-1;i++)
    {
        cin>>x;
        ar[x]++;
    }

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

             cout<<ar[i]<<endl;

     }

}


Measured memory_bytes: 7500
require "pp"

n, m, r = gets.split.map(&:to_i)

def belmaford(s,path,n)
  ret = [nil]*(n+1)
  ret[s] = 0
  while true
    update = false
    path.each do |a, bs|
      bs.each do |b, dist|
        if !ret[a].nil? && (ret[b].nil? || ret[b] > ret[a] + dist)
          ret[b] = ret[a] + dist
          update = true
        end
      end
    end
    break unless update
  end
  return ret
end

rs = gets.split.map(&:to_i)
rs.sort!
path = {}
m.times do |i|
  road = gets.split.map(&:to_i)
  path[road[0]] = {} unless path.has_key? road[0]
  path[road[1]] = {} unless path.has_key? road[1]
  path[road[0]][road[1]] = road[2]
  path[road[1]][road[0]] = road[2]
end

fromR = {}
rs.each do |s|
  fromR[s] = belmaford(s, path,n)
end

mindist = nil
rs.permutation do |perm|
  dist = 0
  (1...perm.size).each do |x|
    unless perm[x-1] && perm[x] && fromR[perm[x-1]][perm[x]]
      puts [x-1, x].join(" ")
    end
    dist += fromR[perm[x-1]][perm[x]]
  end
  mindist = dist if mindist.nil? || dist < mindist
end
puts mindist


Measured memory_bytes: 5372
i;x,y,u;
p(a,b){for(i=0;i++<b;)putchar(a+68);}
main(v){
    scanf("%d%d%d%d",&u,&v,&x,&y);
    x-=u;
    y-=v;
    p(17,y);
    p(14,x+1);
    p(0,y+1);
    p(8,x+1);
    p(17,1);
    p(8,1);
    p(17,y+1);
    p(14,x+1);
    p(0,y+1);
    p(8,x);
}

Measured memory_bytes: 1616
K,N = map(int,input().split())
A = list(map(int,input().split()))

diff = []


for i in range(N-1):
    Diff = A[i+1] -A[i]
    diff.append(Diff)
    
diff.append(K-A[N-1]+A[0])


DIFF = sorted(diff)

del DIFF[-1]

print(sum(DIFF))

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

int main() {
    ll n;
    std::cin >> n;
    for (int i = 1; i <= 9; i++) {
        if(n%i==0 && n/i <= 9){
            std::cout << "Yes" << std::endl;
            return 0;
        }
    }
    std::cout << "No" << std::endl;
}


Measured memory_bytes: 256
import java.util.Scanner;
 
class Main {
    public static void main(String... args) {        
        int N = IN.nextInt();
        int K = IN.nextInt();
        int[] x = new int[N];
        for (int i = 0; i < N; i++) {
            x[i] = IN.nextInt();
        }
        int ans = Integer.MAX_VALUE;
        int j;
        int dist;
        for (int i = 0; i <= N - K; i++) {
            j = i + K - 1;
            if (x[j] <= 0) {
                ans = Math.min(ans, -x[i]);
            } else if (0 <= x[i]) {
                ans = Math.min(ans, x[j]);
            } else {
                dist = Math.min(Math.abs(x[i]), x[j]);
                ans = Math.min(ans, x[j] - x[i] + dist);
            }
        }
        System.out.println(ans);
    }
    final static Scanner IN = new Scanner(System.in);
}

Measured memory_bytes: 50728
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
#define INF 1145141919810893364
typedef pair<int,int> PP;
typedef long long ll;
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; }
#define int ll
#define setdouble setprecision
#define REP(i,n) for(int i=0;i<(n);++i)
#define OREP(i,n) for(int i=1;i<=(n);++i)
#define RREP(i,n) for(int i=(n)-1;i>=0;--i)
#define GOODBYE cout << -1 << endl;return 0
#define MM <<" "<<
#define Endl endl

int BE(int b,int e){
    int r=1;
    while(e){
        if(e&1){
            r=(r*b)%MOD;
        }
        b=(b*b)%MOD;
        e >>=1;
    }
    return r;
}


vector<int> comb_lineup(int N){
    vector<int> fac;
    vector<int> facIE;
    vector<int> comb_line;
    for(int i=0;i<=N;i++){
        if(i==0){fac.push_back(1);continue;}
        fac.push_back(i*fac[i-1]%MOD);
    }
    for(int i=0;i<=N;i++){
        facIE.push_back(BE(fac[i],MOD-2));
    }
    for(int i=0;i<=N;i++){
        comb_line.push_back((((fac[N]*facIE[i])%MOD)*facIE[N-i])%MOD);
    }
    return comb_line;
}


signed main(void){
    int N;
    int A[114514];
    vector<int> C1,C2;
    bool t[114514]={};
    int l=0,r=0;
    cin >> N;
    REP(i,N+1){
        cin >> A[i];
        if(t[A[i]]==0){
            t[A[i]]=1;
        }else{
            r=i;
        }
    }
    REP(i,N+1){
        if(A[i]==A[r]){
            l=i;
            break;
        }
    }
    C1=comb_lineup(N+1);
    C2=comb_lineup(N+l-r);
    int R=C2.size();
    REP(i,N+1){
        int Ans=0;
        Ans+=C1[i+1];
        if(0<=i && i<R){
            Ans=(Ans-C2[i]+MOD)%MOD;
        }
        cout << Ans << endl;
    }
    
    return 0;
}


Measured memory_bytes: 6228
import java.util.Scanner;
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();
    if((a+b) >= c){
    System.out.println("Yes");
    }else{
    System.out.println("No");
    }
  }
}


Measured memory_bytes: 22996
#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <set>
#include <algorithm>

using namespace std;

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

    string str;
    cin >> str;

    if (str[2] == str[3] && str[4] == str[5])
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }

    return 0;
}

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

#define NUM 1400

int rect[NUM + 1][NUM + 1];
int dp[NUM + 1][NUM + 1];

int main(void){
    int H, W;
    scanf("%d %d", &H, &W);

    for(int i = 1; i <= H; i++){
        for(int j = 1; j <= W; j++){
            scanf("%d", &rect[i][j]);
        }
    }

    for(int i = 1; i <= H; i++){
        if(rect[i][1] == 0){
            dp[i][1] = 1;
        }else{
            dp[i][1] = 0;
        }
    }

    for(int j = 1; j <= W; j++){
        if(rect[1][j] == 0){
            dp[1][j] = 1;
        }else{
            dp[1][j] = 0;
        }
    }

    for(int i = 2; i <= H; i++){
        for(int j = 2; j <= W; j++){
            if(rect[i][j] == 1){
                dp[i][j] = 0;
                continue;
            }
            dp[i][j] = min(dp[i - 1][j], min(dp[i][j - 1], dp[i - 1][j - 1])) + 1;
        }
    }

    int s_max = 0;
    for(int i = 1; i <= H; i++){
        for(int j = 1; j <= W; j++){
            s_max = max(s_max, dp[i][j]);
        }
    }

    printf("%d\n", s_max * s_max);

    
}



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


#define vi vector<int>
#define pb push_back
#define pii pair<int, int>
#define mp make_pair
#define ll long long


int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    
    int n, x;
    vi l(100);
    int at = 0;
    int b = 1;

    cin >> n >> x;
    for ( int i = 0; i < n; i++ ) {
        cin >> l[i];
    }

    for ( int i = 0; i < n; i++ ) {
        at += l[i];
        if ( at <= x ) {
            b++;
        }
    }

    cout << b << endl;


    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(){
	string a,b,c;
	char d,e,f;
	cin>>a>>b>>c;
	d=a[0];
	e=b[0];
	f=c[0];
	cout<<(char)(d-32)<<(char)(e-32)<<(char)(f-32)<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <cstring>
#include <climits>
#include <cmath>
#include <cfloat>

using namespace std;

int n, out;
double x[2], y[2], r[2], dst;

int main()
{
	
	cin >> n;
	
	while(n--)
	{
		
		for( int i = 0; i < 2; i++)
		{
			cin >> x[i] >> y[i] >> r[i];
		}
		
		dst = sqrt( pow(x[1] - x[0], 2) + pow(y[1] - y[0], 2) );
		
		if( dst > r[0] + r[1] )
			out = 0;
		else if( abs(r[0] + r[1]) >= dst && dst >= abs(r[0] - r[1]))
			out = 1;
		else 
			out = r[0] > r[1] ? 2 : -2;
		
		cout << out << endl;
		
	}
	
	return 0;
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
      using namespace std;
      #define ll  int
      #define ii pair<ll ,ll >
      #define pb push_back
      #define range 
      #define vi vector <ll >
      #define mod 1000000007
      #define eps 1e-9
      #define fi first
      #define se second
      #define _ <<" "<<
      #define forn(x, n) for(int x = 0; x < n ;++ x) 
      #define forn2(x, n) for(long long ll x = 1; x < n ;++ x) 
      #define forn1(x,n) for(ll x = 1; x <= n ;++ x)
      #define IOS ios_base::sync_with_stdio(0 );cin.tie(0);cout.tie(0);
  vi graph[1005];
  int vis[1005][1005];
    ll gcd(ll a,ll b)
    {
      if(b==0) {return a;}
     return gcd(b,a%b);
    }

  


void solve(){
  string s;
  cin >> s;
  int zcount = 0, ans = 0;
  for (int i = 0; i < s.size(); i++){
    if (s[i] == '0'){
      zcount++;
    }else{
      int t = 1;
      ans++;
      for (int j = i + 1; j < s.size(); j++){
        t *= 2;
        t += s[j] - '0';
        if (zcount + j - i + 1 < t){
          break;
        }
        ans++;
      }
      zcount = 0;
    }
  }
  printf("%d\n", ans);
}
int main(){
   //freopen ("test.txt","r",stdin);
  int n;
cin>>n;
cout<<pow(n,3);

return 0;
} 
 



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using Int = long long;
Int const INF = 1e9;

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

    string s,ans="Good";cin>>s;
    for (int i = 0; i < 3; i++) if(s[i]==s[i+1])ans="Bad";
    cout<<ans<<'\n';
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <iomanip>
#include <cmath>
#include <cstdlib>
#include <map>
#define ll long long
#define REP(i, x) for(int (i) = 0; (i) < (x); (i) ++)
#define pi 3.1415926535
const int MOD = 1000000007;
using namespace std;

int main() {
	int n;
	int count = 0;
	cin >> n;
	vector<int>p(n);
	REP(i, n) {
		cin >> p[i];
	}
	REP(i, n) {
		if (p[i] == i+1) {
			swap(p[i], p[i + 1]);
			count++;
		}
	}
	cout << count << endl;
	return 0;
}

Measured memory_bytes: 640