akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define ALL(a)  (a).begin(),(a).end()
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<long long, long long> Pll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<long long> vll;
typedef vector<vector<long long>> vvll;
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; }
const long long INF = 1LL << 60;
const int INT_INF = 1 << 30;
#define MOD 1000000007LL
#define PI 3.141592653589793
#define endl "\n"

int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  double A, B, H, M;
  cin >> A >> B >> H >> M;
  double time = H * 60.0 + M;
  double x = PI * time / 360.0;
  double y = PI * M / 30.0;
  double z = x - y;
  double ans = sqrt(A*A + B*B - 2.0*A*B*cos(z));
  cout << fixed << setprecision(16);
  cout << ans << endl;
}

Measured memory_bytes: 4240
#include<iostream>
#include<algorithm>
#include<string>
#include<cctype>
#include<map>

using namespace std;

int now;
string str;
map<string,int>mp;

int Number(void){
	string res;
	while('0'<=str[now] && str[now]<='9')res+=str[now++];
	return atoi(res.c_str());
}

int Atom(void){
	string s;
	s+=str[now++];
	if(islower(str[now]))s+=str[now++];
	if(mp.count(s))return mp[s];
	return -1;
}

int Molecule(void){
	
	int res=0;
	if(isupper(str[now])){
		res+=Atom();
		if(res<0)return -1;
		if('0'<=str[now] && str[now]<='9')res*=Number();
	}
	else if(str[now]=='('){
		now++;
		int tmp=Molecule();
		if(tmp<0)return -1;
		res+=tmp;
		now++;
		res*=Number();
	}
	
	if(now<str.size() && str[now]!=')'){
		int tmp=Molecule();
		if(tmp<0)return -1;
		res+=tmp;
	}
	return res;
}

int main(void){
	
	int n;
	string s;
	
	while(true){
		cin >> s;
		if(s=="END_OF_FIRST_PART")break;
		cin >> n;
		mp[s]=n;
	}
	
	while(true){
		cin >> str;
		if(str=="0")break;
		now=0;
		int res=Molecule();
		if(res<0)cout << "UNKNOWN" << endl;
		else cout << res << endl;
	}
	
return 0;
}

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


/// File input & output /////
#define fRead(x)        freopen("x.txt","r",stdin)
#define fWrite(x)       freopen ("x.txt","w",stdout)

#define mt              make_tuple
#define ld              long double
#define ll              long long
#define ull             unsigned long long
#define ff              first
#define ss              second
#define pb              push_back
#define INF             2e16
#define PI              acos(-1.0)
#define mp              make_pair
#define pii             pair<int,int>
#define pll             pair<LL,LL>


#define min3(a,b,c)     min(a,min(b,c))
#define max3(a,b,c)     max(a,max(b,c))
#define min4(a,b,c,d)   min(a,min(b,min(c,d)))
#define max4(a,b,c,d)   max(a,max(b,max(c,d)))
#define SQR(a)          ((a)*(a))
#define FOR(i,a,b)      for(int i=a;i<=b;i++)
#define ROF(i,a,b)      for(int i=a;i>=b;i--)
#define REP(i,b)        for(int i=0;i<b;i++)
#define MEM(a,x)        memset(a,x,sizeof(a))
#define ABS(x)          ((x)<0?-(x):(x))

#define SORT(v)         sort(v.begin(),v.end())
#define REV(v)          reverse(v.begin(),v.end())


#define FASTIO        ios_base::sync_with_stdio(0);cin.tie(nullptr);




///..................Sort by second element in a pair in decending order............. ///
bool SortbySecDesc(const pair<long long,long long > &a, const pair<long long,long long > &b)
{
    return a.second>b.second;
}

///.........................first element of pair in descending order..........................//////
bool sortinrev(const pair<int,int> &a,
               const pair<int,int> &b)
{
       return (a.first > b.first);
}



///.............................................................TEMPLATE................................................./////

int main()
{
    FASTIO;


    set<char>s1,s2;


    string s , t;


    cin >> s >> t;

    int len1 = s.length();

    int len2 = t.length();

    for(int i=0; i<len1; i++)
    {
        if(s[i]!=t[i])
        {
            cout << "No" << endl;
            return 0;
        }
    }

    if(len2=len1+1)
    {
        cout << "Yes" << endl;
        return 0;
    }
    else
    {
        cout << "No" << endl;
    }







    return 0;
}


Measured memory_bytes: 3660
from collections import Counter 
from collections import defaultdict
from collections import deque
import itertools
import heapq
import sys
sys.setrecursionlimit(10**6)

#n=int(input())
#n,m=list(map(int,input().split()))
#a=list(map(int,input().split()))
input_list = lambda : list(map(int,input().split()))


n,m=input_list()
l=0
r=n
for _ in range(m):
    now=input_list()
    l=max(l,now[0])
    r=min(r,now[1])


print(max(r-l+1,0))




Measured memory_bytes: 3436
import std.stdio, std.string, std.range, std.conv, std.array, std.algorithm, std.math, std.typecons, std.ascii;

void main() {
    int A, B;
    readf("%d %d\n", &A, &B);
    auto S = readln.chomp;
    writeln(S[A] == '-' && (S[0..A]~S[A+1..$]).all!isDigit ? "Yes" : "No");
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long i64;
using std::cout;
using std::endl;
using std::cin;

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


Measured memory_bytes: 256
function main(input) {
    var line = input.split(/\r?\n/g);
    var arr = line[0].split(" ");
    const H = arr[0], N = arr[1];
    var A = line[1].split(" ");
    var accum = 0;
    for (var i = 0; i < A.length; i++)
        accum += parseInt(A[i]);
    console.log(1 < Math.ceil(H / accum) ? "No" : "Yes");
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 16716
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#define SIZE 200005
#define INF 10000000000000000LL
 
using namespace std;
typedef long long int ll;
typedef pair <int,int> P;
typedef pair <ll,P> PP;
 
struct edge
{
	int to;
	ll cost;
	edge(int to=0,ll cost=0):to(to),cost(cost){}
};
struct UF
{
	int par[SIZE],rank[SIZE];
	
	void init(int n)
	{
		for(int i=0;i<n;i++)
		{
			par[i]=i;
			rank[i]=0;
		}
	}
	int find(int x)
	{
		if(par[x]==x) return x;
		return par[x]=find(par[x]);
	}
	void unite(int x,int y)
	{
		x=find(x);
		y=find(y);
		if(x==y) return;
		if(rank[x]<rank[y]) par[x]=y;
		else
		{
			par[y]=x;
			if(rank[x]==rank[y]) rank[x]++;
		}
	}
	bool same(int x,int y)
	{
		return find(x)==find(y);
	}
};
UF uf;
vector <edge> vec[SIZE];
ll X[SIZE];
int v1[SIZE],v2[SIZE];
ll d1[SIZE],d2[SIZE];
int id[SIZE],ch[SIZE];
int now_id;
 
void dfs(int v=0,int p=-1)
{
	id[v]=now_id++;
	d1[v]=d2[v]=INF;
	v1[v]=v2[v]=-1;
	for(int i=0;i<vec[v].size();i++)
	{
		edge e=vec[v][i];
		if(e.to!=p)
		{
			dfs(e.to,v);
			ll vl=d1[e.to]+e.cost;
			int vv=v1[e.to];
			if(vl>e.cost+X[e.to])
			{
				vl=e.cost+X[e.to];
				vv=e.to;
			}
			if(vl<d1[v])
			{
				swap(vl,d1[v]);
				swap(vv,v1[v]);
			}
		}
	}
	ch[v]=now_id;
}
void make(int v=0,int p=-1)
{
	for(int i=0;i<vec[v].size();i++)
	{
		edge e=vec[v][i];
		if(e.to!=p)
		{
			ll vl=d1[v]+e.cost;
			int vv=v1[v];
			if(id[e.to]<=id[vv]&&id[vv]<ch[e.to])
			{
				vl=d2[v]+e.cost;
				vv=v2[v];
			}
			if(vl>e.cost+X[v])
			{
				vl=e.cost+X[v];
				vv=v;
			}
			if(vl<d1[e.to])
			{
				swap(vl,d1[e.to]);
				swap(vv,v1[e.to]);
			}
			make(e.to,v);
		}
	}
}
int A[SIZE],B[SIZE];
ll C[SIZE];
int main()
{
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++) scanf("%lld",&X[i]);
	for(int i=0;i<n-1;i++)
	{
		int a,b;
		ll c;
		scanf("%d %d %lld",&a,&b,&c);a--,b--;
		vec[a].push_back(edge(b,c));
		vec[b].push_back(edge(a,c));
		A[i]=a,B[i]=b,C[i]=c;
	}
	dfs();
	make();
	uf.init(n+2);
	ll ret=0;
	for(int i=0;i<n;i++)
	{
		if(v1[v1[i]]==i&&i<v1[i]) continue;
		ret+=d1[i]+X[i];
		uf.unite(i,v1[i]);
	}
	for(int i=0;i<n-1;i++)
	{
		if(!uf.same(A[i],B[i]))
		{
			ret+=min(X[A[i]],d1[A[i]]);
			ret+=min(X[B[i]],d1[B[i]]);
			ret+=C[i];
		}
	}
	printf("%lld\n",ret);
	return 0;
}

Measured memory_bytes: 43520
import java.util.Scanner;

class Main{
  public static void main (String[] args){
    Scanner sc = new Scanner(System.in);
      while (true){
        int H = sc.nextInt();
        int W = sc.nextInt();
        if ((H == 0) && (W == 0)) break;
          for(int i = 0; i < H ; i++){
            for(int j = 0;  j < W ; j++){
            System.out.print("#");
          }
          System.out.println("");
      }
      System.out.println("");
  }
}
}



Measured memory_bytes: 32804
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i <(n); ++i)
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
//xにはvectorなどのコンテナ
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値を求める
#define MIN(x) *min_element(ALL(x)) //最小値を求める
//定数
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define inf 2147483647 //int値の最大値
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
//略記
#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素
#define CST(x) cout<<fixed<<setprecision(x)//小数点以下の桁数指定
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
int gcd(int a, int b) {
    if (b==0) return a;
    else return gcd(b, a%b);
}
int lcm(int a, int b) {
    return a * b / gcd(a, b);
}
int two(int n){
	ll ans=1;
	rep(i,n){
		ans*=2;
	}
	return ans;
}
int main() {
	cin.tie(0);
	cout.tie(0);
	ios::sync_with_stdio(false);

   int n;
   cin>>n;
   vector<ll>a(101);
rep(i,n)cin>>a.at(i);
ll ma = fabs(a[0]-a[1]);

 rep(i,n)for(int j=i+1;j<n;j++){
     if(ma<fabs(a[i]-a[j])){
         ma=fabs(a[i]-a[j]);

     }
 }

cout<< ma <<endl;
}

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

int main()
{
    int a, b;
    cin >> a >> b;
    if ((a - b) % 2 == 0)
        cout << a + (b - a) / 2 << endl;
    else
        cout << "IMPOSSIBLE" << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define int long long
using namespace std;
typedef vector<int>   vint;
typedef pair<int,int> pint;

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

    vint c(26);
    REP(i,N) c[s[i]-'a']++;

    int ans=1+N*(N-1)/2;
    REP(i,26){
        ans-=c[i]*(c[i]-1)/2;
    }
    cout<<ans<<endl;
 
}


Measured memory_bytes: 640
#include <stdio.h>

int main(void){

  int h,w,i,j;
  
  while(1){

    scanf("%d %d",&h,&w);
    if(w==0&&h==0){
      break;
    }
  
    for(i=0;i<h;i++){
      for(j=0;j<w;j++){
	if(i==0 || i==h-1 || j==0 || j==w-1)
	  printf("#");
	else
	  printf(".");
      }
      printf("\n");
    }
    printf("\n");
  }

  return 0;
}

Measured memory_bytes: 572
#include<stdio.h>
int main(void)
{
    char s[3];
  
    scanf("%s",s);
  
    int count = 0;
  
    if(s[0]=='1')	count++;
    if(s[1]=='1')	count++;
    if(s[2]=='1')	count++; 
  
    printf("%d",count);
  
    return 0;
}

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

int main(){
    int N;
    cin >> N;
    long long A[N], B[N-1];
    rep(i, N-1){
        cin >> B[i];
    }
    A[0] = B[0];
    rep2(i, 1, N){
        A[i] = min(B[i-1], B[i]);
    }
    A[N-1] = B[N-2];
    long long count = 0;
    rep(i, N){
        count += A[i];
    }
    cout << count << endl;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cstdio>
#include <iostream>

using namespace std;

int main() {

	int H, W;
	scanf("%d %d", &H, &W);

	int A[H + 1][W + 1];
	for (int i = 1; i <= H; ++i) {
		for (int j = 1; j <= W; ++j) {
			scanf("%d", &A[i][j]);
		}
	}
	int V[H + 1][W + 1];
	for (int i = 0; i <= H; ++i) {
		for (int j = 0; j <= W; ++j) {
			V[i][j] = 0;
		}
	}
	int width = 0;
	for (int i = 1; i <= H; ++i) {
		for (int j = 1; j <= W; ++j) {
			if (A[i][j] == 1) {
				V[i][j] = 0;
			} else {
				V[i][j] = min(V[i][j - 1], min(V[i - 1][j - 1], V[i - 1][j])) + 1;
				width = max(width, V[i][j]);
			}
		}
	}
	cout << width * width << endl;

	return 0;
}

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

int main() {
    int N;
    int a[110];  // 最大 100 個ですが余裕をもたせます
    cin >> N;
    for (int i = 0; i < N; ++i) cin >> a[i];

    sort(a, a + N, greater<int>());  // a[0:N] を大きい順にソート
    int Alice = 0;
    int Bob = 0;
    for (int i = 0; i < N; ++i) {
        if (i % 2 == 0) { // Alice のターン
            Alice += a[i];
        }
        else { // Bob のターン
            Bob += a[i];
        }
    }
    cout << Alice - Bob << endl;
}

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

int main() {
	int N,M,r=0;
	string s;
	map<string,int> c;

	cin >> N;
	rep(i,N) {
		cin >> s;
		if(c.count(s))
			++c.at(s);
		else
			c[s] = 1;
	}

	cin >> M;
	rep(i,M) {
		cin >> s;
		if(c.count(s))
			--c.at(s);
	}

	for(auto p : c)
		r = max(r, p.second);

	cout << r << endl;
}

Measured memory_bytes: 256
#![allow(non_snake_case)]

fn main() {
    loop {
        let mut buf = String::new();
        std::io::stdin().read_line(&mut buf).unwrap();
        let mut iter = buf.split_whitespace();
        let H = iter.next().unwrap().parse::<isize>().unwrap();
        let W = iter.next().unwrap().parse::<isize>().unwrap();

        if H == 0 && W == 0 {break;}
        for _ in 0..W {
            print!("#");
        }
        println!();
        for _ in 0..H - 2 {
            print!("#");
            for _ in 0..W - 2 {
                print!(".");
            }
            print!("#");
            println!();
        }
        for _ in 0..W {
            print!("#");
        }
        println!();
        println!();
    }
}



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

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

  int n, d, x;
  cin >> n >> d >> x;

  vector<int> arr(n + 1);
  for (int i = 1; i <= n; ++i) cin >> arr[i];

  int count = 0;
  for (int i = 1; i <= n; ++i) {
    int j = 1, day = 0;
    while (day <= d) {
      day = j * arr[i] + 1;
      count++, j++;
    }
  }

  cout << count + x << endl;
}


Measured memory_bytes: 3660
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

a, b, x = MAP()

print(b//x-(a-1)//x)


Measured memory_bytes: 9860
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> iint;
typedef pair<ll,ll> llll;
#define ALL(x) (x).begin(),(x).end()
const ll zero = 0;
const ll INF = 3000000000000000000; //10^18
const int inINF = 1000000000; //10^9
const ll MOD = 1000000007; //10^9+7
const ll MOD2 = 998244353;

int main(){
    ll K;
    string S;
    cin >> K >> S;
    ll L;
    L = S.length();

    vector<ll> inv(1000005); inv[1] = 1;
    for (int i = 2; i < 1000005; i++) {
        inv[i] = MOD - (MOD / i) * inv[MOD % i] % MOD;
    }   
    vector<ll> invfact(1000005);
    invfact[0] = 1; invfact[1] = 1;
    for (int i = 2; i < 1000005; i++) {
        invfact[i] = invfact[i-1] * inv[i] % MOD;
    }   
    vector<ll> fact(2000005);
    fact[0] = 1; fact[1] = 1;
    for (int i = 2; i < 2000005; i++) {
        fact[i] = fact[i-1] * i % MOD;
    }   
    
    ll ans = 1;
    for (ll i = 0; i < K; i++) {
        ans = ans * 26 %MOD;
    }
    ll tmp;
    ll b = 25;
    ll c = 1;
    for (int i = 0; i < K-1; i++) {
        c = c * 26 %MOD;
    }
    for (int i = L; i < K+L; i++) {
        tmp = c * b %MOD;
        tmp = tmp * fact[i] %MOD;
        tmp = tmp * invfact[L-1] % MOD;
        tmp = tmp * invfact[i-L+1] % MOD;
        ans = (ans + tmp)%MOD;
        b = b * 25 %MOD;
        c = c * inv[26] %MOD;
    }

    printf("%lld\n", ans);
    
}


Measured memory_bytes: 35616
#include <iostream>
#include <cmath>
#include <string>
#include <cstring>
#include <utility>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#define debug(x) cerr << #x << ':' << x << endl
#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
using namespace std;
typedef long long ll;

struct info{
    int ci;
    int pref;
    int year;
    string id="";
    info(int i, int p, int y){
        ci = i;
        pref = p;
        year = y;
    }
};

bool comp1(const info &a, const info &b){
    if(a.pref==b.pref){
        return a.year < b.year;
    }
    else
        return a.pref < b.pref;
}

bool comp2(const info &a, const info &b){
    return a.ci < b.ci;
}

int main(){
    int n,m;
    cin >> n >> m;
    vector<info> A;
    REP(i,m){
        int p, y;
        cin >> p >> y;
        string s;
        A.push_back(info(i, p, y));
    }
    sort(ALL(A), comp1);
    int order=0;
    int past=-1;
    for(int i=0; i<m; i++){
        if(A[i].pref==past)
            order+=1;
        else
            order = 1;

        string s1;
        // cout << to_string(A[i].pref).size() << ", " << A[i].pref << endl;
        REP(j,6-to_string(A[i].pref).size()) s1.append("0");
        s1.append(to_string(A[i].pref));

        string s2;
        REP(j,6-to_string(order).size()) s2.append("0");
        s2.append(to_string(order));
        A[i].id = s1 + s2;
        past = A[i].pref;
    }
    sort(ALL(A), comp2);

    for(auto x : A)
        cout << x.id<< endl;
    return 0;
}



Measured memory_bytes: 7536
#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;

int main(){
    double x1,y1,x2,y2,x3,y3;
    int n;
    cin >> n;
    double a,b,c;
    double ans1,ans2;
    for(int i=0;i<n;i++){
        double ans = 0;
        cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
        a = hypot(x2 - x1,y2 - y1);
        b = hypot(x3 - x1,y3 - y1);
        c = hypot(x3 - x2,y3 - y2);
        ans = (a*b*c) / (sqrt((a+b+c)*(b+c-a)*(a-b+c)*(a+b-c)));
        ans1 = (((x1*x1)+(y1*y1))*(y2-y3)+((x2*x2)+(y2*y2))*(y3-y1)+((x3*x3)+(y3*y3))*(y1-y2))/(x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2))/2;
        ans2 = (((x1*x1)+(y1*y1))*(x2-x3)+((x2*x2)+(y2*y2))*(x3-x1)+((x3*x3)+(y3*y3))*(x1-x2))/(y1*(x2-x3)+y2*(x3-x1)+y3*(x1-x2))/2;
        printf("%.3lf %.3lf %.3lf\n",ans1,ans2,ans);
    }
}

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

int main(){
  bool alpha[26];
  string s;
  cin >> s;

  for (int i = 0; i < 26; i++){
    alpha[i] = false;
  }

  for (int i = 0; i < s.size(); i++){
    alpha[s[i] - 'a'] = true;
  }

  for (int i = 0; i < 26; i++){
    if(alpha[i] == false){
      cout << (char)(i + 'a') << endl;
      return 0;
    }
  }

  cout << "None" << endl;
  return 0;
}

Measured memory_bytes: 512
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<map>
#include<iomanip>
#include<queue>
#include<stack>
#include<time.h>
//もう二度とつかわん//
//    ↓ ↓　↓　　 //
#define ll long long
//    ↑　↑　↑    //
//フェルマー方程式の恨み//
#define rep(i,n) for(int i=0;i<n;i++)
#define ggr getchar(); getchar();return 0;
using namespace std;
signed main() {
	ll a, b, t;
	cin >> a >> b >> t;
	cout << t / a * b << endl;
	ggr
}




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

using namespace std;

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

typedef long long ll;

const int Inf = 1e9;
const double EPS = 1e-9;
const int MAX = 100001;

void bfs(int);

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

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

int bitCount(long bits) {
    bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
    bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
    bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
    bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
    return (bits & 0x0000ffff) + (bits >>16 & 0x0000ffff);
}

vector<int> g[MAX];
bool visited[MAX];
int entry[MAX];
list<int> out;
int v;

void tsort() {
    rep (i, v) entry[i] = 0;
    rep (i, v) {
        rep (j, g[i].size()) {
            int c = g[i][j];
            entry[c]++;
        }
    }
    rep (i, v) {
        if (entry[i] == 0 && !visited[i]) bfs(i);
    }

    for (auto iter = out.begin(); iter != out.end(); iter++) {
        cout << *iter << endl;
    }

}

void bfs(int s) {
    queue<int> q;
    q.push(s);
    visited[s] = true;
    while (!q.empty()) {
        int t = q.front();
        q.pop();
        out.push_back(t);
        rep (i, g[t].size()) {
            int u = g[t][i];
            entry[u]--;
            if (entry[u] == 0 && !visited[u]) {
                q.push(u);
                visited[u] = true;
            }
        }
    }

}

int main() {
    int e;
    cin >> v >> e;
    rep (i, v) visited[i] = false;
    rep (i, e) {
        int s, t;
        cin >> s >> t;
        g[s].push_back(t);
    }
    tsort();
    
    return 0;
}



Measured memory_bytes: 6172
#include <bits/stdc++.h>
using namespace std;
int n;
int w;
int x[101];
int y[101];
int g[101];
long long f[100+1][100007];
int main()
{
   cin>>n>>w;
    int i;
    for(i=1;i<=n;i++)
        cin>>x[i]>>y[i];
    int k=0;
    for(i=1;i<=n;i++)
        k=k+y[i];
    g[0]=0;
    for(i=1;i<=n;i++)
        g[i]=g[i-1]+y[i];
    int j;
    for(int i= 0; i <= n; i++)
        for(int j = 1; j <= g[n]; j++) f[i][j] = w + 1;
    f[0][0] = 0;
    for(i=1;i<=n;i++)
     for(j=1;j<=g[i];j++)
     {
        if(j<y[i]) f[i][j]=f[i-1][j];
        else
          f[i][j]=min(f[i-1][j-y[i]]+x[i],f[i-1][j]);
     }
     int kq;
     for(j=g[n];j>0;j--)
     if(f[n][j]<=w) {kq=j;break;}
    cout<<kq;
    return 0;
}


Measured memory_bytes: 79104
#include <bits/stdc++.h>
#define int long long
#define moder 1234567
#define inf 9000000000000000000
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define P pair<int,int>
#define all(v) v.begin(),v.end()
#define prique(T) priority_queue<T,vector<T>,greater<T>>
#define vecunique(vec) sort(vec.begin(), vec.end());decltype(vec)::iterator result = std::unique(vec.begin(), vec.end());vec.erase(result, vec.end())
using namespace std;

string s;
int a,b,c;
signed main() {
	cin>>s;
	int n=s.size();
	rep(i,n){
		if(s[i]=='a')a++;
		else if(s[i]=='b')b++;
		else c++;
	}
	if((n-1)/3+1>=a&&(n-1)/3+1>=b&&(n-1)/3+1>=c){
		cout<<"YES"<<endl;
	}else {
		cout<<"NO"<<endl;
	}
}


Measured memory_bytes: 512
function main(input) {
  input = input.trim();
  const [x,a,b] = input.split(" ").map(Number);
 
  if(b-a<=0){
     console.log("delicious");
  }else if(b-a<=x){
     console.log("safe");
  }else{          
     console.log("dangerous");
  }
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 29496
def main():
  n = int(input())
  a = list(map(int,input().split()))
  flg=0
  for i in range(0,n):
    if a[i]%2==0 :
      if a[i]%3!=0 and a[i]%5!=0 :
        flg=1
  if flg==0:
    print("APPROVED")
  else:
    print("DENIED")
main()

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

int main() {
  int n, m, c;
  cin >> n >> m >> c;
  vector<int> b(m);
  vector<vector<int>> a(n, vector<int>(m));

  for (int i = 0; i < m; i++) {
    cin >> b[i];
  }

  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> a[i][j];
    }
  }

  int cnt = 0;
  for (int i = 0; i < n; i++) {
    int sum = 0;
    for (int j = 0; j < m; j++) {
      sum += a[i][j] * b[j];
    }
    sum += c;

    if (sum > 0) cnt++;
  }

  cout << cnt << endl;

  return 0;
}


Measured memory_bytes: 256
#include <cstring>
#include<cstdio>
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,c;
	cin>>a>>b>>c;
	if(a!=b&&c!=b&&c!=a) cout<<"3";
	if(a==b&&a==c&&c==a) cout<<"1";
	if(a!=b&&c==b||b!=a&&c==a||c!=b&&a==b) cout<<"2";
	
	return 0;
}


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

int main() {
    ll n;
    cin>>n;
    ll ans = 1e12;
    for(ll i=1;i*i<=n;i++){
        if(n%i) continue;
        else{
            ans = i+n/i-2;
        }
    }
    cout<< ans <<endl;
    return 0;
}


Measured memory_bytes: 256
#define LOCAL
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define rep2(i, s, n) for(int i=s; i<(n); ++i)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
static const int INTINF = (INT_MAX >> 1); // 10^9 + 10^7
static const ll LLINF = (LLONG_MAX >> 1);
static const int MAX = 1e5+1;
static const ll MOD = 1e9+7;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
string to_string(string s) { return '"' + s + '"'; }
string to_string(bool b) { return b ? "true" : "false"; }
template <size_t N> string to_string(bitset<N> bs) {
  string res;
  for (size_t i = 0; i < N; ++i) res += '0' + bs[i];
  return res;
}
string to_string(vector<bool> v) {
  string res = "{";
  for (bool e : v) res += to_string(e) + ", ";
  return res += "}";
}
template <class T, class U> string to_string(pair<T, U> p);
template <class C> string to_string(C c) {
  string res = "{";
  for (auto e : c) res += to_string(e) + ", ";
  return res += "}";
}
template <class T, class U> string to_string(pair<T, U> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
void debug() { cerr << '\n'; }
template <class Head, class... Tail> void debug(Head head, Tail... tail) {
  cerr << '\t' << to_string(head), debug(tail...);
}
#ifdef LOCAL
#define DEBUG(...) cerr << "[" << #__VA_ARGS__ << "]:", debug(__VA_ARGS__)
#else
#define DEBUG(...)
#endif

struct point{
  ll x, y, idx;
};

int main(int argc, const char * argv[]) {
  std::cout << std::fixed << std::setprecision(15);

  ll N, K; cin >> N >> K;
  vector<point> v(N);
  rep(i, N){
    ll x, y; cin >> x >> y;
    v[i] = {x, y, i};
  }

  ll ans = LLINF;
  rep(i, N){
    point lp = v[i];
    rep(j, N){
      if(lp.idx == v[j].idx) continue;
      if(v[j].x < lp.x) continue;
      point rp = v[j];
      rep(k, N){
        if(v[k].y < max(lp.y, rp.y)) continue;
        point tp = v[k];
        rep(t, N){
          if(v[t].y > min(lp.y, rp.y)) continue;
          point dp = v[t];
          int cnt = 0;
          rep(s, N){
            if(v[s].x < min(lp.x, rp.x) || max(lp.x, rp.x) < v[s].x) continue;
            if(v[s].y < min(tp.y, dp.y) || max(tp.y, dp.y) < v[s].y) continue;
            cnt++;
          }
          if(cnt >= K){
            ll area = abs(max(lp.x, rp.x) - min(lp.x, rp.x)) * abs(max(tp.y, dp.y) - min(tp.y, dp.y));
            chmin(ans, area);
          }
        }
      }
    }
  }

  cout << ans << endl;
}  


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repo(i,n) for(int i = 1; i < (int)(n); i++)
#define pb push_back
#define mp make_pair
#define np next_permutation
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define pi acos(-1.0)
const ll INF = 1LL<<61;
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; }
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }
ll jou(ll N, ll P){if(P==0) return 1;
  if(P%2==0){ll t = jou(N, P/2);return t*t % mod;
  }return (N * jou(N, P-1)) % mod;}  //jou(n,mod-2)で逆元
//intの最大値2147483647 ≒ 2×10^9
//long longの最大値9223372036854775807 ≒ 9×10^18
//'大文字'+=32;    で小文字に
//  cout << fixed << setprecision (20);   小数点以下2０桁まで
//実行時間制約2秒では２×10^8回くらいまで計算できる



int main() {
  ll n,m;
  cin>>n>>m;

  priority_queue<ll> p;
  rep(i,n){
    ll x;
    cin>>x;
    p.push(x);
  }

  rep(i,m){
    ll x=p.top();
    p.pop();
    x/=2;
    p.push(x);
  }

  ll ans=0;
  rep(i,n){
    ll x=p.top();
    p.pop();
    ans+=x;
  }

  cout << ans << endl;
}

Measured memory_bytes: 1400
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e5+5;
const int maxm=125;
const int INF = 0x3f3f3f3f;

int n,a,b;
int main()
{
    scanf("%d",&n);
    a=n/2;
    if(n%2==1) a++;
    printf("%.6f\n",1.0*a/n);
    return 0;
}

Measured memory_bytes: 256
n,k = map(int,input().split())
h = list(map(int,input().split()))
h.sort(reverse=True)
sum =0
if n-k <= 0:
    print(0)
else:
    for i in range(k):
        h[i] = 0
    for i in range(n):
        sum = sum + h[i]
    print(sum)

Measured memory_bytes: 87372
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <deque>
#include <queue>
#include <array>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <cassert>
#include <utility>
#include <functional>
#include <bitset>
#include <cstdint>

using namespace std;
using lli = long long int;
using i64 = int64_t;
using i32 = int32_t;
template<class T, class U> void init_n(vector<T>& v, size_t n, U x) 
{ v = vector<T>(n, x); }
template<class T> void init_n(vector<T>& v, size_t n) { init_n(v, n, T()); }
template<class T> void read_n(vector<T>& v, size_t n, size_t o = 0) 
{ v = vector<T>(n+o); for (size_t i=o; i<n+o; ++i) cin >> v[i]; }
template<class T> void read_n(T a[], size_t n, size_t o = 0)
{ for (size_t i=o; i<n+o; ++i) cin >> a[i]; }
template<class T> T gabs(const T& x) { return max(x, -x); }
#define abs gabs

i64 n, c[10];
int main() {
  cin >> n;
  for (i64 i = 0; i < n; ++i) {
    i64 x; cin >> x;
    c[min(i64(8), x / 400)]++;
  }

  i64 s = 0;
  for (i64 i = 0; i <= 7; ++i) {
    if (c[i] > 0) ++s;
  }

  cout << (s == 0 && c[8] > 0 ? 1 : s) << ' ';
  cout << s + c[8] << '\n';
  return 0;
}


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

int main() {
  int N,sum = 0;
  cin >> N;
  vector<int> l(N),r(N);
  rep(i,N) cin >> l[i] >> r[i];
  rep(i,N) sum += (r[i] - l[i] + 1);
  cout << sum << endl;
}


Measured memory_bytes: 3648
#include <iostream>  // cin,cout
#include <stdio.h>   // printf,scanf (standard input/output)
#include <cmath>     // abs(x),pow(x,2)
#include <string>
#include <string.h>  // strlen, strcmp
#include <algorithm> // min,max, sort(v.begin(),v.end())
#include <vector>
#include <time.h>
using namespace std;

int Make_int(int d, int N) {
    int result = 0;
    
    long long max = pow(3,d);
    for (long long i=0;i<max;i++) {
        long long total = 0;
        int flag[3] = {};
        for (int j=1;j<=d;j++) {
            long long temp = pow(3,j);
            temp = i%temp;
            temp = temp/pow(3,j-1);
            flag[temp] += 1;
            total += (2*temp+3)*pow(10,j-1);
        }
        if (flag[0]*flag[1]*flag[2] and total<=N) result += 1;
    }
    
    return result;
}


int main(){
    //clock_t start = clock();
    
    int N;
    
    cin >> N;
    int N_digit = to_string(N).length();

    int result = 0;
    for (int i=1;i<=N_digit;i++) {
        result += Make_int(i, N);
    }
    
    cout << result << endl;
    
    // 時間計測
    //clock_t end = clock();
    //cout << "Time = " << (double)(end - start) / CLOCKS_PER_SEC << "sec.\n";
    
    return 0;
}

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

typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pll;
typedef vector<bool> vb;
const ll oo = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-9;
#define sz(c) ll((c).size())
#define all(c) begin(c), end(c)
#define FOR(i,a,b) for (ll i = (a); i < (b); i++)
#define FORD(i,a,b) for (ll i = (b)-1; i >= (a); i--)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define xx first
#define yy second
#define has(c,i) ((c).find(i) != end(c))
#define DBGDO(X) ({ if(1) cerr << "DBGDO: " << (#X) << " = " << (X) << endl; })

vvl adj;

ll dfs(ll i, ll p) {
	ll sum = 0;
	for (ll j: adj[i]) if (j != p) {
		sum ^= 1 + dfs(j,i);
	}
	return sum;
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	ll n; cin >> n;

	adj.resize(n);
	FOR(i,1,n) {
		ll a, b; cin >> a >> b;
		a--, b--;
		adj[a].pb(b);
		adj[b].pb(a);
	}

	ll res = dfs(0,-1);
	cout << (res ? "Alice" : "Bob") << endl;
}



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

#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define deb(x)	cout << #x << " " << x << endl;

typedef long long int ll;

int main() {

	IOS

	int n;
	cin >> n;
	
	int x, c = 0;

	for (int i = 1; i <= n; i++) {
		cin >> x;

		if (i%2 == 1 && x%2 == 1)
			c++;
	}

	cout << c;

	return 0;
}

Measured memory_bytes: 3648
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define uni(x) x.erase(unique(rng(x)),x.end())
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define dup(x,y) (((x)+(y)-1)/(y))
#define v(T) vector<T>
#define vv(T) v(v(T))
using ll = int64_t;
using ull = uint64_t;
using uint = uint32_t;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using pil = pair<int,ll>;
using pil = pair<int,ll>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,v.size())i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,v.size())s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(v.size())o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
constexpr double eps = 1e-6;
constexpr ll LINF = 100200300400500600ll;
constexpr int INF = 2*((1<<30)-1)+1;
//--------------------------------------------------------
#define fastio cin.tie(nullptr); std::ios::sync_with_stdio(false);
#define myio ifstream iofi; if(argc>1){iofi.open(argv[1]); std::cin.rdbuf(iofi.rdbuf());}
#define myloopset int loop = 1; if(argc>2) loop =stoi(argv[2]); rep(i,loop)
//--------------------------------------------------------------
template <class T> T chmin(T &a,T b){if(a>b){a=b; return 1;}else return 0;}
template <class T> T chmax(T &a,T b){if(a<b){a=b; return 1;}else return 0;}
constexpr int dx[4] = {0,1,0,-1};
constexpr int dy[4] = {-1,0,1,0};
constexpr int mod = 1000000007;
#define Yes(ifeq) cout<<(( ifeq )? "Yes":"No")<<endl;

void Main(){
  ll n;
  cin>>n;
  ll sum=0;
  srep(i,1,n+1){
    if(i%3!=0 and i%5!=0){
      sum+=i;
    }
  }
  cout<<sum<<endl;
} signed main(int argc,char** argv)
{fastio; myio; myloopset Main();}


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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define reps(i,s,n) for(int (i)=(s);(i)<(n);(i)++)
#define repr(i,n) for(int (i)=(n)-1;(i)>=0;(i)--)
#define all(v) (v).begin(),(v).end()
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
#define pb push_back
#define mod 1000000007
#define inf 1000000000
#define llinf 1000000000000000

typedef long long ll;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef pair<int,int> pint;
typedef pair<ll,ll> pll;
typedef vector<pint> vpint;

int func(int a,int b){
    //if(a<b)return func(b,a);
    if(b==0)return a;
    return func(b,a%b);
}

int main(){
    int n,k;
    cin>>n>>k;
    if(k%2==1){
        cout<<(ll)(n/k)*(ll)(n/k)*(ll)(n/k)<<endl;
    }
    else{
        cout<<(ll)((n+(k/2))/k)*(ll)((n+(k/2))/k)*(ll)((n+(k/2))/k)+(ll)(n/k)*(ll)(n/k)*(ll)(n/k)<<endl;
    }
}

Measured memory_bytes: 256
tmp = list(map(int, input().split()))
x = tmp[0]
n = tmp[1]
if n == 0:
    print(x)
    exit()

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

i = 0

while True:
    if not x-i in p:
        print(x-i)
        break
    if not x+i in p:
        print(x+i)
        break
    i += 1

Measured memory_bytes: 9072
#include <bits/stdc++.h>
#define st first
#define nd second
#define mp make_pair
#define pb push_back
#define N 1000005
using namespace std;

int n, k = -1, m;
vector < int > g[N];

int main() {
	// freopen("in.txt", "r", stdin);
	// freopen("out.txt", "w", stdout);
	scanf("%d",&n);
	n += n;
	for(int i = 1; i <= n; i++)
		if(1ll*i*(i + 1) == n){
			k = i + 1;
			break;
		}
	if(k == -1){
		puts("No");
		return 0;
	}
	puts("Yes");
	m = 1;
	for(int i = 1; i <= k; i++)
		for(int j = i + 1; j <= k; j++){
			g[i].pb(m);
			g[j].pb(m);
			m++;
		}
	printf("%d\n", k);
	for(int i = 1; i <= k; i++,puts("")){
		printf("%d ", k - 1);
		for(int j = 0; j < g[i].size(); j++)
			printf("%d ", g[i][j]);
	}
	return 0;
}

Measured memory_bytes: 25728
n = int(input())
l = []
m = []
a = 0
b = 0
for i in range(n):
    x,u = map(str,input().split())
    l.append(float(x))
    m.append(u)
for i in range(n):
    if m[i] == "JPY":
        a += l[i]
    elif m[i] == "BTC":
        b += l[i]
print(a+b*380000)

Measured memory_bytes: 3064
import java.util.*;
import java.io.*;

public class Main {
	static int mod = (int) 1e9 + 7;
	static int DX[] = { -1, 0, 1, 0 }, DY[] = { 0, -1, 0, 1 };
	static final int INF = Integer.MAX_VALUE / 3;
	static final long LINF = Long.MAX_VALUE / 3;

	public static void main(String[] args) {
		FastScanner fs = new FastScanner(System.in);
		int n = fs.nextInt();
		int a[] = new int[n];
		for(int i=0;i<n;i++) {
			a[i] = fs.nextInt();
		}
		
		TreeMap<Integer,Integer> tm = new TreeMap<>();
		for(int i=0;i<n;i++) {
			int t = a[i];
			if(tm.lowerKey(t)==null) tm.put(t, tm.getOrDefault(t,0)+1);
			else {
				int s = tm.lowerKey(t);
				if(tm.get(s)==1)tm.remove(s);
				else tm.put(s, tm.get(s)-1);
				
				tm.put(t, tm.getOrDefault(t,0)+1);
			}			
		}
		
		int ans = 0;
		for(int key:tm.keySet()) {
			ans += tm.get(key);
		}
		
		System.out.println(ans);
		
	}

	//MOD culculations
	static long plus(long x, long y) {
		long res = (x + y) % mod;
		return res < 0 ? res + mod : res;
	}

	static long sub(long x, long y) {
		long res = (x - y) % mod;
		return res < 0 ? res + mod : res;
	}

	static long mul(long x, long y) {
		long res = (x * y) % mod;
		return res < 0 ? res + mod : res;
	}

	static long div(long x, long y) {
		long res = x * pow(y, mod - 2) % mod;
		return res < 0 ? res + mod : res;
	}

	static long pow(long x, long y) {
		if (y < 0)
			return 0;
		if (y == 0)
			return 1;
		if (y % 2 == 1)
			return (x * pow(x, y - 1)) % mod;
		long root = pow(x, y / 2);
		return root * root % mod;
	}
}

//高速なScanner
class FastScanner {
	private BufferedReader reader = null;
	private StringTokenizer tokenizer = null;

	public FastScanner(InputStream in) {
		reader = new BufferedReader(new InputStreamReader(in));
		tokenizer = null;
	}

	public String next() {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}

	public String nextLine() {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken("\n");
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}

	public int[] nextIntArray(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = nextInt();
		return a;
	}

	public long[] nextLongArray(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nextLong();
		return a;
	}
}

Measured memory_bytes: 44876
<?php
fscanf(STDIN, '%d', $n);
$arr = explode(' ', trim(fgets(STDIN)));
$absList = [];
for ($i = 0; $i < $n;$i++) {
    $a = array_sum(array_slice($arr, 0, $i + 1));
    $b = array_sum(array_slice($arr, $i + 1, $n));
    $absList[] = abs($a - $b);
}
echo min($absList) . PHP_EOL;


Measured memory_bytes: 4728
#include <iostream>
#include <queue>
#include <string>
#include <utility>
using namespace std;

int main(){
	queue<pair<string, int> > Q;
	int n, q, t = 0;
	cin >> n >> q;
	string name;
	int time;
	for (int i = 0; i < n; i++){
		cin >> name;
		cin >> time;
		pair<string, int> a(name, time);
		Q.push(a);
	}
	while (!Q.empty()){
		pair<string, int> current = Q.front();
		Q.pop();
		if (current.second - q > 0){
			current.second -= q;
			Q.push(current);
			t += q;
		}
		else {
			t += current.second;
			cout << current.first << " " << t << endl;
		}
	}

}

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

#define ll long long

bool isPalindrome(string s) {
  string sr = s;
  reverse(sr.begin(), sr.end());
  return s == sr;
}

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

  string s;
  cin >> s;
  int n = s.size();
  string s1 = s.substr((n + 1) / 2), s2 = s.substr((n + 1) / 2);
  if (isPalindrome(s) && isPalindrome(s1) && isPalindrome(s2))
    puts("Yes");
  else
    puts("No");

  return 0;
}


Measured memory_bytes: 3632
import numpy as np

H, N = map(int, input().split())

A = []
B = []
for i in range(N):
	a, b = list(map(int, input().split()))
	A.append(a)
	B.append(b)

A = np.array(A)
B = np.array(B)

dp = np.full((H+1), np.inf)
dp[0] = 0

def solve():
	for i in range(1, H + 1):
		dp[i] = np.amin(dp[np.maximum(i - A, 0)] + B)
	return int(dp[H])

print(solve())

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

using namespace std;

#define ll long long

void solve(){
    string s;
    cin>>s;
    if(s[2] == s[3] && s[4] == s[5]){
        cout<<"Yes";
    }else cout<<"No";
}

int main(){
    int t = 1;
    while(t--){
        solve();
    }
    return 0;
}


Measured memory_bytes: 256
#[allow(unused_imports)]
use proconio::{input, fastout};
#[allow(unused_imports)]
use proconio::marker::{Chars};

#[fastout]
fn main() {
  input!{
    n:usize,
    a:[usize;n]
  }
  let mut res = 0;
  let mut i = 0;
  for e in a {
    i+=1;
    if e%2 == 1 && i%2 == 1 {
      res += 1;
    }
  }
  println!("{}",res)
}


Measured memory_bytes: 2136
#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <climits>
#include <numeric>
#include <cmath>
#include <queue>
#include <sstream>

using namespace std;
typedef long long ll;

// ARMERIAさんを参考に
int dp[106][76];
map<int, int> prime_division;
void prime_factor(int n) {
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      while (n % i == 0) {
        prime_division[i]++;
        n /= i;
      }
    }
  }
  if (n != 1) {
    prime_division[n]++;
  }
}

int main() {
  int N;
  cin >> N;
  
  for (int i = 2; i <= N; i++) {
    prime_factor(i);
  }
  
  vector<int> nums;
  for (auto p : prime_division) {
    nums.push_back(p.second);
  }
  
  vector<int> div75 = {1, 3, 5, 15, 25, 75};
  //dp[i][j]  を「i 番目の素因数まで見た時に、それまでの約数の個数が j であるような選び方の個数」
  dp[0][1] = 1;
  for (int i = 0; i < nums.size(); i++) {
    for (auto d1 : div75) {
      for (auto d2 : div75) {
        if (d1 * d2 <= 75 && nums[i] + 1 >= d2) {
          dp[i + 1][d1 * d2] += dp[i][d1];
        }
      }
    }
  }
  
  cout << dp[nums.size()][75] << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	int n;
	cin >> n;
	vector<long long> A(n, 0), B(n, 0), C;
	for (int i = 0; i < n; i++) {
		cin >> A[i];
	}
	long long sum = 0, sum2 = 0, ans = 0;
	for (int i = 0; i < n; i++) {
		cin >> B[i];
		if (B[i] > A[i]) {
			sum += B[i] - A[i];
			ans++;
		} else {
			sum2 += A[i] - B[i];
			C.push_back(A[i] - B[i]);
		}
	}
	if (sum2 < sum) {
		puts("-1");
		return 0;
	}
	sort(C.begin(), C.end(), greater<int>());
	sum2 = 0;
	for (int e: C) {
		if (sum2 >= sum) {
			break;
		}
		sum2 += e;
		ans++;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 2936
import java.util.*;class Main{public static void main(String[]z){Scanner s=new Scanner(System.in);for(int n,a,h,u,v,k=1001;(n=s.nextInt())>0;System.out.println(a)){int[][]x=new int[k][n+1];n=s.nextInt();for(a=s.nextInt();n-->0;x[h][v]=u)x[h=s.nextInt()][u=s.nextInt()]=v=s.nextInt();for(n=k;n-->0;)a=(h=x[n][a])>0?h:a;}}}

Measured memory_bytes: 17000
def dfs(now,vis,G):
    visit_all = True
    for tf in vis:
        if not tf:
            visit_all = False
    if visit_all:
        return 1

    ret = 0
    for nx in G[now]:
        if vis[nx] == 0:
            nvis = vis[:]
            nvis[nx] = 1
            ret += dfs(nx,nvis,G)

    return ret

def main():
    n,m = map(int,input().split())

    G = [[] for _ in range(n)]
    for _ in range(m):
        a,b = map(int,input().split())
        a -= 1
        b -= 1
        G[a].append(b)
        G[b].append(a)

    vis = [0 for _ in range(n)]
    vis[0]=1
    return dfs(0,vis,G)

if __name__ == '__main__':
    print(main())


Measured memory_bytes: 3064
N,K,Q=map(int,input().split(" "))
A=[]
for _ in range(Q):
    A.append(int(input()))

ans=[K for _ in range(N)]
for q in A:
    ans[q-1]+=1
for a in ans:
    if a>Q:
        print("Yes")
    else:
        print("No")


Measured memory_bytes: 10480
#include<bits/stdc++.h> 
using namespace std;
int *a;
int dp[500001];
int n;
int f(int x){
    if(x==n+1)return 0;
else {dp[x]=min(dp[x-2]+abs(a[x-2]-a[x]), dp[x-1]+abs(a[x-1]-a[x]));return f(x+1);}
    
}
int main(){
 cin>>n;
 a=new int[n+1];
 for(int i=1;i<=n;i++){
     cin>>a[i];
 }
 dp[2]=abs(a[1]-a[2]);
 f(3);
 cout<<dp[n];
 return 0;
}


Measured memory_bytes: 1024