akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repe(i, n) for (int i = 0; i <= (int)(n); i++)
#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define ANS cout << ans << endl
#define all(a) a.begin(),a.end()
#define SORT(a) sort(all(a))
#define REVERSE(a) reverse(all(a))
#define int ll
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORe(i, m, n) for(int i = m;i <= n;i++)
#define VIin(a) for(int i=0; i<a.size(); i++) cin >> a[i]
#define OUT(a) cout << a << endl
#define IN(a) cin >> a
#define INT(a) int a; cin >> a
typedef vector<int> VI;
typedef vector<VI> VVI;
const int MOD=1e9+7;
const long long INF = 1LL << 60;
/*最大公約数*/int gcd(int x, int y) { return y ? gcd(y,x%y) : x;}
/*最小公倍数*/int lcm(int a, int b) { int g = gcd(a, b); return a / g * b; }
/*素数判定*/int isPrime(int n){if(n<2){return 0;}for(int i=2; i*i<=n; i++){if(n%i==0){return 0;}}return 1;}
/*約数列挙*/vector<int> getDivisor(int n){vector<int> v; for(int i=1; i*i<=n; i++){if(n%i==0){v.push_back(i);if(i!=n/i){v.push_back(n/i);}}}sort(v.begin(),v.end()); return v;}
//----------------------------------------------
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    INT(n);
    VI a(n),b(n);
    VIin(a);VIin(b);
    int ans = 0;
    rep(i,n){
        int sum = 0;
        repe(j,i) sum+=a[j];
        FOR(j,i,n) sum+=b[j];
        ans = max(ans,sum);
    }
    ANS;

    return 0;
}

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

using namespace std;

typedef long long ll;

int main(){
	int x;
	cin >> x;
	int sosu[47]={0};
	for(int i = 2; i <= x; i++){
		int ii = i;
		for(int j = 2; j <= 47; j++){
			if(ii%j==0){
				ii/=j;
				sosu[j]++;
				j--;
			}
		}
	}
	vector<int> th;
	vector<int> fi;
	vector<int> ft;
	vector<int> tf;
	vector<int> sf;
	for(int i = 2; i <= 47; i++){
		if(sosu[i] >= 2)th.push_back(i);
		if(sosu[i] >= 4)fi.push_back(i);
		if(sosu[i] >= 14)ft.push_back(i);
		if(sosu[i] >= 24)tf.push_back(i);
		if(sosu[i] >= 74)sf.push_back(i);
	}
	int ans = 0;
	for(int i = 0; i < (int)th.size(); i++){
		for(int j = 0; j < (int)tf.size(); j++)if(th[i] != tf[j])ans++;
	}
	for(int i = 0; i < (int)fi.size(); i++){
		for(int j = 0; j < (int)ft.size(); j++)if(fi[i] != ft[j])ans++;
	}
	ans+=(int)sf.size();
	for(int i = 0; i < th.size(); i++){
		for(int j = 0; j < fi.size(); j++){
			for(int k = j+1; k < fi.size(); k++)if(th[i] != fi[j] && th[i] != fi[k])ans++;
		}
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
while True:
    a = input()
    b = a.split()
    m = int(b[0])
    f = int(b[1])
    r = int(b[2])
    if m == -1 and f == -1 and r == -1:
        break
    elif m == -1 or f == -1:
        print("F")
    elif m + f >= 80:
        print("A")
    elif m + f >= 65:
        print("B")
    elif m + f >= 50:
        print("C")
    elif m + f >= 30:
        if r >= 50:
            print("C")
        else:
            print("D")
    else:
        print("F")



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

int main(){
  int N, Y;
  cin >> N >> Y;
  int ans10 = -1, ans5 = -1, ans1 = -1;
  bool flag = false;
  for(int i = 0; i <= N; i++){
    for(int j = 0; j <= N - i; j++){
      if(i*10000 + j*5000 + (N-i-j)*1000 == Y){
        ans10 = i;
        ans5 = j;
        ans1 = N-i-j;
        flag = true;
        break;
      }
    }
    if(flag) break;  
  }
  
  cout << ans10 << ' ' << ans5 << ' ' << ans1 << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define mod 1000000007
#define ll long long int
#define ar array
#define mp make_pair
using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	int w,h,n;
	cin>>w>>h>>n;
	int g =0,r =0,g2 = w, r2 = h;
	vector<int> a[4];
	for(int i =0, j,k,l ; i<n; i++)
	{
		cin>>j>>k>>l;
		if(l ==1)
			a[0].push_back(j);
		else if(l==2)
			a[1].push_back(j);
		else if(l==3)
			a[2].push_back(k);
		else a[3].push_back(k);
	}
	
	for(int i = 0;i< 4;i++)
		sort(a[i].begin(),a[i].end());

	if(a[0].size())
		g = *(--a[0].end());
	if(a[1].size())
		g2 = a[1][0];
	if(a[2].size())
		r = *(--a[2].end());
	if(a[3].size()) r2 = a[3][0];

	int area = (g2-g)*(r2-r);
	if(g2<=g || r2<=r)
		area =0;
	cout<<area<<endl;
	return 0;
}

Measured memory_bytes: 256
//#pragma once
#include <stdio.h>
#include <string>
#include <iostream>
#include <queue>
#include <algorithm>
#include <sstream>
#include <vector>
#include <math.h>
#include <set>
#include <numeric>

using namespace std;

typedef pair<long long, long long> pl;

long long N, M, k, a, b, c, d, e, H, W,X;
long long A[200000] = {};
long long B[365][365] = {};
bool f;
bool ff;
string S[100005];
set <long long>sll;
pl buf;
vector <long long>vl;

struct ST
{
	long long total;
	long long aki;
	long long itta;
};

vector <ST> vst;
ST st;

int main() {

	cin >> N;
	a = 0;

	for (long long i = 0; i < N; i++) {
		if (i*i >= N) {
			b = i;
			break;
		}
	}

	for (long long i = 1; i < b; i++) {
		if (N%i == 0) {
			c = N / i - 1;
			if (N/c==N%c) {
				a += N / i - 1;
			}
		}
	}
	cout << a << endl;
	
	return 0;
}

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

#define int long long
#define inf 1000000007LL

#define rep(i, n) for(int i = 0; i < (n); i++)
#define rrep(i, n) for(int i = (n) - 1LL; i >= 0; i--)
#define trep(i, n) for(int i = 0; i <= (n); i++)
#define rep1(i, n) for(int i = 1LL; i <= (n); i++)
#define mfor(i, s, t) for(int i = (s); i < (t); i++)
#define tfor(i, s, t) for(int i = (s); i <= (t); i++)
/*
class Dinic {
public:
  vector<vector<pair<int, int>>> v;
  vector<int> e;

  vector<int> k;
  vector<int> j;

  void init(int n) {
    v = vector<vector<pair<int, int>>>(n);
    e = vector<int>();
    k = vector<int>(n);
    j = vector<int>(n);
  }
  void add_edge(int a, int b, int atob, int btoa = 0) {
    v[a].push_back(make_pair(b, e.size()));
    e.push_back(atob);
    v[b].push_back(make_pair(a, e.size()));
    e.push_back(btoa);
  }
  void dyk(int s) {
    for(auto& i : k) {
      i = inf;
    }
    queue<pair<int, int>> pq;
    pq.push(make_pair(0, s));
    while(!pq.empty()) {
      int w = pq.front().first;
      int b = pq.front().second;
      pq.pop();
      if(k[b] > w) {
        k[b] = w;
        for(auto i : v[b]) {
          if(e[i.second] > 0) {
            pq.push(make_pair(w + 1LL, i.first));
          }
        }
      }
    }
  }
  int dfs(int s, int t, int p, int c) {
    if(p == t) {
      return c;
    }
    int all = 0;
    while(c > all && j[p] < v[p].size()) {
      if(k[v[p][j[p]].first] == k[p] + 1LL) {
        int r = dfs(s, t, v[p][j[p]].first, min(c - all, e[v[p][j[p]].second]));
        e[v[p][j[p]].second] -= r;
        e[v[p][j[p]].second ^ 1LL] += r;
        if(r < c - all) {
          j[p]++;
        }
        all += r;
      }
      else {
        j[p]++;
      }
    }
    return all;
  }
  int solve(int s, int t) {
    int all = 0;
    while(1LL) {
      dyk(s);
      for(auto& i : j) {
        i = 0;
      }
      int r = dfs(s, t, s, inf);
      if(r == 0) {
        return all;
      }
      all += r;
    }
  }
};
*/

signed main() {
  int a, b, c;
  cin >> a >> b >> c;
  if((a * 100 + b * 10 + c) % 4 == 0) {
    cout << "YES" << endl;
  }
  else {
    cout << "NO" << endl;
  }
}


Measured memory_bytes: 256
use std::io::*;
use std::str::FromStr;

fn main() {
    let w: f64 = read();
    let h: f64 = read();
    let x: f64 = read();
    let y: f64 = read();
    let po: f64 = w * h / 2.0;
    if x == w/2.0 && y == h/2.0 {
        println!("{} 1", po);
    } else {
        println!("{} 0", po);
    }
}

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}


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

int main() {
  int N;
  cin >> N;
  
 vector<int> A(N);
  
  for(int i=0; i<N; i++){
    cin >> A.at(i);
  } 
  
  sort(A.begin(), A.end());
  reverse(A.begin(), A.end());
  
  int a=0;
  int b=0;
  
   for(int i=0; i<N; i+=2){
    a+=A.at(i);
  } 
   for(int i=1; i<N; i+=2){
    b+=A.at(i);
  } 
  
  cout << a-b << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <queue>
#include <tuple>

using namespace std;
using PII = pair<int, int>;
using TUP = tuple<int, int, int>;

class UnionFind {
private:
	// parents[i] >= 0 なら i の親
	// parents[i] < 0 で、根。abs(parents[i])がその木に属する頂点数
	vector<int> parents;
	int n_root;

public:
	UnionFind();
	UnionFind(int n) {
		parents.assign(n, -1);
		n_root = n;
	}
	~UnionFind() {
		parents.clear();
	};

	int find(int x) {
		if (parents[x] < 0) {
			return x;
		} else {
			return parents[x] = find(parents[x]);
		}
	}

	void unite(int x, int y) {
		x = find(x);
		y = find(y);

		if (x == y) {
			return;
		}

		if (size(x) < size(y)) {
			swap(x, y);
		}

		parents[x] += parents[y];
		parents[y] = x;
		n_root--;
		return ;
	}

	bool same(int x, int y) {
		return find(x) == find(y);
	}

	// xが属する集団のサイズ
	int size(int x) {
		return -parents[find(x)];
	}

	// いくつの集団があるか
	int get_n_root() {
		return n_root;
	}
};

int main() {
	int nv, ne;
	cin >> nv >> ne;

	vector<vector<PII>> connect(nv);

	priority_queue<TUP, vector<TUP>, greater<TUP>> que;

	int s, t, w;
	for (int i = 0; i < ne; i++) {
		cin >> s >> t >> w;
		que.emplace(w, s, t);
	}

	UnionFind uf(nv);
	int ans = 0;
	while (!que.empty() || uf.get_n_root() > 1) {
		tie(w, s, t) = que.top();
		que.pop();

		if (uf.same(s, t)) {
			continue;
		}

		uf.unite(s, t);
		ans += w;
	}
	cout << ans << endl;
	return 0;
}



Measured memory_bytes: 4764
S = str(input())
li = list(S)

i=0
c=0
count=0

while len(li) > i :
    if int(li[i]) == c :
        count = count + 1
    c = c + 1
    c = c % 2
    i = i + 1
    
if len(li) / 2 < count : 
    ans = len(li) - count
else :
    ans = count

print(ans)

Measured memory_bytes: 3956
#include<bits/stdc++.h>
using namespace std;
#define int long long
template <class Q>
void clearQueue(Q & q) {
    q = Q();
}
void solve(){
	int n;cin>>n;
	vector<int>a(n);
	for(int& x:a) cin>>x;
	int cnt=0;
	for(int i=1;i<n;i++){
		if(a[i]<a[i-1]){
			cnt+=a[i-1]-a[i];
			a[i]=a[i-1];
		}
	}
	cout<<cnt;
} 
int32_t main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);cout.tie(NULL); 
	int T=1;
	// cin>>T;
	while(T--){
		solve();
	}
	return 0;
}


Measured memory_bytes: 4760
N = gets.to_i
A = gets.split.map(&:to_i)
MOD = 10 ** 9 + 7

result = 0
60.times do |i|
  base = 1 << i
  c = [0, 0]
  A.each do |a|
    c[a[i]] += 1
  end
  result += 2 * c[0] * c[1] * base
end

puts result / 2 % MOD


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

int main() {

        int x;
        cin >> x;

        //n = m % 10;

        if (x >= 30) {
                cout << "Yes" << endl;
        }
        /*else if (n == 0 || n == 1 || n == 6 || n == 8) {
                cout << "pon" << endl;
        }*/
        else{
                cout << "No" << endl;
        }

        return 0;
}

Measured memory_bytes: 3568
import scala.io.StdIn._

object Main extends App {


  val Array(h,n) = readLine().split(" ").map(_.toInt)
  val A = readLine().split(" ").map(_.toInt)

  def solve() = {
    if(h <= A.sum) "Yes" else "No"
  }

  println(solve())

}



Measured memory_bytes: 62388
#!/usr/bin/perl

my $s = scalar(<STDIN>);
my $r = 0;

if( $s =~ /^RRR/o ){
  $r = 3;
} elsif( $s =~ /^(?:RRS|SRR)/o ){
  $r = 2;
} elsif( $s =~ /R/o ){
  $r = 1;
}
print "$r\n";



Measured memory_bytes: 4824
N, K = map(int, input().split())
A = sorted(list(map(int, input().split())))
MOD = 10 ** 9 + 7


factorial = [1, 1]
inverse = [1, 1]
invere_base = [0, 1]
for i in range(2, N + 2):
    factorial.append((factorial[-1] * i) % MOD)
    invere_base.append((-invere_base[MOD % i] * (MOD // i)) % MOD)
    inverse.append((inverse[-1] * invere_base[-1]) % MOD)


def nCr(n, r):
    if not 0 <= r <= n:
        return 0
    return factorial[n] * inverse[r] * inverse[n - r] % MOD


MAX, MIN = 0, 0
for i, a in enumerate(A):
    MAX += a * nCr(i, K - 1)
    MIN += a * nCr(N - i - 1, K - 1)
    MAX %= MOD
    MIN %= MOD

print((MAX - MIN) % MOD)


Measured memory_bytes: 25736
#include <iostream>


using namespace std;

int solve(int n){
  int e = 1e6;
  for (int i = 0; i*i*i <= n ; ++i)
  {
    for (int k = 0; k*k <= n - i*i*i; ++k)
    {
      e = min(e, n-i*i*i-k*k+i+k);
    }
  }
  return e;
}


int main(){
  int n;
  while(true){
    cin >> n;
    if (n == 0)
    {
      break;
    }
    cout << solve(n) << endl;
  }
}

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

long double d(long double x, long double y)
{
  return sqrtl(x * x + y * y);
}

int main()
{
  int64_t N, ans = 0;
  long double D, x, y;
  cin >> N >> D;
  for (int i = 0; i < N; i++)
  {
    cin >> x >> y;
    if (d(x, y) <= D)
    {
      ans++;
    }
  }
  cout << ans << endl;
}

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

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

using namespace std;

int main() {
    int a,b,c;
    cin >> a >> b >> c;
    if(b > a * c){
        cout << c << endl;
    }else{
        cout << b / a << endl;
    }
    return 0;
}



Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        String input = new Scanner(System.in).nextLine();
        String[] inputs = input.split("\\s+");
        int a = Integer.parseInt(inputs[0]);
        int b = Integer.parseInt(inputs[1]);
        if (a < b) {
            System.out.println("a < b");
        } else if (a > b) {
            System.out.println("a > b");
        } else {
            System.out.println("a == b");
        }
    }
}



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

int main(){
  ll n;
  cin >> n;
  if(n==0){
   cout << 0 << endl;
    return 0;
  }
  deque<ll>deq;
  while(n!=0){
    if(n%-2==0){
      deq.push_front(0);
    }
    if(n%-2!=0){
      n--;
      deq.push_front(1);
    }
    n/=-2;
  }
  while(deq.front()==0) deq.pop_front();
  while(deq.size()!=0){
    cout << deq.front();
    deq.pop_front();
  }
}


Measured memory_bytes: 256
import java.util.Arrays;
import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.Scanner;

//Highway Express Bus
public class Main{

	static int[][] dist;
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(true){
			int c = sc.nextInt();
			int n = sc.nextInt();
			int m = sc.nextInt();
			int s = sc.nextInt();
			int d = sc.nextInt();
			if((c|n|m|s|d)==0)break;
			s--;
			d--;
			int[][] e = new int[n][n];
			for(int[]ee:e)Arrays.fill(ee, 1<<28);
			while(m--!=0){
				int a = sc.nextInt()-1;
				int b = sc.nextInt()-1;
				int cos = sc.nextInt();
				e[a][b]=e[b][a]=cos;
			}
			dist = new int[c+1][n];
			for(int[] dd:dist)Arrays.fill(dd, 1<<28);
			dist[c][s] = 0;
			PriorityQueue<int[]> q = new PriorityQueue<int[]>(n, new Comparator<int[]>() {
				public int compare(int[] o1, int[] o2) {
					return dist[o1[0]][o1[1]]-dist[o2[0]][o2[1]];
				}
			});
			q.add(new int[]{c,s});
			while(!q.isEmpty()){
				int[] a = q.poll();
				int u = a[0];
				int v = a[1];
				if(v==d){
					System.out.println(dist[u][v]);
					break;
				}
				for(int k=0;k<n;k++){
					if(e[v][k]==1<<28)continue;
					int w = dist[u][v]+e[v][k];
					if(w<dist[u][k]){
						dist[u][k] = w;
						q.add(new int[]{u,k});
					}
					if(u>0){
						w = dist[u][v]+e[v][k]/2;
						if(w<dist[u-1][k]){
							dist[u-1][k] = w;
							q.add(new int[]{u-1,k});
						}
					}
				}
			}
		}
	}
}

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

A = [int(s) for s in input().split()]

MOD = 10**9 + 7
sums = [A[0]]
for a in A[1:]:
    sums.append((a + sums[-1]) % MOD )

alls = 0
for i in range(1, len(A)):
    # print(A[i], sums[i-1])
    alls += A[i] * sums[i-1]
    alls %= MOD
print(alls)

Measured memory_bytes: 31436
#include<bits/stdc++.h>
using namespace std;
const int N=2e5+5;
typedef long long ll;
int n,a[N],b[N],c[N],d[N];
int main()
{
    scanf("%d",&n);for(int i=1;i<=n;i++) scanf("%d",&a[i]);
    long long sum=0;
    sort(a+1,a+1+n,greater<int>());
    int t=1,tot=0;
    for(int i=2;i<=n;i++)
        if(a[i]==a[i-1]) t++;
    else
    {
        b[++tot]=t;c[tot]=a[i-1];
        t=1;
    }
    b[++tot]=t;c[tot]=a[n];
    sum=(ll)c[1]*(b[1]-1);d[1]=b[1];
    int l=1;
    for(int i=2;i<=tot;i++)
    {
        while(b[i])
        {
            while(l<i&&!d[l]) l++;
            if(l==i)
            {
                sum+=(ll)c[i]*b[i];
                d[i]+=b[i];
                b[i]=0;
            }
            else
            {
                ll k=min(b[i],d[l]);
                sum+=k*c[l];
                d[l]-=k;b[i]-=k;
                d[i]+=k*2;
            }
        }
    }
    printf("%lld\n",sum);
}


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

#define ll long long

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

    string s;
    cin >> s;
    ll k;
    cin >> k;

    for (ll i = 0; i < k; i++){
        if (s[i] != '1'){
            cout << s[i] << endl;
            return 0;
        }
    }

    cout << '1' << endl;

    return 0;
}



Measured memory_bytes: 256
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<algorithm>
using namespace std;
int main()
{
	int x, y;
	scanf("%X %X", &x, &y);
	if(x<y)
	{
		printf("<\n");
	}
	else if(x>y)
	{
		printf(">\n");
	}
	else
	{
		printf("=\n");
	}
	return 0;
}


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

using namespace std;
typedef long long ll;
typedef long int li;
typedef long double lb;
#define rep(i,j,n) for (ll i = j; i < (n); i++)
#define repr(i,j,n) for(ll i = j; i >= (n); i--)
#define all(x) (x).begin(),(x).end()
#define CLR(mat,f) memset(mat, f, sizeof(mat))
#define IN(a, b, x) (a<=x&&x<b)
#define out(ans) cout << ans << endl
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; }
typedef pair<ll,ll>P;
const ll mod=1e9+7;
const ll INF = 1LL<<60;

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

int main(){

  ll h,w;cin>>h>>w;
  string s;
  string alf="";
  ll num=0;
  rep(i,0,h){
    rep(j,0,w){
      cin>>s;
      if(s=="snuke"){
        alf=char('A'+j);
        num+=(i+1);
      }
    }
  }

  out(alf<<num);

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
using namespace std;
int n,a[200005],f[200005];
bool check(int x)
{
	for(int i=1;i<=2*n-1;i++)
	{	
	  if(a[i]>x)f[i]=1;
	  else f[i]=0;
	}
    for(int i=1;i<=n;i++)
    {
    	 if(f[n-i]==f[n-i+1])
    	 {
    	 	if(f[n-i]==0)return 0;
    	 	else return 1;
		 }
    	 if(f[n+i]==f[n+i-1])
    	 {
    	    if(f[n+i]==0)return 0;
    	 	else return 1;	
		 }
    }
    if(f[1]==0)return 0;
    return 1;
}
int main()
{

	int maxx=0;
	cin>>n;
	for(int i=1;i<=2*n-1;i++)
	{	scanf("%d",&a[i]);
	    if(a[i]>maxx)maxx=a[i];
	}
	int l=1,r=maxx;
	while(l<r)
	{
		int mid=l+r>>1;
		if(check(mid))l=mid+1;
		else r=mid;
	}
	cout<<l<<endl;
	return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
 
//DEFINE and TYPEDEF--------------------------------------------------------------
 
#define timeKyaHorhaH 1.0 * clock() / CLOCKS_PER_SEC

#define FORG(i,a,n) for(lld i=a;i<n;i++) //for - general
#define FORZ(i,n) for(lld i=0;i<n;i++) //for - zero
#define FORGI(i,a,n,inc) for(lld i=a;i<n;i+=inc) //for - general incremental
#define FORZI(i,n,inc) for(lld i=0;i<n;i+=inc) //for - zero incremental
#define SPEEDUP ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
#define MEM(a,val) memset(a,val,sizeof(a));
 
#define SORTall(m) sort(m.begin(),m.end());
 
#define st first
#define nd second
#define pb push_back
 
typedef long long int lld;
typedef unsigned long long int ulld;
 
//DEBUGGER------------------------------------------------------------------------
// #define DEBUG(x) cerr<<(#x)<<" is "<<(x)<<"\n" //to debug values of variables
// #define DEBUGON
#define ZINDA cerr<<"\nIdhar-ich hai apun!!\n"; //to debug if code reached that point

vector<string> vec_splitter(string s) {
	for(char& c: s) c = c == ',' ?  ' ': c;
	stringstream ss; ss << s;
	vector<string> res;
	for(string z; ss >> z; res.push_back(z));
	return res;
}

void debug_out(vector<string> args, int idx) { cerr << endl; }
template <typename Head, typename... Tail>
	void debug_out(vector<string> args, int idx, Head H, Tail... T) {
		if(idx > 0) cerr << ", ";
		stringstream ss; ss << H;
		cerr << args[idx] << " = " << ss.str();
		debug_out(args, idx + 1, T...);
	}

#ifdef DEBUGON
	#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __VA_ARGS__);
	#define DEBUG(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __VA_ARGS__);	
#else
	#define debug(...) 320;
	#define DEBUG(...) 320;
#endif

lld power(lld b, lld e)
{
    if(e==0)
        return 1;
    if(e%2==1)
        return b*power(b*b,(e-1)/2);
    else
        return power(b*b,e/2);
}
 
lld power(lld b, lld e, lld m)
{
	if(e==0)
		return 1;
	if(e%2==1)
		return b*power(((b%m)*(b%m))%m,(e-1)/2,m)%m;
	else
		return power(((b%m)*(b%m))%m,e/2,m)%m;
}
 
int nDig(lld n)
{
	if(n<0) 
		n*=-1;
	if(n==0)
		return 1;

    return floor(log10(n) + 1);
}

#define endl '\n'
#define mod 1000000007

//endl : changed to '\n', to flush comment that definition
//--------------------------------------------------------------------------------

void swagWaalaFunction()
{
	lld n;
	cin>>n;

	set<string> s;
	string ss;
	FORZ(i,n)
	{
		cin>>ss;
		s.insert(ss);
	}

	cout<<s.size();
	return;
}

int main()
{
    SPEEDUP;
 	lld t=1;
 	//cin>>t;

 	while(t--)
 		swagWaalaFunction();
	
	// cerr<<"\n"<<timeKyaHorhaH; 	
 	return 0;
}

Measured memory_bytes: 19244
#include <bits/stdc++.h>
#define pii pair<int,int>
#define eb emplace_back
#define MOD 1000000007
#define int long long
using namespace std;
#define s second
#define f first

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    
    int n, k;  cin >> n >> k;
    int A[n], c = 0;
    for(int i=0;i<n;i++)
    {
        cin >> A[i];
        if( A[i] > 0 )
            c++;
    }
    int ans=1;
    if( k == n )
        for(int i=0;i<n;i++)
            ans = ans * A[i] % MOD;
    else if( c==0 and k&1 )
    {
        partial_sort(A, A+k, A+n, greater<int>());
        for(int i=0;i<k;i++)
            ans = ans * A[i] % MOD;
    }
    else {
    sort(A, A+n, [](int a, int b){
        return abs(a)>abs(b);
    });
    deque<int> q;
    bool neg = false;
    for(int i=0;i<k;i++)
    {
        if( A[i] < 0 )
            neg = !neg,
            q.emplace_front(A[i]);
        else
            q.emplace_back(A[i]);
    }
    if( neg )
    {
        int x1, x2, y1, y2;
        y1 = y2 = 0;

        x1 = q.front() < 0 ? q.front() : 0;
        x2 = q.back() > 0 ? q.back() : 0;

        for(int i=k;i<n;i++)
        if( A[i] >= 0 ) {
            y1 = A[i]; break;
        }
        for(int i=k;i<n;i++)
        if( A[i] <= 0 ) {
            y2 = A[i]; break;
        }
        if( abs(x1*y2) < abs(x2*y1)  or x2 == 0 or y2 == 0)
            q.pop_front(),
            q.push_back(y1);
        else
            q.pop_back(),
            q.push_back(y2);
    }
    while(!q.empty())
    {
        ans = ans * q.front() % MOD;
        q.pop_front();
    }
    }
    cout << (ans+MOD)%MOD;
}

Measured memory_bytes: 6824
def inpl(): return [int(i) for i in input().split()]

N = int(input())
xyh = []
for _ in range(N):
    xyh.append(inpl())
for x, y, h in xyh:
    if h:
        tx, ty, th = x, y, h
        break
    
for i in range(101):
    for j in range(101):
        cx, cy, ch  = i, j, (th + abs(i-tx) + abs(j-ty))
        for kx, ky, kh in xyh:
            if max(0, ch - abs(cx-kx) - abs(cy-ky)) != kh:
                break
        else:
            print(cx, cy, ch)
            break
    else:
        continue
    break


Measured memory_bytes: 3064
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define ll long long

int max(int aa, int bb);

int main(void) {
    int a_len,b_len,itr,itrA,itrB,dp[4055][4055],tmp,piv_x,piv_y,piv_ans=0,ans_len;
    char a_str[4055],b_str[4055], ans[4055] = "";
    scanf("%s %s",a_str,b_str);
    //配列の長さを取得
    a_len = strlen(a_str);
    b_len = strlen(b_str);
    //初期化
    for(itr = 0;itr <= a_len; itr++){
        dp[itr][0] = 0;
    }
    for(itr = 0;itr <= b_len; itr++){
        dp[0][itr] = 0;
    }
    /*
    dpの計算
    三通りあるので、それらの最大値を取る
    */
    for(itrA = 1;itrA <= a_len; itrA++){
        for(itrB = 1;itrB <= b_len; itrB++){
            dp[itrA][itrB] = max(dp[itrA][itrB-1],dp[itrA-1][itrB]);
            if(a_str[itrA-1]==b_str[itrB-1]){
                tmp = dp[itrA-1][itrB-1] + 1;
                dp[itrA][itrB] = max(dp[itrA][itrB],tmp);
            }
        }
    }
    //右下から探索を始める
    piv_x = a_len;
    piv_y = b_len;
    
    while(piv_x != 0 && piv_y != 0){
        if(dp[piv_x][piv_y] == dp[piv_x-1][piv_y]){
            piv_x--;
        }
        else if(dp[piv_x][piv_y] == dp[piv_x][piv_y-1]){
            piv_y--;
        }
        else{
            //左上なのでansに追加
            ans[piv_ans] = a_str[piv_x-1];
            piv_ans++;
            piv_y--;
        }
    }
    ans_len = strlen(ans);
    //反転しながら出力
    for(itr = ans_len-1;itr >= 0; itr--){
        printf("%c",ans[itr]);
    }
    printf("\n");
    
    return 0;
}
//maxを計算する関数
int max(int aa, int bb) {
    if (aa > bb)
        return aa;
    else
        return bb;
}


Measured memory_bytes: 49408
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<stack>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<int,pii> pip;
typedef vector<pip>vip;
const double PI=acos(-1);
const double EPS=1e-7;
const int inf=1e8;
const ll INF=1e16;
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
int n,m;
vvi G,dp;
void dfs(int a,int b,int c){
	if(b<0||dp[a][b])return;
	dp[a][b]=c;
	dfs(a,b-1,c);
	rep(i,G[a].size())dfs(G[a][i],b-1,c);
}
int main(){
	cin>>n>>m;
	G=vvi(n);
	rep(i,m){
		int a,b;cin>>a>>b;
		a--;b--;
		G[a].pb(b);
		G[b].pb(a);
	}
	int q;
	cin>>q;
	vvi in(q+1,vi(3));
	rep(i,q)rep(j,3)cin>>in[i+1][j];
	dp=vvi(n,vi(20));
	for(int i=q-1;i>=0;i--)dfs(in[i+1][0]-1,in[i+1][1],i+1);
	rep(i,n)cout<<in[dp[i][0]][2]<<endl;
}








Measured memory_bytes: 23672
#include<iostream>
#include<algorithm>
using namespace std;
static const int MAX = 200000;

int main(){
	int n;
	cin >> n;
	int r[MAX];
	for (int i = 0; i < n; i++) {
		cin >> r[i];
	}
	int maxp = r[1] - r[0];
	int minv = r[0];
	for (int j = 1; j < n; j++) {
		minv = min(minv, r[j - 1]);
		maxp = max(maxp, r[j] - minv);
	}
	cout << maxp << endl;

	return 0;
}



Measured memory_bytes: 3880
#include <bits/stdc++.h>
#define Rep(i,n) for(int i=0;i<n;i++)
#include <math.h>
using namespace std;
typedef int64_t intl;


intl modpow(intl a, intl n, intl p){
  intl res = 1;
  while (n > 0){
    if (n&1){res = (res * a) % p;}
	a = (a * a) % p;
    n >>= 1;
  }
  return res;
}

intl modinv(intl a, intl p){
  if (a==0){
    cout << "/0 at modinv"<<endl;
    exit(0);
  }
  if (a < 0){
    cout << "/- at modinv" <<endl;
    exit(0);
  }
  if (a==1){return 1;}
  if (a > p){return modinv(a%p, p);}

  return p - ( modinv(p%a,p) * (p/a) ) % p;
}

intl modcomb(intl n, intl k, intl p){
  if (k > n || k < 0 || n < 0){
    cout << "error at modcomb"<<endl;
    exit(0);
  }
  if (2*k > n){ k = n-k;}
  if (k ==0){return 1;}
  intl c=1;
  for (intl i = 0; i < k; i++){
    c =( c * ( (n-i) % p ) % p ) * modinv(i+1,p) % p;
  }
  return c;
}

int main(){
  intl mod = 1000000007;
  double R;
  cin >> R;
  cout << M_PI * R *2 ;
}

Measured memory_bytes: 3788
#include <bits/stdc++.h>
#define INF 2000000000000000000
#define ll long long
#define pb push_back
using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  ll N, M;
  cin >> N >> M;
  if (N == M) {
    cout << "Yes" << "\n";
  }
  else {
    cout << "No" << "\n";
  }
}


Measured memory_bytes: 3576
N = int(input())
T = [int(input()) for i in range(N)]

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

def lcm(a, b):
	return a * b // gcd (a, b)

ans = 1
for i in range(N):
    ans = lcm(ans, T[i])
print(ans)

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
const int maxn=5e5+5;
int c[26][maxn]; char s[maxn]; int n;
inline int lowbit(int x) { return x&-x; }
inline int sum(int pos,int x) { int res=0; for(int i=pos;i;i-=lowbit(i)) res+=c[x][i]; return res; }
inline void update(int pos,int x,int val) { for(int i=pos;i<=n;i+=lowbit(i)) c[x][i]+=val; }
int main(void)
{
	scanf("%d",&n); scanf("%s",s+1);
	for(int i=1;i<=n;i++)
	{
		int x=s[i]-'a';
		update(i,x,1);
	}
	int q; scanf("%d",&q);
	while(q--)
	{
		int opt; int pos,l,r; char cc;
		scanf("%d",&opt);
		if(opt==1)
		{
			scanf("%d %c",&pos,&cc);
			update(pos,s[pos]-'a',-1);
			s[pos]=cc;
			update(pos,s[pos]-'a',1);
		}
		else
		{
			scanf("%d%d",&l,&r);
			int res=0;
			for(int i=0;i<26;i++)
			{
				int x=sum(r,i)-sum(l-1,i);
				if(x) res++;
			}
			printf("%d\n",res);
		}
	}
	return 0;
}

Measured memory_bytes: 51584
#include <iostream>
#include <vector>
#include <algorithm>
#include <string.h>

using namespace std;

typedef pair<int, int> obj;

int main(){
  int N, W, weight, value;
  char ch;
  int case_num = 1;

  while(1){
    cin >> W;
    if(W == 0) break;
    cin >> N;

    vector<obj> obj_list;
    int dp[1010];
    memset(dp, -1, sizeof(dp));
    
    for(int i = 0; i < N; i++){
      cin >> value >> ch >> weight;
      obj_list.push_back(obj(value, weight));
    }

    dp[0] = 0;

    for(int i = 0; i < N; i++){
      obj o = obj_list[i];

      for(int j = W - o.second; j >= 0; j--){
        if(dp[j] != -1){
          dp[j+o.second] = max(dp[j+o.second], dp[j] + o.first);
        }
      }
    }
    int answer = 0;
    int answer_weight = 0;

    for(int i = 0; i <= W; i++){
      if(answer < dp[i]){
        answer = dp[i];
        answer_weight = i;
      }
    }

    cout << "Case " << case_num << ":" << endl;
    cout << answer << endl;
    cout << answer_weight << endl;

    case_num++;
  }

  return 0;
}

Measured memory_bytes: 1216
#include <stdio.h>
#include <stdlib.h>
 
int main(void){
 
  char str[4];
 
  int i;
  scanf("%c %c %c",&str[0],&str[1],&str[2]);
  str[3] = '\0';
 
  if(atoi(str)%4 == 0){
    printf("YES");
  }else{
    printf("NO");
  }
 
  return 0;
 
}


Measured memory_bytes: 128
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {
    public static void main(String[] args) {
        try (InputReader in = new InputReader(); PrintWriter out = new PrintWriter(System.out)) {
            new Main().solve(in, out);
            out.flush();
        }
    }

    int[] rootFrom;

    private void solve(InputReader in, PrintWriter out) {
        int n = in.nextInt();
        int m = in.nextInt();

        rootFrom = new int[n];
        for (int i = 0; i < n; i++) {
            rootFrom[i] = i;
        }

        for (int i = 0; i < m; i++) {
            int x = in.nextInt() - 1;
            int y = in.nextInt() - 1;
            int z = in.nextInt();

            unite(x, y);
        }

        Set<Integer> ansSet = new HashSet<>(n);
        for (int i = 0; i < n; i++) {
            ansSet.add(calcRoot(i));
        }

        out.println(ansSet.size());
    }

    int calcRoot(int node) {
        if (rootFrom[node] == node) {
            return node;
        }

        rootFrom[node] = calcRoot(rootFrom[node]);
        return calcRoot(rootFrom[node]);
    }

    void unite(int x, int y) {
        int xroot = calcRoot(x);
        int yroot = calcRoot(y);

        rootFrom[xroot] = yroot;
    }
}

class InputReader implements AutoCloseable {
    private final Scanner sc = new Scanner(System.in);

    String next() {
        return this.sc.next();
    }

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

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

    double nextDouble() {
        return Double.parseDouble(this.sc.next());

    }

    @Override
    public void close() {
        this.sc.close();
    }
}


Measured memory_bytes: 64152
#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,k) for(int i=j;i<=k;++i)
typedef long long ll;
char cch;
inline ll rd(){
	ll x=0,fl=1;
	cch=getchar();
	while(cch>'9'||cch<'0'){
		if(cch=='-') fl=-1;
		cch=getchar();
	}
	while(cch>='0'&&cch<='9') x=(x<<3)+(x<<1)+cch-'0',cch=getchar();
	return x*fl;
}
const int N=1e5+3;
struct abc{
	int i;
	ll d;
}a[N];
int fr[N],head[N],to[N],nxt[N],cnt,sz[N];
ll re,c[N];
inline bool cmp(const abc &a,const abc &b){
	return a.d<b.d;
}
inline void adde(int u,int v){
	to[++cnt]=v,fr[cnt]=u,nxt[cnt]=head[u],head[u]=cnt;
}
inline void dfs(int u,int fa,int dep){
	re+=dep;
	for(int i=head[u];i;i=nxt[i]){
		dfs(to[i],u,dep+1);
	}
}
int main(){
	int n;
	scanf("%d",&n);
	rep(i,1,n) a[i].d=rd(),a[i].i=i,sz[i]=1;
	sort(a+1,a+1+n,cmp);
	rep(i,1,n) c[i]=a[i].d;
	int pos;
	ll tmp;
	for(int i=n;i>1;--i){
		tmp=a[i].d-(n-sz[a[i].i])+sz[a[i].i];
		pos=lower_bound(c+1,c+n+1,tmp)-c;
		if(c[pos]!=tmp||tmp>a[i].d){
			puts("-1");return 0;
		}
		else sz[a[pos].i]+=sz[a[i].i],adde(a[pos].i,a[i].i);
	}
	dfs(a[1].i,0,0);
	if(re!=a[1].d){
		puts("-1");return 0;
	}
	for(int i=1;i<n;++i){
		printf("%d %d\n",fr[i],to[i]);
	}
}

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

int main(){
  int N,X;
  cin >> N >> X;
  vector<int> bound(N);
  for(int i = 0;i < N;i++){
    cin >> bound.at(i);
  }
  int D = 0;
  int DD;
  int count = 1;
  for(int i = 1;i <= N;i++){
    DD = D + bound.at(i - 1);
    D = DD;
    if(DD <= X){
      count++;
    }else{
      break;
    }
  }
  cout << count << endl;
}


Measured memory_bytes: 3620
#include<iostream>
#include<cstdio>
#include<cstring>
#include<queue>
#include<stack>
#include<cmath>
#include<algorithm>
#include<map>
typedef long long ll;
using namespace std;
#define INF 0x3f3f3f3f
/**
*超时有可能是输入的问题
*注意边界
*仔细读题
*没思路试试逆向思维
**加油，奥利给！！！ 
**/
map<int,int>p;
/*struct knd{
	int x,y,z;
}s[200000];*/ 
int a[200000];
int main()
{
	int m,n,i,j,t,k,w,e;
	cin>>n;
	int s=0;
	char l[200000];
	for(i=1;i<=n;i++) 
	{
		cin>>l[i];
		if(l[i]=='R')s++;
	}
	w=s;
	for(i=1;i<=w;i++)
	{
		if(l[i]=='R')s--;
	}
	cout<<s;
 } 

Measured memory_bytes: 3428
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<vector<int>> g(n);
  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
    --a;
    --b;
    g.at(a).push_back(b);
    g.at(b).push_back(a);
  }
  vector<int> sign(n);
  vector<bool> seen(n);
  queue<int> q;
  q.push(0);
  while (!q.empty()) {
    int v = q.front();
    q.pop();
    for (int x : g.at(v)) {
      if (!seen.at(x)) {
        sign.at(x) = v;
        q.push(x);
        seen.at(x) = true;
      }
    }
  }

  cout << "Yes" << endl;
  for (int i = 1; i < n; ++i) {
    cout << sign.at(i) + 1 << endl;
  }
  return 0;
}


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

int N,M,L;
int P[111],T[111],V[111];

double Time[111][111];
double pa[111][111];
double ncr[111][111];

const double EPS = 1E-9;
const double INF = 1E50;

void getncr(){
  for(int i=0;i<=100;i++) ncr[i][i] = ncr[i][0] = 1LL;
  for(int i=2;i<=100;i++)
    for(int j=1;j<i;j++)
      ncr[i][j] = ncr[i-1][j] + ncr[i-1][j-1];
      	
}

int main(){
  cin >> N >> M >> L;
  for(int i=0;i<N;i++){
    cin >> P[i] >> T[i] >> V[i];
  }

  getncr();

  for(int i=0;i<N;i++){
    double ka = 1.0f;

    if( P[i] == 100 ){
      for(int j=0;j<=M;j++){
	if( V[i] == 0 )
	  Time[i][j] = INF;
	else
	  Time[i][j] = (double)L / (double)V[i] + (double)T[i]*(double)j;	
	pa[i][j] = 0.0f;
      }      
      pa[i][M] = 1.0f;
    } else {
      for(int l=0;l<M;l++){
	ka *= (double)(100-P[i])/100.0;
      }
      //  cout <<i << endl;
      for(int j=0;j<=M;j++){
	if( V[i] == 0 )
	  Time[i][j] = INF;
	else
	  Time[i][j] = (double)L / (double)V[i] + (double)T[i]*(double)j;
	
	if( ka > 1.0 - EPS ) pa[i][j] = 1.0f;
	else pa[i][j] = ka*ncr[M][j];  
	
	ka /= (double)(100-P[i])/100.0;
	ka *= (double)P[i]/100.0;       
      }
    }
  }

  for(int i=0;i<N;i++){
    double res = 0.0f;
    for(int j=0;j<=M;j++){

      double H = Time[i][j];
      double ret = 1.0f;
      for(int k=0;k<N;k++){
	if( i == k ) continue;
	double kk = 0.0f;

	for(int l=0;l<=M;l++){
	  // cout << H << " " << Time[k][l] << " " << pa[k][l] << endl;
	  if( Time[k][l] > H+EPS ){
	    //      cout << pa[k][l] << endl;
	    kk += pa[k][l];
	  }
	}

	//	cout << "k= " << k << " "<< kk << endl;
	ret *= kk;
      }
      // cout << "i , j = " << i << " "<< j << " "<< ret << " * " << pa[i][j] << " "<< ret*pa[i][j] << endl;
      res += ret*pa[i][j];
    }

     printf("%.10lf\n",res);
  }

}

Measured memory_bytes: 1456
def main():
    l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
    k = int(input())
    print(l[k-1])

main()

Measured memory_bytes: 2940
package main

import (
	"fmt"
	"math"
)

func main() {
	var N, K int
	fmt.Scan(&N, &K)

	ans := int(math.Pow(float64(N/K), 3))
	if K%2 == 0 {
		c := N / K
		if N%K >= (K / 2) {
			c++
		}
		ans += int(math.Pow(float64(c), 3))
	}
	fmt.Println(ans)
}


Measured memory_bytes: 1840
s=input()
x,y=list(map(int,input().split()))
dx=[]
dy=[]
first=True
move=0
xf=0
dir=0
for i in s:
    if(i=="F"):
        move+=1
    else:
        if(first):
            xf = move
            first=False
        else:
            if(dir%2==0):
                dx.append(move)
            else:
                dy.append(move)
        dir+=1
        move=0

if(dir%2==0):
    if(first):
        xf = move
    else:
        dx.append(move)
else:
    dy.append(move)
cx=0
cy=0
x-=xf
for i in sorted(dx,reverse=True):
    if x>=cx:
        cx+=i
    else:
        cx-=i

for i in sorted(dy,reverse=True):
    if y>=cy:
        cy+=i
    else:
        cy-=i
#print(sorted(dx,reverse=True),sorted(dy,reverse=True))
if(cx==x and cy==y):
    print("Yes")
else:
    print('No')


Measured memory_bytes: 3188
#include <bits/stdc++.h>
 
using namespace std;
 
// max 16
int main() {
    string N;
    cin >> N;
    bool f=false;
    int ans=0;
    int t=0;
    for(auto c: N) {
        if(c=='A'||c=='C'||c=='G'||c=='T'){
            if(f) {
                t++;
            } else {
                f = true;
                t=1;
            }
        } else {
            f=false;
            t=0;
        }
        ans = max(t, ans);
    }
    cout << ans;
}

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

#define ll long long
#define INF 1e9
#define mt make_tuple

typedef tuple <ll, ll, ll> Tlll;

vector <Tlll> dia;
vector <vector <ll> > dis;

int n;
ll dp(int w, int l) {
    if (w == n) return 0;
    int a, b, c;
    tie(a, b, c) = dia[w];
    // cout << a << b << c << endl;
    if (dis[w][l] != 0) return dis[w][l];

    if (l != 0) dis[w][l] = max(dis[w][l], dp(w+1, 0) + a);
    if (l != 1) dis[w][l] = max(dis[w][l], dp(w+1, 1) + b);
    if (l != 2) dis[w][l] = max(dis[w][l], dp(w+1, 2) + c);
    return dis[w][l];
}

int main() {
    cin >> n;

    dia.assign(n, mt(0, 0, 0));
    for (int i = 0; i < n; i++) {
        int a, b, c;
        scanf("%d%d%d", &a, &b, &c);
        dia[i] = mt(a, b, c);
    }

    dis.assign(n, vector<ll>(3, 0));
    ll aux = dp(0, 0);
    dis.assign(n, vector<ll>(3, 0));
    aux = max(aux, dp(0, 1));
    dis.assign(n, vector<ll>(3, 0));
    aux = max(aux, dp(0, 2));
    printf("%lld\n", aux);
}


Measured memory_bytes: 15872
// B - Counting of Trees

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// const int INF = 2147483647;
// const ll INF = 9223372036854775807;
const ll MOD = 998244353;

ll mod_pow(ll a, ll n, ll mod) {
	ll result = 1;
	while (n > 0) {
		if (n & 1) result = result * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return result;
}

int D[100000];

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

	unordered_map<int, int> cnt;
	int max_D = -1;
	for (int i=0; i<N; i++) {
		cin >> D[i];
		cnt[D[i]]++;
		max_D = max(max_D, D[i]);
	}

	if (D[0] != 0 || cnt[0] > 1) {
		cout << 0 << endl;
		return 0;
	}

	ll ans = 1;

	for (int i=1; i<=max_D; i++) {
		if (cnt[i] == 0) {
			ans = 0;
			break;
		}

		ans = ans * mod_pow(cnt[i-1], cnt[i], MOD) % MOD;
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 7704
#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll a[100005];
int k,first=1,last=9;
int main()
{
	cin>>k;
	for(int i=1;i<=9;i++)a[i]=i;
	if(k<=9)
	{
		cout<<a[k];return 0;
	}
	while(1)
	{
		ll t=a[first];
		for(int i=-1;i<=1;i++)
		{
			if(t%10==0&&i==-1)continue;
			if(t%10==9&&i==1)continue;
			ll nt=t*10+t%10+i;
		    a[++last]=nt;
		    if(last>=k)
		    {
		    	cout<<a[k];return 0;
			}
		}
		first++;
	}
    return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <cstring>
#include <sstream>
using namespace std;

int n, m;
string cand[22];
vector<string> words;

vector<int> match[82];
int matchBit[82];

vector<char> ansKey;
int ansFlg;

bool matches(string a, string b){
  if(a.size() != b.size()) return false;
  char trans[128];
  memset(trans, -1, sizeof(trans));
  for(int i = 0; i < a.size(); i++){
    if(trans[a[i]] != -1 && b[i] != trans[a[i]]) return false;
    if(trans[b[i]] != -1 && a[i] != trans[b[i]]) return false;
    trans[a[i]] = b[i];
    trans[b[i]] = a[i];
  }
  return true;
}

bool mycmp(const string &a, const string &b){
  set<char> st1;
  for(int i = 0; i < a.size(); i++) st1.insert(a[i]);
  set<char> st2;
  for(int i = 0; i < b.size(); i++) st2.insert(b[i]);

  return st1.size() > st2.size();
}

bool setKey(const string &a, const string &b, vector<char> &key){
  for(int i = 0; i < a.size(); i++){
    if(key[a[i]] != -1 && key[a[i]] != b[i] ||
       key[b[i]] != -1 && key[b[i]] != a[i]){
      return false;
    }
    key[a[i]] = b[i];
    key[b[i]] = a[i];
  }
  return true;
}

void dfs(int idx, int used, vector<char> key){
  if(idx == m){
    if(ansFlg == 1){
      ansFlg = -1;
    }
    else{
      ansFlg = 1;
      ansKey = key;
    }
    return;
  }

  for(int i = idx; i < m; i++){
    if((matchBit[i] & used) == matchBit[i]){
      return;
    }
  }

  for(int i = 0; i < match[idx].size(); i++){
    int j = match[idx][i];
    if(used & (1 << j)) continue;

    vector<char> nextKey = key;
    if(setKey(words[idx], cand[j], nextKey)){
      dfs(idx + 1, used | (1 << j), nextKey);
      if(ansFlg == -1) return;
    }
  }
}

void solve(){
  sort(words.begin(), words.end(), mycmp);

  for(int i = 0; i < m; i++){
    match[i].clear();
    matchBit[i] = 0;

    for(int j = 0; j < n; j++){
      if(matches(words[i], cand[j])){
        match[i].push_back(j);
        matchBit[i] |= (1 << j);
      }
    }
  }

  vector<char> key(128, -1);
  ansFlg = 0;
  dfs(0, 0, key);
}

int main(){
  while(cin >> n, n){
    for(int i = 0; i < n; i++){
      cin >> cand[i];

      for(int j = 0; j < i; j++){
        if(cand[j] == cand[i]){
          i--;
          n--;
          break;
        }
      }
    }

    string s;
    getline(cin, s);
    getline(cin, s);
    for(int i = 0; i < s.size(); i++) if(s[i] == '.') s[i] = ' ';

    vector<string> raw;
    stringstream ss(s);
    words.clear();

    while(ss >> s){
      raw.push_back(s);

      bool pushFlg = true;
      for(int i = 0; i < words.size(); i++){
        if(words[i] == s){
          pushFlg = false;
          break;
        }
      }
      if(pushFlg) words.push_back(s);
    }
    m = words.size();

    solve();

    if(ansFlg == 1){
      for(int i = 0; i < raw.size(); i++){
        if(i != 0) cout << " ";
        for(int j = 0; j < raw[i].size(); j++){
          cout << ansKey[raw[i][j]];
        }
      }
      cout << "." << endl;
    }
    else{
      cout << "-." << endl;
    }
  }
}

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

using namespace std;

int main()
{
    int a, b, N, M; cin >> N >> M; map< int, int > request; vector< int > removed;

    for( int i = 0; i < M; i++ )
        cin >> a >> b, b--, request[ b ] = max( request[ b ], a );

    for( auto p: request )
        if ( lower_bound( removed.begin(), removed.end(), p.second ) == removed.end() )
            removed.push_back( p.first );

    cout << removed.size();
}


Measured memory_bytes: 3328
#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>

using namespace std;
using lli = long long int;
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 (lli 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 (lli i=o; i<n+o; ++i) cin >> a[i]; }
template<class T> T gabs(const T& x) { return max(x, -x); }
#define abs gabs

lli n;
int main() {
  cin >> n;
  set<lli> s;
  lli cnt = 0;
  for (lli i=0; i<n; ++i) {
    lli x; cin >> x;
    if (s.count(x)) {
      ++cnt;
    } else {
      s.insert(x);
    }
  }
  lli ans = n - cnt - cnt % 2;
  cout << ans << '\n';
  return 0;
}



Measured memory_bytes: 4992
#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
using namespace std;
int n,x[105];

int main(){
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>x[i];
    }
    int minimum=1000000;
    for(int i=1;i<=100;i++){
        int tmp=0;
        for(int j=0;j<n;j++){
            tmp+=(x[j]-i)*(x[j]-i);
        }
        minimum=min(minimum,tmp);
    }    
    cout<<minimum<<"\n";
    return 0;
    
}

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


int main(){
    while (1){
	stack<double> st;
	string s;
	if (!getline(cin, s)) break;

	for (int i = 0; i < s.size(); i++){
	    while (s[i] == ' ' && i < s.size()) i++;
	    if ('0' <= s[i] && s[i] <= '9'){
		double n = 0;
		while ('0' <= s[i] && s[i] <= '9'){
		    n *= 10;
		    n += s[i] - '0';
		    i++;
		}
		st.push(n);
	    }
	    if (s[i] == '-'){
		if ('0' <= s[i+1] && s[i+1] <= '9'){
		    i++;
		    double n = 0;
		    while ('0' <= s[i] && s[i] <= '9'){
			n *= 10;
			n += s[i] - '0';
			i++;
		    }
		    st.push(-n);
		}
		else {
		    double b = st.top();
		    st.pop();
		    double a = st.top();
		    st.pop();
		    st.push(a-b);
		}
	    }
	    if (s[i] == '+' || s[i] == '*' || s[i] == '/'){
		double b = st.top();
		st.pop();
		double a = st.top();
		st.pop();
		switch (s[i]){
		case '+':
		    st.push(a+b);
		    break;
		case '*':
		    st.push(a*b);
		    break;
		case '/':
		    st.push(a/b);
		    break;
		}
	    }
	}
	if (!st.empty()) printf("%.7lf\n", st.top());
    }
}

Measured memory_bytes: 0