akhauriyash/Code-Regression huggingface dataset:
/**
*    author:  Dooloper
*    created: 25.07.2020 20:56:21
**/

#include <bits/stdc++.h>

#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;
using P = pair<int,int>;
using ll = long long;

const double PI = acos(-1);
const int mod = 1000000007;
class mint {
    long long x;
public:
    mint(long long x=0) : x((x%mod+mod)%mod) {}
    mint operator-() const {
      return mint(-x);
    }
    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 pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t>>1);
        a *= a;
        return a;
    }
    // for prime mod
    mint inv() const {
        return pow(mod-2);
    }
    mint& operator/=(const mint& a) {
        return (*this) *= a.inv();
    }
    mint operator/(const mint& a) const {
        mint res(*this);
        return res/=a;
    }

    friend ostream& operator<<(ostream& os, const mint& m){
        os << m.x;
        return os;
    }
};

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i,n) cin >> a[i];
  ll ans = 1000;
  vector<ll> dp(n,1000);
  for(int i = 0; i < n; i++){
    for(int j = 0; j < i; j++){
      ll rec = dp[j] - dp[j]/a[j]*a[j] + dp[j]/a[j]*a[i];
      for(int k = 0; k < i; k++){
        dp[i] = max(dp[i],dp[k]);
      }
      dp[i] = max(dp[i],rec);
    }
  }
  cout << dp[n-1] << endl;
  return 0;
}

Measured memory_bytes: 3616
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
using namespace __gnu_pbds;
using namespace std;
#define ll long long
#define hii cout << "hii" << endl
#define int ll
#define endl '\n'
#define all(s) s.begin(), s.end()
 
template <class T> ostream& operator << (ostream &os, const vector<T> &v) { for (T i : v) os << i << ' '; return os; }
template <class T> ostream& operator << (ostream &os, const set<T> &v) { for (T i : v) os << i << ' '; return os; }
template <class T, class S> ostream& operator << (ostream &os, const pair<T, S> &v) { os << v.first << ' ' << v.second; return os; }
template <class T, class S> ostream& operator << (ostream &os, const unordered_map<T, S> &v) { for (auto i : v) os << '(' << i.first << "=>" << i.second << ')' << ' '; return os; } 
 
 
#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <class Arg1> void __f(const char* name, Arg1&& arg1) { cerr << name << " : " << arg1 << endl; }
    template <class Arg1, class... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args) {
        const char* sep = strchr(names + 1, ',');
        cerr.write(names, sep - names) << " : " << arg1 << "  ";
        __f(sep + 1, args...);
    }
#else
#define trace(...) 0
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("avx2,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define _CRT_SECURE_NO_WARNINGS
#endif // ifndef ONLINE_JUDGE
 
 
const int N = 3e5 + 5;
const int MAXN = 1e5 + 5;
const int M = 1e5;
const int mod = 998244353;
const int MOD = 998244353;
const int INF = 1e15;
const int LG = 21;

int arr[N];
int brr[N];


void solve() 
{
	int n, k;
	cin >> n >> k;
	set<int> s;
	for(int i = 0; i < k; i++)
	{
		int m;
		cin >> m;
		for(int i = 0; i < m; i++)
		{
			int data;
			cin >> data;
			s.insert(data);
		}
	}
	cout << n - s.size() << endl;
}



 
 
int32_t main() 
{	
    ios_base:: sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	    int t = 1;
	    // cin >> t;
	while(t--)solve();
	return 0;
}


Measured memory_bytes: 3672
import collections,copy,sys
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
N,M = LI()
AB = [LI() for _ in range(M)]
graph = {i:collections.deque() for i in range(1,N+1)} #1_indexed
for a,b in AB:
    graph[a].append(b)
    graph[b].append(a)
seen = [0]*(N+1) #1_indexed
min_dist = [-1]*(N+1) #1_indexed
queue = collections.deque() #部屋NOを入れておく
def bfs():
    c_graph = copy.deepcopy(graph)
    seen[1] = 1
    queue.append(1)
    min_dist[1] = 0
    while queue:
        q_NO = queue.popleft()
        q_dist = min_dist[q_NO]
        if not c_graph[q_NO]:
            continue
        g = c_graph[q_NO]
        for _ in range(len(g)):
            g_NO = g.popleft()
            if seen[g_NO]:
                continue
            seen[g_NO] = 1
            queue.append(g_NO)
            min_dist[g_NO] = q_dist+1
bfs()
if not all(seen[2:]):
    print('No')
    exit()
print('Yes')
for j in range(2,N+1):
    ans,dist = 0,float('INF')
    for x in graph[j]:
        if dist>=min_dist[x]:
            ans = x
            dist = min_dist[x]
    print(ans)


Measured memory_bytes: 196304
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int INF = (1LL << 30) - 1;
int MOD = 1e9+7;
main(){
    int N;
    cin >> N;
    vector<int>A(N),B(N);
    vector<P>V(N*2);
    rep(i,0,N){
        cin >> A[i];
        V[i] = P(A[i], 0);
    }
    rep(i,0,N){
        cin >> B[i];
        V[i + N] = P(B[i], 1);
    } 
    
    sort(V.begin(), V.end());
    ll ans = 1;
    int cnt = 0;
    rep(i,0,N*2){
        if(V[i].second)ans *= (cnt < 0 ? -cnt : 1);
        else ans *= (cnt > 0 ? cnt : 1);
        ans %= MOD; 
        cnt += V[i].second ? 1 : -1;
    }   
    cout << ans << endl;
}

Measured memory_bytes: 2560
// Template from https://techracho.bpsinc.jp/jhonda/2019_08_05/78537

// input macro for competive-programming from https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };

    ($iter:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, bytes) => {
        read_value!($iter, String).into_bytes()
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    use std::io::Read;
    let mut s = String::new();
    std::io::stdin().read_to_string(&mut s).unwrap();

    println!("{}", solve(&s));
}

macro_rules! test {
    ($($input:expr => $output:expr),* $(,)*) => {
        #[test]
        fn solve_test() {
            $(
                assert_eq!(solve($input), $output);
            )*
        }
    };
}

test! {
r#"2018 218"# => "Yes",
r#"2763 0"# => "No",
//
}

fn solve(src: &str) -> String {
    input! {
        source = src,
        n: i64,
        a: i64,
    }

    if n - (n / 500) * 500 - 1 * a > 0 {
        "No"
    } else {
        "Yes"
    }.to_string()
}

Measured memory_bytes: 4352
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string>
#include <string.h>
#include <algorithm>
#include <cmath>
#include <limits>
#include <sstream>

using namespace std;

int main (void)
{
	int n;

	cin >> n;

	int k = 0;

	if (n != 0)
	{
		k = n / 100;
		cout << "ai1333";

		for (int i = 0; i < k; i++)
		{
			cout << '3';
		}
		cout << endl;
	}
	else
	{
		cout << "ai1333" << endl;
	}
}



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

using namespace std;

#define N 2005

int n,m,f[N][N],L[N],R[N],ans,stk[N];
bool a[N][N];
char s[N];

int main(){
	scanf("%d%d",&n,&m);
	for (int i=1;i<=n;++i){
		scanf("%s",s+1);
		for (int j=1;j<=m;++j) a[i][j]=s[j]=='.';
	}
	for (int i=n;i;--i){
		for (int j=1;j<m;++j)
			if ((a[i][j]^a[i][j+1])==(a[i+1][j]^a[i+1][j+1])) f[i][j]=f[i+1][j]+1;
			else f[i][j]=1;
	}
	ans=n;
	for (int i=1;i<=n;++i){
		int tp=0; stk[tp]=0;
		for (int j=1;j<m;++j){
			for (;tp&&f[i][j]<f[i][stk[tp]];--tp);
			L[j]=stk[tp];
			stk[++tp]=j;
		}
		tp=0; stk[tp]=m;
		for (int j=m-1;j;--j){
			for (;tp&&f[i][j]<=f[i][stk[tp]];--tp);
			R[j]=stk[tp];
			stk[++tp]=j;
		}
		for (int j=1;j<m;++j)
			ans=max(ans,f[i][j]*(R[j]-L[j]));
	}
	printf("%d\n",ans);
	
	return 0;
}
			

Measured memory_bytes: 19840
let s = stdin.ReadLine()

let a =
    [| for i in 0..s.Length - 3 -> s.[i..i + 2] |]
    |> Array.map int

[| for _ in 0..s.Length - 3 -> 753 |]
|> Array.map2 (-) a
|> Array.map abs
|> Array.min
|> printfn "%d"


Measured memory_bytes: 12240
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <cmath>
#include <iomanip>
using namespace std;
typedef long long ll;

 
int main() {
    int N, x=0, Max = 0; cin >> N;
    string S; cin >> S;
    for(int i = 0; i < N; i++){
        if(S[i] == 'I') x++;
        else x--;
        Max = max(Max, x);

    }
    cout << Max << endl;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cmath>

using namespace std;

double date[2][3];
int n;

int main()
{
	scanf("%d",&n);
	for(int k=0;k<n;k++)
	{
	for(int i=0;i<2;i++)
	{
		for(int j=0;j<3;j++)
		{
			scanf("%lf",&date[i][j]);
		}
	}
	double d = sqrt((date[0][0]-date[1][0])*(date[0][0]-date[1][0])+(date[0][1]-date[1][1])*(date[0][1]-date[1][1]));
	if(date[0][2]-date[1][2]>d) printf("2\n");
	else if(date[1][2]-date[0][2]>d)printf("-2\n");
	else if(date[0][2]+date[1][2]<d)printf("0\n");
	else printf("1\n");
	}
	return 0;

}

Measured memory_bytes: 0
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;

/*
<url:https://cf17-final-open.contest.atcoder.jp/tasks/cf17_final_a>
問題文============================================================
 文字列 S が与えられます。
 
 高橋君はこの文字列の好きな位置に好きなだけ文字 A を挿入することができます。
 
 S を AKIHABARA に変えることはできるでしょうか？
=================================================================

解説=============================================================
あらかじめ、あり得る状態の文字列の集合を用意しておき、
 入力文字がその集合に含まれるか確認すれば良い
================================================================
*/
set<string> s;

void init(string akiba){
    s.insert(akiba);
    for(int i = 0; i < (int)akiba.size();i++){
        if(akiba[i] == 'A'){
            init(akiba.substr(0,i) + akiba.substr(i+1));
        }
    }
}
int main(void) {
	cin.tie(0); ios::sync_with_stdio(false);
    string S; cin >> S;
    init("AKIHABARA");
    if(s.find(S) != s.end()){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }
	return 0;
}


Measured memory_bytes: 256
N,M,X = map(int,input().split())

L = []
for _ in range(N):
  x = input().split()
  x = [int(y) for y in x]
  L.append(x)
  
cost = []

for i in range(2**N):
    list = []
    point = [0 for _ in range(M)]
    c = 0
    for j in range(N):
        if ((i >> j)&1):
            list.append(L[j])
    for x in list:
        c +=x[0]
        for i in range(1,M+1):
            point[i-1] += x[i]
    if min(point) >= X:
        cost.append(c)

if len(cost) == 0:
    print(-1)
else:
    print(min(cost))

Measured memory_bytes: 9244
#include<bits/stdc++.h>
using namespace std;
int a[100005]={0};
void solve(int n,int k,int b[],int& ans){
    if(n==k-1){
        ans=abs(b[0]-b[n-1]);
        return ;
    }
  if(n==2){ans=abs(b[0]-b[1]);return ;}
  if(n==1){ans=0;return ;}
    if(n==0){
        ans=0;
        return ;
    }

a[1]=abs(b[1]-b[0]);
for(int i=2;i<n;i++){
    a[i]=a[i-1]+abs(b[i]-b[i-1]);
   for(int j=1;j<=k;j++){
       if(i-j<0)break;
       a[i]=min(a[i-j]+abs(b[i]-b[i-j]),a[i]);
   }
}
     
    ans=a[n-1]; 
     return ;
     
 }



int main(){
    int n,k;
    cin>>n>>k;
    int b[n];
    int ans=0;
    for(int i=0;i<n;i++)cin>>b[i];
    solve(n,k,b,ans);
    cout<<ans;
    
    
    
    
}

Measured memory_bytes: 1024
#include<iostream>
using namespace std;
int main(void){
  int n,ans=0;
  cin>>n;
  int a[n];
  for(int i=0;i<n;i++)cin>>a[i];
  for(int i=0;i<n;i++)if(a[i])if(i+1==a[a[i]-1]){ans++;a[a[i]-1]=0;}
  cout<<ans;
  return 0;
}

Measured memory_bytes: 768
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#define debug(x)  cerr << #x << " = " << x << endl
using namespace std;
typedef long long ll;
typedef pair <ll, ll> pll;

const int maxN = 1e5 + 5;
const ll INF = 1e18;
const ll MOD = 1e9 + 7;

ll gcd(ll a, ll b){return !b ? a : gcd(b, a % b);}
ll modP(ll a, ll b) {return (!b ? 1 : (modP(a, b / 2) * modP(a, b / 2) * (b % 2 ? a : 1)) % MOD);}

int n, m, cnt[maxN], i, j, k, tmp, sum;

int main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n >> m;
	for (i = 0; i < n; i++){
		cin >> k;
		for (j = 0; j < k; j++){
			cin >> tmp;
			cnt[tmp] += 1;
		}
	}
	for (i = 1; i <= m; i++){
		if (cnt[i] == n){
			sum += 1;
		}
	}
	cout << sum << endl;
	return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<stack>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
//#define mt make_tuple
//typedef tuple<double,int,double> tp;
//typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
const double PI=acos(-1);
const double EPS=1e-7;
Def inf=sizeof(Def)==sizeof(long long)?2e18:1e9;
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};
int main(){
	int n;
	cin>>n;
	vi in(n);
	rep(i,n)cin>>in[i];
	int out=0;
	rep(i,n){
		if(in[i]==i+1){
			out++;
			i++;
		}
	}
	cout<<out<<endl;
}








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

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            //[summary]B - 1 Dimensional World's Tale
            var line = ReadLine();
            int x = line[2];
            int y = line[3];

            var xCoords = ReadLine().OrderByDescending(c => c).ToList();
            int xMax = xCoords[0];

            var yCoords = ReadLine().OrderBy(c => c).ToList();
            int yMin = yCoords[0];

            for(int i = xMax + 1; i <= yMin; i++)
            {
                if (i > x && i <= y)
                {
                    Console.WriteLine("No War");
                    return;
                }
            }

            Console.WriteLine("War");
        }

        static List<int> ReadLine()
        {
            var line = Console.ReadLine().TrimEnd();
            var array = line.Split(' ');
            var numbers = new List<int>();

            foreach (var s in array)
            {
                int num = int.Parse(s);
                numbers.Add(num);
            }

            return numbers;
        }
    }
}

Measured memory_bytes: 13396
#include<vector>
#include<iostream>
#include<string>
#include<algorithm>
#include<math.h>
#include<map>
#include<functional>
#include<queue>
#include<stack>
#include<string.h>
#include<utility>
#define ll long long int
#define MOD 1000000007LL
using namespace std;
int main() {
    ll x,y;
    cin>>x>>y;
    if(abs(x-y)<=1){
        cout<<"Brown"<<endl;
    }else{
        cout<<"Alice"<<endl;
    }
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
#include <functional>
#include<complex>
#include<bitset>
using namespace std;

#define rep(i,x) for(ll i=0;i<x;i++)
#define repn(i,x) for(ll i=1;i<=x;i++)

typedef long long ll;
const ll INF = 1e17;
const ll MOD = 1000000007;
const ll MAX = 4000001;
const double eps = 1E-18;

ll max(ll a, ll b) {
	if (a > b) { return a; }
	return b;
}

ll min(ll a, ll b) {
	if (a > b) { return b; }
	return a;
}

ll gcd(ll a, ll b) {
	if (b == 0) { return a; }
	if (a < b) { return gcd(b, a); }
	return gcd(b, a % b);
}

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

struct edge {
	ll ind;
	ll fr;
	ll to;
	ll d;
};

class mint {
	long long x;
public:
	mint(long long x = 0) : x((x% MOD + MOD) % MOD) {}
	mint operator-() const {
		return mint(-x);
	}
	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 operator^(const ll& t)const {
		if (!t) return 1;
		mint a = pow(t >> 1);
		a *= a;
		if (t & 1) a *= *this;
		return a;
	}

	mint pow(ll t) const {
		if (!t) return 1;
		mint a = pow(t >> 1);
		a *= a;
		if (t & 1) a *= *this;
		return a;
	}
	// for prime MOD
	mint inv() const {
		return pow(MOD - 2);
	}
	mint& operator/=(const mint& a) {
		return (*this) *= a.inv();
	}
	mint operator/(const mint& a) const {
		mint res(*this);
		return res /= a;
	}

	friend ostream& operator<<(ostream& os, const mint& m) {
		os << m.x;
		return os;
	}
};

///////////////////////////


int main() {
	ll N;
	cin >> N;

	vector<ll> A(N + 1);
	repn(i, N) cin >> A[i];

	bitset<5000000> dp(1);

	repn(i, N) {
		dp = dp | (dp << A[i]);
	}

	ll S = 0;
	repn(i, N) S += A[i];
	
	ll K = (S + 1) / 2;
	while (dp[K] == 0) { K++; }

	cout << K << endl;

	

	system("PAUSE");
}

Measured memory_bytes: 2936
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair<int, int> pin;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;


#define ff(i, a, b) for ( ll i=a; i<(b); i++)
#define ffd(i, a, b) for ( ll i=a; i<= b; i++)
#define fr(i,a,b) for (int i = (b)-1; i >= a; i--)
#define ffr(i,a) for (int i = (a)-1; i >= 0; i--)
#define endl "\n"
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()

const int maxn = 2e5 + 5 ;
const int mod = 1000000007;
const ll INF = 1e18;
const int MX = 2000000001; //check the limits, dummy

pair < int , string > s[200] ;
int main() {
	ios_base::sync_with_stdio(0) ,cin.tie(0);
  ll t, qr, n, ar, hb, k, l, m, r,  x = 0, y = 0, ans = 0, temp = 0, res = 0 ;
  cin >> n  ;
  ll a[n] = {0} ;
  ff(i, 0, n - 1)  cin >> x ,a[x -1]++ ;
  ff(i, 0, n) cout << a[i] << endl ;
}

Measured memory_bytes: 5216
#include <iostream>
#include <string>
#include <sstream>

using namespace std;

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

long long foo(string s,int x){
	rep(i,s.size()){
		if(s[i]=='X') s[i]=x+'0';
	}
	stringstream ss;
	ss<<s;
	long long t;
	ss>>t;
	return t; 
}

string foo2(string a,string b){
	int t=0;
	if(a.size()<b.size()) swap(a,b);
	rep(i,a.size()){
		a[i]-='0';
	}
	rep(i,b.size()){
		b[i]-='0';
	}
	int j=a.size()-1;
	for(int i=b.size()-1;i>=0;i--){
		bool f=false;
		if(a[j]+b[i]+t>=10) f=true;
		else f=false;
		a[j]=(a[j]+b[i]+t)%10;
		if(f) t=1;
		else t=0;
		j--;
	}
	bool f2=false;
	if(a.size()==b.size()&&t==1) f2=true;
	else{
		for(;j>=0;j--){
			if(t==0) break;
			bool f=false;
			if(a[j]+t>=10) f=true;
			else f=false;
			a[j]=(a[j]+t)%10;
			if(f) t=1;
			else t=0;
		}
		if(t==1) f2=true;
	}
	rep(i,a.size()){
		a[i]+='0';
	}

	if(f2) a="1"+a;
	// cout<<a<<endl;
	return a;
}
string foo3(string s,int a){
	rep(i,s.size()){
		if(s[i]=='X'){
			s[i]=a+'0';
		}
	}
	// cout<<s<<endl;
	return s;
}

int main(){
	string s;
	while(cin>>s){
		// cout<<s<<endl;
		stringstream ss;
		bool f=true;
		int x,y;
		rep(i,s.size()){
			if(s[i]=='+') x=i;
			if(s[i]=='=') y=i;
		}
		string a,b,c;
		a=s.substr(0,x);
		b=s.substr(x+1,y-x-1);
		c=s.substr(y+1);
		// cout<<a<<" "<<b<<" "<<c<<endl;
		if(a.size()>=2&&a[0]=='X') f=false;
		if(b.size()>=2&&b[0]=='X') f=false;
		if(c.size()>=2&&c[0]=='X') f=false;
		bool f2=true;
		rep(i,10){
			if(i==0&&f){
				// cout<<foo2(foo3(a,i),foo3(b,i))<<endl;
				if(foo2(foo3(a,i),foo3(b,i))==foo3(c,i)) {
					cout<<i<<endl;
					f2=false;
					break;
				}
			}
			else{
				if(foo2(foo3(a,i),foo3(b,i))==foo3(c,i)) {
					cout<<i<<endl;
					f2=false;
					break;
				}
			}
		}
		if(f2) cout<<"NA\n";
	}
}

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

int main() {
  int D, N;
  cin >> D >> N;
  
  int exp;
  
  if (D == 0) exp = 1;
  if (D == 1) exp = 100;
  if (D == 2) exp = 10000;
  
  if (N == 100) {
    cout << exp * 101 << endl;
  } else {
    cout << exp * N << endl;
  }
}

Measured memory_bytes: 256
#import pysnooper
#import os,re,sys,operator,math,heapq,string
#from collections import Counter,deque
#from operator import itemgetter
#from itertools import accumulate,combinations,groupby,combinations_with_replacement
from sys import stdin,setrecursionlimit
#from copy import deepcopy

setrecursionlimit(10**6)
input=stdin.readline

s=input().rstrip()
dp=[[0]*13 for _ in range(10**5+5)]
n=len(s)
dp[0][0]=1
mod=10**9+7
for i in range(n):
    c=-1 if s[i]=="?" else int(s[i])
    for j in range(10):
        if c!=-1 and c!=j:
            continue
        for k in range(13):
            dp[i+1][(k*10+j)%13]+=dp[i][k]
    for j in range(13):
        dp[i+1][j]%=mod
print(dp[n][5])

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

#define int             long long
#define FOR( i, m, n )  for( int (i) = (m); (i) < (n); (i)++ )
#define REP( i, n )     FOR( i, 0, n )
#define REPR( i, m )    for( int (i) = (m); (i) >= 0; (i)-- )
#define REPONE( i, n )  FOR( i, 1, n + 1 )
#define ALL( a )        (a).begin(), (a).end()
#define MP              make_pair

typedef pair<int, int> P;

template<class T>bool chmax( T& a, const T& b ) { if( a < b ) { a = b; return 1; } return 0; }
template<class T>bool chmin( T& a, const T& b ) { if( a > b ) { a = b; return 1; } return 0; }

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

signed main(){
    int x, a; cin >> x >> a;
    if( x < a ) cout << 0 << endl;
    else cout << 10 << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pb push_back
#define all(a) a.begin(), a.end()
#define sz(a) (int)a.size()
#define x first
#define y second
#define debug(...) cout << "[" << #__VA_ARGS__ << ": " << __VA_ARGS__ << "]\n"
#define rd() abs((int)rng())
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int>pii;
const int maxn = 1e5 + 100;
const int mod = 1e9 + 7;
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
int main()
{
	ios_base::sync_with_stdio(false), cin.tie(0);
	int a, p;
	cin >> a >> p;
	cout << (a * 3 + p) / 2;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;
const int maxn = 3e3 + 50;
const ll mod = 1e9+7;
double dp[maxn][maxn];
double p[maxn];
int n;
int main(){
    scanf("%d", &n);
    for(int i = 1; i <= n; i++) scanf("%lf", &p[i]);
    dp[1][0] = 1-p[1];
    dp[1][1] = p[1];    
    for(int i = 2; i <= n; i++){
        dp[i][0] = dp[i-1][0] * (1-p[i]);
        for(int j = 1; j < i; j++){
            dp[i][j] += dp[i-1][j-1] * p[i];
//            dp[i][j] += dp[]
            dp[i][j] += dp[i-1][j] * (1-p[i]);
        }
        dp[i][i] = dp[i-1][i-1] * p[i];
    }
    double ans = 0.0;
    for(int i = (n+1)/2; i <= n; i++)
        ans += dp[n][i];
    printf("%.10lf\n", ans);
    return 0;
}





Measured memory_bytes: 70272
#include <iostream>
#include <vector>
#include <map>
#include <queue>
#include <string>
#include <algorithm>
#include <cmath>
#include <climits>
#define REP(i, n) for(int i=0; i<(n); i++)
#define FOR(i, a, n) for(int i=(a); i<(n); i++)
using namespace std;

int main(){
    int p,q,r;
    cin >> p >> q >> r;
    int ans = p + q < q + r ? p + q : q + r;
    ans = ans < p + r ? ans : p + r;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
def DP_A() :
    N = int(input())
    h = [int(x) for x in input().split()]
    dp = [10**10]*(N+1)

    dp[0] = 0
    dp[1] = abs(h[1] - h[0])
    for i in range(2,N) :
        dp[i] = min(dp[i], dp[i-1] + abs(h[i] - h[i-1]))
        dp[i] = min(dp[i], dp[i-2] + abs(h[i] - h[i-2]))

    return dp[N-1]


print(DP_A())


Measured memory_bytes: 14052
#include <cstdio>
#include <cstring>
#include <unordered_map>

const int maxn = 3e5 + 7;
int acable[27];

char s[maxn];
int n, pre[maxn], dp[maxn];
std::unordered_map<int, int> opt;

int main() {
	for(int i = 1; i < 27; ++i) {
		acable[i] = 1 << (i - 1);
	}
	scanf("%s", s);
	n = strlen(s);
	for(int i = 1; i <= n; ++i) {
		pre[i] = pre[i - 1];
		pre[i] ^= 1 << (s[i - 1] - 'a');
	}
	dp[0] = 0;
	opt[0] = 0;
	for(int i = 1; i <= n; ++i) {
		dp[i] = 0x7fffffff;
		for(int j = 0; j < 27; ++j) {
			if(opt.find(pre[i] ^ acable[j]) != opt.end()) {
				dp[i] = std::min(dp[i], opt[pre[i] ^ acable[j]] + 1);
			}
		}
		if(opt.find(pre[i]) == opt.end()) {
			opt[pre[i]] = dp[i];
		} else {
			opt[pre[i]] = std::min(dp[i], opt[pre[i]]);
		}
	}
	printf("%d\n", dp[n]);
	return 0;
}


Measured memory_bytes: 9852
#include<bits/stdc++.h>
using namespace std;
//const int MAXN=10010;
int n,cnt;
int main(){
	cin>>n;
	for(int i=1;i<=n;i++){
		if(i>=1&&i<=9)
			cnt++;
		else if(i>=100&&i<=999)
			cnt++;
		else if(i>=10000&&i<=99999)
			cnt++;
	}
	cout<<cnt;
	return 0;
}


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

using namespace std;

int main(){
    
   
    string S,T;
    cin >> S >> T;
    
    int a = 0;
    for (int i = 0; i < 3; i++) {
        if (S[i] == T[i]) {
            a += 1;
        }
    }
    
    cout << a << endl;
    
}


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

namespace ABC078_C
{
    class Program
    {
        static void Main(string[] args)
        {
            var NM = Console.ReadLine().Split().Select(int.Parse).ToArray();
            var N = NM[0];
            var M = NM[1];
            long X = (100 * (N - M) + 1900 * M) * (long)Math.Pow(2,M);
            Console.WriteLine(X);
        }
    }
}


Measured memory_bytes: 13268
#include<cstdio>
#include<iostream>
#include<string.h>
#include<algorithm>
using namespace std;
int n,dp[100009],a[100009];
int xg(int a){
	if(a>0)
		return a;
	return -a;
}
int main(){
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>dp[i];
	}
	a[1]=xg(dp[1]-dp[0]);
	for(int i=2;i<n;i++)
		a[i]=min(a[i-1]+xg(dp[i]-dp[i-1]),a[i-2]+xg(dp[i]-dp[i-2]));
	cout<<a[n-1]<<endl;
	return 0;
}

Measured memory_bytes: 1024
from collections import deque


class Edge:
    def __init__(self, to, rev, cap):
        self.to = to
        self.rev = rev
        self.cap = cap


# 最大流問題を解く O(|E||V|^2)
class Dinic:
    def __init__(self, num_of_node: int):
        assert num_of_node > 0

        self.graph = [list() for _ in range(num_of_node)]   # グラフの隣接リスト表現
        self.level = [None] * num_of_node      # sからの距離
        self.ite = [None] * num_of_node       # どこまで調べ終わったか

    # fromからtoへ向かう容量capの辺をグラフに追加する
    def add_edge(self, f: int, t: int, cap: int):
        self.graph[f].append(Edge(t, len(self.graph[t]), cap))
        self.graph[t].append(Edge(f, len(self.graph[f]) - 1, 0))

    # sからtへの最大流を求める
    def max_flow(self, s: int, t: int):
        flow = 0
        while True:
            self.bfs(s)
            if self.level[t] < 0:
                return flow

            self.ite = [0] * len(self.ite)
            while True:
                f = self.dfs(s, t, 10 ** 10)
                if f > 0:
                    flow += f
                else:
                    break

    # sからの最短距離をBFSで計算する
    def bfs(self, s: int):
        self.level = [-1] * len(self.level)
        que = deque()
        que.append(s)
        self.level[s] = 0
        while len(que):
            v = que.popleft()

            for i in range(len(self.graph[v])):
                e = self.graph[v][i]
                if e.cap > 0 and self.level[e.to] < 0:
                    self.level[e.to] = self.level[v] + 1
                    que.append(e.to)

    # 増加パスをDFSで探す
    def dfs(self, v: int, t: int, f: int):
        if v == t:
            return f

        for i in range(0, len(self.graph[v])):
            e = self.graph[v][i]
            if e.cap > 0 and self.level[v] < self.level[e.to]:
                d = self.dfs(e.to, t, min(f, e.cap))
                if d > 0:
                    self.graph[v][i].cap -= d
                    self.graph[e.to][e.rev].cap += d
                    return d
            self.ite[v] = i
        return 0


def main():
    V, E = map(int, input().split())
    dinic = Dinic(V)
    for _ in range(E):
        u, v, c = map(int, input().split())
        dinic.add_edge(u, v, c)

    print(dinic.max_flow(0, V - 1))


if __name__ == '__main__':
    main()



Measured memory_bytes: 6328
#include<stdio.h>

int main(void)
{
  int a,b,d,r;
  double f;

  scanf("%d %d",&a,&b);
 
  d=a/b;
  r=a%b;
  f=(double)a/b;
      
  printf("%d %d %21.9f\n",d,r,f);

}



Measured memory_bytes: 2052
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rep3(i, l, n) for (int i = l; i < n; ++i)
#define max(a, b) (a > b ? a : b)
#define min(a, b) (a < b ? a : b)
#define chmax(a, b) a = (a >= b ? a : b)
#define chmin(a, b) a = (a <= b ? a : b)
#define out(a) cout << a << endl
#define outa(a, n) { rep(_, n) cout << a[_] << " "; cout << endl; }
#define outp(a, n) { cout << endl; rep(_, n) cout << a[_].F << " " << a[_].S << endl; }
#define SZ(v) (int)v.size()
#define inf (int)(1e9+7)
#define abs(x) (x >= 0 ? x : -(x))
#define ceil(a, b) a / b + !!(a % b)
#define FIX(a) fixed << setprecision(a)
#define LB(v, n) (int)(lower_bound(all(v), n) - v.begin())
#define UB(v, n) (int)(upper_bound(all(v), n) - v.begin())

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int n;
    cin >> n;
    
    vector<int> a(3 * n);
    rep(i, 3 * n) cin >> a[i];
    sort(all(a), greater<int>());
    // outa(a, 2 * n);
    
    ll sum = 0;
    rep(i, 2 * n) {
        if (i % 2 != 0) sum += a[i];
    }
    
    out(sum);
}



Measured memory_bytes: 1408
//#include "stdafx.h"
#include <iostream>
#include <set>
#include <queue>
#include <vector>
#include <algorithm>
#include <math.h>
#include <cmath>
#include <string>
#include <cstring>
#include <climits>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
#include <tuple>
#include <numeric>
#include <assert.h>
#include <functional>
#include <unordered_map>
#include <cstdint>
#include <complex>

using namespace std;

/*-----------------------------------------------------------------------------
　定義
 -------------------------------------------------------------------------------*/
#define REP(i, n)				for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n)			for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define INF						2e9
#define MOD						(1000 * 1000 * 1000 + 7)
#define Ceil(x, n)				(((((x))+((n)-1))/n))		/* Nの倍数に切り上げ割り算 */
#define CeilN(x, n)				(((((x))+((n)-1))/n)*n)		/* Nの倍数に切り上げ */
#define FloorN(x, n)			((x)-(x)%(n))				/* Nの倍数に切り下げ */
#define IsOdd(x)				(((x)&0x01UL) == 0x01UL)			
#define IsEven(x)				(!IsOdd((x)))						
#define ArrayLength(x)			(sizeof( x ) / sizeof( x[ 0 ]))
#define	MAX_QWORD				((QWORD)0xFFFFFFFFFFFFFFFF)
#define M_PI					3.14159265358979323846
typedef long long				ll;
typedef unsigned long long int	QWORD;
typedef unsigned long long		SQWORD;

/*-----------------------------------------------------------------------------
　幾何学ライブラリ
 -------------------------------------------------------------------------------*/
/* 基本要素 */
typedef double D;      // 座標値の型。doubleかlong doubleを想定
typedef complex<D> P;  // Point
typedef pair<P, P> L;  // Line
typedef vector<P> VP;
const D EPS = 1e-9;    // 許容誤差。問題によって変える
#define X real()
#define Y imag()
#define LE(n,m) ((n) < (m) + EPS)
#define GE(n,m) ((n) + EPS > (m))
#define EQ(n,m) (abs((n)-(m)) < EPS)
namespace std {
  bool operator<(const P a, const P b) {
    return a.X != b.X ? a.X < b.X : a.Y < b.Y;
  }
}

/*-----------------------------------------------------------------------------
　メイン
 -------------------------------------------------------------------------------*/
int main()
{
	int a, b;
	cin >> a >> b;
	int n = b - a;
	int ans = - a + n * (n - 1) / 2;
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <string.h>
#include <stack>
#define Endl endl
#define mp make_pair
#define ll long long 
#define pii pair<int,int>
#define pll pair<ll,ll>
#define over(A) {cout<<A<<endl;exit(0);}
#define all(A) A.begin(),A.end()
#define ceil(a,b) ((a-1)/b+1)
#define srand() mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define rand(l,r) uniform_int_distribution<int>(l,r)(rng)
#define time time179
typedef unsigned long long ull;
const int inf=1039074182;
using namespace std;
int n,k;
int time[100005];
int cost[100005];
int id[100005];
priority_queue <int> que;

bool compare(const int a,const int b)
{
	return time[a]<time[b];
}

int main()
{
//	freopen("input.txt","r",stdin);
	cin>>n>>k;
	for(int i=0;i<n;i++)
	{
		scanf("%d%d",time+i,cost+i);
		id[i]=i;
	}
	sort(id,id+n,compare);
	int res=0;
	int i=0;
	for(int day=k-1;day>=0;day--)
	{
		while(i<n && time[id[i]]+day<=k)
		{
			que.push(cost[id[i++]]);
		}
		if(!que.empty()) res+=que.top(),que.pop();
	}
	cout<<res<<endl;
	return 0;
}

Measured memory_bytes: 2044
n = int(input())
a = [int(i) for i in input().split()]
cnt = [0]*(10**5+1)
for i in range(n): cnt[a[i]] += 1
q = int(input())
s = sum(a)
for _ in range(q):
    b,c = map(int,input().split())
    s += (-b+c)*cnt[b]
    cnt[c] += cnt[b]
    cnt[b] = 0
    print(s)

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

	int main(){
    char a[6];
      
      for(int i = 0; i < 6;i++)cin >> a[i];
      
      if(a[2] == a[3]&&a[4]==a[5]){
        cout << "Yes";
      }else{
        cout << "No";
      }

	}


Measured memory_bytes: 256
#[cfg(debug_assertions)]
include! {"./debug.rs"}

#[cfg(not(debug_assertions))]
macro_rules! debug {
    ($($arg:expr),*) => {};
}

#[allow(unused_macros)]
macro_rules! read {
    ([$t:ty] ; $n:expr) =>
        ((0..$n).map(|_| read!([$t])).collect::<Vec<_>>());
    ($($t:ty),+ ; $n:expr) =>
        ((0..$n).map(|_| read!($($t),+)).collect::<Vec<_>>());
    ([$t:ty]) =>
        (rl().split_whitespace().map(|w| w.parse().unwrap()).collect::<Vec<$t>>());
    ($t:ty) =>
        (rl().parse::<$t>().unwrap());
    ($($t:ty),*) => {{
        let buf = rl();
        let mut w = buf.split_whitespace();
        ($(w.next().unwrap().parse::<$t>().unwrap()),*)
    }};
}

#[allow(dead_code)]
#[allow(deprecated)]
fn rl() -> String {
    let mut buf = String::new();
    std::io::stdin().read_line(&mut buf).unwrap();
    buf.trim_right().to_owned()
}

////////////////////////////////////////////////////////////////////////////////

fn main() {
    let n = read!(usize);
    let a = read!([i64]);

    let abssum: i64 = a.iter().map(|x| x.abs()).sum();

    let ans: i64 = if a.iter().filter(|&&x| x < 0).count() % 2 == 0 {
        abssum
    } else {
        abssum - a.iter().map(|x| x.abs()).min().unwrap().abs() * 2
    };

    println!("{}", ans);
}


Measured memory_bytes: 8444
#include<stdio.h>
#include<limits.h>

int main(void)
{
  int n;
  long long  sum=1;
  long long  a[100010];
  scanf("%d",&n);
  for(long i=0L;i<n;i++){
    scanf("%lld",&a[i]);
  }

  int zero=0;
  for(int i=0;i<n;i++){
    if(a[i]==0){
      zero++;
    }
  }

  if(zero>0){
    puts("0");
    return 0;
  }
  long long max=1000000000000000000;
  for(long i=0;i<n;i++){
    if(a[i]>max){
      puts("-1");
      return 0;
    }else{
      max/=a[i];
      sum*=a[i];
    }
  }


  printf("%lld\n",sum);
  return 0;
}


Measured memory_bytes: 2516
import java.util.Scanner;


public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in); 

		int n = sc.nextInt();
		int w = sc.nextInt();

		int[] dp = new int[w + 1];
		for (int i = 0; i < n; i++) {
			int v = sc.nextInt();
			int wi = sc.nextInt();
					
			for (int j = w; j >= wi; j--) {
				dp[j] = Math.max(dp[j], dp[j - wi] + v);
			}
		}
		
		System.out.println(dp[w]);

		sc.close();
	}
}

Measured memory_bytes: 20544
def search(num):
    i = num[0]
    ind = 2
    count = 0

    for j in list(num[1:len(num)]):
        for k in list(num[ind:len(num)]):
            if i != j and i != k and j != k:
                lst = []
                lst.append(int(i))
                lst.append(int(j))
                lst.append(int(k))
                lst.sort()
                if lst[2] < lst[0] + lst[1]:
                    count += 1

        ind += 1

    return count


def main():
    n = int(input())
    num = list(map(int, input().split()))
    
    count = 0
    for i in range(len(num)-2):
        count += search(num[i:len(num)])
    
    print(count)

if __name__ == '__main__':
    main()


Measured memory_bytes: 9208
#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    cin>>s;
    int l=s.size();
    int coun;
    if(l==1)
    {
        if(s[0]=='R')
        {
            coun=1;
        }
        else
        {
            coun=0;
        }
    }
    if(l==2)
    {
        if(s[0]=='R'&&s[1]=='R')
        {
            coun=2;
        }
        else if(s[0]=='S'&&s[1]=='S')
        {
            coun=0;
        }
        else if((s[0]=='S'&&s[1]=='R')||(s[0]=='R'&&s[1]=='S'))
        {
            coun=1;
        }
    }
    else if(l==3)
    {
        if(s[0]=='S'&&s[1]=='S'&&s[2]=='S')
        {
            coun=0;
        }
        else if((s[0]=='S'&&s[1]=='S'&&s[2]=='R')||(s[0]=='S'&&s[1]=='R'&&s[2]=='S')||(s[0]=='R'&&s[1]=='S'&&s[2]=='S')||(s[0]=='R'&&s[1]=='S'&&s[2]=='R'))
        {
            coun=1;
        }
        else if((s[0]=='S'&&s[1]=='R'&&s[2]=='R')||(s[0]=='R'&&s[1]=='R'&&s[2]=='S'))
        {
            coun=2;
        }
    }
    cout<<coun<<endl;
}


Measured memory_bytes: 3624
n = int(input())

count = 0
for i in range(n):
    a, b = map(int, input().split())


    if count == 3:
        continue
    else:
        if a == b:
            count+=1
        else:
            count = 0



if count == 3:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 9172
#include<iostream>
using namespace std;
int main(void){
  int i[5]={0},j;
  cin >> i[0] >> i[1] >> i[2];
	for(j=0;j<3;j++){
      if(i[j]==5){
        i[3]++;
      }else if(i[j]==7){
        i[4]++;
      }
    }
  
  if(i[3]!=2&&i[4]!=1){
    cout<<"NO"<<endl;
  }else{
    cout<<"YES"<<endl;
  }
  
  return 0;
}

Measured memory_bytes: 256
package main

import (
  "fmt"
)

func main() {
  var k, s int
  fmt.Scanf("%d %d", &k, &s)

  ans := createAnswer(k, s)
  fmt.Println(ans)
}

// s = x + y + z を満たす組み合わせは何通り存在するのかを確認する
func createAnswer(k, s int) (ans int) {
  for x := 0; x <= k; x++ {
    for y := 0; y <= k; y++ {
      z := s - x - y
      if z >= 0 && z <= k {
        ans++
      }
      if z < 0 {
        break
      }
    }
  }
  return ans
}


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

#define _GLIBCXX_DEBUG
#define all(v) (v).begin(),(v).end()

using namespace std;

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

const ll INF=1LL<<60;
const int MOD=1e9+7;

vector<pii> visit;
int order=1;

void dfs(vector<vi> &G, int v){
    visit[v].first=order;
    order++;
    for(auto nv: G[v]){
        if(visit[nv].first != -1) continue;
        dfs(G, nv);
    }
    visit[v].second=order;
    order++;
}

int main(){
    int n; cin >> n;
    vector<vi> G(n+1);
    visit.assign(n+1, {-1,-1});
    for(int i=0; i<n; i++){
        int u, k; cin >> u >> k;
        for(int j=0; j<k; j++){
            int v; cin >> v;
            G[u].push_back(v);
        }
    }
    for(int i=1; i<=n; i++){
        if(visit[i].first != -1) continue;
        dfs(G, i);
    }
    for(int i=1; i<=n; i++){
        cout << i << " " << visit[i].first << " " << visit[i].second << endl;
    }
    return 0;
}




Measured memory_bytes: 3156
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <stack>
#include <climits>
#include <map>
#include <set>

using namespace std;

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

const ll mod = 1000000007;
const int inf = 1e9;
const long long INF = 1LL << 60;

bool dp[100200];

int main()
{
    int n;
    cin >> n;
    dp[0] = true;
    
    for(int i = 0; i <= n; i++){
        if(dp[i]){
            for(int j = 100; j <= 105; j++){
                dp[i+j] = true;
            }
        }
    }
    if(dp[n]){
        cout << 1 << endl;
    }else{
        cout << 0 << endl;
    }
}


Measured memory_bytes: 384
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<algorithm>
using namespace std;
char s1[15], s2[15], s3[15];
int main()
{
	scanf("%s %s %s", s1, s2, s3);
	printf("%c%c%c\n", s1[0] - 32, s2[0] - 32, s3[0] - 32);
}

Measured memory_bytes: 128
// --------------------<optimizations>--------------------
#pragma GCC optimize("O3")
//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN TRYING TO BRUTEFORCE WITH A LOT OF LOOPS)\
#pragma GCC optimize("unroll-loops")

#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")

#include<bits/stdc++.h>

using namespace std;

#define ll long long
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define pii pair<ll,ll>
#define vpii vector<pair<ll,ll> >
#define F first
#define S second
#define ld long double
#define built __builtin_popcountll
#define mst(a,i) memset(a,i,sizeof(a))
#define all(x) x.begin(),x.end()
#define itit(it,a) for(auto it=(a).begin(); it!=(a).end(); it++)
#define rep(i,a,b) for(ll i=a; i<b; i++)
#define repr(i,a,b) for(ll i=a; i>b; i--)
#define reprr(i,a,b) for(ll i=a; i>=b; i--)
#define pi 3.14159265358979323846264338327950288419716939937510582097494459230
ll max3(ll x,ll y,ll z) {return max(max(x,y),z);}
ll min3(ll x,ll y,ll z) {return min(min(x,y),z);}
const ll M=2e5+10,M2=1e6+10,mod=1e9+7,inf=1e17+10;
const int INF=1e9+7;
void add(int& a, int b) {a+=b;if(a>=mod){a-=mod;}}
#define trace1(x)                    cerr<<#x<<": "<<x<<endl
#define trace2(x, y)                 cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)                 cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)             cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)         cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f)     cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
int X[] = {0, 1, 0, -1};
int Y[] = {-1, 0, 1, 0};
ll power(ll x,ll n){ll result=1;while(n>0){if(n%2==1)result=(result*x)%mod; x=((x%mod)*(x%mod))%mod;n=n/2;}return result;}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    string a,b,c;
    cin >> a >> b >> c;
    cout << char(a[0]-32) << char(b[0]-32) << char(c[0]-32);
    return 0;
}
/* The judge is never wrong! Your code is buggy
   Look for:
 * * Read the problem carefully.
 * * Don't forget to sort(), mod, ll!!!!
 * * Initial value = +/- infinity instead of zero!!!
 * * an easier and alternate approach
 * * read the problem statement carefully
 * * if concept is correct and still WA, try with a different implementation
 * * special cases (n=1?)
 * * if you have no idea just guess the appropriate well-known algorithm instead of doing nothing :/
 */

Measured memory_bytes: 256
#include "bits/stdc++.h"
#define rep(i,b) for(ll i=0;i<b;i++)
#define ll long long
using namespace std;
/*--Input//////////////////////////////////////////////////*/
inline void IN(void){return;}
template <typename First, typename... Rest>
void IN(First& first, Rest&... rest){
    cin >> first;
    IN(rest...);
    return;
}
#define SS(T, ...)      T __VA_ARGS__; IN(__VA_ARGS__);
/*--Output/////////////////////////////////////////////////*/
inline int p(void){cout << endl; return 0;}
template<class Head> int p(Head&& head){cout << head;p();return 0;} template<class Head,class... Tail> int p(Head&& head,Tail&&... tail){cout<<head<<" ";p(forward<Tail>(tail)...);return 0;}
struct ProconInit {
    static constexpr int IOS_PREC = 15;
    static constexpr bool AUTOFLUSH = false;

    ProconInit() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(IOS_PREC);
        if(AUTOFLUSH)
            cout << unitbuf;
    }
} PROCON_INIT;


#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vvvl vector<vector<vector<ll>>>
#define debug(x) cerr<<#x<<" "<<x<<'\n';
#define all(x) (x).begin(),(x).end()
#define bit(n) (1LL<<(n))
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
bool cmp(pair<ll,ll> a, pair<ll,ll> b) { return a.second < b.second; }

const int MOD = 1000000007;

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

int main() {
    SS(ll,n)SS(ll,k,r,s,p)SS(string,t)
    ll sum = 0;
    rep(i, n) {
        if(i >= k && t[i] == t[i - k]) t[i] = 'x';
        if(t[i] == 'r') sum += p;
        if(t[i] == 's') sum += r;
        if(t[i] == 'p') sum += s;
    }
    cout << sum << endl;
}

Measured memory_bytes: 512
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>

#define int long long
#define MOD7 1000000007
#define MOD9 1000000009

#define rep(i, n) for (int i = 0; i < (n); i++)
#define itrep(i, a) for (auto i = (a).begin(); i != (a).end(); i++)
#define REP(i, a, n) for (int i = (a); i <= (n); i++)
#define all(a) (a).begin(), (a).end()
#define mp(a, b) make_pair((a), (b))

using namespace std;

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

template<class T> void inputVector(vector<T>& v, int n) {
    v.resize(n);
    for (int i = 0; i < v.size(); i++) cin >> v[i];
}

signed main() {
    int H, W, N;
    cin >> H >> W >> N;

    int V = max(H, W);

    cout << (N + V - 1) / V << endl;

    return 0;
}


Measured memory_bytes: 768