akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <math.h>
#include <limits.h>
#include <assert.h>
#define FOR(i,a,n) for(i=(a);i<(n);i++)
#define swap(type,a,b) do{type t=a;a=b;b=t;}while(0)
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define ll long long
#define INF 100000000
#define MOD 1000000007
#define SIZE 100005
#define LOCAL
#ifdef LOCAL
    #define DEBUG(...) printf(" "__VA_ARGS__)
#else
    #define DEBUG(...)
#endif /* LOCAL */
int comp(const void* a,const void* b){
	return *(int*)a-*(int*)b;
}
char str[20];
int main(void)
{
	int len,a,b,i;
	scanf("%s",str);
	len=strlen(str);
	a=(str[0]-'0'-1)+9*(len-1);
	b=0;
	FOR(i,0,len) b+=(str[i]-'0');
	printf("%d\n",MAX(a,b));
	return 0;
}
    
    
    

Measured memory_bytes: 128
import sys
sys.setrecursionlimit(10**6)

def iig(vn, en):
    res = [[] for _ in range(vn)]
    for _ in range(en):
        ai, bi = map(lambda x: int(x) - 1, input().split())
        res[ai].append(bi)
        res[bi].append(ai)
    return res

def sep_pc(graph, root=0):
    parent = [-1 for _ in range(n)]
    children = [None for _ in range(n)]
    def f(x, p):
        parent[x] = p
        children[x] = [y for y in graph[x] if y != p]
        for y in graph[x]:
            if y != p:
                f(y, x)
        return
    f(root, -1)
    return parent, children

def itree(n, root=0):
    return sep_pc(iig(n, n - 1), root)

mod = 10**9 + 7

fact_range = 10**5 + 3
facts = [1] * (fact_range + 1)
for i in range(0, fact_range):
    facts[i+1] = facts[i] * (i + 1) % mod

ifacts = [1] * (fact_range + 1)
ifacts[fact_range] = pow(facts[fact_range], mod - 2, mod)
for i in range(fact_range, 0, -1):
    ifacts[i-1] = ifacts[i] * i % mod

n, k = map(int, input().split())
p, c = itree(n)
def dfs(i=0, cur=k, avail=k-1):
    sz = len(c[i])
    if avail <= 0 and sz > 0 or sz > avail:
        return 0
    cur = cur * facts[avail] * ifacts[avail - sz] % mod
    for u in c[i]:
        cur = dfs(u, cur, k - 2)
    return cur
print(dfs())


Measured memory_bytes: 125456
#include <iostream>
#include <string.h>
#include <vector>
#include <map>
#include <algorithm>
#define rep(i,N) for(int i=0;i<((int)N);i++)
#define mod 1000000007
typedef long long ll;
using namespace std;
int main(void){
  int N;
  cin>>N;
  long a[N+1]; 
  for(int i=0;i<N;i++){
      cin>>a[i];
  }
  a[N]=0;
  sort(a,a+N);
  int count=0; int ans=0;
  for(int i=0;i<N;i++){
     count++;
     if(a[i]!=a[i+1]){
        if(count%2==1) {ans++;}
        count=0;
     }
  }
  cout<<ans;
  return 0;
}


Measured memory_bytes: 1024
#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use {
    proconio::{marker::*, *},
    std::{cmp::*, collections::*, mem::*},
};
/**
 * snuke code
**/
fn main() {
    input! {
            h:usize,
            w:usize,
            k:usize,
        s:[Chars;h],
    }
    dbg!(&s);
    let mut ans = INF;
    // 横に切る方法を全探索
    for div in 0..(1usize << (h - 1)) {
        let mut g: usize = 0;
        let mut id = vec![0usize; h + 1];
        for i in 0..h {
            id[i] = g;
            if (((div >> i) & 1) == 1) {
                g += 1;
            }
        }
        g += 1;
        let mut c = vec![vec![0usize; w]; g];
        for i in 0..h {
            for j in 0..w {
                c[id[i]][j] += (s[i][j] as u8 - b'0') as usize;
            }
        }

        // dbg!(&c);
        let mut num: usize = g - 1;
        // 各グループで何個のホワイトチョコがあるか
        let mut now = vec![0usize; g];
        for j in 0..w {
            if !add(&mut now, j, g, k, &c) {
                num += 1;
                now = vec![0usize; g];
                if !add(&mut now, j, g, k, &c) {
                    num = INF;
                    break;
                }
            }
        }
        ans = min(ans, num);
    }
    println!("{}", ans);
}
// j列目をnowに加算
fn add(now: &mut Vec<usize>, j: usize, g: usize, k: usize, c: &Vec<Vec<usize>>) -> bool {
    for i in 0..g {
        now[i] += c[i][j];
    }
    for i in 0..g {
        if now[i] > k {
            return false;
        }
    }
    return true;
}
const INF: usize = 1 << 62;

pub fn charconv(c: char, base: char) -> usize {
    return (c as u8 - base as u8) as usize;
}


Measured memory_bytes: 2240
#include <stdio.h>
#include <math.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <queue>
#include <map>
#include <utility>

using namespace std;

#define ll long long

void solve()
{
    ll N;
    cin >> N;
    vector<ll> A(N);
    vector<ll> B(N);
    vector<ll> C(N - 1);

    for (ll i = 0; i < N; i++)
    {
        cin >> A.at(i);
        A.at(i)--; // インデックス合わせる
    }
    for (ll i = 0; i < N; i++)
    {
        cin >> B.at(i);
    }
    for (ll i = 0; i < N - 1; i++)
    {
        cin >> C.at(i);
    }

    ll sat = 0;
    for (ll i = 0; i < N; i++)
    {
        sat += B.at(A.at(i));
        if (i > 0)
        {
            if (A.at(i - 1) + 1 == A.at(i))
            {
                sat += C.at(A.at(i - 1));
            }
        }
    }

    cout << sat << endl;
}

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


Measured memory_bytes: 256
#include<iostream>
using namespace std;
#define MAX 100
#define White 1
#define Black 2
#define Red 3
#define Infinit 1e+8
struct Vertex {
	int weight,color, parent,totalweight;
};
int M[MAX][MAX];
int n;
Vertex v[MAX];
void search() {
	int pointer, min;
	for (int i = 0; i < n; i++) {
		if (i == 0) {
			v[i].weight = 0;
		}
		else {
			v[i].weight = Infinit;
		}
		v[i].color = White;
		v[i].parent = -1;
	}
	while (true) {
		min = Infinit;
		pointer = -1;
		for (int i = 0; i < n; i++) {
			if (v[i].color != Black && min > v[i].weight) {
				min = v[i].weight;
				pointer = i;
			}
		}
		if (min == Infinit) break;
		v[pointer].color = Black;
		for (int k = 0; k < n; k++) {
			if (M[pointer][k] != -1 && v[k].color != Black) {
				if (v[pointer].weight+M[pointer][k]<v[k].weight) {
					v[k].weight = v[pointer].weight+M[pointer][k];
					v[k].parent = pointer;
					v[k].color = Red;
				}
			}
		}

	}
	for (int i = 0; i < n; i++) {
		cout << i << " " << v[i].weight << endl;
	}
	
}
int main() {
	int u,k,v,c;
	cin >> n;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			M[i][j] = -1;
		}
	}
	for (int i = 0; i < n; i++) {
		cin >> u >> k;
		for (int i = 0; i < k; i++) {
			cin >> v >> c;
			M[u][v] = c;
		}
	}
	search();
}


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

long long int n, m, d;

int main(){
    scanf("%lld%lld%lld", &n, &m, &d);
    printf("%.12Lf", (static_cast<long double>(n - d) * (d ? 2 : 1) * (m - 1)) / (n * n));
    return 0;
}

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

int max(int a,int b){
  if(a>b) return a;
  else return b;
}
int absolute(int a,int b){
  if(a-b<0) return -(a-b);
  else return a-b;
}
void Yes(){
  cout << "Yes" << endl;
}
void No(){
  cout << "No" << endl;
}
int main(){
  int A,B,C;
  cin >> A >> B >> C;
  
  if(A<=C && C <= B) Yes();
  else No();
}

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

namespace AOJ1043
{
    internal class Program
    {
        private static void Main()
        {
            foreach (var sortedTeams in from teams in ReadInputs()
                                        select from team in teams
                                               orderby team.Correct descending, team.Penalty, team.Id
                                               select team)
            {
                var picked = new List<Team>();
                foreach (var team in sortedTeams)
                {
                    var sameAffiliation = picked.Count(t => t.Affiliation == team.Affiliation);

                    if (picked.Count < 10)
                    {
                        if (sameAffiliation < 3)
                        {
                            picked.Add(team);
                        }
                    }
                    else if (picked.Count < 20)
                    {
                        if (sameAffiliation < 2)
                        {
                            picked.Add(team);
                        }
                    }
                    else if (picked.Count < 26)
                    {
                        if (sameAffiliation == 0)
                        {
                            picked.Add(team);
                        }
                    }
                }

                foreach (var team in picked)
                {
                    Console.WriteLine(team.Id);
                }
            }
        }

        public static IEnumerable<Team[]> ReadInputs()
        {
            while (true)
            {
                var count = int.Parse(Console.ReadLine() ?? "");
                if (count == 0) yield break;

                var teams = new Team[count];

                for (var i = 0; i < count; i++)
                {
                    var values = (Console.ReadLine() ?? "").Split(' ').Select(int.Parse).ToArray();
                    teams[i] = new Team(values[0], values[1], values[2], values[3]);
                }

                yield return teams;
            }
        }
    }

    public class Team
    {
        public int Id { get; private set; }
        public int Affiliation { get; private set; }
        public int Correct { get; private set; }
        public int Penalty { get; private set; }

        public Team(int id, int affiliation, int correct, int penalty)
        {
            Id = id;
            Affiliation = affiliation;
            Correct = correct;
            Penalty = penalty;
        }
    }
}

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

from bisect import bisect_left, bisect_right


def count(seq, element):
    "Return number of occurrences of item"
    i = bisect_left(seq, element)
    j = bisect_right(seq, element)
    return seq[i:j].count(element)


def solve(N: int, A: "List[int]"):
    flag = 0
    ans = 1
    seta = sorted(list(set(A)))
    sa = sorted(A)
    for a in reversed(seta):
        if count(sa, a) >= 4:
            if flag == 1:
                ans *= a
                print(ans)
                return
            ans = a * a
            print(ans)
            return
        elif count(sa, a) >= 2:
            flag += 1
            ans *= a
            if flag == 2:
                print(ans)
                return
    print(0)
    return


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

    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A)


if __name__ == '__main__':
    main()


Measured memory_bytes: 21276
import java.util.Scanner;
 
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
 
        if (a+b >= 10) {
            System.out.println("error");
        } else {
            System.out.println(a+b);
        }
    }
}

Measured memory_bytes: 21204
#! python3
# triangle.py - 三角形の面積、周、高さの計算

import math

a, b, angle = [int(i) for i in input().split()]

angle = math.radians(angle)
# 面積を求める
# S = (1/2) * a * b * math.sin(math.radians(angle))
S = (1/2) * a * b * math.sin(angle)

print(S)

# 周を求める
# if angle <= 90:
#     c_sqre = (a ** 2) + (b ** 2) + (2 * a * b * math.cos(math.radians(angle))# )
# else :
#     c_sqre = (a ** 2) + (b ** 2) + (-1 * 2 * a * b * math.cos(math.radians# (angle)))

c_sqre = (a ** 2) + (b ** 2) - (2 * a * b * math.cos(angle))

c = math.sqrt(c_sqre)
# print(c)
L = a + b + c
print(L)

# 高さを求める
h  = b * math.sin(angle)

print(h)

# print(angle)
# print(math.sin(math.radians(90)))


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

// 2 で割り切れる回数を返す
int f(int x) {
  int res = 0;
  while (x % 2 == 0) {
    x /= 2;
    res++;
  }
  return res;
}

// 最大公約数を返す
long long gcd(long long a, long long b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}

// 最小公倍数を返す
long long lcm(long long a, long long b) {
  return a / gcd(a, b) * b;
}

int main() {

  int N, M;
  cin >> N >> M;

  vector<int> a(N);
  for (int i = 0; i < N; i++) {
    cin >> a[i];
  }

  // 入力を 2 で割る
  for (int i = 0; i < N; i++) {
    if (a[i] % 2 == 1) {
      cout << 0 << endl;
      return 0;
    }
    a[i] /= 2;
  }

  // 2 で割り切れる回数が a[0] から a[N - 1] まで、全部同じじゃないとダメ
  // 同じ場合は、2^t で割る
  int t = f(a[0]);
  for (int i = 0; i < N; i++) {
    if (f(a[i]) != t) {
      cout << 0 << endl;
      return 0;
    }
    // a[i] /= 2^t
    a[i] >>= t;
  }

  // M /= 2^t
  M >>= t;

  // 2^t で割った a[0] から a[N - 1] までの lcm を求める。
  // lcm が M を超えるとダメ
  long long lcm_ = 1;
  for (int i = 0; i < N; i++) {
    lcm_ = lcm(lcm_, a[i]);
    if (M < lcm_) {
      cout << 0 << endl;
      return 0;
    }
  }

  // 2^t で割った M = lcm * answer を満たす必要があり、
  // answer は奇数じゃないとダメなので、奇数の個数が答えになる
  M /= lcm_;

  int answer = (M + 1) / 2;
  
  cout << answer << endl;
  
  return 0;
}

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

using namespace std;

int main(void){
    int N;
    cin >> N;
    vector<int> d(N);
    for(int i = 0; i < N; i++) cin >> d[i];
    sort(d.begin(), d.end());
    cout << d[N / 2] - d[N / 2 - 1] << endl;
    return 0;
}

Measured memory_bytes: 640
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <numeric>
#include <algorithm>
#include <math.h>

using namespace std;

string S;
int K;

int main(){
        cin >> S >> K;

    string str[6];
    for(int i=0;i<6;i++)  str[i] = "zzzzz";
    str[0] = "";
    for(int k=1;k<=K;k++){
        for(int i=0;i<S.size();i++){
            for(int j=1;j<=K;j++){
                string res = S.substr(i, j);
                if( str[k-1] < res && res < str[k] )   str[k] = res;
            }
        }
    }
    
    cout << str[K] << endl;
}



Measured memory_bytes: 256
import sys
from collections import Counter
input = sys.stdin.readline

s = list(input().rstrip())

s_odd = [s[x] for x in range(len(s)) if x % 2 != 0]
s_even = [s[x] for x in range(len(s)) if x % 2 == 0]


print(min([s_odd.count('1')+s_even.count('0'),s_odd.count('0')+s_even.count('1')]))


Measured memory_bytes: 5028
#include <stdio.h>
#include <math.h>
int main(void){
int a,b,c,e = 1;
scanf("%d %d",&a,&b);
for (c = 0;c < 20;c++)
{
  if (e >= b){
  break;
  }
  e += (a-1);
}
printf ("%d",c);
return 0;
}

Measured memory_bytes: 128
package main

import (
	"fmt"
	"sort"
)

func main() {
	var A, B, C, K int
	fmt.Scan(&A, &B, &C, &K)
	n := []int{A, B, C}

	for i := 0; i < K; i++ {
		sort.Ints(n)
		n[len(n)-1] *= 2
	}

	ans := 0
	for i := 0; i < len(n); i++ {
		ans += n[i]
	}

	fmt.Println(ans)
}


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

int main()
{
  string S;
  cin >> S;
  string ans = "Yes";
  rep(i, S.size()) {
    if ((i+1)%2 == 0) {
      if (S.at(i) != 'L' && S.at(i) != 'U' && S.at(i) != 'D') {
        ans = "No";
      }
    } else {
      if (S.at(i) != 'R' && S.at(i) != 'U' && S.at(i) != 'D')
      {
        ans = "No";
      }
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <utility>
#include <iomanip>
#include <functional>
#include <queue>
#include <stack>
#include <cmath>
#define INF 100000000
#define MOD 1000000007
using namespace std;
int main(){
  int a,b;
  cin>>a>>b;
  cout<<2*b-a<<endl;
}  

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

using ll = long long int;

const int MAX = (int)(1e5 + 5);
const ll INF = (ll)(1e10 + 5);
const int MAX_N = (int)(1e2 + 5);

int n;
int h[MAX_N];

int ans;

int calc_times(int l, int r) {
  if (l == r) {
    return h[l];
  }

  int tmpmin = MAX;
  for (int i = l; i <= r; ++i) {
    tmpmin = min(tmpmin, h[i]);
  }

  int next_l = l;
  int next_r = next_l;

  int times = tmpmin;

  for (int i = l; i <= r; ++i) {
    h[i] -= tmpmin;
  }

  h[r + 1] = 0;

  for (int i = l; i <= r + 1; ++i) {
    if (h[i] == 0) {
      if (i == next_l && next_l == next_r) {
        next_l += 1;
        next_r += 1;
      }
      else {
        next_r = i - 1;
        times += calc_times(next_l, next_r);

        next_l = i + 1;
        next_r = next_l;
      }
    }

  }

  return times;
}

int main(void) {
  // Here your code !
  scanf("%d", &n);

  for (int i = 0; i < n; ++i) {
    scanf("%d", &(h[i]));
  }

  ans = calc_times(0, n - 1);

  printf("%d\n", ans);

  return 0;
}

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

# define REP(i,n) for (int i=0;i<(n);++i)
# define PER(i,n) for (int i=(N-1);i>=0;--i)
# define rep(i,a,b) for(int i=a;i<(b);++i)
# define p(s) std::cout << s ;
# define pl(s)  std::cout << s << endl;
# define printIf(j,s1,s2) cout << (j ? s1 : s2) << endl;
# define YES(j) cout << (j ? "YES" : "NO") << endl;
# define Yes(j) std::cout << (j ? "Yes" : "No") << endl;
# define yes(j) std::cout << (j ? "yes" : "no") << endl;
# define all(v) v.begin(),v.end()
# define showVector(v) REP(i,v.size()){p(v[i]);p(" ")} pl("")
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;}
typedef long long int ll;
typedef pair<ll,ll> P_ii;
typedef pair<double,double> P_dd;

template<class T>
vector<T> make_vec(size_t a){
    return vector<T>(a);
}

template<class T, class... Ts>
auto make_vec(size_t a, Ts... ts){
  return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}

template<typename T,typename V>
typename enable_if<is_class<T>::value==0>::type
fill_v(T &t,const V &v){t=v;}

template<typename T,typename V>
typename enable_if<is_class<T>::value!=0>::type
fill_v(T &t,const V &v){
  for(auto &e:t) fill_v(e,v);
}


const int MOD = 1000000007;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;

void addM(long long &a, long long b) {
    a += b;
    if (a >= MOD) a -= MOD;
}

void mulM(long long &a, long long b) {
    a = ((a%MOD)*(b%MOD))%MOD ;
}

const int MAX = 510000;
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;
}

vector<pair<long long, long long> > prime_factorize(long long n) {
    vector<pair<long long, long long> > res;
    for (long long p = 2; p * p <= n; ++p) {
        if (n % p != 0) continue;
        int num = 0;
        while (n % p == 0) { ++num; n /= p; }
        res.push_back(make_pair(p, num));
    }
    if (n != 1) res.push_back(make_pair(n, 1));
    return res;
}

vector<int> g[200005];
vector<ll> val(200005, 0);
vector<ll> ans(200005, 0);

void dfs(int v, int p){
    ans[v] = val[v] + (p != -1 ? ans[p] : 0);
    for(auto&& s : g[v]) {
        if(s == p) continue;
        dfs(s, v);
    }
}

int main() {
    int N, Q;
    cin >> N >> Q;

    REP(i, N-1) {
        int a, b;
        cin >> a >> b;
        a--;
        b--;

        g[a].push_back(b);
        g[b].push_back(a);
    }

    REP(i, Q) {
        int p, x;
        cin >> p >> x;
        p--;
        val[p] += x;
    }

    dfs(0, -1);

    REP(i, N) cout << (i == 0 ? "" : " ") << ans[i];
    cout << endl;

    return 0;
}

Measured memory_bytes: 27264
#include <bits/stdc++.h>
using namespace std;
int main(){
  int a;
  int b;
  int c;
  int d=0;
  cin>>a>>b>>c;
  for(int i=a;i<b+1;i++){
    if(i%c==0){
      d+=1;
    }
  }
  cout<<d;
}
    

Measured memory_bytes: 3620
package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)
	var sum int
	for i := 1; i <= n; i++ {
		num := (n-n%i-i)/i + 1
		sum += (i + n - n%i) * num / 2
	}
	fmt.Println(sum)
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}


Measured memory_bytes: 1792
#include<stdio.h>
#define INF 0x7fffffff
#define ST_SIZE ((1 << 18) - 1)
typedef long long int LL;
LL dat[ST_SIZE];
LL input(void);
void update(LL a, LL b, LL x, LL k, LL l, LL r);
void find(LL x, LL k, LL l, LL r);
int main (void) {
  int command, x;
  LL i, n, q, s, t;
  n = input();
  q = input();
  for (i = 0; i < n; i++) dat[i] = INF;
  for (i = 0; i < q; i++) {
    command = input();
    if (!command) {
      s = input();
      t = input();
      x = input();
      update(s, t + 1, x, 0, 0, n);
    } else {
      t = input();
      find(t, 0, 0, n);
    }
  }
}
LL input(void)
{
  LL n = 0;
  int c = getchar_unlocked();
  if (c == '-') {
    c = getchar_unlocked();
    do {
      n = 10 * n + c - '0';
      c = getchar_unlocked();
    } while (c >= '0' && c <= '9');
    return -n;
  } else {
    do {
      n = 10 * n + c - '0';
      c = getchar_unlocked();
    } while (c >= '0' && c <= '9');
    return n;
  }
}
void update(LL a, LL b, LL x, LL k, LL l, LL r)
{
  LL m = (l + r) / 2;
  if (a >= r || b <= l) return;
  else if (a <= l && b >= r) dat[k] = x;
  else {
    if (dat[k] != -1) {
      dat[k*2+1] = dat[k*2+2] = dat[k];
      dat[k] = -1;
    }
    update(a, b, x, k * 2 + 1, l ,m);
    update(a, b, x, k * 2 + 2, m, r);
  }
}
void find(LL x, LL k, LL l, LL r)
{
  LL m = (l + r) / 2;
  if (dat[k] != -1) printf("%lld\n", dat[k]);
  else {
    if (x < m) find(x, k * 2 + 1, l, m);
    else find(x, k * 2 + 2, m, r);
  }
}


Measured memory_bytes: 3796
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
        Scanner stdin = new Scanner(System.in);

        int A = stdin.nextInt();
        int B = stdin.nextInt();
        
        if(10 > A && 10 > B) {
        	System.out.println(A*B);
        }
        else {
        	System.out.println("-1");
        }

	}
}


Measured memory_bytes: 22100
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <stdbool.h>
#define LL long long
#define INF 1<<31-1
#define LNF 9223372036854775807
#define PI 3.14159265358979
#define MIN(x,y) ((x)<(y)?(x):(y))
#define MAX(x,y) ((x)<(y)?(y):(x))
#define FOR(i,a,n) for(i=a;i<n;i++)
#define MOD 1000000007
#define NUM 100005

void swap(int* a,int* b){int tmp=*a;*a=*b;*b=tmp;}
int abs(int a){if(a<0)return -a;return a;}
int dup(int a,int d){if(a%d==0)return a/d;else return a/d+1;}
int mod(int a,int m){if(a<0)return a%m+m;else return a%m;}
int GCD(int a,int b){int c=1,tmp=MAX(a,b);b=MIN(a,b);a=tmp;while(c!=0){c=a%b;a=b;b=c;}return a;}
int LCM(int a,int b){return a*b/GCD(a,b);}
int POW(int a,int n){LL ans=1;while(n>0){if(n&1)ans=ans*a%MOD;a=a*a%MOD;n>>=1;}return (int)ans;}
int icmp(const void* a,const void* b){return *(int*)a-*(int*)b;}
int lcmp(const void* a,const void* b){if(*(LL*)a>*(LL*)b)return 1;if(*(LL*)a<*(LL*)b)return -1;return 0;}
int ccmp(const void* a,const void* b){return *(char*)a-*(char*)b;}
int scmp(const void* a,const void* b){return strcmp(*(char**)a,*(char**)b);}
LL fac[NUM],finv[NUM],inv[NUM];
void comi(){int i;fac[0]=fac[1]=1;finv[0]=finv[1]=1;inv[1]=1;FOR(i,2,NUM){fac[i]=fac[i-1]*i%MOD;inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;finv[i]=finv[i-1]*inv[i]%MOD;}}
int com(int n,int k){if(n<k||n<0||k<0)return 0;return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;}


int main(){
  int N,i,l,ans=0;
  char S[NUM];
  scanf("%d",&N);
  scanf("%s",S);
  l=strlen(S);
  FOR(i,0,l){
    S[i]+=N;
    if(S[i]>90)S[i]-=26;
  }

  printf("%s\n",S);
	return 0;
}


Measured memory_bytes: 128
N = int(input())
A = list(map(int, input().split()))
money = [[1000, 0]]
ans = 1000
B = [1 for _ in range(N)] #-1 -> buy 1 ->sell 0 -> nothing
for k in range(N-1):
  if A[k] < A[k+1]:
    B[k] = -1
  elif A[k] == A[k+1]:
    B[k] = 0

for k in range(N):
  if B[k] == -1:
    new = []
    for j in range(len(money)):
      if A[k] <= money[j][0]:
        new.append([money[j][0]%A[k], money[j][1] + money[j][0]//A[k]])
    money += new
  
  if B[k] == 1:
    ans = 0
    for j in range(len(money)):
      ans = max(money[j][0] + money[j][1]*A[k], ans)
    money[0] = [ans, 0]

print(ans)


Measured memory_bytes: 8988
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] a = new int[] { sc.nextInt(), sc.nextInt(), sc.nextInt() };
		sc.close();
		Arrays.sort(a);
		System.out.println(a[2] == a[1] && a[1] == a[0] ? "Yes" : "No");
	}
}


Measured memory_bytes: 23252
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include <iomanip>
using namespace std;

int main(){
	string s;
	cin>>s;
	int n;
	n=0;
	for(int i=0; i<3;i++){
		if(s[i]=='o'){
			n++;
		}
	}
	cout<<700+100*n<<endl;
    return 0;
}

Measured memory_bytes: 256
from math import sqrt


def log(s):
    # print("| " + str(s), file=sys.stderr)
    pass


def output(x):
    print(x, flush=True)


def input_ints():
    return map(int, input().split())


def main():
    k, s = tuple(input_ints())

    def solve2(ss):
        if ss > 2 * k:
            return 0
        elif ss > k:
            return 2 * k - ss + 1
        else:
            return ss + 1

    print(sum([solve2(ss) for ss in range(max(0, s - k), s + 1)]))


main()


Measured memory_bytes: 3060
def main():
    a = (input())
    if a.find("RRR")!=-1:
        print(3)
    elif a.find("RR")!=-1:
        print(2)
    elif a.find("R")!=-1:
        print(1)
    else:
        print(0)

if __name__ == "__main__":
    main()

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

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

	bool yes = true;
	for (int i = 0; i < n; ++i) {
		int a;
		cin >> a;
		if (a % 2 == 0) {
			if ((a % 3 == 0) || (a % 5 == 0)) {
			}
			else {
				yes = false;
			}
		}
	}

	if (yes) {
		cout << "APPROVED" << endl;
	}
	else {
		cout << "DENIED" << endl;	
	}

	return 0;
}

Measured memory_bytes: 256
/**
 *   Author:  Wasi Ur Rahman
 *   FROM RMSTU
**/
#include <bits/stdc++.h>
#define ll                      long long
#define boost                   ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define ticktock                cout<<"\nTime Elapsed: " << 1.0*clock() / CLOCKS_PER_SEC << " sec\n"
#define min3(a,b,c)             min(a,min(b,c))
#define min4(a,b,c,d)           min(d,min3(a,b,c))
#define max3(a,b,c)             max(a,max(b,c))
#define max4(a,b,c,d)           max(d,max3(a,b,c))
#define all(v)                  v.begin(),v.end()
#define revall(v)               v.rbegin(),v.rend()
#define pb                  	push_back
#define eb                      emplace_back
#define mk                      make_pair
#define setbits(x)              __builtin_popcountll(x)
#define zrobits(x)              __builtin_ctzll(x)
#define si(x)               	scanf("%d", &x)
#define sii(x, y)           	scanf("%d %d", &x, &y)
#define siii(x, y, z)       	scanf("%d %d %d", &x, &y, &z)
#define siiii(p,x, y, z)    	scanf("%d %d %d %d",&p, &x, &y, &z)
#define sll(x, y)           	scanf("%lld %lld", &x, &y)
#define slll(x, y, z)       	scanf("%lld %lld %lld", &x, &y, &z)
#define read                	freopen("input.txt","r",stdin)
#define write               	freopen("output.txt","w",stdout)
#define println()          		cout << endl
#define printi(x)           	printf("%d\n")
#define printii(x,y)        	printf("%d %d\n")
#define printiii(x,y,z)     	printf("%d %d %d\n")
#define printl(x)           	printf("%lld\n")
#define printll(x,y)        	printf("%lld %lld\n")
#define printlll(x,y,z)     	printf("%lld %lld %lld\n")
using namespace std;
/*************************************
*          A S S E M B L E           *
**************************************/
bool Prime(ll n){if(n <= 1)return false;for (ll i = 2; i<=sqrt(n); i++)if (n % i == 0)return false;return true;}
const int mod = 1e9+7;
inline int add(int a,int b){if((a+=b)>=mod)a-=mod;return a;}
inline int dec(int a,int b){if((a-=b)<0)a+=mod;return a;}
ll mult(ll a,ll b){long long t=1ll*a*b;if(t>=mod)t%=mod;return t;}
inline int power(int a,int b){int out=1;while(b){if(b&1)out=mult(out,a);a=mult(a,a);b>>=1;}return out;}
ll fact(ll n){ll res = 1;for(ll i = n;i>=1;i--) res = mult(res,i);return res;}
ll nCr(ll n,ll r){return (fact(n)/(fact(r)*fact(n-r)));}
ll nPr(ll n,ll r){return fact(n)/fact(n-r);}
ll modpow(ll a, ll n, ll mod){ll res=1;while(n>0){if(n&1) res=res*a%mod;a=a*a%mod;n>>=1;}return res;}
bool com(pair<ll,ll> a,pair<ll,ll> b) {if(a.first != b.first)return a.first<b.first;else return (a.second > b.second);}
/*************************************
*  E N D    G A M E   S T A R T S    *
**************************************/
int main(){
    boost;
    ll n;
    cin >> n;
    if(n % 2 == 0)
        cout << n << endl;
    else cout << n*2 << endl;
    return 0;
}


Measured memory_bytes: 3696
#include <iostream>
#include <bitset>
#include <string>
using namespace std;

int main(){
    string s;
    int x,y;
    cin >> s >> x >> y;

    bitset<16001> mx(0),my(0),ax(0),ay(0);
    ax[8000+x]=true;
    ay[8000+y]=true;

    int x0=0, i;
    for(i=0;i<s.size();i++){
        if(s[i]=='F') x0++;
        else break;
    }
    mx[8000+x0]=true;
    my[8000]=true;

    while(i<s.size()){
        int cx=0,cy=0;
        for(i++;i<s.size();i++){
            if(s[i]=='F') cy++;
            else break;
        }
        for(i++;i<s.size();i++){
            if(s[i]=='F') cx++;
            else break;
        }
        mx=(mx<<cx)|(mx>>cx);
        my=(my<<cy)|(my>>cy);
    }

    if((mx&ax)!=0 && (my&ay)!=0) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 256
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

#[allow(dead_code)]
fn read_vec2<T: std::str::FromStr>(n: u32) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}

fn main() {
    let v = read_vec::<usize>();
    let n = v[0];
    let k = v[1];
    let s = read::<String>();

    let s2 = s
        .chars()
        .enumerate()
        .map(|(i, c)| {
            if i == k - 1 {
                (c as u8 + 32) as char
            } else {
                c
            }
        })
        .collect::<String>();
    println!("{}", s2);
}


Measured memory_bytes: 4352
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;

string to_s(int n){
	string res;
	while(n){
		res += n%10+'0';
		n /= 10;
	}
	reverse(res.begin(),res.end());
	return res;
}
string query(string s){
	string res,t;
	for(int i=0;i<s.size();){
		int j;
		for(j=i+1;j<s.size();j++)
			if(s[i]!=s[j])break;
		res += to_s(j-i)+s[i];
		i = j;
	}
	return res;
}
int main(){
	int n;
	string s;
	while(cin>>n&&n){
		cin>>s;
		while(n--){
			s=query(s);
		}
		cout<<s<<endl;
	}
	return 0;
}

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

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

int N,K;
int OP[1606];
ll fact2[3030];
ll mo=1000000007;
ll memo[603][603];

ll dp(int L,int R) {
	if((R-L)%2==0) return 0;
	if(memo[L][R]>=0) return memo[L][R];
	
	int i;
	int NF=0;
	for(i=L;i<=R;i++) {
		if(OP[i]!=-1 && (OP[i]<L || OP[i]>R)) return memo[L][R]=0;
		NF+=OP[i]==-1;
	}
	ll ret=fact2[NF];
	int NF2=0;
	for(i=L;i<R;i++) {
		NF2+=OP[i]==-1;
		ret+=mo-dp(L,i)*fact2[NF-NF2]%mo;
	}
	
	return memo[L][R]=ret%mo;
}

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	fact2[0]=1;
	for(i=2;i<=600;i+=2) fact2[i]=fact2[i-2]*(i-1)%mo;
	
	MINUS(OP);
	MINUS(memo);
	
	cin>>N>>K;
	N*=2;
	FOR(i,K) {
		cin>>x>>y;
		OP[x-1]=y-1;
		OP[y-1]=x-1;
	}
	
	int NFS=0;
	FOR(i,N) NFS+=(OP[i]==-1);
	
	ll ret=0;
	FOR(x,N) {
		int NF=0;
		for(y=x;y<N;y++) {
			NF+=OP[y]==-1;
			ret+=dp(x,y)*fact2[NFS-NF]%mo;
		}
	}
	
	cout<<ret%mo<<endl;
	
}


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


Measured memory_bytes: 3072
#include <iostream>
#include <sstream>
#include <fstream>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <list>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <climits>
using namespace std;

struct node {
	int key;
	node *p, *lc, *rc;
	node(int key){
		this->p = this->lc = this->rc = NULL;
		this->key = key;
	}
	void push(node *nod){
		if(this->key == INT_MAX){
			this->key = nod->key;
			return;
		}
		
		if(this->key > nod->key){
			if(this->lc == NULL){
				nod->p = this;
				this->lc = nod;
			}else this->lc->push(nod);
		}else{
			if(this->rc == NULL){
				nod->p = this;
				this->rc = nod;
			}else this->rc->push(nod);
		}
	}
	void inprint(){
		if(this->lc != NULL) this->lc->inprint();
		cout << " " << this->key;
		if(this->rc != NULL) this->rc->inprint();
	}
	void preprint(){
		cout << " " << this->key;
		if(this->lc != NULL) this->lc->preprint();
		if(this->rc != NULL) this->rc->preprint();
	}
};

int main() {
	int n;
	cin >> n;
	
	node top(INT_MAX);
	while(n--){
		string com;
		cin >> com;
		
		if(com[0] == 'i'){
			int key;
			cin >> key;
			
			node *nod = new node(key);
			top.push(nod);
		}else{
			top.inprint();
			cout << endl;
			top.preprint();
			cout << endl;
		}
	}
	
	return 0;
}

Measured memory_bytes: 24644
#include<stdio.h>
int main(void)
{
	int N,i,x,y,b,p,f,c;
	scanf("%d",&N);
	for(i=0;i!=N;i++){
		scanf("%d%d%d%d",&x,&y,&b,&p);
		f=x*b+y*p;
		if(b<5){
			b=5;
		}
		if(p<2){
			p=2;
		}
		c=(x*b+y*p)/5*4;
		if(f<c){
			printf("%d\n",f);
		}
		else{
			printf("%d\n",c);
		}
	}
	return 0;
}

Measured memory_bytes: 1028
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <numeric>
#include <string>
#include <string.h>
#include <map>
#include <set>
#include <functional>
#include <complex>
#include <stack>
#include <tuple>
using namespace std;
#define rep(i,n) for (int i=0; i < (n); i++)


typedef long long int ll;
typedef double D;      // ??§?¨?????????????double???long double?????????
typedef complex<D> P;  // Point
typedef pair<P, P> L;  // Line
typedef vector<P> VP;


const int INF = (1<<30) - 1;
const D EPS = 1e-9;

#define X real()
#define Y imag()
#define LE(n,m) ((n) < (m) + EPS)
#define GE(n,m) ((n) + EPS > (m))
#define EQ(n,m) (abs((n)-(m)) < EPS)

class Imos{
public:
    int H, W;
    vector<vector<int>> d;
public:
    //1-indexed
    Imos(vector<vector<int>>& field){
        H = field.size();
        W = field[0].size();
        d = vector<vector<int> >(H+1, vector<int>(W+1));
        
        for(int i=0; i<H; i++){
            for(int j=0; j<W; j++){
                d[i+1][j+1] = d[i+1][j] + d[i][j+1] - d[i][j] + field[i][j];
            }
        }
    }
    int area(int h1, int w1, int h2, int w2){
        //size of area s.t. [h1, h2) and [w1, w2)
        return d[h2][w2] - d[h2][w1] - d[h1][w2] + d[h1][w1];
    }
};

//g++ -std=c++0x -msse4.2 -O3
//#include <bits/stdc++.h>
int main(){
    //ios::sync_with_stdio(false);
    //cin.tie(0);
    //cout.precision(16);
    
    int N, M; cin >> N >> M;
    
    vector<int> xs(N), ys(N);
    vector<pair<int, int>> p(N);
    
    for(int i=0; i<N; i++){
        scanf("%d %d", &xs[i], &ys[i]);
        p[i] = make_pair(xs[i], ys[i]);
    }
    
    sort(xs.begin(), xs.end());
    sort(ys.begin(), ys.end());
    xs.erase(unique(xs.begin(), xs.end()), xs.end());
    ys.erase(unique(ys.begin(), ys.end()), ys.end());
    
    vector<vector<int>> d(xs.size(), vector<int>(ys.size()));
    for(int i=0; i<N; i++){
        int x = p[i].first, y = p[i].second;
        int xi = lower_bound(xs.begin(), xs.end(), x) - xs.begin();
        int yi = lower_bound(ys.begin(), ys.end(), y) - ys.begin();
        
        d[xi][yi]++;
    }
    
    Imos imos = Imos(d);
    
    while(M--){
        int x1, y1, x2, y2;
        scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
        
        int x1i = lower_bound(xs.begin(), xs.end(), x1) - xs.begin();
        int y1i = lower_bound(ys.begin(), ys.end(), y1) - ys.begin();
        int x2i = upper_bound(xs.begin(), xs.end(), x2) - xs.begin();
        int y2i = upper_bound(ys.begin(), ys.end(), y2) - ys.begin();
        
        printf("%d\n", imos.area(x1i, y1i, x2i, y2i));
    }
    return 0;
}

Measured memory_bytes: 196884
import sys
read = sys.stdin.readline


def readln():
    return list(map(int, read().split()))


N, Q = readln()
S = input()

L = []
R = []
for _ in range(Q):
    a, b = readln()
    L.append(a-1)  # indexでアクセスできるように
    R.append(b-1)

AC_count = [0] * N  # Sのidxと対応、そこまでにACが何回出てきたか
cnt = 0

for i, (s1, s2) in enumerate(zip(S[:-1], S[1:])):
    if s1 == 'A' and s2 == 'C':
        cnt += 1

    AC_count[i+1] = cnt

for l, r in zip(L, R):
    print(AC_count[r]-AC_count[l])


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

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

  vector<int> vec(n);

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

    cin >> vec[i];
  }

  sort(vec.begin(), vec.end());
  int N = vec.back();

  vector<int> ar(100010, 0);

  for (int i = 0; i < n; i++) {
    ar[vec[i]]++;
    ar[vec[i] + 1]++;
    ar[vec[i] + 2]++;
  }
  /*for (int i = 0; i < n; i++) {
    cout << vec[i] << ":::" << ar[i] << endl;
  }*/
  int ans = 0;
  for (int i = 1; i < n; i++) {
    ans = max(ans, ar[i]);
  }

  // sort(cou.begin(), cou.begin() + vec[n - 1] + 1, greater<int>());
  if (n != 1) {
    cout << ans << endl;
  } else {
    cout << 1;
  }
  return 0;
}


Measured memory_bytes: 1024
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<utility>
#include <algorithm> // sort
#include <map> // pair
using namespace std;
using ll = long long;
const ll mod = 1e9+7;

int main(){
  int a,b;
  cin >> a >> b;
  if (a>=13){
    cout << b;
  }else if(6<=a){
    cout << b/2;
  }else {
    cout << 0;
  }


}


Measured memory_bytes: 256
void main() {
	auto s = rs, t = rs;
	size_t[][char] m;
	foreach(i, c; s) m[c] ~= i + 1;

	long last, loopc;
	auto N = s.length;
	foreach(c; t) {
		if(c !in m) {
			writeln(-1);
			return;
		}
		auto k = m[c].assumeSorted.upperBound(last);
		debug writefln("%s %s", m[c], k);
		if(k.empty) {
			loopc++;
			last = m[c][0];
		} else {
			last = k[0];
		}
		debug writefln("%d %d", loopc, last);
	}
	writeln(loopc * N + last);
}

// ===================================

import std.stdio;
import std.string;
import std.functional;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

long rl() {
	return readAs!long;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}

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

#define MAX 500000
typedef unsigned long long int ULL;
typedef long long int LL;
typedef unsigned int UI;
typedef long long i64;

bool isvowel(char ch)
{
    if(ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u')
        return true;
    else
        return false;
}

int main()
{
    char c;
    cin>>c;
    if(isvowel(c))
        cout<<"vowel"<<endl;
    else
        cout<<"consonant"<<endl;

    return 0;
}


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

using namespace std;

#define REP(i, n) for(int i = 0; i < (n); i++)
#define SREP(i, s) for(int i = 0; i < (s.length()); i++)
#define SORT(v, n) sort(v, v+n);
#define GSORT(v, n) sort(v, v+n, greater<int>())
#define REV(a) reverse(begin(a),end(a));

int main(){
	ios::sync_with_stdio(false);cin.tie(0);
//////////////////////////////////////////////
	int a,b;
	cin >> a >> b;
	cout << max(a-b,0) << endl;
//////////////////////////////////////////////
}


Measured memory_bytes: 256
N, A, B, C = map(int, input().split())
l_list = [int(input()) for _ in range(N)]

inf = float("inf")


def dfs(cur, a, b, c):
    if cur == N:
        return abs(a - A) + abs(b - B) + abs(c - C) - 30 if min(a, b, c) > 0 else inf
    ans0 = dfs(cur + 1, a, b, c)
    ans1 = dfs(cur + 1, a + l_list[cur], b, c) + 10
    ans2 = dfs(cur + 1, a, b + l_list[cur], c) + 10
    ans3 = dfs(cur + 1, a, b, c + l_list[cur]) + 10
    return min(ans0, ans1, ans2, ans3)


print(dfs(0, 0, 0, 0))


Measured memory_bytes: 3064
H, W = list(map(int, input().split()))
hw = [list(input()) for _ in range(H)]

index = 0
row = []
while True:
    # 縦
    if hw[index][0] == '.':
        clearable = 0
        for i in range(W):
            if hw[index][i] == '.':
                clearable += 1
        if clearable != W:
            row.append(hw[index][:])
    else:
        row.append(hw[index][:])

    index += 1
    if index == H:
        break

# 転置して横と似たような処理で縦も処理する
rowt = [list(x) for x in list(zip(*row))]

index = 0
cols = []
while True:
    # 横
    if rowt[index][0] == '.':
        clearable = 0
        for i in range(len(rowt[index])):
            if rowt[index][i] == '.':
                clearable += 1
        if clearable != len(rowt[index]):
            cols.append(rowt[index][:])
    else:
        cols.append(rowt[index][:])

    index += 1
    if index == len(rowt):
        break

# 転置してるので元に戻す
ans = [list(x) for x in list(zip(*cols))]

for i in range(len(ans)):
    print(''.join(ans[i]))


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


int main()
{
	int N;
	cin>>N;
	map<long long int,int> A;
	for(int i=0;i<N;i++)
	{
		long long int a;
		cin>>a;
		A[a]++;	
	}
	//A={"a" -> 1 ,"b" -> 2 ,"c" -> 3}
	//p=("a",1)
	//p.first="a"
	//p.second=1
	//
	//p.first="b"
	//p.second=2
	//
	//p.first="c"
	//p.second=3
	int flag=1;
	for(pair<long long int,int> p : A)
	{
		if(p.second>1)
		{
			flag=0;
			break;
		}
	}
	if(flag==1)
	{
		cout<<"YES"<<endl;	
	}
	else
	{
		cout<<"NO"<<endl;
	}
	return 0;
}


Measured memory_bytes: 12800
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func main() {
    let next: [String: String] = [
        "a": "b",
        "b": "c",
        "c": "d",
        "d": "e",
        "e": "f",
        "f": "g",
        "g": "h",
        "h": "i",
        "i": "j",
        "j": "k",
        "k": "l",
        "l": "m",
        "m": "n",
        "n": "o",
        "o": "p",
        "p": "q",
        "q": "r",
        "r": "s",
        "s": "t",
        "t": "u",
        "u": "v",
        "v": "w",
        "w": "x",
        "x": "y",
        "y": "z"
    ]
    let c = readLine()!
    print(next[c]!)
}

main()


Measured memory_bytes: 7856
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BMultiplication2 solver = new BMultiplication2();
        solver.solve(1, in, out);
        out.close();
    }

    static class BMultiplication2 {
        private static final long MAX = 1_000_000_000_000_000_000L;

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            long[] a = in.readLongArray(n);

            for (long x : a) {
                if (x == 0) {
                    out.println(0);
                    return;
                }
            }

            long answer = 1;
            for (long x : a) {
                try {
                    answer = Math.multiplyExact(answer, x);
                } catch (ArithmeticException e) {
                    out.println(-1);
                    return;
                }
            }

            if (answer > MAX) {
                out.println(-1);
                return;
            }

            out.println(answer);
        }

    }

    static class InputReader {
        public final BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

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

        public long[] readLongArray(int n) {
            long[] x = new long[n];
            for (int i = 0; i < n; i++) {
                x[i] = nextLong();
            }
            return x;
        }

    }
}



Measured memory_bytes: 48580
#include <bits/stdc++.h>
#ifndef ONLINE_JUDGE
#define _GLIBCXX_DEBUG
#endif
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = s; i < (int)(n); i++)
#define Clear(a) a = decltype(a)()
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define vec vector
typedef long long ll;
typedef pair<ll,ll> P;
//const ll big=998244353;
const ll big=1000000007LL;
const ll INF=1e18;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
ll max(ll x,ll y){
    if(x>y)return x;
    else return y;
}
ll min(ll x,ll y){
    if(x<y)return x;
    else return y;
}
ll expm(ll x,ll y){
    if(y==0)return 1;//0^0=1
    if(x==1||x==0)return x;
    if(y%2==1)return (expm(x,y-1)*x)%big;
    ll t=expm(x,y/2);
    return (t*t)%big;
}
ll exp(ll x,ll y){
    if(y==0)return 1;//0^0=1
    if(x==1||y==0)return x;
    if(y%2==1)return exp(x,y-1)*x;
    ll t=exp(x,y/2);
    return t*t;
}


int main(){
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    cout << fixed << setprecision(10);
    /*--------------------------------*/
    
    int n;cin >> n;
    vector<int> primes(1000001);
    primes[0]=primes[1]=-1;
    for(int i=2;i<=1000000;i++){
        if(primes[i]!=0)continue;
        primes[i]=-1;
        for(int j=2*i;j<=1000000;j+=i){
            if(primes[j]==0)primes[j]=i;
        }
    }
    ll ans=0;
    rep2(c,1,n){
        int k=n-c;
        ll cnt=1;
        while(1){
            int p=primes[k];
            if(p==-1){
                if(k==1)break;
                cnt*=2;break;
            }
            int now=0;
            while(k%p==0){
                now++;
                k/=p;
            }
            cnt*=now+1;
        }
        ans+=cnt;
    }
    cout << ans << endl;
}

Measured memory_bytes: 7156