akhauriyash/Code-Regression huggingface dataset:
#if !defined(__clang__) && defined(__GNUC__)
#include <bits/stdc++.h>
#else
#include <cstdlib>
#include <climits>
#include <iostream>
#include <cstdint>
#include <vector>
#include <string>
#include <complex>
#include <bitset>
#include <queue>
#include <deque>
#include <stack>
#include <utility>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <regex>
#endif //  !defined(__clang__) && defined(__GNUG__)
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/multi_array.hpp>
#include <boost/optional.hpp>
#include <boost/math/common_factor_rt.hpp>

using namespace std;

int main()
{
    int N;
    std::cin >> N;

    if (N >= 1000) {
        std::cout << "ABD" << std::endl;
    }
    else {
        std::cout << "ABC" << std::endl;
    }

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <functional>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <cassert>
#include <exception>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<P> vp;
#define rep(i,a,n) for(ll i = (a);i < (n);i++)
#define per(i,a,n) for(ll i = (a);i > (n);i--)
#define lep(i,a,n) for(ll i = (a);i <= (n);i++)
#define pel(i,a,n) for(ll i = (a);i >= (n);i--)
#define clr(a,b) memset((a),(b),sizeof(a))
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(),(c).end()
#define sz size()
#define print(X) cout << (X) << endl
const ll INF = 1e+9+7;
ll n,m,l;
string s,t;
ll d[200010],dp[550][550];

int main(){
  cin >> n >> m;
  if(0 < n && n <= m)puts("Positive");
  else if(n <= m && m < 0){
    if((m - n + 1) % 2 == 0)puts("Positive");
    else puts("Negative");
  }else{
    puts("Zero");
  }
  return 0;
}

Measured memory_bytes: 256
n, a, b = map(int, input().strip().split())
s = input().strip()

domestic = 0
abroad = 0

for c in s:
    if c == 'a':
        if domestic + abroad < a + b:
            print('Yes')
            domestic += 1
        else:
            print('No')
    elif c == 'b':
        if domestic + abroad < a + b and abroad < b:
            print('Yes')
            abroad += 1
        else:
            print('No')
    else:
        print('No')


Measured memory_bytes: 4016
import itertools
n = int(input())
L = list(range(1, n + 1))
P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))
junretu = list(itertools.permutations(L))
junretu.sort()
a, b = 0, 0
for i, jun in enumerate(junretu):
    if P == jun:
        a = i
    if Q == jun:
        b = i
print(abs(a-b))

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

int main() {
  int a, b;
  cin >> a >> b;
  
  if ((a+b)%2 == 1) {
  	cout << "IMPOSSIBLE" << endl;
    return 0;
  }
  cout << (a+b)/2 << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(a) a.begin(), a.end()
using namespace std;
 
int N, K;

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string S;
  cin >> S >> K;
  N = S.length();
  set<string> st;
  for(int i=0; i<N; ++i){
    string s = "";
    for(int j=0; j<=5 && i+j < N; ++j){
      s += S[i+j]; 
      st.insert(s);
    }
  }
  for(auto it : st){
   if(K-1 == 0){
     cout << it << "\n";
     return 0;
   }
    --K;
  }
  return 0;
}



Measured memory_bytes: 2176
#include<iostream>
#include<vector>
#define rep(i,n) for(int i = 0; i < (n); i++)
using ll = long long;
using namespace std;

int main()
{
    int n, ans = 0;
    cin >> n;
    vector<ll>l(n);
    rep(i,n) cin >> l[i];
    if(n <= 2){
        cout << 0 << endl;
        return 0;
    }
    rep(i,n){
        for(int j = i + 1; j < n; j++){
            for(int k = j + 1; k < n; k++){
                if(l[i] != l[j] && l[i] != l[k] && l[j] != l[k]){
                    if(l[k] < l[j] + l[i] && l[j] < l[i] + l[k] && l[i] < l[k] + l[j]) ans++;
                }
            }
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3632
import sys
import heapq
from operator import itemgetter
from collections import deque, defaultdict
from bisect import bisect_left, bisect_right
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

def sol():
    N = int(input())
    A = list(map(int, input().split()))
    A.sort()

    sumA = sum(A)
    ans = 0
    for i in range(N)[:: -1]:
        sumA -= A[i]
        if sumA * 2 < A[i]:
            ans = N - i
            break
    print(ans)


sol()

Measured memory_bytes: 14700
#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <iomanip>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;


#define rep(i,n) for (int i=0; i<(n); i++)
const int INF =2*1e5+5;
const ll BIG = 1e9+7;
const double PI = 3.141592653589793;

int main(){
    int n, k;
    cin >> n >> k;
    vector<int> p(n);
    rep(i,n) cin >> p[i];
    sort(p.begin(), p.end());
    int money = 0;
    rep(i,k){
        money += p[i];
    }
    cout << money << endl;
    return 0;
}

Measured memory_bytes: 3620
N, M = [int(x) for x in input().split()]
a = sorted([int(x) for x in input().split()])
INF = 10**9

num = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]

keta = [-INF for _ in range(N+1)]
keta[0] = 0
for i in range(1, N+1):
    cand = [keta[i-num[aa]] for aa in a if i-num[aa] >= 0]
    if len(cand) > 0:
        keta[i] = max(cand) + 1

n = N
ans = ""
while n > 0:
    cand = [aa for aa in a if n-num[aa] >= 0 and keta[n]-1 == keta[n-num[aa]]]
    if len(cand) > 0:
        ans += str(cand[-1])    # ソートしてるので。
        n = n - num[cand[-1]]
print(ans)


Measured memory_bytes: 3316
while 1:
    b,r,g,c,s,t = list(map(int,input().split()))
    if t == 0:break

    cnt  = b * 5 + r * 3 + s #コイン不使用とするゲーム数
    coins = (b * 5 + r * 3) * (15-2)
    coins += b * 15
    coins += r * 15
    coins += 7 * g
    coins += 2 * c
    coins += 100 - (t - cnt) * 3

    print (coins)

Measured memory_bytes: 6720
'use strict'
function main(input) {
  const args = input.split('\n');
  const num = args.map(el => parseInt(el))
  const ans = [1, 2, 3]
  let out = ans.filter(el => el !== num[0])
  out = out.find(el => el !== num[1])
  console.log(out)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 7372
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <list>
#include <ctime>
#include <sstream>
#include <queue>
#include <stack>
#include <bitset>
#include <numeric>
#include <cassert>
using namespace std;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;
#define FOR(x, b, e) for(int x=(b); x<=(e); ++x)
#define FORD(x, b, e) for(int x=((int)(b))-1; x>=(e); --x)
#define REP(x, n) for(int x=0; x<(n); ++x)
#define ALL(c) c.begin(),c.end()
#define sz(x) ((int)((x).size()))
#define pb push_back
#define st first
#define nd second
#define mp(x,y) make_pair(x,y)
typedef short int sint;

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

int main() {
	ios_base::sync_with_stdio(false);

	int n;
	cin >> n;
	map<string, int> cnt;
	REP(i, n) {
		string x;
		cin >> x;
		++cnt[x];
	}
	int najw = 0;
	for (auto elem : cnt) {
		if (elem.nd > najw) {
			najw = elem.nd;
		}
	}
	set<string> res;
	for (auto elem : cnt) {
		if (elem.nd == najw) {
			res.insert(elem.st);
		}
	}
	for (auto ele : res) {
		cout << ele << endl;
	}
}

Measured memory_bytes: 33280
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <cassert>
#include <limits>
#include <functional>
#include <iomanip>
#include <complex>
#include <bitset>

using namespace std;

#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
#if defined(_MSC_VER) || __cplusplus > 199711L
#define aut(r,v) auto r = (v)
#else
#define aut(r,v) __typeof(v) r = (v)
#endif
#define each(it,o) for(aut(it, (o).begin()); it != (o).end(); ++ it)
#define all(o) (o).begin(), (o).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset(m,v,sizeof(m))
#define INF 0x3f3f3f3f3f3f3f3fLL
#define SIZE 8080
#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()

typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pair<int, int> > vpii; typedef long long ll;
typedef pair<int,ll> pill; typedef pair<ll,int> plli; 
typedef pair<double, int> pdi;
template<typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; }
template<typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }
typedef complex<double> P;
ll MOD=1e9+7;
typedef ll Weight;
struct Edge {
	int src, dst;
	Weight weight;
};
bool operator < (const Edge &e, const Edge &f) {
	return e.weight != f.weight ? e.weight > f.weight : // !!INVERSE!!
	e.src != f.src ? e.src < f.src : e.dst < f.dst;
}
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;
int N,C;
vector<ll> A,B;
ll dp[405][405]={0};
ll sum[405][405]={0};//sum[k][a] 1^k~a^k
ll powMod(ll x, ll k, ll m) {
	if (k == 0)     return 1;
	if (k % 2 == 0) return powMod(x*x % m, k/2, m);
	else            return x*powMod(x, k-1, m) % m;
}
int main(){
	cin>>N>>C;
	for(int i=0;i<N;i++){
		ll a;
		cin>>a;
		A.pb(a);
	}
	for(int i=0;i<N;i++){
		ll a;
		cin>>a;
		B.pb(a);
	}
	//cout<<"YES"<<endl;
	for(int i=0;i<=403;i++){
		
		for(int j=1;j<=403;j++){
			sum[i][j]=(sum[i][j-1]+powMod(j,i,MOD))%MOD;
		}
	}
	dp[0][0]=(ll)1;
	for(int i=1;i<=N;i++){
		for(int j=0;j<=C;j++){
			for(int k=0;k<=j;k++){
				ll hoge=0;
				hoge=(sum[j-k][B[i-1]]-sum[j-k][A[i-1]-1]+MOD)%MOD;
				dp[i][j]=(dp[i][j]+(dp[i-1][k]*hoge)%MOD)%MOD;
			}
		}
	}
	cout<<dp[N][C]<<endl;
}

Measured memory_bytes: 2944
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    a,b,c,d = MI()
    ans = max(a*c, a*d, b*c, b*d)
    print(ans)
if __name__ == '__main__':
    main()

Measured memory_bytes: 10948
//#define NDEBUG
#include <cstddef>
#include <cstdint>
#include <vector>

namespace n91 {

	using i8 = std::int_least8_t;
	using i32 = std::int_least32_t;
	using i64 = std::int_least64_t;
	using u8 = std::uint_least8_t;
	using u32 = std::uint_least32_t;
	using u64 = std::uint_least64_t;
	using isize = std::ptrdiff_t;
	using usize = std::size_t;

	class rep {
		const usize f, l;

	public:
		class itr {
			friend rep;
			usize i;
			constexpr itr(const usize x) noexcept : i(x) {}

		public:
			void operator++() noexcept { ++i; }
			constexpr usize operator*() const noexcept { return i; }
			constexpr bool operator!=(const itr x) const noexcept { return i != x.i; }
		};
		constexpr rep(const usize first, const usize last) noexcept
			: f(first), l(last) {}
		constexpr itr begin() const noexcept { return itr(f); }
		constexpr itr end() const noexcept { return itr(l); }
	};
	class revrep {
		const usize f, l;

	public:
		class itr {
			friend revrep;
			usize i;
			constexpr itr(usize x) noexcept : i(x) {}

		public:
			void operator++() noexcept { --i; }
			constexpr usize operator*() const noexcept { return i; }
			constexpr bool operator!=(const itr x) const noexcept { return i != x.i; }
		};
		constexpr revrep(usize first, usize last) noexcept : f(--first), l(--last) {}
		constexpr itr begin() const noexcept { return itr(l); }
		constexpr itr end() const noexcept { return itr(f); }
	};
	template <class T> using vec_alias = std::vector<T>;
	template <class T> auto md_vec(const usize n, const T &value) {
		return std::vector<T>(n, value);
	}
	template <class... Args> auto md_vec(const usize n, Args... args) {
		return std::vector<decltype(md_vec(args...))>(n, md_vec(args...));
	}
	template <class T> constexpr T difference(const T &a, const T &b) {
		return a < b ? b - a : a - b;
	}

} // namespace n91

#include <algorithm>
#include <iostream>
#include <utility>
#include <array>

namespace n91 {

	void main_() {
		static constexpr usize n = 5;
		std::array<u32, n> a;
		u32 k;
		for (auto &e : a) {
			std::cin >> e;
		}
		std::cin >> k;
		std::cout << (a.back() - a.front() <= k ? "Yay!" : ":(") << std::endl;
	}

} // namespace n91

int main() {
	n91::main_();
	return 0;
}


Measured memory_bytes: 256
import java.util.*;
import java.lang.*;
  
public class Main{
  public static void main(String[] args){
    Scanner stdIn=new Scanner(System.in);
    int i,n,x;
    n=stdIn.nextInt();
    long max=-133333333,min=133333333,sum=0;
    for (i=0;i<n;i++){
	x=stdIn.nextInt();
	sum+=x;
	if (x>max){
	    max=x;
	}
	if (x<min){
	    min=x;
	}
    }
    System.out.println(min+" "+max+" "+sum);
  }
}



Measured memory_bytes: 40988
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <cmath>

using namespace std;

int main() {
	int n, a, b, c;
	cin >> n >> a >> b >> c;

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

	int limit = 1 << (2 * n);

	int min_mp = 1e9;
	for (int i = 0; i < limit; i++) {
		vector<int> bamboo(3, 0);

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

			int x = tmp % 4;
			tmp /= 4;
			if (x < bamboo.size()){
				if (bamboo[x] >= 1) {
					mp += 10;
				}
				bamboo[x] += l[j];
			}
		}


		if (*min_element(bamboo.begin(), bamboo.end()) == 0) {
			continue;
		}

		mp += abs(bamboo[0] - a) + abs(bamboo[1] - b) + abs(bamboo[2] - c);
		min_mp = min(min_mp, mp);
	}

	cout << min_mp << endl;
	return 0;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
from decimal import *


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [Scanner.string() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [Scanner.int() for i in range(n)]


class Math():
    @staticmethod
    def gcd(a, b):
        if b == 0:
            return a
        return Math.gcd(b, a % b)

    @staticmethod
    def lcm(a, b):
        return (a * b) // Math.gcd(a, b)

    @staticmethod
    def divisor(n):
        res = []
        i = 1
        for i in range(1, int(n ** 0.5) + 1):
            if n % i == 0:
                res.append(i)
                if i != n // i:
                    res.append(n // i)
        return res

    @staticmethod
    def round_up(a, b):
        return -(-a // b)

    @staticmethod
    def is_prime(n):
        if n < 2:
            return False
        if n == 2:
            return True
        if n % 2 == 0:
            return False
        d = int(n ** 0.5) + 1
        for i in range(3, d + 1, 2):
            if n % i == 0:
                return False
        return True


def pop_count(x):
    x = x - ((x >> 1) & 0x5555555555555555)
    x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
    x = (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f
    x = x + (x >> 8)
    x = x + (x >> 16)
    x = x + (x >> 32)
    return x & 0x0000007f


MOD = int(1e09) + 7
INF = int(1e15)


def solve():
    R = Scanner.int()
    print(2 * R * math.pi)


def main():
    # sys.stdin = open("sample.txt")
    solve()


if __name__ == "__main__":
    main()


Measured memory_bytes: 10716
import sys
input = sys.stdin.readline
n = int(input())
X = []
for i in range(n):
  x, l = map(int, input().split())
  X.append([x-l, x+l])
X.sort()
temp = X[0][1]
count = n
for i in range(1,n):
  if temp>X[i][0]:
    count -= 1
    temp = min(temp, X[i][1])
  else:
    temp = X[i][1]
print(count)


Measured memory_bytes: 21756
#include <stdio.h>

int main()
{
	int n, a, b, sum, num, ans = 0;
	scanf("%d%d%d", &n, &a, &b);
	for(int i = 1 ; i <= n ; i++)
	{
		sum = 0;
		num = i;
		while(num)
		{
			sum += num % 10;
			num /= 10;
		}
		if(sum >= a && sum <= b)
			ans += i;
	}
	printf("%d\n", ans);
}

Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#include <queue>

using namespace std;
#define int long long

signed main(){
    ios_base::sync_with_stdio(false);
    
    int x, y;
    cin >> x >> y;
    if (x % y == 0) {
        cout << "-1\n";
    }
    else{
        cout << x << '\n';
    }
    
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; i++)
#define repo(i, n) for(int i=1; i<=n; i++)
#define INF 1001001001
#define INFll 100100100100100
// debug用
#define PrintVec(x) for (auto elementPrintVec: x) { cout << elementPrintVec << " "; } cout << endl;

using namespace std;
using ull = unsigned long long;
using ll = long long;
using P = pair<int, int>;
const int mod = 1000000007;

int main(){
  int n , k;
  cin >> n >> k;
  vector<ll> a(n+1);
  repo(i, n){
    a[i]=a[i-1]+i;
  }
  ll ans=0;
  for(int i=k; i<=n; i++){
    ans+=a[n]-a[n-i]-a[i-1]+1;
    ans%=mod;
  }
  ans++;
  ans%=mod;
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 4844
//#include <bits/stdc++.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <stdio.h>
#include <queue>
#include <deque>
#include <set>
#include <stack>
#include <time.h>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<int, ll> Pil;
typedef pair<ll, ll> Pll;
typedef pair<ll, int> Pli;

#define fi first
#define se second

const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll MOD3 = 1812447359;
const ll INF = 1ll << 62;
const double PI = 2 * asin(1);

void yes() {printf("yes\n");}
void no() {printf("no\n");}
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

int H, W, K;
ll ans[105][10], DP[10];

int main(){
  scanf("%d%d%d", &H, &W, &K);

  DP[0] = 1; DP[1] = 1;
  for (int i = 2; i < 10; i++) DP[i] = DP[i-1] + DP[i-2];

  ans[0][1] = 1;
  for (int i = 1; i <= H; i++){
    for (int j = 1; j <= W; j++){
      ans[i][j] += ans[i-1][j] * (DP[j-1] * DP[W-j]); 
      ans[i][j] %= MOD;

      if (j >= 2){
        ans[i][j] += ans[i-1][j-1] * (DP[j-2] * DP[W-j]);
        ans[i][j] %= MOD;
      }

      if (j < W){
        ans[i][j] += ans[i-1][j+1] * (DP[j-1] * DP[W-j-1]);
        ans[i][j] %= MOD;
      }
    }
  }

  printf("%lld\n", ans[H][K]);

  return 0;
}


Measured memory_bytes: 3828
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <numeric>
#include <queue>
#include <stack>
#include <map> 
#include <set>
#include <string>
#include <functional>
#include <list>
#include <random>
#include <time.h>
#include <iomanip>
#include <assert.h>
#include <numeric>
#include <new>
#define BIT(nr) (1ULL << (nr))
#define int long long
#define ll long long
#define double long double
#define mod 1000000007
#define MAXN (int)1e+5 * 2+1
#define LL_MAX 9223372036854775807	//ない環境用
#define LL_HALFMAX 9223372036854775807 / 2	//ない環境用
#define MIN -(9223372036854775807 / 2)
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define mp make_pair
template<typename T1, typename T2> inline void chmin(T1 & a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1& a, T2 b) { if (a < b) a = b; }


using namespace std;

signed main() {
    int N, x;
    cin >> N >> x;
    vector<int> a(N);
    rep(i, N) cin >> a[i];

    int ans = 0;

    REP(i, 1, N) {
        int su = a[i] + a[i - 1];
        if (su > x) {
            // dif だけ食べる必要 あり
            int dif = su - x;
            if (a[i] >= dif) {
                a[i] -= dif;
            }
            else {
                a[i] = 0;
                // a[i-1] からも食べなければならん けど 参照されないので無視してOK
            }
            ans += dif;
        }
    }

    cout << ans << "\n";

    return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <cassert>
#include <queue>
#include <map>
#include <set>
using namespace std;
using Int = int64_t;
using P = pair<Int, Int>;
const Int INF = 1<<30;
const Int MOD = (Int)1e9 + 7;
const Int MAX_N = (Int)1e5 + 5;
#define debug(x) cout << #x << ": " << x << endl
#define debug2(x, y) cout << #x << ": " << x << ", " << #y << ": " << y << endl;
template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2>& p) { os << p.first << " " << p.second; return os; }
template<typename T>
ostream &operator<<(ostream &os, const vector<T> &v) { for(int i = 0; i < (int) v.size(); i++) os << v[i] << (i + 1 != v.size() ? " " : ""); return os; }

void solve()
{
    int n, x, t;
    cin >> n >> x >> t;
    int k = n / x;
    if(n % x) k++;

    cout << k * t << endl;
}

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


Measured memory_bytes: 3648
#include <bits/stdc++.h>
#include <algorithm>
#include <vector>
#include <iostream>
#include <string>
using namespace std;
 
int main() {
  //input
  long n;
  cin >> n;
  long long ans;
  //compute
  
  ans = n * ( n - 1 ) / 2 ;

  //output
  cout << ans  << endl;
}  

Measured memory_bytes: 3592
//include
//------------------------------------------
#include <bits/stdc++.h>
using namespace std;
//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> P;
typedef long long ll;
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const long long INF = 1000000007;
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
// chmax chmin
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

int main(void){
    int N,M; cin >> N >> M;
    int p[M]; string S[M]; REP(i,M){cin >> p[i] >> S[i]; p[i]--;}
    int num[N][2]; REP(i,N){num[i][0] = 0; num[i][1] = 0;}

    REP(i,M){
        if(S[i] == "AC"){
            if(num[p[i]][0] == 0) num[p[i]][0] = 1;
        }
        else{
            if(num[p[i]][0] == 0) num[p[i]][1]++;
        }
    }
    P ans; ans.first = 0; ans.second = 0;
    REP(i,N){
        ans.first += num[i][0];
        if(num[i][0] == 1) ans.second += num[i][1];
    }
    cout << ans.first << " " << ans.second << endl;
    return 0;
}

Measured memory_bytes: 6912
aaa = list(map(int, input().split())) + list(map(int, input().split())) + list(map(int, input().split()))

n = int(input())
for _ in range(n):
    b = int(input())
    try:
        i = aaa.index(b)
    except:
        continue
    if i >= 0:
        aaa[i] = -1
for i, j, k in [(0, 1, 2), (3, 4, 5), (6, 7, 8), (0, 3, 6), (1, 4, 7), (2, 5, 8), (0, 4, 8), (2, 4, 6)]:
    if aaa[i] == -1 and aaa[j] == -1 and aaa[k] == -1:
        print('Yes')
        break
else:
    print('No')


Measured memory_bytes: 3064
#include<iostream>
using namespace std;
 
int main() {
    int k, x; cin>>k>>x;

    if(x - (k - 1) < -1000000){
        for(int i = -1000000; i <= x + k - 1; i++){
            cout<<i<<" ";
        }
    }
    else if(x + k - 1 > 1000000){
        for(int i = x - (k - 1); i <= 1000000; i++){
            cout<<i<<" ";
        }
    }else if(k == 1){
        cout<<x<<endl;
    }
    else{
        for(int i=x - (k - 1);i <= x + k - 1 ;i++ ){
            cout<<i<<" ";
        }
    }
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
int LCS(int,int);
char X[1001],Y[1001];
int main(){
  int n,i,j,len1,len2,result;
  scanf("%d", &n);
  for(i=0;i<n;i++){
    scanf("%s",X);
    scanf("%s",Y);
    len1=strlen(X);
    len2=strlen(Y);
    //result=LCS(len1,len2);
    printf("%d\n",LCS(len1,len2));
  }
  return 0;
}

int LCS(int len1,int len2){
  int i,j=0,str[len1+1][len2+1];
  
  for(i=0;i<=len1;i++){
     str[i][0]=0;
   	 if(j<=len2) str[0][j]=0;
   	 j++;
  }
  for(i=1;i<=len1;i++){
    for(j=1;j<=len2;j++){
      if(X[i-1]==Y[j-1]){
        str[i][j]=str[i-1][j-1]+1;
      }
      else if(str[i-1][j]>=str[i][j-1]){
        str[i][j] = str[i-1][j];
      }
      else{
        str[i][j] = str[i][j-1];
      }
    }
  }
  return str[len1][len2];
}


Measured memory_bytes: 5628
#include<stdio.h>
#define N 4

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

int count;

int A[N][N];

int abs(int a){
  if(a > 0) return a;
  else return a*-1;
}

void swap(int *x,int *y){
  int tmp=*x;
  *x=*y;
  *y=tmp;
  return ;
}

int Heuristic(){
  int i,j,sum = 0,x;
  for(i = 0;i < N;i++){
    for(j = 0;j < N;j++){
    if(A[i][j]==0)continue;
    x = A[i][j] - 1;
    sum+=abs(x/N - i)+abs(x%N - j);
    }
  }
  return sum;
}

int move(int d,int pre,int s,int t){
  int i,x,y,h = Heuristic();
  if(h==0)return 1;
  if(d+h > count)return 0;
  for(i=0;i<4;i++){
    if(abs(i - pre)==2)continue;/*return move*/

    x = s + dy[i];
    y = t + dx[i];

    if(x<0||y<0||x>=N||y>=N)continue;/*frame over*/

    swap(&A[x][y],&A[s][t]);
    if(move(d+1,i,x,y))return 1;
    swap(&A[x][y],&A[s][t]);/*return move because next move's starat is same this one */
  }
  return 0;
}

void counter(int s,int t){
  count = 0;
  while(1){
    if(move(0,10,s,t)){
      printf("%d\n",count);
      return ;
    }
    count++;
  }
}

int main(){
  int i,j,s,t;
  for(i = 0;i < N;i++){
    for(j = 0;j < N;j++){
      scanf("%d",&A[i][j]);
      if(A[i][j] == 0){
        s = i;
        t = j;
      }
    }
  }
  counter(s,t);
  return 0;
}



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

#define loop(v, f, l) for(int v = (f), v##_ = (l); v < v##_; ++v)

using namespace std;

typedef long long int lint;
static inline int in(){ int x; scanf("%d", &x); return (x); }
static inline lint inl(){ lint x; scanf("%lld", &x); return (x); }

int main()
{
	int candy;
	while( scanf("%d", &candy) != EOF )
	{
		printf("3C%02d\n", (candy - 1) % 39 + 1);
	}
	return (0);
}

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

int main() {
  int H, W, N;
  cin >> H >> W >> N;
  vector<int> V;
  for (int i = 1; i <= N; i++) {
    int A;
    cin >> A;
    for (int j = 0; j < A; j++) V.push_back(i);
  }
  vector<vector<int>> R(H, vector<int>(W));
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      R.at(i).at(j) = V.at(W * i + j);
    }
  }
  for (int i = 0; i < H; i++) {
    if (i % 2 == 0) {
      for (int j = 0; j < W; j++) cout << R.at(i).at(j) << " ";
    }
    else {
      for (int j = W - 1; j >= 0; j--) cout << R.at(i).at(j) << " ";
    }
    cout << endl;
  }
}

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

using namespace std;

#define DUMP(x) std::cerr << (#x) << " = " << (x) << "\n"
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define REP(i, k, n) for (int i = (k); i < (int)(n); ++i)
#define ALL(r) r.begin(), r.end()
#define YES puts("YES")
#define Yes puts("Yes")
#define NO puts("NO")
#define No puts("No")
#define IMP puts("IMPOSSIBLE")
#define Imp puts("Impossible")
#define imp puts("impossible")
#define M1 puts("-1")
#define pb push_back

template <typename T>
ostream &operator<<(ostream &os, vector<T> &v)
{
    os << "{";
    rep(i, v.size()) os << v[i] << (i == (int)v.size() - 1 ? "" : ", ");
    os << "}";
    return os;
}
template <typename T>
T dup(T x, T y)
{
    return (x + y - 1) / y;
};
template <typename A, size_t N, typename T>
inline void arrayFill(A (&array)[N], const T &val) { std::fill((T *)array, (T *)(array + N), val); }
struct in
{
    const size_t n = 0;
    in() = default;
    in(size_t n) : n(n){};
    template <typename T>
    operator T()
    {
        T ret;
        cin >> ret;
        return ret;
    }
    template <typename T>
    operator vector<T>()
    {
        assert(n != 0);
        vector<T> ret(n);
        for (auto &x : ret)
            cin >> x;
        return ret;
    }
};

using ll = int64_t;
using vint = vector<int32_t>;
using vvint = vector<vint>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pint = pair<int32_t, int32_t>;
using pll = pair<ll, ll>;
using setint = set<int32_t>;
using setstr = set<string>;
using qint = queue<int32_t>;
using qpint = queue<pint>;

constexpr std::int32_t INF = 1001001001;
constexpr std::int64_t LINF = 1001001001001001001;

void Main()
{
    ll n = in(), k = in();
    vector<pll> xy(n);
    rep(i, n)
    {
        ll x = in(), y = in();
        xy[i] = make_pair(x, y);
    }

    sort(ALL(xy));

    ll ans = LINF * 4;
    for (ll l = 0; l < n - (k - 1); ++l)
    {
        for (ll r = l + k - 1; r < n; ++r)
        {
            vector<pll> cxy{xy.begin() + l, xy.begin() + r + 1};
            sort(ALL(cxy), [](auto lhs, auto rhs) { return lhs.second < rhs.second; });
            for (ll d = 0; d <= (r - l + 1) - k; ++d)
            {
                ll mi = cxy[d].second;
                ll ma = cxy[d + (k - 1)].second;
                ll rect = (xy[r].first - xy[l].first) * (ma - mi);
                ans = min(ans, rect);
            }
        }
    }
    cout << ans << endl;
}

int main()
{
    std::cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}


Measured memory_bytes: 256
N = int(input())
A = sorted(map(lambda x: (int(x[1]), x[0]),
               enumerate(input().split())), reverse=True)


V = [0]

for i in range(N-1):
    a, p = A[i]
    s = i+1
    V2 = [None]*(s+1)

    for t in range(s+1):
        v = 0

        if t > 0:
            v = V[t-1] + a*abs(p-(t-1))

        if t < s:
            v = max(V[t] + a*abs(p-(N-s+t)), v)

        V2[t] = v

    V = V2

a, p = A[-1]
for i in range(N):
    V[i] += a*abs(p-i)

print(max(V))





            


Measured memory_bytes: 9608
#include <stdio.h>
#include <math.h>
#define PI 3.14159265359

int main(void){
    double a,b,c;
    scanf("%lf %lf %lf",&a,&b,&c);
    c = c * PI / 180;
    printf("%f\n",a * b  / 2 * sin(c));
    printf("%f\n",a + b + sqrt(a*a + b*b  - 2 * a * b * cos(c)));
    printf("%f\n",sin(c) * b);
    return 0;
}

Measured memory_bytes: 676
#include <iostream>
#include <stack>
#include <string>
using namespace std;
int main() {
	cin.tie(0); ios::sync_with_stdio(false);
	stack<char> ST;
	string X;
	cin >> X;

	ST.push(X[0]);

	for (int i = 1; i < X.length();i++) {
		if (ST.empty()) {
			ST.push(X[i]);
			continue;
		}
		if (ST.top() == 'S' && X[i] == 'T') {
			ST.pop();
		}
		else {
			ST.push(X[i]);
		}
	}
	cout << ST.size() << endl;
}

Measured memory_bytes: 720
// A

#include <bits/stdc++.h>
using ll = long long;
using namespace std;
ll mod=1e9+7;
#define pa(x,n) for(ll i=0;i<n;i++){cout<<(x[i])<<" \n"[i==n-1];};

int main(){
  int A,B;
  cin>>A>>B;
  if (A*B%2==0){
    cout << "No" << endl;
  }else{
    cout << "Yes" << endl;
  }
  return 0;
}


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


p = 0
res = 0

while p < N:
    while p + 1 < N and A[p] == A[p + 1]:
        p += 1
    if p + 1 < N and A[p] < A[p + 1]:
        while p + 1 < N and A[p] <= A[p + 1]:
            p += 1
    elif p + 1 < N and A[p] > A[p + 1]:
        while p + 1 < N and A[p] >= A[p + 1]:
            p += 1
    res += 1
    p += 1
print(res)


Measured memory_bytes: 20168
#include <iostream>
#include <vector>
#include <queue>
#include <memory.h>
#include <algorithm>
using namespace std;
typedef long long LL;
typedef pair<LL, LL> pll;
const int MAXN = 100 + 10;
vector<int> edges[MAXN];
bool used[MAXN];
int x, y;

pll solve (int root, bool bad = false) {
    LL ret = 1;
    memset(used, false, sizeof(used));
    queue<int> q;
    LL layer = 0;
    q.push(root); used[root] = true;
    while (!q.empty()) {
        layer++;
        int sz = q.size();
        int m = 0;
        for (int i = 0; i < sz; i++) {
            int cur = q.front(); q.pop();
            int cnt = 0;
            for (int nxt : edges[cur]) {
                if (used[nxt]) continue;
                if (bad) {
                    if (x == cur && y == nxt) continue;
                    if (y == cur && x == nxt) continue;
                }
                cnt++;
                q.push(nxt); used[nxt] = true;
            }
            m = max(m, cnt);
        }
        if (m != 0) ret = ret * m;
        if (ret < 0)  return {500LL, 0LL};
    }
    return {layer, ret};

}
int main() {
//    freopen("test.txt", "r", stdin);
    ios::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int n; cin >> n;
    int a, b;
    for (int i = 0; i < n-1; i++) {
        cin >> a >> b;
        edges[a].push_back(b);
        edges[b].push_back(a);
    }
    pll ret = {500LL, 0LL};
    for (int i = 1; i <= n; i++) {
        ret = min(ret, solve(i));
    }
    for (int i = 1; i <= n; i++) {
        for (int j = 0; j < edges[i].size(); j++) {
            if (i > edges[i][j]) continue;
            x = i; y = edges[i][j];
            edges[n+1].push_back(x);
            edges[n+1].push_back(y);
            edges[x].push_back(n+1);
            edges[y].push_back(n+1);
            auto tmp = solve(n+1, true);
            tmp.first--;
            ret = min(ret, tmp);
            edges[n+1].clear();
            edges[x].pop_back();
            edges[y].pop_back();
        }
    }
    cout << ret.first << ' ' << ret.second << endl;




    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <bitset>
#include <map>
#include <tuple>
#include <unordered_set>
#include <unordered_map>
#include <list>
#include <numeric>
#include <utility>
#include <iterator>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <ctime>
#include <cassert>
#include <random>
#include <cstring>

#define rep(i,n) for(int i=0;i<int(n);i++)
#define all(x) (x).begin(),x.end()
#define pb push_back

using namespace std;
using ll = long long;

const ll mod = 1000000007;

// int dx[4]={1,0,-1,0};
// int dy[4]={0,1,0,-1};
int ddx[8]={-1,-1,0,1,1,1,0,-1};
int ddy[8]={0,1,1,1,0,-1,-1,-1};
// bool debug=false;

/*---------------------------------------------------*/

int main() {
    int N, L;
    string S[105];
    cin >> N >> L;
    for(int i = 0; i < N; i++) {
        cin >> S[i];
    }
    sort(S, S + N);
    for(int i = 0; i < N; i++) cout << S[i];
    cout << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N,K,Q;cin>>N>>K>>Q;
  vector<int>P(N,K);  
  for(int i=0;i<Q;i++){
    int a;cin>>a;P[a-1]++;
  }
  for(int i=0;i<N;i++)cout<<(P[i]>Q?"Yes":"No")<<endl;
  
}



Measured memory_bytes: 1024
import numpy as np

a, b, m = map(int, input().split())

an = np.asarray(input().split(), dtype=np.uint32)

bn = np.asarray(input().split(), dtype=np.uint32)

minimum = np.min(an) + np.min(bn)

for i in range(m):
    x, y, c = map(int, input().split())
    new_value = an[x-1] + bn[y-1] - c
    if minimum > new_value:
        minimum = new_value

print(minimum)

Measured memory_bytes: 23948
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <string>
#include <iomanip>
#include <bits/stdc++.h>
#include <fstream>
#include <map>
using namespace std;
typedef long long ll;
#define INF 1000000000000 //10^12:極めて大きい値,∞
#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 FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)


int main(){
  char c;
  cin >> c;
  if(c >='a' && c <= 'z') cout << 'a' << endl;
  else cout << 'A' << endl;
  return 0;
}

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

using namespace std;

typedef short sho;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef double db;
typedef string str; 
 
typedef pair<int,int> pii;
typedef pair<ll,ll> pll; 
typedef pair<ld,ld> pld;
 
typedef vector<int> vi; 
typedef vector<ll> vl; 
typedef vector<ld> vd;
typedef vector<str> vs;
typedef vector<pii> vpi;
typedef vector<pll> vpl;
typedef vector<pld> vpd;

#define LOCAL
#define MP make_pair 
#define FF first
#define SS second
#define sz(x) (int)x.size()
#define begin(x) (x).begin() 
#define end(x) (x).end()
#define rbegin(x) (x).rbegin()
#define rend(x) (x).rend()
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define rsz resize
#define ins insert
#define ft front()
#define bk back()
#define PF push_front 
#define PB push_back
#define PP push
#define lb lower_bound 
#define ub upper_bound
#define lowbit(x) x&(-x)
#define testbit(x,i) x&(1<<i)

inline void checkmin(int &x,int y){x=min(x,y);}
inline void checkmax(int &x,int y){x=max(x,y);}

const int maxn=2e5+10;

int n;
int a[maxn];

int cnt[maxn];

int main() 
{
	#ifndef LOCAL
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    /* start code */
    cin>>n;
    for(int i=2;i<=n;i++)
    {
    	cin>>a[i];
    	cnt[a[i]]++;
	}
	for(int i=1;i<=n;i++)
	{
		cout<<cnt[i]<<endl;
	}
    /* end code */
	return 0;
}

Measured memory_bytes: 5132
import math
s = int(input())
#k1*k2=sとなるようなk1k2を求める問題
x1 = 0
y1 = 0

x2 = math.ceil(math.sqrt(s))
y3 = math.ceil(math.sqrt(s))

x3 = 1
y2 = y3**2-s
assert (x2*y3-x3*y2)==s
assert x2<=10**9 and x3<=10**9 and y2<=10**9 and y3<=10**9
print(x1,y1,x2,y2,x3,y3)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repr(i,n) for(int i = (int)(n); i >= 0; i--)
#define all(v) v.begin(),v.end()
typedef long long ll;

int main(){
    int N;
    cin >> N;
    cout << N * (N + 1) / 2 << endl;
}


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

#define forn(i, n) for(int i = 0; i < n; ++i)

typedef long long ll;
typedef std::vector<int> vi;
typedef std::vector<vi> vvi;

int main() {
    using namespace std;
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);

    int x, y, z;
    cin >> x >> y >> z;
    printf("%d %d %d\n", z, x, y);

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define vsort(v) sort(v.begin(), v.end());
#define rvisort(v) sort(v.begin(), v.end(), greater<int>());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
 
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using vpii = vector<pii>;
using vs = vector<string>;
using vd = vector<double>;
using ul = unsigned long;
 
template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }
 
const int mod=1e9+7;
 
struct mint {
  ll x;
  mint(ll x=0):x(x%mod){}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
};
 
mint c[4005][4005];
void init() {
  c[0][0] = 1;
  for (int i = 0; i <= 4000; i++) {
    for (int j = 0; j <= i; j++) {
      c[i+1][j] += c[i][j];
      c[i+1][j+1] += c[i][j];
    }
  }
}
mint comb(int n, int k) {
  return c[n][k];
}
 
bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false;
 
    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return false;
        }
    }
 
    return true;
}
 
map<ll, ll> primeFact(ll n) {
  map<ll, ll> res;
  for (ll i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      res[i]++;
      n /= i;
    }
  }
  if (n != 1) res[n]++;
  return res;
}
 
void printv(vi& v){
  rep(i,v.size()) cout << v[i] << " ";
  cout << endl;
}
void printv(vll& v){
  rep(i,v.size()) cout << v[i] << " ";
  cout << endl;
}
int vtotal(vi& v){
  int total=0;
  rep(i,v.size()) total+=v[i];
  return total;
}
 
int main()
{
  //init(); // mint初期化
  cin.tie( 0 );
  ios::sync_with_stdio( false );
  
  string s;cin>>s;
  replace(s.begin(),s.end(),',',' ');
  cout(s);
  
  return 0;
}

Measured memory_bytes: 125568
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;

#define LEN(x) (int)x.size()
#define ALL(x) x.begin(), x.end()

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

template<typename T, typename M = __gnu_pbds::null_type>
using ordered_set = __gnu_pbds::tree<T, M, less<T>, __gnu_pbds::rb_tree_tag, __gnu_pbds::tree_order_statistics_node_update>;

const ll INF = 1e18;
const int MOD = 1e9 + 7;
const double EPS = 1e-9;

inline int fcmp(double x, double y)
{ return (x < y + EPS ? (x < y - EPS ? -1 : 0) : 1);}

const int N = 410;
int a[N], n;
ll dp[N][N], pre[N];

ll sum(int l, int r)
{
    return pre[r] - pre[l - 1];
}

ll solve(int l, int r)
{
    if(l == r) return 0;

    ll& ans = dp[l][r];

    if(ans == -1)
    {
        ans = INF;
        for(int mid = l; mid < r; mid++)
            ans = min(ans, solve(l, mid) + solve(mid + 1, r) + sum(l, r));
    }

    return ans;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cout.precision(10);

    cin >> n;

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

    pre[0] = 0;
    for(int i = 1; i <= n; i++)
        pre[i] = pre[i - 1] + a[i];

    memset(dp, -1, sizeof dp);
    cout << solve(1, n) << endl;
    
    return 0;
}

Measured memory_bytes: 1664
#include<stdio.h>
int main(){int a=0,b=0,c=0,r=0,e=0;
  scanf("%d%d%d",&a,&b,&c);
  while(a <= b){
           e=c%a;
	     if(e == 0)r++;
               a=(a+1);}
  printf("%d\n",r);
    return 0;
  }

Measured memory_bytes: 596
using System;
using System.Collections.Generic;
using static System.Math;
using System.Linq;
 
class DandA {
    static void Main(string[] args) {
        string s = ReadLineStr();
        string[] ary = new string[] {"SUN","MON","TUE","WED","THU","FRI","SAT"};
        Console.WriteLine(7 - Array.IndexOf(ary, s));
    }
  
    static private string ReadLineStr() {return Console.ReadLine();}
    static private int ReadLineInt() {return int.Parse(Console.ReadLine());}
    static private string[] ReadLineStrArray() {return Console.ReadLine().Trim().Split();}
    static private int[] ReadLineIntArray() {return Console.ReadLine().Trim().Split().Select(a => int.Parse(a)).ToArray();}
    static private long[] ReadLineLongArray() {return Console.ReadLine().Trim().Split().Select(a => long.Parse(a)).ToArray();}
    static private string[][] ReadMLineStrArray(int arg) { return new int[arg].Select(_ => Console.ReadLine().Split()).ToArray();}
    static private int[][] ReadMLineIntArray(int arg) { return new int[arg].Select(_ => Console.ReadLine().Split().Select(int.Parse).ToArray()).ToArray();}

    static private bool IsPrime(int num) {
        if (num < 2) return false;
        if (num == 2) return true;
        else if (num % 2 == 0) return false;
        double sqrtNum = Math.Sqrt(num);
        for (int i = 3; i <= sqrtNum; i += 2) {
            if (num % i == 0) return false;
        }
        return true;
    }
}

Measured memory_bytes: 13148