akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <iostream>
#include <string.h>
#include <limits.h>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>

#ifndef ULLONG
typedef unsigned long long ULLONG;
#endif
#ifndef LLONG
typedef long long LLONG;
#endif
template <class _T> static _T tp_abs(const _T& a) {
	return ((a < 0) ? (a * -1) : a);
}
template <class _T> static _T tp_min(_T a, _T b) {
	return a < b ? a : b;
}
template <class _T> static _T tp_max(_T a, _T b) {
	return a > b ? a : b;
}
template<class _T> static void get1int(_T& a) {
	const char* fmt = " %d";
	if (sizeof(_T) == sizeof(long long)) {
		fmt = " %lld";
	}

	if (scanf(fmt, &a) < 0) {
		printf("g1int Error\n");
	}
}
template<class _T> static void get2int(_T& a, _T& b) {
	const char* fmt = " %d %d";
	if (sizeof(_T) == sizeof(long long)) {
		fmt = " %lld %lld";
	}

	if (scanf(fmt, &a, &b) < 0) {
		printf("g2int Error\n");
	}
}
template<class _T> static void get3int(_T& a, _T& b, _T& c) {
	const char* fmt = " %d %d %d";
	if (sizeof(_T) == sizeof(long long)) {
		fmt = " %lld %lld %lld";
	}

	if (scanf(fmt, &a, &b, &c) < 0) {
		printf("g3int Error\n");
	}
}
static void getstring(char* buff) {
	if (scanf(" %s", buff) < 0) {
		printf("getstr error!\n");
	}
}
static const long long MOD_NUM = 1000000007LL;

static void D2_task();

int main()
{
	D2_task();
	fflush(stdout);
	return 0;
}

class D2_data {
public:
	LLONG value = 0;
	bool add = false;
};
static void D2_dfs(std::vector<std::vector<int>>& graph, D2_data* tree, int now, int par)
{
//	if (tree[par].add) return;
//	tree[par].add = true;

	for (auto it = graph[now].begin(); it != graph[now].end(); it++) {
		if (*it == par) continue;
		tree[*it].value += tree[now].value;
		D2_dfs(graph, tree, *it, now);
	}
}

static void D2_task()
{
	int N, Q;
	get2int(N, Q);

	std::vector<std::vector<int>> graph(N);
	int a, b;
	for (int i = 0; i < N - 1; i++) {
		get2int(a, b); a--; b--;
		graph[a].push_back(b);
		graph[b].push_back(a);
	}
	auto tree = new D2_data[N];

	int p, x;
	for (int i = 0; i < Q; i++) {
		get2int(p, x); p--;
		tree[p].value += (LLONG)x;
	}
	//for (int i = 0; i < N; i++) {
		D2_dfs(graph, tree, 0, -1);
	//}

	for (int i = 0; i < N; i++) {
		printf("%lld ", tree[i].value);
	}

	delete[] tree;
}


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

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef pair<LL, LL> PLL;

#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

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

#define FF first
#define SS second
template<class S, class T>
istream& operator>>(istream& is, pair<S,T>& p){
  return is >> p.FF >> p.SS;
}

const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL MOD = 1e9+7;

int N, W, H;
int sz;
int idx(int x, int y){
  if(y == 0) return x;
  if(x == W) return W + y;
  if(y == H) return W + H + W-x;
  return W+H+W+H-y;
}
int projc(int x, int y, int dir){
  switch(dir){
  case 0:
	return idx(x-min(x,y),y-min(x,y));
  case 1:
	return idx(x+min(W-x,y),y-min(W-x,y));
  case 2:
	return idx(x+min(W-x,H-y),y+min(W-x,H-y));
  case 3:
	return idx(x-min(x,H-y),y+min(x,H-y));
  }
  return -1;
}

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

  cin >> N >> W >> H;
  sz = 2*(W+H); 
  vector<PII> xs(N);
  REP(i,N){
	char f;
	int x, y; cin >> x >> y >> f;
	PII p;
	int ix = string("SENW").find(f);
	p.FF = projc(x,y,ix);
	p.SS = projc(x,y,(ix+1)%4);
	if(p.SS < p.FF) p.SS += sz;
	xs[i] = p;
  }

  int ans = N;
  REP(i,N) xs.EB(xs[i].FF+sz, xs[i].SS+sz);
  SORT(xs);

  for(int i=0;i<N;++i){
	int sum = 0;
	int e = -1;
	for(int j=i;j<i+N;++j){
	  if(xs[j].FF <= e){
		e = min(e, xs[j].SS);
	  }
	  else{
		++sum;
		e = xs[j].SS;
	  }
	}
	ans = min(ans, sum);
  }

  cout << ans << endl;
  
  return 0;
}

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

#define int long long

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

typedef pair<int, int> P;
int N;
int a[100], b[100], c[100], d[100];
P red[100], blue[100];

signed main() {
    cin >> N;
    for (int i = 0; i < N; i++) {
        cin >> a[i] >> b[i];
        red[i] = P(a[i], b[i]);
    }
    for (int i = 0; i < N; i++) {
        cin >> c[i] >> d[i];
        blue[i] = P(c[i], d[i]);
    }
    sort(red, red + N);
    reverse(red, red + N);
    int ans = 0;
    for (int i = 0; i < N; i++) {
        int min_d = LLONG_MAX, min_j;
        for (int j = 0; j < N; j++) {
            if (c[j] > red[i].first && d[j] > red[i].second && min_d > d[j]) {
                min_d = d[j];
                min_j = j;
            }
        }
        if (min_d != LLONG_MAX) {
            ans++;
            c[min_j] = -1;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
def main():
	from math import log,ceil
	n=int(input())
	a=list(map(int,input().split()))
	num={}
	for x in a:
		if x in num:
			num[x]+=1
		else:
			num[x]=1
	ans=0
	cnt=ceil(log(max(a),2)+1e-9)+1

	for i in range(cnt,0,-1):
		b={}
		for x in num:
			if 2**i-x in b:
				b[2**i-x]+=1
			else:
				b[2**i-x]=1
		for x in num:
			if x in b and num[x]>0:
				if x*2==2**i:
					ans+=num[x]//2
					num[x]%=2
				else:
					small=min(num[x],num[2**i-x])
					ans+=small
					num[x]-=small
					num[2**i-x]-=small
	print(ans)
if __name__ == '__main__':
	main()

Measured memory_bytes: 226044
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <stack>
#include <queue>
#include <cmath>
using namespace std;
const long long  max_n = 5000;
long long cnt[111];
long long b = 1;
long long n,a,W;
const int INF = 1e9;
const int mod = 1e9 + 7;
long long s[max_n],v[max_n],w[1000];
long long dp[max_n];
vector<vector<int> > G;

void solve(){
    long long count = 0;
    while(n > 0){
      n /= a;  
      count++;
    }
    cout << count << endl;
}
int main(){
    cin >> n >> a;
 
    solve();
    return 0;
}

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

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);
    vector<int> a(4);
    for (int i = 0; i < 4; ++i)
        cin >> a[i];
    sort(a.begin(), a.end());
    if (a[0] == 1 && a[1] == 4 && a[2] == 7 && a[3] == 9)
        cout << "YES";
    else
        cout << "NO";
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <climits>
#include <algorithm>
#include <cmath>
#include <map>
#include <string>
#include <bitset>
#include <set>

using ll = long long;
using namespace std;

int main(void) {
	int n;
	cin >> n;
	
	set<int> st;
	for(int i = 0; i < n; ++i) {
		int a;
		cin >> a;
		st.insert(a);
	}
	
	if( st.size() == n ) cout << "YES" << endl;
	else cout << "NO" << endl;
	
	return 0;
}


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

typedef long long STATES;

int main( void )
{
	STATES free_days[31], dp[51], goal_state, next;
	int i, j, n, answer, free_day, k;

	while ( scanf( "%d", &n ) == 1 && n )
	{
		memset( free_days, 0, sizeof(free_days) );
		memset( dp, 0, sizeof(dp) );

		goal_state = 0;
		for ( i = 0; i < n; i++ ) goal_state |= 1LL << i;

		for ( i = 0; i < n; i++ )
		{
			scanf( "%d", &k );
			for ( j = 0; j < k; j++ )
			{
				scanf( "%d", &free_day );
				free_days[free_day] |= 1LL << i;
			}
		}

		answer = -1;
		for ( i = 0; i < n; i++ ) dp[i] = 1LL << i;
		for ( i = 1; i <= 30; i++ )
		{
			next = 0;
			for ( j = 0; j < n; j++ ) if ( free_days[i] & 1LL << j ) next |= dp[j];
			if ( next == goal_state )
			{
				answer = i;
				break;
			}
			for ( j = 0; j < n; j++ ) if ( free_days[i] & 1LL << j ) dp[j] |= next;
		}

		printf( "%d\n", answer );
	}

	return 0;
}

Measured memory_bytes: 760
# coding=utf-8

###
### for atcorder program
###

import sys
import math

# math class
class mymath:
    ### pi
    pi = 3.14159265358979323846264338

    ### Prime Number
    def pnum_eratosthenes(self, n):
        ptable = [0 for i in range(n+1)]
        plist = []

        for i in range(2, n+1):
            if ptable[i]==0:
                plist.append(i)
                for j in range(i+i, n+1, i):
                    ptable[j] = 1
        return plist

    ### GCD
    def gcd(self, a, b):
        if b == 0:
            return a
        return self.gcd(b, a%b)

    ### LCM
    def lcm(self, a, b):
        return (a*b)//self.gcd(a,b)

    ### Mat Multiplication
    def mul(self, A, B):
        ans = []
        for a in A:
            c = 0
            for j, row in enumerate(a):
                c += row*B[j]
            ans.append(c)
        return ans

mymath = mymath()

### output class
class output:
    ### list
    def list(self, l):
        l = list(l)
        #print(" ", end="")
        for i, num in enumerate(l):
            print(num, end="")
            if i != len(l)-1:
                print(" ", end="")
        print()

output = output()

### input sample
#i = input()
#N = int(input())
#A, B, C = [x for x in input().split()]
#N, K = [int(x) for x in input().split()]
#inlist = [int(w) for w in input().split()]

#R = float(input())
#A.append(list(map(int,input().split())))

#for line in sys.stdin.readlines():
#    x, y = [int(temp) for temp in line.split()]

#abc list
#abc = [chr(ord('a') + i) for i in range(26)]

### output sample
#print("{0} {1} {2:.5f}".format(A//B, A%B, A/B))
#print("{0:.6f} {1:.6f}".format(R*R*math.pi,R*2*math.pi))
#print(" {}".format(i), end="")

def get_input():
    N = []
    while True:
        try:
            N.append(input())
            #N.append(int(input()))
            #N.append(float(input()))
        except EOFError:
            break
    return N

def is_integer(n):
    try:
        float(n)
    except ValueError:
        return False
    else:
        return float(n).is_integer()

def dist(A, B):
    d = 0
    for i in range(len(A)):
        d += (A[i]-B[i])**2            
    d = d**(1/2)
    return d

while True:
    N = int(input())
    
    if N == 0:
        break
    
    S = []
    ans = None
    flag = False

    for i in range(N):
        S.append(len(input()))

    #print(S)

    for i in range(N):
        for j in range(i, N):
            A = S[i:j+1] 
            C = [5, 12, 17, 24, 31]
            #print(sum(A))
            if sum(A) == 31:
                for k in A:
                    C = [x-k if x != 0 else x for x in C]
            if sum(C) == 0:
                ans = i
                flag = True
                break
        if flag:
            break

    print(ans+1)



Measured memory_bytes: 5700
#include <bits/stdc++.h>
#define f first
#define s second
#define MOD 1000000007
#define PMOD 998244353
#define pb(x) push_back(x)
using namespace std;

typedef long long int ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> plii;
typedef pair<int, pii> piii;
const int INF = 1e9+10;
const ll LINF = 1LL*INF*INF;
const int MAXN = 5e5+10;
const int MAXM = 5e3+10;

priority_queue<int> pq;
vector<vector<int> > graph;
queue<int> que;

int A[MAXN];
int P[MAXN];
int res[MAXN];
int tmp[MAXN];
int mnv[MAXN];

void merge_sort(int st,int en,int k)
{
    if(st==en)return;

    int mid = (st+en)>>1;

    merge_sort(st,mid,k);
    merge_sort(mid+1,en,k);

    for(int i=st;i<=en;i++)tmp[i] = P[i];

    mnv[mid] = tmp[mid];

    for(int i=mid-1;i>=st;i--)
        mnv[i] = min(mnv[i+1],tmp[i]);

    int i = st,j = mid+1;
    int idx = st;

    while(i<=mid&&j<=en){
        if(mnv[i]<tmp[j]+k){
            P[idx] = tmp[i];
            idx++; i++;
        }
        else {
            P[idx] = tmp[j];
            idx++; j++;
        }
    }
    if(i<=mid){
        for(;i<=mid;i++)
            P[idx++] = tmp[i];
    }
    else {
        for(;j<=en;j++)
            P[idx++] = tmp[j];
    }

    return;
}

int main()
{
    int n,m,k,a,b,x,y,q;
    int sum = 0;
    int cnt = 0;
    int mx = 0;
    int mn = INF;
    int cur = 0, idx = -1;
    int tc;

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin>>n>>k;

    for(int i=1;i<=n;i++)
        cin>>A[i];

    for(int i=1;i<=n;i++)
        P[A[i]] = i;

    merge_sort(1,n,k);

    for(int i=1;i<=n;i++)
        res[P[i]] = i;

    for(int i=1;i<=n;i++)
        cout<<res[i]<<"\n";

    return 0;
}


Measured memory_bytes: 13312
#include <bits/stdc++.h>
#include <vector>
#include <queue>
#include <set>
using namespace std;
//#include <boost/multiprecision/cpp_int.hpp>
//using multiInt = boost::multiprecision::cpp_int;

using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template<typename Q_temp>
using smaller_queue = priority_queue <Q_temp, vector<Q_temp>, greater<Q_temp> >;

const ll MOD = (ll) (1e9 + 7);
const int INF = (int) 1e9;
const ll LINF = (ll) 4e18;
const double PI = acos(-1.0);

#define REP(i,m,n) for(ll i = m; i < (ll)(n); ++i)
#define rep(i,n) REP(i, 0, n)
#define MP make_pair
#define MT make_tuple
#define YES(n) cout << ((n) ? "YES" : "NO") << endl
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible") << endl
#define all(v) v.begin(), v.end()
#define NP(v) next_permutation(all(v))
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define dbg2(x_) for(auto a_ : x_) cerr << a_ << " "; cerr << endl;
#define dbg3(x_ , sx_) rep(i, sx_) cerr << x_[i] << " "; cerr << endl;
vector<int> Dx = {0, 0, -1, 1, -1, 1, -1, 1, 0};
vector<int> Dy = {1, -1, 0, 0, -1, -1, 1, 1, 0};

inline ll CEIL(ll a, ll b) {
    return (a + b - 1) / b;
}

void finish() {
    cout << -1 << endl;
    exit(0);
}

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

bool comp(const set<int>& s1, const set<int>& s2) {
    return s1.size() < s2.size();
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << setprecision(20) << setiosflags(ios::fixed);
    int n;
    cin >> n;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];
    bool can = false;
    bool all_zero = true;
    rep(i, n) if (a[i] != 0) all_zero = false;
    if (all_zero) can = true;

    if (n % 3 == 0) {
        sort(all(a));
        ll a1 = a[0], a2 = a[n / 3], a3 = a[2 * n / 3];
        if ((a1 ^ a2 ^ a3) == 0) {
            bool same = true;
            rep(i, n / 3) if (a[i] != a1) same = false;
            REP(i, n / 3, 2 * n / 3) if (a[i] != a2) same = false;
            REP(i, 2 * n / 3, n) if (a[i] != a3) same = false;
            if (same) can = true;
        }

    }
    Yes(can);
    return 0;
}



Measured memory_bytes: 1024
require 'pp'

# 空白区切の入力値を数値の配列で返却する
def gets_i_list()
  gets.chomp.split(" ").map(&:to_i)
end

N, M = gets_i_list

one_two = []
n_two   = []
ab_list = M.times.map do
  from, to = gets_i_list
  if from == 1
    one_two.push(to)
  elsif to == 1
    one_two.push(from)
  end

  if from == N
    n_two.push(to)
  elsif to == N
    n_two.push(from)
  end    
end

if (one_two & n_two).empty?
  puts "IMPOSSIBLE"
else
  puts "POSSIBLE"
end


Measured memory_bytes: 11896
'use strict'
function Main(input) {
  	if(input.includes('AA')||input.includes('AI')||input.includes('IA')){
       console.log('NO');
  	   return;
	}
	input = input.trim();
    input = input.split("");
  	for(let i =0; i< input.length; i++){
      if(input[i] === 'A'){
        input.splice(i, 1);
      }
    }
  	let result;
  	let str = input.join("");
 	if(str === 'KIHBR'){
      result = 'YES';
    }else{
      result = 'NO';
    }
	console.log(result);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 29652
import sys
#import numpy as np

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in ss]
ss2nnn = lambda ss: [s2nn(s) for s in ss]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [sys.stdin.readline().rstrip() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    S = i2s()
    n = 0
    na = 0
    ba = False
    bb = False
    for s in S:
        if s == 'A':
            if ba:
                na += 1
                ba = True
                bb = False
            elif bb:
                na = 1
                ba = True
                bb = False
            else:
                na = 1
                ba = True
                bb = False
        elif s == 'B':
            if ba:
                ba = False
                bb = True
            elif bb:
                na = 0
                ba = False
                bb = False
            else:
                na = 0
                ba = False
                bb = False
        else:
            if ba:
                na = 0
                ba = False
                bb = False
            if bb:
                n += na
                #na = 0
                ba = True
                bb = False
            else:
                na = 0
                ba = False
                bb = False
    print(n)

main()


Measured memory_bytes: 41820
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
typedef long long LL;
LL N,A,B;
LL C[1000001];

bool check(LL x){
   vector<LL>v;
   REP(i,N){
       v.push_back(C[i]-x*B);
   }
   LL c=0;
   REP(i,N){
       if(v[i]<=0)continue;
       c+=((v[i]+A-B-1)/(A-B));
   }
   if(c>x){
      return false;
   }else{
      return true;
   }
}

LL binary_search(){
   LL ub=0;
   LL lb=1e9+1;
   while((lb-ub)!=1){
      LL mid=(ub+lb)/2;
      if(check(mid)){
         lb=mid;
      }else{
         ub=mid;
      }
   }
   return lb;
}

int main(){
    cin>>N>>A>>B;
    REP(i,N){
        cin>>C[i];
    }
    cout<<binary_search()<<endl;
    return(0);
}

Measured memory_bytes: 2896
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <tuple>
#define mkp make_pair
#define mkt make_tuple
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;

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

  string a="",b="";
  rep(i,B) a+=char('0'+A);
  rep(i,A) b+=char('0'+B);

  if(a<b) cout<<a<<endl;
  else cout<<b<<endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int x;
  cin >>x;
  x=x%7;
  if(x==0)cout <<"thu"<<endl;
  if(x==1)cout <<"fri"<<endl;
  if(x==2)cout <<"sat"<<endl;
  if(x==3)cout <<"sun"<<endl;
  if(x==4)cout <<"mon"<<endl;
  if(x==5)cout <<"tue"<<endl;
  if(x==6)cout <<"wed"<<endl;
}

Measured memory_bytes: 3088
n, y = map(int, input().split())

for i in range(n+1):
    for j in range(n-i+1):
        if i*10000+j*5000+(n-i-j)*1000 == y:
            print("{} {} {}".format(i, j, n-i-j))
            exit()

print("-1 -1 -1")

Measured memory_bytes: 2940
#include <iostream>
#include <string>
#include <string.h>
#include <math.h>
#include <cmath>
#include <vector>
#include <algorithm>
#include <queue>

#define ll long long

using namespace std;

const long long mod = 1e9 + 7;

struct score{
    ll sum;
    vector<ll> minusV;
};

int main() {
    string s;
    cin >> s;
    const char* schar;
    schar = s.c_str();

    int k = 1;
    for(int i = 1; i < s.length(); i++){
        if(schar[i-1] != schar[i]){
            k++;
        }else{
            if(i == s.length()-1){
                break;
            }else{
                if(i == s.length()-2){
                    k++;
                    break;
                }else{
                    i += 2;
                    k += 2;
                }
            }
        }
    }

    cout << k << endl;
}

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

int main() {
    int N, M; cin >> N >> M;
    vector<int> v(MAX, 1);
    for (int i = 0; i < M; ++i) {
        int a; cin >> a;
        v[a] = 0;
    }
    vector<ll> dp(MAX);
    dp[0] = 1;
    for (int i = 0; i < N; ++i) {
        if (v[i]) {
            if (v[i + 1]) (dp[i + 1] += dp[i]) %= mod;
            if (v[i + 2]) (dp[i + 2] += dp[i]) %= mod;
        }
    }

    cout << dp[N] << endl;
    return 0;
}

Measured memory_bytes: 1408
#include<cstdio>
int main(){
	char a[1001];
	scanf("%s",a);
	for(int i=0;a[i];i++){
		a[i]-=3;
		if(a[i]<'A')a[i]+=26;
		}
	printf("%s\n",a);
	return 0;
	}

Measured memory_bytes: 948
#include <stdio.h>
/*#include <stdlib.h>
#include <algorithm>
#include <numeric>
#include <string>
#include <vector>
#include <iostream>
#include <forward_list>*/
using namespace std;

#define SCAN_INT(i) scanf("%lld", i)
#define FOR(i, start, end) for (int i = start; i < end; i++)
#define PRINT_INT(i) printf("%lld\n", i)
#define PRINT_TWO_INT(i, j) printf("%d %d\n", i, j)
#define PRINT_THREE_INT(i, j, k) printf("%d %d %d\n", i, j, k)

int main()
{
    char ss[3];
    scanf("%s", ss);

    bool flag = false;
    for (int i = 0; i < 2; i++)
    {
        if (ss[i] != ss[i + 1])
        {
            flag = true;
            break;
        }
    }

    if (flag)
        printf("Yes");
    else
        printf("No");
    return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;


int main()
{
	int a, b, x;
	cin >> a >> b >> x;
	if (x <= a + b && x >= a)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;

	
	return 0;
}

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

cnt=0
cnt=H[0]
for i,num in enumerate(H):
    if(cnt>num):
        if(cnt>num+1):
            print("No")
            cnt=-1
            break
    else:
        cnt=num

if(cnt!=-1):
    print("Yes")
    

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

#define int long long
using namespace std;
#define rep(i, n) for(int i=0;i<(n);++i)
typedef pair<int, int> pii;
const int INF = 1l << 60;
#define u_b upper_bound
#define l_b lower_bound

int N, K, Q;
int A[100100];
int B[100100];

signed main() {
    cin >> N >> K >> Q;
    rep(i, Q) {
        cin >> A[i];
        --A[i];
        B[A[i]]++;
    }
    rep(i, N) {
        if (K - Q + B[i] <= 0) {
            cout << "No" << endl;
        } else {
            cout << "Yes" << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 2176
#include "bits/stdc++.h"
using namespace std;

typedef long long ll;

ll X[100010];
ll Y[100010];
ll Cost[100010];

int main(){
    int H, W, D;
    cin >> H>>W>>D;
    for(int y = 1; y <=H;y++){
        for(int x = 1; x <= W; x++){
            int a;
            cin >> a;
            X[a] = x;
            Y[a] = y;
        }
    }
    for(int i=D+1;i<100000;i++){
        Cost[i] = Cost[i-D] + abs(X[i] - X[i-D]) + abs(Y[i] - Y[i-D]);
    }
    int Q;
    cin>>Q;
    for(int q = 1; q <= Q; q++){
        int l, r;
        cin >> l >> r;
        cout << Cost[r] - Cost[l]<<endl;
    }



    return 0;
}

Measured memory_bytes: 3328
#include "bits/stdc++.h"
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

using ll = long long;
using ii = pair<int,int>;
using vi = vector<int>;
using vii = vector<ii>;

const int mod = 1e9+7;
const int oo = 1e8+7;

int n, m;
vector<vi> AdjList;
vi dp;

int dag(int u) {
 
    if(dp[u] != -1) {
        return dp[u];
    }
    
    debug() << imie(u);
    
    int ans = 0;
    
    for(int i = 0; i < (int)AdjList[u].size(); ++i) {
        int v = AdjList[u][i];
        debug() << imie(u) imie(v);
        ans = max(ans, 1+dag(v));
    }
    
    dp[u] = ans;
    return ans;
}


int main() {

    scanf("%d%d",&n,&m);
    
    dp.assign(n+1, -1);
    AdjList.resize(n+1);
    
    for(int i = 0; i < m; ++i) {
        int c1, c2;
        scanf("%d%d",&c1,&c2);
        AdjList[c1].push_back(c2);
    }
    
    for(int i = 1; i <= n; ++i) {
        AdjList[0].push_back(i);
    }
    
    int ans = dag(0);
    
    cout << ans-1 << endl;
    
    return 0;
}



Measured memory_bytes: 8696
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int (i) = 0; (i) <(n); (i)++) 
#define so(v) sort(v.begin(),v.end())
using ll = long long;
using vi=vector<int>;
using vvi=vector<vi>;
const int MAX = 510000;
const int MOD = 1000000007;
ll gcd(ll a, ll b)
{
   if (a%b == 0)
   {
       return(b);
   }
   else
   {
       return(gcd(b, a%b));
   }
}
ll lcm(ll a, ll b)
{
   return a * b / gcd(a, b);
}
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
// 二項係数計算
long long com(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main() {
  int a,b;
  cin>>b>>a;
  if(a%2!=0){
    cout<<"No"<<endl;
    return 0;
  }
  if((a/2-b>=0)&&(2*b-a/2>=0)){
    cout<<"Yes"<<endl;
  }
  else cout<<"No"<<endl;
  
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define rep2(i, s, n) for (ll i = s; i < (ll)(n); i++)
#define repr(i, n) for (ll i = n; i >= 0; i--)
#define pb push_back
#define COUT(x) cout << (x) << endl
#define COUTF(x) cout << setprecision(15) << (x) << endl
#define ENDL cout << endl
#define DF(x) x.erase(x.begin())  // 先頭文字削除
#define ALL(x) x.begin(), x.end()
#define SORT(x) sort(ALL(x))
#define REVERSE(x) reverse(ALL(x))
#ifdef _DEBUG
#define debug(x) cout << "[debug] " << #x << ": " << x << endl
#else
#define debug(x)
#endif
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using P = pair<ll, ll>;
constexpr ll INF = 0x3f3f3f3f3f3f3f3f;
constexpr double PI = 3.141592653589793238462643383279;
ll getDigit(ll x) {
  return x == 0 ? 1 : log10(x) + 1;
}

ll gcd(ll x, ll y) {
  return y ? gcd(y, x % y) : x;
}

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

vector<P> factorize(ll n) {
  vector<P> result;
  for (ll i = 2; i * i <= n; ++i) {
    if (n % i == 0) {
      result.pb({i, 0});
      while (n % i == 0) {
        n /= i;
        result.back().second++;
      }
    }
  }
  if (n != 1) {
    result.pb({n, 1});
  }
  return result;
}

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

signed main() {
  ll N, K, Q;
  cin >> N >> K >> Q;

  vll ans(N);
  rep(i, Q) {
    ll a;
    cin >> a;
    a--;
    ans[a]++;
  }

  rep(i, N) {
    ll point = K - Q + ans[i];
    if (point > 0) {
      COUT("Yes");
    } else {
      COUT("No");
    }
  }

  return 0;
}

Measured memory_bytes: 1408
#include <bits/stdc++.h>
#define FOR(i, m, n) for (int i = m; i < (n); i++)
#define RFOR(i, m, n) for (int i = (m - 1); i >= 0; i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, n, 0)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
using namespace std;
typedef long long ll;
const int mod = 1e9 + 7;

int main()
{
  ll n, q;
  ll k;
  cin >> n >> k >> q;
  vector<ll> points(n);
  REP(i, q)
  {
    int a;
    cin >> a;
    points[a - 1] += 1;
  }
  REP(i, n)
  {
    if (points[i] - (q - k) <= 0)
    {
      cout << "No" << endl;
    }
    else
    {
      cout << "Yes" << endl;
    }
  }
  return 0;
}

Measured memory_bytes: 1408
#include<bits/stdc++.h>
using namespace std;
int main(){
   int h1, m1, h2, m2, k;
   cin >> h1 >> m1 >> h2 >> m2 >> k;

   int min1 = h1 * 60 + m1;
   int min2 = h2 * 60 + m2;

   int sa = min2 - min1;

   cout << sa - k << endl;
}

Measured memory_bytes: 3616
#include <iostream> // cin, cout, cerr
#include <algorithm> // minmax, sort, swap
#include <numeric> // iota
#include <cstdio> // printf, scanf
#include <string> // string, stoi, to_string
#include <vector> // vector
#include <queue> // queue, priority_queue
#include <deque> // deque
#include <map> // key-value pairs sorted by keys
#include <set> // set
#include <iomanip> // cout<<setprecision(n)
#include <functional> // function<void(int)>

#ifdef DEBUG
#include "debug.hpp"
#else
#define debug(...)
#endif

#define rep(i,n) for(int i = 0; i < (n); i++)
#define ENDL '\n'
#define print(i) std::cout << (i) << '\n'

#define int long long // at least int64 > 9*10^18
#define all(v) (v).begin(), (v).end()
/* libraries */

constexpr int MOD = 1e9+7;
struct mint
{
	int v;
	mint():v(0){}
	mint(int v):v((v+MOD)%MOD){}
	mint operator-()const{ return mint(0) - *this; }
	mint& operator+=(const mint& a){ if((v+=a.v)>=MOD) v-=MOD; return *this; }
	mint& operator-=(const mint& a){ if((v+=MOD-a.v)>=MOD) v-=MOD; return *this; }
	mint& operator*=(const mint& a){ (v*=a.v)%=MOD; return *this; }
	mint& operator/=(const mint& a){ (*this) *= a.inv(); return *this; }
	mint operator+(const mint& a)const{ return mint(*this) += a; }
	mint operator-(const mint& a)const{ return mint(*this) -= a; }
	mint operator*(const mint& a)const{ return mint(*this) *= a; }
	mint operator/(const mint& a)const{ return mint(*this) /= a; }
	bool operator<(const mint& a)const{ return v < a.v; }
	bool operator==(const mint& a)const{ return v == a.v; }
	mint pow(int k)const{ mint r(1),t(v); while(k){ if(k&1) r*=t; t*=t; k>>=1; } return r; }
	mint inv()const{ return pow(MOD-2); }
	static mint comb(int n, int k) {
		if(n-k<k) k=n-k;
		mint num(1), dom(1);
		for(int i=0;i<k;i++) { num*=n-i; dom*=i+1; }
		return num/dom;
	}
};
std::istream& operator>>(std::istream&i,mint&a){ int t; i>>t; a=mint(t); return i; }
std::ostream& operator<<(std::ostream&o,const mint&a){ o<<a.v; return o; }

std::vector<mint> construct_comb(int n) {
	std::vector<mint> c(n+1);
	mint a = 1;
	c[0] = a;
	for(int i=1;i<=n;i++) {
		a = a*mint(n+1-i)/i;
		c[i] = a;
	}
	return c;
}

signed main() {
	int n;
	std::cin >> n;
	std::vector<int> a(n+1);
	std::map<int, std::vector<int> > map;
	rep(i,n+1) {
		int x;
		std::cin >> x;
		a[i] = x;
		map[x].emplace_back(i);
	}
	int s;
	for(auto i:map) {
		if(i.second.size()==2) {
			s = i.second[0] + n-i.second[1];
			break;
		}
	}
	auto npC = construct_comb(n+1);
	auto sC = construct_comb(s);
	for(int i=1;i<=n+1;i++) {
		mint ans = 0;
		if(i-1<=s) {
			ans-=sC[i-1];
		}
		ans+=npC[i];
		print(ans);
	}

	return 0;
}


Measured memory_bytes: 14464
#include <stdio.h>
int main(int argc, const char *argv[]){
    int a,b,c=0;
    scanf("%d %d %d",&a,&b,&c);
    if(a<b && b<c){
        printf("Yes\n");
    }else{
        printf("No\n");
    }
    return 0;
}

Measured memory_bytes: 580
#include <bits/stdc++.h>
#define MOD 998244353
#define pb push_back
#define ll long long int
#define con 1000000007

using namespace std;
int main()
{    
     ios_base::sync_with_stdio(false);
     cin.tie(NULL);
     cout.tie(NULL);
     ll i,j,k,m;
     ll t;
     ll a,b;
     cin>>k>>a>>b;
     if(b/k-((a-1)/k)>0)
         cout<<"OK";
    else
        cout<<"NG";
}  



Measured memory_bytes: 3668
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using tlll=tuple<ll,ll,ll>;
using vs=vector<string>;

#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(ll i=(n)-1;i>=0;i--)
#define range(i,a,n) for(ll i=(a);i<(n);i++)

#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI 3.1415926535897932384

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

template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;}
template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;}
template<class S>S acm(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
void YN(bool b){cout<<(b?"YES":"NO")<<"\n";}
void Yn(bool b){cout<<(b?"Yes":"No")<<"\n";}
void yn(bool b){cout<<(b?"yes":"no")<<"\n";}
int sgn(const double&r){return (r>EPS)-(r<-EPS);} // a>0  : sgn(a)>0
int sgn(const double&a,const double&b){return sgn(a-b);} // b<=c : sgn(b,c)<=0

ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}
template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s;a=0;} return os;}

ll zr=0,pl=0,mn=0;
ll n,k;
vl v,vpl,vzr,vmn;

ll func(ll lim){
	ll ret=0;
	if(lim>=0)ret+=(n*(n-1)/2-(n-zr)*(n-zr-1)/2);
	ll cur=0;
	rep(i,mn){
		while(cur<pl && vpl[cur]*vmn[i] > lim)cur++;
		ret+=(pl-cur);
	}
	cur=pl-1;
	rep(i,pl){
		while(cur>0 && vpl[cur]*vpl[i] > lim)cur--;
		ret+=max(0,cur-i);
	}
	cur=0;
	rrep(i,mn){
		while(cur<mn && vmn[cur]*vmn[i] > lim)cur++;
		ret+=max(0,i-cur);
	}
	return ret;
}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cin>>n>>k;
	v.resize(n);
	rep(i,n)cin>>v[i];
	sort(all(v));
	rep(i,n){
		if(v[i]<0)vmn.push_back(v[i]);
		if(v[i]==0)vzr.push_back(v[i]);
		if(v[i]>0)vpl.push_back(v[i]);
	}
	mn=vmn.size();
	zr=vzr.size();
	pl=vpl.size();
	ll ng=-LINF*4,ok=LINF*4;
	while(ng+1!=ok){
		ll mid=(ng+ok)/2;
		//puta(mid,func(mid));
		if(func(mid)>=k)ok=mid;
		else ng=mid;
	}
	puta(ok);
}


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

#define ll long long
#define pb push_back
#define pf push_front
#define mp make_pair
#define endl "\n" 
#define all(c) c.begin(),c.end()
#define present(c,element) (c.find(element)!=c.end())
#define cpresent(c,element) (find(c,element)!=c.end())
#define forr(i,a,b) for(int i=a;i<int(b);i++)
#define tr(i,a) for(auto i:a)
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int,int> pii;
const double PI=acos(-1);
const ll mod=1e9+7;


int32_t main()
{
ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);

int test=1;
//cin>>test;
while(test--)
{
	int n;
	cin>>n;
	vi h(n);
	for (int i = 0; i < n; ++i)
	{
		/* code */cin>>h[i];
	}
	int dp[n];
	dp[0]=0;dp[1]=abs(h[1]-h[0]);
	for (int i = 2; i < n; ++i)
	{
		/* code */
		dp[i]=min(dp[i-1]+abs(h[i]-h[i-1]),dp[i-2]+abs(h[i]-h[i-2]));
	}
	cout<<dp[n-1]<<endl;



}
return 0;
}










Measured memory_bytes: 1024
#include <iostream>
#include <queue>
#include <string>
#include <map>
#include <stdio.h>
#include <iomanip>
#include <math.h>
#include <vector>
#include <stack>
#include <algorithm>
#include <string.h>
#include <set>
#include <cstdlib>
#include <iostream>
#include <bits/stdc++.h>
#define pii pair<int,int> 
#define ll long long int 
#define sl(n) scanf("%lld",&n)
#define s(n) scanf("%d",&n)
#define f(i,n) for(int i=0;i<n;++i)
#define fo(i,n) for(int i=1;i<=n;++i)
#define fnm(n,m) for(ll i=n;i<m+1;++i)
#define pb push_back
#define pf printf
#define F first
#define S second
#define srt(v) sort(v.begin(),v.end());
#define srtc(v,cmp) sort(v.begin(),v.end(),cmp);
#define srta(v,n) sort(v,v+n);
const ll LL_INF=0x3f3f3f3f3f3f;
const ll MOD=1073741824;


using namespace std;


int T;
int n,k;
int arr[100005];
ll dp[100005];

ll gen(int i){
    if(i==n-1)return 0;
    ll &ret = dp[i];
    if(~ret)return ret;
    ret =LL_INF;
    fo(j,k){
        if(i+j<n)ret=min(gen(i+j)+abs(arr[i]-arr[i+j]),ret);

    }
    // ret=gen(i+1)+abs(arr[i]-arr[i+1]);
    return ret;
}


int main(){
    // pf("\t\t\t***************************************************************************\n\n");
    // pf("\t\t\t***************************************************************************\n\n");
    // freopen("input.txt","r",stdin);
    // freopen("output.txt","w",stdout);
    memset(dp,-1,sizeof dp);
    s(n);
    s(k);
    f(i,n)s(arr[i]);

    pf("%lld\n",gen(0));

    return 0;
} 

Measured memory_bytes: 6144
#include <bits/stdc++.h>
#define N 100005
#define ll long long
using namespace std;
ifstream in("in.txt");
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    int n;
    cin>>s;
    n=s.length();
    if(n%2==1){
        cout<<"No";
        return 0;
    }
    for(int i=0; i<n; i+=2){
        if(s[i]!='h' || s[i+1]!='i'){
            cout<<"No";
            return 0;
        }
    }
    cout<<"Yes";
    return 0;
}


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

int main(){
	long long N,K;
	cin>>N>>K;
	vector<long> A(N+1);
	for(int i=1;i<=N;i++) {cin>>A[i];}
	vector<long> score(N+1);

	for(int i=1;i<=N-K;i++){
		if(A[i]<A[K+i]){
			cout<<"Yes"<<endl;
		}else{
			cout<<"No"<<endl;
		}
	}

}

Measured memory_bytes: 6436
acgt = ["A", "C", "G", "T"]
s = input()
cnt = 0
cnt_max = 0
for c in list(s):
  if c in acgt:
    cnt += 1
  else:
    if cnt > cnt_max:
      cnt_max = cnt
    cnt = 0
if cnt > cnt_max:
      cnt_max = cnt
print(cnt_max)


Measured memory_bytes: 3060
using System;
public class Hello{
    static long CntDigit(long n){
        long count = 0;
        while(n > 0){
            count += n % 10;
            n /= 10;
        }
        return count;
    }
    public static void Main(){
        
        var N = long.Parse(Console.ReadLine());
        var SN = CntDigit(N);
        
        Console.WriteLine((N % SN == 0) ? "Yes" : "No");
    }
}


Measured memory_bytes: 11092
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

n, u = na()
d = []
for i in range(u):
    d.append(na())

c = []
for i in range(n):
    c.append(na())

for i in range(n):
    for j in range(n):
        c[i][j] -= 1

fs = []
for i in range(u):
    f = [0]*3
    for j in range(n):
        t = j%3
        for k in range(n):
            f[t] += d[c[j][k]][i]
            t += 1
            if t == 3:
                t = 0
    fs.append(f)

ans = 99999999999999999
for i in range(u):
    for j in range(u):
        for k in range(u):
            if i == j or j == k or k == i: continue

            ans = min(ans, fs[i][0] + fs[j][1] + fs[k][2])
print(ans)


Measured memory_bytes: 47068
#include <algorithm>
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <ctime>
#include <map>
#include <set>
#define MEM(x,y) memset ( x , y , sizeof ( x ) )
#define rep(i,a,b) for (int i = a ; i <= b ; ++ i)
#define per(i,a,b) for (int i = a ; i >= b ; -- i)
#define pii pair < int , int >
#define X first
#define Y second
#define rint read<int>
#define int long long
#define pb push_back

using std::set ;
using std::pair ;
using std::max ;
using std::min ;
using std::priority_queue ;
using std::vector ;

template < class T >
    inline T read () {
        T x = 0 , f = 1 ; char ch = getchar () ;
        while ( ch < '0' || ch > '9' ) {
            if ( ch == '-' ) f = - 1 ;
            ch = getchar () ;
        }
        while ( ch >= '0' && ch <= '9' ) {
            x = ( x << 3 ) + ( x << 1 ) + ( ch - 48 ) ;
            ch = getchar () ;
       }
   return f * x ;
}

char s[4] , t[4] ;
int ans ;

signed main (int argc , char * argv[] ) {
    scanf ("%s%s" , s + 1 , t + 1 ) ;
    rep ( i , 1 , 3 ) if ( s[i] == t[i] ) ++ ans ;
    printf ("%lld\n" , ans ) ; return 0 ;
}

Measured memory_bytes: 256
#include <stdio.h> 
int main(void){
 int r,c,i,j;

 static 
 int s[101][101];

 scanf("%d%d",&r,&c);

 for(i=0;i<=r;i++){
  for(j=0;j<c;j++){
   scanf("%d", &s[i][j]);

   printf("%d ", s[i][j]);

   s[i][c] += s[i][j];
   s[r][j] += s[i][j];
  }

   printf("%d\n",s[i][c]);
 }

 return 0;
} 


Measured memory_bytes: 2084
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <cmath>
#include <complex> // complex<double> a(1.2 , 2.3);// real(): 1.2, imag()2.3
using namespace std;

#define MOD 1000000007
#define EPS 1e-10
#define ll long long
#define ld long double
#define FOR(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end())
#define rmvector(a,b) rep(i,a.size())rep(j,b.size())if(a[i]==b[j]){a.erase(a.begin()+i);i--;break;}
#define first_more_idx(ve, num) upper_bound(all(ve), num)-ve.begin() // idx = first_more_idx(ve,num); if(idx = ve.size()) , then not exist
#define first_lessequal_idx(ve, num) lower_bound(all(ve), num)-ve.begin()
#define pq_pair_tB priority_queue <pair<ll,ll>, vector<pair<ll,ll> > , greater<pair<ll,ll> > >
#define pq_pair_ts priority_queue <pair<ll,ll> > // only sort first param
template<typename X> bool exist(vector<X> vec, X item){return find(all(vec), item)!=vec.end();}
ll gcd(ll a, ll b){if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a, ll b){return a/gcd(a,b)*b;}
ll power(ll x, ll n){if(n == 0) return 1;return  (n%2)? x*power(x, n-1)%MOD : power(x*x%MOD, n/2);}
ll dx[]={0, 0, -1, 1};
ll dy[]={1, -1, 0, 0};// up,down,left right


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll N , K;
    cin >> N >> K;
    
    ll ans = 0 ;
    while(N != 0){
        N /= K;
        ans ++;
    }
    
    cout << ans << endl;

    //cout << fixed << setprecision(16) << ans << endl;
    return 0;
}


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

using namespace std;

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

    int dp[n+1][m+1];

    for(int i=0; i<=n; i++) dp[i][0] = 0;
    for(int i=0; i<=m; i++) dp[0][i] = 0;

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

            if(s[i-1] == t[j-1]){
                dp[i][j] = 1 + dp[i-1][j-1];
            }

            else{
                dp[i][j] = max(dp[i-1][j],dp[i][j-1]);
            }
        }
    }

    string res;

    int i = n, j = m;
//
//    for(int i=0; i<=n; i++){
//        for(int j=0; j<=m; j++){
//            cout << dp[i][j] << " ";
//        }
//        cout << endl;
//    }
//
//    cout << endl;

    while(i>0 && j >0){

//        cout << i << " " << j;
        if(s[i-1] == t[j-1]){
//            cout << " same" << endl;
            res.push_back(s[i-1]);
            i -= 1;
            j -= 1;
            continue;
        }

//        cout << endl;

        int xi[3] = {-1,0};
        int yi[3] = {0,-1};

        int inxt, jnxt;
        int val = INT_MIN;

        for(int k=0; k<2; k++){
            if(dp[xi[k]+i][yi[k]+j] > val){
                inxt = i + xi[k];
                jnxt = j + yi[k];
                val = dp[xi[k]+i][yi[k]+j];
            }
        }

        i = inxt;
        j = jnxt;
    }

    reverse(res.begin(),res.end());
    cout << res;

    return 0;
}


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

//定数
const long long MOD1=1000000007;
const long long MOD2=998244353;
const long double PI=3.1415926535897932;
const long long MAXLL=9223372036854775807;
const long long INF=2305843009213693951;
const long long dx[]={0,1,0,-1,1,-1,1,-1};
const long long dy[]={1,0,-1,0,1,1,-1,-1};

//型名省略
#define ll long long
#define ull unsigned long long
#define ld long double
#define uld unsigned long double
#define pll pair<long long,long long>
#define tll(n) array<long long,(int)(n)>
#define pcc pair<char,char>
#define vl vector<long long>
#define vvl vector<vector<long long>>
#define vc vector<char>
#define vvc vector<vector<char>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define vp vector<pair<long long,long long>>
#define vt(n) vector<array<long long,(int)(n)>>
#define umap unordered_map
#define uset unordered_set
#define Lqueue priority_queue<long long>
#define Squeue priority_queue<long long,vector<long long>,greater<long long>>
#define Fi first
#define Se second
#define mp make_pair
#define eb emplace_back

//マクロ
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define rbf(a,x) for(auto& a:x)
#define rep(i,n) for(long long i=0;i<(long long)(n);i++)
#define rep2(i,s,n) for(long long i=(s);i<(long long)(n);i++)
#define bitrep(i,s,n) for(long long i=(s);i<(1LL<<(n));i++)
#define Maxe(x) *max_element((x).begin(),(x).end())
#define Mine(x) *min_element((x).begin(),(x).end())
#define Size(x) ((long long)(x).size())
#define lin(s) getline(cin,(s))
#define Ssort(v) sort((v).begin(),(v).end(),[](auto &left,auto &right){return left.second<right.second;})

//Yes,No
void Yes(bool a){cout<<(a?"Yes":"No")<<endl;}
//YES.NO
void YES(bool a){cout<<(a?"YES":"NO")<<endl;}

//MAX,MIN
template<class T,class U> auto max(T a,U b){return a>b?a:b;}
template<class T,class U> auto min(T a,U b){return a<b?a:b;}

//最大公約数,最小公倍数
long long gcd(long long a,long long b){return b?gcd(b,a%b):a;}
long long lcm(long long a,long long b){return a/gcd(a,b)*b;}

//累乗
template<typename t>
constexpr t mypow(t a,long long b){
    if(b==0)return 1;
    if(a==0)return 0;
    t x=1;
    while(b>0){
        if(b&1LL)x*=a;
        a*=a;
        b>>=1LL;
        }
    return x;
}
#define pow mypow

//chmin,chmax
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;}

//組み合わせ O(r)
template<typename t>
constexpr t nCr(t n,long long r){
    if(r==0)return 1;
    if(n==0)return 0;
    if(n<r)return 0;
    t x=1;
    for(long long i=1;i<=r;i++){
        x*=n-i+1;
        x/=i;
    }
    return x;
}

vl A(0);
ll n,k;

ll solve(ll l,ll r){
    if(r-l<=1)return r;
    ll m=(l+r)/2;
    ll c=0;
    rep(i,Size(A)){
        c+=(A[i]+m-1)/m-1;
    }
    if(c>k){
        return solve(m,r);
    }
    else{
        return solve(l,m);
    }
}

//main関数
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin>>n>>k;
    A.resize(n);
    rep(i,n)cin>>A[i];
    ll L=0;
    ll R=Maxe(A)+1;
    cout<<solve(L,R)<<endl;
}

Measured memory_bytes: 4788
N = gets.to_i
a = N.times.map{gets.split.map &:to_i}
b = N.times.map{gets.split.map &:to_i}
a.sort_by!{|x,y|[-x, -y]}
b.sort_by!{|x,y|[y, x]}
ans = 0
b.each{|bx, by|
  idx = a.index{|ax, ay| bx > ax && by > ay}
  if idx
    a.delete_at(idx)
    ans += 1
  end
}
p ans

Measured memory_bytes: 1788
#include <bits/stdc++.h>
#define repeat(i, n) for(int (i) = 0; i < (n); i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const double EPS = numeric_limits<double>::epsilon();
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 main() {
	int A, B;
	cin >> A >> B;

	int result = -1;

	repeat(i, 2000) {
		int a = (i+1) * 0.08;
		int b = (i+1) * 0.1;
		if (a == A && b == B) {
			result = i + 1;
			break;
		}
	}

	cout << result << endl;
	return 0;
}


Measured memory_bytes: 256