akhauriyash/Code-Regression huggingface dataset:
def main():
    from sys import setrecursionlimit, stdin
    from os import environ
    from collections import defaultdict, deque, Counter
    from math import ceil, floor
    from itertools import accumulate, combinations, combinations_with_replacement
    setrecursionlimit(10**6)
    dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in environ else lambda *x: 0
    input = lambda: stdin.readline().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    P = 10**9+7
    INF = 10**9+10


    def sieve_of_eratosthenes(upper_bound):
        upper_bound += 1
        P = [True] * upper_bound
        P[0] = P[1] = False
        for i in range(4,upper_bound,2):
            P[i] = False
        for i in range(3,int(upper_bound**0.5),2):
            if P[i]:
                for j in range(i**2,upper_bound,i):
                    P[j] = False
        return P

















    num_like2017 = [0]*(10**5+1)
    primes = sieve_of_eratosthenes(10**5)
    for i in range(1,10**5+1):
        if primes[i] and primes[(i+1)//2]:
            num_like2017[i] = num_like2017[i-1] + 1
        else:
            num_like2017[i] = num_like2017[i-1]
    out = deque()
    Q = II()
    for i in range(Q):
        l,r = LMIIS()
        out.append(num_like2017[r] - num_like2017[l-1])
    
    for o in out:
        print(o)

    
main()

Measured memory_bytes: 53212
#include <iostream>
#include <math.h>

using namespace std;

#define SIZE_OF_ARRAY(array)    (sizeof(array)/sizeof(array[0]))

int main()
{
    int a,b,c,temp;
    cin >> a >> b >>c;
    int p[] = {a, b, c};
        for(int i = 0; i < SIZE_OF_ARRAY(p); i++)
        {
            for(int j = 1; j < SIZE_OF_ARRAY(p)-i; j++)
            {
                if(p[i] > p[i+j])
                {
                    temp = p[i];
                    p[i] = p[i+j];
                    p[i+j] = temp;
                }
            }
        }
        cout << p[0] <<" "<< p[1]<<" "<< p[2] << endl;

    return 0;
}


Measured memory_bytes: 3120
#include <bits/stdc++.h>
#include<bits/stdc++.h>
using namespace std;
#define  _GLIBCXX_PERMIT_BACKWARD_HASH
#include <ext/hash_map>
#include <ext/hash_set>
using namespace __gnu_cxx;
struct str_hash{
	size_t operator()(const string& str) const
	{ return __stl_hash_string(str.c_str()); }};
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/priority_queue.hpp>

using namespace __gnu_pbds;
using namespace std;

map<long long  ,long long > cnt;
long long  arr[100050];
bool isPrime[3060];
vector< long long > prime;
long long   Slove( long long   n)
{
	for(int i = 0; i < prime.size(); ++i)
	{
		if(prime[i]>n)break;
		while(n % prime[i] == 0)
			n /= prime[i];
	}
	return n;
}
int main()
{

	/*freopen("e:\\1.in", "r", stdin);
	freopen("e:\\1.out", "w", stdout);*/
	for(long long  i = 2; i <= 1590; ++i)
	{
		if(isPrime[i])
			continue;
		prime.push_back(i * i * i);
		for( long long   j = i + i; j <= 1590; j += i)
			isPrime[j] = true;
	}
	int n;
	int t=1;
	//scanf("%d",&t);
	while(t--)
	{
		cnt.clear();
		scanf("%d", &n);
		for(int  i = 1; i <= n; ++i)
			scanf("%lld", &arr[i]);
		for( int i = 1; i <= n; ++i)
			++cnt[ Slove(arr[i]) ];
		long long  ans;
		if(cnt.find(1) != cnt.end())
			ans = 1;
		else
			ans = 0;
		map<long long  ,long long >::iterator it2;
		for(auto it = cnt.begin(); it != cnt.end(); ++it)
		{
			if(it->first == 1)
				continue;
			long long  a = it->first;
			long long  b = Slove(a * a);
			it2=cnt.find(b);
			if(it2!=cnt.end())
			{
			ans += max(it->second, it2->second);
			it2->second=0;
			}
			else
			{
				ans+=it->second;
			}
			it->second=0;
		}
		printf("%lld\n", ans);
	}
	return 0;
}

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

int main() {

  int N;
  cin >> N;

  vector<int> d(N);
  for (int i = 0; i < N; i++) {
    cin >> d[i];
  }
  
  int answer = 0;

  for (int i = 0; i < N; i++) {
    for (int j = i + 1; j < N; j++) {
      answer += d[i] * d[j];
    }
  }

  cout << answer << endl;
  
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define For(i,m,n) for(int i=m;i<n;i++)
#define FOR(i,n) for(int i=0;i<n;i++)
#define ll long long
#define ull unsigned long long
#define lli long long int
#define pb push_back
#define all(x) x.begin(),x.end()
ll mob=1000000007;
using namespace std;
int main()
{ 

string h;
cin>>h;

h=="ARC"?cout<<"ABC":cout<<"ARC";
 
 



return 0;
}











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

#define ll long long

using namespace std;

int pmod(int x, int y, int p){ int res = 1; x = x % p; if (x == 0) return 0; while (y > 0) { if (y & 1)  res = (res*x) % p;  y = y>>1; x = (x*x) % p; } return res; }  
ll pmod(ll x, ll y, ll p){ ll res = 1; x = x % p; if (x == 0) return 0; while (y > 0) { if (y & 1)  res = (res*x) % p;  y = y>>1; x = (x*x) % p; } return res; } 

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

	int n,m;
	cin >> n >> m;
	vector <int> h(n);
	for(int i = 0; i < n; ++i)
		cin >> h[i];
	vector <int> cnt(n), gtr(n);
	for(int i = 0; i < m; ++i){
		int a,b;
		cin >> a >> b;
		a--;b--;
		if(h[a] > h[b])
			gtr[a]++;
		if(h[b] > h[a])
			gtr[b]++;
		cnt[a]++;
		cnt[b]++;
	}
	int res = 0;
	for(int i = 0; i < n; ++i){
		if(cnt[i] == gtr[i])
			res++;
	}
	cout << res << endl;
	return 0;
}

Measured memory_bytes: 4520
# coding: utf-8
A, B, C = map(int, input().split())
count = 0

while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
    if A == B == C:
        print(-1)
        exit()
    count += 1
    A1 = A
    B1 = B
    C1 = C
    A = B1//2 + C1//2
    B = A1//2 + C1//2
    C = A1//2 + B1//2

print(count)

Measured memory_bytes: 3064
/* ex5-3
    kas056 */

#include <stdio.h>

int main(void){
    int row, column;//変数設定
    int i,j;
    
    
    scanf("%d %d", &row, &column);

    char matrix[row][column];//行列を入れる配列作成
    int judge_r[row], judge_c[column];//その行・列が全て'.'か判定。

    //入力の読み込み。一文字ずつ読み込み、(i,j)番目に入れる
    for(i = 0; i < row; i++){
        for (j = 0; j < column; j ++){
            scanf(" %c", &matrix[i][j]);
        }
    }

    //判定機の初期値設定。＃がなければ１にしたいので、初期値を全て0にする。
    for(i=0; i<row; i++){//行
        judge_r[i] = 0;
    }
    for(j=0; j<column; j++){//列
        judge_c[j] = 0;
    }

    for(i = 0; i < row; i++){//まず行を固定して
        for (j = 0; j < column; j++){//その行の各要素に対して
            if(matrix[i][j] == '#'){//＃と一致するものがあったら終了する。
                break;
            }
        }

        if(j == column){//最後まで＃がなかったら
            judge_r[i] = 1;
        }
    }//これを行の数だけ繰り返す。

    for(j = 0; j < column; j++){//列を固定して、行の場合と同様の操作を行う
        for(i = 0; i < row; i++){
            if(matrix[i][j] == '#'){
                break;
            }
        }
        if(i == row){
            judge_c[j] = 1;
        }
    }

    for(i=0; i<row; i++){//ある行において＃があった時、かつ
        if(judge_r[i] == 0){
            for(j = 0; j<column; j++){//その列に＃があったとき、
                if(judge_c[j] == 0){
                    printf("%c", matrix[i][j]);//(i,j)番目の文字を一文字出力
                }
            }//折り返し。これをcolumnの数だけ繰り返す
            printf("\n");//終点で改行
        }
    }//これをrowの数だけ繰り返す

    return 0;
}

Measured memory_bytes: 128
//in dp prefix suffix sum helps..
#include<iostream>
#include<vector>
#include<string.h>
#include<algorithm>
#include<iomanip>
#include<cmath>
#include<stack>
#include <iterator>
#include <map>
#include<list>
#include <fstream>
#include<unordered_map>
#include<set>
#include<queue>
#define int  long long
#define double long double
#define pb   push_back
#define mp   make_pair
#define pii  pair<int,int>
#define pip pair<int, pair<int, int> >
#define viv vector<vector<int> >
#define vip vector< pair<int, int> >
#define vi vector<int>
#define mii  map<int, int>
#define li list<int>
#define qu queue<int>
#define vd vector<double>
#define set set<int>
#define stack stack<int>
#define fi first
#define se second
#define mem(x, y) memset(x, y, sizeof(x))
#define ps(x,y) fixed<<setprecision(y)<<x
using namespace std;
// author :: Anurag Anand.
using namespace std;
int z= 1000000007;
//int z= 998244353;
int gcd(int a, int b){
    if(a==0)return b;
    if(b==0)return a;
    return gcd(b, a%b);
}
int power(int a,int b)
{
	int res=1;
	while(b)
	{
		if(b&1)
		{
			res=(res*a)%z;
			b--;
		}
		else
		{
			a=(a*a)%z;
			b=b>>1;
		}
	}
	return res;
}
vi v[100001];
int vis[100001]={0}, ar[100001]={0};
void bfs(int root){
	int a;
	qu q;
	q.push(root);
	ar[root]=1;
	while(!q.empty()){
		a= q.front();q.pop();vis[a]=1;
		for(int i=0;i<v[a].size();i++){
			if(!vis[v[a][i]]&&!ar[v[a][i]]){
				ar[v[a][i]]=1;
				q.push(v[a][i]);
			}
		}
	}
}
int32_t main()
{
    ios_base::sync_with_stdio(false);
	cin.tie(NULL);
    cout.tie(NULL);
	int t;
	t=1;
	//cin>>t;
	while(t--){
		int n, m;
		cin>>n>>m;
		for(int i=0;i<m;i++){
			int a, b;
			cin>>a>>b;
			v[a].pb(b);
			v[b].pb(a);
		}
		int ans=0;
		for(int i=1;i<=n;i++){
			if(!vis[i]){
				bfs(i);
				ans++;
			}
		}
		ans--;
		cout<<ans<<"\n";
	}
}

Measured memory_bytes: 11068
import java.util.Scanner;

public class Main {

    public static void main(String args[]) {

        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        Integer[] h = new Integer[n];
        for (int i = 0; i < n; i++) {
            h[i] = Integer.parseInt(sc.next());
        }

        int result = 1;
        int max = h[0];
        for (int i = 1; i < n; i++) {
            if (max <= h[i]) {
                result++;
            }
            max = Math.max(max, h[i]);
        }

        System.out.println(result);
    }
}

Measured memory_bytes: 23508
//do u need something?
#include <bits/stdc++.h>
/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/t_policy.hpp>
using namespace __gnu_pbds;
//*/
/*
#pragma GCC optimize ("O3")
#pragma GCC target ("avx2")
#pragma GCC optimize ("unroll-loops")
//*/

std::mt19937 rng(std::chrono::system_clock::now().time_since_epoch().count());
using namespace std;
#define IO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define y1 asjfkgasj
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define F first
#define S second
#define endl '\n'
#define flsh '\n'<<flush
#define pii pair<int,int>
#define pll pair<long long,long long>
#define deb(x) cout<< #x <<'='<< x <<flsh;
#define ull unsigned long long
#define intt long long
#define ll long long
#define ld long double
#define dd double
#define OK cout<<"OK\n"<<flsh;
#define setpre(x) fixed<<setprecision(x)
#define mmset(x,y) memset(x,y,sizeof(x))
const ll mod=998244353;

ll n,ans,a[26];
string s;
int main()
{
	IO;
	cin>>s;
	n=s.size();
	for(int i=0;i<n;i++)
		a[s[i]-'a']++;
	ans=(n*(n-1))/2;
	for(int i=0;i<26;i++)
		ans-=(a[i]*(a[i]-1))/2;
	cout<<ans+1<<endl;
	return 0;
}

Measured memory_bytes: 720
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
long long mo = 1e9 + 7;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
template<class A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}cout << "\n";}
ld PI=3.14159265358979323846;

int main(){
    ll N,D,A;
    cin >> N >> D >> A;
    vector<Pll> P(N);
    rep(i,N){
        cin >> P[i].first >> P[i].second;
    }
    sort(P.begin(), P.end());
    queue<Pll> que;
    ll Ac = 0;
    ll ans = 0;
    rep(i,N){
        ll X = P[i].first;
        ll H = P[i].second;
        while(!que.empty() && X >= que.front().first){
            Ac -= A*que.front().second;
            que.pop();
        }
        if(H > Ac){
            ll n = ((H-Ac)+A-1)/A;
            que.push(Pll(X+2*D+1, n));
            Ac += A*n;
            ans += n;
        }else{
            continue;
        }
    }
    cout << ans << endl;
}

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

#define int long long
#define ffor(i,n) for(int i = 0;i < (n); ++i)
#define fro(i,j,n) for(int i = (j);i < (n); ++i)
#define all(v) v.begin(),v.end()
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int,int>
#define vpii vector<pii>
#define ff first
#define ss second


signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    int n;
    cin >> n;
    int ans = 0;
    ans = (n*(n + 1))/2;
    for(int i = 3;i <= n; i += 3){
    	ans -= i;
    }
    for(int i = 5;i <= n; i += 5){
    	ans -= i;
    }
    for(int i = 15;i <= n; i += 15){
    	ans += i;
    }
    cout << ans;
}		

Measured memory_bytes: 3652
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << x << endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
typedef vector<int> vi;
typedef pair<int,int> P;
typedef pair<vi,int> Vii;
typedef long long ull;
ull B=1e7+7;
int dx[9]={-1,-1,-1,0,0,0,1,1,1},dy[9]={-1,0,1,-1,0,1,-1,0,1};
int H,W,I;
string s[15];
int id[15][15];
vector<int> ns;
vi nei[15][15];
vi htons[15];
map<int,int> mp;
int myhash(int h,int w){
	ull s=h*W+w;
	rep(i,I) s=s*B+ns[i];
	return (int)s;
}
void init(int H,int W){
	I=0;
	rep(i,H) rep(j,W) id[i][j]=-1;
	ns.clear();
	rep(i,H) rep(j,W) nei[i][j].clear();
	rep(i,H) htons[i].clear();
	mp.clear();
}
bool is(int x,int y){
	return 0<=x and x<H and 0<=y and y<W;
}
bool put(int h,int w){
	for(int v:nei[h][w]){
		if(ns[v]==0) return false;
	}
	for(int v:nei[h][w]) ns[v]--;
	return true;
}
void rmv(int h,int w){
	for(int v:nei[h][w]) ns[v]++;
}
bool linecheck(int h){
	if(h<0) return 1;
	for(int n:htons[h]) if(ns[n]!=0) return 0;
	return 1;
}
bool ok(){
	for(int n:ns) if(n!=0) return false;
	return true;
}
int dfs(int h,int w){
	if(w==W){
		if(!linecheck(h-1)) return 114514;
		return dfs(h+1,0);
	}
	if(h==H){
		if(ok()) return 0;
		else return 114514;
	}
	if(s[h][w]=='.'||nei[h][w].empty()) return dfs(h,w+1);
	if( mp.count(myhash(h,w))) return mp[myhash(h,w)];
	int ret=dfs(h,w+1);
	if(put(h,w)){
		chmin(ret,dfs(h,w+1)+1);
		rmv(h,w);
	}
	mp[myhash(h,w)]=ret;
	return ret;
}
int main(){
	while(true){
		cin>>H>>W;
		if(H==0) break;
		rep(i,H) cin>>s[i];
		if(H<W){
			string st[15];
			rep(i,H) st[i]=s[i];
			rep(i,W) s[i].resize(H);
			rep(i,W) rep(j,H) s[i][j]=st[j][i];
			swap(H,W);
		}
		init(H,W);
		rep(i,H) rep(j,W) if(isdigit(s[i][j])){
			id[i][j]=I++;
			ns.pb(s[i][j]-'0');
			htons[i].pb(id[i][j]);
		}
		rep(i,H) rep(j,W){
			rep(d,9){
				int ni=i+dx[d],nj=j+dy[d];
				if(is(ni,nj)&&isdigit(s[ni][nj])) nei[i][j].pb(id[ni][nj]);
			}
		}
		cout<<dfs(0,0)<<endl;
	}
}

Measured memory_bytes: 10852
#include <bits/stdc++.h>
using namespace std;
#define GET_MACRO(_1, _2, _3, NAME, ...) NAME
#define _repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define _rep(i,n) _repl(i,0,n)
#define rep(...) GET_MACRO(__VA_ARGS__, _repl, _rep)(__VA_ARGS__)
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back((a))
#define all(x) (x).begin(),(x).end()
#define uniq(x) sort(all(x)),(x).erase(unique(all(x)),end(x))
#define fi first
#define se second
#define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
void _dbg(string){cout<<endl;}
template<class H,class... T> void _dbg(string s,H h,T... t){int l=s.find(',');cout<<s.substr(0,l)<<" = "<<h<<", ";_dbg(s.substr(l+1),t...);}
template<class T,class U> ostream& operator<<(ostream &o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream &o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

#define INF 1120000000

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

  if(a==b) cout <<c<<endl;
  else if(a==c) cout<<b<<endl;
  else if(b==c) cout<<a<<endl;
  else assert(false);

  return 0;
}


Measured memory_bytes: 256
N, A, B, C, D = map(int, input().split())
S = input()
p = 0
t = 0
sti = 0
for i in range(A-1, max(C, D) - 1):
  if S[i:i+2] == '##':
    p = 1
for j in range(B-1, min(C, D) - 1):  
  if S[j:j+3] == '...':
    if sti == 0:
      sti = j + 1
    t = 1
if S[B] == '.' and S[B-2] == '.':
  t = 1
if (C < D and p == 0) or (C > D and p == 0 and t == 1 and sti <= D-1):
  print('Yes')
else:
  print('No')


Measured memory_bytes: 3572
#include<bits/stdc++.h>
#define int long long
#define for1(i, n) for(int i = 1; i <= (n);i++)
using namespace std;
int l, k, sum, dp[100];
signed main() {
	cin >> l >> k;
	dp[1] = 1; dp[k++] = 1;
	for1(i, l) {
		if (i > 2)dp[i] += dp[i - 2];
		if (i > k)dp[i] += dp[i - k];
		sum += dp[i];
	}
	cout << sum << endl;
}


Measured memory_bytes: 3132
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<deque>
#include<stack>
#include<set>
#include<map>
#include<bitset>
#include<string>
#include<functional>
#define rep(i,n,m) for(int i=(n);i<(int)(m);i++)
#define reps(i,n,m) for(int i=(n);i<=(int)(m);i++)
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#define SZ(x) ((int)(x).size())
#define pb push_back
#define fs first
#define sc second
#define lb lower_bound
#define ub upper_bound
#define LB(a,x) lb(all(a), x) - a.begin()
#define UB(a,x) ub(all(a), x) - a.begin()
#define printfdouble(x) printf("%.20f\n",(x))
#define chartoint(c) (int)((c) - '0')
#define chartoll(c) (long long)((c) - '0')
#define MOD 1000000007
#define itn int
#define enld endl
#define ednl endl
#define icn cin
#define cotu cout
#define Endl endl
#define stirng string
using namespace std;
typedef long long ll;
const double pi = 3.141592653589793;
using Graph = vector<vector<int>>;
template<class T> bool chmax(T &a, const T &b){if(a<b){a=b; return 1;} return 0;}
template<class T> bool chmin(T &a, const T &b){if(b<a){a=b; return 1;} return 0;}
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    int n; cin >> n;
    int D[105][2];
    rep(i,0,n){
        cin >> D[i][0] >> D[i][1];
    }

    int ans = 0;
    int tmp = 0;
    rep(i,0,n){
        if(D[i][0] == D[i][1]) tmp++;
        else{
            chmax(ans, tmp);
            tmp = 0;
        }
    }
    chmax(ans, tmp);

    if(ans >= 3){
      cout << "Yes" << endl;
    }else{
      cout << "No" << ednl;
    }
    return 0;
}

Measured memory_bytes: 3648
// https://atcoder.jp/contests/abc150/tasks/abc150_a

#include "algorithm"
#include "bitset"
#include "cmath"
#include "functional"
#include "iomanip"
#include "iostream"
#include "map"
#include "numeric"
#include "queue"
#include "set"
#include "string"
#include "vector"
#define rep(i, to) for (ll i = 0; i < (to); ++i)
#define rep1(i, to) for (ll i = 1; i <= (to); ++i)
#define repf(i, from, to) for (ll i = from; i < (to); ++i)
#define repr(i, from) for (ll i = from - 1; i >= 0; --i)
#define all(vec) vec.begin(), vec.end()
#define unless(cond) if (!(cond))
#define fi first
#define se second
using namespace std;
typedef long long ll;
template <typename T>
using V = vector<T>;
using VL = V<ll>;
using VVL = V<VL>;
template <typename T, typename U>
using P = pair<T, U>;
using PL = P<ll, ll>;
using VPL = V<PL>;
template <typename T>
inline bool chmax(T& a, T b);
template <typename T>
inline bool chmin(T& a, T b);
void print_ints(vector<ll> v);
template <typename T>
void drop(T a);

const ll INF = 1e18;

void solve() {
  ll K, X;
  cin >> K >> X;
  if (500 * K >= X) drop("Yes");
  drop("No");
}

struct exit_exception : public std::exception {
  const char* what() const throw() { return "Exited"; }
};

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

  try {
    solve();
  } catch (exit_exception& e) {
  }

  return 0;
}
#endif

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

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

void print_ints(vector<ll> v) {
  rep(i, v.size()) {
    if (i > 0) {
      cout << " ";
    }

    cout << v[i];
  }

  cout << endl;
}

template <typename T>
void drop(T res) {
  cout << res << endl;
  throw exit_exception();
}


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

using namespace std;

#define sz(v)           ((int)((v).size()))
#define clr(v, d)       memset(v, d, sizeof(v))
#define rep(i, v)       for(int i=0; i<sz(v); ++i)
#define lp(i, n)        for(int i=0; i<(int)(n); ++i)
#define lpi(i, j, n)    for(int i=(j); i<(int)(n); ++i)
#define lpd(i, j, n)    for(int i=(j); i>=(int)(n); --i)
#define INF             1000000000

typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;

void init(){
	std::ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
}

const int N = 55;

int n, m;
string A[N], B[N];

bool comp(int x, int y){
	lp(i, m)
		lp(j, m)
			if(A[i+x][j+y] != B[i][j])
				return 0;
	return 1;
}

int main()
{
	init();
	cin >> n >> m;
	lp(i, n)
		cin >> A[i];
	lp(i, m)
		cin >> B[i];
	lp(i, n-m+1){
		lp(j, n-m+1){
			if(comp(i, j)){
				cout << "Yes";
				return 0;
			}
		}
	}
	cout << "No";
	return 0;
}



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

#define dump(x) cout << (x) << endl
#define Int int64_t
#define fi first
#define se second

int main() {
    Int n, m;
    cin >> n >> m;
    vector<Int> a(n + 1, 0);
    for (Int i = 0; i < m; i++) {
        Int s, t;
        cin >> s >> t;
        a[s]++;
        a[t]++;
    }
    bool check = true;
    for (Int i = 1; i <= n; i++) {
        if (a[i] % 2 == 1) {
            check = false;
        }
    }
    dump(check ? "YES" : "NO");
    return 0;
}

Measured memory_bytes: 1024
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp43 {
    class Program {
        static void Main(string[] args) {
            var st = Console.ReadLine().Split(' ').ToArray();

            Console.WriteLine(st[0].ToUpper()[0].ToString() + st[1].ToUpper()[0].ToString() + st[2].ToUpper()[0].ToString());


            
        }

    }
}


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

int cnt_500(double f){
    
    if(f < 35.5) return 1;
    else if(f < 37.5) return 2;
    else if(f < 40) return 3;
    else if(f < 43) return 4;
    else if(f < 50) return 5;
    else if(f < 55) return 6;
    else if(f < 70) return 7;
    
    return 8;
}

int cnt_1000(double t){
    if(t < 71) return 1;
    else if(t < 77) return 2;
    else if(t < 83) return 3;
    else if(t < 89) return 4;
    else if(t < 105) return 5;
    else if(t < 116) return 6;
    else if(t < 148) return 7;
    
    return 8;
}

int main(){
    double f,t;
    
    while(cin >> f >> t){
        int grade = max(cnt_500(f),cnt_1000(t));
        
        switch(grade){
            case 1:
                cout << "AAA" << endl;
                break;
            case 2:
                cout << "AA" << endl;
                break;
            case 3:
                cout << 'A' << endl;
                break;
            case 4:
                cout << 'B' << endl;
                break;
            case 5:
                cout << 'C' << endl;
                break;
            case 6:
                cout << 'D' << endl;
                break;
            case 7:
                cout << 'E' << endl;
                break;
            case 8:
                cout << "NA" << endl;
                break;
        }
        
    }
    
    return 0;
}

Measured memory_bytes: 1216
import sys
input = sys.stdin.buffer.readline  # これを使わないとTLEしてしまう
sys.setrecursionlimit(10**7)

N, Q = map(int, input().split())
AB = [[int(x) for x in input().split()] for _ in range(N-1)]
PX = [[int(x) for x in input().split()] for _ in range(Q)]

# 木構造をリストで表現する
graph = [[] for _ in range(N+1)]

for a, b in AB:
    graph[a].append(b)
    graph[b].append(a)

# 各操作で与えられる値を、各頂点ごとに集計しておく
P = [0] * (N+1)
for p, x in PX:
    P[p] += x

Count = [0] * (N+1)


def dfs(v, parent, point):
    # 現在いる頂点vの親までの値をpointとする
    Count[v] = point + P[v]
    for x in graph[v]:
        if x == parent:
            continue
        dfs(x, v, Count[v])


dfs(1, 0, 0)

res = ' '.join(map(str, Count[1:]))
print(res)

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

using namespace std;

const int MAXN = 2005;

int n, k, cnt, sol;
int a[MAXN], b[MAXN];
vector <int> v[MAXN];

void dfs (int x, int rod, int dub) {
    cnt++;
    if (dub == 0) return;
    for (auto sus : v[x]) {
        if (sus == rod) continue;
        dfs(sus, x, dub - 1);
    }
}

int main () {
    cin >> n >> k;
    for (int i=0; i<n-1; i++) {
        cin >> a[i] >> b[i];
        v[a[i]].push_back(b[i]);
        v[b[i]].push_back(a[i]);
    }
    for (int i=1; i<=n; i++) {
        cnt = 0;
        dfs(i, 0, k/2);
        sol = max(sol, cnt);
    }
    for (int i=0; i<n-1; i++) {
        cnt = 0;
        dfs(a[i], b[i], (k-1)/2);
        dfs(b[i], a[i], (k-1)/2);
        sol = max(sol, cnt);
    }
    cout << n - sol;
    return 0;
}


Measured memory_bytes: 384
#include <stdio.h>

int main ()
{
    long int max = -2000000000,min,num = 0;
    
    scanf("%ld",&num);
    
    long int val[num];
    
    for(int i = 0;i<num;i++)
    {
        scanf("%ld",&val[i]);
        
    }
    
    min = val[0];
    
    for(int i = 1; i<num ;i++)
    {
        
        if(max < val[i] - min)
        {
            max  = val[i] - min;
        }
        
        if(min>val[i])
            min = val[i];

    }
    printf("%ld\n",max);
    return 0;

}



Measured memory_bytes: 3328
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
    int n;
    cin >> n;
    string s;
    cin >> s;
    auto v = vector<int>(26);
    for (char c : s)
        v[c - 'a']++;
    for (int i=0; i<n-1; i++) {
        cin >> s;
        auto w = vector<int>(26);
        for (char c : s)
            w[c - 'a']++;
        for (int i=0; i<26; i++) {
            if (w[i] == 0)
                v[i] = 0;
            else    
                v[i] = min(v[i], w[i]);
            //cout << i << " " << v[i] << endl;
        }
    }
    string ans = "";
    for (int i=0; i<26; i++) {
        for (int j=0; j<v[i]; j++) {
            ans += (char)(97 + i);
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#ARC 088
X,Y= map(int,input().split())
tmp=X
cnt=1
for i in range(1,int(Y//X)+2):
    if tmp ==Y:
        print(cnt)
        exit()
    elif tmp >Y:
        print(cnt-1)
        exit()
    else:
        tmp=2*tmp
        cnt+=1

Measured memory_bytes: 3060
#include <iostream>

using namespace std;

int main(int argc, char **)
{
	int n, m, t = -1, tmp;
	float p, s;
	
	while(1){
		cin >> n >> m >> p;
		if(n == 0){
			break;
		} else if(t != -1){
			cout << endl;
		}
		
		p = 1.0 - p/100;
		s = 0;
		for(int i = 1; i <= n; i++){
			cin >> tmp;
			s += tmp*100;
			if(i == m){
				t = tmp;
			}
		}
		
		if(t == 0){
			cout << "0";
			continue;
		}
		
		cout << (int)(p*s/t);
	}
cout << endl;	

	return 0;
}

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

typedef long long   signed int LL;
typedef long long unsigned int LU;

#define incID(i, l, r) for(int i = (l)    ; i <  (r); i++)
#define incII(i, l, r) for(int i = (l)    ; i <= (r); i++)
#define decID(i, l, r) for(int i = (r) - 1; i >= (l); i--)
#define decII(i, l, r) for(int i = (r)    ; i >= (l); i--)
#define  inc(i, n) incID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define  dec(i, n) decID(i, 0, n)
#define dec1(i, n) decII(i, 1, n)

#define inII(v, l, r) ((l) <= (v) && (v) <= (r))
#define inID(v, l, r) ((l) <= (v) && (v) <  (r))

#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define PQ priority_queue

#define  ALL(v)  v.begin(),  v.end()
#define RALL(v) v.rbegin(), v.rend()
#define  FOR(it, v) for(auto it =  v.begin(); it !=  v.end(); ++it)
#define RFOR(it, v) for(auto it = v.rbegin(); it != v.rend(); ++it)

template<typename T> bool   setmin(T & a, T b) { if(b <  a) { a = b; return true; } else { return false; } }
template<typename T> bool   setmax(T & a, T b) { if(b >  a) { a = b; return true; } else { return false; } }
template<typename T> bool setmineq(T & a, T b) { if(b <= a) { a = b; return true; } else { return false; } }
template<typename T> bool setmaxeq(T & a, T b) { if(b >= a) { a = b; return true; } else { return false; } }
template<typename T> T gcd(T a, T b) { return (b == 0 ? a : gcd(b, a % b)); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }

// ---- ----

LL n, a[100000], ans[100001][3], INF = 1e15;
char op[100000];

int sg(int k) { return (k % 2 == 0 ? +1 : -1); }

int main() {
	cin >> n;
	inc(i, n) {
		if(i == 0) { op[0] = '+'; } else { cin >> op[i]; }
		cin >> a[i];
	}
	
	incII(i, 0, n) {
	inc(k, 3) {
		ans[i][k] = -INF;
	}
	}
	ans[0][0] = 0;
	inc(i, n) {
		if(op[i] == '+') {
			inc(k, 3) { ans[i + 1][k    ] = ans[i][k] + sg(k    ) * a[i]; }
		} else {
			inc(k, 2) { ans[i + 1][k + 1] = ans[i][k] + sg(k + 1) * a[i]; }
		}
		
		dec(k, 2) { setmax(ans[i + 1][k], ans[i + 1][k + 1]); }
	}
	
	cout << ans[n][0] << endl;
	
	return 0;
}


Measured memory_bytes: 3456
#include <iostream>
using namespace std;
static const int N = 100;

int main(){
  int M[N][N];
  int n, u, k, v;

  cin >> n;

  for(int i=0; i<n; i++){
    for(int j=0; j<n; j++) M[i][j] = 0;
  }

  for(int i=0; i<n; i++){
    cin >> u >> k;
    u--;
    for(int j=0; j<k; j++){
      cin >> v;
      v--;
      M[u][v] = 1;
    }
  }

  for(int i=0; i<n; i++){
    for(int j=0; j<n; j++){
      if(j) cout << " ";
      cout << M[i][j];
    }
    cout << endl;
  }

  return 0;
}



Measured memory_bytes: 3144
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.*;

public class Main {

	public static void main(String[] args) throws IOException {
		MyScanner sc = new MyScanner(System.in);
		int n = sc.nextInt();
		Pair[] x = new Pair[n];
		Pair[] y = new Pair[n];
		for(int i=0; i<n; i++) {
			int _x = sc.nextInt(); int _y = sc.nextInt();
			x[i] = new Pair(_x, i); y[i] = new Pair(_y, i);
		}
		Arrays.sort(x, new Comparator<Pair>() {
			public int compare(Pair p1, Pair p2) {
				return p1.fst - p2.fst;
			}
		});
		Arrays.sort(y, new Comparator<Pair>() {
			public int compare(Pair p1, Pair p2) {
				return p1.fst - p2.fst;
			}
		});
		Edge[] es = new Edge[2*n-2];
		for(int i=1; i<n; i++) {
			es[i-1] = new Edge(x[i-1].snd, x[i].snd, Math.abs(x[i].fst-x[i-1].fst));
			es[i-1+n-1] = new Edge(y[i-1].snd, y[i].snd, Math.abs(y[i-1].fst-y[i].fst));
		}
		Arrays.sort(es, new Comparator<Edge>() {
			public int compare(Edge e0, Edge e1) {
				long w0 = e0.w; long w1 = e1.w;
				if(w0>w1) {
					return 1;
				} else if(w0==w1) {
					return 0;
				} else {
					return -1;
				}
			}
		});
		int[] par = new int[n];
		init(par, n);
		int cnt = 0;
		int ans = 0;
		for(int i=0; i<2*n-2&&cnt<n; i++) {
			Edge e = es[i];
			int from = e.from; int to = e.to; 
			if(same(from, to, par)) {
				;
			} else {
				ans += e.w;
				cnt++;
				unite(from, to, par);
			}
		}
		System.out.println(ans);
	}
	
	static void init(int[] par, int n) {
		for(int i=0; i<n; i++) par[i] = i;
	}
	
	static int root(int x, int[] par) {
		if(par[x] == x) return x;
		return par[x] = root(par[x], par);
	}
	
	static boolean same(int x, int y, int[] par) {
		return root(x, par) == root(y, par);
	}
	
	static void unite(int x, int y, int[] par) {
		x = root(x, par);
		y = root(y, par);
		if(x == y) return;
		par[x] = y;
	}
	
	static class Pair {
		int fst; int snd;
		Pair(int _f, int _s) {
			fst = _f; snd = _s;
		}
	}
	
	static class Edge {
		int from; int to; long w;
		Edge(int _f, int _t, long _w) {
			from = _f; to = _t; w = _w;
		}
	}

	static class MyScanner
	{
		BufferedReader br;
		StringTokenizer st;
		public MyScanner(InputStream s)
		{
			br=new BufferedReader(new InputStreamReader(s));
		}
		public String nextLine() throws IOException
		{
			return br.readLine();
		}
		public String next() throws IOException
		{
			while(st==null || !st.hasMoreTokens())
				st=new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int nextInt() throws IOException
		{
			return Integer.parseInt(next());
			
		}
		public double nextDouble() throws IOException
		{
			return Double.parseDouble(next());
		}
		public boolean ready() throws IOException
		{
			return br.ready();
		}
		public long nextLong() throws IOException
		{
			return Long.parseLong(next());
		}
	}
}

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

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

    int X[2021];
    int Position[2040];
    
    for(int i = 1; i <= N; i++){
        cin >> Position[i];
        X[Position[i]] = i;
    }

    int M;
    cin >> M;

    for(int j = 1; j <= M; j++){
        int num_koma;
        cin >> num_koma;

        if ( ( Position[num_koma] != 2019 ) && ( X[Position[num_koma] + 1] == 0 )){
            X[Position[num_koma]] = 0;
            Position[num_koma]++;
            X[Position[num_koma]] = num_koma;
        }
    }

    for (int l = 1; l <= N; l++){
        cout << Position[l] << endl;
    }
    return 0;
}


Measured memory_bytes: 3112
#include<iostream>
using namespace std;
int main()
{
    int a, b;
    cin >> a >> b;
    if(a%3 == 0)
    {
        cout << "Possible" << endl;
        return 0;
    }
    if(b%3 == 0)
    {
        cout << "Possible" << endl;
        return 0;
    }
    int sum = a+b;
    if(sum%3 == 0)
    {
        cout << "Possible" << endl;
    }
    if(sum%3 != 0)
    {
        cout << "Impossible" << endl;
    }
}

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

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

using namespace std;
using lint=long long;

template<class T> T gcd(const T& a,const T& b){ return b==0?a:gcd(b,a%b); }

void solve(){
	lint a,b,c,d;
	scanf("%lld%lld%lld%lld",&a,&b,&c,&d);

	if(a<b || d<b){
		puts("No");
		return;
	}

	if(c>=b){
		puts("Yes");
		return;
	}

	lint m=(a-c+b-1)/b; // m = min{ m | a - m*b <= c }
	if(a-m*b<0){
		puts("No");
		return;
	}

	lint g=gcd(d-b,b);
	lint x=(b-(a-m*b)-1)/g; // x = max{ x | a - m*b+ x*g < b }
	puts(a-m*b+x*g>c?"No":"Yes");
}

int main(){
	int q; scanf("%d",&q); rep(_,q) solve();
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin>>n;
    int n2=1,n3=1;
    for(int i=0;i<n;i++)n2*=2,n3*=3;
    int x[n],y[n],p[n];
    for(int i=0;i<n;i++)cin>>x[i]>>y[i]>>p[i];
    long long X[n2][n],Y[n2][n];
    for(int i=0;i<n2;i++){
        vector<long long>vx={-100000,0,100000};
        vector<long long>vy={-100000,0,100000};
        int I=i;
        for(int j=0;j<n;j++){
            if(I%2){
                vx.push_back(x[j]);
                vy.push_back(y[j]);
            }
            I/=2;
        }
        sort(vx.begin(),vx.end());
        sort(vy.begin(),vy.end());
        for(int j=0;j<n;j++){
            X[i][j]=min(*upper_bound(vx.begin(),vx.end(),x[j])-x[j],
                       x[j]-*(upper_bound(vx.begin(),vx.end(),x[j])-1))*p[j];
            Y[i][j]=min(*upper_bound(vy.begin(),vy.end(),y[j])-y[j],
                       y[j]-*(upper_bound(vy.begin(),vy.end(),y[j])-1))*p[j];
        }
    }
    vector<long long>ans(n+1,1000000000000000);
    for(int i=0;i<n3;i++){
        int I=i,P=1,build=0,px=0,py=0;
        for(int j=0;j<n;j++){
            if(I%3){
                build++;
                if(I%3==1)px+=P;
                else py+=P;
            }
            P*=2;
            I/=3;
        }
        long long cost=0;
        for(int j=0;j<n;j++)cost+=min(X[px][j],Y[py][j]);
        ans[build]=min(ans[build],cost);
    }
    for(int i=0;i<=n;i++)cout<<ans[i]<<endl;
    return 0;
}

Measured memory_bytes: 11320
#pragma region Macros
#include <bits/stdc++.h>
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define sz(v) (int)(v).size()

using namespace std;
typedef long long ll;
#pragma endregion
int main()
{
	cin.tie(0);
	ios_base::sync_with_stdio(false);

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

	ans = (a + b) * h / 2;
	cout << ans << '\n';
	return 0;
}


Measured memory_bytes: 256
/*
　　　  ∧＿∧　やあ
　　 （´・ω・｀)　　　　　/　　　　　ようこそ、バーボンハウスへ。
　　 ／∇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 num = 1;
    vector<lint> ret;
    for (int i=0; i<=n; ++i){
        ret.push_back(num);
        num *= 2;
    }
    return ret;
}

int main()
{
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    int n, k;
    cin >> n >> k;
    cout << n - k + 1 << endl;
    return 0;
}

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

ll n;
ll a[100010];
ll dp[100010];

int main(){
    cin.tie(0); ios::sync_with_stdio(0);
    cin >> n;
    REP(i,n) cin >> a[i];
    REP(i,n) dp[i] = INF;
    REP(i,n) *lower_bound(dp,dp+n,a[i]) = a[i];
    cout << lower_bound(dp,dp+n,INF) - dp << "\n";
    return 0;
}


Measured memory_bytes: 4784
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <cmath>
#include <algorithm>
#include <utility>
#include <functional>
#include <fstream>
#define debug(x) cout << #x << " = " << x << endl
#define FOR(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,n) for(int i = 0; i < (n); i++)
#define repr(i,n) for(int i = (n); i > -1; i--)
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const int MOD = 1000000007;
const double EPS = 1e-9;


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

  ll n;
  cin>>n;
  ll mn = n;
  
  for(ll i = 1; i * i <= n; i++)
  {
    if(n % i == 0) {
      mn = n / i;
    }
  }
  int ans = 0;
  while(mn > 0) {
    ans++;
    mn /= 10;
  }
  cout << ans << endl;
  


  return 0;
}


Measured memory_bytes: 256
// #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

#define debug(...) fprintf(stderr, __VA_ARGS__)
#define int long long int
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
typedef pair<int, int> pii;
typedef long long ll;
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const ll INF = 1001001001001001LL;
const ll MOD = 1000000007LL;

// Union-Find 木 (Verified: AtCoder Typical Contest 001 B)
struct UnionFind {
private:
    const int n;
    int __size;
    vector<int> uf;
public:
    // 初期化 UnionFind uni(n) のように宣言すれば良い
    UnionFind(int _n) : n(_n), __size(_n), uf(_n, -1) {}
    // find (木の根を求める)
    int find(int x) {return (uf[x] < 0) ? x : uf[x] = find(uf[x]);}
    // x と y が同じ集合に属するかどうか
    bool same(int x, int y) {return find(x) == find(y);}
    // x が属する集合の要素数
    int size(int x) {return -uf[find(x)];}
    // 集合はいくつあるか
    int size()      {return __size;}
    // x と y の属する集合を併合
    bool unite(int x, int y) {
        x = find(x); y = find(y);
        if(x == y) return false;
        __size--;
        if(uf[y] < uf[x]) swap(x, y);
        uf[x] += uf[y]; uf[y] = x;
        return true;
    }
};

using Graph = vector< vector<int> >;
signed main() {
    int N, M; cin >> N >> M;
    vector<int> u(M), v(M);
    for(int i=0; i<M; i++) {
        cin >> u[i] >> v[i];
        u[i]--; v[i]--;
    }
    reverse(u.begin(), u.end());
    reverse(v.begin(), v.end());

    UnionFind uf(N);
    vector<int> ans(M);
    int sum = N*(N-1) / 2;
    for(int i=0; i<M; i++) {
        if(uf.same(u[i], v[i])) {
            ans[M-1-i] = sum;
        }
        else {
            ans[M-1-i] = sum;
            int szu = uf.size(u[i]);
            int szv = uf.size(v[i]);
            sum -= szu * szv;
            uf.unite(u[i], v[i]);
        }
    }

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


Measured memory_bytes: 4480
#include <cstdio>
#include <set>
#include <string>
#include <algorithm>

int testcase_ends() {
  char buf[64];
  scanf("%s", buf);
  std::string s = buf;
  if (s == "#") return 1;

  std::string r0 = "yuiophjklnm";
  std::set<char> r(r0.begin(), r0.end());
  int res = -1;
  int last = -1;
  for (char c: s) {
    int cur = r.count(c);
    if (last != cur) ++res;
    last = cur;
  }
  printf("%d\n", res);
  return 0;
}

int main() {
  while (!testcase_ends()) {}
}



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

typedef pair<long long, int> P;

void Main() {
  int N;
  long long C;
  cin >> N >> C;

  long long x[N], v[N];
  for (int i = 0; i < N; i++) {
    cin >> x[i] >> v[i];
  }

  long long asum[N + 1], a1[N + 1], a2[N + 1];
  memset(asum, 0, sizeof(asum));
  memset(a1, 0, sizeof(a1));
  memset(a2, 0, sizeof(a2));
  for (int i = 0; i < N; i++) {
    asum[i + 1] = asum[i] + v[i];
    a1[i + 1] = max(a1[i], asum[i + 1] - x[i]);
    a2[i + 1] = max(a2[i], asum[i + 1] - x[i] * 2);
  }

  long long bsum[N + 1], b1[N + 1], b2[N + 1];
  memset(bsum, 0, sizeof(bsum));
  memset(b1, 0, sizeof(b1));
  memset(b2, 0, sizeof(b2));
  for (int i = N - 1; i >= 0; i--) {
    bsum[i] = bsum[i + 1] + v[i];
    b1[i] = max(b1[i + 1], bsum[i] - (C - x[i]));
    b2[i] = max(b2[i + 1], bsum[i] - (C - x[i]) * 2);
  }

  long long ans = 0;
  for (int i = 0; i < N + 1; i++) {
    ans = max(ans, a1[i] + b2[i]);
    ans = max(ans, a2[i] + b1[i]);
  }
  cout << ans << endl;
}

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



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

using namespace std;

#define debug(n) cerr << #n << ':' << n << endl;
#define dline    cerr << __LINE__ << endl;

using ll = long long;
using ull = unsigned long long;
template<class T, class U> using P = pair<T,U>;
template<class T> using Heap = priority_queue<T>;
template<class T> using heaP = priority_queue<T,vector<T>,greater<T>>;
template<class T,class U> using umap = unordered_map<T,U>;
template<class T> using uset = unordered_set<T>;

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

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

template<class T, size_t N, class U>
void Fill(T (&a)[N], const U&v){
    fill((U*)a,(U*)(a+N),v);
}

template<class T>
istream& operator >> (istream&is, vector<T>&v){
  for(auto&e:v){
    is >> e;
    e--;
  }
  return is;
}

int main(){
  int a,b,n; cin >> a >> b >> n;
  auto f = [](int&s,int&t){int x = s / 2;s = x;t += x;};
  for(int i = 0; i < n; ++i){
    if(i%2 == 0) f(a,b);
    else f(b,a);
  }
  cout << a << ' ' << b << endl;
}



Measured memory_bytes: 3540
N = int(input())

if N == 1:
    print(1)
elif N == 2:
    print(3)
else:
    sub = [2, 1]
    for i in range(N - 3):
        if i % 2:
            sub[0] = sum(sub)
        else:
            sub[1] = sum(sub)
    if N % 2:
        print(sub[0] + 2 * sub[1])
    else:
        print(sub[1] + 2 * sub[0])


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

int main(){
  char s[100];
  char str[4];
  int i,count,min=100000000;
  int a[20]={0};
  
  scanf("%s",s);
  for(i=0;i<strlen(s)-2;i++){
    strncpy(str,&s[i],3);
    a[i] = atoi(&str);
    s[i] ='0';
    //printf("%d\n",a[i]);
  }
  count = i;
  for(i=0;i<count;i++){
    if(abs(754-a[i]) < min){
      min = abs(753-a[i]);
    }
  }
  printf("%d\n",min);
  return 0;
}

Measured memory_bytes: 128
s = input()
 
if s[0] == s[1] and s[2] == s[3] and s[0] != s[2]:
    print('Yes')
elif s[0] == s[2] and s[1] == s[3] and s[0] != s[1]:
    print('Yes')
elif s[0] == s[3] and s[1] == s[2] and s[0] != s[1]:
    print('Yes')
else:
    print('No')  

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

#define IOS {ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);}
#define ll long long 

ll powermod(ll x,ll ex,ll md){ll ans=1ll;while(ex>0){if(ex&1ll) ans=(ans*x)%md; ex>>=1ll;x=(x*x)%md;}return ans;}
inline ll gcd(ll a,ll b) {if(b==0)return a;a%=b;return gcd(b,a);}
inline ll max(ll a,ll b) {return((a>b)?a:b);}
inline ll min(ll a,ll b) {return((a>b)?b:a);}

const ll N=2e5+1;
ll n,m;
vector<ll> v[N];
bool vis[N];
ll ct=0;
void dfs(ll node){
        vis[node]=1;
        ct++;
        for(auto child:v[node]){
                if(!vis[child]) dfs(child);
        }
}

int main(){
        IOS;
        cin>>n>>m;
        for(ll i=0;i<m;i++){
                ll x,y;
                cin>>x>>y;
                v[x].push_back(y);
                v[y].push_back(x);
        }        
        ll ans=LLONG_MIN;
        for(ll i=1;i<=n;i++){
                if(!vis[i]){
                        ct=0;
                        dfs(i);
                        ans=max(ans,ct);
                }
        }
        cout<<ans<<"\n";
}


Measured memory_bytes: 20968
<?php

while (TRUE) {
    fscanf(STDIN, '%d', $d);
    if (feof(STDIN)) {
        break;
    }
    $sum = 0;
    for ($i = $d; $i < 600; $i += $d) {
        $sum += $i * $i;
    }
    echo $sum * $d . PHP_EOL;
}

Measured memory_bytes: 6592
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)

int main() {
	int n;
	cin >> n;
	int tmp;
	vector<int> a;
	REP(i, n) {
		cin >> tmp;
		a.push_back(tmp);
	}

	bool flag = true;
	int i=0;
	int ans = 0;
	while (flag) {
		flag = false;
		for (int j = n - 1; j >= i+1; j--) {
			if (a[j] < a[j - 1]) {
				tmp = a[j - 1];
				a[j - 1] = a[j];
				a[j] = tmp;
				ans++;
				flag = true;
			}
		}
		i++;
	}

	REP(i, n) {
		if (i == n - 1) { cout << a[i] << endl; }
		else { cout << a[i] << " "; }
	}

	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 3160