akhauriyash/Code-Regression huggingface dataset:
fun main(args: Array<String>) {
    val scanner = System.`in`.bufferedReader()
    val n = scanner.readLine().toInt()
    val restaurants = Array(n) { i ->
        scanner.readLine().split(" ").let {
            Restaurant(i + 1, it[0], it[1].toInt())
        }
    }
    println(
        restaurants.sorted().joinToString("\n") {
            it.id.toString()
        }
    )
}

data class Restaurant(val id: Int, val name: String, val rank: Int) : Comparable<Restaurant> {
    override fun compareTo(other: Restaurant): Int {
        return when {
            this.name < other.name -> -1
            this.name == other.name -> when {
                this.rank == other.rank -> 0
                this.rank > other.rank -> -1
                else -> 1
            }
            else -> 1
        }
    }
}

Measured memory_bytes: 35656
use proconio::*;

fn calc(a: &[u32], b: &[u32], v: u32) -> usize {
    let mut ans = 0;
    let mut p = b.len();
    for a in a.iter() {
        while p > 0 && *a + b[p - 1] >= v {
            p -= 1;
        }
        ans ^= b.len()- p;
    }
    ans & 1
}

fn run() {
    input! {
        n: usize,
        mut a: [u32; n],
        mut b: [u32; n],
    }
    a.sort();
    b.sort();
    let mut ans = 0;
    for i in (0..29).rev() {
        let mut c = 0;
        for j in 1..=3 {
            c ^= calc(&a, &b, j << i);
        }
        ans |= c << i;
        let mask = (1 << i) - 1;
        for a in [&mut a, &mut b].iter_mut() {
            a.iter_mut().for_each(|a| *a &= mask);
            a.sort();
        }
    }
    println!("{}", ans);
}

fn main() {
    run();
}


Measured memory_bytes: 7744
#include <iostream>
#include <vector>
#include <string.h>
using namespace std ;


int main(void) {

    char s[3] ;
    cin >> s;
  
    if (strcmp(s, "SUN")==0)
        cout << 7 << endl;
    else if (strcmp(s, "MON")==0)
        cout << 6 << endl;
    else if (strcmp(s, "TUE")==0)
        cout << 5 << endl;
    else if (strcmp(s, "WED")==0)
        cout << 4 << endl ;
    else if (strcmp(s, "THU")==0)
        cout << 3 << endl ;
    else if (strcmp(s, "FRI")==0)
        cout << 2 << endl ;
    else
        cout << 1 << endl ;

    return 0 ;
}

Measured memory_bytes: 256
n=int(input())
s=list(input())
c=[0 for _ in range(n)]
c[0]=s[1:].count('W')
for i in range(1,n):
	if s[i-1] =='W' and s[i]=='W':
		c[i]=c[i-1]-1
	elif s[i-1]=='E' and s[i]=='E':
		c[i]=c[i-1]+1
	else:
		c[i]=c[i-1]
print(n-1-max(c))

Measured memory_bytes: 17488
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <regex>
#define REP(i,n) for(int i = 0; i < n; i++)
#define FOR(i,j,n) for(int i = j; i < n; i++)
#define RFOR(i,j,n) for(int i = j-1; i >= n; i--)
#define PREC(n) fixed << setprecision(n)
#define print_array(v) REP(__k, v.size()) { cout << v[__k]; if(__k != v.size()-1) cout << " "; else cout << endl; } value
#define YesorNo(a) printf(a?"Yes\n":"No\n")
#define _LIBCPP_DEBUG 0
using namespace std;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int a, b, k;
  cin >> a >> b >> k;
  for(int i=100; i >= 1; i--) {
    if(a%i == 0 && b%i == 0) k--;
      if(k == 0) {
        cout << i << endl;
        return 0;
      }
  }
  return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		
		int[] a = new int[N + 1];
		
		for(int i = 0; i < M; i++) {
			int x = sc.nextInt();
			int y = sc.nextInt();
			a[x]++;
			a[y]++;
		}
		
		for(int i = 1; i <= N; i++) {
			System.out.println(a[i]);
		}
		
	}
}


Measured memory_bytes: 23636
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>

#define FOR(i, a, b) for (int i = (a); i < int(b); ++i)
#define RFOR(i, a, b) for (int i = (b)-1; i >= int(a); --i)
#define REP(i, n) FOR(i, 0, n)
#define REP1(i, n) FOR(i, 1, int(n) + 1)
#define RREP(i, n) RFOR(i, 0, n)
#define RREP1(i, n) RFOR(i, 1, int(n) + 1)
#define ALL(c) begin(c), end(c)

int _ = (
#ifndef LOCAL
    std::cin.tie(nullptr), std::ios::sync_with_stdio(false),
#endif
    std::cout.precision(10), std::cout.setf(std::ios::fixed));

using ll = long long;
using ull = unsigned long long;
using ld = long double;
template <typename T> using vec = std::vector<T>;
using namespace std;

static ll count2(ll x) {
  ll res = 0;
  while (x % 2 == 0) {
    x /= 2;
    res++;
  }
  return res;
}

int main() {
  ll N;
  cin >> N;
  vec<ll> a(N);
  REP(i, N) cin >> a[i];

  const ll res =
      accumulate(ALL(a), 0ll, [](ll acc, ll x) { return acc += count2(x); });
  cout << res << endl;
  return 0;
}


Measured memory_bytes: 3680
#include <stdio.h>
#define N 2000
#define CO 190
int A[N],n;

int main(){
  int B[CO],M[200],i,n1,j,k,count=0,p;

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

  scanf("%d",&n1);

  for(i=0;i<n1;i++){
    scanf("%d",&k);
      p=solve(0,k);
    if(p==1)
	printf("yes\n");
    else
      printf("no\n");
  }

  return 0;
}

int solve(int i,int m){
  int res;
  if(m==0)
    return 1;
  if(i>=n)
    return 0;
  res=solve(i+1,m)||solve(i+1,m-A[i]);
  return res;
}

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

int main(){
    int K;
    cin >> K;
    string S;
    cin >> S;
    if(S.size() <= K) cout << S << endl;
    else cout << S.substr(0,K) << "..." << endl;
}

Measured memory_bytes: 3632
#include <stdio.h>
#include <math.h>
int main(void){
  int n,k,i;
  scanf("%d %d",&n,&k);
  int sum=1;
  for(i=0;i<n;i++){
    if(sum*2<sum+k) sum*=2;
    else sum+=k;
  }
  printf("%d\n",sum);
  return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
#include<string.h>
 
typedef long long int ll;
#define all(x) (x).begin(), (x).end()
 
using namespace std;

int nxt() {
    int x;
    cin >> x;
    return x;
}

ll nxtl(){
    ll x;
    cin>>x;
    return x;
}
 
void SieveOfEratosthenes(int n,vector <int> &primes) 
{ 
    // Create a boolean array "prime[0..n]" and initialize 
    // all entries it as true. A value in prime[i] will 
    // finally be false if i is Not a prime, else true. 
    bool prime[n+1]; 
    memset(prime, true, sizeof(prime)); 
  
    for (int p=2; p*p<=n; p++) 
    { 
        // If prime[p] is not changed, then it is a prime 
        if (prime[p] == true) 
        { 
            // Update all multiples of p greater than or  
            // equal to the square of it 
            // numbers which are multiple of p and are 
            // less than p^2 are already been marked.  
            for (int i=p*p; i<=n; i += p) 
                prime[i] = false; 
        } 
    } 
  
    // Print all prime numbers 
    for (int p=2; p<=n; p++) 
       if (prime[p]) 
          primes.push_back(p);
} 
 
ll max(ll a,ll b)
{
    if(a>b)
        return a;
    return b;
}
 
ll power(ll x, ll y,ll mod) 
{ 
    ll temp; 
    if( y == 0) 
        return 1; 
    temp = power(x, y/2,mod); 
    if (y%2 == 0) 
        return (temp*temp)%mod; 
    else
        return (((x*temp)%mod)*temp)%mod; 
}

ll binomialCoeff(ll n, ll k) 
{ 
    ll C[k+1]; 
    memset(C, 0, sizeof(C)); 
  
    C[0] = 1;  // nC0 is 1 
  
    for (ll i = 1; i <= n; i++) 
    { 
        // Compute next row of pascal triangle using 
        // the previous row 
        for (ll j = min(i, k); j > 0; j--) 
            C[j] = C[j] + C[j-1]; 
    } 
    return C[k]; 
} 

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n=nxt();
    vector <int> v(n);
    generate(all(v),nxt);
    sort(all(v));
    int test=0;
    set <int> s;
    int c=0;
    for(int i=0;i<n;i++){
        int val=v[i]/400;
        if(val<8)
        s.insert(val);
    else
        c++;
    }
    cout<<max(s.size(),1)<<" "<<s.size()+c<<endl;

    return 0;   
}




 
 


Measured memory_bytes: 256
N,T = list(map(int,input().split()))
ct = []
for i in range(N):
    ct.append(list(map(int,input().split())))
minCost = 1001
for i in range(N):
    if ct[i][1] <= T and minCost > ct[i][0]:
        minCost = ct[i][0]
if minCost > 1000:
    print("TLE")
else:
    print(minCost)

Measured memory_bytes: 9164
/*
  AOJ 2403
  Title:The Enemy of My Enemy is My Friend
  @kankichi573
  14/11/02 TLE 0/4
*/
#include <stdio.h>
#include <string.h>
#define max(x,y) (((x)>(y))?(x):(y))

char country[40][17];
char adjoin[40][40]; 
int strength[40];
int n,n2;
char doumei[40];
int init_power;
int answer;
int runsum_strength[40];
void dump()
{  int i,j;

  for(i=0;i<n;i++)
    {
      
      printf("%-16s [%d][%d]|",&country[i][0],strength[i],runsum_strength[i]);
      for(j=0;j<n;j++)
        if(adjoin[i][j])
	  printf("%d :",j);
      
      printf("\n");
      
    }

}

void dump_n()
{
  int i,j,cnt;
  char buf1[4],buf[121];

  printf("%d\n",n);
  for(i=0;i<n;i++)
    {
      printf("%-2d %-5d [%-5d]",i,strength[i],runsum_strength[i]);
      buf[0]='\0';
      cnt=0;
      for(j=0;j<n;j++)
	{
        if(adjoin[i][j])
	  {
	    sprintf(buf1,"%-2d ",j);
	    strcat(buf,buf1);
	    cnt++;
	  }
	}
      
      printf("%d %s \n",cnt,buf);
    }
  printf("0\n");
}
void dump_doumei(char doumei[],int lv)
{
  int i;
  printf("D:[%d]",lv);
  for(i=0;i<n;i++)
    if(doumei[i]==1)
      printf("%s:",country[i]);
    else if(doumei[i]==2)
      printf("[%s]",country[i]);
  printf("\n");
}

solve2(char doumei[],int from,int acc,int lv)
{
  char doumei0[40],doumei1[40];
  int i,dm,flag;

#ifdef DEBUG
  dump_doumei(doumei,lv);
#endif  
  for(i=from;i<n;i++)
    {
      if(doumei[i]==0)
	goto NEXT;
    }
  answer=max(answer,acc);
  return;
 NEXT:
  dm=i;

  if(acc + runsum_strength[dm] < answer)
    return;  //edakari 2

  memcpy(doumei0,doumei,40);
  memcpy(doumei1,doumei,40);
  doumei0[dm]=2;
  doumei1[dm]=1;


  flag=0;
  for(i=0;i<n;i++)
    if(adjoin[dm][i])
      {
	if(doumei[i]==0)
	  {
	    flag=1; //edakari
	    doumei1[i]=2;
	  }
      }
  
  solve2(doumei1,from+1,acc+strength[dm],lv+1); 
  if(flag)
    solve2(doumei0,from+1,acc,lv+1);
}

void solve()
{
  int ret,i;

  answer=0;
  for(i=0;i<n;i++)
    if(adjoin[0][i])
      doumei[i]=2;
        
  solve2(doumei,1,init_power,1);
}

int register_country(char *s)
{
  int i;
  for(i=0;i<n2;i++)
    if(0==strcmp(s,&country[i][0]))
      return(i);
  strcpy(&country[n2][0],s);
  n2++;
  return(n2-1);
}

main()
{
  int i,j,ret;
  char name[17];

  int str,num,country_no,rinsetu_no;

  while(scanf("%d",&n) && n)
  {
    n2=0;
    memset(doumei,0,40);
    memset(adjoin,0,40*40);
    init_power=0;
    for(i=0;i<n;i++)
      {
	scanf("%s %d %d",name,&str,&num);
		
	country_no=register_country(name);
	strength[country_no]=str;
	if(num==0 || i==0)
	  {
	    doumei[country_no]=1; // rinsetukoku nasi => must union
	    init_power+=str;
	  }
	for(j=0;j<num;j++)
	  {
	    scanf("%s",name);
	    rinsetu_no=register_country(name);
	    adjoin[country_no][rinsetu_no]=1;
	  }
      }
    runsum_strength[n-1]=strength[n-1];
    if(n>1)
      for(i=n-2;i>=0;i--)
	runsum_strength[i]=runsum_strength[i+1]+strength[i];
#ifdef DEBUG2
      dump_n();
#else
    solve();
    printf("%d\n",answer);
#endif    
  }
    return(0);
}

Measured memory_bytes: 628
import sys
input=sys.stdin.readline

n,m = map(int, input().split())
a = {}
for i in range(m):
    a[int(input())] = 0

dp = [0]*(n+1)
dp[0] = 1
dp[1] = 0 if 1 in a else 1
for i in range(2,n+1):
    if i in a:
        dp[i] = 0
    else:
        dp[i] = dp[i-1] + dp[i-2]

print(dp[n]%(10**9+7))


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

#define F first 
#define S second

using namespace std;

typedef long long LL;
typedef pair<int, int> PII;

const int N = 200010, M = 110;

int n;
int cnt[M];
int f[M][M];

int main()
{
	cin >> n;
	for (int i = 2; i <= n; i ++ )
	{
		int t = i;
		for (int j = 2; j <= t / j; j ++ )
			while (t % j == 0)
			{
				cnt[j] ++ ;
				t /= j;
			}
		if (t > 1) cnt[t] ++ ;
	}
	
	f[0][1] = 1;
	for (int i = 0; i < M; i ++ )
		for (int j = 1; j <= 75; j ++ )
			for (int k = 0; k <= cnt[i]; k ++ )
				if ((k + 1) * j > 75) break;
				else f[i + 1][j * (k + 1)] += f[i][j];
	
	cout << f[100][75] << endl;
    return 0;
}

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

int main() {
  int n, m;

  cin >> n >> m;

  vector<int> a(n);

  for (int i = 0; i < m; i++) {
    int temp, temp2;
    cin >> temp >> temp2;
    a[--temp]++;
    a[--temp2]++;
  }

  for (int i = 0; i < n; i++) {
    cout << a[i] << endl;
  }

  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, begin, end) for(ll i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(ll i=(begin)-1;i>=(end);i--)
#define IREP(i, n) IFOR(i,n,0)
#define SORT(a) sort(a.begin(), a.end())
#define ISORT(a) sort(a.begin(), a.end(),greater<ll>())
#define REVERSE(a) reverse(a.begin(), a.end())
#define debug(x) cout << #x << "=" << x << endl;
#define vdebug(v) cout << #v << "=(" << v[0]; FOR(i_debug, 1, v.size()){ cout << "," << v[i_debug]; } cout << ")" << endl;
#define mdebug(m) cout << #m << "=" << endl; REP(i_debug, m.size()){ REP(j_debug, m[i_debug].size()){ cout << m[i_debug][j_debug] << ","; } cout << endl;}
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
#define Max(a, b) a = max(a, b)
#define Min(a, b) a = min(a, b)

#define ll long long
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define INF 1000000000000000000

using vec = vector<ll>;
using mat = vector<vec>;
using Pii = pair<ll, ll>;
using PiP = pair<ll, Pii>;
using PPi = pair<Pii, ll>;
using bvec = vector<bool>;
using Pvec = vector<Pii>;


template<typename T> void readv(vector<T> &a) { REP(i, a.size()) cin >> a[i]; }
void readv_m1(vector<int> &a) { REP(i, a.size()) {cin >> a[i]; a[i]--;} }

ll mod = 1000000007;

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

	vec xlist(F + 1, 0), ylist(F + 1, 0);

	REP(i, F + 1) {
		REP(j, F + 1) {
			ll xtemp = 100 * A * i + 100 * B * j;
			ll ytemp = C * i + D * j;
			if (xtemp <= F) xlist[xtemp] = 1;
			if (ytemp <= F) ylist[ytemp] = 1;
		}
	}

	double maxdense = 0;
	ll answeight = 100 * A;
	ll anssug = 0;

	REP(i, F + 1) {
		if (xlist[i] == 0) continue;
		REP(j, F + 1) {
			if (ylist[j] == 0) continue;

			if (i * E / 100 < j) continue;

			if (i+ j > F) continue;

			if (maxdense < (double)100 * j / (i + j)) {
				maxdense =  (double)100 * j / (i + j);
				answeight = i + j;
				anssug = j;
			}
		}
	}

	cout << answeight << " " << anssug << endl;


	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<string.h>
#include<map>
#include<set> 
#include<vector>
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue> 
using namespace std;
int main() 
{string a;
 cin>>a;
 int ans=700;
 for (int i=0;i<3;i++)
 if (a[i]=='o')
 ans+=100;
 cout<<ans; 
 system("pause");
 return 0;
}        


Measured memory_bytes: 504
// includes
#include <cstdio>
#include <cstdint>
#include <iostream>
#include <iomanip>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <utility>
#include <functional>
#include <cmath>
#include <climits>
#include <bitset>
#include <list>
#include <random>

// macros
#define ll long long int
#define pb emplace_back
#define mk make_pair
#define pq priority_queue
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define rrep(i, n) for(int i=((int)(n)-1);i>=0;i--)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())

using namespace std;

//  types
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
typedef pair<ll, ll> Pll;
typedef pair<double, double> Pd;
 
// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double EPS = 1e-10;
const int mod = 1e9 + 7;

// solve
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(a > b){a = b; return 1;} return 0;}

int st[200001];
vector<int> at[26];

int main(int argc, char const* argv[])
{
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, q;
  cin >> n >> q;
  string s;
  cin >> s;
  vector<char> t(q), d(q);
  rep(i, q){
    cin >> t[i] >> d[i];
  }
  int l = 0, r = n;
  int res = 0;
  while(r - l > 1){
    int m = (r + l) / 2;
    int M = m;
    bool flag = false;
    for(int i = 0; i < q; i++){
      if(t[i] != s[m])continue;
      m += (d[i] == 'L' ? -1: 1);
      if(m < 0){
        flag = true;
        break;
      }
      if(m >= n){
        flag = false;
        break;
      }
    }
    if(flag)l = M;
    else r = M;
  }
  res += l + 1;
  //cout << res << endl;
  l = 0, r = n;
  while(r - l > 1){
    int m = (r + l) / 2;
    int M = m;
    bool flag = false;
    for(int i = 0; i < q; i++){
      if(t[i] != s[m])continue;
      m += (d[i] == 'L' ? -1: 1);
      if(m >= n){
        flag = true;
        break;
      }
      if(m < 0){
        flag = false;
        break;
      }
    }
    if(!flag)l = M;
    else r = M;
  }
  res += n - l - 1;
  cout << n - res << endl;
	return 0;
}


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

int main(void){
  ll N,K;
  cin >> N >> K;
  ll x = N/K;
  if(N - x*K < abs(N-(x+1)*K)){
    cout << N - x*K << endl;
  }else{
    cout << abs(N-(x+1)*K) << endl;
  }
  
  return(0);
}


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

using namespace std;

int main() {
	long long n;
	cin >> n;
	long long a, b;
	cin >> a >> b;

	long long ans = 0;
	long long cnt = n / (a + b);
	ans += cnt * a;
	long long rest = n % (a + b);
	ans += min(a, rest);

	cout << ans << endl;

	return 0;
}

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

int main() {
  int N,M;
  cin >> N >> M;
  int count=0;
  if (N>1){
    count += N*(N-1)/2;
  }
  if (M>1){
    count += M*(M-1)/2;
  }
  cout << count << endl;
}


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

int main(){
  int n, k, sum=0;
  cin >> n >> k;
  
  for(int i=0, x; i < n; i++){
    cin >> x;
    if((k - x) < x){
      sum += (k - x) * 2;
    }else{
      sum += x * 2;
    }
  }
  cout << sum << endl;
}

Measured memory_bytes: 3556
#include<stdio.h>
int main(void)
{
	int a,b,c,d,e,m,x,y,z;
	scanf("%d %d %d %d %d",&a,&b,&c,&d,&e);
	if(a<0){
		m=a*-1;
		x=c*m;
		y=e*b;
		z=x+y+d;
		printf("%d\n",z);
	}
	else if(a>0){
		x=b-a;
		y=x*e;
		printf("%d\n",y);
	}
	else{
		x=b*e;
		y=x+d;
		printf("%d\n",y);
	}
	return 0;
}	


Measured memory_bytes: 2080
#include <bits/stdc++.h>
using namespace std;
int main() {
	long long a,b,c,d;

	cin >> a >> b >> c ;

	if (c<=a+b){
		cout << "No" << endl;
		return 0;
	}
	if ((c-a-b)*(c-a-b)>4*a*b){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;
	}
	return 0;
}

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

int main(){
  int age,ryokin;
  
  cin >> age >> ryokin;
  
  if(age >= 13) cout << ryokin;
  else if(age >= 6 && age <= 12) cout << ryokin / 2;
  else cout << 0;
}


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

using namespace std;

int main()
{
    int n;
    cin>>n;
    vector<int> x(n);
    for (int &t: x)
        cin>>t;
    long long M = 1000000007;
    long long ans = 1;
    int cnt = 1;
    int cur = 1;
    int p = 1;
    while (cur<n)
    {
        while (cur<n && (cnt-1)*2+2<x[cur])
        {
            cur++;
            cnt++;
        }
        if (cur<n)
        {
            ans = ans * (cnt+1) % M;
            cur++;
        }
    }
    while (cnt>1)
        ans = ans * cnt % M,
        cnt--;
    cout<<ans<<endl;
}



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

using ll = long long;
const int N = 110 , M = 1e5 + 5;

ll dp[N][M];
int n , W;
int w[N];
ll  v[N];

main(){
    scanf("%d %d" , &n , &W);
    for(int i = 1 ; i <= n ; i ++){
        scanf("%d %lld" , &w[i] , &v[i]);
    }


    for(int j = 1 ; j <= W ; j ++){
        for(int i = 1 ; i <= n ; i ++){
            if(j - w[i] >= 0){
                dp[i][j] = max(dp[i-1][j] , v[i] + dp[i-1][j-w[i]]);
            }
            else dp[i][j] = dp[i-1][j];
        }
    }

    ll ans = 0;
    for(int i = 1 ; i <= W ; i ++)
        ans = max(ans , dp[n][i]);

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


Measured memory_bytes: 79360
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define NCLR(a) memset((a), -1 ,sizeof(a))
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
typedef complex<double> P;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 1000000007;
static const int INF = 1 << 29;
static const LL LL_INF = 1ll << 60;
static const int dx[] = { -1, 0, 1, 0, 1, -1, 1, -1 };
static const int dy[] = { 0, -1, 0, 1, 1, 1, -1, -1 };

#ifdef WIN32
#define dump(x) cout << #x << " = " << (x) << "\n"
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n"
#else
#define dump(x)
#define debug(x)
#endif

struct Union_Find {
	vector<int> par;
	vector<int> rank;

	//初期化
	void init( int n ) {
		par.resize( n );
		rank.resize( n );
		for ( int i = 0; i < n; ++i ) {
			par[ i ] = i;
			rank[ i ] = 0;
		}
	}

	//木の根を探す
	int find( int s ) {
		if ( par[ s ] == s ) {
			return s;
		}
		return par[ s ] = find( par[ s ] );
	}

	//結合
	void unite( int x, int y ) {
		int a = find( x ), b = find( y );
		if ( a == b ) {
			return;
		}
		if ( rank[ a ] < rank[ b ] ) {
			par[ a ] = b;
		}
		else {
			par[ a ] = b;
			if ( rank[ a ] == rank[ b ] ) {
				++rank[ b ];
			}
		}
	}

	//二つの数の根が同じかどうか
	bool same( int x, int y ) {
		return find( x ) == find( y );
	}

	//サイズを返す
	unsigned int size() {
		return par.size();
	}
};

int main() {
#ifdef WIN32
	printf( "Debug Mode\n" );
#endif
	int n, q;
	scanf( "%d %d", &n, &q );
	Union_Find uf;
	uf.init( n );
	for ( int i = 0; i < q; i++ ) {
		int com, x, y;
		scanf( "%d %d %d", &com, &x, &y );
		if ( com ) {
			printf( "%d\n", uf.same( x, y ) );
		}
		else {
			uf.unite( x, y );
		}
	}
	return 0;
}

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

int main() {
	int n,m;cin>>n>>m;
	int in_deg[n+1]={0};
	vector<int>v[n+1];
	for(int i=0;i<m;i++){
		int x,y;cin>>x>>y;
		v[x].push_back(y);
		 in_deg[y]++;
	}
	queue<int>q;
	int vis[n+1]={0};
	int dp[n+1]={0};
	
	for(int i=1;i<=n;i++){
		if(in_deg[i]==0){
			q.push(i);
			dp[i]=1;
		}
	}
	int maxx=0;
	while(!q.empty()){
		int p=q.front();
	//	cout<<p<<endl;
		q.pop();
		if(vis[p])continue;
		vis[p]=1;
		if(dp[p]>maxx)
		maxx=dp[p];
		for(int i=0;i<v[p].size();i++){
			
			int y=v[p][i];
			in_deg[y]--;
	//		cout<<y<<" "<<in_deg[y]<<endl;
			dp[y]=max(dp[y],dp[p]+1);
			if(in_deg[y]==0){
				q.push(y);
			}
		}
	}
	//for(int i=1;i<=n;i++)cout<<dp[i]<<" ";
	cout<<maxx-1<<endl;
	
	return 0;
}

Measured memory_bytes: 10240
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt();
			System.out.println(IntStream.range(0, n).map(i -> devide2Count(scanner.nextInt())).min().getAsInt());
		}
	}

	/**
	 * @param number
	 * @return numberが何回2で割れるか
	 */
	private static int devide2Count(int number) {
		int result = 0;
		while ((number & 1) == 0) {
			number >>= 1;
			result++;
		}
		return result;
	}
}


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

int main(){
	ios::sync_with_stdio(0);
	cout << setprecision(10) << fixed;
	long long n, d, a;
	cin >> n >> d >> a;
	vector<pair<long long, long long>> m(n);
	vector<long long> used(n + 1, 0);
	for (int i = 0; i < n; ++i){
		cin >> m[i].first >> m[i].second;
	}
	sort(m.begin(), m.end());
	long long ans = 0;
	for (int i = 0, j = 0; i < n; ++i){
		while (j < n && m[i].first + 2 * d >= m[j].first){
			j++;
		}
		int need = max((1ll * m[i].second - used[i] * a + a - 1) / a, 0ll);
		ans += need;
		used[i] += need;
		used[j] -= need;
		used[i + 1] += used[i];
	}
	cout << ans;
	return 0;
}



Measured memory_bytes: 4992
import sys
import os
import math

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    S, T = sl()
    ret = []
    for n in range(N):
        ret.append(S[n])
        ret.append(T[n])
    print(*ret,sep="")


if __name__ == '__main__':
    main()


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

int n;
int A[30];

bool solve(int i, int m){
    if (m == 0){
        return true;
    }
    if (i > n){
        return false;
    }

    bool res = solve(i+1, m) || solve(i+1, m-A[i]);

    return res;

}

int main() {
    cin >> n;
    rep(i, n){
        cin >> A[i];
    }

    int q; cin >> q;
    rep(i, q){
        int m; cin >> m;
        if(solve(0, m)){
            cout << "yes" << endl;
        } else {
            cout << "no" << endl;
        }
    }
}


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

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

int main(){
  int n;
  cin>>n;
  long mod=1000000007;
  vector<long>a(n);
  vector<int>b(1001001);
    
  rep(i,n){
    cin>>a.at(i);
    int co;
    int now=a.at(i);
    for(int j=2;j*j<=now;j++){
      co=0;
      while(now%j==0){
        co++;
        now/=j;
      }
      b[j]=max(b[j],co);
    }
    if(now!=1){
      b[now]=max(b[now],1);
    }
    
  }
  long tot=1;
  rep(i,b.size()){
    tot*=modpow(i,b[i],mod);
    tot%=mod;
  }
  long ans=0;
  rep(i,n){
    long now=tot*modpow(a[i],mod-2,mod)%mod;
    ans=(ans+now)%mod;
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 7124
N = int(input())
a = list(map(int,input().split()))
a.sort()
a.reverse()
alice = 0
bob = 0
for i in range(N) :
    if i%2 == 0 : 
        alice += a[i]
    elif i%2 == 1 :
        bob += a[i]
print(alice-bob)
    

Measured memory_bytes: 9096
#include <bits/stdc++.h>
 
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pii;
typedef tuple<ll, ll, ll> ti;
ll mod=1E9+7;
 
#define REP(a,b,c) for(ll a=(b);a<(c);a++)
#define PER(a,b,c) for(ll a=(b);a>=(c);a--)

ll ii(){ ll x; cin >> x; return x; }
string is(){ string x; cin >> x; return x; }
double id(){ double x; cin >> x; return x; }
void oi(ll x){ cout << x; }
void od(ld x){ cout << fixed << setprecision(10) << x; }
void os(string x){ cout << x; }
void oe(){ cout << endl; }
void oie(ll x){ oi(x); oe(); }
void ode(ld x){ od(x); oe(); }
void ose(string x){ os(x); oe(); }

int main(){
    ll N=ii();
    set<string> S;
    REP(i,0,N){
        S.insert(is());
    }
    oie(S.size());
    return 0;
}

Measured memory_bytes: 19228
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; 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 sz(x) (int)(x).size()
#define uni(x) x.erase(unique(rng(x)),x.end())
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef set<int> S;
typedef queue<int> Q;
typedef queue<P> QP;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int MOD = 1000000007;


class Combi {
public:
  v(ll) fac, inv, finv;
  void init(int N) {
    fac[0] = fac[1] = 1; inv[1] = 1; finv[0] = finv[1] = 1;
    for (int i = 2; i < N; i++) {
      fac[i] = fac[i - 1] * i % MOD;
      inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
      finv[i] = finv[i - 1] * inv[i] % MOD;
    }
  }
  Combi(int N) : fac(N + 1), inv(N + 1), finv(N + 1) { init(N + 1); }
  ll Cmod(int n, int k) {
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
  }
  ll Pmod(int n, int k) {
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * finv[n - k] % MOD;
  }
};

struct mint {
  ll x;
  mint():x(0){}
  mint(ll x):x((x%MOD+MOD)%MOD){}
  mint& fix() { x = (x%MOD+MOD)%MOD; return *this;}
  mint operator-() const { return mint(0) - *this;}
  mint& operator+=(const mint& a){ if((x+=a.x)>=MOD) x-=MOD; return *this;}
  mint& operator-=(const mint& a){ if((x+=MOD-a.x)>=MOD) x-=MOD; return *this;}
  mint& operator*=(const mint& a){ (x*=a.x)%=MOD; return *this;}
  mint operator^(int b) {mint res = 1;while(b > 0) {if(b&1) {res = (res*(*this));}*this=(*this)*(*this);b>>=1;} return res;}
  mint operator+(const mint& a)const{ return mint(*this) += a;}
  mint operator-(const mint& a)const{ return mint(*this) -= a;}
  mint operator*(const mint& a)const{ return mint(*this) *= a;}
  bool operator<(const mint& a)const{ return x < a.x;}
  bool operator==(const mint& a)const{ return x == a.x;}
};
typedef vector<mint> vm;
typedef vector<vm> vvm;

ll mpow(ll a,ll b) {
  a %= MOD;
  ll res = 1;
  while(b > 0) {
    if(b&1) {
      res = (res*a) % MOD;
    }
    a = (a*a) % MOD;
    b >>= 1;
  }
  return res;
}
  
int main() {
  int n,a,b;
  cin >> n >> a >> b;
  mint ans = mpow(2,n);
  ans -= 1;
  Combi c(200010);
  ll ax = 1;
  for(int i=n;i>n-a;i--) {
    ax *= i;
    ax %= MOD;
  }
  ax *= c.finv[a];
  ax %= MOD;
  ll bx=1;
  for(int i=n;i>n-b;i--) {
    bx *= i;
    bx %= MOD;
  }
  bx *= c.finv[b];
  bx %= MOD;
  ans -= ax;
  ans -= bx;
  cout << ans.x << endl;
  return 0;
}

Measured memory_bytes: 5120
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define REP(i,n) for (int64_t i=0; i<(n); ++i)
#define P pair<int,int>
using ll=int64_t;
using namespace std;
#define ketasuu(n) fixed<<setprecision(n)
#define btoe(p) p.begin(),p.end()
#define etob(p) p.rbegin(),p.rend()




int main(){
    ll x,y; cin>>x>>y;
    int ans=1;
    while(x*2<=y){
        ans++;
        x*=2;
    }
    cout<<ans<<endl;
    return 0;
}

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

int main()
{
	int x, a, b;
	cin >> x >> a >> b;
	if (-a + b <= 0) {
		cout << "delicious" << endl;
	}
	else if (-a + b > x) {
		cout << "dangerous" << endl;
	}
	else {
		cout << "safe" << endl;
	}
	

    return 0;
}

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

using namespace std;

int main() {
    int N, maxi = 0, mini = 0;
    cin >> N;
    vector<int> A(N);
    for(int i = 0; i < N; i++) cin >> A.at(i);
    maxi = A.at(0); mini = A.at(0);
    for(int i = 0; i  < N; i++){
        maxi = max(maxi, A.at(i));
        mini = min(mini, A.at(i));
    }
    
    cout << abs(maxi - mini) << endl;
}


Measured memory_bytes: 256
<?php
fscanf(STDIN,"%d %d %d",$a,$b,$c);
$ans = 0;
for($i = 1;$i <= sqrt($c);$i++){
    if($c % $i == 0){
        $q = $c / $i;
        if($i > $b || $q < $a){
            break;
        }
        if($i >= $a && $i <= $b){
            $ans++;
        }
        if($q >= $a && $q <= $b){
            $ans++;
        }
        if($i == $q){
            $ans--;
        }
    }
}
echo $ans . PHP_EOL;

Measured memory_bytes: 15320
#include<stdio.h>

int main(){
    
    int a,b,c,input;
    scanf("%d",&input);
    a=input/3600;
    b=(input%3600)/60;
    c=(input%60);
    
    printf("%d:%d:%d\n",a,b,c);
    
    
    
    
    
    
    
    
    
    
    
    
    return 0;
}


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

typedef long long LL;
typedef unsigned long long ULL;

#define debug printf("fuck %d\n", __LINE__);

inline LL read() {
	LL res = 0, bo = 1; char ch = getchar();
	while(ch < '0' || ch > '9') { if (ch == '-') bo = -1; ch = getchar(); }
	while(ch >= '0' && ch <= '9') { res = (res << 1) + (res << 3) + ch - '0'; ch = getchar(); }
	return bo * res;
}

template<typename T> void read(T &x) { x = read(); }
template<typename T, typename ...Argv> void read(T &a, Argv &...argv) { read(a); read(argv...); }

const int N = 2e5, inf = 2147483647;

struct Edge {
	int to, cap, dis;
	Edge *nxt, *pre;
	Edge(int to, int cap, int dis, Edge *nxt) : to(to), cap(cap), dis(dis), nxt(nxt), pre(NULL) {}
} *head[N], *cur[N];

LL cost, dis[N];
int S, T, flow;
bool vis[N];

void add(int u, int v, int c, int d) {
	head[u] = new Edge(v, c, d, head[u]);
	head[v] = new Edge(u, 0, -d, head[v]);
	head[u]->pre = head[v];
	head[v]->pre = head[u];
}

std::queue<int> q;

bool spfa() {
	for(int i = 1; i <= T; ++ i) dis[i] = -inf, cur[i] = head[i], vis[i] = false;
	dis[S] = 0; q.push(S);
	while (q.size()) {
		int x = q.front(); q.pop(); vis[x] = false;
		for (Edge *i = head[x]; i; i = i->nxt) {
			if (i->cap && dis[x] + i->dis > dis[i->to]) {
				dis[i->to] = dis[x] + i->dis;
				if (!vis[i->to]) q.push(i->to), vis[i->to] = true; 
			}
		}
	}
	return dis[T] != -inf;
}

int dfs(int x, int flow) {
	vis[x] = true;
	if(x == T || !flow) return flow;
	int king = 0;
	for(Edge *&i = cur[x]; i; i = i->nxt) {
		if((vis[i->to] == false || i->to == T) && i->cap && dis[x] + i->dis == dis[i->to]) {
			int o = dfs(i->to, std::min(i->cap, flow));
			if(o) {
				i->cap -= o, i->pre->cap += o;
				cost += 1LL * i->dis * o; flow -= o; king += o;
				if(!flow) return king;
			}
		}
	}
	return king;
}

void zkw_Mincost_Maxflow() {
	while(spfa()) {
		flow += dfs(S, inf);
		while(vis[T] == true) {
			for(int i = 1; i <= T; ++i) vis[i] = false;
			flow += dfs(S, inf);
		}
	}
}

int n, x, y, c, a[4];

int main() {
	read(n); S = n * 2 + 5; T = n * 2 + 6;
	for (int i = 0; i < 4; ++ i) a[i] = n * 2 + i + 1;
	for (int i = 1; i <= n; ++ i) {
		read(x, y, c);
		add(S, i, c, 0);
		add(i, a[0], inf, -x - y);
		add(i, a[1], inf, x - y);
		add(i, a[2], inf, -x + y);
		add(i, a[3], inf, x + y);
	}
	for (int i = 1; i <= n; ++ i) {
		read(x, y, c);
		add(i + n, T, c, 0);
		add(a[0], i + n, inf, x + y);
		add(a[1], i + n, inf, -x + y);
		add(a[2], i + n, inf, x - y);
		add(a[3], i + n, inf, -x - y);
	}
	zkw_Mincost_Maxflow();
	std::cout << cost << std::endl;
	return 0;
}

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

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

	vector<vector<ll> > V1(n, vector<ll>(m));
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++) {
			cin >> V1[i][j];
		}
	}
	vector<vector<ll> > V2(m, vector<ll>(l));
	for (int i = 0; i < m; i++) {
		for (int j = 0; j < l; j++) {
			cin >> V2[i][j];
		}
	}

	for (int i = 0; i < n; i++) {
		for (int j = 0; j < l; j++) {
			ll sum = 0;
			for (int k = 0; k < m; k++) {
				sum += V1[i][k] * V2[k][j];
			}
			cout << sum;
			if (j == l - 1)
				cout << endl;
			else
				cout << " ";
		}
	}
}



Measured memory_bytes: 3292
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define ALL(A) A.begin(), A.end()

using namespace std;

typedef long long ll;
typedef pair<int, int> P;

const int MAX_N = (int)1e5 + 5;

bool used[MAX_N];	// この数字を使ったかどうか
bool change[MAX_N];	// この桁が１引く事によって変化するかどうか
bool cand[MAX_N];	// この数字が候補である
int main()
{
	memset(used, false, sizeof(used));
	
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int N; cin >> N;
	vector<int> a(N, 0);
	rep (i, N) cin >> a[i];

	int ans = 0;
	int res = 0;
	rep (i, N) ans ^= a[i];
	if (ans == 0){
		res = 0;
	}else{

		for(int digit = 31; digit >= 0; --digit){
			memset(cand, false, sizeof(cand));
			memset(change, false, sizeof(change));
			int cnt = 0;
			rep (i, N){
				if (a[i] & (1<<digit)){
					++cnt;
					if (!used[i]) cand[i] |= true;
					if (!used[i] && !((a[i] - 1) & (1<<digit))) change[i] |= true;
				} // end if
			} // end rep

			if (cnt % 2 == 0){
				rep (i, N) used[i] |= change[i];
			}else{
				bool one = false;
				rep (i, N){
					if (!used[i] && change[i]){
						if (!one){
							--a[i];
							++res;
							one |= true;
						} // end if
						used[i] |= true;
					} // end if
				} // end rep
				if (!one){
					res = -1;
					break;
				} // end if
			} // end if
		} // end for
	} // end if
	cout << res << endl;

	return 0;
}

Measured memory_bytes: 1024
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const int INF = (1<<30);
const ll INFLL = (1ll<<60);
const ll MOD = (ll)(1e9+7);

#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	a = (a<MOD)?a:(a-MOD);
	b = (b<MOD)?b:(b-MOD);
	a += b;
	a = (a<MOD)?a:(a-MOD);
}

ll fc[2002002]={1ll},nv[2002002]={1ll};

ll rwpw(ll a, ll p = MOD-2){
	ll ret = 1ll;
	while(p){
		if(p&1){
			mul_mod(ret,a);
		}
		mul_mod(a,a);
		p /= 2;
	}
	return ret;
}

ll comb(int a, int b){
	ll ret = fc[a+b];
	mul_mod(ret,nv[a]);
	mul_mod(ret,nv[b]);
	return ret;
}

int main(void){
	int r[2],c[2],i;
	ll x,y,ans=0ll;
	for(i=1; i<=2000020; ++i){
		fc[i] = fc[i-1]*i%MOD;
		nv[i] = rwpw(fc[i]);
	}
	for(i=0; i<2; ++i){
		cin >> r[i] >> c[i];
		r[i] += i; c[i] += i;
	}
	ans = comb(r[1],c[1]);
	add_mod(ans,comb(r[0],c[0]));
	add_mod(ans,MOD-comb(r[0],c[1]));
	add_mod(ans,MOD-comb(r[1],c[0]));
	cout << ans << endl;
	return 0;
}


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

using namespace std;

#define all(v)				((v).begin()), ((v).end())
#define allr(v)				((v).rbegin()), ((v).rend())
#define sz(v)				((int)((v).size()))
#define rep(i, v)		for(int i=0;i<sz(v);++i)
#define lp(i, n)		for(int i=0;i<(int)(n);++i)
#define lpi(i, j, n)	for(int i=(j);i<(int)(n);++i)
#define lpd(i, j, n)	for(int i=(j);i>=(int)(n);--i)
#define ll long long
#define pb					push_back
#define fIO ios_base::sync_with_stdio(0);cin.tie(0);

const ll oo = 1e8;
const double pi = 3.1415926535897;


const double EPS = (1e-7);
int dcmp(double x, double y) {	return fabs(x-y) <= EPS ? 0 : x < y ? -1 : 1;	}


typedef vector<int>                vi;
typedef vector<pair<int,int>>      vii;
typedef vector<ll>                 vll;
typedef vector<double>             vd;
typedef vector< vi >               vvi;
typedef vector< vd >               vvd;
typedef vector<string>             vs;

/**
    * PLEASEEE READDD PROBLEEEM CARFULLY ****
    * Always check for OVERFLOW ll vs int
    * Always check for array bounds
    * Check for function return
    * READ OUTPUT SECTION AGAIN!!!
**/

struct edge{
    int from, to, w;

    edge(){}
    edge(int x, int y, int we): from(x), to(y), w(we){}

    bool operator < (const edge &rhs) const{
        return w > rhs.w;
    }

};

int main(){
    fIO

    int m1, d1, m2, d2;

    cin >> m1 >> d1 >> m2 >> d2;

    if(m2 == m1) {
        cout << 0;
    }else cout << 1;


}








Measured memory_bytes: 256
/*
*/

//#pragma comment(linker, "/STACK:16777216")
#define _CRT_SECURE_NO_WARNINGS

#include <fstream>
#include <iostream>
#include <string>
#include <complex>
#include <math.h>
#include <set>
#include <vector>
#include <map>
#include <queue>
#include <stdio.h>
#include <stack>
#include <algorithm>
#include <list>
#include <ctime>
#include <memory.h>
#include <assert.h>
#include <unordered_map>

#define y0 sdkfaslhagaklsldk
#define y1 aasdfasdfasdf
#define yn askfhwqriuperikldjk
#define j1 assdgsdgasghsf
#define tm sdfjahlfasfh
#define lr asgasgash
#define norm asdfasdgasdgsd

#define eps 1e-9
#define M_PI 3.141592653589793
#define bs 1000000009
#define bsize 350

using namespace std;

const int INF = 1e9;
const int N = 111531;

long long a, b, c, ans;

long long solve(long long a, long long b, long long c)
{
	if (a % 2 == 0)
		return 0;
	return b*c;
}

int main(){
	//freopen("fabro.in","r",stdin);
	//freopen("fabro.out","w",stdout);
	//freopen("F:/in.txt", "r", stdin);
	//freopen("F:/output.txt", "w", stdout);
	ios_base::sync_with_stdio(0);
	//cin.tie(0);
	
	cin >> a >> b >> c;
	ans = min(solve(a, b, c), min(solve(b, a, c), solve(c, a, b)));
	cout << ans << endl;

	cin.get(); cin.get();
	return 0;
}

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

int main(){
  vector<int> alp(26,0);
  string s; cin>>s;
  for(int i=0;i<(int)s.size();i++){
    alp[s[i]-'a']++;
  }
  for(int i=0;i<26;i++){
    if(alp[i]%2!=0){
      cout<<"No"<<endl;
      return 0;
    }
  }
  cout<<"Yes"<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define rep2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(c) (c).begin(), (c).end()
#define pb push_back
#define eb emplace_back
using namespace std;
const long long INF = 1LL<<60; // 仮想的な無限大の値;
using ll = long long;
using P  = pair<int, int>;
#define vi vector<int>
#define vll vector<ll>
#define vs vector<string>
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; }

int main()
{
    int N;
    string S;
    cin >> N >> S;
    ll cnt[3] {0, 0,0};
   
    rep(i, N){
        if(S[i] == 'R') {cnt[0]++;}
        if(S[i] == 'G') {cnt[1]++;}
        if(S[i] == 'B') {cnt[2]++;}
    }

    ll tot = cnt[0]*cnt[1]*cnt[2];
    rep(i, N)rep2(j, i+1, N){
        int k = j+j-i;
        if(k < N)
        {
            if(S[i] == S[j]) continue;
            if(S[k] == S[j]) continue;
            if(S[i] == S[k]) continue;
            --tot;
        }
    }
    cout << tot << endl;
    return 0;
}

Measured memory_bytes: 3632
using System;

class Program
{
  public static void Main()
  {
    string S = Console.ReadLine();
    Console.WriteLine(judge(S) ? "YES" : "NO");
  }
  public static bool judge(string s) {
    for (int i = 0; i < s.Length-1; i ++) {
      for (int j = 0; j <= s.Length - i; j ++) {
        if(s.Remove(i, j) == "keyence") return true;
      }
    }
    return false;
  }
}


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

#define fir first
#define sec second
using namespace std;
typedef long long LL;

template <typename T> inline bool cmin(T & a, const T & b) { return a > b ? a = b, 1 : 0;}
template <typename T> inline bool cmax(T & a, const T & b) { return a < b ? a = b, 1 : 0;}
int inp() {
	int x = 0, f = 1;char ch;
	for(ch = getchar(); !isdigit(ch); ch = getchar())
		if(ch == '-') f = -1;
	for(; isdigit(ch); x = x * 10 + ch - '0', ch = getchar());
	return x * f;
}

const int MaxN = 101234;
int n, x, y, z, a[MaxN], b[MaxN], c[MaxN], rk[MaxN];
LL ans = 0;
bool cmp(int x, int y){
	return b[x] - c[x] > b[y] - c[y];
}

priority_queue<int> q; LL f[MaxN], g[MaxN];

int main() {
	int i, j, _i;
	x = inp(); y = inp(); z = inp();
	for(n = (x + y + z), i = 1; i <= n; i++)
		a[i] = inp(), b[i] = inp(), c[i] = inp();
	for(i = 1; i <= n; i++) rk[i] = i; sort(rk + 1, rk + n + 1, cmp);
	
	for(_i = 1; i = rk[_i], _i <= y; _i++) q.push(a[i] - b[i]), ans += b[i] - a[i];
	f[y] = ans;
	for(_i = y + 1; i = rk[_i], _i <= n; _i++){
		if((j = a[i] - b[i]) <= q.top()){
			ans += q.top() - j;
			q.pop(); q.push(j);
		}
		f[_i] = ans;
	} 	
	for(i = 1; i <= (n >> 1); i++) swap(rk[i], rk[n - i + 1]);
	
	ans = 0;
	while(!q.empty()) q.pop();
	for(_i = 1; i = rk[_i], _i <= z; _i++) q.push(a[i] - c[i]), ans += c[i] - a[i];
	g[z] = ans; 
	for(_i = z + 1; i = rk[_i], _i <= n; _i++){
		if((j = a[i] - c[i]) <= q.top()){
			ans += q.top() - j;
			q.pop(); q.push(j);
		}
		g[_i] = ans;
	} 
	ans = -1e14;	
	for(i = y; i <= x + y; i++) cmax(ans, f[i] + g[n - i]);
	for(i = 1; i <= n; i++) ans += a[i];
	cout << ans;
	return 0;
}




Measured memory_bytes: 3456
// D - Chat in a Circle
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
int in(){int x;cin>>x;return x;}

int main(){
	int N; cin>>N;
	priority_queue<int> q;
	rep(i, N) q.push(in());
	int64_t ans = q.top(); q.pop();
	rep(c, N-2){ ans += q.top() * (1<<(++c < N-2)); q.pop(); }
	cout<< ans <<endl;
}


Measured memory_bytes: 4332
#include<bits/stdc++.h>
using namespace std;
int a,b,c;
char x1,x2;
int main(){
	cin>>a>>x1>>b>>x2>>c;
	if(a<2019||(a==2019&&b<=4)){
		cout<<"Heisei"<<endl;
		return 0;
	}
	cout<<"TBD"<<endl;
	return 0;
} 

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// contest 170
		Scanner sc = new Scanner(System.in);
		// List<Integer> l = Arrays.asList(sc.nextInt().split(" "));
		int x = sc.nextInt();
		int y = sc.nextInt();
		int z = sc.nextInt();
		int w = sc.nextInt();
		int s = sc.nextInt();
		if (x == 0) {
			System.out.print(1);
		}
		if (y == 0) {
			System.out.print(2);
		}
		if (z == 0) {
			System.out.print(3);
		}
		if (w == 0) {
			System.out.print(4);
		}
		if (s == 0) {
			System.out.print(5);
		}
	}
}


Measured memory_bytes: 35720
#include <iostream>
#include<string>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
    int t,n,i;
    int a[4]={6000,4000,3000,2000};
    for(i=0;i<4;i++){
        cin>>t>>n;
        cout<<a[t-1]*n<<endl;
    }
          return 0;
}

Measured memory_bytes: 3088
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define MAX 300005
const int maxn = 2e5+10;
int a[maxn];
int main() {
    LL n, k;
    cin>>n>>k;

    int cntR = 0;
    int ma = 0;
    for (int i = 0; i < n; ++i) {
        scanf("%d", a+i);
        ma = max(ma, a[i]);
    }
    LL l = 0, r = ma;
    LL d = k + n;
    while(l < r){
        int p =  0;
        int m = (l + r + 1) / 2;
        if(m == 0) {
            break;
        }
        else for (int i = 0; i < n; ++i) {
            p += (a[i] + m - 1)/ m;
        }
        if(p > d) l = m;
        else r = m - 1;
    }
    if(r == 0){
        cout<<1;
        return 0;
    }
    int p =  0;
    for (int i = 0; i < n; ++i) {
        p += (a[i] + r - 1)/ r;
    }
    if(p > d)cout<<r+1<<endl;
    else cout<<r<<endl;
}

Measured memory_bytes: 4400
#include<bits/stdc++.h>
using namespace std;
//size_t f = string::npos
//make pair, tuple

int main(){
      string s1,s2,s3;cin >> s1 >> s2 >> s3;
      cout << (char)toupper(s1[0]) << (char)toupper(s2[0]) << (char)toupper(s3[0]);
}

Measured memory_bytes: 256