akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <algorithm>
#include <unordered_map>

#define rep(i, a, b) for (ll i = a; i < b; i++)

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef unordered_map<string, ll> u_map;

// input
void input() {}
template <class Head, class... Tail>
void input(Head &&a, Tail &&... b)
{
    cin >> a;
    input(forward<Tail>(b)...);
}

template <class V>
void input(vector<V> &v)
{
    for_each(v.begin(), v.end(), [](auto &i) { input(i); });
}

// output
template <class V>
void output(vector<V> &v)
{
    for_each(v.begin(), v.end(), [](auto &x) { cout << x << " "; });
    cout << endl;
}

// math functions
ll mpow(ll a, ll n, ll p)
{
    ll x = 1;
    while (n > 0)
    {
        if (n & 1)
        {
            x = a * x % p;
        }
        a = a * a % p;
        n >>= 1;
    }

    return x;
}

ll mfact(ll n, ll p)
{
    ll res = 1;
    for (ll i = 2; i <= n; i++)
    {
        res = res * i % p;
    }
    return res;
}

ll mcomb(ll n, ll r, ll p)
{
    if (n == 0 && r == 0)
    {
        return 1;
    }
    if (n < r || n < 0 || r < 0)
    {
        return 0;
    }

    ll a = mfact(n, p);
    ll b = mfact(n - r, p);
    ll c = mfact(r, p);
    return (((a * mpow(b, p - 2, p)) % p) * mpow(c, p - 2, p)) % p;
}

ll gcd(ll a, ll b)
{
    if (a < b)
    {
        a ^= b;
        b ^= a;
        a ^= b;
    }
    return b ? gcd(b, a % b) : a;
}

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

int main()
{
    char c;
    input(c);

    if ('A' <= c && c <= 'Z')
    {
        cout << 'A' << endl;
    }
    else
    {
        cout << 'a' << endl;
    }

    return 0;
}

Measured memory_bytes: 3636
S=gets.chomp
K=gets.to_i
mark=S[0]
cnt=1
ms=Array.new
if S.codepoints.uniq.size==1
  puts S.size*K/2
  exit
end
for i in 1..S.size-1
  if i!=S.size-1
    if S[i]==mark
      cnt+=1
    else
      ms << cnt
      cnt=1
      mark=S[i]
    end
  else
    if S[i]==mark
      ms << cnt+1
    else
      ms << cnt
      ms << 1
    end
  end
end
ans=ms.map{|e|e/2}.inject(:+)*K
if S[0]==S[-1]
  ans+=(ms[0]+ms[-1])/2*(K-1)-(ms[0]/2)*(K-1)-(ms[-1]/2)*(K-1)
end
puts ans

Measured memory_bytes: 1788
#include <stdio.h>

typedef struct{
  char c;
  int n;
}back;

int main()
{
  back card1[36],card2[36],tmp[36],temp;
  char c;
  int minj,i,j,a,N;

  scanf("%d",&N);
  
  for(i=0;i<N;i++){
    scanf(" %c%d",&card1[i].c,&card1[i].n);
    scanf("%c",&c);
  }

  for(j=0;j<N;j++){
    card2[j]=card1[j];
  }

  a=0;
  
  for(i=1;i<10;i++){
    for(j=0;j<N;j++){
      if(card1[j].n==i){
	tmp[a]=card1[j];
	a++;
      }
    }
  }

  for(i=0;i<N;i++){
    for(j=1;j<N;j++){
      if(card1[j].n<card1[j-1].n){
	temp=card1[j];
	card1[j]=card1[j-1];
	card1[j-1]=temp;
      }
    }
  }

  for(i=0;i<N;i++){
    if(i!=N-1) printf("%c%d ",card1[i].c,card1[i].n);
    else printf("%c%d\n",card1[i].c,card1[i].n);
  }

  a=0;

  for(i=0;i<N;i++){
    if(card1[i].c!=tmp[i].c){
      printf("Not stable\n");
      a++;
      break;
    }
  }
  if(a==0) printf("Stable\n");

  for(i=0;i<N;i++){
    minj=i;
    for(j=i;j<N;j++){
      if(card2[j].n<card2[minj].n) minj=j;
    }
    temp=card2[i];
    card2[i]=card2[minj];
    card2[minj]=temp;
  }

  for(i=0;i<N;i++){
    if(i!=N-1) printf("%c%d ",card2[i].c,card2[i].n);
    else printf("%c%d\n",card2[i].c,card2[i].n);
  }

  a=0;

  for(i=0;i<N;i++){
    if(card2[i].c!=tmp[i].c){
      printf("Not stable\n");
      a++;
      break;
    }
  }
  if(a==0) printf("Stable\n");
  return 0;
}

Measured memory_bytes: 2704
#include <iostream>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <queue>
#include <functional>
#include <string>
#include <stack>
#include <set>
#include <sstream>
#include <iomanip>
#include <limits>
#include <cstring>

using namespace std;
using ll = long long;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef pair<string, string> sP;
typedef pair<ll, pair<ll, ll>> PP;

const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll INF = 1 << 30;
const ll INF2 = 9e18;
const double INF3 = 9e14;
const int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };
const int tx[8] = { -1,0,1,-1,1,-1,0,1 }, ty[8] = { -1,-1,-1,0,0,1,1,1 };
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define pb push_back
#define eb emplace_back
#define fr first
#define sc second



int main() {
	ll n, a[200010], b[200010], ans = 0;
	cin >> n;
	for (int i = 0;i < n;i++)cin >> a[i];
	for (int i = 0;i < n;i++)cin >> b[i];
	for (int i = 0;i <= 28;i++) {
		ll c[200010],d[200010];
		for (int j = 0;j < n;j++)c[j] = a[j] % (1 << (i + 1));
		for (int j = 0;j < n;j++)d[j] = b[j] % (1 << (i + 1));
		sort(d, d + n);
		ll count1 = 0;
		for (int j = 0;j < n;j++) {
			int it = lower_bound(d, d + n, (1 << i) - c[j]) - d;
			int it2 = lower_bound(d, d + n, (1 << i) * 2 - c[j]) - d;
			count1 += max(0, it2 - it);
			it = lower_bound(d, d + n, (1 << i) * 3 - c[j]) - d;
			it2 = lower_bound(d, d + n, (1 << i) * 4 - c[j]) - d;
			count1 += max(0, it2 - it);
		}
		if (count1 % 2 == 1)ans += 1 << i;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 6528
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<math.h>
using namespace std;
int main()
{
	int n,a[100],sum=0,max1=0;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
	}
	for(int i=0;i<n;i++)
	{
		if(a[i]==1)
		{
			sum++;
			max1=max(max1,sum);
		}
		else 
		{
			sum=0;
		}
	}
	cout<<max1+1<<endl;
	return 0;
}


Measured memory_bytes: 3080
#include <stdio.h>

int main(void){
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
int d=0;
if(a==b && b!=c)
d++;
if(b==c && c!=a)
d++;
if(a==c && b!=c)
d++;

if(d) printf("Yes");
else printf("No");
return 0;
}

Measured memory_bytes: 128
s=[ord(ch)-97 for ch in input()]
t=[ord(ch)-97 for ch in input()]
 
# minimize
mnmz={ch for ch in s} & {ch for ch in t}
if len(mnmz)==0:
    print("")
    exit()
s=[ z for z in s if z in mnmz ]
t=[ z for z in t if z in mnmz ]
if len(s)>len(t): s, t = t, s
 
# init
dp=[[0]*len(s) for _ in range(len(t))]
 
#dp frame
 
for i in range(len(s)): 
    if s[i]==t[0]:
        for j in range(i, len(s)):
            dp[0][j]=1
        break
for i in range(len(t)): 
    if s[0]==t[i]:
        for j in range(i, len(t)):
            dp[j][0]=1
        break
#dp
for i in range(1,len(t)):
    for j in range(1, len(s)):
        if s[j]==t[i]:
            dp[i][j]=dp[i-1][j-1]+1
        else: dp[i][j]=(dp[i][j-1] if dp[i][j-1]>dp[i-1][j] else dp[i-1][j])
 
#recover string
res=[]
j=len(s)-1
i=len(t)-1
while i>0 and j>0:
    if s[j]==t[i] and dp[i][j]==dp[i-1][j-1]+1:
        res.append(s[j])
        i=i-1
        j=j-1
        continue
    if dp[i][j]==dp[i][j-1]:
        j=j-1
    else: i=i-1
# last letter (first acually)
if i==0 and dp[i][j]>0:
    res.append(t[0])
elif j==0 and dp[i][j]>0:
    res.append(s[0])
 
 
print("".join(chr(i+97) for i in reversed(res)))

#print("\n".join(" ".join(str(el) for el in lst) for lst in dp ))

Measured memory_bytes: 114652
[<AutoOpen>]
module Program

open System

let read f = stdin.ReadLine() |> f
let reada f = stdin.ReadLine().Split() |> Array.map f
let reads f = stdin.ReadLine().Split() |> Array.toList |> List.map f

let inline gcd x y =
    let zero = LanguagePrimitives.GenericZero
    let rec loop x y = if y = zero then x else loop y (x % y)
    loop (abs x) (abs y)

let factorize n =
    let rec loop acc m i =
        if i * i > n then
            Set.add m acc
        else
            match (m / i, m % i) with
            | (q, 0L) -> loop (Set.add i acc) q i
            | _ -> loop acc m (i + 1L)
    loop Set.empty n 2L
    |> Set.remove 1L

[<EntryPoint>]
let main _ =
    let [a;b] = reads int64
    gcd a b
    |> factorize
    |> Set.count
    |> (+) 1
    |> stdout.WriteLine
    0

Measured memory_bytes: 14176
n, m = list(map(int, input().split()))
from collections import defaultdict
d = defaultdict(set)
for i in range(m):
  a, b = list(map(int, input().split()))
  d[a].add(b)
  d[b].add(a)
if d[1]&d[n]:
  print("POSSIBLE")
else:
  print("IMPOSSIBLE")

Measured memory_bytes: 77820
// Problem : A - Takoyaki
// Contest : AtCoder - AtCoder Beginner Contest 176
// URL : https://atcoder.jp/contests/abc176/tasks/abc176_a
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <iostream>
using namespace std;

int n, x, t;

int main() {
    cin >> n >> x >> t;
    cout << t * ( n / x + (bool)( n % x ) ) << endl;
    return 0;
}

Measured memory_bytes: 3628
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;

int main() {
    int n, m;
    cin >> n >> m;
    const ll mod = 1000000007LL;
    
    if(1 < abs(n-m)) {
        cout << 0 << endl;
        return 0;
    }
    else {
        ll ans = 1;
        for(int i = 2; i <= n; i++) {
            ans = ans * i % mod;
        }
        for(int i = 2; i <= m; i++) {
            ans = ans * i % mod;
        }
        
        if(n == m) {
            cout << 2*ans % mod;
        }
        else {
            cout << ans % mod;
        }
    }

    cout << endl;
    return 0;
}

Measured memory_bytes: 256
// https://atcoder.jp/contests/practice2/tasks/practice2_c?lang=ja

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;

int main()
{
    long t;
    cin >> t;

    for (long i = 0; i < t; ++i)
    {
        long n, m, a, b;
        cin >> n >> m >> a >> b;
        cout << floor_sum(n, m, a, b) << endl;
    }

    return 0;
}

Measured memory_bytes: 3544
#include<bits/stdc++.h>
using namespace std;
const int N = 2 * 1e5 + 10;
int n, cnt[N];
int main(){
	scanf("%d", &n);
	for(int i = 1, temp; i < n; ++i){
		scanf("%d", &temp);
		cnt[temp] ++; 
	}
	for(int i = 1; i <= n; ++i){
		printf("%d\n", cnt[i]);
	}
	return 0;
}


Measured memory_bytes: 4508
// AOJ 2334 Roads on Towns
// 2018.2.24 bal4u

#include <stdio.h>
#include <math.h>

#define EPS			1e-10
#define INF			1e20
typedef struct { double x, y; } PP;

PP p[2][1002];

PP vectorSub(PP p1, PP p2) { PP r; r.x = p1.x - p2.x, r.y = p1.y - p2.y; return r; }
double cross(PP a, PP b) { return a.x * b.y - a.y * b.x; }
double dot(PP a, PP b) { return a.x * b.x + a.y * b.y; }
double norm(PP a) { return a.x * a.x + a.y * a.y; }
double vectorAbs(PP a) { return hypot(a.x, a.y); }

int ccw(PP p0, PP p1, PP p2)
{
	PP a = vectorSub(p1, p0), b = vectorSub(p2, p0);
	double t = cross(a, b);
	if (t >  EPS) return 1;
	if (t < -EPS) return -1;
	if (dot(a, b) < -EPS) return 2;
	if (norm(a) < norm(b)) return -2;
	return 0;
}

int intersect(PP p1, PP p2, PP p3, PP p4)
{
	return ccw(p1, p2, p3) * ccw(p1, p2, p4) <= 0 &&
		   ccw(p3, p4, p1) * ccw(p3, p4, p2) <= 0;
}

//#define getchar_unlocked()  getchar()
int in()
{
	int n = 0;
	int c = getchar_unlocked();
	if (c == '-') {
		c = getchar_unlocked();
		do n = (n<<3)+(n<<1) + (c & 0xf), c = getchar_unlocked();
		while (c >= '0');
		return -n;
	}
	do n = (n<<3)+(n<<1) + (c & 0xf), c = getchar_unlocked();
	while (c >= '0');
	return n;
}

double calc(PP s, PP g, PP *a, int n, PP es, PP eg)
{
	int i, j;
	double ans, x, y, z;

	if (!intersect(s, g, es, eg)) return vectorAbs(vectorSub(s, g));
	if (n == 0) return INF+100;

	ans = INF+100;
	for (i = 0; i < n; i++) {
		if (intersect(s, a[i], es, eg)) continue;
		x = vectorAbs(vectorSub(s, a[i]));
		if (x >= ans) continue;
		if (!intersect(g, a[i], es, eg)) {
			y = vectorAbs(vectorSub(g, a[i]));
			if (x + y < ans) ans = x + y;
			continue;
		}
		for (j = 0; j < n; j++) if (j != i) {
			if (intersect(a[i], a[j], es, eg)) continue;
			y = vectorAbs(vectorSub(a[i], a[j]));
			if (x + y  >= ans) continue;
			if (!intersect(g, a[j], es, eg)) {
				z = vectorAbs(vectorSub(g, a[j]));
				if (x + y + z < ans) ans = x + y + z;
			}
		}
	}
	return ans;
}

int main()
{
	int i, j, n[2];
	PP s[2], g[2];
	double ans, x;

	n[0] = in()-2, n[1] = in()-2;
	for (i = 0; i < 2; i++) {
		s[i].x = in(), s[i].y = in();
		g[i].x = in(), g[i].y = in();
		for (j = 0; j < n[i]; j++) p[i][j].x = in(), p[i][j].y = in();
	}

	ans = INF+100;
	for (i = 0; i < 2; i++) {
		x = vectorAbs(vectorSub(s[1-i], g[1-i])) + calc(s[i], g[i], p[i], n[i], s[1-i], g[1-i]);
		if (x < ans) ans = x;
	}

	if (ans >= INF) puts("-1");
	else printf("%.12lf\n", ans);
	return 0;
}


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

#define INF (2e9)
#define FOR(i, a, b) for (ll (i) = (a); (i) < (b); ++(i))
#define REP(i, n) FOR(i, 0, n)

using namespace std;

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

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

using ll = long long;
using ld = long double;

#define ALL(x) (x).begin(), (x).end()
template<class T>
using vc = vector<T>;
using vi = vc<ll>;
using vvi = vc<vi>;

template<class T>
using va = valarray<T>;
using vad = va<ld>;
using vai = va<ll>;

using pii = pair<ll, ll>;

vi Read(ll n) {
    auto      v = vi(n);
    for (auto i = std::size_t(0); i < n; ++i) {
        cin >> v[i];
    }
    return v;
}

template<class T>
void DumpRow(const T& A) {
    for (const auto& value : A)
        cout << value << "\n";
}

template<class T>
void DumpColumn(const T& A) {
    auto isFirst = true;
    for (const auto& value : A) {
        if (isFirst) {
            cout << value;
            isFirst = false;
        } else {
            cout << " " << value;
        }

    }
    cout << endl;
}

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

    ll n;
    cin >> n;
    auto v = vc<pii>(n);
    REP(i, n) cin >> v[i].first >> v[i].second;

    sort(ALL(v));

    REP(i, n) cout << v[i].first << " " << v[i].second << endl;
    return 0;
}



Measured memory_bytes: 4400
table = list(map(int,input().split()))

for i in range(2,0,-1):
    k = 0
    while k < i:
        if table[k] > table[k+1]:
            table[k],table[k+1] = table[k+1],table[k]
        k += 1;


print(table[0],table[1],table[2])


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

vector<int>vec[30];
int main()
{
    string s;
    cin>>s;
    for(int i = 0 ; i<s.size() ; ++i)
        vec[s[i]-'a'].push_back(i);
    for(int i = 0 ; i<26 ; ++i)
    {
        if(vec[i].size() < 2) continue;
        int l = 2 , r = vec[i].size();
        int m = vec[i].size();
        for(; l <=r ; ++l)
        {
            int mid = l;
            for(int j = 0 ; j<= m - mid ; ++j)
            {
                int sum = vec[i][j+mid-1] - vec[i][j] + 1;
                if(sum-mid >= mid) continue;
                cout<<vec[i][j]+1<<" "<<vec[i][j+mid-1]+1<<endl;
                return 0;
            }
        }
    }
    cout<<"-1 -1"<<endl;
    return 0;
}


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

using namespace std;

int digitSum(int a) {
	int num, sum = 0, digit = 0;
	string s;

	s = to_string(a);

	num = a;

	while (num != 0) {
		num /= 10;
		digit++;
	}

	for (int i = 0; i < digit; i++) sum += (int)(s[i] - '0');

	return sum;
}


int main() {
	string res;
	int input;

	cin >> input;


	if (input % digitSum(input) == 0) res = "Yes";
	else res = "No";

	cout << res << endl;

	return 0;
}

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

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

int main() {
	int h, w;
	cin >> h >> w;
	vector<string> s(h);
	rep(i, h) cin >> s[i];
	auto bfs = [&](int a, int b) {
		vector<vector<int>> ans(h, vector<int>(w));
		vector<vector<bool>> vi(h, vector<bool>(w));
		queue<P> que;
		int j_res = 0;
		que.emplace(a, b);
		vi[a][b] = true;
		while (que.size()) {
			P p = que.front(); que.pop();
			rep(i, 4) {
				int nx = p.first + dx[i], ny = p.second + dy[i];
				if (nx < 0 || ny < 0 || nx >= h || ny >= w) continue;
				if (s[nx][ny] == '#') continue;
				if (vi[nx][ny]) continue;
				vi[nx][ny] = true;
				ans[nx][ny] = ans[p.first][p.second] + 1;
				j_res = max(j_res, ans[nx][ny]);
				que.emplace(nx, ny);
			}
		}
		return j_res;
	};
	int ans = 0;
	rep(i, h)rep(j, w) {
		if (s[i][j] == '#') continue;
		ans = max(ans, bfs(i, j));
	}
	cout << ans << endl;
	return 0;
}


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

int main() {
  int N;
  string S,T;
  cin >> N;
  cin >> S >> T;
  string ans = S+T;
  for(int i=0;i<N*2;i++){
      if(i%2==0) ans.at(i)=S.at(i/2);
      if(i%2==1) ans.at(i)=T.at(i/2);
  }
  cout << ans;

}

Measured memory_bytes: 256
import std.stdio;
import std.algorithm;
import std.string;
import std.range;
import std.array;
import std.conv;
import std.complex;
import std.math;
import std.ascii;
import std.bigint;
import std.container;
import std.typecons;

auto readInts() {
	return array(map!(to!int)(readln().strip().split()));
}
auto readInt() {
	return readInts()[0];
}
auto readLongs() {
	return array(map!(to!long)(readln().strip().split()));
}
auto readLong() {
	return readLongs()[0];
}

void readlnTo(T...)(ref T t) {
    auto s = readln().split();
    assert(s.length == t.length);
    foreach(ref ti; t) {
        ti = s[0].to!(typeof(ti));
        s = s[1..$];
    }
}

const real eps = 1e-10;

void main(){
    long h, w, a, b;
    readlnTo(h, w, a, b);
    long p = 1000000000L+7;
    long [long[]] memo;
    long pow_mod(long n, long k) {
        if(k == 0) {
            return 1;
        }
        auto tmp = pow_mod(n, k/2);
        tmp = (tmp*tmp)%p;
        if(k%2 == 1) {
            tmp = (tmp*n)%p;
        }
        return tmp;
    }
    long c(long n, long k) {
        if(([n, k] in memo) !is null) {
            return memo[[n,k]];
        }
        long ans;
        if(k == 0) {
            ans = 1;
        } else {
            ans = (((c(n, k-1)*(n-k+1))%p)*pow_mod(k, p-2))%p;
        }
        memo[[n,k].idup] = ans;
        return ans;
    }
    for(int i; i <= h-a-1+b; ++i) {
        c(h-a-1+b, i);
    }
    for(int i; i <= a+w-b-1; ++i) {
        c(a+w-b-1, i);
    }
    long ans;
    for(int i = 1; i <= min(h-a, w-b); ++i) {
        ans += c(h-a-1+b, h-a-i)*c(a-b+w-1, a-1+i);
        ans %= p;
    }
    writeln(ans);
}




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

int main() {
  int n,ans=0;
  cin >> n;
  for(int i = 1; i <= n; ++i) {
    bool flag = false;
    if(i % 3 == 0) flag = true;
    int x = i;
    while(x) {
      if(x % 10 == 3) flag = true;
      x /= 10;
    }
    if(flag) cout << " " << i;
  }
  cout << endl;
  return 0;
}


Measured memory_bytes: 3116
#include<stdio.h>
#include<iostream>
#include<vector>
#include<math.h>
#include<queue>
#include<map>
#include<algorithm>
#include<string.h>
#include<functional>
#include<limits.h>
#include<stdlib.h>
#include<string>
#include<unordered_map>
#include<set>
using namespace std;

#define intmax INT_MAX
#define lmax LONG_MAX
#define uintmax UINT_MAX
#define ulmax ULONG_MAX
#define llmax LLONG_MAX
#define ll long long
#define rep(i,a,N) for((i)=(a);(i)<(N);(i)++)
#define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--)
#define llfor ll i,j,k
#define sc(a) cin>>a
#define pr(a) cout<<a<<endl
#define pY puts("YES")
#define pN puts("NO")
#define py puts("Yes")
#define pn puts("No")
#define pnn printf("\n")
#define all(a) a.begin(),a.end()
#define push(a,b) (a).push_back(b)
#define llvec vector<vector<ll>>
#define charvec vector<vector<char>>
#define sizeoof(a,b) (a,vector<ll>(b))
#define llpvec vector<pair<ll,ll>>
/*繰り上げ除算*/ll cei(ll x,ll y){ll ans=x/y;if(x%y!=0)ans++;return ans;}
/*最大公約数*/ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
/*最小公倍数*/ll lcm(ll x,ll y){return x/gcd(x,y)*y;}
/*n乗*/ll llpow(ll x,ll n){ll i,ans=1;rep(i,0,n)ans*=x;return ans;}
/*階乗*/ll fact(ll x){ll i,ans=1;rep(i,0,x)ans*=(x-i);return ans;}
/*nCr*/ll ncr(ll n,ll r){return fact(n)/fact(r)/fact(n-r);}
/*nPr*/ll npr(ll n,ll r){return fact(n)/fact(n-r);}
/*primejudge*/bool prime(ll a){if(a<=1)return false;ll i;for(i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}
/*約数*/vector<ll>div(ll a){vector<ll>b;ll i;rep(i,1,a){if(!a%i)push(b,a);}return b;}
/*素因数分解*/
llfor;///////////////////////////////////////////////////////////
int main(){
 ll a,b,c;
 sc(a);sc(b);sc(c);
 if(a+b-c>0){
  pn;return 0;
 }
 if((a+b-c)*(a+b-c)>4*a*b)py;
 else pn;
return 0;}



Measured memory_bytes: 3608
#n=int(input())
h,w=map(int,input().split())
#l=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]
m=h//2
n=w//2

if h==1 or w==1:
    ans=1
elif h%2==0:
    ans=m*w
else:
    md=w%2
    ans=n*(m+1+m)+md*(m+1)
print(ans)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
 
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  ll ans = 0;
  vector<int> r;
  vector<int> g;
  vector<int> b;
  for (int i = 0; i < n; i++){
    if ( s[i] == 'R' ) r.push_back(i);
    if ( s[i] == 'G' ) g.push_back(i);
    if ( s[i] == 'B' ) b.push_back(i);
  }
  ans += (r.size()*g.size()*b.size());
  for (int j = 0; j < n; j++){
    for (int i = 0; i < j; i++){
      int k = j + (j-i);
      if (k < n){
        if ( s[i] == s[j] ) continue;
        if ( s[j] == s[k] ) continue;
        if ( s[i] == s[k] ) continue;
        ans--;
      }
    }
  } 
  cout << ans << endl;
}

Measured memory_bytes: 3600
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		final Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();

		if (M % N == 0) {
			System.out.println(M / N);
			return;
		}

		int max = M / N;
		for (int a = max; a > 0; a--) {
			if (M % a == 0) {
				System.out.println(a);
				break;
			}
		}
	}
}


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


int main()
{
     int n, w;
     cin >> n >> w;
    long long wt[n],val[n];
    for(int i=0;i<n;i++)
    { cin>>wt[i]>>val[i];

    }
   long long dp[n+1][w+1] ;
   for(int i =0;i<=n;i++)
   {for(int j=0;j<=w;j++)
    {if(i==0||j==0)
    {dp[i][j]=0;}}
   
   }
    for(int i =1;i<=n;i++)
   {for(int j=1;j<=w;j++)
   { if(wt[i-1]<=j)
   {dp[i][j]=max(val[i-1]+dp[i-1][j-wt[i-1]],dp[i-1][j]);}
   else dp[i][j]=dp[i-1][j];

   }}
 cout<<dp[n][w]<<endl;
     return 0;
}

Measured memory_bytes: 82444
#include <bits/stdc++.h>
#define int long long
using namespace std;
 
signed main(){
  char S[55];
  int N;
  cin>>N;
  for(int i=0;i<N;i++){
    cin>>S[i];
  }
  int ans=0;
  for(int i=0;i<=N-3;i++){
    if(S[i]=='A'&&S[i+1]=='B'&&S[i+2]=='C'){
      ans++;
    }
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<map>
#include<math.h>
#include<algorithm>
#include<iomanip>

using namespace std;

class Counting {
	unsigned long long p, n;
	vector<long long> invMemo, facMemo, facInvMemo;
public:
	Counting(unsigned long long nn, unsigned long long np) {
		p = np;
		n = nn;
		invMemo.resize(n + 1);
		facMemo.resize(n + 1);
		facInvMemo.resize(n + 1);
		facMemo[0] = 1;
		facMemo[1] = 1;
		facInvMemo[0] = 1;
		facInvMemo[1] = 1;
		invMemo[0] = 0;
		invMemo[1] = 1;
		for (unsigned long long i = 2; i <= n; i++) {
			invMemo[i] = p - (p / i)*invMemo[p%i] % p;
			facMemo[i] = (facMemo[i - 1] * i) % p;
			facInvMemo[i] = (facInvMemo[i - 1] * invMemo[i]) % p;
		}
	}
	unsigned long long fac(unsigned long long k) {
		return facMemo[k];
	}
	unsigned long long facInv(unsigned long long k) {
		return facInvMemo[k];
	}
	unsigned long long choose(unsigned long long n, unsigned long long k) {
		if (!(0 <= k && k <= n))
			return 0;
		return (((facMemo[n] * facInvMemo[k]) % p)*facMemo[n - k]) % p;
	}
	unsigned long long divide(unsigned long long a, unsigned long long b) {
		return (a * invMemo[b]) % p;
	}
	unsigned long long mod(unsigned long long a) {
		a %= p;
		if (a < 0) a += p;
		return a;
	}
	unsigned long long power(unsigned long long a, unsigned long long e) {
		unsigned long long ans = 1;
		for (; e > 0; e /= 2) {
			if (e % 2 != 0)
				ans = ans * a % p;
			a = a*a%p;
		}
		return ans;
	}
};

string s;

int main() {
	cin >> s;

	s[5] = ' ';
	s[13] = ' ';
	cout << s << endl;
	return 0;
}

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

typedef long long ll;

ll q, h, s, d;
ll ans;
ll n;
ll cq, ch, cs, cd;

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

	cin >> q >> h >> s >> d >> n;
	cq = q * 4; ch = h * 2; cs = s;
	if (n >= 2) {
		int mi = min(cq, min(ch, cs)) * 2;
		if (mi > d) {
			ll num = n / 2;
			//cout << d << ' ' << num << endl;
			ans += d * num;
			n -= num * 2;
		}
	}
	//cout << ans << endl;
	int mi = min(cq, min(ch, cs));
	ans += mi * n;
	cout << ans << endl;


	return 0;
}


Measured memory_bytes: 256
from itertools import groupby

s = input()
k = int(input())
a = [sum(1 for _ in g) for _, g in groupby(s)]
if len(a) == 1:
    print(len(s) * k // 2)
else:
    x, y = a[0], a[-1]
    b = x // 2 + y // 2
    c = (x + y ) // 2 if s[0] == s[-1] else b
    print(b + sum(x // 2 for x in a[1:-1]) * k + c * (k - 1))


Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <cstdio>
using namespace std;

int main(){
	int n;

	while(cin >> n, n){
		vector<int> vsum(n);
		int hsum = 0;
		int k;
		for(int i = 0; i < n; i++){
			int sum = 0;
			for(int j = 0; j < n; j++){
				cin >> k;
				printf("%5d", k);
				sum+=k;
				vsum[j]+=k;
			}
			printf("%5d\n", sum);
			hsum += sum;
		}
		vsum.push_back(hsum);

		for(int i = 0; i < n+1; i++){
			printf("%5d", vsum[i]);
		}
		cout << endl;
	}

	return 0;
}

Measured memory_bytes: 1240
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <utility>
using namespace std;
typedef pair<int, int> pii;

void input_crossing(string &a, string &b){
    string in;
    cin >> in;
    int n = in.length();
    for(int i=0; i<n; i++){
        if(in[i] == '-'){
            a = in.substr(0, i);
            b = in.substr(i+1, n-i-1);
            break;
        }
    }
}

int dfs(int curr, int g, vector<vector<pii>> &adj, vector<bool> &used){
    if(used[curr]) return -1;
    used[curr] = true;
    if(curr == g) return 0;
    
    for(auto next: adj[curr]){
        int ret = dfs(next.first, g, adj, used);
        if(ret != -1){
            return ret+next.second;
        }
    }
    return -1;
}

int main(){
    while(1){
        int n;
        cin >> n;
        if(n == 0) break;

        vector<string> a(n),b(n);
        int id=0;
        map<string, int> to_id;
        for(int i=0; i<n; i++){
            input_crossing(a[i], b[i]);
            if(to_id.count(a[i]) == 0){
                to_id[a[i]] = id++;
            }
            if(to_id.count(b[i]) == 0){
                to_id[b[i]] = id++;
            }
        }

        vector<int> aid(n),bid(n);
        int num_st = to_id.size();
        vector<vector<pii>> adj(num_st);
        for(int i=0; i<n; i++){
            aid[i] = to_id[a[i]];
            bid[i] = to_id[b[i]];
            adj[aid[i]].emplace_back(bid[i], 1);
        }
        vector<vector<int>> eq(num_st, vector<int>(num_st, 0));
        for(int i=0; i<n; i++){
            for(int j=0; j<n; j++){
                if(aid[i]==aid[j] and eq[bid[i]][bid[j]]==0){
                    eq[bid[i]][bid[j]] = 1;
                }
                if(bid[i]==bid[j] and eq[aid[i]][aid[j]]==0){
                    eq[aid[i]][aid[j]] = 1;
                }
                if(aid[i]==bid[j]){
                    eq[bid[i]][aid[j]] = eq[aid[j]][bid[i]] = -1;
                }
            }
        }
        for(int i=0; i<num_st; i++){
            for(int j=i+1; j<num_st; j++){
                if(eq[i][j] == 1){
                    adj[i].emplace_back(j, 0);
                    adj[j].emplace_back(i, 0);
                }
            }
        }

        int m;
        cin >> m;
        cout << id << endl;
        for(int i=0; i<m; i++){
            string s,g;
            input_crossing(s, g);
            if(to_id.count(s)==0 or to_id.count(g)==0){
            	cout << "NO" << endl;
            	continue;
            }
            vector<bool> used(num_st, false);
            int ret = dfs(to_id[s], to_id[g], adj, used);
            if(ret!=-1 and ret%2==1){
                cout << "YES" << endl;
            }else{
                cout << "NO" << endl;
            }
        }
    }
    return 0;
}



Measured memory_bytes: 3324
#include<bits/stdc++.h>
#include<iostream>
#include<typeinfo>
#define ll  long long 
#define ull unsigned long long 
#define ld  long double
#define pb  push_back
#define eb  emplace_back
#define pf  push_front
#define mp  make_pair
#define all(v)  v.begin(),v.end()
#define BP(n)  __builtin_popcount(n)
#define bs(v,x)  binary_search(all(v),x)
#define lb(v,x) lower_bound(all(v),x) //first equal to or lower than element
#define ub(v,x) upper_bound(all(v),x) //first greater than element
#define rep(i,n)  for(i=0;i<n;i++)
#define rep1(j,n)  for (j=i+1;j<n;j++)
#define Unique(v)  vector<int>::iterator it; sort(all(v)); it= unique(all(v)); v.resize(distance(v.begin(),it))
#define M  1000000007
#define PI  acos(-1.0)
#define fastio  ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL)
using namespace std;
void input(vector<int>& v,int n){ int i,io; rep(i,n) { cin>>io; v.pb(io);} }
void output(vector<int> v) { int i; rep(i,v.size()) cout<<v.at(i); }
map<int,int>  frequency(vector<int> v){ int i; map<int,int> m; rep (i,v.size()) {  if (m.find(v[i])==m.end()) m.insert({v.at(i),1}); else m[v.at(i)]++; } return m; }
bool perfsq(ll n){ return (ceil(sqrt(n))==floor(sqrt(n))); }
bool ispower2(int n) { if (n&(n-1)==0) return true; else return false; }
bool binary_pred(int a,int b){ return a==b; }
int string_to_int(string s) { stringstream geek(s); int x = 0; geek >> x; return x; }
int digcount(ll n) { return (floor(log10(n)) + 1); }
bool isprime(ll n) {
    if (n <= 1)
        return false;
    for (ll i = 2; i*i <= n; i++) {
        if (n % i == 0)
            return false;
    }
    return true;
}
vector<ll> get_factors(ll n) {
    vector<ll> ans;
    for (ll i=2;i*i<=n;i++) {
        if (n % i == 0) {
            ans.pb(i);
            if (n/i != i)
                ans.pb(n/i);
        }
    }
    if (n != 1) {
        ans.pb(1);
        ans.pb(n);
    }
    else 
        ans.pb(1); 
    sort(all(ans));
    return ans;
}
void getans() {
    int k;
    cin >> k;
    string ans;
    for (int i=0;i<k;i++)
        ans.append("ACL");
    cout<<ans<<endl;
}
int main() {
    fastio;
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
        freopen("error.txt", "w", stderr);
    #endif
    int T = 1;
    //cin >> T;
    while (T--) 
        getans();
}
// Check for corner cases
// Check for special case like n = 0 or n = INT_MAX
// Check for Buffer Overflow or use of unsigned variable if any
// Check if problem can be solved mathematically

Measured memory_bytes: 3680
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#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)--)
const ll INF = 1145141919;
const ll MOD = 1000000007;
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;}}

int main(){

    ll H, W, A, B;
    cin >> H >> W >> A >> B;
    rep1(y, H){
        rep1(x, W){
            ll tmp = 0;
            if(y <= B)tmp ^= 1;
            if(x <= A)tmp ^= 1;
            cout << tmp;
        }
        cout << endl;
    }

    return 0;
}

Measured memory_bytes: 1280
#include<bits/stdc++.h>
using namespace std;
 
#define int long long
 
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;
 
template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}
 
signed main(){
    string s;cin>>s;
 
    for(char c='a';c<='z';c++){
        int tmp=count(all(s),c);
        if(tmp%2){
            cout<<"No"<<endl;
            return 0;
        }
    }
    cout<<"Yes"<<endl;
    return 0;
}

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

using namespace std;

int main(){
    int H,W;
    string a[100];
    scanf("%d%d",&H,&W);
    for(int i=0;i<H;i++){
        cin >> a[i];
    }

    for(int i=0;i<W+2;i++){
        printf("#");
    }
    printf("\n");

    for(int i=0;i<H;i++){
        printf("#");
        cout << a[i];
        printf("#\n");
    }
    
    for(int i=0;i<W+2;i++){
        printf("#");
    }        
    printf("\n");

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <stdio.h>
#include <stdlib.h>
#include <cstdlib> 
#include <string>

using namespace std;

int main() {
	string s;
	cin >>s;
	for (int i=0;i<s.size(); i +=2){
		cout << s[i];
	}

}

Measured memory_bytes: 512
#include <iostream>
#include <string>
#include <cmath>
#include<algorithm> 
#include <functional>	
using namespace std;

int main() {
	int a, b, c;
	cin >> a >> b;
	if (a*b % 2 != 0) {
		cout << "Yes"
			<< endl;
	}
	else {
		cout << "No" << endl;
	}


	return 0;
}

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

int main()
{
    int n;scanf("%d",&n);
    int a[100005];
    for(int i=1;i<=n;i++)scanf("%d",a+i);
    sort(a+1,a+1+n);
    int now=a[1];
    int cnt=1;
    int ans=0;
    for(int i=2;i<=n;i++)
    {
        if(a[i]==now)cnt++;
        else
        {
            if(cnt>=now)
                ans+=cnt-now;
            else
                ans+=cnt;
            cnt=1;
            now=a[i];
        }
    }
    if(cnt>=now)
        ans+=cnt-now;
    else
        ans+=cnt;
    cout<<ans;
    return 0;
}


Measured memory_bytes: 640
#include<iostream>
#include<sstream>
#include<ios>
#include<iomanip>
#include<algorithm>
#include<vector>
#include<list>
#include<queue>
#include<cstdlib>
#include<cmath>
#include<queue>
#include<deque>
#include<map>
#include<string>
#include<numeric>
#include<set>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep2(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define rep_inv(i, n, m) for(int i = (int)(n); i > (int)(m); i--)
using namespace std;
using vi = vector<int>;
using vl = vector<long>;
using vc = vector<char>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<long>>;
using vvc = vector<vector<char>>;
using pii = pair<int, int>;
using vpii = vector<pii>;

int main(){
  long MOD = 998244353;

  int N;
  cin >> N;
  vl D(N);
  bool quit = false;
  rep(i, N){
    cin >> D[i];

    if((i == 0 && D[i] > 0) || (i > 0 && D[i] == 0)) quit = true;
  }

  if(quit){
    cout << 0 << endl;
    return 0;
  }

  stable_sort(D.begin(), D.end());

  int height = D[N-1];
  int pos = 1;
  int before = 1;
  long ans = 1;

  rep2(i, 1, height+1){
    int cnt = 0;

    while(D[pos] == i){
      cnt++;
      pos++;
    }

    if(cnt == 0){
      quit = true;
      break;
    }

    rep(j, cnt){
      ans *= before;
      ans %= MOD;
    }
    before = cnt;
  }

  if(quit){
    cout << 0 << endl;
  }
  else{
    cout << ans << endl;
  }
  
  return 0;
}

Measured memory_bytes: 1408
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define yesno(flg) if(flg){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define MAX_N 1002
#define i197 1000000007

using namespace std;
typedef long long ll;
typedef pair<ll,ll> P1;
typedef pair<int,int> Pi;
typedef pair<double,Pi> Pdi;
typedef pair<ll,int>Pli;
typedef pair<P1,ll> P2;
typedef pair<string,string> Ps;
const ll INF=1000000000000000001;
struct edge{int to,cost;};
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
struct Road{double cost;int a,b;};
struct pos{
	// 1 変数を入れる;
	int x,y,sx,sy,cost;
};
int dp[1001][1001];

int main() {

	string s1,s2;
	cin>>s1;
	cin>>s2;

	rep(i,s1.size()){
		rep(j,s2.size()){
			dp[j+1][i+1]=2001;
		}
	}

	dp[0][0]=0;
	rep(i,s1.size())dp[0][i+1]=i+1;
	rep(i,s2.size())dp[i+1][0]=i+1;

	for(int i=1; i<s1.size()+1; i++){
		for(int j=1; j<s2.size()+1; j++){
			dp[j][i]=min(dp[j][i],dp[j][i-1]+1);
			dp[j][i]=min(dp[j][i],dp[j-1][i]+1);
			if(s2[j-1]==s1[i-1])dp[j][i]=min(dp[j][i],dp[j-1][i-1]);
			else dp[j][i]=min(dp[j][i],dp[j-1][i-1]+1);
		}
	}
	int ans=s1.size()+s2.size();
	for(int i=1; i<s2.size()+1; i++){
		int x=s2.size()-i;
		ans=min(ans,dp[i][s1.size()]+x);
	}
	cout<<ans<<endl;

	return 0;
}



Measured memory_bytes: 7104
//yukicoder@cpp14
//author:luckYrat(twitter:@luckYrat_)
//競技プログラミングから逃げるな
//https://www.youtube.com/watch?v=z_B9iJ8r4ic

//せんげん！
#include <iostream>

#include <cmath>
#include <algorithm>
#include <iomanip>

#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <bitset>

#include <cctype>
#include <utility>
#include <climits>


//なまえくーかん！
using namespace std;
using ll = long long;
using P = pair<ll,ll>;

//てーすう！
const int mod = 1000000007;
const int inf = (1<<30)-1;
const ll linf = (1LL<<62LL)-1;
const double EPS = (1e-10);

//でふぁいん！
#define anyfill(n,s) setw(n) << setfill(s)
#define loop(s) for(int i = 0; s > i; i++)
#define rep(i,q) for(int i = 0; (q) > i; i++)
#define repp(i,n,q) for(int i = n; (q) > i; i++)
#define dep(i,q) for(int i = (q); 0 < i; i--)

//みじかく！
#define pb push_back
#define fir first
#define scn second
#define ednl endl

//いぇすのー！
#define YesNo(a) (a?"Yes":"No")
#define YESNO(a) (a?"YES":"NO")
#define yesno(a) (a?"yes":"no")

//きんぼーnほーこー！！
P ar4[4] = {{0,1},{0,-1},{1,0},{-1,0}};
P ar8[8] = {{-1,-1},{-1,0},{-1,1},{0,-1},{0,1},{1,-1},{1,0},{1,1}};
/*
確認ポイント
cout << fixed << setprecision(n) << 小数計算//n桁の小数表記になる

計算量は変わらないが楽できるシリーズ
min(max)_element(iter,iter)で一番小さい(大きい)値のポインタが帰ってくる
count(iter,iter,int)でintがiterからiterの間にいくつあったかを取得できる
*/
__attribute__((constructor))
void initial() {
 cin.tie(0);
 ios::sync_with_stdio(false);
}
int main(){
  int a,b,c,d;cin>>a>>b>>c>>d;
  while(a>0 || c>0){
    c-=b;
    if(c<=0){
      cout << "Yes" << endl;
      return 0;
    }
    a-=d;
    if(a<=0){
      cout << "No" << endl;
      return 0;
    }
  }
}

Measured memory_bytes: 3652
#include <iostream>
#include <numeric>
#include <math.h>
#include <algorithm>
#include <float.h>
#include <limits>
#include <vector> 
#include <string.h>
#include <iomanip>

#define rep(i,a,n) for(ll int (i) = (a);(i) < (n);(i)++)
#define urep(i,a,n) for(ll int (i) = (a);(i) > (n);(i)--)
#define MOD 1000000007
#define INF 2147483647
#define ll long long
#define asort(a) sort(a.begin(),a.end());//昇順ソート
#define usort(a) sort(a.rbegin(),a.rend());//降順ソート

using namespace::std;

int jo(ll int a, ll int b){//累乗
    ll int num=1;
    rep(i,0,b) num=num*a;
    return num;
}
char tobig(char s){//char大文字化
  return (s-0x20);
}
char tolow(char s){//char小文字化
  return (s+0x20);
}
int ctoi(char a){//char->int
  if('0'<=a&&a<='9') return (a-'0');
  return -1;
}

int gcd(ll int a,ll int b) {//最大公約数
  if(a<b) return gcd(b,a);
  int c;
  while ((c=a%b)) {
    a=b;
    b=c;
  }
  return b;
}
int lcm(ll int a,ll int b){//最小公倍数
 return (a*b)/gcd(a,b);
}


int main(){
  string S;cin>>S;
  int cnt1=0;
  int cnt2=0;
  rep(i,0,S.length()){
    if(cnt1==0){

      if(S[i]=='C'){
        cnt1++;
      }
    }else{

      if(S[i]=='F'){
        cnt2++;
        break;
      }
    }
  }
  cout<<(cnt2?"Yes":"No");
}




// vector<vector<int>> 変数名(左の個数, vector<int>(右の個数));

//cout<<fixed<<setprecision(n);  //小数点n桁まで表示

//  vector<pair<int,int>> data(N);  //2つのデータを格納、.first/.secondで参照
// pairのソートはfirst優先の昇順


Measured memory_bytes: 256
#include <iostream>
#include <sstream>
using namespace std;
int main() {
  int M, D, count = 0;
  int d10, d1;
  char d[3];
  string s;
  
  cin >> M >> D;
  for (int m = 4; m <= M; m++) {
    for (int n = 22; n <= D; n++) {
      s = to_string(n);
      s.copy(d, 2);
      d10 = d[0] - '0';
      d1 = d[1] - '0';
      if (d10 >= 2 && d1 >= 2 && d10*d1 == m)
	count++;
    }
  }
  cout << count << endl;

  return 0;
}


Measured memory_bytes: 256
using System;

namespace tst
{
    class Program
    {
        static void Main(string[] args)
        {
            //lenに配列の要素数//6
            int len = int.Parse(Console.ReadLine());
            //str //2 3 4 5 6 7 
            //素数判定//素数じゃなかったら引いていく
            int cnt = len;
            for (int i = 0; i < len; i++)//dt[0]~dt[5}
            {
                int k = int.Parse(Console.ReadLine());
                if (k == 2)
                {
                    continue;
                }
                else if (k % 2 == 0)
                {
                    cnt -= 1;
                    continue;
                }
                double sqrt = Math.Sqrt(k);
                for (int j = 3; j <= sqrt; j += 2)
                {
                    if (k % j == 0)
                    {
                        cnt -= 1;
                        break;
                    }
                }

            }
            Console.WriteLine(cnt);

        }
    }
}


Measured memory_bytes: 15940
#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b;
  cin >> a >> b;
  int s=0;
  for(int i=a;i<=b;i++){
    if(i/10000%10==i%10&&i/1000%10==i/10%10)s++;
  }
  cout << s;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  ll n,c,m=0;
  ll ar[n];
  cin>>n;
  for(ll i=0;i<n;i++)
     cin>>ar[i];
  
  for(ll j=0;j<n-1;j++){
    if(ar[j]>=ar[j+1])
      c=c+1;
    else {
      c=0;
    }
    m=max(m,c);
  }
  cout<<m;
}


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

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;

  if ( (A + B) < (C + D) ) {
    cout << "Right" << endl;
  }
    else if ( (A + B) == (C + D) ) {
      cout << "Balanced" << endl;
    }
  else {
    cout << "Left" << endl;
  }
}

Measured memory_bytes: 256
#ABC 128 C Switches
import numpy as np 
N,M = map(int,input().split())
# switch_matrix = np.ones((M,N))
switch_list = []
for m in range(M):
    inputs = list(map(int,input().split()))
    k = inputs[0]
    s_list = inputs[1:]
    p = 0
    for s in s_list:
        p= p | pow(2,s-1)

    switch_list.append(p)
p_list = list(map(int,input().split()))

ans=0
for i in range(pow(2,N)):
    num = 0
    for m in range(M):
        a = bin(i & switch_list[m]).count("1")
        if a%2 == p_list[m]:
            num+=1
    if num==M:
        ans+=1
print(ans)

Measured memory_bytes: 12504
import sys
from collections import defaultdict
readline = sys.stdin.buffer.readline
# sys.setrecursionlimit(10**8)


def geta(fn=lambda s: s.decode()):
    return map(fn, readline().split())


def gete(fn=lambda s: s.decode()):
    return fn(readline().rstrip())


def main():
    a = gete(int) 
    print(a+a**2+a**3)

if __name__ == "__main__":
    main()

Measured memory_bytes: 9452
//
//  main.cpp
//  ervb
//
//  Created by Kanak Gautam on 21/04/20.
//  Copyright © 2020 Kanak Gautam. All rights reserved.
//
 
 
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#define pb push_back
#define mk make_pair
#define endl "\n"
#define mod 1000000007
using namespace std;
typedef long long int lli;
typedef long double ld;
priority_queue <lli, vector<lli>, greater<lli> > ti;
vector <lli> p[500005],g,b(2000005,0),f(500005,0),ans(200005,0);
vector <ld> a(200005);
lli vis[200005];
map <pair<lli,lli>,lli> mp;
set<pair<lli, lli> > s;
set<lli> st;
map<lli,lli> np,v;
queue<lli> qy;
lli gcd(lli a, lli b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
      
}
lli bpow(lli a, lli b) {
    lli res = 1;
    while (b > 0) {
        if (b & 1)
            res = (res * a)%mod;
        a = (a * a)%mod;
        b >>= 1;
    }
    return res%mod;
}
lli fact(lli i)
{
    f[0]=1;
    for(lli k=1;k<=i;k++)
    {
        (f[k]=f[k-1]*k)%=mod;
    }
    return f[i];
}
lli isprime(lli n)
{
    if(n==1)
        return 0;
    for(lli i=2;i<=sqrt(n);i++)
        if(n%i==0)
            return 0;
    return 1;
}
bool cmp(lli i,lli j)
{
    return p[i].size()<p[j].size();
}
/*void sieve()
{
    for(lli i=2;i<=5000000;i++)
    {
        if(b[i]==0)
        {
        for(lli j=2;i*j<=5000000;j++)
        {
            b[i*j]=1;
        }
        }
    }
}*/
int main ()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    for(int i=1;i<2e6+5;i++)
    {
        b[i]=b[i%__builtin_popcount(i)]+1;
    }
    lli n;cin>>n;
    string s;cin>>s;
    reverse(s.begin(),s.end());
    lli p1=1,p2=1;
    lli t1=0,t2=0,c=0;
    for(lli i=0;i<s.size();i++)
    {
        if(s[i]=='1')c++;
    }
    for(lli i=0;i<n;i++)
    {
        if(s[i]=='1')
        {
            t1=(t1+p1)%(c+1);
            if(c>=2)t2=(t2+p2)%(c-1);
        }
        p1=(p1*2)%(c+1);
        if(c>=2)p2=(p2*2)%(c-1);
    }
    p1=1;p2=1;
    for(lli i=0;i<n;i++)
    {
        if(s[i]=='1')
        {
            if(c==1)ans[i]=0;
            else
            {
                lli y=(t2-p2+c-1)%(c-1);
                ans[i]=b[y]+1;
            }
        }
        else
        {
            lli y=(t1+p1)%(c+1);
            ans[i]=b[y]+1;
        }
        p1=(p1*2)%(c+1);
        if(c>=2)p2=(p2*2)%(c-1);
    }
    for(lli i=n-1;i>=0;i--)
    {
        cout<<ans[i]<<endl;
    }
}



Measured memory_bytes: 39624
N = int(input())
M = int(input())

A = list(map(int,input().split()))
p = [0] * N

for i in range(M):

    B = list(map(int,input().split()))

    x = 0

    for j in range(N):

        if A[i] == B[j]:
            p[j] += 1
        else:
            x += 1

    p[A[i]-1] += x

for i in range(N):
    print (p[i])



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

int main() {
    int N;
    cin >> N;
    int onesPlace = N % 10;

    switch(onesPlace) {
        case 0:
            cout << "pon" << endl;
            break;
        case 1:
            cout << "pon" << endl;
            break;
        case 2:
            cout << "hon" << endl;
            break;
        case 3:
            cout << "bon" << endl;
            break;
        case 4:
            cout << "hon" << endl;
            break;
        case 5:
            cout << "hon" << endl;
            break;
        case 6:
            cout << "pon" << endl;
            break;
        case 7:
            cout << "hon" << endl;
            break;
        case 8:
            cout << "pon" << endl;
            break;
        case 9:
            cout << "hon" << endl;
            break;
    }

}

Measured memory_bytes: 3608
# ABC052D
N, A, B = map(int, input().split())
X = list(map(int, input().split()))
ans = 0
thres = B // A
for i in range(N-1):
    x = X[i+1] - X[i]
    if x > thres:
        ans += B
    else:
        ans += A * x
print(ans)

Measured memory_bytes: 14224