akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;

#define fastio 			ios::sync_with_stdio(0);	cin.tie(0); cout.tie(0);  cout<<fixed;  cout<<setprecision(12);
#define randomINT 		mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define	newl 			cout<<"\n"
#define DISP(as)		for(auto it : as) cout<<it<<" ";newl;
#define all(x)         	(x).begin(),(x).end()
#define mset(x,val)    	memset(x,val,sizeof(x))
#define newl           	cout<<"\n"
#define pb             	push_back
#define mp             	make_pair
#define f 				first
#define s 				second
#define dline          cerr<<"///REACHED///\n";
#define deb1(x)        cerr<<#x<<" = "<<x<<'\n';
#define deb2(x,y)      cerr<<'['<<#x<<','<<#y<<"] = "<<'['<<x<<','<<y<<']'<<'\n';
#define deb3(x,y,z)    cerr<<'['<<#x<<','<<#y<<','<<#z<<"] = "<<'['<<x<<','<<y<<','<<z<<']'<<'\n';

typedef long long 				ll;
typedef long double 			ld;
typedef vector<ll> 				vll;
typedef pair<ll , ll> 			pll;
typedef pair<ld, ld> 			pld;
typedef unordered_map<ll, ll> 	um;
typedef vector<pll> 			vpll;

const ll 	MAX5 	= 	1e+5 + 7;
const ll 	MAX7 	= 	1e+7 + 7;
const ll 	MAXN 	= 	MAX7;
const ll   	INF   	=  	0x7f7f7f7f7f7f7f7f;
const int  	INFi 	=  	0x7f7f7f7f;
const ll 	MOD		=  	1e+9 + 7;

vll adj[MAXN]; ll visit[MAXN] = {};
int dx8[] = {0, 1, 1, 1, 0, -1, -1, -1}, dy8[] = {1, 1, 0, -1, -1, -1, 0, 1};
int dx4[] = {0, 1, 0, -1}, dy4[] = {1, 0, -1, 0};

// <------------- Declare Variables Here ------------> //

ll T = 1;
ll n, x, y, r, p;
string s, t;
// <------------- Implement Functions Here ----------> //



// <------------- Start of main() -------------------> //

void MAIN() {
	cin >> n;
	vll a(n+1),b(n+1),c(n);

	for(ll i=1;i<=n;i++) cin>>a[i];
	for(ll i=1;i<=n;i++) cin>>b[i];
	for(ll i=1;i<n;i++) cin>>c[i];

	ll sum = accumulate(all(b),0);
	
	for(ll i=2;i<=n;i++) {
		if(a[i]-1 == a[i-1]) {
			sum += c[a[i-1]];
		}
	}

	cout<<sum;
}

int main() {
	fastio; randomINT;
	//cin>>t;
	while (T--) {
		MAIN();
	}
	return 0;
}


Measured memory_bytes: 237992
#include <iostream>
#include <string>

using namespace std;

int main(){
    string str;
    while(cin >> str){
        if(str == "-")
            break;
        int m;
        cin >> m;
        int h;
        for(int i = 0; i < m; i++){
            cin >> h;
            str = str.substr(h, str.size() - h) + str.substr(0, h);
        }
        cout << str << endl;
    }
    return 0;
}


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

int main() {
    int a, b;

    while (1) {
        cin >> a >> b;
        if (a == 0 && b == 0) break; 
        for(int i = 0; i < a; i ++ ) {
            for (int n = 0; n < b; n++) {
                cout << "#";
            }
            cout << "\n";

        }
        cout << endl;
    }

    return 0;
}


Measured memory_bytes: 3112
#include<bits/stdc++.h>
#define Tp template<typename Ty>
#define Ts template<typename Ty,typename... Ar>
#define Reg register
#define RI Reg int
#define Con const
#define CI Con int&
#define I inline
#define W while
#define N 100000
#define X 998244353
#define Inc(x,y) ((x+=(y))>=X&&(x-=X))
using namespace std;
int n,pw[N+5];
class FastIO
{
	private:
		#define FS 100000
		#define tc() (A==B&&(B=(A=FI)+fread(FI,1,FS,stdin),A==B)?EOF:*A++)
		#define D isdigit(c=tc())
		char c,*A,*B,FI[FS];
	public:
		I FastIO() {A=B=FI;}
		Tp I void read(Ty& x) {x=0;W(!D);W(x=(x<<3)+(x<<1)+(c&15),D);}
}F;
class Graph
{
	private:
		#define add(x,y) (e[++ee].nxt=lnk[x],e[lnk[x]=ee].to=y)
		int m,ee,lnk[N+5],SG[N+5],vis[N+5];struct edge {int to,nxt;}e[2*N+5];
		I void dfs(CI x)
		{
			RI i;for(i=lnk[x];i;i=e[i].nxt) x<e[i].to&&!~SG[e[i].to]&&(dfs(e[i].to),0);
			for(i=lnk[x];i;i=e[i].nxt) x<e[i].to&&(vis[SG[e[i].to]]=x);
			for(SG[x]=0;vis[SG[x]]==x;++SG[x]);
		}
	public:
		int Mx,tot[N+5];
		I void Init()
		{
			RI i,x,y;for(F.read(m),i=1;i<=m;++i) F.read(x),F.read(y),add(x,y),add(y,x);
			for(i=1;i<=n;++i) SG[i]=-1;for(i=1;i<=n;++i)
				!~SG[i]&&(dfs(i),0),Mx<SG[i]&&(Mx=SG[i]),Inc(tot[SG[i]],pw[i]);
		}
}G1,G2,G3;
int main()
{
	RI i,j,ans=0;F.read(n);
	for(pw[0]=1,pw[1]=(long long)1e18%X,i=2;i<=n;++i) pw[i]=1LL*pw[i-1]*pw[1]%X;
	for(G1.Init(),G2.Init(),G3.Init(),i=0;i<=G1.Mx;++i)
		for(j=0;j<=G2.Mx;++j) ans=(1LL*G1.tot[i]*G2.tot[j]%X*G3.tot[i^j]+ans)%X;
	return printf("%d",ans),0;
}

Measured memory_bytes: 9344
import sys
from itertools import combinations

while True:
    c, n = map(int, raw_input().split())
    if c == n == 0:
        break

    # sum(cC3) == 9
    count = 0
    for i in combinations(range(1, c + 1),3):
        if sum(i) == n:
            count += 1
    print count

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

#define endl '\n'
#define INF 1e9 + 10
#define rep(i,s,n)      for (int i = s ; i < n ; i++)
#define repp(i,s,n)    for (int i = s ; i <= n ;i++)
#define all(a)      a.begin(),a.end()
#define sz(v)    (int)v.size()
#define digg(n)    ((long long)log10(n)+1)
#define Unique(n)         (n).erase(unique(all(n)), (n).end())
#define tests    int s ; cin >> s; while (s--)
#define test    int tt = 1 ; while (tt--)
#define readArr    int n ; cin >> n ; int arr[n]; rep(i,0,n)cin>>arr[i]
#define isvowel(a)   (a == 'a' || a == 'e' || a == 'i' || a == 'o' || a == 'u')
#define fast     ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define pb push_back
#define s second
#define f first
#define deb(...)                 __f(#__VA_ARGS__, __VA_ARGS__)

template <typename Arg1>
void __f(const char* name, Arg1&& arg1)
{
    cerr << name << " : " << arg1 <<'\n';
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args)
{
    const char* comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << " : " << arg1 << " | ";
    __f(comma + 1, args...);
}

// to be noted >> corner cases >>

typedef long long ll ;
typedef pair<int,int> pii;
typedef vector<long long> vll;
typedef vector<pii>vii;
typedef map<long long, long long> mll ;


void readFromText ()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
#endif // ONLINE_JUDGE
}

void print(int arr [], int n)
{
    rep(i,0,n)cout<< arr[i] << " ";
    cout << endl ;
}

vll dig(ll n)
{
    vll res;
    if(n == 0)
    {
        res.pb(0);
        return res;
    }
    while(n != 0)
        res.pb(n % 10), n /= 10;
    return res;
}

vll bin(ll a)
{
    vll res;
    while(a != 0)
        res.pb(a % 2), a /= 2;
    while((ll)res.size() != 64)
        res.pb(0);
    return res;
}

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

string longDivision(string number, long long divisor)
{
    string out;
    int indx = 0;
    long long temp = number[indx] - '0';
    while (temp < divisor)
        temp = temp * 10 + (number[++indx] - '0');
    while (number.size() > indx)
    {
        out += (temp / divisor) + '0';
        temp = (temp % divisor) * 10 + (number[++indx] - '0');
    }
    if (out.length() == 0)
        return "0" ;
    return out;
}

//bool fun (item i , item j) {
//
//}

const double Pi = acos(-1.0);
const int MAX = 2e5 ;
int pref[MAX+9];

int main()
{
    fast;
//    readFromText();
    test{
        ll a ;  cin >> a;
        ll ans = a + pow(a,2) + pow(a,3);
        cout << ans << endl ;
    }
    return 0;
}


Measured memory_bytes: 4032
void main(){
	string s = inelm!string();
	writeln( s.lastIndexOf('Z') - s.indexOf('A')+1 );
}
     
import std.stdio, std.conv, std.algorithm, std.numeric, std.string, std.math, std.range;
const long mod = 10^^9+7;      
// 1要素のみの入力
T inelm(T= int)(){
	return to!(T)( readln().chomp() );
}
     
// 1行に同一型の複数入力
T[] inln(T = int)(){
	T[] ln;
	foreach(string elm; readln().chomp().split())ln ~= elm.to!T();
	return ln;
}


Measured memory_bytes: 2816
k, n = map(int, input().split())
a = list(map(int, input().split()))
ma = min(a)
a = [x - ma for x in a]
a.append(k)
md = 0
for i in range(len(a) - 1):
    if md < (a[i+1] - a[i]):
        md = a[i+1] - a[i]
print(k - md)

Measured memory_bytes: 26060
#include <bits/stdc++.h>
#include <math.h>
#include <vector>
#include <queue>
#include <iomanip>
#include <string>
#include <algorithm>
using namespace std;
using Graph = vector<vector<int>>;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep_1 (i,j,n) for(int i=j;i<n;i++)
typedef long long ll;
typedef long l;
const ll l_INF = 101010101000;
const int INF = 1010101010;
const int dx[4] = {-1,0,1,0};
const int dy[4] = {0,-1,0,1};
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int,int>;

int main(){
  int q; cin>>q;
  int s[101010];
  for(int i=3;i<101010;i++){
    s[i]=s[i-1];
    bool judge1=true,judge2=true;
    for(int j=2;j<=sqrt(i);j++){
      if(i%j==0){
        judge1=false;
      }
    }
    for(int j=2;j<=sqrt((i+1)/2);j++){
      if(((i+1)/2)%j==0){
        judge2=false;
      }
    }
    if(judge1&&judge2) s[i]++;
  }
  rep(i,q){
    ll l,r;
    cin>>l>>r;
    cout << s[r]-s[l-1] << endl;
  }
  //チェック
  //rep(i,50) cout <<s[i]<<endl;
}


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

int main() {
  char c;
  cin >> c;
  
  if (c == 'a' || c == 'i' || c == 'u' || c == 'e' || c == 'o') {
    cout << "vowel" << endl;
  }
  else {
    cout << "consonant" << endl;
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rep_ll(i,n) for(ll i = 0; i < (ll)(n); i++)

using namespace std;
 
typedef long long ll;
typedef unsigned long long u_ll;
typedef pair<int, int> pair_;

const long double PI = (acos(-1));
 
const int INF = 1001001001;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
 
int gcd(int a, int b){
    if(b == 0) return a;
 
    return gcd(b, a%b);
}
 
int main(){
   double a,b,h,m; 
   cin >> a >> b >> h >> m;

   vector<double> h_(2,0);
   vector<double> m_(2,0);

   h_[0]=a*sin((h/12*360+m/60*30)/180*PI);
   h_[1]=a*cos((h/12*360+m/60*30)/180*PI);

   m_[0]=b*sin(m/60*2*PI);
   m_[1]=b*cos(m/60*2*PI);

   double hh=(h_[0]-m_[0])*(h_[0]-m_[0]);
   double mm=(h_[1]-m_[1])*(h_[1]-m_[1]);
   
    double l=sqrt(hh+mm);

    cout << fixed << setprecision(9) << l;

   return 0;
}

Measured memory_bytes: 4192
#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int MOD = 1e9 + 7;
typedef long long ll;
typedef long double ld;
const int maxn = 3e5 + 100;
ll dp[61][2][2]; // текущий бит / меньше суффикса или равен | больше суффикса
// ... / есть перенос на тек. бит в v
void add(ll &a, const ll b) {
    a += b;
    if (a >= MOD) {
        a -= MOD;
    }
}
int main() {
    ll n;
    cin >> n;
    constexpr int bits = 60;
    string s = bitset<bits>(n).to_string();
    reverse(s.begin(),s.end());
    dp[0][0][0] = 1; // 0 small , 1 bigger
    for (int i = 0; i < s.size(); ++i) {
        for (int smaller = 0; smaller < 2; ++smaller) {
            for (int ov = 0; ov < 2; ++ov) {
//                cout << i << " " << smaller << " " << ov << " " << dp[i][smaller][ov] << endl;
                for (int e = 0; e < 3; ++e) {
                    int is_1 = ((ov + e) & 1);
                    int overflow = ((ov + e) >= 2);
                    if (s[i] == '0') {
                        add(dp[i + 1][is_1 ? 1 : smaller][overflow], dp[i][smaller][ov]);
                    } else {
                        add(dp[i + 1][is_1 ? smaller : 0][overflow], dp[i][smaller][ov]);
                    }
                }
            }
        }
    }
//    for (int i = 0; i < 2; ++i) {
//        for (int o = 0; o < 2; ++o) {
//            cout << s.size() << " " << i << " " << o << " " << dp[s.size()][i][o] << endl;
//        }
//    }
    cout << dp[s.size()][0][0];
}


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

int num_swap = 0;

// Selection sort
void selection_sort(int A[], int n)
{
	for (int i = 0; i < n; i++) {
		int min = i;
		for (int j = i + 1; j < n; j++) {
			if (A[j] < A[min])
				min = j;
		}
		// Swap
		if (min != i) {
			num_swap++;
			int tmp;
			tmp = A[min];
			A[min] = A[i];
			A[i] = tmp;
		}
	}
}

int main(int argc, char** argv)
{
	// Input
	int n;
	cin >> n;
	int A[100];
	for (int i = 0; i < n; i++)
		cin >> A[i];
	// Selection sort
	selection_sort(A, n);
	// Output
	for (int i = 0; i < n; i++) {
		if (i)
			cout << " ";
		cout << A[i];
	}
	cout << endl << num_swap << endl;
	return 0;
}

Measured memory_bytes: 3096
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <iomanip>
#include <cmath>
#include <map>
#include <set>
#include <ctype.h>
#include <numeric>
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
const ll MOD = 1e9 + 7;
const int INF = 1e9;

int dx4[4] = { 0, -1, 1, 0 };
int dy4[4] = { -1, 0, 0, 1 };
int dx8[8] = { 0, -1, 1, 0, -1, 1, -1, 1 };
int dy8[8] = { -1, 0, 0, 1, -1, -1, 1, 1 };

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

  auto digitSum = [](int num) {
    int sum = 0;
    while (num != 0) {
      sum += num % 10;
      num /= 10;
    }
    return sum;
  };

  int fx = digitSum(n);
  if (n % fx == 0) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 764
def binaryArraySearch(ordered, t):
  low = 0
  high = len(ordered) - 1

  while low <= high:
    mid = (low + high) // 2
    if t == ordered[mid]:
      return True
    elif t < ordered[mid]:
      high = mid - 1
    else:
      low = mid + 1
  return False


n = int(input())
S = [int(x) for x in input().split()] # 昇順に整列されている
q = int(input())
T = [int(x) for x in input().split()]

count = 0
for target in T:
  if binaryArraySearch(S, target):
    count += 1

print(count)

Measured memory_bytes: 21092
#include <stdio.h>
//sorting_tree_numbers.c

int main(void) {
	int a, b, c, x;
	
	scanf("%d %d %d", &a, &b, &c);
	
	if(a > b) {
		x = a;
		a = b;
		b = x;
	}
	
	if(a > c) {
		x = a;
		a = c;
		c = x;
	}
	
	if(b > c) {
		x = b;
		b = c;
		c = x;
	}
	
	printf("%d %d %d\n", a, b, c);
	
	return 0;
}

Measured memory_bytes: 596
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P  = pair <int, int>;

#define rep(i, n)     for (int i = 0; i < (int) (n); i++)
#define repr(i, a, b) for (int i = a; i < b; i++)
#define each(i, mp)   for (auto &i : mp)

const int INF = 1001001001;
const int takahashi = 998244353;
const int mod       = 998244353;
struct mint {
  ll x; // typedef long long ll;
  mint(ll 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
  {
    return mint(*this) += a;
  }

  mint operator-(const mint a) const
  {
    return mint(*this) -= a;
  }

  mint operator*(const mint a) const
  {
    return mint(*this) *= 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
  {
    return mint(*this) /= a;
  }
};

istream &operator>>(istream &is, mint &a)
{
  return is >> a.x;
}

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

ll  ans = 0;
int n, k;
ll minus_counter(ll n, ll tmp)
{
  ll counter = 0;
  while (1) {
    n -= tmp;
    if (n < 0) {
      return counter;
    }
    else {
      counter++;
    }
  }
}

int main()
{
  cin >> n >> k;
  vector <int> l(k);
  vector <int> r(k);
  rep(i, k) {
    cin >> l[i];
    cin >> r[i];
  }
  // vector <int> s;
  // rep(i, k) {
  //   repr(j, l[i], r[i] + 1) {
  //     s.push_back(j);
  //   }
  //   if (l[i] == r[i]) { s.push_back(l[i]); }
  // }
  // sort(s.begin(), s.end());
  // s.erase(std::unique(s.begin(), s.end()), s.end());
  // vector <ll> save_counter;
  // rep(i, s.size()) {
  //   save_counter.push_back(minus_counter(n, s[i]));
  // }
  vector <mint> dp(n + 1);
  vector <mint> dpsum(n + 1);
  dp[1]    = 1;
  dpsum[1] = 1;
  for (int i = 2; i <= n; ++i) {
    rep(j, k) {
      // [l[i], r[i]]
      int li = i - r[j];
      int ri = i - l[j];
      if (ri < 0) { continue; }
      li     = max(li, 1);
      dp[i] += dpsum[ri] - dpsum[li - 1]; // dp[li]~dp[ri];
    }
    dpsum[i] = dpsum[i - 1] + dp[i];
  }
  cout << dp[n] << endl;

  return 0;
}


Measured memory_bytes: 6432
#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
const long long LINF = 1e18;
#define dump(x)  cout << 'x' << ' = ' << (x) << ` `;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
typedef long long ll;
using namespace std;
typedef pair<ll, ll> P;

int main(int argc, char const *argv[]) {
    int n;
    cin >> n;
    vector<P> c;
    REP(i,n) {
        ll a, b;
        cin >> a >> b;
        c.emplace_back(b,a);
    }

    sort(c.begin(), c.end());

    int now = 0;
    bool ok = true;

    REP(i,n) {
        ll a = c[i].second; ll b = c[i].first;
        now += a;
        if (now > b) ok = false;
    }

    if(ok) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 6384
#include "bits/stdc++.h"
using namespace std;
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef pair<ll, ll>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 (b<a) { a=b; return 1; } return 0; }
void SAY(bool YES){cout<<(YES?"YES":"NO")<<endl;};
void Say(bool Yes){cout<<(Yes?"Yes":"No")<<endl;};

const ll MOD = 1000000007;

int main(){

    ll x, a, b;
    cin >> x >> a >> b;
    if(a - b >= 0)cout << "delicious" << endl;
    else if(a + x - b >= 0)cout << "safe" << endl;
    else cout << "dangerous" << endl;

    return 0;
}

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

using namespace std;

ll sum=0;
int cnt=0;
priority_queue<int> manji;
priority_queue<int, vector<int>, greater<int> >veci;
ll summ,sumv;

void dodaj(int a)
{
    if(cnt>1 && a>manji.top())
        veci.push(a), sumv+=a;
    else
        manji.push(a), summ+=a;
    if(manji.size()<veci.size())
    {
        int tek=veci.top();
        veci.pop();
        sumv-=tek;
        manji.push(tek);
        summ+=tek;
    }
    if(manji.size()-1>veci.size())
    {
        int tek=manji.top();
        //cout<<"*"<<tek<<endl;
        manji.pop();
        summ-=tek;
        veci.push(tek);
        sumv+=tek;
    }
}

int mediana()
{
    return manji.top();
}

ll f(int x)
{
    ll ret=0;
    if(cnt%2==1)
        ret+=x;
    ret+=sum;
    ret+=sumv;
    //cout<<"*"<<sumv<<" "<<summ<<"  "<<sum<<endl;
    ret-=summ;
    return ret;
}

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

	int q;
	cin>>q;
	int t,a,b;
	summ=sumv=0;
	while(q--)
    {
        cin>>t;
        if(t==1)
        {
            cin>>a>>b;
            sum+=b;
            cnt++;
            dodaj(a);
        }
        else
        {
            int x=mediana();
            cout<<x<<" "<<f(x)<<endl;
        }

    }


	return 0;
}


Measured memory_bytes: 3452
var
  l,i:longint;
  s:string;
begin
  readln(s);
  l:=pos('C',s);
  if l=0 then begin writeln('No');exit;end;
  for i:=length(s) downto l+1 do
    if s[i]='F' then begin writeln('Yes');exit;end;
  writeln('No');
end.

Measured memory_bytes: 128
/*{{{*/
//#define HOME
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;

#define MP make_pair
#define MT make_tuple
#define PB push_back
#define EB emplace_back
#define F first
#define S second

template<class T> void _R(T &_x) { cin >> _x; }
void _R(int &_x) { scanf("%d", &_x); }
void _R(int64_t &_x) { scanf("%" SCNd64, &_x); }
void _R(double &_x) { scanf("%lf", &_x); }
void _R(char &_x) { scanf(" %c", &_x); }
void _R(char *_x) { scanf("%s", _x); }
template<class T, class U> void _R(pair<T, U> &_x) {_R(_x.F); _R(_x.S);}
void R() {}
template<class T, class... U> void R(T &_head, U &... _tail) { _R(_head); R(_tail...); }

template<class T> void _W(const T &_x) { cout << _x; }
void _W(const int &_x) { printf("%d", _x); }
void _W(const int64_t &_x) { printf("%" PRId64, _x); }
void _W(const double &_x) { printf("%.16f", _x); }
void _W(const char &_x) { putchar(_x); }
void _W(const char *_x) { printf("%s", _x); }
template<class T, class U> void _W(const pair<T, U> &_x) {_W(_x.F); putchar(' '); _W(_x.S);}
template<class T> void _W(const vector<T> &_x) { for (auto i = _x.begin(); i != _x.end(); _W(*i++)) if (i != _x.cbegin()) putchar(' '); }
void W() {}
template<class T, class... U> void W(const T &_head, const U &... _tail) { _W(_head); putchar(sizeof...(_tail) ? ' ' : '\n'); W(_tail...); }
template<class T, class... U> void DB(const T &_head, const U &... _tail) {
#ifdef HOME
    W('#', _head, _tail...);
#endif
}

#define SZ(x) (int)((x).size())
#define ALL(x) (x).begin(), (x).end()
#define RAN(x,n) (x).begin(), (x).begin()+(n)
#define UNIQUE(x) {sort(ALL(x)); (x).erase(unique(ALL(x)), (x).end());}

#define REP(i,a,b) for (int i = (a); i <= (b); ++i)
#define REPD(i,a,b) for (int i = (a); i >= (b); --i)
#define FORI(i,n) REP(i,1,n)
#define FOR(i,n) REP(i,0,int(n)-1)
//#define ITER(i,t) for (auto i = t.begin(); i != t.end(); ++i)
#define IT3(i,st,ed) for (auto i = st; i != ed; ++i)
#define IT2(i,range) IT3(i,range)

#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define MS(X, v) memset((X), (v), sizeof((X)))

template<class T> using MaxHeap = priority_queue<T>;
template<class T> using MinHeap = priority_queue<T, vector<T>, greater<T>>;

typedef int64_t ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;

inline int LG (const unsigned int &_x) { return 31-__builtin_clz(_x); }  // floor: LG(x), ceil: LG(x-1)+1
/*}}}*/

int m1, d1, m2, d2;

int main(){
    R(m1, d1, m2, d2);
    W((int)m1 != m2);
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include <stdio.h>
#include <string>
#include <string.h>
#include <algorithm>
#include <functional>
#include <vector>

using namespace std;
int main()
{
	int A = 0;
	int B = 0;
	int Ans = 0;

	int a;
	int b;
	int c;

	cin >> A >> B;

	a = A + B;
	b = A - B;
	c = A * B;

	if (a >= b && a >= c) {
		cout << a;

	}
	else if (b >= a && b >= c) {
		cout << b;
	}
	else if (c >= a && c >= b) {
		cout << c;
	}

	return 0;
}

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

int main(){
  int r;
  cin>>r;
  printf("%20.20f",6.28318530717958623200*r);
  return 0;
}

Measured memory_bytes: 3748
#include <iostream>
#include <string> 
#include <vector> 
#include <algorithm> 
#include <utility> 
#include <tuple> 
#include <cstdint> 
#include <cstdio> 
#include <map> 
#include <queue> 
#include <set> 
#include <stack> 
#include <deque> 
#include <unordered_map> 
#include <unordered_set> 
#include <bitset> 
#include <cctype> 
#include<math.h>
using namespace std;

#define int long long
#define endl "\n"
#define fir first
#define sec second
#define fro front
#define m_p make_pair
#define mod 1000000007
#define rep(i,n)  for(int i=0; i<(int) (n); i++)
#define all(v)  v.begin(),v.end()
#define vecin(v) for(int i=0; i<(int)v.size(); i++)cin>>v[i];
using namespace std;

const int MAX = 510000;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
int jousu(int x00, int y00) {
	int z00 = 1;
	for (int i = 0; i < y00; i++) {
		z00 *= x00;
	}
	return z00;
}
int keta(int x00) {
	int z00 = x00;
	int w00 = 0;
	while (z00 != 0) {
		z00 /= 10;
		w00++;
	}
	return w00;
}

int modinv(int a, int m) {
	int b = m, u = 1, v = 0;
	while (b) {
		int t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}
int modpow(int a, int n) {
	int res = 1;
	while (n > 0) {
		if (n & 1) res* a% mod;
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}
int gcd(int xx, int yy) {
	int p = xx;
	int q = yy;
	if (q > p)swap(p, q);
	while (p % q != 0) {
		p %= q;
		swap(p, q);
	}
	return q;
}
int lcm(int xx, int yy) {
	return xx * yy / gcd(xx, yy);
}
bool prime(int xx) {
	int a = xx;
	for (int i = 2; i * i <= xx; i++) {
		if (xx % i == 0) {
			return 0;
		}
	}
	return 1;
}
int com(int xx, int yy) {
	int zz = 1;
	for (int i = xx; i > xx - yy; i--) {
		zz *= i;
		zz %= mod;
	}
	for (int i = 1; i <= yy; i++) {
		zz *= modinv(i, mod);
		zz %= mod;
	}
	return zz;
}



signed main() {
	int n, a, b, c, d, e, ans;
	cin >> n >> a >> b >> c >> d >> e;
	ans = (n - 1) / min(a, min(b, min(c, min(d, e)))) + 5;
	cout << ans << endl;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#include <boost/integer/common_factor.hpp>
#include <boost/integer/common_factor_rt.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>

using std::string;
using std::vector;
using std::set;
using std::multiset;
using std::unordered_set;
using std::map;
using std::multimap;
using std::unordered_map;
using std::pair;
using std::cin;
using std::cout;

using boost::multiprecision::cpp_int;
using cpp_dec_float_1000 = boost::multiprecision::number<boost::multiprecision::cpp_dec_float<1000>>;

typedef uintmax_t    ull;
typedef intmax_t     ll;
typedef uint64_t     ul;
typedef uint32_t     ui;
typedef uint8_t      uc;

constexpr char CRLF  = '\n';
constexpr char SPACE = ' ';
constexpr char VECTOR_COUT_SEPARATOR = SPACE;
constexpr ll INF = 1000'000'007;
constexpr int MOD = 1000'000'007;

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; }
template<class T> std::ostream& operator<< (std::ostream& os, const std::vector<T>& vc) { for(auto it = vc.begin(); it != vc.end(); ++it) { if (std::next(it) == vc.end()) os << *it; else os << *it << VECTOR_COUT_SEPARATOR; } return os; }
template<class T1, class T2> inline std::ostream & operator<< (std::ostream & os, const std::pair<T1, T2> & p) { return os << p.first << ' ' << p.second; }
template<class T> T modinv(T a, T m) { T b = m, u = 1, v = 0; while (b) { T t = a / b; a -= t * b; boost::swap(a, b); u -= t * v; boost::swap(u, v); } u %= m; if (u < 0) u += m; return u; }
template<class T> inline bool isSosuu(const T& n) { if (n == T(1)) { return false; } for (T i = 2; i*i <= n; ++i) { if (n % i == 0) { return false; } } return true; }

struct Tmp
{
public:
  Tmp(int N);
};

Tmp::Tmp(int N){}

void solve(void)
{
  string s; cin >> s;
  string hi = "hi";
  while (true) {
    if (hi.size() > s.size()) {
      cout << "No" << CRLF;
      return;
    }
    if (hi == s) {
      cout << "Yes" << CRLF;
      return;
    }
    hi += "hi";
  }
  return;
}

int main(void)
{
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(0);

  solve();

  return 0;
}


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

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rrep(i, n) for(int i = ((int)(n)-1); i >= 0; i--)
#define all(x) (x).begin(),(x).end()
 
using namespace std;
using ll = long long;
 
struct edge { int to, cost; };
 
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> P;
 
const int INF = ~(1<<31);
const int MOD = 1e9+7;
const double EPS = 1e-10;
const double PI = acos(-1.0);
 
const int mx4[] = {0,1,0,-1};
const int my4[] = {1,0,-1,0};
const int mx8[] = {0,1,1,1,0,-1,-1,-1};
const int my8[] = {1,1,0,-1,-1,-1,0,1};

int main()
{
	int n;
	cin >> n;
	int flag = 0;
	for(int i = 1; i <= 9; i++){
		for(int j = 1; j <= 9; j++){
			if(i*j == n) flag = 1;
		}
	}
	cout << (flag ? "Yes" : "No") << endl;
 	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0, i##_len = (n); i < i##_len; ++i)
#define rep2(i, x, n) for(int i = x, i##_len = (n); i < i##_len; ++i)
#define all(n) begin(n), end(n)
using ll = long long;
using P = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
using vd = vector<double>;
vi dir = {-1, 0, 1, 0, -1, -1, 1, 1, -1};

int main() {
  int h, w;
  cin >> h >> w;
  vector<vc> g(h + 2, vc(w + 2, '.'));
  rep2(i, 1, h + 1) rep2(j, 1, w + 1) cin >> g[i][j];
  bool ans = true;
  rep2(i, 1, h + 1) rep2(j, 1, w + 1) {
    if(g[i][j] == '#') {
      bool ok = false;
      rep(k, 4) {
        int ni = i + dir[k];
        int nj = j + dir[k + 1];
        if(g[ni][nj] == '#') ok = true;
      }
      if(!ok) ans = false;
    }
  }
  cout << (ans ? "Yes" : "No") << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <math.h>
#define _GLIBCXX_DEBUG
using namespace std;
int main() {
  
  int X;cin>>X;
  
  int p;
  
  for(int i=6;i>=0;i--){
    if(pow(2,i)<=X){
      p=i;
      break;
    }
  }
  
  for(int i=100;i>=0;i--){
    if(pow(2,p)*i<=X){
      cout<<pow(2,p)*i<<endl;
      return 0;
    }
  }
}

Measured memory_bytes: 4084
#![allow(unused_imports, unused_macros, dead_code)]

macro_rules! min {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        if let Some(z) = it.next() {
            Some(it.fold(z, |x, y| min!(x, y)))
        } else {
            None
        }
    }};
    ($x:expr) => ($x);
    ($x:expr, $($ys:expr),*) => {{
        let t = min!($($ys),*);
        if $x < t { $x } else { t }
    }}
}
macro_rules! max {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        if let Some(z) = it.next() {
            Some(it.fold(z, |x, y| max!(x, y)))
        } else {
            None
        }
    }};
    ($x:expr) => ($x);
    ($x:expr, $($ys:expr),*) => {{
        let t = max!($($ys),*);
        if $x > t { $x } else { t }
    }}
}


macro_rules! ewriteln {
    ($($args:expr),*) => { let _ = writeln!(&mut std::io::stderr(), $($args),*); };
}
macro_rules! trace {
    ($x:expr) => { ewriteln!(">>> {} = {:?}", stringify!($x), $x) };
    ($($xs:expr),*) => { trace!(($($xs),*)) }
}
macro_rules! put {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        if let Some(x) = it.next() { print!("{}", x); }
        for x in it { print!(" {}", x); }
        println!("");
    }};
    ($x:expr) => { println!("{}", $x) };
    ($x:expr, $($xs:expr),*) => { print!("{} ", $x); put!($($xs),*) }
}

const M: i64 = 1_000_000_007;

fn main() {
    let mut sc = Scanner::new();
    let a: i64 = sc.cin();
    let b: i64 = sc.cin();
    put!(max!(a + b, a - b, a * b));
}

use std::io::{self, Write};
use std::str::FromStr;
use std::collections::VecDeque;

struct Scanner { stdin: io::Stdin, buffer: VecDeque<String>, }
impl Scanner {
    fn new() -> Self { Scanner { stdin: io::stdin(), buffer: VecDeque::new() } }
    fn cin<T: FromStr>(&mut self) -> T {
        while self.buffer.len() == 0 {
            let mut line = String::new();
            let _ = self.stdin.read_line(&mut line);
            for w in line.split_whitespace() {
                self.buffer.push_back(String::from(w));
            }
        }
        self.buffer.pop_front().unwrap().parse::<T>().ok().unwrap()
    }
}


Measured memory_bytes: 4352
def main():
    import bisect
    import numpy as np
    n,k = map(int,input().split())
    l = list(map(int,input().split()))
    l.sort()
    l = np.array(l)
    def bise(x):
        y = np.searchsorted(l,x-l)
        return n*n-y.sum()

    left = -1
    right = l[-1]*2+1

    while right > left+1:
        mid = (right+left)//2
        
        if bise(mid) >= k:
            left = mid
        else:
            right = mid
    ans = 0
    
    acc = np.zeros(n+1,np.int64)
    acc[1:] = l.cumsum()
    x = np.searchsorted(l,right-l)
    count = n*n-x.sum()
    ans = (acc[-1]-acc[x]).sum() + (l*(n-x)).sum()

    print(ans-(count-k)*left)
if __name__ == "__main__":
    main()

Measured memory_bytes: 23412
#include <bits/stdc++.h>
using namespace std;
#define LL long long
inline int read() {
	char ch = getchar(); int x = 0, f = 1;
	while(ch < '0' || ch > '9') {
		if(ch == '-') f = -1;
		ch = getchar();
	}
	while('0' <= ch && ch <= '9') {
		x = x * 10 + ch - '0';
		ch = getchar();
	}
	return x * f;
}
int A[200010];
int main() {
	int n = read();
	for(int i = 1; i <= n; ++ i) A[i] = read();
	int lst = n;
	LL Ans = 0;
	for(int i = n; i >= 1; -- i) {
		lst = min(lst, i);
		int now = i - lst;
		if(A[i] < now) {
			return puts("-1"), 0;
		}
		if(A[i] == now) continue;
		lst = i - A[i];
		if(lst < 1) {
			return puts("-1"), 0;
		}
		Ans += A[i];
	}
	printf("%lld\n", Ans);
}

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

int main(){
    int a,b;
    cin >> a;
    b = a / 1000;
  	if(b*1000 < a){
      b++;
      b = b*1000-a;
    }else{
      b = b*1000 -a;
      
    }
  
    cout << b;
}

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

int main() {
    int H, W;
    cin >> H >> W;
    multiset<int> value;
    for (int i = 0; i < W; ++i) {
        value.insert(0);
    }
    map<int, int> mp;
    rep(i, W) {
        mp[i] = i;
    }
    rep(i, H) {
        int l, r;
        cin >> l >> r;
        --l;
        auto itr = mp.lower_bound(l);
        int maxV = -1;
        while (itr != mp.end() && itr->first <= r) {
            maxV = max(maxV, itr->second);
            int x = itr->first - itr->second;
            value.erase(value.find(x));
            itr = mp.erase(itr);
        }
        if (maxV != -1 && r < W) {
            value.insert(r - maxV);
            mp[r] = maxV;
        }

        if (value.size() == 0) {
            cout << -1 << "\n";
        } else {
            cout << (i + 1) + (*value.begin()) << "\n";
        }
    }
    return 0;
}

Measured memory_bytes: 22364
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(int i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(int i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(int i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define uniq(x) (x).erase(unique((x).begin(), (x).end()), (x).end())

ll gcd(ll a, ll b) {
    return b ? gcd(b, a % b) : a;
}

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n, m;
    string s, t;
    cin >> n >> m >> s >> t;
    
    if (n < m) {
        swap(n, m);
        swap(s, t);
    }
    
    rep(i, m) {
        double dpos = i * ((double)n / m);
        int ipos = (int)dpos;
        
        if (dpos != (double)ipos) {
            continue;
        }
        
        if (ipos >= n) {
            break;
        }
        
        if (s[ipos] != t[i]) {
            cout << -1 << endl;
            return 0;
        }
    }
    
    cout << lcd(n, m) << endl;
    return 0;
}

Measured memory_bytes: 640
from math import cos, sqrt, radians

a, b, h, m = [int(x) for x in input().split()]

percentage = m / 60
hourAngle = (h + percentage) * 30
minuteAngle = (m/5) * 30
ans = sqrt(a**2 + b**2 - (2*a*b*cos(radians(abs(hourAngle - minuteAngle)))))
print(ans)


Measured memory_bytes: 9544
#include<iostream>
#include<string>

int main(){
	std::string s;
	while (std::getline(std::cin,s)){
		if (s == "END OF INPUT")break;
		std::string ans;
		int a = 0;
		for (int i = 0; i < s.size(); ++i){
			if (s[i] != ' ')a++;
			else{
				char c = a + '0';
				ans+=c;
				a = 0;
			}
			if (i == s.size() - 1){
				char c = a + '0';
				ans += c;
			}
		}
		std::cout << ans << std::endl;
	}
	return 0;
}

Measured memory_bytes: 1188
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <utility>
#include <map>
#include <string>
#include <math.h>
using namespace std;
typedef long long ll;


int main() {

    int i=0;
    string S;
    cin >> S;
    int flag = 1;
    int N = S.size();
    for(int i=0;i<N/2;i++){
        if(S[i]!=S[N-1-i]){
            flag = 0;
        }
    }
    for(int i=0;i<(N-1)/2;i++){
        if(S[i]!=S[(N-1)/2-1-i]){
            flag = 0;
        }
    }
    for(int i=0;i<N-((N+3)/2);i++){
        if(S[((N+3)/2)+i-1] != S[N-1-i]){
            flag = 0;
        }
    }
    if(flag==1){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    return 0;
}

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

//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;

#define ll long long int
#define ld long double
#define FAST ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define pb push_back
#define pi 3.14159265358979
#define pa pair<ll,ll>
//#define goodset tree<pa, null_type, less<pa>, rb_tree_tag, tree_order_statistics_node_update>
//#define FRE freopen("acm.in","r",stdin); freopen("acm.out","w",stdout);

const ll mod = 1e9+7 ;
const ll N = 1e3+7;
char maz[N][N];
ll vis[N][N],dis[N][N];

int main()
{
    FAST
    ll tc,i,j,k;
    //cin>>tc;
    tc=1;
    while(tc--)
    {
       ll n,m,tar;
       cin>>n>>m>>tar;
       map<ll,ll>mp,mp1,mp2;
       vector<pair<ll,ll> >v;
       for(i=0; i<tar; i++)
       {
           ll r,c;
           cin>>r>>c;
           v.pb({r,c});
           mp[r]++;
           mp1[c]++;
           mp2[c]++;
       }
       sort(v.begin(),v.end());
       multiset<ll>s;
       for(auto it: mp1)
        s.insert(it.second);

        set<ll>s1;
        ll ans=0;
       for(i=0; i<tar; i++)
       {
           ll fir=v[i].first;
           ll cnt=mp[fir];
           s1.clear();
            /*if(cnt==4)
           {
               for(auto it: s)
                cout<<it<<"\n";
               cout<<"\n";
           }*/
           for(j=i; j<i+cnt; j++)
           {
               ll val=mp1[v[j].second];
               mp1[v[j].second]--;

               s.erase(s.find(val));
               s.insert(val-1);
               s1.insert(v[j].second);
           }
           //cout<<s.size()<<"\n";
           ll cnt2=*s.rbegin();


           //cout<<"\n";
           ans=max(ans,cnt+cnt2);
           //cout<<cnt<<" "<<cnt2<<"\n";
           for(auto it : s1)
           {
               ll val=mp1[it];
               s.erase(s.find(val));
               mp1[it]=mp2[it];
               s.insert(mp1[it]);
           }
           i=i+cnt-1;
           //cout<<ans<<"\n";
       }

       cout<<ans;



    }
    return 0;
}





Measured memory_bytes: 78184
#include <bits/stdc++.h>
using namespace std;
const int N=100000+10;
typedef long long LL;
int n, h[N];
LL dp[N];
int main() {
	scanf("%d", &n);
	for(int i=1;i<=n;i++)scanf("%d",&h[i]);
	for(int i=1;i<=n;i++)dp[i]=1e18;dp[1]=0;
	for(int i=2;i<=n;i++){
		dp[i]=dp[i-1]+abs(h[i-1]-h[i]);
		if(i>=3)dp[i]=min(dp[i],dp[i-2]+abs(h[i-2]-h[i]));
	}
	cout<<dp[n]<<endl;
}

Measured memory_bytes: 1408
#include <algorithm>
#include <iostream>
#include <vector>
#include <numeric>
#include <string>
#include <stdio.h>
#include <set>
#include <iomanip>
using namespace std;
 
int main(){
    int N;
    cin >> N;
    int p;
    vector<int> A(N, 0);
    for (int i=1; i<N; i++){
        cin >> p;
        A[p-1] += 1;
    }
    for (int i=0; i<N; i++){
        cout << A[i] << endl;
    }
    return 0;
}

Measured memory_bytes: 4052
#ifdef LOCAL111
	#define _GLIBCXX_DEBUG
#else
	#define NDEBUG
#endif
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
const int INF = 1e9;
using namespace std;
template<typename T, typename U> ostream& operator<< (ostream& os, const pair<T,U>& p) { cout << '(' << p.first << ' ' << p.second << ')'; return os; }

#define endl '\n'
#define ALL(a)  (a).begin(),(a).end()
#define SZ(a) int((a).size())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#ifdef LOCAL111
	#define DEBUG(x) cout<<#x<<": "<<(x)<<endl
	template<typename T> void dpite(T a, T b){ for(T ite = a; ite != b; ite++) cout << (ite == a ? "" : " ") << *ite; cout << endl;}
#else
	#define DEBUG(x) true
	template<typename T> void dpite(T a, T b){ return; }
#endif
#define F first
#define S second
#define SNP string::npos
#define WRC(hoge) cout << "Case #" << (hoge)+1 << ": "
template<typename T> void pite(T a, T b){ for(T ite = a; ite != b; ite++) cout << (ite == a ? "" : " ") << *ite; cout << endl;}
template<typename T> bool chmax(T& a, T b){if(a < b){a = b; return true;} return false;}
template<typename T> bool chmin(T& a, T b){if(a > b){a = b; return true;} return false;}

typedef long long int LL;
typedef unsigned long long ULL;
typedef pair<int,int> P;

void ios_init(){
	//cout.setf(ios::fixed);
	//cout.precision(12);
#ifdef LOCAL111
	return;
#endif
	ios::sync_with_stdio(false); cin.tie(0);	
}

int main()
{
	ios_init();
	int n, k;
	while(cin >> n >> k) {
		vector<LL> a(n);
		REP(i,n) cin >> a[i];
		LL g = a[0];
		LL ma = -1;
		REP(i,n){
			g = __gcd(a[i],g);
			chmax(ma,a[i]);
		}
		if(k%g == 0 and ma >= k){
			cout << "POSSIBLE" << endl;
		}else{
			cout << "IMPOSSIBLE" << endl;
		}
	}
	return 0;
}


Measured memory_bytes: 1024
/*
ID: anonymo14
TASK: wormhole
LANG: C++                 
*/
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<pair<int,int>> vpii;

#define F first
#define S second
#define PU push
#define PUF push_front
#define PUB push_back
#define PO pop
#define POF pop_front
#define POB pop_back

#define REP(i,a,b) for(int i=a; i<=b; i++)

#define MOD 1000000007

void solve(int test_case) {
	int a,p;
	cin>>a>>p;
	p+=3*a;
	cout<<p/2;
}

int main() {
	
	////// FILE BASED IO////
	//freopen("wormhole.in", "r", stdin);
	//freopen("wormhole.out", "w", stdout);
	///////////////
	
	ios::sync_with_stdio(0);
	cin.tie(0);
	int t=1;
	//cin>>t;
	REP(i,1,t) {
		solve(i);
	}
	return 0;
}	


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

int main() {
  string S;
  int counter = 0;

  cin >> S;
  int size = S.size();

  for (int i = 0; i < size; i++) {
    if (S[i] != S[size - 1 - i]) {
      counter++;
    }
  }

  cout << counter / 2 << endl;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<ll, P>IP;
typedef vector<ll> V;
typedef vector<V> V2;
typedef vector<vector<P> > G;
void g_dir(G &graph, ll a, ll b, ll w = 1){graph[a].push_back(P(b, w));}
void g_undir(G &graph, ll a, ll b, ll w = 1){g_dir(graph, a, b, w);g_dir(graph, b, a, w);}
#define rep(i, n) for(ll (i) = 0; (i) < (n); (i)++)
#define rep1(i, n) for(ll (i) = 1; (i) <= (n); (i)++)
#define rrep(i, n) for(ll (i) = (n) - 1; (i) >= 0; (i)--)
#define rrep1(i, n) for(ll (i) = (n); (i) >= 1; (i)--)
template<class T> void chmax(T &a, const T &b){if(a < b){a = b;}}
template<class T> void chmin(T &a, const T &b){if(a > b){a = b;}}
const ll INF = 1145141919;
const ll MOD = 1000000007;
const ll NUM = 101010;

ll era[NUM];

int main(){
    rep(i, NUM)era[i] = 1;
    era[0] = 0;
    era[1] = 0;
    for(ll i = 2; i * i < NUM; i++){
        if(era[i] == 0)continue;
        for(ll j = i + i; j < NUM; j+= i)era[j] = 0;
    }
    ll X;
    cin >> X;
    for(ll i = X; ;i++){
        if(era[i]){
            cout << i << endl;
            return 0;
        }
    }
    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using vs=vector<string>;
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define range(i,a,n) for(ll i=(a);i<(n);i++)
#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI 3.1415926535897932384

int dx[]={1,0,-1,0,1,-1,-1,1},dy[]={0,1,0,-1,1,1,-1,-1};
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s;a=0;} return os;}
template<class S>void tf(bool b,S t,S f){cout<<(b?t:f)<<endl;}
void OUT(bool b){tf(b,"YES","NO");}
void Out(bool b){tf(b,"Yes","No");}
void out(bool b){tf(b,"yes","no");}
template<class T>void puta(T&&t){cout<<t<<endl;}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}

int popcnt(int x){return __builtin_popcount(x);}
int popcnt(ll x){return __builtin_popcountll(x);}
int bsr(int x){return 31 - __builtin_clz(x);}
int bsr(ll x){return 63 - __builtin_clzll(x);}
int bsf(int x){return __builtin_ctz(x);}
int bsf(ll x){return __builtin_ctzll(x);}
template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;}
template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;}

/*他のライブラリを入れる場所*/
struct UnionFind{
	vi p;
	UnionFind(int s):p(s,-1){}
	void unite(int a,int b){
		a=root(a);b=root(b);
		if(a!=b){
			if(p[b]<p[a])swap(a,b);
			p[a]+=p[b];p[b]=a;
		}
	}
	bool same(int a,int b){return root(a)==root(b);}
	int root(int a){return p[a]<0?a:p[a]=root(p[a]);}
};


int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n,k,l;
	cin>>n>>k>>l;
	UnionFind r(n),t(n);
	rep(i,k){
		int a,b;
		cin>>a>>b;
		a--;b--;
		r.unite(a,b);
	}
	rep(i,l){
		int a,b;
		cin>>a>>b;
		a--;b--;
		t.unite(a,b);
	}
	using pii=pair<int,int>;
	map<pii,ll> mp;
	rep(i,n){
		mp[make_pair(r.root(i),t.root(i))]++;
	}
	vi ans(n);
	rep(i,n)ans[i]=mp[make_pair(r.root(i),t.root(i))];
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 15104
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
using namespace std;
//#include <stdio.h>
#define ll long long

int main(void)
{
    ll n, d, ans = 0;
    cin >> n >> d;
    vector<ll>  x(n);
    vector<ll>  y(n);
    for(ll i = 0; i < n; i++) {
        cin >> x.at(i) >> y.at(i);
        if((double)sqrt(x.at(i) * x.at(i) + y.at(i) * y.at(i)) <= (double)d)
            ans++;
    }

    cout << ans;
}

Measured memory_bytes: 6428
#include<iostream>
#include<algorithm>
#include<vector>
#include<functional>
#include<string>
#include<cmath>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<cstdio>
using namespace std;
using ll = long long;
int main(){
  string s;
  cin >> s;
  if(s == "AAA" || s == "BBB"){
    cout << "No\n";
  }else{
    cout << "Yes\n";
  }
  return 0;
}

Measured memory_bytes: 256
def main():
    from builtins import int, map, list, float, print, len, min
    from itertools import combinations
    import sys
    sys.setrecursionlimit(10 ** 6)

    input = sys.stdin.readline
    input_list = (lambda: input().rstrip().split())
    input_number = (lambda: int(input()))
    input_number_list = (lambda: list(map(int, input_list())))

    N, M, X = input_number_list()
    C = []
    A = []
    for i in range(N):
        sc = input_number_list()
        C.append(sc[0])
        A.append(sc[1:])
    ls = []
    idxs = [i for i in range(N)]
    for i in range(0, N):
        for combi in combinations(idxs, i + 1):
            ls.append(combi)
    ans = float('inf')
    for i in range(len(ls)):
        money = 0
        xs = [0] * M
        is_ng = False
        for j in range(len(ls[i])):
            money += C[ls[i][j]]
            for k in range(len(A[ls[i][j]])):
                xs[k] += A[ls[i][j]][k]
        for n in range(len(xs)):
            if xs[n] < X:
                is_ng = True
                break
        if is_ng == False:
            ans = min(ans, money)
    if ans == float('inf'):
        ans = -1
    print(ans)

if __name__ == '__main__':
    main()


Measured memory_bytes: 9388
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define long long ll
int main(){
  int n; 
  cin >> n;
  int64_t a;
  __int128_t ans=1, INF = int64_t(1e18) + 1;;
  for(int i=0; i<n; i++){
    cin >> a;
    ans =min(ans*a, INF);
  }
 
  if(ans!=INF){
    //cout << pow(10, 18);
    printf("%ld", ans);
  } else {
    cout << -1;
  }
}


Measured memory_bytes: 3684