akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#include<map>
#include<set>
using namespace std;
const int inf=2147483647,dx[]={-1,0,1,0},dy[]={0,-1,0,1};
const int N=100005,M=1000005,mod=1000000007;
const long long llinf=9223372036854775807ll;
int n,a[N],dp[N];
int main(){
	cin>>n;
	for(int i=1;i<=n;i++)
		cin>>a[i];
	dp[1]=0,dp[2]=abs(a[1]-a[2]);
	for(int i=3;i<=n;i++)
		dp[i]=min(abs(a[i-1]-a[i])+dp[i-1],abs(a[i-2]-a[i])+dp[i-2]);
	cout<<dp[n];
	return 0;
}

Measured memory_bytes: 1024
#pragma once
#include <stdio.h>
#include <sstream>
#include <string.h>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <deque>
#include <limits>
#include <iomanip>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define bit(x,v) ((ll)x << v)

const ll INF = 1000000007;
const ll MAX = 210000;
const ll MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

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

ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}
int pr[100010];
void uini(int n) {
	for (size_t i = 0; i <= n; i++)
	{
		pr[i] = i;
	}
}

int parent(int x) {
	if (x == pr[x]) return x;
	return pr[x] = parent(pr[x]);
}

bool unit(int x, int y) {
	int px = parent(x);
	int py = parent(y);

	if (px == py) return false;
	if (px < py) {
		pr[py] = px;
	}
	else {
		pr[px] = py;
	}
	return true;
}

// res[i][c] := i 文字目以降で最初に文字 c が登場する index (存在しないときは n)
vector<vector<int> > calcNext(const string & S) {
	int n = (int)S.size();
	vector<vector<int> > res(n + 1, vector<int>(26, n));
	for (int i = n - 1; i >= 0; --i) {
		for (int j = 0; j < 26; ++j) res[i][j] = res[i + 1][j];
		res[i][S[i] - 'a'] = i;
	}
	return res;
}
// mod 1000000007 の世界で a += b する関数
void add(long long& a, long long b) {
	a += b;
	if (a >= MOD) a -= MOD;
}
const ll ainf = 998244353;

void solv() {
	int n;
	cin >> n;
	int v[100010];
	int c[100010];
	for (size_t i = 0; i < n; i++)
		cin >> v[i];
	for (size_t i = 0; i < n; i++)
		cin >> c[i];
	int res = 0;
	for (size_t i = 0; i < n; i++)
	{
		res += max(0, v[i] - c[i]);
	}
	cout << res << endl;
}

int main() {
	//COMinit();
	solv();

	return 0;
}


Measured memory_bytes: 256
//abc135_a.cpp
//Sat Jul 27 20:50:31 2019

#include <iostream>
#include <string>
#include <queue>
#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <math.h>
#include <set>
#define INTINF 2147483647
#define LLINF 9223372036854775807
using namespace std;
using ll=long long;
typedef pair<int,int> P;

int main(){
	ll a,b;
	cin >> a >> b;
	if ((a+b)%2==0){
		cout << (a+b)/2 << endl;
	}else {
		cout << "IMPOSSIBLE" << endl;
	}
//	printf("%.4f\n",ans);
}

Measured memory_bytes: 256
N, M = map(int, input().split())
dic = {}
ac = 0
wa = 0
for x in range(M):
    p, s = input().split()
    try:
        dic[p]
    except:
        dic[p] = [False, 0]
    
    if s == 'WA':
        if not dic[p][0]:
            dic[p][1] += 1
        
        
    else:
        if not dic[p][0]:
            dic[p][0] = True
            ac += 1
            wa += dic[p][1]

print(ac, wa)        

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

int main()
{
  string ans;
  int n;
  cin >> n;
  int y = n / 100;
  int m = n % 100;
  if (1 <= m && m <= 12) {
    if (1 <= y && y <= 12) {
      ans = "AMBIGUOUS";
    } else {
      ans = "YYMM";
    }
  } else {
    if (1 <= y && y <= 12) {
      ans = "MMYY";
    } else {
      ans = "NA";
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int l = 2*a + 2*b;
        System.out.print(a*b + " " + l);
        System.out.println();
    }
}


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

public class Main {

	public static void main(String[] args) throws Exception {
		MyScanner sc = new MyScanner();
		PrintWriter pr = new PrintWriter(System.out);
		int n = sc.nextInt();
		int ar[][] = new int[n][3];
		int dp[][] = new int[n][3];

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

			ar[i][0] = sc.nextInt();
			ar[i][1] = sc.nextInt();
			ar[i][2] = sc.nextInt();

			for (int j = 0; j < 3; j++)
				dp[i][j] = -1;
		}

		int a = func(0, 0, dp, ar);
		int b = func(0, 1, dp, ar);
		int c = func(0, 2, dp, ar);
		pr.println(Math.max(a, Math.max(b, c)));
		pr.close();
	}

	private static int func(int i, int j, int dp[][], int[][] ar) {

		if (i == ar.length - 1)
			return dp[i][j] = ar[i][j];

		if (dp[i][j] != -1)
			return dp[i][j];

		int max = Integer.MIN_VALUE;

		for (int x = 0; x < 3; x++) {

			if (x != j)
				max = Math.max(max, (ar[i][j] + func(i + 1, x, dp, ar)));
		}
		return dp[i][j] = max;
	}

	public static class MyScanner {
		BufferedReader br;
		StringTokenizer st;

		public MyScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}
}

Measured memory_bytes: 64748
#include <stdio.h>
int main(){
    int n,x,y;
    scanf("%d",&n);
    for(x=3;x<=n;x++){
        
        if(x%3==0){
            printf(" %d",x);
        }
        
    else{
        for(y=x;y!=0;y/=10){
            if(y%10==3){
                printf(" %d",x);
                break;
            }
        }
    }    
        
        
    }
    printf("\n");
    return 0;    
}

Measured memory_bytes: 600
package main

import (
	"fmt"
	"math"
)

func main() {
	var n float64
	fmt.Scan(&n)
	ans := math.Ceil(n / 1.08)
	if math.Trunc(ans*1.08) != n {
		fmt.Println(":(")
	} else {
		fmt.Println(ans)
	}
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define fr first
#define se second
#define r_0 return 0
#define ll long long
#define pb push_back
using namespace std;

const long long INF = 1e7;
const long long N = 1e5+ 7;
const long long mod = 1e9 + 7;
const long double eps = 1E-7;

long double a, n, b, c = 1, d , cnt , m , ans;
string s , s1 , s2;
set<int>st;
ll used[N];
vector<int>v;
int main()
{
   /// freopen("symposium.in" ,"r" ,stdin);
///freopen("symposium.out" , "w" ,  stdout);
    ios_base::sync_with_stdio(0);
cin >> n;
for( int i=  0;i < n;i++ )
    cin >> a , st.insert(a);
if( st.size() == n )
    cout << "YES";
else
    cout << "NO";
}


Measured memory_bytes: 9600
#include<iostream>
#include<queue>
using namespace std;
int main()
{
	priority_queue<int> a;
	int n,m;
	while(cin>>n>>m)
	{
		int p;
		for(int i=0;i<n;i++)
		{
			cin>>p;
			a.push(p);
		}
		while(m>0)
		{
			int temp=a.top()/2;
			a.pop();
			a.push(temp);	
			m--;
		}
		long long sum=0;
		while(!a.empty())
		{
			sum+=a.top();
			a.pop();
		} 
		cout<<sum<<endl;
	}
	
	return 0;
}

Measured memory_bytes: 892
#include<stdio.h>

int main(void){
	int n;
	scanf("%d\n",&n);
	int kazu[100];
	int i;
    for ( i = 0; i < n; i++ ){
		scanf("%d",&kazu[i]);
    }
	i=0;
    for ( i = 0; i < n; i++ ){
        if ( i ) printf(" ");
        printf("%d", kazu[n-i-1]);
    }
    printf("\n");
	return 0;
}

Measured memory_bytes: 1028
#include <bits/stdc++.h>
 
using namespace std;
#define  ll long long
#define ld long double
#define f first
#define s second
 
ll a[2000005] , b[1000005];
 
int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
 
    ll n,k;
    cin >> n;
 
    n++;
    for(int i=1; i<=n; i++)
        cin >> a[i];
 
    ll ans=0;
    for(int i=1; i<n; i++)
    {
        cin >> b[i];
        ll tmp = min(b[i] , a[i]);
        a[i] -= tmp;
        b[i] -= tmp;
        ans += tmp;
 
        tmp = min(b[i] , a[i+1]);
        a[i+1] -= tmp;
        b[i] -= tmp;
        ans += tmp;
 
    }
 
    cout << ans << "\n";
//
    return 0;
}

Measured memory_bytes: 5120
#include <bits/stdc++.h>
#define BIT(n) (1LL << (n))
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPB(i, n) for (int i = 0; i < BIT(n); i++)
#define REPS(i, x) for (int i = 1; i <= (int)(x); i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define FORA(i, n) for (auto &&i : n)
#define FORS(i, m, n) for (int i = m; i <= n; i++)
#define DEBUG(x) cerr << #x << ": " << x << "\n"
#define PRINTALL(V)                                                            \
  for (auto v : (V)) {                                                         \
    cout << v << " ";                                                          \
  }                                                                            \
  cout << "\n";
#define ALL(v) v.begin(), v.end()
#define fst first
#define snd second
#define mp make_pair
#define pb push_back
#define epb emplace_back
#define int long long
using namespace std;
template < class T > bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template < class T > bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template < class T > using vec = std::vector< T >;
template < class T > void print(const T &x) { cout << x << "\n"; }
const int MOD = 1000000007, INF = 1061109567;
const double EPS = 1e-10, PI = acos(-1.0);
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
signed main() {
  cin.tie(0), ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  int A, B, K;
  cin >> A >> B >> K;
  B -= A;
  K--;
  FORS(i, 0, min(K, B)) { print(A + i); }
  FORS(i, max(K + 1, B - K), B) { print(A + i); }

  //  FORS(i, A, min(A + K - 1, B)) { print(i); }
  //  FORS(i, max(A + K, B - (K - 1)), B) { print(i); }
}

Measured memory_bytes: 256
S = input()
top = 0
end = len(S)-1
toright = True
N = int(input())
Q = [S[i] if i <= end else "" for i in range(end+1+N)]

for i in range(N):
  q = input().split()
  if q[0]=="1":
    toright = not toright
  else:
    if not(toright ^ (q[1]=="1")):
      Q[top-1]=q[2]
      top -= 1
    else:
      Q[end+1]=q[2]
      end += 1
ans = ""
#print(Q)
#print(toright)
for i in range(top, end+1):
  ans += Q[i]
if not toright:
  ans = ans[::-1]
print(ans)


Measured memory_bytes: 12092
import sys
S = input()
K = int(input())

letter_set = sorted(set(S))

ans_list = []

for letter in letter_set:
    letters = letter
    while letters in S:
        ans_list.append(letters)
        if len(ans_list) == K:
            print(ans_list[K - 1])
            sys.exit()
        for i in range(len(letter_set)):
            if letters + letter_set[i] in S:
                letters = letters + letter_set[i]
                break
        else:
            break
print(ans_list[K - 1])


Measured memory_bytes: 3064
#include <stdio.h>
#include <algorithm>

int main() {
	int N, M, a, b, R[50] = { 0 };
	scanf("%d %d", &N, &M);
	for (int i = 0; i < M; i++) {
		scanf("%d %d", &a, &b);
		R[a - 1]++;
		R[b - 1]++;
	}
	for (int i = 0; i < N; i++)
		printf("%d\n", R[i]);
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define rev(i, n) for(int i = (int)(n - 1); i >= 0; i--)
#define rev1(i, n) for(int i = (int)(n); i > 0; i--)
#define pb push_back
#define all(v) ((v).begin(), (v).end())
using ll = long long;
using P = pair<int, int>;
/* ------------------------------------------------ */
ll fact(int i) {       //階乗
    if (i == 0) return 1;
    return (fact(i - 1)) * i;
}
ll gcd(ll a, ll b) {        //最大公約数
    if(b == 0) return a;
    return gcd(b, a % b); 
}
ll lcm(ll a, ll b) {      //最小公倍数
    return a * b / gcd(a, b);
}
int keta(ll n) {        //桁数を求める
    if(n == 0) return 1;
    int count = 0;
    while(n != 0) {
        n /= 10;
        count++;
    }
    return count;
}
ll ketasum(ll n) {    //各桁の和
    ll sum = 0;
    while(n != 0) {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}
/* ------------------------------------------------ */

int main() {
    ll x;
    cin >> x;
    ll i = 0;
    ll n = 100;
    while(n < x) {
        i++;
        n+=n/100;
    }
    cout << i << endl;
    return 0;
}

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

int main() {
  int N, M;
  cin >> N >> M;
  int ac = 0, pena = 0;
  vector<long long> wa(N, 0), isac(N, 0);
  for (int i = 0; i < M; ++i) {
    int p; string s;
    cin >> p >> s;
    --p;
    if (s == "AC") {
        if (!isac[p]) {
            ++ac;
            pena += wa[p];
            isac[p] = true;
        }
    }
    else wa[p]++;
  }
  cout << ac << " " << pena << endl;
}


Measured memory_bytes: 1920
//confilm 0LL and 1LL
//confilm cornercases such as 0
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using Vec = vector<ll>;
using VecP = vector<P>;
using VecB = vector<bool>;
using VecC = vector<char>;
using VecVec = vector<Vec>;
#define REP(i, m, n) for(ll (i) = (m); (i) < (n); ++(i))
#define REPN(i, m, n) for(ll (i) = (m); (i) <= (n); ++(i))
#define REPR(i, m, n) for(ll (i) = (m); (i) >= (n); --(i))
#define rep(i, n) REP(i, 0, n)
#define repn(i, n) REPN(i, 1, n)
#define repr(i, n) REPR(i, n, 0)
#define repnr(i, n) REPR(i, n, 1)
#define co(n) cout << (n) << endl
#define cosp(n) cout << (n) << ' '
#define setp(n) cout << fixed << setprecision(n);
#define all(s) (s).begin(), (s).end()
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fs first
#define sc second
template <typename T>
bool chmax(T &a, const T& b){if(a < b){a = b; return true;} return false;}
template <typename T>
bool chmin(T &a, const T& b){if(a > b){a = b; return true;} return false;}
void sonic(){ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);}
const ll INF = 1e9+1;
const ll LINF = 1e18+1;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const double PI = acos(-1);
const double EPS = 1e-9;

int main(void){
	ll a, b, c;
	cin >> a >> b >> c;
	ll ans = b+min(a+b+1, c);
	co(ans);

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)    FOR (i,0,n)
#define ALL(f,x,...) ([&](decltype((x)) ALL) {                          \
            return (f)(begin(ALL), end(ALL), ## __VA_ARGS__); })(x)

using namespace std;

double power(double a, int n)
{
    double r;
    int abs_n;

    r = 1;

    abs_n = n < 0 ? -n : n;

    while (0 < abs_n)
    {
        if (abs_n % 2 == 1) r *= a;

        a *= a;
        abs_n /= 2;
    }

    return n >= 0 ? r : 1 / r;
}

double nthroot(double a, int n)
{
    double x, y;

    if (a <= 0 || n < 0) return 0;
    if (n == 0) return 1;

    /* When 0 < a and 0 < n */
    y = (1 < a) ? a : 1;

    do
    {
        x = y;
        y = ((n - 1) * x + a / power(x, n - 1)) / n;
    }
    while (y < x);

    return y;
}
// is_power
// power number or not
// (squared number, cubic number, quadruple number, etc.)
bool isPower(int a)
{
    if (a == 1) return 1;

    FOR (i, 2, (int)floor(log2(a)))
    {
        if ((int)power(floor(nthroot(a, i)), i) == a) return true;
    }

    return false;
}

int main()
{
    int X;

    cin >> X;

    for (int i = X; 0 <= i; i--)
    {
        if (isPower(i))
        {
            cout << i << endl;
            break;
        }
    }

    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <queue>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

int A1, A2, A3;

int main() {
  cin >> A1 >> A2 >> A3;
  cout << (A1 + A2 + A3 >= 22 ? "bust" : "win") << endl;

  return 0;
}


Measured memory_bytes: 3604
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i < (n); i++)
#define lower(s) transform(s.begin(), s.end(), s.begin(), ::tolower)
using namespace std;
using ll = long long;
int INF = 1001001001;

int main() {
  ll a;
  double b;
  cin >> a >> b;
  ll ib = (b * 100+0.5);
  ll temp = a * ib;
  ll ans = temp / 100;
  cout << ans << endl;
  // printf("%lld\n", ans);
  return 0;
}

Measured memory_bytes: 3732
//
//  main.cpp
//  AC
//
//  Created by makinofuya on 2019/07/08.
//  Copyright © 2019 makinofuya. All rights reserved.
//
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <stack>
#include <math.h>

typedef long long ll;
using namespace std;
#define mod 1000000007
#define rep(i,n) for(ll i=0;i<n;i++)
#define out(s) cout << s << endl


int main(){
    int n;cin >> n;
    int cnt=0;
    for(int i=1;i<=n;i++){
        if(i<10)cnt++;
        if(i>=100 && i<= 999)cnt++;
        if(i>=10000 && i<=99999)cnt++;
    }
    cout << cnt << endl;
    return 0;
    
}


Measured memory_bytes: 256
x,y = map(int,input().split())
if x > y*2 or y > x*2 or (x+y)%3 != 0:
  print(0)
  exit()
n = (x+y)//3
r = min(x-n,2*n-x)

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7
N = 10**6
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

print(cmb(n,r,mod))

Measured memory_bytes: 124064
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy, copy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
import numpy as np

N = INT()
S = [input() for _ in range(N)]
march = ["M", "A", "R", "C", "H"]
march_lis = [0]*5

for s in S:
	if s[0].upper() in march:
		march_lis[march.index(s[0].upper())] += 1

#print(march_lis)
ans = 0
for x, y, z in combinations(march_lis, 3):
	#print(x, y, z)
	ans += x*y*z
print(ans)

Measured memory_bytes: 31428
n = int(input())
a = list(map(int, input().split()))
m = 1000
s = 0
for i in range(0,n):
    for j in range(i+1,n):
        if a[i] != a[j]:
            if a[i] >= a[j]:
                m = m + s *a[i]
                s = 0
                break
            else:
                s = s + m//a[i]
                m = m - m//a[i]*a[i]
                break
print(m+s*a[len(a)-1])

Measured memory_bytes: 8968
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Solve s = new Solve();
		s.solve();
	}

}

class Solve {

	public void solve() {
		Scanner sc = new Scanner(System.in);

		String S = sc.next();
		String T = sc.next();
		String ans;

		char[] s = S.toCharArray();
		char[] t = T.toCharArray();


		int temp;
		boolean flag;
		boolean breakF = false;
		StringBuffer sb = new StringBuffer();


		int sl = s.length;
		int tl = t.length;
		int start = 0;
		int last = sl-tl;

		for (int i = 0; i < tl; i++) {
			for (int j = last ; j >= i; j--) {

				flag = true;
				if (s[j] == t[i] || s[j] == '?') {

					for (int k = 0; k < tl; k++) {
						if (!check(s[j-i+k], t[k])){
							flag = false;
							break;
						}
					}

					if (flag) {
						int c = 0;
						for (int k = 0; k < sl; k++) {
							// j-i~j-i+tlまではsbにtlを入れる。
							// ?部分はaを入れる。
							if (k >= j-i && k < j-i+tl) {
								sb.append(t[c]);
								c++;
							} else {
								if (s[k] == '?') {
									sb.append('a');
								} else {
									sb.append(s[k]);
								}
							}
						}
						breakF = true;
						break;
					}

				}	// end if
				if (breakF) break;
			}	// end for j
			if (breakF) break;
		}	// end for i

		if (breakF) {
			System.out.println(sb.toString());
		} else {
			System.out.println("UNRESTORABLE");
		}
	}

	public boolean check(char s, char t) {
		if (s == '?' || s == t) {
			return true;
		}
		return false;
	}

	public int checkContain(char s, char[] a) {
		if (s =='?') return 0;
		for (int i = 0; i < a.length; i++) {
			if (s == a[i]) return i;
		}
		return -1;
	}

	public boolean check(char s, char[] t, int index) {
		boolean flag = false;
		if (s == '?') {
			flag = true;
		} else {
			for (int i = index; i < t.length; i++) {
				if (s == t[i]) {
					flag = true;
				}
			}
		}
		return flag;
	}
}

Measured memory_bytes: 23124
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)

int main(){
    string s, t;
    cin >> s >> t;
    int n = s.size();

    bool ans = true;
    vector<int> a(26,-1);
    vector<int> b(26,-1);
    rep(i,n){
        int si = s[i] - 'a';
        int ti = t[i] - 'a';
        if(a[si] < 0) a[si] = ti;
        else if(a[si] != ti){
            ans = false;
        }
        if(b[ti] < 0) b[ti] = si;
        else if(b[ti] != si){
            ans = false;
        }
    }
    if(ans) cout << "Yes" << endl;
    else cout << "No" << endl;
}

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

int main(void){
    string s,t;
    cin >> s >> t;
    string ans = "Yes";
    vector<int> vec1(26), vec2(26);
    for(int i=0; i<26; i++){
        vec1.at(i) = 0;
        vec2.at(i) = 0;
    }

    for(int i=0; i<s.size(); i++){
        if(vec1.at(s[i]-'a') == 0 && vec2.at(t[i]-'a') == 0){
            vec1.at(s[i]-'a') = t[i] - 'a';
            vec2.at(t[i]-'a') = s[i] - 'a';
        }else{
            if(vec1.at(s[i]-'a') != t[i]-'a' || vec2.at(t[i]-'a') != s[i]-'a'){
                ans = "No";
                break;
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 776
#include <iostream>

using namespace std;

static const int MAX = 500000;

class BinaryHeap {
private:
    int heap[MAX + 1];
    int size;

    void set()
    {
        int value;
        for(int i = 1; i <= size; i++)
        {
            cin >> value;
            heap[i] = value;
        }
    }

public:
    BinaryHeap(int size)
    {
        this->size = size;
        set();
    }

    int parent(int index)
    {
        return index / 2;
    }

    int left(int index)
    {
        return 2 * index;
    }

    int right(int index)
    {
        return 2 * index + 1;
    }

    void maxHeapify(int root)
    {
        int left_id = left(root);
        int right_id = right(root);

        int largest;
        if(left_id <= size && heap[left_id] > heap[root])
            largest = left_id;
        else
            largest = root;
        if(right_id <= size && heap[right_id] > heap[largest])
            largest = right_id;

        if(largest != root)
        {
            swap(heap[largest], heap[root]);
            maxHeapify(largest);
        }
    }

    void build_max_heap()
    {
        for(int i = size / 2; i >= 1; i--)
            maxHeapify(i);
    }

    void print()
    {
        for(int i = 1; i <= size; i++)
            cout << " " << heap[i];
        cout << endl;
    }
};

int main()
{
    int H_size;
    cin >> H_size;
    BinaryHeap heap(H_size);
    heap.build_max_heap();
    heap.print();
}


Measured memory_bytes: 4952
#include<iostream>
#include<cstdio>
#include<queue>
using namespace std;
int main()
{
    char s[11];
    priority_queue<int> q;
    while(scanf("%s",s)==1)
    {
        if(s[0]=='e'&&s[1]=='n') break;
        else if(s[0]=='e')
        {
            if(!q.empty())
            {
                int x=q.top();
                q.pop();
                printf("%d\n",x);
            }
        }
        else if(s[0]=='i')
        {
            int x;
            scanf("%d",&x);
            q.push(x);
        }
    }
    return 0;
}

Measured memory_bytes: 6928
class UnionFind
  def initialize(n)
    @parents = Array.new(n, -1)
  end
  def find(x)
    @parents[x] < 0 ? x : @parents[x] = find(@parents[x])
  end
  def parents
    @parents
  end
  def union(x, y)
    x = find(x)
    y = find(y)
    return if x == y
    if @parents[x] > @parents[y]
      x, y = y, x
    end
    @parents[x] += @parents[y]
    @parents[y] = x
  end
  def count
    @parents.map{ _1 < 0 ? 1 : 0}.sum
  end
end

n, m = gets.split.map(&:to_i)
u = UnionFind.new(n)
m.times do
  a, b = gets.split.map(&:to_i)
  u.union(a - 1, b - 1)
end
p u.count - 1

Measured memory_bytes: 15932
N = int(input())
xys = []
for i in range(N):
  x, y = map(int, input().split())
  xys.append((x,y))
xys.sort()
#print(xys)
def count(p,q):
  c = N
  for i in range(0, N):
    for j in range(i+1, N):
      if p == xys[j][0]-xys[i][0] and q == xys[j][1]-xys[i][1]:
        c -= 1
        break
  return c
r = N
for i in range(0, N):
  for j in range(0, i):
    p = xys[i][0]-xys[j][0]
    q = xys[i][1]-xys[j][1]
    r = min(r, count(p, q))
print(r)


Measured memory_bytes: 3064
n, m = map(int, input().split())
data = []
dict_q = dict()
wa = 0
ac = 0
finished = set()
for i in range(m):
    p, s = input().split()
    if s == "WA":
        if p in dict_q:
            dict_q[p] += 1
        else:
            dict_q[p] = 1
    else:
        if p in finished:
            continue
        finished.add(p)
        if p in dict_q:
            wa += dict_q[p]
        ac += 1
print("{} {}".format(ac,wa))
    

Measured memory_bytes: 14052
#include<iostream>
#include<algorithm>

using namespace std;
typedef long long ll;

int N;
ll in[200000];
ll ruisekiwa[200001];
ll over;

ll getmin(int l, int r) {
	ll a, b, c, ans = 0;
	a = ruisekiwa[r] - ruisekiwa[l];
	b = *lower_bound(ruisekiwa + r, ruisekiwa + 2 * N, ruisekiwa[r] + over);
	c = ruisekiwa[l + N] - *lower_bound(ruisekiwa + r, ruisekiwa + 2 * N, ruisekiwa[r] + over);
	ans = max(ans, min(a, min(b, c)));
	//b = *(lower_bound(ruisekiwa + r, ruisekiwa + 2 * N, ruisekiwa[r] + over) + 1);
	//c = ruisekiwa[l + N] - *(lower_bound(ruisekiwa + r, ruisekiwa + 2 * N, ruisekiwa[r] + over) + 1);
	//ans = max(ans, min(a, min(b, c)));
	return ans;
}

int main() {
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> in[i];
		in[N + i] = in[i];
	}
	for (int i = 1; i <= N * 2; i++) {
		ruisekiwa[i] = ruisekiwa[i - 1] + in[i - 1];
	}

	ll ans = 0;
	over = (ruisekiwa[N] - ruisekiwa[0]) / 3;
	for (int l = 0, r = 0;(l < N); l++) {
		for (; ruisekiwa[r] - ruisekiwa[l] < over; r++)ans = max(ans, getmin(l, r));
		ans = max(ans, getmin(l, r + 1));
		ans = max(ans, getmin(l, r));
		ans = max(ans, getmin(l, r - 1));
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 6236
#include<stdio.h>

int main()

{

    int n,t=0,i;

    char a[100]= {0};

    scanf("%d",&n);

    for(i=0; i<n; i++)

        scanf(" %c",&a[i]);

    for(i=0; i<n-2; i++) 

        if(a[i]=='A'&&a[i+1]=='B'&&a[i+2]=='C')

    t++;

    printf("%d",t);

    return 0;

}

Measured memory_bytes: 128
#include<bits/stdc++.h>
#define inv(x) power(x,Mod-2)
#define upd(a,b) a=add(a,b)
using namespace std;
typedef long long ll;
const int Mod=1e9+7;
int add(int a,const int b){a+=b;if(a>=Mod)a-=Mod;return a;}
int sub(int a,const int b){a-=b;if(a<0)a+=Mod;return a;}
int mul(const int a,const int b){return (ll)a*b%Mod;}
int power(int x,int cs)
{
	int ras=1;
	while(cs)
	{
		if(cs&1) ras=mul(ras,x);
		x=mul(x,x);cs>>=1;
	}
	return ras;
}
const int N=1e6+20,pn=1e6+5;
int n,ans=0;
int zp[N],fp[N],pin[N];
int main()
{
	int i,w;
	zp[0]=fp[0]=1;
	for(i=1;i<=pn;i++) zp[i]=mul(zp[i-1],i);
	fp[pn]=inv(zp[pn]);
	for(i=pn-1;i>=1;i--) fp[i]=mul(fp[i+1],i+1);
	for(i=1;i<=pn;i++) pin[i]=mul(fp[i],zp[i-1]);
	scanf("%d",&n);
	for(i=0,w=pin[3];i<n;i++,w=mul(w,pin[3]))
	{
		upd(ans,mul(mul(pin[n],pin[n-i]),w));
	}
	printf("%d",ans);
	return 0;
}

Measured memory_bytes: 12032
#include<stdio.h>
#include<math.h>
#define N 10000
int main(){
  int i,n,j,num[N],count=0;
  scanf("%d",&n);
  if(n>N) return 0;
  for(i=n;i>0;i--){
    scanf("%d",&num[i]);
    if(num[i]>=2&&num[i]<=100000000){
      if(num[i]!=2&&num[i]%2==0) count++;
      else{
	for(j=3;j<=sqrt(num[i]);j+=2){
	  if(num[i]%j==0){
	    count++;
	    break;
	  }
	}
      }
    }
    else break;
  }
  printf("%d\n",n-count);
  return 0;
}



Measured memory_bytes: 2064
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
class Program
{
    static void Main(string[] args)
    {
            // 入力
            string[] sS = System.Console.ReadLine().Trim().Split(' ');
            int iN = int.Parse(sS[0]);

            System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
            sw.Start();

            // 解析
            string sOut = "No";
            if (iN >= 30) { sOut = "Yes"; }

            // 出力
            System.Console.WriteLine("{0}", sOut.ToString().Trim());

            sw.Stop();
#if DEBUG
            Console.WriteLine();
            Console.WriteLine("{0}", sw.Elapsed.ToString());
            Console.WriteLine("続行するには何かキーを押してください．．．");
            Console.ReadKey();
#endif
    }

}


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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
using P = pair<ll, ll>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
#define ALL(obj) (obj).begin(), (obj).end()
const int INF = 1e9;

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

	ll N;
	ll ans = 0;

	cin >> N;

	vector<ll> A(N), M(N);
	multiset<ll> pq;

	ll tmp;
	rep(i, N) {
		cin >> tmp;
		A[i] = tmp;
	}

	ll sum = 0;
	rep(i, N) {
		if (i % 2 == 0) {
			sum += A[i];
		}
		else {
			sum -= A[i];
		}
	}
	M[0] = sum;
	cout << M[0] << " ";

	rep2(i, 1, N){
		M[i] = 2 * (A[i - 1] - M[i - 1] / 2);
		cout << M[i] << " ";
	}

	return 0;
}


Measured memory_bytes: 2944
fun main(args: Array<String>) {
  val N = readInt()
  val ST = (1..N).map { readStrings() }.map { it[0] to it[1].toInt() }
  val V = readString()
  var f = false
  var sum = 0
  for (i in 0 until N) {
    val (S, T) = ST[i]
    if (S == V) {
      f = true
      continue
    }
    if (f) {
      sum += T
    }
  }
  println(sum)
}
 
fun readString() = readLine()!!
fun readStrings() = readString().split(" ")
fun readInt() = readString().toInt()
fun readInts() = readStrings().map { it.toInt() }
fun readLongs() = readStrings().map { it.toLong() }

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

int main(){
 	int n, t; cin>>t>>n;
  	
  	int sum = 0;
  	for(int i = 0;  i < n; i++){
      	int ele; cin>>ele;
    	sum += ele;
    }
    
  	(sum >= t) ? cout<<"Yes" : cout<<"No";
  
 	return 0; 
}

Measured memory_bytes: 256
#include<stdio.h>

int main (void)
{
int i, j, k, l, n;
int p[101], m[101][101];

scanf("%d", &n); 
for(i = 1; i <= n; i++){
scanf("%d %d", &p[i - 1], &p[i]);
}

for(i = 0; i <= n; i++){
m[i][i] = 0;
}

for(l = 2; l <= n; l++){

for(i = 1; i <= n-l+1; i++){
int j = i+l-1;
m[i][j] = 10000000000;

for(k = i; k <= j-1; k++){

if( m[i][j] < m[i][k] + m[k+1][j] + p[i-1]*p[k]*p[j]){
m[i][j] = m[i][j] ;
} else {
m[i][j] = m[i][k] + m[k+1][j] + p[i-1]*p[k]*p[j];
}

}

}

}

printf("%d\n", m[1][n]);

return 0;
}

Measured memory_bytes: 1892
#include <algorithm>
#include <bitset>
#include <iostream>
#include <map>

using namespace std;
using ll = long long int;

// void dfs(string now, bitset<26> used) {
//   if (used.count() == 26) {
//     return;
//   }

//   for (size_t i = 0; i < 26; i++) {
//     if (used[i] == 0) {
//       string next = now;
//       char c = ('a' + i);
//       dfs(next + c, (used | bitset<26>(1 << i)));
//       mp[next + c]++;
//     }
//   }
//   return;
// }

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

  map<char, int> mp;
  for (size_t i = 0; i < s.size(); i++) {
    mp[s[i]]++;
  }

  char remain = '-';
  for (size_t i = 0; i < 26; i++) {
    if (mp['a' + i] == 0) {
      remain = 'a' + i;
      break;
    }
  }

  bool saidai = true;
  for (size_t i = 0; i < 25; i++) {
        if (s[i] < s[i + 1]) {
          saidai = false;
        }
  }

  if (remain != '-') {
    cout << (s + remain) << endl;
  } else if (saidai) {
    cout << -1 << endl;
  } else {
    string next = s;
    next_permutation(next.begin(), next.end());
    string ans;
    for (size_t i = 0; i < 26; i++)
    {
        if (s[i] == next[i]) {
            ans.push_back(s[i]);
        } else {
            ans.push_back(next[i]);
            break;
        }
    }
    cout << ans << endl;
    
  }
}

Measured memory_bytes: 256
inpl = lambda: list(map(int,input().split()))
def get_sequence(arr):
    if len(arr) == 0:
        return [], []
    elements = []
    nums = []
    n = 1
    prev = arr[0]
    for c in arr[1:]:
        if c == prev:
            n += 1
        else:
            elements.append(prev)
            nums.append(n)
            prev = c
            n = 1
    elements.append(prev)
    nums.append(n)
    return elements, nums

S = input()
K = int(input())
ele, num = get_sequence(S)
if len(ele) == 1:
    print(K*len(S)//2)
elif len(ele) == 2:
    print((num[0]//2 + num[1]//2)*K)
else:
    if ele[0]==ele[-1]:
        ans = num[0]//2 + num[-1]//2
        ans += sum(map(lambda x: x//2, num[1:-1]))*K
        ans += (num[0]+num[-1])//2 * (K-1)
    else:
        ans = sum(map(lambda x: x//2, num))*K
    print(ans)

Measured memory_bytes: 38256
# coding: utf-8
import re
import math
import itertools
from copy import deepcopy
import fractions
import random
from functools import lru_cache
from heapq import heappop,heappush
import time
import sys
readline = sys.stdin.readline
sys.setrecursionlimit(2000)
#import numpy as np
alphabet="abcdefghijklmnopqrstuvwxyz"
mod=int(10**9+7)
inf=int(10**20)
def yn(b):
    if b:
        print("yes")
    else:
        print("no")
def Yn(b):
    if b:
        print("Yes")
    else:
        print("No")
def YN(b):
    if b:
        print("YES")
    else:
        print("NO")
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def fac_list(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
def get_primes(n,type="int"):
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    if(type=="bool"):return A
    B=[]
    for a in range(n+1):
        if(A[a]):B.append(a)
    return B
def is_prime(num):
    if(num<=2):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def join(A,c=" "):
    n=len(A)
    A=list(map(str,A))
    s=""
    for a in range(n):
        s+=A[a]
        if(a<n-1):s+=c
    return s

#main
N,A,B=map(int,input().split())
C=A+B
ans=N//(A+B)
ans=ans*A
N%=(A+B)
if N<=A:
    ans+=N
else:
    ans+=A
print(ans)


Measured memory_bytes: 6736
#include<stdio.h>
#include<string.h>
int main()
{
int n=0,a,b,i=0,m=0;
char s[1000],c;
scanf("%d",&a);
getchar();
c=getchar();
while(c>='A'&&c<='Z')
{ s[i]=c;i++;
c=getchar();
if(i==a) break;

}
for(i=0;i<a-2;i++)
if(s[i]=='A'&&s[i+1]=='B'&&s[i+2]=='C') m++;
printf("%d",m);
return 0; 

}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
int n,m,a,b,dp[111111],ans;
vector<int>v[111111];
int dfs(int x){
	if(dp[x])return dp[x];
	rep(i,v[x].size())dp[x]=max(dfs(v[x][i])+1,dp[x]);
	ans=max(ans,dp[x]);
	return dp[x];
}
signed main(){
	cin>>n>>m;
	rep(i,m){
		cin>>a>>b;
		a--,b--;
		v[a].push_back(b);
	}
	rep(i,n)if(!dp[i])dfs(i);
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 8832
open System.Collections.Generic

type Scanner() = class
    let mutable hold = [||]
    let mutable index = 0
    member public this.Next() =
        if hold.Length > index
        then 
            index <- index + 1
            hold.[index - 1]
        else
            let mutable st = stdin.ReadLine()
            while st = "" do st <- stdin.ReadLine()
            hold <- st.Split(' ')
            if hold.Length = 0
            then
                this.Next()
            else
                index <- 1
                hold.[index - 1]
            
    member public this.NextI32() =
        this.Next() |> int

    member public this.ArrayI32(n: int) =
        [|for _ in 0 .. n - 1 -> this.NextI32()|]

    member public this.IArrayI32(n: int) =
        [|for i in 0 .. n - 1 -> this.NextI32(), i|]

    member public this.NextI64() =
        this.Next() |> int64
    
    member public this.ArrayI64(n: int) =
        [|for _ in 0 .. n - 1 -> this.NextI64()|]

    member public this.IArrayI64(n: int) =
        [|for i in 0 .. n - 1 -> this.NextI64(), i|]

    member public this.NextF32() =
        this.Next() |> float32
    
    member public this.ArrayF32(n: int) =
        [|for _ in 0 .. n - 1 -> this.NextF32()|]

    member public this.IArrayF32(n: int) =
        [|for i in 0 .. n - 1 -> this.NextF32(), i|]

    member public this.NextF64() =
        this.Next() |> double
    
    member public this.ArrayF64(n: int) =
        [|for _ in 0 .. n - 1 -> this.NextF64()|]

    member public this.IArrayF64(n: int) =
        [|for i in 0 .. n - 1 -> this.NextF64(), i|]

    member public __.Tuple2Array n (f : int -> 'a list) =
        [|for _ in 0 .. n - 1 -> f 2 |> fun x -> x.[0], x.[1]|]
    
    member public __.Tuple3Array n (f : int -> 'a list) =
        [|for _ in 0 .. n - 1 -> f 3 |> fun x -> x.[0], x.[1], x.[2]|]

    member public __.CountDic n (f : unit -> 'a) =
        let seqs = seq {for _ in 0 .. n - 1 -> f()}
        let dic = new Dictionary<'a, int64>();
        for i in seqs do
            if dic.ContainsKey(i)
            then dic.[i] <- dic.[i] + 1L
            else dic.Add(i, 1L)
        dic

end

[<EntryPoint>]
let main _ =
#if DEBUG
    printfn "debuged"
#endif

    let scanner = Scanner()
    let s = scanner.Next().ToCharArray()
    let l = Array.length s
    let f arr =
        let rarr = arr |> Array.rev
        arr = rarr
    let fs = s.[0..l/2-1]
    let ls = s.[l/2+1..l-1]
    if f s && f fs && f ls then "Yes" else "No"
    |> printfn "%s"

    0


Measured memory_bytes: 18236
n, m = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]
roads = [tuple(int(i) for i in input().split()) for _ in range(m)]

h_ans = [0] * n
for s, g in roads:
  if h[s-1] > h[g-1]:
    h_ans[g-1] += 1
  elif h[s-1] < h[g-1]:
    h_ans[s-1] += 1
  else:
    h_ans[g-1] += 1
    h_ans[s-1] += 1
    
print(h_ans.count(0))

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

int main(){
    int k,x;
    cin >> k >> x;
    if (k*500 >= x){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
    return 0;
}

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

int main() {
  int n, m;
  vector<int> a(m);
  vector<int> b(m);
  
  cin >> n >> m;
  
  for (int i = 0; i < m; i++) {
  	cin >> a.at(i) >> b.at(i);
  }
  
  vector<int> road(n);
  for (int i = 0; i < m; i++) {
    road.at(a.at(i) - 1) += 1;
    road.at(b.at(i) - 1) += 1;
  }
  
  for (int i = 0; i < n; i++) {
  	cout << road.at(i) << endl;
  }
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#define rep(i, n) for (lli i = 0; i < (n); i++)
#define rrep(i, n) for (lli i = (n)-1; i >= 0; i--)
using namespace std;
using lli = long long int;
int main() {
  string s;
  cin >> s;
  int a = (s[0] - '0') * 10 + (s[1] - '0');
  int b = (s[2] - '0') * 10 + (s[3] - '0');
  int ma = a == 0 || a > 12;
  int mb = b == 0 || b > 12;
  if(ma && mb){
      cout << "NA"<<endl;
  }else if(ma && !mb){
      cout << "YYMM"<<endl;
  }else if(mb && !ma){
      cout << "MMYY"<<endl;
  }else {
      cout << "AMBIGUOUS"<<endl;
  }

}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <climits>
#include <string>
#include <bitset>
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;
#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 fin(ans) cout<<(ans)<<endl
#define STI(s) atoi(s.c_str())
#define mp(p,q) make_pair(p,q)
#define pb(n) push_back(n)
#define Sort(a) sort(a.begin(),a.end())
#define Rort(a) sort(a.rbegin(),a.rend())
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;}
const int P = 1000000007;
const int INF = INT_MAX;
const long long LLINF = 1LL<<60;
//g++ -std=c++1z main.cpp
//.\a.exe

int main(void){ios::sync_with_stdio(false);cin.tie(0);
////////////////////////////////////////////////////////
int a;
string s;
cin >> a >> s;
if(a<3200){
   cout << "red" << endl; 
}

else{
   cout << s << endl;
}
////////////////////////////////////////////////////////
return 0;}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll MOD = 998244353;
const ll INF = (ll)1000000007 * 1000000007;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef long double ld;
typedef complex<ld> Point;
const ld eps = 1e-11;
const ld pi = acos(-1.0);
typedef pair<ll, ll> LP;
typedef pair<ld, ld> LDP;
queue<int> s[300];
int main(){
	int n, m; cin >> n >> m;
	rep(i, n) {
		rep(j, m) {
			int a; cin >> a; a--;
			s[i].push(a);
		}
	}
	int used[300] = {};
	int out = 1000;
	while(true) {
		bool f = false;
		rep(i, n) {
			if (s[i].empty())f = true;
		}
		if (f)break;
		int cnt[300] = {};
		rep(i, n) {
			cnt[s[i].front()]++;
		}
		int ma = 0;
		rep(i,m) {
			ma = max(ma, cnt[i]);
		}
		out = min(out, ma);
		rep(i, n) {
			if (cnt[s[i].front()] == ma) {
				used[s[i].front()] = 1;
			}
		}
		rep(i, n) {
			while (!s[i].empty()&&used[s[i].front()])s[i].pop();
		}
	}
	cout << out << endl;
	return 0;
}

Measured memory_bytes: 768
#include <iostream>
#include <cstring>
#include <cmath>
#include <string>
#include <algorithm>
#include <utility>
#include <vector>
#include <set>
#include <map>
#include <deque>
#include <tuple>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using pll = pair<ll,ll>;
using tll = tuple<ll,ll,ll>;
#define pb push_back
#define for1(i,n) for (ll i=0;i<(n);(i)++)
#define for2(i,m,n) for (ll i=(m);(i)<(n);(i)++)
#define for3(i,m,n,d) for (ll i=(m);(i)<(n);(i)+=(d))
#define INF (1LL << 60)
#define DEBUG 0
#if DEBUG
    #define dump(v1) dump_1(#v1, v1)
    #define dump2(v1,v2) dump_2(#v1, v1, #v2, v2)
    #define dump3(v1,v2,v3) dump_3(#v1, v1, #v2, v2, #v3, v3)
#else
    #define dump(v1)
    #define dump2(v1,v2)
    #define dump3(v1,v2,v3)
#endif
#if DEBUG
template <typename T>
void dump_1(const string& n1, const T& v1)
{
    cerr << n1 << ": " << v1 << endl;
}
template <typename T1, typename T2>
void dump_2(const string& n1, const T1& v1, const string& n2, const T2& v2)
{
    cerr << n1 << ": " << v1 << "  " << n2 << ": " << v2 << endl;
}
template <typename T1, typename T2, typename T3>
void dump_3(const string& n1, const T1& v1, const string& n2, const T2& v2, const string& n3, const T3& v3)
{
    cerr << n1 << ": " << v1 << "  " << n2 << ": " << v2 << "  " << n3 << ": " << v3 << endl;
}
template <typename T1,typename T2>
ostream& operator << (ostream& os, const pair<T1,T2>& v)
{
    os << "(" << v.first << ", " << v.second << ")";
    return os;
}
template <typename T1,typename T2, typename T3>
ostream& operator << (ostream& os, const tuple<T1,T2,T3>& v)
{
    os << "(" << get<0>(v) << ", " << get<1>(v) << ", " << get<2>(v) << ")";
    return os;
}
template <typename T>
ostream& operator << (ostream& os, const vector<T>& v)
{
    os << "[";
    for (auto it = v.begin(); it != v.end(); it++) {
        if (it != v.begin()) {
            os << ", ";
        }
        os << *it;
    }
    os << "]";
    return os;
}
template <typename T>
ostream& operator << (ostream& os, const set<T>& v)
{
    os << "{";
    for (auto it = v.begin(); it != v.end(); it++) {
        if (it != v.begin()) {
            os << ", ";
        }
        os << *it;
    }
    os << "}";
    return os;
}
template <typename T1, typename T2>
ostream& operator << (ostream& os, const map<T1,T2>& v)
{
    os << "{";
    for (auto it = v.begin(); it != v.end(); it++) {
        if (it != v.begin()) {
            os << ", ";
        }
        os << it->first << ":" << it->second;
    }
    os << "}";
    return os;
}
#endif // DEBUG
template <typename T>
void print(const T& v)
{
    cout << v << endl;
}
//---------------------------------------------------------

void solve()
{
    ll ans = 0;
    ll r = 0;
    cin >> r;
    ans = 3 * r * r;

    print(ans);
}

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


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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	string S,T;
	cin>>S>>T;
	cout<<T<<S<<endl;
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


Measured memory_bytes: 256