akhauriyash/Code-Regression huggingface dataset:
// AOJ 1280: Slim Span
// 2017.10.22 bal4u@uu

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAX 100
/* UNION-FIND library */
int p[MAX], rank[MAX], pp[MAX];
void link(int x, int y) {
	if (rank[x] > rank[y]) p[y] = x;
	else { p[x] = y; if (rank[x] == rank[y]) rank[y] = rank[y] + 1;	}
}
int find_set(int x) { if (x != p[x]) p[x] = find_set(p[x]);	return p[x]; }
void union_set(int x, int y) { link(find_set(x), find_set(y)); }

#define INF 0x7fffffff
typedef struct { int x, y, w; } EDGE;
EDGE edge[5000], edge2[5000], *end; int m;

char buf[130], *b;
int getInt(void)
{
	int n = 0;
	if (*b == ' ') b++;
	n = 0; while (*b >= '0' ) n = (n<<3) + (n<<1) + (*b++ & 0xf);
	return n;
}

#define VMAX 10000
int f[VMAX+1], vmax, vmin;
void distsort()
{
	int i, x;
	register EDGE *ep;

	memset(f, 0, sizeof(f));
	for (ep = edge; ep < end; ep++) f[ep->w]++;
	for (i = vmin+1; i <= vmax; i++) f[i] += f[i-1];
	for (i = m-1; i >= 0; i--) {
		x = edge[i].w, edge2[--f[x]] = edge[i];
	}
	end = edge2 + (end - edge);
}

int main() 
{
	int n, i, j, k, ans, sz;
	register EDGE *ep;

	for (j = 0; j < 100; j++)  pp[j] = j;
	while (fgets(b=buf, 128, stdin) && *b != '0') {
		n = getInt(), m = getInt();
		sz = sizeof(int)*n;
		for (vmin = VMAX+1, vmin = 0, ep = edge, k = m; k--; ep++) {
			fgets(b=buf, 128, stdin);
			ep->x = getInt()-1, ep->y = getInt()-1, ep->w = i = getInt();
			if (i < vmin) vmin = i;	else if (i > vmax) vmax = i;
		}
		end = ep;

		distsort();

		ans = INF;
		for (i = 0; i < m; i++) {
			memcpy(p, pp, sz), memset(rank, 0, sz);
			for (k = 1, ep = edge2+i; ep < end; ep++) {
				if (find_set(ep->x) != find_set(ep->y)) {
					union_set(ep->x, ep->y);
					if (++k == n) {
						if (ep->w - edge2[i].w < ans) {
							ans = ep->w - edge2[i].w;
							if (ans == 0) goto done;
						}
						break;
					}
				}
			}
		}
		if (ans == INF) puts("-1");
		else {
done:		printf("%d\n", ans);
		}
	}
	return 0; 
}

Measured memory_bytes: 1960
using System;

namespace ITP1_4_C
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                string[] strs = Console.ReadLine().Split(' ');
                int a = int.Parse(strs[0]);
                char op = char.Parse(strs[1]);
                int b = int.Parse(strs[2]);
                if (op == '?') break;
                int c = 0;
                switch (op)
                {
                    case '+':c = a + b; break;
                    case '-':c = a - b; break;
                    case '*':c = a * b; break;
                    case '/':c = a / b; break;
                    default: break;
                }
                Console.WriteLine(c);
            }
        }
    }
}

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

#define TRACE(x) x
#define WATCH(x) TRACE(cout << #x" = " << x << endl)
#define WATCHR(a, b) TRACE(for (auto it=a; it!=b;) cout << *(it++) << " "; cout << endl)
#define WATCHC(V) TRACE({cout << #V" = "; WATCHR(V.begin(), V.end());})

#define all(x) (x).begin(), (x).end()

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vs = vector<string>;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

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

    ll R, D, X;
    cin >> R >> D >> X;

    for (int i = 0; i < 10; i++) {
        X = R * X - D;
        cout << X << "\n";
    }

    return 0;
}



Measured memory_bytes: 256
n=int(input())
ab = []
for i in range(n):
    s=input()
    t = list(s)
    t.sort()
    t = ''.join(t)
    ab.append(t)

ab.sort()
count = 1
memo = []
for i in range(n-1):
    #print(i)
    if ab[i] == ab[i+1]:
        count += 1
    else:
        memo.append(count)
        count = 1
    if i == n-2:
        memo.append(count)
ans = 0
for i in memo:
    ans += i*(i-1)//2
print(ans)

Measured memory_bytes: 63064
#include <stdio.h>
#include <stdlib.h>

int main(){
    int n;
    scanf("%d", &n);
    int *l = malloc(sizeof(int) * n);
    for (int i = 0; i < n;i++){
        scanf("%d", &l[i]);
    }

    int cnt = 0;
    for (int i = 0; i < n - 2;i++){
        for (int j = i + 1; j < n - 1; j++){
            for (int k = j + 1; k < n; k++){
                if((l[i]+l[j]>l[k])&&(l[j]+l[k]>l[i])&&(l[k]+l[i]>l[j])&&(l[i]!=l[j])&&(l[j]!=l[k])&&(l[k]!=l[i])){
                    cnt++;
                }
            }
        }
    }
    printf("%d", cnt);
    return 0;
}

Measured memory_bytes: 1736
#include <iostream>
using namespace std;
int main(){
	int a,b;
	cin >> a >> b;
	if (a < b) {
		cout << "a < b" <<endl;
	} else if (a > b) {
		cout << "a > b" <<endl;
	} else {
		cout << "a == b" <<endl;
	}
    return 0;
}

Measured memory_bytes: 3060
a, b = map(int,input().split())
X = list(map(int, input().split()))
odd = 0
even = 0
for i in X:
    if(i % 2 == 1):
        odd += 1
    else:
        even += 1

if(odd!=0):
    odd-=1
ans = (2**even) * (2**(odd))

if(b==0):
    print(ans)
else:
    print(2**a - ans)


Measured memory_bytes: 3060
#include <cstdio>
#include <cstring>
char s[100005];
int n, k, ans;
int main(){
	scanf("%d%d", &n, &k);
	scanf("%s", s + 1), ans = 1;
	for (register int i = 2; i <= n; ++i)
		if (s[i] != s[i - 1]) ++ans;
	if (k >= ans / 2) return printf("%d\n", n - 1), 0;
	ans -= k * 2;
	printf("%d\n", n - ans);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <string.h>
//#include <queue>
using namespace std;
#define ll long long
#define ld long double

int main()
{
    int r,d,x;
    cin >> r >> d >> x;
    for(int i=0;i<10;i++)
    {
        x=r*x-d;
        cout << x << endl;
    }
    return(0);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
 
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,n) for(int i=1;i<=(n);i++)
#define lol long long
#define SUM(n) ((n)+1)*(n)/2　//1〜nまでの総和を求める式
#define mp make_pair
#define fi first
#define se second
#define pu push_back
#define SYOU(x) setprecision(x+1) //小数点桁数を指定する
#define abs(x,y) (max(x,y)-min(x,y))
#define all(v) v.begin(),v.end()
#define UPDight(a,b) (a+b-1)/b //小数点切り上げ 
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const int MOD=int(1e9)+7; 
using namespace std;
using pii = pair<int,int>;
typedef vector<int> vit;

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

    int n, m;
    cin >> n >> m;
    vit Ball(n + 5, 1);
    bool Red[n + 5] = {false};
    Red[1] = true;
    int x, y;
    rep(i, m){
      cin >> x >> y;
      Ball[x] --;
      Ball[y] ++;
      
      if(Red[x]){
	Red[y] = true;
      }
      
      if(Ball[x] == 0){
	Red[x] = false;
      }
      
    }
    int ans = 0;
    reps(i, n){
      if(Red[i]){
	ans ++;
      }
    }
    cout << ans << '\n';
    return 0;
}


Measured memory_bytes: 768
/*** 𝕒𝕜𝕤𝕙𝕒𝕪𝕜𝕦𝕞𝕒𝕣𝟡𝟡 ***/

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
 
using namespace std;
using namespace __gnu_pbds;
 
template<typename T> using id_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update> ;
 
#define f(i,x,n) for(i=x;i<n;i++)
#define fr(i,x,n) for(i=x;i>=n;i--)
#define pu push_back           
#define pp pop_back
#define F first
#define S second
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define SP(x) fixed<<setprecision(x)
#define IOS() ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
 
const long long MOD=1e9+7;
const long double PI = acos(-1);
const long long INF=INT_MAX;
const long long LINF=LLONG_MAX;
const long long N=1e6+1;
 
typedef long long ll;
typedef long double ld;

void test_case()
{
    ll n,k,i,j,ans=0;
    cin>>n;
    f(i,1,n+1)
    {
        f(j,1,n+1)
        {
            f(k,1,n+1)
            {
                ans+=__gcd(__gcd(i,j),k);
            }
        }
    }
    cout<<ans<<'\n';

}

int main()
{
    IOS();
    
    int tc=1;
    // cin>>tc;
    while(tc--)
        test_case();
    return 0;
}

Measured memory_bytes: 3648
function main (input) {
	var x=input.split(" ");
	for(var i=0;i<x.length;i++)x[i]=parseInt(x[i]);
if(x[2]>=x[0]&&x[2]<=x[0]+x[1])console.log("YES\n");
else console.log("NO\n");
}
 
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

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

int main()
{
  	int x, y;
  	cin>>x>>y;
  	if((x == 1 || x == 3 || x == 5 || x == 7 || x == 8 || x == 10 || x == 12) && (y == 1 || y == 3 || y == 5 || y == 7 || y == 8 || y == 10 || y == 12))
  		cout<<"Yes";
  	else if((x == 4 || x == 6 || x == 9 || x == 11) && (y == 4 || y == 6 || y == 9 || y == 11))
    	cout<<"Yes";
  	else if(x == y == 2)
      	cout<<"Yes";
  	else
      	cout<<"No";
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
int main(void){
   
    int a,b;
    scanf("%d %d",&a,&b);
   
    
    if(a<b)
     printf("a < b\n");

    else if ( a>b)
     printf("a > b\n");
    
    else if ( a==b)
     printf("a == b\n");
    
    else 
     printf("none\n");

    return 0;
    
}



Measured memory_bytes: 2104
from collections import Counter
from collections import deque
from functools import reduce
from pprint import pprint
# import statistics
import bisect
import copy
import fractions
import math
import random
import sys
import time
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def MI(): return map(int, sys.stdin.readline().split())
def II(): return int(sys.stdin.readline())
def IS(): return input()
def C(x): return Counter(x)
def GCD_LIST(numbers):
    return reduce(fractions.gcd, numbers)
def LCM_LIST(numbers):
    return reduce(LCM, numbers)
def LCM(m, n):
    return (m * n // fractions.gcd(m, n))
def unite(x, y):
    # それぞれのノードの根を求める
    x = root(x)
    y = root(y)
    if x == y:
        return
    # node[x]の根をyに変更する
    node[x] = y
def same(x,y): return bool(root(x) == root(y))
def root(x):
    if node[x] == x:  # xが根の場合
        return x
    else:
        node[x] = root(node[x])  # 経路圧縮
        return node[x]
def dfs(v):
    # ノードに訪れた
    visited[v] = True
    for v2 in range(n):
        if graph[v][v2] == False:  # そもそもvとv2が辺でつながっていない
            continue
        if visited[v2] == True:  # もう見た
            continue
        dfs(v2)

n = II()
s = [IS() for _ in range(n)]
cnt = 0
sentou_b = 0
ushiro_a = 0
ab = 0
for i in s:
    cnt += i.count('AB')
    if i[0] == 'B' and i[-1] == 'A':
        ab += 1
    else:
        if i[0] == 'B':
            sentou_b += 1
        if i[-1] == 'A':
            ushiro_a += 1
if ab == 0:
    print(cnt+min(sentou_b, ushiro_a))
elif ab > 0:
    if sentou_b + ushiro_a > 0:
        print(cnt+ab+min(sentou_b, ushiro_a))
    elif sentou_b + ushiro_a == 0:
        print(cnt+ab-1)


Measured memory_bytes: 71508
using System;

public class AOJ2522
{
    static void Main()
    {
        string pass = Console.ReadLine();
        bool hd = false, hu = false, hl = false;
        foreach (char ss in pass)
        {
            if (char.IsDigit(ss)) hd = true;
            else if (char.IsLower(ss)) hl = true;
            else if (char.IsUpper(ss)) hu = true;
        }
        if (hd && hl && hu && pass.Length >= 6) Console.WriteLine("VALID");
        else Console.WriteLine("INVALID");
    }
}

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

int main()
{
  	ll a,b,c,d;
  	cin>>a>>b>>c>>d;
  	ll ans1 = b*d;
  	ll ans2 = b*c;
  	ll ans3 = a*d;
  	ll ans4 = a*c;
  	vector<ll> v{ans1,ans2,ans3,ans4};
  	sort(v.begin(), v.end());
  	cout<<v[3];
  	return 0;
}

Measured memory_bytes: 3604
# coding: utf-8

N, M = map(int, input().split())
k_s = [list(map(int, input().split())) for _ in range(M)]
k = [l[0] for l in k_s]
s = [l[1:] for l in k_s]
p = list(map(int, input().split()))

switch = [[0] * N for _ in range(2 ** N)]
for i in range(2 ** N):
    for j in range(N):
        switch[i][j] = (i & (1 << j)) >> j
counter = 0
for sw in switch:
    ons = 0
    for i in range(M):
        temp = []
        for si in s[i]:
            temp.append(sw[si - 1])
        if sum(temp) % 2 == p[i]:
            ons += 1
    if ons == M:
        counter += 1

print(counter)


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

using namespace std;

int main(){
  string S; //入力文字列
  cin>>S;
  int K=0;
  string flg_str="";
  /*ループ*/
  int j=1;//部分文字列の文字数
  for(int i=0;i<S.size();i++){
    while(S.substr(i,j) == flg_str && ((i+j-1)<S.size())){
     j++; 
    }
    if(S.substr(i,j)!=flg_str){
      flg_str=S.substr(i,j);
      K++;
    }
    
    i=(i+j-1); 
    j=1;
  }
  cout<<K<<endl;
  return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
#define cs const
using namespace std;
typedef long long ll;
cs int N = 2e5 + 50, M = 70;
int n, c[2][M][M];
int main(){
	#ifdef FSYolanda
	freopen("1.in","r",stdin);
	#endif
	scanf("%d", &n); ll ans = 0;
	for(int i = 1; i <= n; i++){
		long double y; scanf("%Lf", &y);
		int a = 0, b = 0, typ = -1;
		for(int j = 0; j <= 10; j++) y *= 10, --a;
		ll x = y + 0.01;
		while(x && (x % 10 == 0)) ++a, x /= 10;
		if(x & 1) typ = 1; else typ = 0;
		while(x && (x % 2 == 0)) x >>= 1, ++b;
		while(x && (x % 5 == 0)) x /= 5, ++b;
		for(int j = -10; j <= 10; j++)
		for(int k = 0; k <= 60; k++)
		if(j + a + min(k, b) >= 0)
		ans += c[typ ^ 1][j + 10][k];
		for(int j = -10; j <= 10; j++)
		for(int k = 0; k <= 60; k++)
		if(j + a >= 0)
		ans += c[typ][j + 10][k];
		++c[typ][a + 10][b];
//		cout << ans << " " << a << " " << b << " " << typ << endl;
	} cout << ans; return 0;
}

Measured memory_bytes: 3844
S = input()

allSUM = 0
# print(len(S))

def dfs(i,strNum):
    # print("i: {} s: {}".format(i,strNum))


    if i == len(S)-1:
        tmp = strNum.split("+")

        for j in range(len(tmp)):
            tmp[j] = int(tmp[j])

        global allSUM
        allSUM += sum(tmp)

        return False

    if i+1 > len(S)-1:
        return False

    if(dfs(i+1,strNum+S[i+1])):
        return True

    if(dfs(i+1,strNum+"+"+S[i+1])):
        return True

    return False


dfs(0,S[0])

print(allSUM)


Measured memory_bytes: 3064
#include <iostream>

typedef long long ll;
using namespace std;

ll dp[1001][1001];

ll solve(ll n, ll k, ll m) {
  for(int i=1;i<=n;++i) {
    for(int j=1;j<=i;++j) {
      if (i==1 || j==1) {
        dp[i][j] = 1;
      } else {
        dp[i][j] = (dp[i-1][j-1] + (j*dp[i-1][j] % m)) % m;
      }
    }
  }
  return dp[n][k];
}

int main() {
  ll n,k,mod=1e9+7;
  cin>>n>>k;
  cout<<solve(n,k,mod)<<endl;
  return 0;
}


Measured memory_bytes: 9992
/*
  AUTHOR:SOURABH
  CREATED:26:01:20
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define ordered_set tree<ll , null_type, less< ll >, rb_tree_tag, tree_order_statistics_node_update>
#define ll long long int
#define ld long double
#define fi first
#define se second
#define pb push_back
#define pob pop_back
#define W while
#define fn(i,x) for(i=0;i<x;i++)
#define fs(i,s,x) for(i=s;i<x;i++)
#define fr(i,x) for(i=x;i>=0;i--)
#define fit(it,s) for(it=s.begin();it!=s.end();it++)
#define mp make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vii vector<int>
#define vll vector<ll>
#define mii map<int,int>
#define mll map<ll,ll>
#define mod 1000000007
#define MAX 100005
#define M 32

using namespace std;
using namespace __gnu_pbds;

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

    //freopen("in.txt","r",stdin);
    //freopen(2 "out.txt","w",stdout);

    ll n,m,q;
    cin>>n>>m;
    q=n/m;
    if(n%m)
        q++;
    cout<<q;
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>  
#include <algorithm>  
#include <assert.h>
#include <bitset>
#include <cmath>  
#include <complex>  
#include <deque>  
#include <functional>  
#include <iostream>  
#include <limits.h>  
#include <map>  
#include <math.h>  
#include <queue>  
#include <set>  
#include <stdlib.h>  
#include <string.h>  
#include <string>  
#include <time.h>  
#include <unordered_map>  
#include <unordered_set>  
#include <vector>  

#pragma warning(disable:4996)  
#pragma comment(linker, "/STACK:336777216")  
using namespace std;

#define mp make_pair  
#define Fi first  
#define Se second  
#define pb(x) push_back(x)  
#define szz(x) ((int)(x).size())  
#define rep(i, n) for(int i=0;i<n;i++)  
#define all(x) (x).begin(), (x).end()  
#define ldb ldouble  

typedef tuple<int, int, int> t3;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <ll, int> pli;
typedef pair <db, db> pdd;

int IT_MAX = 1 << 19;
const ll MOD = 1000000007;
const int INF = 0x3f3f3f3f;
const ll LL_INF = 0x3f3f3f3f3f3f3f3f;
const db PI = acos(-1);
const db ERR = 1e-10;

bool chk[705][705];

int r[705][2];
int root(int x) {
	if (x == r[x][0]) return x;

	int t = r[x][0];
	r[x][0] = root(t);
	r[x][1] ^= r[t][1];
	return r[x][0];
}

int cnt[1050][2];
bool dp[705];
bool tdp[705];

int main() {
	int N, M, i, j;
	scanf("%d %d", &N, &M);
	for (i = 1; i <= M; i++) {
		int t1, t2;
		scanf("%d %d", &t1, &t2);
		chk[t1][t2] = chk[t2][t1] = true;
	}

	for (i = 1; i <= N; i++) r[i][0] = i, r[i][1] = 0;
	for (i = 1; i <= N; i++) {
		for (j = i + 1; j <= N; j++) {
			if (chk[i][j]) continue;
			int t1 = root(i), t2 = root(j);
			int x = r[i][1] ^ r[j][1] ^ 1;
			if (t1 == t2) {
				if (x == 1) return !printf("-1\n");
				continue;
			}
			r[t1][0] = t2;
			r[t1][1] = x;
		}
	}
	
	dp[0] = true;
	for (i = 1; i <= N; i++) {
		int x = root(i);
		cnt[x][r[i][1]]++;
	}
	for (i = 1; i <= N; i++) {
		for (j = 0; j <= N; j++) tdp[j] = false;
		for (j = 0; j <= N; j++) {
			if (!dp[j]) continue;
			tdp[j + cnt[i][0]] = true;
			tdp[j + cnt[i][1]] = true;
		}
		for (j = 0; j <= N; j++) dp[j] = tdp[j];
	}

	int mn = INF;
	for (i = 1; i < N; i++) if (dp[i]) mn = min(mn, i*(i - 1) / 2 + (N - i)*(N - i - 1) / 2);
	return !printf("%d\n", mn);
}

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

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
#include <string>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cmath>
#include <climits>
#include <bitset>
#include <array>
#include <deque>
#include <queue>
#include <map>
#define all(x) (x).begin(),(x).end()

void solve(){

}
int main(){
    int N,M;
    cin >> N >> M;
    vector<int> a(M),b(M),cnt(N);
    for (int i = 0; i < M; i++){
        cin >> a[i] >> b[i];
        cnt[--a[i]]++;
        cnt[--b[i]]++;
    }

    for (int i = 0; i < N; i++){
        cout << cnt[i] << endl;
    }



    return 0;
}


Measured memory_bytes: 256
while True:
    N = int(input())
    if N == 0:
        break
    W, H = map(int, input().split())
    field = [[0 for _ in range(W)] for _ in range(H)]
    for _ in range(N):
        x, y = map(int, input().split())
        field[y - 1][x - 1] = 1
    S, T = map(int, input().split())
    c_list = []
    for tate in range(H - T + 1):
        for yoko in range(W - S + 1):
            c = 0
            for i in range(tate, T + tate):
                for j in range(yoko, S + yoko):
                    if field[i][j] == 1:
                        # print(i + 1, j + 1)
                        c += 1
            c_list.append(c)

    # print(*field, sep="\n")
    print(max(c_list))



Measured memory_bytes: 5792
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i = 0; i < (N); i++)
#define repo(i,N) for(int i = 1; i < (N); i++)
//#define int long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
//#define num 1000000007
#define pi acos(-1.0)
//cout << fixed << setprecision (10);   小数点以下１０桁まで
//intの最大値2147483647 ≒ 2×10^9
//long longの最大値9223372036854775807 ≒ 9×10^18
//'大文字'+=32;    で小文字に
//string s = to_string(int数);
//int n = stoi(string文字列);

int main() {
  int a,b,c;
  cin >>a>>b>>c;
  
  cout << c <<" "<<a<<" "<<b << endl;
  
}


Measured memory_bytes: 256
// A C++ program to check if two given line segments intersect 
#include <iostream> 
using namespace std; 

struct Point { 
  int x; 
  int y; 
}; 


bool onSegment(Point p, Point q, Point r) { 
  if (q.x <= max(p.x, r.x) && q.x >= min(p.x, r.x) && q.y <= max(p.y, r.y) && q.y >= min(p.y, r.y)) {
    return true; 
  }
  return false;
} 

int orientation(Point p, Point q, Point r) { 
  int val = (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y); 

  if (val == 0) return 0; // colinear 

  return (val > 0)? 1: 2; // clock or counterclock wise 
} 

bool doIntersect(Point p1, Point q1, Point p2, Point q2) { 
  // Find the four orientations needed for general and 
  // special cases 
  int o1 = orientation(p1, q1, p2); 
  int o2 = orientation(p1, q1, q2); 
  int o3 = orientation(p2, q2, p1); 
  int o4 = orientation(p2, q2, q1); 

  // General case 
  if (o1 != o2 && o3 != o4) return true; 

  // Special Cases 
  // p1, q1 and p2 are colinear and p2 lies on segment p1q1 
  if (o1 == 0 && onSegment(p1, p2, q1)) return true; 

  // p1, q1 and q2 are colinear and q2 lies on segment p1q1 
  if (o2 == 0 && onSegment(p1, q2, q1)) return true; 

  // p2, q2 and p1 are colinear and p1 lies on segment p2q2 
  if (o3 == 0 && onSegment(p2, p1, q2)) return true; 

  // p2, q2 and q1 are colinear and q1 lies on segment p2q2 
  if (o4 == 0 && onSegment(p2, q1, q2)) return true; 

  return false; // Doesn't fall in any of the above cases 
} 

// Driver program to test above functions 
int main() { 
  Point p1, q1, p2, q2;
  int tt;
  cin >> tt;
  while (tt--) {
    cin >> p1.x >> p1.y >> q1.x >> q1.y >> p2.x >> p2.y >> q2.x >> q2.y;
    doIntersect(p1, q1, p2, q2) ? cout << "1\n": cout << "0\n"; 
  }
  return 0; 
} 



Measured memory_bytes: 3088
N = int(input())
*A, = map(int, input().split())

dp = [[0, 0] for i in range(N+1)]
dp[0][1] = -10**18
for i in range(N):
    dp[i+1][0] = max(dp[i][0] + A[i], dp[i][1] - A[i])
    dp[i+1][1] = max(dp[i][0] - A[i], dp[i][1] + A[i])
print(dp[-1][0])

Measured memory_bytes: 76192
//{{{
#include <bits/stdc++.h>
using ll = long long;
#ifdef LOCAL
#define debug(...) {__VA_ARGS__}
#else
#define debug(...) 
#endif
using namespace std;
//}}}

constexpr int nax = 1e4;

int n, tab[nax];

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

    cin >> n;

    for (int i = 0; i < n; ++i)
        cin >> tab[i];
    for (int i = 0; i < n; ++i)
    {
        int v; cin >> v;
        tab[i] -= v;
    }
    ll sum = 0;
    for (int i = 0; i < n; ++i)
        sum += tab[i];

    ll op1 = -sum;
    ll op2 = -sum;

    debug(cerr << sum << '\n';);

    for (int i = 0; i < n; ++i)
    {
        if (tab[i] < 0)
        {
            op1 -= abs((tab[i] - 1) / 2);
            op2 -= (tab[i] & 1);
        }
        if (tab[i] > 0)
            op2 -= tab[i];
        debug(cerr << op1 << ' ' << op2 << '\n';);
    }
    if (op1 < 0 or op2 < 0 or op1 * 2 != op2)
        cout << "No" << '\n';
    else
        cout << "Yes" << '\n';
}

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

int main(){
    int n;
    cin >> n;
    set<int> one;
    vector<long long> two;
    for(int i = 0;i < n;i++){
        int a;
        cin >> a;
        set<int>::iterator it = one.find(a);
        if(it == one.end()){
            one.insert(a);
        } else {
            one.erase(it);
            two.push_back(a);
        }
    }
    if(two.size() < 2) cout << 0 << endl;
    else{
        sort(two.begin(),two.end());
        cout << two[two.size()-1]*two[two.size()-2] << endl;
    }
    return 0;
}


Measured memory_bytes: 4992
n = int(input())
a = list(map(int, input().split()))
count = 0
color = set()
for i in range(n):
    if a[i]<400:
        color.add("a")
    elif a[i]<800:
        color.add("b")
    elif a[i]<1200:
        color.add("c")
    elif a[i]<1600:
        color.add("d")
    elif a[i]<2000:
        color.add("e")
    elif a[i]<2400:
        color.add("f")
    elif a[i]<2800:
        color.add("g")
    elif a[i]<3200:
        color.add("h")
    else:
        count += 1
if len(color) == 0:
    print(1, count)
else:
    print(len(color), len(color)+count)

Measured memory_bytes: 38256
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define rep(i, n) for(int i=0;i<n;++i)
#define rrep(i, n) for(int i=n;i>=0;--i)
const int inf=1e9+7;
const ll mod=1e9+7;
const ll big=1e18;
const double PI=2*asin(1);

int main() {
  int M, D;
  cin>>M>>D;
  int ans = 0;
  for(int i=1;i<=M;++i) {
    for(int j=20;j<=D;++j) {
      if(j%10<2) continue;
      if(i==(j%10)*(j/10)) {
        ans++;
      }
    }
  }
  cout<<ans<<endl;
}



Measured memory_bytes: 3652
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

int main() {
  int n;
  scanf("%d", &n);
  std::vector<double> v;
  for (int i = 0; i < n; ++i) {
    char c[10];
    double d;
    scanf("%lf %s", &d, c);
    if (c[0] == 'J') {
      v.push_back(d);
    } else {
      v.push_back(d * 380000);
    }
  }
  double total = 0;
  for (int i = 0; i < n; ++i) {
    total += v[i];
  }
  printf("%lf\n", total);

  return 0;
}


Measured memory_bytes: 256
N = gets.chomp.to_i
A = Array.new(2).map{Array.new(N)}
2.times do |n|
    A[n] = gets.chomp.split.map(&:to_i)
end
dir = [[1,0],[0,1]]
node = []
node.push({:pos => [0,0], :score => 0, :log => Array.new(2).map{Array.new(N)}})
ans = []
while !node.empty?
    cur = node.shift

    cur[:score] += A[cur[:pos][0]][cur[:pos][1]]
    if cur[:pos][0] == 1 && cur[:pos][1] == N-1
        ans.push(cur[:score])
        next
    end

    dir.each do |d|
        childY = cur[:pos][0]+d[0]
        childX = cur[:pos][1]+d[1]
        if childY.between?(0,1) && childX.between?(0,N-1)
            if !cur[:log][childY][childX]
                cur[:log][childY][childX] = 0
                node.push({:pos => [childY, childX], :score => cur[:score], :log => Marshal.load(Marshal.dump(cur[:log]))})
            end
        end
    end
end
print "#{ans.max}\n"

Measured memory_bytes: 5884
import math
n = int(input())

cards = [0] * n

for i in range(n):
  cards[i] = int(input())

ans = 0


for i in range(n):
  ans += math.floor(cards[i] / 2)
  cards[i] = cards[i] % 2
  if cards[i] == 1 and not(i == (n - 1)) and not(cards[i + 1] == 0):
    ans += 1
    cards[i + 1] = cards[i + 1] - 1

print(ans)


Measured memory_bytes: 12776
#include<iostream>

using namespace std;

int main(){
    int N,i,sum=0;
    cin>>N;
        if(N%10!=0){
            i=N;
            while(i>0){
                sum+=i%10;
                i/=10;
            }
        cout<<sum;
        }else{
            cout<<"10";
        }

}

Measured memory_bytes: 3124
#include<iostream>
#include<sstream>
#include<vector>
#include<algorithm>
#include<string>
#include<stdexcept>
#include<stdio.h>
#include<queue>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;

 int main(){ 
   int a,b; cin >> a >> b;
   if(a==1) a=14;
   if(b==1) b=14;
   
   if(a>b) cout << "Alice"<<endl;
   else if(a<b) cout <<"Bob"<<endl;
   else if(a==b) cout <<"Draw"<<endl;
 }
   

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

bool chmin(int& a, int b){
    if (a > b) a = b; return true;
    return false;
}

int main(){
    int N, M;
    vector<int> T, P, X;
    cin >> N;
    for (int i=0; i<N; i++){
        int t;
        cin >> t;
        T.push_back(t);
    }
    int total = accumulate(T.begin(), T.end(), 0);
    cin >> M;
    for (int i=0; i<M; i++){
        int p, x;
        cin >> p >> x;
        cout << total - T[p-1] + x << endl;;
    }
    return 0;
}

Measured memory_bytes: 3664
#include<bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  while (a) {
    b %= a;
    swap(a, b);
  }
  return b;
}
int main () {
  int N;
  cin >> N;
  vector<int>A(N);
  int g = 0;
  for (int i = 0; i < N; i ++) {
    cin >> A[i];
    g = gcd(g, A[i]);
  }
  if (g != 1) {
    cout << "not coprime" << endl;
    return 0;
  }
  vector<bool>sosuu(1000008, false);
  sosuu[0] = sosuu[1] = true;
  vector<bool>exa(1000008, false);
  for (int i = 0; i < N; i ++) {
    if (A[i] != 1 && exa[A[i]]) {
      cout << "setwise coprime" << endl;
      return 0;
    }
    exa[A[i]] = true;
  }
  for (int i = 0; i < 1000008; i ++) {
    if (!sosuu[i]) {
      sosuu[i] = true;
      int kj = 0;
      for (int j = 1; j * i < 1000008; j ++) {
        sosuu[i * j] = true;
        if (exa[i * j]) kj ++;
      }
      if (kj > 1) {
        cout << "setwise coprime" << endl;
        return 0;
      }
    }
  }
  cout << "pairwise coprime" << endl;
}

Measured memory_bytes: 7428
#include<iostream>
#include<string>
#include<vector>
using namespace std;
int main() {
	vector<string>l;
	string s;
	int m;
	while (cin >> s) {
		if (s == "-")break;
		cin >> m;
		for (int i = 0; i < m; i++) {
			int a;
			cin >> a;
			string st;
			for (int i = 0; i < a; i++) {
				st += s[0];
				s.erase(s.begin() + 0);
			}
			s += st;
		}
		l.push_back(s);
	}
	for (string i : l)cout << i << endl;
	cin >> s;
}

Measured memory_bytes: 3092
n = gets.to_i 
a = gets.chomp.split.map(&:to_i)
b = Array.new()
(a.length).times do |i|
  if n % 2 == 0
    if i % 2 == 0
      b.push a[i]
    else
      b.unshift a[i]
    end
  else
    if i % 2 == 1
      b.push a[i]
    else
      b.unshift a[i]
    end
  end
end
 
puts b.join(" ")

Measured memory_bytes: 27612
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define f(i,n) for(int i=0;i<n;i++)
#define f1(i,n) for(int i=1;i<n;i++)
#define rf(i,n) for(int i=n-1;i>=0;i--)
#define PI 3.1415926535897932384626433832795
#define fi first
#define se second
#define mp(x,y) make_pair
#define BIN(n,x) bitset<n>(x)  
using namespace std;

//BITSET
//bitset< ##no of digits required in binary## > x( ##integral string value## )   // bitset< ##no of digits required in binary## > x( ##number## ) 
//stores binary value of the string in x // constructor sets all values to 0 by default // x.set() sets all value to 1 //x.none() checks for 0{gives bool}
//-->x.count() gives no of 1's //--> x.size() gives total bits //--> x.test(i) returns binary value of i'th bit

//SETPRECISION
//cout<<fixed<<setprecision(#n#)<<x;  --> sets the no of digits of x after decimal to n

//SET STL
//insert();*** count() returns 1 if element is present or 0  **** ;find() {returns iterator pointing to element else returns end iterator}; ---> O(log(N))
//begin();end(){next to last};---->O(1)
//See sorting

//VECTOR STL
//begin(); back();-->O(1)
//sort(v.begin(),v.end()); -->{O(Nlog(N))}
//set_union(it1beg,it1end,it2beg,it2end,itcombinedbegin)   {joins two vectors}
//lower_bound(v.begin(),v.end(),val) returns iterator to element just greater than or eq to val--->O(N)
//sort(v.begin(),v.end()) is sorted default by first value of pairs  to sort by second

//MAP STL map<U,V> mp; U=key val  V = mapped val
//count(k) (returns 1 if element with key value k is found}-->O(log(N))
//See sorting


//Binary Exponentiation
long long BERem(long long a, long long b, long long m){
    a%=m;
    long long res =1;
    while(b>0){
        if(b&1){
            res = (res * a)%m;
        }
        a=(a*a)%m;
        b>>=1;
    }
    return res;
}


int main(){
    
    int n,x,y;
    cin>>n>>x>>y;
    
    int ans[n]={0};
    int dist=0;
    f1(i,n){
        for(int j=i+1;j<=n;j++){
            dist=min((j-i),(abs(x-i)+1+abs(y-j)));
            ans[dist]++;
        }
    }
    f1(i,n){
        cout<<ans[i]<<" ";
    }

    return 0;
}



Measured memory_bytes: 256
n=int(input())
s=[int(input()) for i in range(n)]
if sum(s)%10!=0:
  print(sum(s))
else:
  l=[]
  for j in range(n):
    if s[j]%10!=0:
      l.append(s[j])
  if len(l)==0:
    print(0)
  else:
    print(sum(s)-min(l))

Measured memory_bytes: 3316
#include<iostream>
#include<cmath>
#include<vector>
#include<algorithm>
#include<string.h>
#include<iomanip>
#include<set>
using namespace std;
 
#define PI 3.14159265358979323846264338327950L

int main() {
	int N;
	set<string> s;

	cin >> N;
	for (int ii = 0; ii < N; ii++) {
		string tmp;
		cin >> tmp;
		s.insert(tmp);
	}
	cout << s.size() << endl;
}

Measured memory_bytes: 19236
/*
	?§£??¬??????
*/

#include <iostream>
using namespace std;
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <algorithm>
#include <functional> //sort(A,A.end(),greater<int>());???????????????
#include <queue>
#include <stack>
#include <vector>

#define INF 10 << 10

/*long oi[1000000];

int main() {
	long n, m;
	string s;
	cin >> n >> m >> s;

	int k;
	for (int i = 0; i <= s.size() - (n * 2 + 1); ++i) {
		if (s[i] == 'I') {
			char cp[3];
			s.copy(cp, 2, i + 1);	//???cp?????????????????????,???????????????????????°,????????????????????????
			char* x = strstr(cp, "OI");
			bool flg = false;
			if (x != NULL) { flg = true; }
			while (i < s.size() && x != NULL) {
				++oi[k];
				i += 2;
				s.copy(cp, 2, i + 1);
				x = strstr(cp, "OI");
			}
			if (flg) { ++k; }
		}
	}
	//for(int i = 0;)
	return 0;
}*/

int ss[1000000];

int main() {
	int n, m;
	string s;
	while (cin >> n && n != 0) {
		cin >> m >> s;

		//?????????S???(I=1),(O=0)???????????????
		for (int i = 0; i < s.size(); ++i) {
			if (s[i] == 'I') { ss[i] = 1; }
			else { ss[i] = 0; }
		}

		int cnt = 0;
		for (int i = 0; i < m - (n * 2 + 1); ++i) {
			if (ss[i] == 1) {
				int temp = i;
				int k = i + 1;
				bool flg = true;
				while (k - temp < (n * 2 + 1)) {
					if (ss[k] != 0) {
						flg = false;
						break;
					}
					else if (ss[++k] != 1) {
						flg = false;
						break;
					}
					++k;
				}
				if (flg) { ++cnt; }
			}
		}

		cout << cnt << endl;
	}

	return 0;
}

Measured memory_bytes: 7888
#include <iostream>
using namespace std;
int main () {
    int dem = 0;
    string s;
    cin >> s;
    for (int i = 0; i < s.size(); i++)  {
        if (s[i] == 'o')    {
            dem++;
        }
    }
    cout << 700 + (dem * 100);
    return 0;
}

Measured memory_bytes: 256
// J'aime
// Chemise Blanche

#include <bits/stdc++.h>
using namespace std;

#define int long long

#define ii pair<int,int>
#define fi first
#define sc second

#define all(x) (x).begin(),(x).end()
#define dbg(x) cerr << __LINE__ << " > " << #x << " = " << (x) << endl

void MAIN() {
  char a, b;
  cin >> a >> b;
  if (a == b) cout << "=" << '\n';
  else cout << (a < b ? "<" : ">") << '\n';
}

signed main() {
#ifdef _DEBUG
  // freopen("in" , "r", stdin );
  // freopen("out", "w", stdout);
#endif
  ios::sync_with_stdio(0); cin.tie(0);
  int T = 1;
  // cin >> T;
  while (T--) MAIN();
}


Measured memory_bytes: 3596
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int D = Integer.parseInt(sc.next());
		int X = Integer.parseInt(sc.next());
		ArrayList<Integer> list = new ArrayList<>();
		for(int i = 0; i < N; i++) {
			list.add(Integer.parseInt(sc.next()));
		}
		sc.close();

		int count = X;
		for(int i = 0; i < list.size(); i++) {
			int cookie = 0;
			if(D % list.get(i) != 0) {
				cookie = D / list.get(i) + 1;
			}else {
				cookie = D / list.get(i);
			}
			count += cookie;
		}
		System.out.println(count);

	}

}

Measured memory_bytes: 21844
import java.util.Scanner;

/**
 * ToggleCases
 */
public class Main{

    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            String line = sc.nextLine();
            String answer = "";
            int length = line.length();

            for (int i = 0; i < length; i++) {
                char ch = line.charAt(i);
                if (Character.isLowerCase(ch)) {
                    ch = Character.toUpperCase(ch);
                } else if (Character.isUpperCase(ch)) {
                    ch = Character.toLowerCase(ch);
                }

                answer += ch;
            }

            System.out.println(answer);
        }
    }
}


Measured memory_bytes: 31464
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#include <bits/stdc++.h>
using namespace std;
template<class t> inline t read(t &x){
	char c=getchar();bool f=0;x=0;
	while(!isdigit(c)) f|=c=='-',c=getchar();
	while(isdigit(c)) x=(x<<1)+(x<<3)+(c^48),c=getchar();
	if(f) x=-x;return x;
}
template<class t,class ...A> inline void read(t &x,A &...a){
	read(x);read(a...);
}
template<class t> inline void write(t x){
	if(x<0) putchar('-'),write(-x);
	else{if(x>9) write(x/10);putchar('0'+x%10);}
}

const int N=105;
bool ans[N];
int n,sp;
vector<int> pos[2],tp;

bool que(vector<int> &a){
	cout<<"?";
	for(int x:a) cout<<' '<<x;cout<<endl;
	string res;
	cin>>res;
	return res=="Red";
}

signed main(){
	read(n);
	for(int i=1;i<=n;i++) tp.push_back(i);
	int l=1,r=n+1,ltype=que(tp);
	while(l<=r){
		int mid=l+r>>1;
		tp.clear();
		for(int i=mid;i<=mid+n-1;i++) tp.push_back(i);
		if(que(tp)!=ltype) sp=mid,r=mid-1;
		else l=mid+1;
	}
	sp--;
	tp.clear();
	for(int i=sp+1;i<=sp+n-1;i++) tp.push_back(i);
	for(int i=1;i<=n<<1;i++) if(i<=sp||i>sp+n-1){
		tp.push_back(i);
		ans[i]=que(tp);
		pos[ans[i]].push_back(i);
		tp.pop_back();
	}
	tp.clear();
	for(int i=0;i<n>>1;i++) tp.push_back(pos[0][i]),tp.push_back(pos[1][i]);
	for(int i=sp+1;i<=sp+n-1;i++){
		tp.push_back(i);
		ans[i]=que(tp);
		tp.pop_back();
	}
	cout<<"! ";for(int i=1;i<=n<<1;i++) putchar(ans[i]?'R':'B');
}

Measured memory_bytes: 3828
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int X = Integer.parseInt(sc.next());
		int N = Integer.parseInt(sc.next());
		ArrayList<Integer> list = new ArrayList<>();
		ArrayList<Integer> checkList = new ArrayList<>();
		for(int i = 0; i < 100; i++) {
			checkList.add(i + 1);
		}
		for(int i = 0; i < N; i++) {
			list.add(Integer.parseInt(sc.next()));
		}
		sc.close();
		Collections.sort(list);

		if((!list.contains(X))) {
			System.out.println(X);
			return;
		}

		boolean check = false;
		int index = 1;
		int ans = X;

		while(!check) {
			int tmp1 = X - index;
			if(!(list.contains(tmp1))) {
				ans = tmp1;
				break;
			}
			int tmp2 = X + index;
			if(!(list.contains(tmp2))) {
				ans = tmp2;
				break;
			}
			index++;
		}
		System.out.println(ans);
		return;

	}

}

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

#define FAST_IO                       \
	ios_base::sync_with_stdio(false); \
	cin.tie(0);                       \
	cout.tie(0);

using namespace std;

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

const int MOD = 1e9 + 7;

int main()
{

	FAST_IO;

	ll a, b, n;
	cin >> n >> a >> b;
	ll k = n / (a + b);
	ll ans = k * a;
	n %= (a + b);
	ans += min(n, a);
	cout << ans;
	return 0;
}


Measured memory_bytes: 256
import sys
import math

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    a, b, x = map(int, readline().split())
    V = a * a * b / 2
    if V < x:
        ans = math.degrees(math.atan((2 * (a * a * b - x)) / a ** 3))
    else:
        ans = math.degrees(math.atan((a * b * b) / (2 * x)))
    print(ans)


if __name__ == '__main__':
    main()


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

int main(){
  int n,i,countb=0,countr=0;
  cin >> n;
  char a[n];
  for(i=0;i<n;i++){
    cin >> a[i];
    if(a[i] == 'B'){countb++;}else{countr++;}
  }
  if(countr > countb){cout << "Yes";}else{cout << "No";}
  return 0;
}


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

int main()
{
    int s, h, m;
    cin >> s;
    h = s / (60 * 60);
    m = (s - h * 60 * 60) / 60;

    cout << h << ":" << m << ":" << s - (h * 60 * 60 + m * 60) << endl;
}


Measured memory_bytes: 3104
from collections import defaultdict
import collections

N = int(input())
List = list(map(int, input().split()))
# print(List)

# for i in range(N-1):
#   print(List.count(i+1))
# print(0)

c = collections.Counter(List)
# print(c)
for i in range(1,N+1):
  # print(i)
  print(c[i])
  # print()

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


struct edge{int to,cost;};
typedef pair<int,int>P;

const int INF=1e9;
int N,M,r;
vector<edge>G[100000];
int dist[100000];

int main(){
    cin>>N>>M>>r;
    for(int i=0;i<M;i++){
        int s,t,d;cin>>s>>t>>d;
        G[s].push_back((edge){t,d});
    }


    priority_queue<P,vector<P>,greater<P> >Q;

    fill_n(dist,N,INF);
    Q.push(P(0,r));
    dist[r]=0;

    while(!Q.empty()){
        P p=Q.top();Q.pop();

        if(dist[p.second]<p.first)continue;
        for(int i=0;i<G[p.second].size();i++){
            edge &e=G[p.second][i];
            if(dist[e.to]<=dist[p.second]+e.cost)continue;
            dist[e.to]=dist[p.second]+e.cost;
            Q.push(P(dist[e.to],e.to));
        }
    }

    for(int i=0;i<N;i++){
        if(dist[i]==INF)cout<<"INF"<<endl;
        else cout<<dist[i]<<endl;
    }
    return 0;
}

Measured memory_bytes: 11304
#include <iostream>
#include <vector>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
int main(){
  //kまでしか見れない
  int n,k;
  cin >> n >> k;
  vector<int> dp(n);
  vector<int> heights(n);
  rep(i,n){
    cin >> heights[i];
  }
  rep(i,n)dp[i]=1e9;
  dp[0] = 0;
  rep(i,n){
    for(int j = 1;j<=k;j++){
      if(j>i)break;
      dp[i] = min(dp[i],dp[i-j]+abs(heights[i]-heights[i-j]));
    }
  }
  cout << dp[n-1];
  return 0;
}

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

using namespace std;

#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define pf 				push_front
#define mp              make_pair
#define pii             pair<int,int>
#define MAX 			1000000
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define FIO             ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());
void c_p_c()
{
#ifndef  ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}
const int Max = 1e7;
int32_t main()
{
	//c_p_c();
	int a, b, c;
	cin >> a >> b >> c;
	if ( (c - (a - b)) > 0)
		cout << c - a + b;
	else
		cout << "0";
}

Measured memory_bytes: 3672
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		int number1 = input.nextInt();
		int number2 = input.nextInt();
		if (number1 < 10 && number2 < 10) {
			System.out.println(number1 * number2);
		}else {
			System.out.println("-1");
		}
    }
}


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

template <typename T>
void print(const T &v);

int main()
{
    int k;
    vector<int> num(3);
    cin >> num[0] >> num[1] >> num[2] >> k;
    int i = 0;
    while (num[0] >= num[1])
    {
        num[1] *= 2;
        i++;
    }
    while (num[1] >= num[2])
    {
        num[2] *= 2;
        i++;
    }
    if (i <= k)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
    return 0;
}

// Use For Debug
template <typename T>
void print(T const &v)
{
    for (int i = 0; i < v.size(); i++)
    {
        if (i)
            cout << ' ';
        cout << v[i];
    }
    cout << endl;
}

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

int main(){
	int n, m;
	cin >> n >> m;
	rep(i,m){
		int a;cin >> a;
		n -= a;
	}
	if(n<0) cout << -1 << endl;
	else    cout << n  << endl;
	return 0;	
}


	







Measured memory_bytes: 3552
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long a = Long.parseLong(sc.next());
        long b = Long.parseLong(sc.next());
        System.out.println((a * b) / getGcd(a, b));
    }

    private static long getGcd(long x, long y) {
        return y == 0 ? x : getGcd(y, x % y);
    }
}

Measured memory_bytes: 23636
io = STDIN
ar=[]
ar << io.gets.split.map(&:to_i)
ar << io.gets.split.map(&:to_i)
ar << io.gets.split.map(&:to_i)
n=io.gets.to_i
hit = []
n.times do
  hit << io.gets.to_i
end
ar1=ar.flatten
ar1.map! do |a|
  hit.include?(a) ?  1 : 0
end
def check1(ar)
  ar.each do |a|
    return true if a.inject(:+)==3
  end
  false
end
def check2(ar)
  ar[0][0] == 1 &&
  ar[1][1] == 1 &&
  ar[2][2] == 1  ||
  ar[0][2] == 1 &&
  ar[1][1] == 1 &&
  ar[2][0] == 1
end

ar2=[]
ar2 << ar1[0,3]
ar2 << ar1[3,3]
ar2 << ar1[6,3]
ar3=ar2.transpose
puts (check1(ar2) || check1(ar3) || check2(ar2)) ? 'Yes' : 'No'


Measured memory_bytes: 1788
using System;
using System.Collections.Generic;
using System.Linq;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            int X = int.Parse(Console.ReadLine());
            var ans = (X == 3 || X == 5 || X == 7) ? "YES" : "NO";
            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 13140
import java.util.*;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
	int n = sc.nextInt();
    int m = sc.nextInt();
    //char[] a = sc.nextLine().toCharArray();
    if(n == m){
      System.out.println("Yes");
    }
    else
    {
      System.out.println("No");
    }
  }
}

Measured memory_bytes: 21076
#include <iostream>
#include <cmath>
const int MAXN = 200000;
int cards[MAXN];

using namespace std;

int main() {
	int N;
	cin >> N;
	
	long long int left = 0, right = 0;
	for (int i = 0; i < N; ++i) {
		cin >> cards[i];
		left += cards[i];
	}
	left -= cards[N-1];
	right += cards[N-1];
	
	long long int lowest_diff = abs(left - right);
	for (int i = N-2; i >= 1; --i) {
		left -= cards[i];
		right += cards[i];
		
		if (abs(left - right) < lowest_diff) {
			lowest_diff = abs(left - right);
		}
	}
	
	cout << lowest_diff;
	return 0;
}


Measured memory_bytes: 1024
#include <iostream>
using namespace std;
int n,m,i,x,y,z;
bool data[21][21];
char h[1];
int main(){
	while(cin>>n){
		if(n==0){break;}
		for(x=0;x<=20;x++){
			for(y=0;y<=20;y++){
				data[x][y]=0;
			}
		}
		for(i=0;i<n;i++){
			cin>>x>>y;
			data[x][y]=1;
		}
		cin>>n;
		x=10,y=10;
		data[x][y]=0;
		for(i=0;i<n;i++){
			cin>>h>>m;
			switch(h[0]){
			case 'N':
				for(z=0;z<m;z++){
					y+=1;
					data[x][y]=0;
				}
				break;
			case 'S':
				for(z=0;z<m;z++){
					y-=1;
					data[x][y]=0;
				}
				break;
			case 'E':
				for(z=0;z<m;z++){
					x+=1;
					data[x][y]=0;
				}
				break;
			case 'W':
				for(z=0;z<m;z++){
					x-=1;
					data[x][y]=0;
				}
				break;
			}
		}
		m=0;
		for(x=0;x<=20;x++){
			for(y=0;y<=20;y++){
				m+=data[x][y];
			}
		}
		if(m==0){
			cout<<"Yes"<<endl;
		}else{
			cout<<"No"<<endl;
		}
	}
	return 0;
}

Measured memory_bytes: 1156