akhauriyash/Code-Regression huggingface dataset:
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

s,t = map(str,input().split())
print(t+s)


Measured memory_bytes: 10244
#include<stdio.h>

int main(void)
{
	char Chr[1200];
	int Count;
	int n = 0;
	int C = 0;
	int Kekka[26];
	char moji;

	//初期化
	for (int i = 0; i < 26; i++)
	{
		Kekka[i] = 0;
	}

	while (scanf("%c", &Chr[n]) != EOF)
	{
		if (Chr[n] >= 'a')
		{
			Count = (Chr[n] - 'a');
		}
		else
		{
			Count = (Chr[n] - 'A');
		}
		Kekka[Count] = Kekka[Count] + 1;
	}
	for (moji = 'a'; moji <= 'z'; ++moji)
	{
		printf("%c : %d\n", moji, Kekka[C]);
		C++;
	}
	return 0;
}


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

const int MOD = (int)1e9+7;

int search_less(vector<int> &A,int b,int left,int right,int N){
	int mid=left+(right-left)/2;
	if(A.at(mid)>=b)	return search_less(A,b,left,mid-1,N);
	else if(A.at(mid)<b && A.at(mid+1)<b)	return search_less(A,b,mid+1,right,N);
	else if(A.at(mid)<b && A.at(mid+1)>=b)	return mid;
}

int search_greater(vector<int> &C,int b,int left,int right,int N){
	int mid=left+(right-left)/2;
	if(C.at(mid)<=b)	return search_greater(C,b,mid+1,right,N);
	else if(C.at(mid)>b && C.at(mid-1)>b)	return search_greater(C,b,left,mid-1,N);
	else if(C.at(mid)>b && C.at(mid-1)<=b)	return mid;
}

int main(){
	int N;
	cin >> N;
	vector<int> A(N);
	vector<int> B(N);
	vector<int> C(N);
	for(int i=0;i<N;i++)	cin >> A.at(i);
	for(int i=0;i<N;i++)	cin >> B.at(i);
	for(int i=0;i<N;i++)	cin >> C.at(i);
	A.push_back(-1);
	A.push_back(2e9);
	C.push_back(-1);
	C.push_back(2e9);
	N+=2;

	sort(A.begin(),A.end());
	sort(B.begin(),B.end());
	sort(C.begin(),C.end());
	long long ans=0;
	for(int i=0;i<N-2;i++){
		int b=B.at(i);
		int a=search_less(A,b,0,N-1,N);
		int c=N-1-search_greater(C,b,0,N-1,N);
		//cout << "B=" << b << ",a:" << a << ",c:" << c << endl;
		ans+=(long long)a*c;
	}
	cout << ans << endl;
	
	return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
int main() {
    int N;
    cin >> N;
    string S    = "";
    int    base = 2;
    while (N) {
        // base = 3 でうまくいかない
        // 例えば 7
        // base = 2 は OK
        // S = to_string (abs (N % base)) + S;
        // N -= abs (N % base);
        // N /= -base;

        // base = 3 でもうまくいく
        // 最小非負剰余
        S = to_string ((N % base + base) % base) + S;
        N -= (N % base + base) % base;
        N /= -base;
    }
    if (S != "") cout << S << endl;
    else
        cout << "0" << endl;
    return 0;
}

Measured memory_bytes: 256
fun readString() = readLine()!!
fun readInt() = readLine()!!.toInt()
fun readLong() = readLine()!!.toLong()
fun readIntList() = readLine()!!.split(" ").map(String::toInt)
fun readLongList() = readLine()!!.split(" ").map(String::toLong)

fun main(args: Array<String>) {
    val N = readInt()
    val A = Array(N) { readInt() }
    val maxA = mutableListOf(A[0], A[1]).apply { sortDescending() }
    for (i in 2 until A.size) {
        if (A[i] > maxA[0]) {
            maxA[1] = maxA[0]
            maxA[0] = A[i]
        } else if (A[i] > maxA[1]) {
            maxA[1] = A[i]
        }
    }

    for (i in A.indices) {
        println(
            if (A[i] != maxA[0]) {
                maxA[0]
            } else {
                maxA[1]
            }
        )
    }
}

Measured memory_bytes: 58664
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int N = reader.nextInt();
		int[] A = new int[N];
		int[] sorted = new int[N];
		for (int i = 0; i < N; i++) {
			A[i] = reader.nextInt();
			sorted[i] = A[i];
		}
		Arrays.sort(sorted);
		int center1 = sorted[N/2 - 1];
		int center2 = sorted[N/2];

		for (int i = 0; i < N; i++) {
			if (A[i] >= center2) {
				System.out.println(center1);
			} else {
				System.out.println(center2);
			}
		}
		reader.close();
	}
}



Measured memory_bytes: 91344
#include <bits/stdc++.h>
#define rep(i, m, n) for(int i = m; i < (n); i++)
#define print(x) cout << (x) << endl;
#define printa(x,n) for(int i = 0; i < n; i++){ cout << (x[i]) << " ";} cout << endl;
#define printa2(x,m,n) for(int i = 0; i < m; i++){ for(int j = 0; j < n; j++){ cout << x[i][j] << " ";} cout << endl;}
#define INF (1e9)
typedef long long ll;
typedef struct{
    int x;
    int y;
} P;

using namespace std;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a[3];
    cin >> a[0] >> a[1] >> a[2];
    sort(a, a+3);
    print(a[2] - a[0]);

}


Measured memory_bytes: 256
#include <stdio.h>
int main(void){
    // Here your code !
    int color[8] = {0,0,0,0,0,0,0,0};
    int n,i;
    int cameleon = 0;
    scanf("%d",&n);
    for(i=0;i<n;i++){
        int a;
        scanf("%d",&a);
        int c = a /400;
        if(c>7){cameleon++;}
        else {color[c] = 1;;}
        
    }
    int max,min =0;
    for(i=0;i<8;i++){
        min += color[i];
    }
       max = min + cameleon ;
       min = min <1 ? 1:min;
       printf("%d %d\n",min,max);
    return 0;
}


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

// C - Rally
int main() {
    int N;
    cin >> N;
    int X[N];
    int minX, maxX;
    int sumMin = 0;
    for (int i = 0; i < N; i++) {
        cin >> X[i];
        if (i == 0) {
            minX = X[i];
            maxX = X[i];
        }
        minX = min(minX, X[i]);
        maxX = max(maxX, X[i]);
        sumMin += pow(X[i], 2);
    }

    int sum;
    for (int i = minX; i <= maxX; i++) {
        sum = 0;
        for (int j = 0; j < N; j++) {
            if ((i - X[j]) != 0) {
                sum += pow((i - X[j]), 2);
            }
        }
        sumMin = min(sum, sumMin);
    }
    cout << sumMin;
}


Measured memory_bytes: 3592
# -*- coding: utf-8 -*-
import sys

#n= int(input())
#tmp= float(input())
#tmp = input().split()
#hoge = list(map(lambda a: int(a), tmp))

min=1000000
max=-1000000
total=0

#fst=0
while(1):
    tmp = input().split()
    h,w = list(map(lambda a: int(a), tmp))
    if((h==0)and(w==0)):
        sys.exit()
    for i in range(h):
        tmp=""
        for j in range(w):
            if((i+j)%2==0):
                tmp+="#"
            else:
                tmp+="."
        print(tmp)
    print("")





Measured memory_bytes: 5620
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<algorithm>
#include<iostream>
using namespace std;
string s;
int main()
{
	cin>>s;
	bool flag=false;
	bool flag1=false;
	for(int i=0;i<s.size();i++)
	{
		if(s[i]=='C') flag=true;
		if(flag==true&&s[i]=='F') flag1=true;
	}
	if(flag1==true) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
	int n;
	int a[100];
	cin >> n;
	for(int i = 0;i<n;i++){
		cin >> a[i];
	}
	for(int i = n-1;i>=0;i--){
		if(i == 0){
		cout << a[i] << endl;
		}
		else{
		
		cout << a[i] << " ";
		}
	}
	return 0;
}

Measured memory_bytes: 3084
def resolve():
    N = int(input())
    P = list(map(int, input().split()))
    tmpmin = float("inf")
    ans = 0
    for p in P:
        if tmpmin > p:
            ans += 1
        tmpmin = min(tmpmin, p)
    print(ans)

if '__main__' == __name__:
    resolve()

Measured memory_bytes: 99340
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main()
{
    int k;
    char s[101] = {
        0,
    };

    scanf("%d", &k);
    scanf("%s", s);

    int len = strlen(s);

    for (int i = 0; i < k; i++)
    {
        if (i >= len)
            break;
        printf("%c", s[i]);
    }

    if (k < len)
        printf("...");

    return 0;
}

Measured memory_bytes: 1736
#include <stdio.h>

int main(void) {
	int i,sg,in;
	while (scanf ("%d",&sg) , sg != 0){
		for (i = 1;i <= 9 ; i++){
			scanf("%d",&in);
			sg = sg - in;
		}
		printf("%d\n",sg);
	}
	return 0;
}

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

int main() {
    int a,b,i,j;
    while (!((a==0)and(b==0))){
        cin >> a >> b;
        for (i=1;i<=a;i++){
            for (j=1;j<=b;j++)
                cout << (((i+j)%2==0)?'#':'.');
            cout << endl;
        }
        if (!((a==0)and(b==0)))
            cout << endl;
    }
}


Measured memory_bytes: 3088
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vs = vector<string>;
using msi = map<string, int>;
using mii = map<int, int>;
using psi = pair<string, int>;
using pii = pair<int, int>;
using vlai = valarray<int>;
#define rep(i,n) for(int i=0;i<n;i++)
#define range(i,s,n) for(int i=s;i<n;i++)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define INF 1E9
#define EPS 1E-9
#define MOD 1000000007
#define PI 3.1415926535897932384

std::ostream &operator<<(std::ostream &out, const vector<int> &tgt)
{
	string s;
	for (int i = 0; i<tgt.size(); i++) {
		s += (to_string(tgt[i]) + ((i != tgt.size() - 1) ? " " : ""));
	}
	out << s;
	return out;
}

int main() {
	int n, m, in ,inn;
	cin >> n >> m;
	vi v(n, 0);
	rep(i, m) {
		cin >> in >> inn;
		v[in - 1]++;
		v[inn - 1]++;
	}
	rep(i, v.size()) {
		cout << v[i] << endl;
	}
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <functional>
#include <math.h>
#include <stdlib.h>
#include <map>
#include <sys/timeb.h>
#include <fstream>

using namespace std;

#define repr(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repr(i,0,n)
#define reprrev(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)
#define reprev(i,n) reprrev(i,0,n)
#define repi(itr,ds) for(auto itr=ds.begin();itr!=ds.end();itr++)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define mp make_pair
#define mt make_tuple
#define INF 1050000000
#define INFL 1100000000000000000LL
#define EPS (1e-10)
#define MOD 1000000007
#define PI 3.1415926536
#define RMAX 4294967295

typedef long long ll;
typedef pair<int, int> Pi;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<Pi> vPi;
typedef vector<vector<int> > vvi;
typedef vector<vector<bool> > vvb;
typedef vector<vector<ll> > vvll;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<double> > vvd;
typedef vector<vector<Pi> > vvPi;
typedef priority_queue<int, vector<int>, greater<int> > pqli;
typedef priority_queue<ll, vector<ll>, greater<ll> > pqlll;
typedef priority_queue<Pi, vector<Pi>, greater<Pi> > pqlP;
struct Edge {
	int from, to, cost;
	bool operator<(Edge e) {
		return cost < e.cost;
	}
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;
template <class T>
using vec = vector<T>;
template<class T>
using pql = priority_queue<T, vector<T>, greater<T>>;
string debug_show(Pi a) {
	return "(" + to_string(a.first) + "," + to_string(a.second) + ")";
}

template<class T>
struct augEdge {
	T from, to;
	int cost;
	bool operator<(augEdge e) { return cost < e.cost; }
	bool operator>(augEdge e) { return cost > e.cost; }
};
template<class T>
using augGraph = vector<augEdge<T>>;

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

	int n;
	cin >> n;
	vi a(n);
	rep(i, n)cin >> a[i];
	int ans = 0;
	int max = 0;
	sort(all(a));
	rep(i, n) {
		if (a[i] > max) {
			ans++;
			max = a[i];
		}
	}

	cout << ans << endl;

	return 0;
}


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

LL ans, sum, xorr ;
deque<LL> ar ;

void update(int n){
	while(true){
		if((sum + n) == (xorr ^ n))
			break ;
		sum -= ar.front() ;
		xorr ^= ar.front() ;
		ar.pop_front() ;
	}

	sum += n ;
	xorr ^= n ;
	ar.push_back(n) ;
	ans += (LL)ar.size() ;
}

int main(){

	LL n, a ;
	cin >> n ;

	while(n--){
		cin >> a ;
		update(a) ;
	}

	cout << ans << endl ;

	return 0;
}

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

int main()
{
    string s; cin>>s;
    int N=s.size();

    vector<int> ans(N);
    int cnt=0;
    for(int i=0;i<N;i++){
        if(s[i]=='R') cnt++;
        else{
            ans[i]+=cnt/2;
            ans[i-1]+=(cnt+1)/2;
            cnt=0;
        }
    }
    cnt=0;
    for(int i=N-1;i>=0;i--){
        if(s[i]=='L') cnt++;
        else{
            ans[i]+=cnt/2;
            ans[i+1]+=(cnt+1)/2;
            cnt=0;
        }
    }

    for(int i=0;i<N;i++){
        cout<<ans[i]<<endl;
    }
    return 0;
}

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

nums = []

inputs = input()
for i in inputs.split(" "):
    nums.append(int(i))

count = 0
m = 10 **9 + 7
for i in range(0, 64):
    one = 0
    zero = 0

    for j in range(0, n):
        if (nums[j] % 2 == 1):
            one += 1
        else:
            zero += 1

        nums[j] //= 2
    
    count += (zero * one * (1 << i)) % m

print(count % m)

Measured memory_bytes: 139120
#include<bits/stdc++.h>
using namespace std;
int H,W;
int h[1500],w[1500];

void solve(){
    for(int i=0;i<H;i++)scanf("%d",&h[i]);
    for(int i=0;i<W;i++)scanf("%d",&w[i]);

    int mxh=accumulate(h,h+H,0);
    int mxw=accumulate(w,w+W,0);

    vector<int>th(mxh+1,0),tw(mxw+1,0);

    for(int i=0;i<H;i++){
        int sum=0;
        for(int j=i;j<H;j++){
            sum+=h[j];
            th[sum]++;
        }
    }
    for(int i=0;i<W;i++){
        int sum=0;
        for(int j=i;j<W;j++){
            sum+=w[j];
            tw[sum]++;
        }
    }
    long long ans=0;
    for(int i=1;i<=min(mxh,mxw);i++){
        ans+=(long long)th[i]*tw[i];
    }

    printf("%d\n",ans);
}
int main(){
    while(scanf("%d%d",&H,&W),H||W)solve();
}

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

int main(){
    int N; cin>>N;
    vector<int> p(N); 
    for(int i=0;i<N;i++) cin>>p[i];

    int cnt=0;
    for(int i=0;i<N;i++){
        if(p[i]==i+1) cnt++;
    }
    if(cnt>=N-2) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
}

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

long long N, X[100009], G[100009], bit[200009];

void add(int pos, int x) {
	while (pos <= 200008) { bit[pos] += x; pos += (pos&-pos); }
}
int sum(int pos) {
	int s = 0;
	while (pos >= 1) { s += bit[pos]; pos -= (pos&-pos); }
	return s;
}

long long solve(long long p) {
	G[0] = 0;
	for (int i = 1; i <= N; i++) {
		if (X[i] <= p) G[i] = 1;
		else G[i] = -1;
	}
	for (int i = 1; i <= N; i++) G[i] += G[i - 1];
	for (int i = 0; i <= 200008; i++) bit[i] = 0;

	long long S = 0;
	for (int i = N; i >= 0; i--) {
		long long res = (N - i) - sum(G[i] + 100002); S += res;
		add(G[i] + 100002, 1);
	}
	return S;
}

int main() {
	cin >> N;
	for (int i = 1; i <= N; i++) cin >> X[i];

	long long L = 0, R = (1LL << 30), M, maxn = (1LL << 60);
	for (int i = 0; i < 40; i++) {
		M = (L + R) / 2;
		long long ret = solve(M);
		if (ret >= (N*(N + 1) / 2LL) / 2LL + 1LL) { maxn = min(maxn, M); R = M; }
		else { L = M; }
	}
	cout << maxn << endl;
	return 0;
}

Measured memory_bytes: 3328
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <numeric>
#include <queue>
#include <map> 
#include <set>
#include <string>
#include <functional>
using namespace std;
int dic[256] = { 0 };

int main(){
	string s;
	cin >> s;
	for (size_t i = 0; i < s.length(); i++){
		dic[s[i]]++;
	}
	bool flag = true;
	for (int i = 0; i < 256; i++){
		if (dic[i] >= 2) flag = false;
	}
	if (flag) cout << "yes\n";
	else cout << "no\n";


	return 0;
}

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

l0 = 2
l1 = 1
li = 0

if n == 0:
  print(l0)
elif n == 1:
  print(l1)
else:
  for i in range(2,n+1):
    li = l0 + l1
    l0 = l1
    l1 = li
    
  print(li)


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

int main() {
    int n;
    cin >> n;
    
    bool kind = false;
    for (int i = 0; i < n; i++){
        string str;
        cin >> str;
        if (str.at(0) == 'Y'){
            kind = true;
            break;
        }
    }

    cout << (kind ? "Four" : "Three") << endl;
}

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

int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  int num = 'z'-'a' + 1;
  vector<vector<int> > sloc(num,vector<int>(0)), tloc(num,vector<int>(0));
  string s, t;
  cin >> s >> t;
  int len = s.length();
  bool ok = true;
  rep(i,len) {
    sloc[s[i] - 'a'].push_back(i);
    tloc[t[i] - 'a'].push_back(i);
    if (sloc[s[i] - 'a'].size() != tloc[t[i] - 'a'].size()) {
      ok = false; break;
    }
  }
  if (ok) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 3092
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <numeric>
#include <iterator>
#include <cstring>
using namespace std;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	cerr.tie(nullptr);

	long long a, b, c, d, n;
	cin >> a >> b >> c >> d >> n;

	b = min(b, 2*a);
	c = min(c, 2*b);
	d = min(d, 2*c);

	cout << d * (n/2) + c * (n%2);
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e5+7;
int n,a,b,sum;
void dfs(int x,int y,int ban){
    if(__builtin_popcount(ban^sum) == 1){printf("%d %d ",y,x^y);return;}
    for(int i=0;i<n;i++)if((~(ban>>i))&1 && (x>>i)&1)
        for(int j=0;j<n;j++)if((~(ban>>j))&1 && i!=j){
            dfs(1<<j,y,ban|1<<i);
            dfs(x^(1<<i)^(1<<j),y^(1<<i)^(1<<j),ban|1<<i);
            return;
        }
}
signed main(){
    scanf("%d%d%d",&n,&a,&b);
    sum = (1<<n)-1;
    if(__builtin_popcount(a^b)%2 == 0)return 0*puts("NO");
    puts("YES");
    dfs(a^b,a,0);
    return 0;
}


Measured memory_bytes: 1024
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
using namespace std;
typedef long long ll;
ll MOD = 1e9+7;
#define rep(i,n) for(int i = 0; i < (n); ++i)
int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    vector<int> b(n, 0);
    int ans_num = 0;
    for ( int i = n - 1; i >= 0; --i ) {
        int sum = 0;
        for ( int j = i; j < n; j = j + ( i + 1 ) ) {
            if ( b[j] == 1 ) ++sum;
        }
        if ( sum % 2 != a[i] ) {
            b[i] = 1;
            ++ans_num;
        }  
    }
    cout << ans_num << endl;
    rep(i, n) if ( b[i] == 1 ) printf("%d ", ( i + 1 ) );
    if ( ans_num != 0 ) cout << endl;
    return 0;
}


Measured memory_bytes: 2432
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
    string s;
    cin >> s;
    
    int n = s.size();
    bool ok = true;
    
    for (int i = 0; i < n; i++) {
        if (s[i] != s[n-i-1]) {
            ok = false;
            //cout << "no:1" << endl;
            break;
        }
    }
    
    for (int i = 0; i < (n-1) / 2; i++) {
        if (s[i] != s[(n-1)/2-i-1]) {
            ok = false;
            //cout << "no:2" << endl;
            break;
        }
    }
    
    for (int i = (n+3)/2-1; i < n; i++) {
        if (s[i] != s[n-i-1]) {
            ok = false;
            //cout << "no:3" << endl;
            break;
        }
    }
    
    if(ok)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    
    return 0;
}


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

int main(){
    int N;
    string ans = "Three";
    cin >> N;
    for(int i = 0; i <= N; i++){
        string s;
        cin >> s;
        if(s == "Y"){
            ans = "Four";
            break;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(void) {
    int n;
    scanf("%d",&n);
    if (n < 10) {
        printf("ABC00%d\n",n);
    } else if(n < 100) {
        printf("ABC0%d\n",n);
    } else {
        printf("ABC%d\n",n);
    }
    return 0;
}


Measured memory_bytes: 128
#include <iostream>
    #include <string>
    #include <set>  
    #include <stack>
    #include <algorithm>
    #include <vector>
    #include <cmath>
    #include <queue>
    #include <deque>
    #include <cstring>
    #include <cstdio>
    #include <map>
    #include <numeric>
    #include <cassert>
    #include <iomanip>
    #include <sstream>
    #include <ctime>
    #include <bitset> 
    #include <unordered_set>
using namespace std;
#define for1(i,a,b) for(int i=(a);i<(int)(b);++i)
#define rep(i,maxn) for1(i,0,maxn)
#define ford(i,b,a) for(int i=(int)(b)-1;i>=a;--i)
typedef long long ll;
typedef unsigned long long int128;
typedef pair<int,int> pii;
typedef pair<int,pii > piii;
#define inf 0x3f3f3f3f
#define mod 1000000007
#define eps 1e-10
#define pi acos(-1)
#define st first
#define nd second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define dprintf(...) printf(__VA_ARGS__)
#define lson(x) ((x)<<1)
#define rson(x) ((x)<<1^1)
const int maxn=405;
int C[maxn][4];
struct tile
{
	int a,b,c,d;
	tile(){}
	tile(int _a,int _b,int _c,int _d):a(_a),b(_b),c(_c),d(_d){} 
	bool operator < (const tile &t)const
	{
		return (a!=t.a?a<t.a:b!=t.b?b<t.b:c!=t.c?c<t.c:d<t.d);
	}
	bool operator == (const tile &t)
	{
		return a==t.a&&b==t.b&&c==t.c&&d==t.d;
	}
};
map<tile,int> m;
void ins(int a,int b,int c,int d)
{
	m[tile(a,b,c,d)]++;
	m[tile(b,c,d,a)]++;
	m[tile(c,d,a,b)]++;
	m[tile(d,a,b,c)]++;
}
vector<tile> vx;
int same(tile a,tile b)
{
	int ans=0;
	int aa=b.a,bb=b.b,cc=b.c,dd=b.d;
	if(a==tile(aa,bb,cc,dd))ans++;
	if(a==tile(bb,cc,dd,aa))ans++;
	if(a==tile(cc,dd,aa,bb))ans++;
	if(a==tile(dd,aa,bb,cc))ans++;
	return ans;
}
int main()
{
	int n;
	cin>>n;
	rep(i,n)rep(j,4)cin>>C[i][j];
	ll ans=0;
	ford(i,n,0)
	{
		rep(j,vx.size())
		{
			tile cur=vx[j];
			int a=cur.a,b=cur.b,c=cur.c,d=cur.d;
		//	cout<<C[i][0]<<" "<<C[i][1]<<" "<<C[i][2]<<" "<<C[i][3]<<endl;
		//	cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl;
		//	system("pause"); 
			tile x=tile(C[i][0],C[i][1],b,a);
			tile y=tile(C[i][1],C[i][2],c,b);
			tile z=tile(C[i][2],C[i][3],d,c);
			tile w=tile(C[i][3],C[i][0],a,d);
		//	cout<<"x: "<<x.a<<" "<<x.b<<" "<<x.c<<" "<<x.d<<" "<<m[x]<<endl;
		//	cout<<"y: "<<y.a<<" "<<y.b<<" "<<y.c<<" "<<y.d<<" "<<m[y]<<endl;
		//	cout<<"z: "<<z.a<<" "<<z.b<<" "<<z.c<<" "<<z.d<<" "<<m[z]<<endl;
		//	cout<<"w: "<<w.a<<" "<<w.b<<" "<<w.c<<" "<<w.d<<" "<<m[w]<<endl; 
			ll res=1;
			res*=1ll*m[x]-same(cur,x);
		//	cout<<m[x]<<" "<<same(cur,x)<<endl;
			res*=1ll*m[y]-same(x,y)-same(cur,y);
		//	cout<<m[y]<<" "<<same(x,y)<<" "<<same(cur,y)<<endl;
			res*=1ll*m[z]-same(x,z)-same(y,z)-same(cur,z);
		//	cout<<m[z]<<" "<<same(x,z)<<" "<<same(y,z)<<" "<<same(cur,z)<<endl;
			res*=1ll*m[w]-same(x,w)-same(y,w)-same(z,w)-same(cur,w);
		//	cout<<m[w]<<" "<<same(x,w)<<" "<<same(y,w)<<" "<<same(z,w)<<" "<<same(cur,w)<<endl;
			ans+=res;
		//	cout<<res<<" "<<ans<<endl;
		//	system("pause");
		}
		int a=C[i][0],b=C[i][3],c=C[i][2],d=C[i][1];
		ins(a,b,c,d);
		vx.pb(tile(a,b,c,d));
		vx.pb(tile(b,c,d,a));
		vx.pb(tile(c,d,a,b));
		vx.pb(tile(d,a,b,c));
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 80128
#define _CRT_SECURE_NO_DEPRECATE
#include<iostream>
#include<cstring>
#include<string>
#include<algorithm>
#include<stdio.h>
#include<queue>
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<time.h>
#include<cmath>
#include<sstream>
#include<assert.h>
using namespace std;
#define L(x) x<<1
#define R(x) x<<1|1
typedef long long int LL;
const int inf = 0x3f3f3f3f;
const LL INF = 0x3f3f3f3f3f3f3f3fLL;
const int MAXN = 1e5 + 24;
int head[MAXN], tot, cnt;
LL val[MAXN];
struct Edge{
	int to,next;
	LL weight;
	Edge(int _to = 0, int _next = 0,LL _w=0) :to(_to), next(_next),weight(_w){};
}Edges[MAXN * 2];
void add(int u, int v,LL w){
	Edges[tot].to = v;
	Edges[tot].next = head[u];
	Edges[tot].weight=w;
	head[u] = tot++;
}
int id[MAXN], son[MAXN], deep[MAXN], size[MAXN], fa[MAXN], reid[MAXN], top[MAXN];
void Init(){
	tot = 0; cnt = 0;
	memset(val,0,sizeof(val));
	memset(head, -1, sizeof(head));
	memset(son, -1, sizeof(son));
}
void DFS1(int u, int p,int dep,LL _v){
	fa[u] = p; size[u] = 1; deep[u] = dep; val[u]=_v;
	for (int i = head[u]; i != -1; i = Edges[i].next){
		if (Edges[i].to != p){
			DFS1(Edges[i].to, u,dep+1,Edges[i].weight);
			size[u] += size[Edges[i].to];
			if (son[u] == -1 || size[Edges[i].to] > size[son[u]]){
				son[u] = Edges[i].to;
			}
		}
	}
}
void DFS2(int u, int tp){
	id[u] = ++cnt; reid[id[u]] = u; top[u] = tp;
	if (son[u] == -1){ return; }
	DFS2(son[u], tp);
	for (int i = head[u]; i != -1; i = Edges[i].next){
		if (son[u] != Edges[i].to&&Edges[i].to != fa[u]){
			DFS2(Edges[i].to, Edges[i].to);
		}
	}
}
struct Node{
	int st, ed;
	LL sum;
}Seg[MAXN * 4];
void Build(int l, int r, int k){
	Seg[k].st = l; Seg[k].ed = r; 
	if (l == r){
		Seg[k].sum = val[reid[l]]; 
		return;
	}
	int mid = (l + r) / 2;
	Build(l, mid, L(k)); Build(mid + 1, r, R(k));
	Seg[k].sum = Seg[L(k)].sum + Seg[R(k)].sum;
}
void pushUp(int k){
	Seg[k].sum = Seg[L(k)].sum + Seg[R(k)].sum;
}
LL QuerySum(int l, int r, int k){
	if (Seg[k].st == l&&Seg[k].ed == r){
		return Seg[k].sum;
	}
	LL sum = 0;
	if (r <= Seg[L(k)].ed){
		sum = QuerySum(l, r, L(k));
	}
	else if (l >= Seg[R(k)].st){
		sum = QuerySum(l, r, R(k));
	}
	else{
		sum = QuerySum(l, Seg[L(k)].ed, L(k)) + QuerySum(Seg[R(k)].st, r, R(k));
	}
	pushUp(k);
	return sum;
}
LL QuerySum(int u,int v){
	LL ans = 0;
	int f1 = top[u], f2 = top[v];
	while (f1!=f2){
		if (deep[f1] < deep[f2]){
			swap(f1, f2);
			swap(u, v);
		}
		ans += QuerySum(id[f1], id[u],1);
		u = fa[f1]; f1 = top[u];
	}
	if (deep[u] > deep[v]){
		swap(u, v);
	}
	ans += QuerySum(id[u],id[v], 1);
	return ans;
}
int main(){
#ifdef kirito
	freopen("in.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
#endif
	int start = clock();
	int n, m,st;
	while (~scanf("%d",&n)){
		Init();
		for (int i = 1; i < n; i++){
			int u, v;
			LL w;
			scanf("%d%d%lld", &u, &v,&w);
			add(u, v,w); add(v, u,w);
		}
		scanf("%d%d", &m,&st);
		DFS1(st, 0, 0, 0); DFS2(st, st); Build(1, n, 1);
		while (m--){
			int u,v;
			scanf("%d%d",&u,&v);
			printf("%lld\n", QuerySum(u,st)+QuerySum(st,v)); 
		}
	}
#ifdef LOCAL_TIME
	cout << "[Finished in " << clock() - start << " ms]" << endl;
#endif
	return 0;
}

Measured memory_bytes: 21376
#include <algorithm>
#include <iostream>
#include <math.h>
#include <cstdio>
#include <string.h>
#include <vector>
#include <functional>
#include <stack>
#include <queue>
#include <string>
#include <list>
using namespace std;
typedef long long ll;
/* prototype */
int EDSum(ll);//各桁の和
vector<int> SOE(int,int);//素数 (Min,Max)
int MinCM(int,int);//最小公倍数(num1,num2)
int MaxCD(int,int);//最大公約数(num1,num2)
vector<int> igets(int);//cin * N
ll nPr(ll,ll); //(n,r)
ll nE(ll); //(n)
ll nCr(ll,ll); //(n,r)

void solve(){
    //START
  	char A,B;
  	cin >> A>> B;
  	if(A==B)
    	cout << "H" << endl;
	else cout << "D" << endl;
}

int main(void){cin.tie(0);ios::sync_with_stdio(false);solve();}
/*FUNC*/
//各桁の和
int EDSum(ll number){
    int ans=0;
    while(1){
        ans += number % 10;
        number /= 10;
        if(number == 0) break;
    }
    return ans;
}

//エラトステネスのふるい(素数発見アルゴリズム)
vector<int> SOE(int min, int max)
{
    //0,1は含まれない
    if (min < 2) min = 2;
    //探索リスト作成
    vector<int> int_array;
    for (int i = min; i <= max; i++) int_array.push_back(i);
    //素数リスト
    vector<int> sosu;
    //√max
    double stop = sqrt(max);
    //計算
    while (true)
    {
        //素数リストに追加
        sosu.push_back(int_array.front());
        int_array.erase(int_array.begin());
        //停止
        if (stop < (double)(sosu.back())) break;
        //ふるい
        for (int i = 0; i < (int)int_array.size(); i++)
        {
            if (int_array[i] % sosu.back() == 0)
                int_array.erase(int_array.begin() + i);
        }
    }
    sosu.insert(sosu.end(), int_array.begin(), int_array.end());
    return sosu;
}

//最小公倍数
int MinCM(int a, int b)
{
    int c = a * b;
//入れ替え
    if (a < b)
        swap(a, b);
    int r = a % b;
    while (r != 0)
    {
        a = b;
        b = r;
        r = a % b;
    }
    return c / b;
}

//最大公約数
int MaxCD(int a, int b)
{
//入れ替え
    if (a < b)
        swap(a, b);
    int r = a % b;
    while (r != 0)
    {
        a = b;
        b = r;
        r = a % b;
    }
    return b;
}
//iget cin int 2 vector
vector<int> igets(int N){
    vector<int> A;
    int temp;
    for (int i = 0; i < N; ++i) {
        cin >> temp;
        A.push_back(temp);
    }
    return A;
}

ll nPr(ll n,ll r) {
    ll ans=1;
    r=n-r;
    while(n!=r) {
        ans*=n;
        --n;
    }
    return ans;
}

ll nE(ll n) {
    return nPr(n,n);
}

ll nCr(ll n,ll r) {
    if(r==0)return -1;
    else{
        if(0!=n-r&&n-r<r)r=n-r;
        return nPr(n,r)/nE(r);
    }
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include <cassert>
#include<string>
#include<vector>
#include <utility>
#include <math.h>
#include<cmath>
#define INF 1000000000;
using namespace std;
vector<pair<long long,long long>>juice;
int gcd(int a,int b){
	while (a % b != 0) {
		int c = 0;
		c = a % b;
		a = b;
		b = c;
	}
	return  b;
}
int d[1000009] = { 0 };
int main() {
	int a = 0, b = 0;
	cin >> a >> b;
	int ans = 0;
	for (int i = 0; i < a; i++) {
		cin >> d[i];
		d[i] = abs(d[i] - b);
		if (i > 0) {
			//cout << max(d[i - 1], d[i]) << min(d[i - 1], d[i]) << endl;
			d[i] = gcd(max(d[i - 1], d[i]), min(d[i - 1], d[i]));
		}
		if (d[i] == 1) {
			cout << '1' << endl;
			return 0;
		}
	}
	cout << d[a - 1] << endl;
	return 0;
}

Measured memory_bytes: 640
import std.algorithm, std.container, std.conv, std.math, std.range, std.typecons, std.stdio, std.string;

auto rdsp(){return readln.splitter;}
void pick(R,T)(ref R r,ref T t){t=r.front.to!T;r.popFront;}
void readV(T...)(ref T t){auto r=rdsp;foreach(ref v;t)pick(r,v);}
void readC(T...)(size_t n,ref T t){foreach(ref v;t)v=new typeof(v)(n);foreach(i;0..n){auto r=rdsp;foreach(ref v;t)pick(r,v[i]);}}

void main()
{
  int n, m; readV(n, m);
  int[] a, b; readC(m, a, b); --a[]; --b[];

  auto uf = UnionFind(n);
  auto f = new long[](m); f[$-1] = long(n)*(n-1)/2;

  foreach_reverse (i; 1..m) {
    if (uf.isSame(a[i], b[i])) {
      f[i-1] = f[i];
    } else {
      f[i-1] = f[i] - uf.countNodes(a[i]).to!long*uf.countNodes(b[i]);
      uf.unite(a[i], b[i]);
    }
  }

  foreach (i; 0..m) writeln(f[i]);
}

struct UnionFind
{
  import std.algorithm, std.range;

  int[] p;
  const size_t n;
  const int s;
  size_t cf;
  size_t[] cn;

  this(size_t n)
  {
    this.n = n;
    s = cast(int)n;
    p = new int[](n);
    p[] = s;
    cf = n;
    cn = new size_t[](n); cn[] = 1;
  }

  bool unite(int i, int j)
  {
    auto pi = subst(i), pj = subst(j);
    if (pi != pj) {
      p[pj] = pi;
      --cf;
      cn[pi] += cn[pj];
      return true;
    } else {
      return false;
    }
  }

  bool isSame(int i, int j) { return subst(i) == subst(j); }
  @property countForests() { return cf; }
  auto countNodes(int i) { return cn[subst(i)]; }

  auto groups()
  {
    auto g = new int[][](n);
    foreach (i; 0..cast(int)n) g[subst(i)] ~= i;
    return g.filter!(l => !l.empty);
  }

private:

  int subst(int i) { return p[i] == s ? i : (p[i] = subst(p[i])); }
}


Measured memory_bytes: 6140
/*
 *    author:  Gary Shih
 *    created: 2020-05-04 13:27:07
 */
#pragma GCC optimize("O3")
#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.setf(ios::fixed), cout.precision(9);
  int n;
  cin >> n;
  int c1 = 0, c2 = 0, c3 = 0;
  for (int i = 0; i < n; ++i) {
    int a;
    cin >> a;
    if (a == 1) ++c1;
    if (a == 2) ++c2;
    if (a == 3) ++c3;
  }
  int maxSushi = 900;
  vector<vector<vector<double>>> dp(
      maxSushi + 1, vector<vector<double>>(maxSushi / 2 + 1,
                                           vector<double>(maxSushi / 3 + 1)));
  for (int total = 1; total <= c1 + 2 * c2 + 3 * c3; ++total) {
    for (int i = 0; i <= total; ++i)
      for (int j = 0; j <= (total - i) / 2; ++j) {
        if ((total - i - 2 * j) % 3 != 0) continue;
        int k = (total - i - 2 * j) / 3;
        int rest = i + j + k;
        double prev = 0.0;
        if (i > 0) prev += dp[i - 1][j][k] * i / n;
        if (j > 0) prev += dp[i + 1][j - 1][k] * j / n;
        if (k > 0) prev += dp[i][j + 1][k - 1] * k / n;
        dp[i][j][k] = (prev + 1) * n / rest;
      }
  }
  cout << dp[c1][c2][c3] << '\n';
}


Measured memory_bytes: 971648
#include<iostream>
#include <list>
#include<stack>
#include<queue>
#include <vector>
#include <set>
#include<algorithm>
#include<math.h>
#include<stdlib.h>
#include<string>
#include <functional>
#include<map>

#define FOR(k,m,n) for(int (k)=(m);(k)<(n);(k)++)
#define REP(i,n) FOR((i),0,(n))
#define LL long long
#define CLR(a) memset((a),0,sizeof(a))
#define SZ(x) (int((x).size()))
#define WAITING(str) int str;std::cin>>str;
#define DEBUGING(str) cout<<str<<endl
using namespace std;

const LL MOD = 1000000007;// 10^9+7
const int INF = (1 << 30);

//名前の通り。　N個の独立した要素を併合するときに使用
class UnionFind {
public:
	vector<int>rank, parent;
	//初期化
	UnionFind(){}
	UnionFind(int size) {
		rank.resize(size, 0);
		parent.resize(size, 0);
		REP(i, size)parent[i] = i;
	}
	//木の根を求める
	int find(int x) {
		if (parent[x] == x)return x;
		else return parent[x] = find(parent[x]);
	}
	//xとyの属する集合を併合
	void unite(int x, int y) {
		x = find(x);
		y = find(y);
		if (x == y)return;
		if (rank[x] < rank[y])
			parent[x] = y;
		else {
			parent[y] = x;
			if (rank[x] == rank[y])rank[x]++;
		}
	}
	//xとyが同じ集合に属するか否か
	bool same(int x, int y) {
		return (find(x) == find(y));
	}
	//parentの内容を出力
	void debug() {
		for (auto num : parent) {
			cout << num << " ";
		}
		cout << "more:" << endl;
		REP(i, parent.size()) {
			cout << find(i) << " ";

		}
		cout << endl << "more:" << endl;
		for (auto num : parent) {
			cout << num << " ";
		}
		cout << endl;
	}
};





//変数
int N, K, L;
UnionFind road, rail;





//サブ関数
//入力
void input()
{
	cin >> N >> K >> L;
	road = UnionFind(N);
	rail = UnionFind(N);

	int l, r;
	REP(i, K) {
		cin >> l >> r;
		l--; r--;
		road.unite(l, r);
	}

	REP(i, L) {
		cin >> l >> r;
		l--; r--;
		rail.unite(l, r);
	}
}


//計算
void calc()
{
	vector<pair<int, int>> group;//各都市の、所属している道路集合と鉄道集合の親ノードid
	REP(i, N) {
		group.push_back(make_pair(road.find(i), rail.find(i)));
	}

	map<pair<int, int>, int>mp; //引数：親ノードセット　　返り値：個数
	for (auto gp : group) {
		if (mp.find(gp) != mp.end()) {
			mp[gp]++;
		}
		else {
			mp[gp] = 1;
		}
	}

	for (auto gp : group) {
		cout << mp[gp] << " ";
	}
	cout << endl;
}


//出力
void output()
{

}


//デバッグ
void debug()
{
	int N;
	cin>>N;
}


//メイン関数
int main()
{
	input();
	calc();
	output();
	debug();
	
	return 0;
}


Measured memory_bytes: 16624
/*
　　　  ∧＿∧　やあ
　　 （´・ω・｀)　　　　　/　　　　　ようこそ、バーボンハウスへ。
　　 ／∇y:::::＼　　　 [￣]　　　　　このテキーラはサービスだから、まず飲んで落ち着いて欲しい。
　　 |:⊃:|:::::|　　　|──|
￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣|　うん、「また」なんだ。済まない。
￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣|￣　  仏の顔もって言うしね、謝って許してもらおうとも思っていない。
￣￣￣￣￣￣￣￣￣￣￣￣￣￣／|
　　　　∇　∇　∇　∇　　　／.／|　　　でも、この提出を見たとき、君は、きっと言葉では言い表せない
　　　　┴　┴　┴　┴　／ ／　  |　　　「ときめき」みたいなものを感じてくれたと思う。
￣￣￣￣￣￣￣￣￣￣|／　　  |　　　殺伐としたコンテストの中で、そういう気持ちを忘れないで欲しい
￣￣￣￣￣￣￣￣￣￣　　　　 |　　　そう思って、この提出を投げたんだ。
　　　(⊆⊇)　(⊆⊇)　(⊆⊇)　　|
　    ||　　 ||　　||　　|　　　 じゃあ、判定を聞こうか。
　　.／|＼　／|＼ ／|＼
*/

#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define fst first
#define snd second
#define mp make_pair
#define ALL(obj) (obj).begin(),(obj).end()
#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) RFOR(i,0,n) 
#define SIZE(x) ((int)(x).size())
#define debug(x) cerr << #x << " -> " << x << " (line:" << __LINE__ << ")" << '\n';
#define debugpair(x, y) cerr << "(" << #x << ", " << #y << ") -> (" << x << ", " << y << ") (line:" << __LINE__ << ")" << '\n';
typedef long long lint;
typedef pair<int, int> pint;
typedef pair<lint, lint> plint;
typedef vector<lint> vec;
typedef vector<vector<lint>> matrix;
typedef priority_queue<lint> p_que;
typedef priority_queue<lint, vector<lint>, greater<lint>> p_que_rev;
const lint INF = INT_MAX;
const lint LINF = LLONG_MAX;
const lint MOD = 1000000000 + 7;
const double EPS = 1e-9;
const double PI = acos(-1);
const int di[]{0, -1, 0, 1, -1, -1, 1, 1};
const int dj[]{1, 0, -1, 0, 1, -1, -1, 1};

lint gcd(lint a, lint b) {
    lint r;
    while (b != 0) {
        r = a % b;
        a = b; 
        b = r;
    }
    return a;
}

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

lint power(lint x, lint n, lint mod = MOD) {
    lint ret = 1;
    while(n > 0) {
        if(n & 1){
            (ret *= x) %= mod;
        }
        (x *= x) %= mod;
        n >>= 1;
    }
    return ret;
}

vector<lint> make_power(int n, lint base){
    lint num = 1;
    vector<lint> ret;
    for (int i=0; i<=n; ++i){
        ret.push_back(num);
        num *= base;
    }
    return ret;
}

int main()
{
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    string s;
    cin >> s;
    int a_min = s.length();
    int z_max = 0;
    REP(i, s.length()){
        if(s[i] == 'A'){
            a_min = min(a_min, i);
        }
        else if(s[i] == 'Z'){
            z_max = i;
        }
    }
    cout << z_max - a_min + 1 << endl;
    return 0;
}

Measured memory_bytes: 720
n = int(input())
d = []
for i in range(n):
  a,b = map(int,input().split())
  d.append([a,b])
ans = 'No'
count = 0
for i in range(n):
  if d[i][0] == d[i][1]:
    count +=1
  else:
    count = 0
  if count == 3:
    ans = 'Yes'
    break
  
print(ans)

Measured memory_bytes: 9188
from collections import Counter

n = int(input())
s = [str(input()) for i in range(n)] 
m = int(input())
t = [str(input()) for i in range(m)] 

s = Counter(s)
t = Counter(t)

pointmax = 0

for a in s:
    ans = s[a] - t[a]
    if(ans > pointmax):
        pointmax = ans

print(pointmax)

Measured memory_bytes: 3316
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define pb push_back
typedef long long ll;
const int INF = 100100100;
const int MOD = (int)1e9 + 7;

int main()
{
    ll h, w, s;
    cin >> h >> w;
    if(h==1 || w ==1){
        s = 1;
    }else
    if (h % 2 == 1 && w % 2 == 1)
    {
        s = h * w * 0.5 + 1;
        
    }
    else
    {
        s = h * w * 0.5;
     
    }
    cout << s << endl;
}


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

#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 (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

#define INF INT_MAX/3
#define ALL(a) (a).begin(),(a).end()
#define SET(a,c) memset(a,c,sizeof a)
#define CLR(a) memset(a,0,sizeof a)
#define ll long long
#define ull unsigned long long

#define PI (3.1415926535897932)
#define eps 1e-8

int main() {
	int N;
	ll a[300001];
	cin >> N;
	REP(i, 3*N)cin >> a[i];
	sort(a, a + 3 * N);
	ll ans = 0;
	for (int i = 0; i < N; i++) {
		ans += a[3*N - i * 2 - 2];
	}
	cout << ans << endl;
}


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

int main(){
  char l[33];

  while((cin>>l)&&(l[0]!='#')){
    int count=0;
    int size=0;
    for(int i=0;i<33;i++){
      if(l[i]=='\0'){
        size = i;
        break;
      }
    }
    int hand=-1;
    for(int i=0;i<size;i++){
      if(l[i]=='y'||l[i]=='u'||l[i]=='i'||l[i]=='o'||l[i]=='p'||l[i]=='h'||l[i]=='j'||l[i]=='k'||l[i]=='l'||l[i]=='n'||l[i]=='m'){
        if(hand==-1) hand=0;
        if(hand==1){
          hand=0;
          count++;
        }
      }else if(l[i]=='q'||l[i]=='w'||l[i]=='e'||l[i]=='r'||l[i]=='t'||l[i]=='a'||l[i]=='s'||l[i]=='d'||l[i]=='f'||l[i]=='g'||l[i]=='z'||l[i]=='x'||l[i]=='c'||
          l[i]=='v'||l[i]=='b'){
        if(hand==-1) hand=1;
        if(hand==0){
          hand=1;
          count++;
        }
      }
    }
    cout << count << endl;
  }

  return 0;
}

Measured memory_bytes: 1140
/*
      author : nishi5451
      created: 11.08.2020 22:18:38
*/

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


int main(){
    string s,t;
    cin >> s >> t;
    int ans = 0;
    rep(i,3){
        if(s[i] == t[i]) ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3628
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <unordered_map>
#include <utility>
#include <algorithm>
#include <set>
#include <cmath>
#include <array>
#include <bitset>
using namespace std;

typedef long long ll;
const ll mod=1000000007;
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,n) for(int i=1;i<n+1;i++)
int main(){
    int N,L;
    cin>>N>>L;
    int sum=0;
    rep(i,N) sum+=L+i;
    if(L+N-1<0) cout<<sum-(L+N-1);
    else if(L>0) cout<<sum-L;
    else cout<<sum;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>


int main(void){
    int N;
    scanf("%d",&N);
    char po[350][350];
    for(int i=0;i<N;i++)scanf("%s",po[i]);
    int ans=0;
    for(int i=0;i<N;i++){
        int flag=1;
        for(int j=0;j<N;j++)for(int k=0;k<N;k++){
        if(po[(i+j)%N][k]!=po[(k+i)%N][j]){flag=0;/*printf("%c %c\n",po[(i+j)%N][k],po[k][j]);*/}
    }
        if(flag==1)ans+=N;
    }
    printf("%d",ans);
    return 0;
}


Measured memory_bytes: 256
#ifdef MY_LOCAL
#define MY_NAMESPACE(ns) namespace ns {
#define MY_NAMESPACE_   }
#else
#define MY_NAMESPACE(ns)
#define MY_NAMESPACE_
#endif

#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

MY_NAMESPACE(ABC168C)
int main()
{
	const double PI = acos(-1.0);

	int a, b, h, m;
	cin >> a >> b >> h >> m;

	int mins = 60 * h + m;
	double deg = (6.0 - 0.5) * mins;
	double rad = 2.0 * PI / 360.0 * deg;
	double distance_sqr = pow((double)a, 2.0) + pow((double)b, 2.0) - 2.0 * (double)a * (double)b * cos(rad);
	double distance = sqrt(distance_sqr);

	cout << setprecision(10) << distance << endl;
	return 0;
}
MY_NAMESPACE_

Measured memory_bytes: 4224
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
  int a,b,c,d,x,y;
  cin>>a>>b>>c>>d;
  x=a*b;
  y=c*d;
  if(x>y)
    cout<<x<<endl;
  else if(x<y)
    cout<<y<<endl;
  else
    cout<<x<<endl;
  return 0;
}


Measured memory_bytes: 256
from collections import defaultdict
dic = defaultdict(int) 
N = int(input())
D = list(map(int,input().split()))
for i in range(N):
  dic[D[i]] += 1


M = int(input())
T = list(map(int,input().split()))

for i in range(M):
  if dic[T[i]] == 0:
    print("NO")
    exit()
  else:
    dic[T[i]] -= 1
print("YES")

Measured memory_bytes: 51928
#include <bits/stdc++.h>
using namespace std;
typedef pair< int, int > Pi;
 
int h, w, s, u[32][32];
Pi dp[33][33][33][33];
int Sum[34][34];
int ALL;
 
int getSum(int x1, int y1, int x2, int y2)
{
    return(Sum[y2][x2] + Sum[y1][x1] - Sum[y1][x2] - Sum[y2][x1]);
}
 
Pi rec(int x1, int y1, int x2, int y2)  // ????????????
{
    if(dp[x1][y1][x2][y2] != Pi(-1, -1)) return(dp[x1][y1][x2][y2]);
    Pi ret = Pi(-114514, 114514);
    int JUYO = ALL - getSum(x1, y1, x2, y2);
    if(JUYO <= s) {
        ret = Pi(1, -JUYO);
        for(int xline = x1 + 1; xline < x2; xline++) {  // ??????kill
            Pi Left   = rec(x1, y1, xline, y2);
            if(Left.first == -114514) continue;
            Pi Right  = rec(xline, y1, x2, y2);
            if(Right.first == -114514) continue;
            ret = max(ret, Pi(Left.first + Right.first, -max(-Left.second, -Right.second)));
        }
     
        for(int yline = y1 + 1; yline < y2; yline++) {  // ?¨????kill
            Pi Left   = rec(x1, y1, x2, yline);
            if(Left.first == -114514) continue;
            Pi Right  = rec(x1, yline, x2, y2);
            if(Right.first == -114514) continue;
            ret = max(ret, Pi(Left.first + Right.first, -max(-Left.second, -Right.second)));
        }
    }
    return(dp[x1][y1][x2][y2] = ret);
}
 
int main()
{
    while(scanf("%d %d %d", &h, &w, &s), h) {
        fill_n(***dp, 33 * 33 * 33 * 33, Pi(-1, -1));
        ALL = 0;
        for(int i = 0; i < h; i++) {
            for(int j = 0; j < w; j++) {
                scanf("%d", &u[i][j]);
                ALL += u[i][j];
            }
        }
         
        for(int i = 1; i <= h; i++) {
            for(int j = 1; j <= w; j++) {
                Sum[i][j] = Sum[i][j - 1] + Sum[i - 1][j] - Sum[i - 1][j - 1] + u[i - 1][j - 1];
            }
        }
        Pi ret = rec(0, 0, w, h);
        cout << ret.first << " " << s + ret.second << endl;
    }
}

Measured memory_bytes: 10492
n, k = map(int, input().split())
d = list(map(int, input().split()))


for i in range(10*n+2):
  if i >= n:
    s = str(i)
    for j in range(len(s)):
      if int(s[j]) in d:
        break
    else:
      print(i)
      exit()


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

using namespace std;

#define ff(i, a, b) for(int i = (a); (i <= (b)); ++i)
#define FF(i, a, b) for(int i = (a); (i >= (b)); --i)
#define ll long long

const int M = 1000000000 + 7;

struct re {
    int x, y;
};

string s;
int n;

int main() {
    //ios_base::sync_with_stdio(false); cin.tie(0);
    //freopen("", "r" , stdin);
    //freopen("", "w", stdout);
    cin >> s;
    n = s.size();
    int res = n;
    for (int i = 0; i < n - 1; ++i) {
        if (s[i] == s[i + 1]) {
            --res;
            i += 2;
        }
    }
    cout << res;
}
//This code belongs to s34vv1nd


Measured memory_bytes: 640
using System;

namespace A___Product
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = Console.ReadLine().Split(' ');
            var a = int.Parse(input[0]);
            var b = int.Parse(input[1]);
            if ((a * b) % 2 == 0)
            {
                Console.WriteLine("Even");
            }
            else
            {
                Console.WriteLine("Odd");
            }
        }
    }
}

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

using namespace std;

int n;
pair<pair<string, int>, int> si[100];

int main() {
    cin >> n;
    for(int i = 0; i < n; i++) {
        int point;
        
        cin >> si[i].first.first >> point;
        si[i].first.second = -point;
        si[i].second = i + 1;
    }

    sort(si, si+n);

    for(int i = 0; i < n; i++) {
        cout << si[i].second << '\n';
    }

    return 0;
}

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

int main(){
    int n, k, x, y;
    cin >> n >> k >> x >> y;

    int ans = 0;
    if(n <= k){
        ans += n * x;
    }else{
        ans += k * x;
        ans += (n - k) * y;
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
	 
	  public static String getKey(Long index){
		String colCode = "";
		char key='a';
		Long loop = index / 26;
		if(loop>0){
			colCode += getKey(loop-1);
		}
		key = (char) (key+index%26);
		colCode += key;
		return colCode;
	}

		public static void main(String[] args) {
	        Scanner sc = new Scanner(System.in);
	        Long n = sc.nextLong();
	        System.out.println(getKey(n-1)); 
		}
}

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

int main(){
    int A=0,B=0,C=0,X=0,Y=0,vir=0,ans=1000000000;
    cin >> A >> B >> C >> X >> Y ;
    for(int i=0;i<=200000;i+=2){
        vir=C*i;
        if(X>i/2)vir+=A*(X-i/2);
        if(Y>i/2)vir+=B*(Y-i/2);
        if(ans>vir)ans=vir;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256