akhauriyash/Code-Regression huggingface dataset:
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <vector>
#include <cmath>
#include <string>
#include <map>
#include <ctime>

using namespace std;

const int INF = 1e9 + 9;
const int MOD = 1e9 + 7;
const int kek = 1;

int main() {
	//#ifdef _DEBUG
	//	freopen("input.txt", "r", stdin);
	//#endif

	int n, a;
	string ans;
	scanf("%d%d", &n, &a);
	if (n % 500 <= a) {
		ans = "Yes";
	} else {
		ans = "No";
	}
	printf(ans.c_str());
	return 0;
}

Measured memory_bytes: 256
use std::io;
use std::str::FromStr;

fn main() {
    let stdin = io::stdin();
    let mut buf = String::new();
    stdin.read_line(&mut buf).ok();
    let mut it = buf.split_whitespace().map(|n| usize::from_str(n).unwrap());
    let (n, m, q) = (it.next().unwrap(), it.next().unwrap(), it.next().unwrap());

    let mut matrix = vec![vec![0; n + 1]; n + 1];
    for _ in 0..m {
        let mut buf = String::new();
        stdin.read_line(&mut buf).ok();
        let mut it = buf.split_whitespace().map(|n| usize::from_str(n).unwrap());
        let (l, r) = (it.next().unwrap(), it.next().unwrap());
        matrix[l][r] += 1;
    }

    let mut sum : Vec<Vec<i64>>= vec![vec![0; n + 1]; n + 1];
    for i in 0..n + 1 {
        for j in 0..n + 1 {
            sum[i][j] = matrix[i][j];
            if j as i32 - 1 >= 0 { sum[i][j] += sum[i][j - 1]; };
            if i as i32 - 1 >= 0 { sum[i][j] += sum[i - 1][j]; };
            if i as i32 - 1 >= 0 && j as i32 - 1 >= 0 { sum[i][j] -= sum[i - 1][j - 1]; };
        }
    }

    for _ in 0..q {
        let mut buf = String::new();
        stdin.read_line(&mut buf).ok();
        let mut it = buf.split_whitespace().map(|n| usize::from_str(n).unwrap());
        let (p, q) = (it.next().unwrap(), it.next().unwrap());
        let cnt = get((p, p), (q, q), &sum);
        println!("{}", cnt);
    }
}

fn get((x1, y1) : (usize, usize), (x2, y2) : (usize, usize), sum : &Vec<Vec<i64>>) -> i64 {
    let mut res : i64 = sum[x2][y2];
    if x1 > 0 { res -= sum[x1 - 1][y2]; };
    if y1 > 0 { res -= sum[x2][y1 - 1]; };
    if x1 > 0 && y1 >0 { res += sum[x1 - 1][y1 - 1]; };
    res
}


Measured memory_bytes: 9084
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
const double pi=3.1415926535;

int main()
{
    string s,t;
    cin>>s>>t;
    bool flag=1;
    for(int i=0;i<s.length();i++){
    	if(s[i]!=t[i]){
    		flag=0;break;
		}
	}
	if(flag)cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
    return 0;
}

Measured memory_bytes: 3544
"""
author : halo2halo
date : 9, Jan, 2020
"""

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)


DISH = list(map(int, read().split()))

temp = 10
im = 0
for num, i in enumerate(DISH):
    if i % 10 < temp and i % 10 != 0:
        temp = i % 10
        im = num

ans = 0
for num, i in enumerate(DISH):
    if num != im:
        ans += ((i + 9) // 10) * 10
    else:
        ans += i
print(ans)


Measured memory_bytes: 3064
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

MOD = 10 ** 9 + 7

def cumprod(A, MOD = MOD):
    L = len(A); Lsq = int(L**.5+1)
    A = np.resize(A, Lsq**2).reshape(Lsq,Lsq)
    for n in range(1,Lsq):
        A[:,n] *= A[:,n-1]; A[:,n] %= MOD
    for n in range(1,Lsq):
        A[n] *= A[n-1,-1]; A[n] %= MOD
    return A.ravel()[:L]


def make_fact(U, MOD = MOD):
    x = np.arange(U, dtype = np.int64); x[0] = 1
    fact = cumprod(x, MOD)
    x = np.arange(U, 0, -1, dtype=np.int64); x[0] = pow(int(fact[-1]), MOD-2, MOD)
    fact_inv = cumprod(x, MOD)[::-1]
    fact.flags.writeable = False
    fact_inv.flags.writeable = False
    return fact,fact_inv

fact, fact_inv = make_fact(2 * 10**6 + 10)

def F(i,j):
    return fact[i+j+2] * fact_inv[i+1] % MOD * fact_inv[j+1] % MOD

a,b,c,d = map(int,read().split())

answer = F(c,d) - F(a-1,d) - F(c,b-1) + F(a-1,b-1)
answer %= MOD
print(answer)

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

using namespace std;

int main()
{
    int n;
    cin >> n;
    vector<int>v,p,q;
    v.resize(n);
    p.resize(n);
    q.resize(n);
    for(int i = 0; i < n; i++)
    {
        cin >> p[i];
    }
    for(int i = 0; i < n; i++)
    {
        cin >> q[i];
    }
    for(int i = 0; i < n; i++)
    {
        v[i] = i + 1;
    }
    int count = 0;
    int a,b;
    do
    {
        if(v == p) a = count;
        if(v == q) b = count;
        count++;
    }while(next_permutation(v.begin(),v.end()));
    
    cout << abs(b - a) << endl;
    return 0;
}

Measured memory_bytes: 3604
S = input()
K = int(input())
now,cnt,num = S[0],1,0
for i in S[1:-1]:
    if i == now:
        cnt += 1
    else:
        num += cnt//2
        cnt = 1
        now = i
if S[-1] == now:
    num += (cnt+1)//2
else: num += cnt//2

S = S + S
now,cnt,num2 = S[0],1,0
for i in S[1:-1]:
    if i == now:
        cnt += 1
    else:
        num2 += cnt//2
        cnt = 1
        now = i
if S[-1] == now:
    num2 += (cnt+1)//2
else: num2 += cnt//2

length = len(S)//2
if len(set(S)) == 1 and length%2 == 1:
    print(length//2*K + K//2)
    exit()

if num2 - num*2 == 1:
    ans = K - 1 + num*K
else:
    ans = num*K
print(ans)

Measured memory_bytes: 9236
#include <iostream>
#include <vector>
#include <array>
#include <string>
#include <algorithm>
#include <numeric>
#include <list>
#include <set>
#include <map>
#include <cmath>
#include <limits>

#define pv(val) cerr << #val << '=' << (val) << endl
#define pvn(name, val) cerr << name << '=' << (val) << endl
#define pl cerr << '@' << __LINE__ << endl


using namespace std;

template <class T>
ostream& operator<<(ostream& os, vector<T> const& vec) {
    if (vec.empty()) {
        os << "{}";
    } else {
        os << '{';
        for (size_t i = 0; i < vec.size() - 1; i++) os << vec[i] << ", ";
        os << vec.back() << '}';
    }
    return os;
}

template <class T, size_t S>
ostream& operator<<(ostream& os, array<T, S> const& arr) {
    if (arr.empty()) {
        os << "{}";
    } else {
        os << '{';
        for (size_t i = 0; i < arr.size() - 1; i++) os << arr[i] << ", ";
        os << arr.back() << '}';
    }
    return os;
}

template<class T, class U>
ostream& operator<<(ostream& os, pair<T, U> const& p) {
    os << '(' << p.first << ", " << p.second << ')';
    return os;
}

namespace math {
    int64_t gcd(int64_t u, int64_t v) {
        while (v != 0) {
            int64_t r = u % v;
            u = v;
            v = r;
        }
        return u;
    }
    int64_t lcm(int64_t m, int64_t n)
    {
        if ((0 == m) || (0 == n))
            return 0;

        return ((m / math::gcd(m, n)) * n);
    }
}

struct UnionFind {
    vector<int64_t> data;
    UnionFind(int64_t size) : data(size, -1) { }
    bool unionSet(int64_t x, int64_t y) {
    x = root(x); y = root(y);
    if (x != y) {
        if (data[y] < data[x]) swap(x, y);
        data[x] += data[y]; data[y] = x;
    }
    return x != y;
    }
    bool findSet(int64_t x, int64_t y) {
    return root(x) == root(y);
    }
    int64_t root(int64_t x) {
    return data[x] < 0 ? x : data[x] = root(data[x]);
    }
    int64_t size(int64_t x) {
    return -data[root(x)];
    }
};

int main(void) {
    int64_t n, m;
    cin >> n >> m;
    vector<pair<int64_t, int64_t>> b(m);
    for(int64_t i = 0; i < m; i++){
        cin >> b[i].first >> b[i].second;
        b[i].first--;
        b[i].second--;
    }
    reverse(b.begin(), b.end());
    UnionFind uf(n);

    vector<int64_t> ans(m + 1);
    ans[0] = (n * (n - 1)) / 2;
    for(int64_t i = 0; i < m; i++) {
        auto const p = b[i];

        int64_t s0 = uf.size(p.first);
        int64_t s1 = uf.size(p.second);

        if(uf.root(p.first) == uf.root(p.second))
            s0 = 0;
        else
            uf.unionSet(p.first, p.second);

        ans[i + 1] = ans[i] - s0 * s1;
    }
    reverse(ans.begin(), ans.end());

    for(int64_t i = 0; i < m; i++)
        cout << ans[i + 1] << endl;

    return 0;
}

Measured memory_bytes: 4480
#pragma region
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <map>
#include <queue> 
#include <stack>
#include <set>
#include <list>

using namespace std;
typedef long long ll;
//#define rep(i, s, e) for (int(i) = (s); (i) < (e); ++(i))
#define rep(i, e) for (int(i) = 0; (i) < (e); ++(i))
#define rrep(i, s) for (int(i) = (s) - 1; (i) >= 0; --(i))
#define all(x) x.begin(),x.end()
#pragma endregion


int main()
{
	int n; cin >> n;
	vector<ll> s(n + 1);
	s[0] = 0;
	rep(i, n)
	{
		ll a; cin >> a;
		s[i + 1] = s[i] + a;
	}
	vector<vector<ll>> dp(n + 1, vector<ll>(n + 1, 1e18));
	rep(i, n + 1)dp[i][i] = 0;
	for (int l = 2; l <= n; ++l)
	{
		for (int i = 1; i <= n - l + 1; ++i)
		{
			int j = i + l - 1;
			for (int k = i; k < j; ++k)
			{
				dp[i][j] = min(dp[i][j], dp[i][k] + dp[k + 1][j] + s[j] - s[i - 1]);
			}
		}
	}
	cout << dp[1][n] << endl;
}

Measured memory_bytes: 1536
#include<iostream>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<utility>
#include<iomanip>
#include<map>
#include<cmath>
#include<cstdio>
#define rep(i,n) for(int i=0; i<(n); ++i)
using namespace std;
using ll =long long;
using P = pair<int,int>;

int main(){
    int n; cin >> n;
    vector<int> hen(n);
    rep(i,n) cin >> hen[i];
    sort(hen.begin(),hen.end());
    int sum=0;
    rep(i,n-1) sum += hen[i];
    if(sum>hen[n-1])
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    return 0;
}


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

using namespace std;

#define inf 1<<30
#define llong long long
#define usd unsigned
#define pqueue priority_queue
#define mp make_pair
#define pb push_back
#define fn fill_n
typedef pair<int, int> P;
typedef struct data{
	int now;
	int cost;
}data;
int nw[9] = {0, 1, 0, -1, -1, 1, 1, -1, 0};
int nh[9] = {1, 0, -1, 0, 1, 1, -1, -1, 0};




int main(){
	int n, a, b;
	cin >> n;
	if(n == 1) cout << "Hello World" << endl;
	else{
		cin >> a >> b;
		cout << a+b << endl;
	}

	return 0;
}

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

namespace AtCoder
{
	public class Program
	{
		//static int[] parent;
		static long MAX_LONG = 100000000000;
		static int MAX_NUM = 1000000000;
		static void Main(string[] args)
		{
			int[] input = Console.ReadLine().Split().Select(p => int.Parse(p)).ToArray();
			int A = input[0];
			int B = input[1];
			int Q = input[2];

	//Random rnd = new System.Random();

			List<long> shrine = new List<long>();
			List<long> temple = new List<long>();
			List<long> ques = new List<long>();
			for(int i=0; i<A; i++)
			{
				//shrine.Add(rnd.Next(MAX_NUM));
				//Console.Write(shrine[i] + " ");
				shrine.Add(long.Parse(Console.ReadLine()));
			}
			shrine.Sort();
			//Console.WriteLine();
			for(int i=0; i<B; i++)
			{
				//temple.Add(rnd.Next(MAX_NUM));
				//Console.Write(temple[i] + " ");
				temple.Add(long.Parse(Console.ReadLine()));
			}
			temple.Sort();
			//Console.WriteLine();
			for(int i=0; i<Q; i++)
			{
				//ques.Add(rnd.Next(MAX_NUM));
				//Console.Write(ques[i] + " ");
				ques.Add(long.Parse(Console.ReadLine()));
			}
			//Console.WriteLine();

			// 東西それぞれ近い神社、寺との距離を探す
			for(int i=0; i<Q; i++)
			{
				long ws = ques[i] - binarySearch(shrine, ques[i], 0, A-1, false);
				long es = binarySearch(shrine, ques[i], 0, A-1, true) - ques[i];
				long wt = ques[i] - binarySearch(temple, ques[i], 0, B-1, false);
				long et = binarySearch(temple, ques[i], 0, B-1, true) - ques[i];
				// 西の神社と西の寺を訪れる時
				long min = MAX_LONG;
				if(ws>0 && wt > 0)
					min = Math.Max(ws,wt);
//Console.WriteLine(ws + " " + wt + " " + ques[i] + " " + es + " " + et);
				// 東の神社と東の寺を訪れる時
				if(es > 0 && et > 0 && min > Math.Max(es, et))
					min = Math.Max(es, et);

				// 西の神社と東の寺を訪れる時
				if(ws > 0 && et > 0 && min > Math.Max(ws, et) + 2*Math.Min(ws, et))
					min = Math.Max(ws, et) + 2*Math.Min(ws, et);

				// 東の神社と西の寺を訪れる時
				if(es > 0 && wt > 0 && min > Math.Max(es, wt) + 2*Math.Min(es, wt))
					min = Math.Max(es, wt) + 2*Math.Min(es, wt);

				Console.WriteLine(min + "");
			}
		}

		static long binarySearch(List<long> list, long x, int start, int end, bool bigger)
		{
			// 範囲外の場合-1を返却する
			if(bigger)
			{
				if(x > list[end])
					return -1;
				else if(x < list[start])
					return list[start];
			}
			else
			{
				if(x < list[start])
					return x+1;
				else if(x > list[end])
					return list[end];
			}

			if(list[start] == x || list[end] == x) return x;

			if(end-start<=1)
			{
				if(bigger)
					return list[end];
				else
					return list[start];
			}

			int hf = (start + end)/2;
			if(list[hf] <= x)
			{
				return binarySearch(list, x, hf, end, bigger);
			}
			else
			{
				return binarySearch(list, x, start, hf, bigger);
			}
		}
	}
}


Measured memory_bytes: 23500
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n,i,ar[100010],sum,a,b;
    cin>>n;
    for(i=1;i<=n;i++)
        cin>>ar[i];
    sum=0;
    a=0;
    for(i=1;i<=n;i++)
    {
        sum+=ar[i];
        if(i%2==1)
        {
            if(sum>0)
                continue;
            if(sum==0)
                a++;
            else if(sum<0)
                a+=1-sum;
            sum=1;
        }
        else
        {
            if(sum<0)
                continue;
            if(sum==0)
                a++;
            else if(sum>0)
                a+=sum+1;
            sum=-1;
        }
    }
    b=0;
    sum=0;
    for(i=1;i<=n;i++)
    {
        sum+=ar[i];
        if(i%2==1)
        {
            if(sum<0)
                continue;
            if(sum==0)
                b++;
            else if(sum>0)
                b+=sum+1;
            sum=-1;
        }
        else
        {
            if(sum>0)
                continue;
            if(sum==0)
                b++;
            else if(sum<0)
                b+=1-sum;
            sum=1;
        }
    }
    cout<<min(a,b)<<endl;
}


Measured memory_bytes: 1024
#include<iostream> 
#include<vector>  
#include<string>
using namespace std;
int main()
{
	string a; 
	cin >> a;   
	for (int i = 0; i < 3; i++)
	{


		if (a.at(i)=='1')
		{
			a.at(i) = '9';
		} 
		else if (a.at(i)=='9')
		{
			a.at(i) = '1';
		}
	}
	cout << a << "\n";

}

Measured memory_bytes: 256
import java.util.*;
import static java.lang.System.*;
import java.math.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int g = n / 2;
		double ans = (double)(n-g) / n;
		out.println(ans);

		
	}
}

Measured memory_bytes: 21716
p=[]
s=input()
for i in range(2**(len(s)-1)):
    k=s[:]
    d=bin(i)[2:]
    d="0"*(len(s)-len(d)-1)+d
    c=s[0]
    for i in range(len(s)-1):
        if d[i]!="0":
            c+="+"+s[i+1]
        else:
            c+=s[i+1]
    else:
        p.append(eval(c))
print(sum(p))

Measured memory_bytes: 3064
#include <cstdio>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <bitset>
#include <climits>
#include <utility>
#include <cstdlib>
#include <algorithm>
#include <iostream>
#define REP(i,n) for(int (i)=0;i<(int)(n);++(i))
#define REPIT(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
#define PB push_back
#define FT first
#define SD second
#define ZERO(x) memset(x,0,sizeof(x))
#define NEG(x) memset(x,-1,sizeof(x))
#define RI(x) scanf("%d",&(x))
#define RII(x,y) scanf("%d%d",&(x),&(y))
#define RIII(x,y,z) scanf("%d%d%d",&(x),&(y),&(z))
#define OIII(x,y,z) printf("%d %d %d\n",(x),(y),(z))
#define OII(x,y) printf("%d %d\n",(x),(y))
#define OI(x) printf("%d\n",(x))
#define OL(x) cout<<(x)<<endl
#define OLL(x,y) cout<<(x)<<" "<<(y)<<endl
#define OLLL(x,y,z) cout<<(x)<<" "<<(y)<<" "<<(z)<<endl
#define RS(s) scanf("%s",(s))
#define MP(x,y) make_pair((x),(y))
#define SZ(x) ((int)(x).size())
#define FIN(f) freopen(f,"r",stdin)
#define FOUT(f) freopen(f,"w",stdout)
typedef long long LL;
using namespace std;
typedef pair<int,int> PII;
const int MOD = 1e9+7;
const int maxn = 222222;
int main(int argc, char const *argv[])
{
    int a,b;
    cin>>a>>b;
    if(a<=0 && b>=0)puts("Zero");
    else if(a<0 && b<0 && (b-a + 1)%2==1)puts("Negative");
    else puts("Positive");
    return 0;
}

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

using LL = long long;

int main()
{
    LL n, k;
    cin >> n >> k;

    if (n % k == 0)
        cout << 0 << endl;
    else
    {
        n %= k;
        cout << min(n, k - n) << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <wchar.h>
#include <string.h>
#include <stdint.h>
#include <inttypes.h>
#define MAX(a, b) ((a > b) ? a : b)
static void countNumOfAlphabet(const uint32_t N, const char * S, uint32_t *counter) {
	for (uint32_t idx = 0; idx < N; idx++) {
		counter[S[idx] - 'a']++;
	}
}
static uint32_t countSameAlphabet(const uint32_t * const left, const uint32_t * const right) {
	uint32_t sameCount = 0;
	for (uint32_t idx = 0; idx < 26; idx++) {
		if (left[idx] > 0 && right[idx] > 0) {
			sameCount++;
		}
	}
	return sameCount;
}
int main(void) {
	uint32_t N; 
	char S[101];
	uint32_t max = 0;
	scanf("%"PRIu32"\n%s", &N, &S);
	uint32_t leftCount[26];
	uint32_t rightCount[26];
	for (uint32_t idx = 0; idx < 26; idx++) {
		leftCount[idx] = 0;
		rightCount[idx] = 0;
	}
	countNumOfAlphabet(N, S, rightCount);
	for (uint32_t cutPos = 0; cutPos < N - 1; cutPos++) {
		rightCount[S[cutPos] - 'a']--;
		leftCount[S[cutPos] - 'a']++;
		const uint32_t sameCount = countSameAlphabet(leftCount, rightCount);
		if (sameCount > max) {
			max = sameCount;
		}
	}
	printf("%"PRIu32, max);
	return 0;
}

Measured memory_bytes: 128
#include<stdio.h>
#define N 60
#define M 10000

int main(void){
  int i,n,j,c;
  char v,hoge,co1,co2;
  int cur,front[M],ria[M];
  char train[M][N];

  scanf("%d",&n);
  scanf("%c",&hoge);
  for(i=0;i<n;i++){
    front[i]=30;
    ria[i]=30;
    cur=30;
    for(;;){
      scanf("%c",&v);
      train[i][cur]=v;
      scanf("%c",&co1);
      if(co1=='\n')
        break;
      scanf("%c",&co2);
      if(co1=='-'){
        cur++;
        if(cur>ria[i])
          ria[i]=cur;
      }else if(co1=='<'){
        cur--;
        if(cur<front[i])
          front[i]=cur;
      }
    }
  }
  for(i=0;i<n;i++){
    for(j=front[i];j<=ria[i];j++){
      printf("%c",train[i][j]);
    }
    printf("\n");
  }
  return 0;
}

Measured memory_bytes: 0
#include<iostream>
using namespace std;
int main(){
  int n;string s;cin>>n>>s;
  int k(0);
  for(int i=0;i<n-2;i++){
  if(s[i]=='A' and s[i+1]=='B' and s[i+2]=='C')
    k++;
  }
  cout<<k<<endl;
}

Measured memory_bytes: 3628
#include<stdio.h>
#include<string.h>
#define LEN 100005

typedef struct pp{
	char name[100];
	int time;
}P;

P Q[LEN];

int head, tail, n;

void enqueue(P x)
{
	Q[tail] = x;
	tail = (tail + 1) % LEN;
}

P dequeue(){
	P x = Q[head];
	head = (head + 1) % LEN;
	return x;
}

int min(int a, int b)
{
	return a < b ? a : b;
}

int main (void)
{
	int elaps = 0, c;
	int i, q;
	P u;
	scanf("%d %d", &n, &q);
	
	for(i = 1; i <= n; i++)
	{
		scanf("%s", &Q[i].name);
		scanf("%d", &Q[i].time);
	}
	
	head = 1;
	tail = n + 1;
	
	while(head != tail){
		u = dequeue();
		c = min(q, u.time);
		u.time = u.time - c;
		elaps = elaps + c;
		if(u.time > 0)
		{
			enqueue(u);
		}
		else
		{
			printf("%s %d\n", u.name, elaps);
		}
	}
	
	return 0;
}


Measured memory_bytes: 11872
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <bitset>
#include <deque>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <iterator>
#include <string>
const long INF = 1000000009;

int n;
bool flag[26];

int main(){
	scanf("%d", &n);
	int ans = 0;
	for(int i = 0; i < n; i++){
	//printf("pass\n");
		char c;
		scanf("%*c%c", &c);
		if(!flag[c-'A']){
			ans++;
			flag[c-'A'] = true;
		}
	}
	if(ans == 3){
		printf("Three\n");
	}else{
		printf("Four\n");
	}
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
const int N=2e5+10;
int a[N];
map <int,int>mp;
string s;
int main()
{
    long long  n;
    cin>>n;
    if(n==1) {
        cout<<0<<endl;
        return 0;
    }
    int cou=0;
    int n1=n;
    for(long long  i=2;i*i<=n;i++){
        if(n%i==0){
            while(n%i==0){
                a[cou]++;
                n/=i;
            }
            cou++;
        }
    }

    if(cou==0){
        cout<<1<<endl;
        return 0;
    }
    int ans=0;
    for(int i=0;i<cou;i++){
        int sum=1;
        int ans1=0;
        while(a[i]>=sum){
            ans1++;
            a[i]-=sum;
            sum++;
        }
        ans+=ans1;
    }
    if(n>1) ans++;
    cout<<ans<<endl;
}


Measured memory_bytes: 3612
#include <stdio.h>
#define mod 1000000007

int pm(int x, long long y);

int main(void){
  long long n;
  scanf("%lld", &n);

  long long a = pm(10,n); 
  long long b = pm(9,n);
  long long c = pm(8,n); 


  long long ans = a - b - b + c;

  ans %= mod;

  ans = (ans + mod) % mod;

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

  return 0;
}

int pm(int x, long long y){
  long long a = 1;
  for(int i = 0; i < y; i++){
    a *= x;
    a %= mod;
  }
  return a;
}

Measured memory_bytes: 1704
<?php
$a = (int)trim(fgets(STDIN));

$hp = $a;
$count = 0;
while ($hp > 1) {
    $hp = floor($hp / 2);
    $count += 1;
}

$ans = 0;

for ($i = 0; $i < $count + 1; $i++) {
    $ans += 2 ** $i;
}

echo $ans;


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

#define sswap(x, y) { x+=y; y=x-y; x-=y; }
#define LSOne(S) ((S) & (-S))

#define EPS 1e-6
#define MOD 1000000007

#define fi first
#define se second
#define pb push_back
#define ende '\n'

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define mset(x, y) memset(&x, (y), sizeof(x))

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

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
	int a, b, c, k;
	cin >> a >> b >> c >> k;
	//cout << min(a, k) - (k - a > 0 ? min(min(k-a-b, 0), c) : 0) << ende;
	cout << min(a, k) - (a < k ? (a+b < k ? k-a-b : 0) : 0) << ende;
  return 0;
}


Measured memory_bytes: 3620
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<numeric>

#define reps(i, j, k) for (int i = (j); i < (k); i++)
#define rep(i, j) reps(i, 0, j)
#define fs first
#define sc second
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front

using namespace std;

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

const int mod = 1e9 + 7;
const long double pi = 3.141592653589793238462643383279502884197;
const long double eps = 1e-7;

int main() {
	int N;
	vi T;
	
	cin >> N;

	rep(i, N - 1) {
		int c, s, f;
		cin >> c >> s >> f;

		T.pub(s + c);
		if (i != 0) {
			rep(j, i) {
				int buf = s;
				while (buf < T[j]) {
					buf += f;
				}
				T[j] = buf + c;
			}
		}

	}
	T.pub(0);

	rep(i, N) {
		cout << T[i] << endl;
	}

	return 0;
}

Measured memory_bytes: 256
t[9999][9999],j;main(p,W,a,b,c){
for(;scanf("%d",&W),W;printf("Case %d:\n%d\n%d\n",p++,t[0][W],j)){
		for(scanf("%d",&c);c&&scanf("%d,%d",&b,&a);c--)for(j=0;j<=W;j++)t[c-1][j]=(j<a)?t[c][j]:(t[c][j]>t[c][j-a]+b)?t[c][j]:(t[c][j-a]+b);
		for(j=0;t[0][j]!=t[0][W];j++);
	}
} 

Measured memory_bytes: 0
//ヘッダー
#include<bits/stdc++.h>
using namespace std;

//型定義
typedef long long ll;

//定数
const ll INF=1e+18;
const int MOD=1e+9+7;

//REPマクロ
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define REP2(i,a,b) for(ll i=a;i<(ll)(b);i++)
#define REPD2(i,a,b) for(ll i=a;i>(ll)(b);i--)

// 多次元 vector 生成
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...));
}

//vectorの扱い
#define ALL(x) (x).begin(),(x).end() //sortなどの引数省略
#define SIZE(x) ((ll)(x).size()) //size
#define MAX(x) *max_element(ALL(x)) //最大値
#define MIN(x) *min_element(ALL(x)) //最小値

int main(){
    ll X,K,D;
    cin>>X>>K>>D;
    X=abs(X);
    ll ans;
    ll k1=(X-1)/D;
    k1++;
    ll k2=k1-1;
    if(k2>K){
        ans=X-K*D;
    }else if(k1>K){
        ans=abs(X-k2*D);
    }else{
        if((K-k2)%2==0){
            ans=abs(X-k2*D);
        }else{
            ans=abs(k1*D-X);
        }
        
    }

    cout<<ans<<endl;
}

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

const int MAX_N = 5005;

int dp[5005][5005]={0};

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

    for(int i=n-1;i>=0;i--){
        for(int j=n-1;j>=0;j--){
            if(s[i]==s[j]) dp[i][j] = min(dp[i+1][j+1]+1, abs(i-j));
        }
    }

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

    cout << ans << endl;
}

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

using namespace std;
using ll = long long;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N;
  cin >> N;
  int sum = 0, maxn = 0;
  for (int i = 0; i < N; i++) {
    int l;
    cin >> l;
    sum += l;
    maxn = max(maxn, l);
  }
  cout << (sum - maxn > maxn ? "Yes" : "No") << '\n';
  return 0;
}


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

#define MOD 1000000007
#define ll long long
#define ld long double
#define FOR(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end())
#define rmvector(a,b) rep(i,a.size())rep(j,b.size())if(a[i]==b[j]){a.erase(a.begin()+i);i--;break;}
template<typename X> bool exist(vector<X> vec, X item){return find(all(vec), item)!=vec.end();}
ll gcd(ll a, ll b){if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a, ll b){return a/gcd(a,b)*b;}


ll cal(ll a){
  ll ans = 0;
  while(a!=0){
    ans += (a%10);
    a /= 10;
  }
  return ans;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  
  ll N , A, B ; cin >> N >> A >> B ;
  ll ans  = 0 ; 
  rep(i,N+1){
    ll s = cal(i);
    if((A<=s) && (s<=B)) ans += i ; 
  }

  cout << ans << endl;
  
  
  //cout << fixed << setprecision(16) << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(void)
{
	int x[5];
	cin>>x[0]>>x[1]>>x[2]>>x[3]>>x[4];
	for(int i=0;i<5;i++)
	{
		if(x[i]==0){
			cout<<i+1<<endl;
			break;
		}
	}
}

Measured memory_bytes: 3564
#include<bits/stdc++.h>
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3f
#define EPS (1e-10)
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef pair<int, int>P;

signed main() {
	int n; scanf("%d", &n);
	deque<int>v;
	if (n % 2 == 0) {
		rep(i, n) {
			int a; scanf("%d", &a);
			if (i % 2 == 1)v.push_front(a);
			else v.push_back(a);
		}
	}
	else {
		rep(i, n) {
			int a; scanf("%d", &a);
			if (i % 2 == 1)v.push_back(a);
			else v.push_front(a);
		}
	}
	rep(i, n) {
		if (i)printf(" ");
		printf("%d", v[i]);
	}
	puts("");
}

Measured memory_bytes: 2944
#include<cstdio>

int a, b;

int solve(int n);
int sum(int n);

int main(void){
	int n;

	scanf("%d %d %d", &n, &a, &b);

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

	return 0;
}

int solve(int n){
	if(!n){
		return 0;
	}

	int x = sum(n);

	if(x >= a && x <= b){
		return n + solve(n - 1);
	}

	return solve(n - 1);
}

int sum(int n){
	return n / 10000 + n % 10000 / 1000 + n % 1000 / 100 + n % 100 / 10 + n % 10;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define RI register int
typedef long long LL;

using namespace std;

char buf[1000000], *p1 = buf, *p2 = buf;
inline char gc() {
  if (p1 == p2) p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin);
  return p1 == p2 ? EOF : *(p1++);
}
template <class T> inline void read(T &n) {
  n = 0; RI ch = gc(), f;
  while ((ch < '0' || ch > '9') && ch != '-') ch = gc();
  f = (ch == '-' ? ch = gc(), -1 : 1);
  while (ch >= '0' && ch <= '9') n = n * 10 + (ch ^ 48), ch = gc();
  n *= f;
}

LL const mod = 1e9 + 7;
int const MAXN = 2e5 + 5;
struct Edges { int to, next; } e[MAXN * 2];
int head[MAXN], tot;
int n, size[MAXN];
LL Bin[MAXN], ans;

inline void addedge(int from, int to) {
  e[++tot] = (Edges){to, head[from]};
  head[from] = tot;
  e[++tot] = (Edges){from, head[to]};
  head[to] = tot;
}

inline LL qpow(LL a, LL k) {
  LL re = 1;
  for (; k; k >>= 1, a = a * a % mod)
    if (k & 1) re = re * a % mod;
  return re;
}

void Dfs(int now, int fa) {
  size[now] = 1;
  for (RI i = head[now]; i; i = e[i].next)
    if (e[i].to != fa) {
      Dfs(e[i].to, now);
      (ans -= Bin[size[e[i].to]] - 1) %= mod;
      size[now] += size[e[i].to];
    }
  (ans -= Bin[n - size[now]] - 1) %= mod;
  ans += Bin[n - 1] - 1;
}

int main() {
  
  read(n);
  Bin[0] = 1;
  for (RI i = 1; i <= n; ++i)
    Bin[i] = Bin[i - 1] * 2 % mod;
  for (RI i = 1, x, y; i < n; ++i)
    read(x), read(y), addedge(x, y);
  Dfs(1, 0);
  printf("%lld\n", (ans + mod) % mod * qpow(qpow(2, n), mod - 2) % mod);
  
  return 0;
}



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

int q;
long long a, b;

int main()
{
	scanf("%d", &q);
	while(q--)
	{
		scanf("%lld%lld", &a, &b);
		long long temp=sqrt(a*b);
		if(temp*temp==a*b)
		{
			if(a==b)
			{
				printf("%d\n", temp*2-2);
				continue;
			}
			else 
			{
				printf("%d\n", temp*2-3);
				continue;
			}
		}
		if(temp*(temp+1)>=a*b) printf("%d\n", temp*2-2);
		else printf("%d\n", temp*2-1);
	}
}

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

#define MP make_pair
#define PB push_back
#define ALL(x)      (x).begin(),(x).end()
#define REP(i,n)    for(int i=0;i<(n);i++)
#define REP1(i,n)   for(int i=1;i<(n);i++)
#define REP2(i,d,n) for(int i=(d);i<(n);i++)
#define RREP(i,n)   for(int i=(n);i>=0;i--)
#define CLR(a)      memset((a),0,sizeof(a))
#define MCLR(a)     memset((a),-1,sizeof(a))
#define RANGE(x,y,maxX,maxY) (0 <= (x) && 0 <= (y) && (x) < (maxX) && (y) < (maxY))

typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI > VVI;
typedef vector<string> VS;
typedef vector<LL> VLL;
typedef pair<int,int> PII;

const int INF = 0x3f3f3f3f;
const LL INFL = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-9;

const int DX[]={1,0,-1,0},DY[]={0,-1,0,1};

int main(){
    int N, M;
    cin >> N >> M;
    VI split(N, INF);

    REP(i, M){
        int a,b;
        cin >> a >> b;
        split[a-1] = min(split[a-1], b-1);
    }

    int min_target = INF;
    int ans = 0;
    REP(i, N){
        if(i == min_target){
            ans++;
            min_target = INF;
        }
        min_target = min(min_target, split[i]);
    }
    cout << ans << endl;
}



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

step = []
sum = 0

for i in range(int(N) -1):
  if A[i] > A[i+1]:
    n = A[i] - A[i+1]
    A[i+1] = A[i+1] + n
    step.append(n)
  
for i in step:
  sum = sum + i

print(sum)

Measured memory_bytes: 32148
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using VI = vector<int>;
using VL = vector<ll>;
#define FOR(i,a,n) for(int (i)=(a);(i)<(n);(i)++)
#define eFOR(i,a,n) for(int (i)=(a);(i)<=(n);(i)++)
#define SORT(i) sort((i).begin(),(i).end())
#define rSORT(i,a) sort((i).begin(),(i).end(),(a))
constexpr ll INF = 1000000000;
constexpr ll LLINF = 1LL << 60;
constexpr ll mod = 1000000007;
constexpr ll MOD = 998244353;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; }return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; }return 0; }
inline void init() { cout.tie(nullptr); cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); }

int main() {
    init();

    int n, k;
    cin >> n >> k;

    if (k > (n - 1) * (n - 2) / 2) {
        cout << "-1\n";
        return 0;
    }

    vector<pair<int,int>> s;
    eFOR(i, 2, n)eFOR(j, i + 1, n)s.push_back({ i,j });
    cout << n * (n - 1) / 2 - k << "\n";
    eFOR(i, 2, n)cout << "1 " << i << "\n";
    FOR(i, 0, (n - 1) * (n - 2) / 2 - k)cout << s[i].first << " " << s[i].second << "\n";
}


Measured memory_bytes: 384
package main

import (
        "fmt"
)

func solution(a, b string) string {
        if len(a) > len(b) {
                return "GREATER"
        }
        if len(a) < len(b) {
                return "LESS"
        }
        if a > b {
                return "GREATER"
        }
        if a == b {
                return "EQUAL"
        }
        return "LESS"
}

func main() {
        var a, b string
        fmt.Scan(&a, &b)
        fmt.Println(solution(a, b))
}

Measured memory_bytes: 512
n = gets.to_i
p_org = gets.split.map(&:to_i)
flg = false

n.times do |i|
  n.times do |j|
    p = p_org.dup
    p[i], p[j] = p[j], p[i]
    if p == p_org.sort
      flg = true
      break
    end
  end
end

puts flg ? 'YES' : 'NO'

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

void solve() {
  int n; cin >> n;
  int ans = 0, cnt = 0;
  while(n--) {
    int a, b; cin >> a >> b;
    if(cnt < a) {
      cnt = a;
      ans = a + b;
    }
  }
  cout << ans << endl;
}

signed main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  solve();
  return 0;
}


Measured memory_bytes: 3624
from collections import Counter
n = int(input())
X = input()
preC = Counter(X)
preS = set(X)
for _ in range(n - 1):
    X = input()
    C = Counter(X)
    preS = set(X) & preS
    d = {}
    for s in preS:
        d[s] = min(C[s], preC[s])
    preC = d
ans = []
for s in preS:
    for _ in range(preC[s]):
        ans.append(s)
print("".join(sorted(ans)))

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

typedef long long ll;
using namespace std;
int main()
{
//ll SUN, MON, TUE, WED, THU, FRI, SAT;
string s;
cin>>s;
if(s=="SUN") cout<<7<<endl;
if(s=="MON") cout<<6<<endl;
if(s=="TUE") cout<<5<<endl;
if(s=="WED") cout<<4<<endl;
if(s=="THU") cout<<3<<endl;
if(s=="FRI") cout<<2<<endl;
if(s=="SAT") cout<<1<<endl;
}


Measured memory_bytes: 3572
def acinput():
    return list(map(int, input().split(" ")))


N=int(input())
A=acinput()

x=list(zip(A,range(1,N+1)))

x=sorted(x,key=lambda x:x[0])
res=list(map(lambda y:str(y[1]),x))
print(" ".join(res))



Measured memory_bytes: 25916
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
// Welcome to my source code!

int main() {
    string s;
    cin >> s;
    bool flag = false;
    if (s[0] == '7' || s[1] == '7' || s[2] == '7') flag = true;
    if (flag) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 3636
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            int a = int.Parse(Console.ReadLine());
            string s = Console.ReadLine();
            if(a >= 3200)
            {
                Console.WriteLine(s);
            }
            else
            {
                Console.WriteLine("red");
            }

        }
    }
}


Measured memory_bytes: 11092
#include <stdio.h>

int main() {
	int x, y;
	int temp;

	while (1) {
		scanf("%d %d", &x, &y);

		if (x == 0 && y == 0) {
			break;
		}

		if (x > y) {
			temp = x;
			x = y;
			y = temp;
		}

		printf("%d %d\n" ,x ,y);
	}

	return 0;
}


Measured memory_bytes: 2036
#include<stdio.h>
#include<string.h>
  
#define N 3
#define L 32
#define H 362897
  
struct dep {
    int depth, key;
};
  
int ans[N][N] = {
    {1, 2, 3},
    {4, 5, 6},
    {7, 8, 0}};
  
int min = L;
struct dep h[H];
  
int hash1(int k) {
    return k % H;
}

int hash2(int k) {
    return 1 + k % (H-1);
}

int hash(int k, int i) {
    return (hash1(k) + i * hash2(k)) % H;
}
  
void dfs(int p[N][N], int n) {
    int i, j, i1, j1, a = 0, b = 1;
    int f = 0;
    int tmp[N][N];
    for (i=0;i<N;i++) {
        for (j = 0; j<N; j++) {
            if (ans[i][j] != p[i][j]) f++;
            if(p[i][j] == 0) {
                i1 = i;
                j1 = j;
            }
            a += p[i][j] * b;
            b *= 10;
        }
    }

    if (f == 0) {
        if(min >= n) {
            min = n;
        }
        return;
    }
    if(n > min) return;
    i = 0;
    while(1) {
        b = hash(a, i);
        if (h[b].key == 0) {
            h[b].key = a;
            h[b].depth = n;
            break;
        }
        else if (h[b].key == a) {
            if (h[b].depth > n) {
                h[b].depth = n;
                break;
            }
            else return;
        }
        i++;
    }
      
    if(i1 > 0 && i1 < N) {
        memcpy(tmp, p, sizeof(int) * N * N);
        f = tmp[i1][j1];
        tmp[i1][j1] = tmp[i1 - 1][j1];
        tmp[i1 - 1][j1] = f;
        dfs(tmp, n + 1);
    }
    if(j1 > 0 && j1 < N) {
        memcpy(tmp, p, sizeof(int) * N * N);
        f = tmp[i1][j1];
        tmp[i1][j1] = tmp[i1][j1 - 1];
        tmp[i1][j1 - 1] = f;
        dfs(tmp, n + 1);
    }
      
    if(i1 >= 0 && i1 < N - 1) {
        memcpy(tmp, p, sizeof(int) * N * N);
        f = tmp[i1][j1];
        tmp[i1][j1] = tmp[i1 + 1][j1];
        tmp[i1 + 1][j1] = f;
        dfs(tmp, n + 1);
    }
    if(j1 >= 0 && j1 < N - 1) {
        memcpy(tmp, p, sizeof(int) * N * N);
        f = tmp[i1][j1];
        tmp[i1][j1] = tmp[i1][j1 + 1];
        tmp[i1][j1 + 1] = f;
        dfs(tmp, n + 1);
    }
}
  
int main(void)
{
    int i, j;
    int p[N][N];
      
    for (i = 0; i < N; i++) {
        for (j = 0; j < N; j++) {
            scanf("%d", &p[i][j]);
        }
    }
    dfs(p, 0);
      
    printf("%d\n", min);
      
    return 0;
}








Measured memory_bytes: 4692
li = []

li.append(list(map(int,input().split())))
li.append(list(map(int,input().split())))
li.append(list(map(int,input().split())))

ans = 'Yes'

for a0 in range(li[0][0] + 1):
  b0 = li[0][0] - a0
  b1 = li[1][0] - a0
  b2 = li[2][0] - a0

  a1 = li[0][1] - b0
  a2 = li[0][2] - b0

  if li[0][0] != a0 + b0:
    ans = 'No'
  
  if li[0][1] != a1 + b0:
    ans = 'No'

  if li[0][2] != a2 + b0:
    ans = 'No'

  if li[1][0] != a0 + b1:
    ans = 'No'

  if li[1][1] != a1 + b1:
    ans = 'No'

  if li[1][2] != a2 + b1:
    ans = 'No'

  if li[2][0] != a0 + b2:
    ans = 'No'

  if li[2][1] != a1 + b2:
    ans = 'No'

  if li[2][2] != a2 + b2:
    ans = 'No'

print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
int main(){
    int t;

    long long int a;int c,d;char e;
    cin>>a>>c;
    cin>>e>>d;
    //cout<<c<<"a a"<<d;
    long long int f=a*int(c)+a*d/100;
    cout<<f<<endl;
    return 0;

}

Measured memory_bytes: 3592
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define INF (1LL<<50)
#define MOD 1000000007

int main(){
    int X;
    cin >> X;
    if(X>=30){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 3544
fun main(args: Array<String>) {

    val n = readLine()!!
    val array = readLine()!!.split(" ")
    val t = array[0].toInt()
    val abs = array[1].toInt()

    val list = readLine()!!.split(" ").map(String::toInt)

    var result: Pair<Int, Int> = Pair(1, Int.MAX_VALUE)

    for ((index, value) in list.withIndex()) {

        // 気温を求める
        // 頭悪くて演算ができていなさそう・・・
        // 落ち着いて考える。やはり絶対値しないと10と15は距離5なのに??
        // 2値の差は減算した後に絶対値を適用すればOK!!
        // 正値は通常計算、負値は反転して差分になり、前後逆転は絶対値で補正
        // 10 - 0 -> 10
        // 10 - 5 -> 5
        // 10 - (-2) -> 12
        // 10 - 15 -> -5 ...NG
        val x = t * 1000 - value * 6
        var sub = abs * 1000 - x
      if (sub < 0)
      	sub *= -1

        if (sub < result.second)
            result = Pair(index + 1, sub)
    }
    println(result.first)
}

Measured memory_bytes: 37736
#include<cmath>
#include<cstdio>
#include<vector>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int pl[5050],g[5050],a[5050];
long long f[5050][5050];
void mn(long long &x,long long y)
{
	x=min(x,y);
}
int main()
{
	int tmp,n,i,j,A,B;
	long long ans;
	scanf("%d%d%d",&n,&A,&B);
	for(i=1;i<=n;i++)
		scanf("%d",&a[i]);
	for(i=1;i<=n;i++)
	{
		pl[a[i]]=i;
		for(j=i-1;j;j--)
			if(a[j]>a[i])
				g[i]++;
	}
	for(i=1;i<=n;i++)
		for(j=0;j<=n;j++)
			f[i][j]=1e18;
	f[0][0]=0; 
	for(i=0;i<n;i++)
	{
		tmp=pl[i+1];
		for(j=0;j<=n;j++)
		{
			if(j>g[tmp])
				mn(f[i+1][j-1],f[i][j]+A);
			else
				mn(f[i+1][j],f[i][j]+B),mn(f[i+1][g[tmp]],f[i][j]);
		}
	}
	ans=1e18;
	for(i=0;i<=n;i++)
		mn(ans,f[n][i]);
	printf("%lld\n",ans);
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
 	return 0;
}


Measured memory_bytes: 198912
import java.util.*;
import static java.lang.Integer.*;
//import static java.lang.Long.*;
//import static java.lang.Math.*;
import static java.lang.Math.*;
import static java.lang.System.*;

public class Main {
	public static void main(String[] args) {
		int i, j, k;
		Scanner sc = new Scanner(in);
		int n = parseInt(sc.next());
		int[] x = new int[n];
		int[] y = new int[n];
		int[] h = new int[n];
		int ii = 0;
		for(i = 0; i < n; i++) {
			x[i] = parseInt(sc.next());  
			y[i] = parseInt(sc.next());  
			h[i] = parseInt(sc.next());  
			if(h[i]>0) ii = i;
		}
		sc.close();
		int hh, hh0;
		int max=0;
		int mx = 0;
		int my = 0;
		for (int cx = 0; cx <= 100; cx++) {
			for (int cy = 0; cy <= 100; cy++) {
				boolean f = true; 
				hh0 = abs(x[ii]-cx) + abs(y[ii]-cy) + h[ii];
				for (i=0; i < n; i++) {
					if(h[i]>0) {
						hh = abs(x[i]-cx) + abs(y[i]-cy) + h[i];
						if(hh0 != hh) {
							f = false;
							break;
						}
					} else {
						if(hh0 - abs(x[i]-cx) - abs(y[i]-cy) > 0) {
							f = false;
							break;
						}
					}
				}
				if(f) {
					if(max < hh0) {
						max = hh0;
						mx = cx;
						my = cy;
					}
				}
			}
		}
		out.printf("%d %d %d%n", mx, my, max);
	}
}

Measured memory_bytes: 23252
#include <bits/stdc++.h>
#define all(x) x.begin(),x.end()
#define ll long long
#define pii pair<int,int>
#define sz(x) (int) x.size()
#define f first
#define s second
using namespace std;
const int N=1e2+2;
const int M=1e8;
ll dp[N][N][12][12];
int n1,n2,k1,k2;
signed main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    ll n;
    n=5;
//    cin>>n;
    ll x;
    for(int i=0;i<n;i++){
        cin>>x;
        if(x!=(i+1)){
            cout<<i+1;
            return 0;
        }
    }
    return 0;
}
// abcd


Measured memory_bytes: 3584
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define stoi stoll
using pii=pair<int,int>;
#define all(c) begin(c),end(c)
#define rall(c) rbegin(c),rend(c)
#define fore(x,c) for(auto &&x:c)
#define rep(i,a,n) for(int i=a,i##len=(int)(n);i<i##len;++i)
#define rrep(i,n) for(int i=(int)(n);i>=0;--i)
#define sz(c) ((int)c.size())
#define contains(c,x) (c.find(x)!=end(c))
#define inseg(l,x,r) ((l)<=(x)&&(x)<(r))
#define dump(...)
#define pb push_back
#define _ 0
const signed INF_=1001001001; const long long INF=1001001001001001001LL;
const int DX[9]={0,1,0,-1,1,1,-1,-1,0},DY[9]={-1,0,1,0,-1,1,1,-1,0};
template<class T> ostream& operator<<(ostream &os,const vector<T> &v) {
    for (auto i = begin(v); i != end(v); i++) os<<*i<<(i==end(v)-1?"":" ");return os;}
template<class T> istream& operator>>(istream &is,vector<T> &v) {
    for (auto i = begin(v); i != end(v); i++) is>>*i;return is;}
template<class T,class U> istream& operator>>(istream &is, pair<T,U> &p) {
    is>>p.first>>p.second;return is;}
template<class T, class U> bool chmax(T &a,const U &b){return a<b?a=b,1:0;}
template<class T, class U> bool chmin(T &a,const U &b){return a>b?a=b,1:0;}
template <class T> void psum(T& c) {partial_sum(begin(c), end(c), begin(c));}
template<class T> using heap=priority_queue<T,vector<T>,greater<T>>;
struct before_main_function {
    before_main_function() {
        cin.tie(0); ios::sync_with_stdio(0);
        cout << setprecision(15) << fixed;
        // #define endl "\n"
    }
} before_main_function;
//------------------8<------------------------------------8<--------------------
 
signed main() {
    vector<int> a(5);
    cin >> a;
		int sum=0, temp=10;
		for(int e: a) {
			if (e%10 < temp && e%10 != 0) temp = e%10;
			sum += ((e-1)/10+1)*10;
		}
		cout << sum-10+temp << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
	string n;
	cin>>n;
	int l=n.length();
	cout<<n;
	if(n[l-1]=='s')
	{
		cout<<"es"<<endl;
	}
	else
	{
		cout<<"s"<<endl;
	}
	return 0;
}

Measured memory_bytes: 3620
def main():
    n = int(input())
    s = input()
    x = 0
    max_num = 0

    for str in s:
        if str == 'I':
            x += 1
        else:
            x -= 1
        max_num = max(x, max_num)

    print(max_num)


if __name__ == "__main__":

    main()


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

using i64 = long long int;

struct Edge{
    i64 from, to, cost;
};

struct State{
    i64 num, cost;
};

i64 mini[100005];

int main(){
    int n;
    cin >> n;
    vector<vector<Edge>> graph(n+1, vector<Edge>());
    for(int i=0;i<n-1;++i){
        i64 a, b, c;
        cin >> a >> b >> c;
        graph[a].push_back((Edge){a,b,c});
        graph[b].push_back((Edge){b,a,c});
    }

    int q, k;
    cin >> q >> k;

    for(int i=1;i<=n;++i)mini[i] = LLONG_MAX;
    mini[k] = 0;
    queue<State> que;
    que.push((State){k, 0});
    while(!que.empty()){
        State curr = que.front(); que.pop();
        for(auto e : graph[curr.num]){
            if(curr.cost + e.cost < mini[e.to]){
                mini[e.to] = curr.cost + e.cost;
                que.push((State){e.to, curr.cost + e.cost});
            }
        }
    }

    for(int i=0;i<q;++i){
        int x, y;
        cin >> x >> y;
        cout << mini[x] + mini[y] << endl;
    }

    return 0;
}


Measured memory_bytes: 12080
#include<bits/stdc++.h>
using namespace std;
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<bool> col(8, false);
  int cnt = 0;
  for(int i = 0; i < n; i++){
    int a;
    cin >> a;
    if(a < 400) col[0] = true;
    else if(400 <= a && a < 800) col[1] = true;
    else if(800 <= a && a < 1200) col[2] = true;
    else if(1200 <= a && a < 1600) col[3] = true;
    else if(1600 <= a && a < 2000) col[4] = true;
    else if(2000 <= a && a < 2400) col[5] = true;
    else if(2400 <= a && a < 2800) col[6] = true;
    else if(2800 <= a && a < 3200) col[7] = true;
    else if(3200 <= a) cnt++;
  }
  int res = 0;
  for(int i = 0; i < 8; i++)
    if(col[i]) res++;
  cout << max(res, 1) << " " << res+cnt << endl;
  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

/**
 * Main
 */
public class Main {

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        
        long N = s.nextInt();
        long ans = (N * (N-1)) /2;

        System.out.println(ans);
        s.close();
    }
}

Measured memory_bytes: 21844