akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
//define
#define int long long
#define rep(x,y) for(int i=x;i<y;i++)
#define REP(x,y) for(int j=x;j<y;j++)
#define Rep(x,y) for(int k=x;k<y;k++)
#define str string
#define vint vector<int>
#define vvint vector<vector<int>>
#define vc vector<char>
#define vvc vector<vector<char>>
#define vool vector<bool>
#define vtr vector<str>
#define vvtr vector<vector<str>>
#define pb() push_back()
#define elif else if
#define all(x) x.begin(),x.end()
//function
int shizuku(int);
//UnionFind
struct UnionFind{
  vint par;
  UnionFind(int N):par(N){
    rep(0,N)par[i]=i;
  }
  int root(int x){
    if(par[x]==x)return x;
    return par[x]=root(par[x]);
  }
  void unite(int x,int y){
    int rx=root(x);
    int ry=root(y);
    if(rx==ry)return;
    par[rx]=ry;
  }
  bool same(int x,int y){
    return root(x)==root(y);
  }
};

signed main(){
    int N,M,O,P,X,count=0,count2=0;
    double D;
    int c='A'-'a';
    char C;
    str S,T;
    cin>>N>>M;
    char A[N][N];
    char B[M][M];
    rep(0,N)REP(0,N)cin>>A[i][j];
    rep(0,M)REP(0,M)cin>>B[i][j];
    rep(0,N-M+1)REP(0,N-M+1){
      if(A[i][j]==B[0][0]){
        for(int k=0;k<M;k++)for(int l=0;l<M;l++){
          if(A[i+k][j+l]==B[k][l]){
            count+=1;
          }
        }
        if(count==M*M){
          count2=1;
        }
        count=0;
      }
    }
    if(count2==1)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
	int w,h;	cin>>w>>h;
	int n;	cin>>n;
	vector<int> p(n);
	for(int i=0;i<n;i++)	cin>>p[i];
	int posa=0,posb=0;
	int cnt=0;
	for(int i=0;i<n;i++){
		if(p[i]==1)	posa++;
		else posb++;
		if(0<=posa&&posa<=w-2){
			if(posa==posb)	cnt++;
		}
		if(w-2<=posa&&posa<=w+h-5){
			if(posa+2==posb)	cnt++;
		}
		if(w+h-5<=posa&&posa<=w+w+h-7){
			if(posa+4==posb)	cnt++;
		}
	}
	cout<<cnt<<endl;
	return 0;
}

Measured memory_bytes: 1196
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define repr(i,n) for(ll i=(n-1);i>=0;i--)
#define all(x) x.begin(),x.end()
#define br cout << "\n";
using namespace std;
const long long INF = 1e10;
const long long MOD = 1e9+7;
using Graph = vector<vector<ll>>;
using pll = pair<ll, ll>;
template<class T> inline bool chmin(T &a, T b) { if(a > b){ a = b; return true;} return false;}
template<class T> inline bool chmax(T &a, T b) { if(a < b){ a = b; return true;} return false;}

// 0 false, 1 true 
// string to int : -48
// a to A : -32
// ceil(a)  1.2->2.0
// c++17	g++ -std=c++17 a.cpp

int main() {
    std::cout << std::fixed << std::setprecision(15);
    ll n; cin >> n;
    vector<ll> vec(n);
    rep(i, n){
        cin >> vec[i];
    }

    vector<ll> dp(n, INF);

    rep(i, n){
        ll tmp = lower_bound(all(dp), vec[i]) - dp.begin();
        dp[tmp] = vec[i];
    }

    ll ans = 0;
    rep(i, n){
        if(dp[i] < INF){
            ans++;
        }else{
            break;
        }
    }
    cout << ans << endl;

}


Measured memory_bytes: 4424
#include<stdio.h>
int main(void)
{
	int a,s[5][14],d=0,f,g,h,j,i;
	char z[2];
	for(i=1;i<=13;i++){
		s[1][i]=0;
		s[2][i]=0;
		s[3][i]=0;
		s[4][i]=0;
	}
	scanf("%d",&a);
	for(i=1;i<=a;i++){
		scanf(" %c %d",&z[1],&d);
	//	printf("%d %d\n",i,d);
		if(z[1]=='S'){
			s[1][d]=1;
		}
		else if(z[1]=='H'){
			s[2][d]=1;
		}
		else if(z[1]=='C'){
			s[3][d]=1;
		}
		else if(z[1]=='D'){
			s[4][d]=1;
		}
	}
	for(i=1;i<=4;i++){
		for(j=1;j<=13;j++){
			if(s[i][j]==0){
				if(i==1)
					printf("S %d\n",j);
				if(i==2)
					printf("H %d\n",j);
				if(i==3)
					printf("C %d\n",j);
				if(i==4)
					printf("D %d\n",j);
			}
		}
	}
	return 0;
}

Measured memory_bytes: 2660
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#define ll long long
using namespace std;
int main(){
    int n;
    cin>>n;
    map<int,int> amap;
    for(int i=0;i<n;i++){
        int a;
        cin>>a;
        amap[a]++;
    }
    for(const auto& item:amap){
        if(item.second>1){
            cout<<"NO"<<endl;
            return 0;
        }
    }
    cout<<"YES"<<endl;
    return 0;
}

Measured memory_bytes: 9600
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;

int main()
{
    string s; cin>>s;
    int n=s.size();
    int mx=0;
    for(int i=0; i<n; i++){
        bool dame=0;
        for(int j=i; j<n; j++){
            if(s[j]!='A' && s[j]!='C' && s[j]!='G' && s[j]!='T'){
                if(mx<j-i){
                    mx=j-i;
                    
                }
              dame=1;
                    break;
            }
        }
        if(!dame) mx=max(mx, n-i);
    }
    cout<<mx<<endl;
    return 0;
}

Measured memory_bytes: 256
# include <bits/stdc++.h>
using namespace std;
long long int n,k;
int main()
{
	scanf("%lld%lld",&n,&k);
	long long int m=n-k;
	if(m<0)	m=-m;
	long long int s=m%k;
	if(k-s<s)	s=k-s;
	printf("%lld",s);
	return 0;
	
}

Measured memory_bytes: 256
//*******Abhijit Burman***********//
//Jalpaiguri Government Engineering College//

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mk make_pair
#define MAXX (1000000000000000000+7)
#define fio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)

ll dp[100000];

ll count(ll a[], ll n)
{
	if(n<=1)
	{
		return 0;
	}
	if(dp[n-1]!=-1)
	{
		return dp[n-1];
	}
	else
	{
		if(n==2)
		{
			dp[n-1] = (abs(a[n-1]-a[n-2]));
		}
		else
		{
			dp[n-1] =  (min(abs(a[n-1]-a[n-2])+count(a,n-1),abs(a[n-1]-a[n-3])+count(a,n-2)));
		}
		return dp[n-1];
	}

}


void solve()
{
	ll n;
	cin>>n;
	ll a[n];
	memset(dp,-1,sizeof(dp));
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
	}
	ll ans = count(a,n);
	cout<<ans<<endl;
	//cout<<a<<" "<<b<<" "<<c<<endl;
}

int main()
{
	/*#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
	#endif*/

    //main code starts here//
    fio;
    ll t=1;
    //cin>>t;
    while(t--)
    {
    	solve();
    }


    //code ends///
    /*#ifndef ONLINE_JUDGE
    cout<<"\nTime Elapsed: " << 1.0*clock() / CLOCKS_PER_SEC << " sec\n";
	#endif*/
	return 0;

		
}

Measured memory_bytes: 4992
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define IOS; ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define MX 100001
#define FF freopen("input.in","r",stdin); freopen("output.txt","w",stdout);
int n;
int a[MX];
int dp[MX];
int f(int i)
{
    if(i==n)return 0;
    if(dp[i]!=-1)return dp[i];
    if(i<n-1)
        return dp[i]=min(f(i+1)+abs(a[i]-a[i+1]),f(i+2)+abs(a[i]-a[i+2]));
    else
        return dp[i]=f(i+1)+abs(a[i]-a[i+1]);
}
int main()
{
    //FF;
    IOS;
    cin>>n;
    for(int i=1; i<=n; i++)
    {
        cin>>a[i];
    }
    memset(dp,-1,sizeof dp);
    cout<<f(1);
}



Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (int i = (a), ed_##i = (b); i <= ed_##i; ++i)

#define N 4010
int A, B, n;
int d[N], t;
char f[N], g[5];

int main() {
    scanf("%d%d", &A, &B);
    n = A + B;
    if(A <= B) return puts("Impossible"), 0;
    FOR(i, 0, n - 1){
        if(!t) d[++t] = i;
        else{
            printf("? %d %d\n", d[t], i), fflush(stdout);
            scanf("%s", g);
            *g == 'Y' ? d[++t] = i : --t;
        }
    }
    const int u = d[t];
    f[u] = 49;
    FOR(i, 0, n - 1) if(i != u){
        printf("? %d %d\n", u, i), fflush(stdout);
        scanf("%s", g);
        f[i] = (*g == 'Y') + 48;
    }
    printf("! %s\n", f), fflush(stdout);
    return 0;
}

Measured memory_bytes: 3780
S = []

def func(A):
    for i in range(len(A)):
        if (A[i] in "+-*"):
            x = S.pop()
            y = S.pop()
            S.append(str(eval(y + A[i] + x)))
        else:
            S.append(A[i])
    return S[0]

A = list(input().split(" "))
print (func(A))


Measured memory_bytes: 5572
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
int INF = numeric_limits<int>::max() / 2;

const int n = 100001;
vector<bool> dp(100001,false); //falseなら素数

void Eratosthenes(){
    dp[0] = dp[1] = true;
    for(int i = 2; i < n; i++){
        if(dp[i]) continue;
        for(int j = i * 2; j < n; j += i){
            dp[j] = true;
        }
    }
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
	int n,h;
	cin >> n >> h;
	vector<int> a(n),b(n);
	int amax = 0;
	int sum = 0;
	for(int i = 0; i < n; i++){
		cin >> a[i] >> b[i];
	}
	int thrownum = 0;
	sort(a.begin(), a.end(), greater<int>());
	sort(b.begin(), b.end(), greater<int>());
	for(int i = 0; i < n; i++){
		if(a[0] < b[i]){
			sum += b[i];
			thrownum++;
		}
	}
	int ans = 0;
	
	if(sum >= h){
		while(h > 0){
			h -= b[ans];
			ans++;
		}
	}else{
		h -= sum;
		ans = thrownum + ((h + a[0] - 1) / a[0]);
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1024
# -*- coding: utf-8 -*-

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
from collections import defaultdict
from collections import deque
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def Yes(): print("Yes"); return
def No(): print("No"); return

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr

#####MakeDivisors######
def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors

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

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#####ChangeBase#####
def Base_10_to_n(X, n):
  if X//n:
    return Base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def Base_n_to_10(X, n):
  return sum(int(str(X)[-i])*n**i for i in range(len(str(X))))

#####IntLog#####
def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count

#############
# Main Code #
#############

N = inputI()

print(2**int_log(N,2))

Measured memory_bytes: 38384
import math
a, b, x = map(int, input().split())
if x >= b * a * a / 2:
    s = (2*a*a*b-2*x)/(a**3)
else:
    s = a*b*b/(2*x)
atan1 = math.degrees(math.atan(s))
print(atan1)

Measured memory_bytes: 38384
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <iomanip>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstring>
#include <climits>

using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> V;
typedef map<int, int> M;

constexpr ll INF = 1e18;
constexpr ll MOD = 1e9 + 7;
constexpr double PI = 3.14159265358979323846;
constexpr int di[] = {0, 0, 1, -1};
constexpr int dj[] = {1, -1, 0, 0};

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

    int n;
    ll a[112345];

    ll sum = 0;

    ll exOne = 0;

    cin >> n;
    REP(i, n)
    {
        cin >> a[i];
        sum += a[i];

        exOne += (i % 2) * a[i];
    }

    sum /= 2;

    ll res[112345];

    res[0] = sum - exOne;

    for (int i = 1; i < n; i++)
        res[i] = a[i - 1] - res[i - 1];

    REP(i, n)
    cout << res[i] * 2 << (i < n - 1 ? " " : "\n");

    return 0;
}


Measured memory_bytes: 2944
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for(int(i) = 0; (i) < (n); (i)++)
#define FOR(i, m, n) for(int(i) = (m); (i) < (n); (i)++)
#define All(v) (v).begin(), (v).end()
#define pb push_back
#define MP(a, b) make_pair((a), (b))
typedef long long ll;
const int INF = 1 << 30;
const ll LINF = 1LL << 60;
const int MOD = 1e9 + 7;

ll dp[2100000];

int main() {
    int N;
    cin >> N;
    vector<vector<int>> A(N, vector<int>(N));
    rep(i, N) rep(j, N) cin >> A[i][j];
    // dp[i][j]:=男性[0,i)、女性[0,j)まで見たときのペアを作る通り数
    // dp[S]:=ペアになっている女性の集合がSで表されるときの通り数
    // 男性は若番からペアにしていく
    dp[0] = 1;
    for(int bit = 1; bit < (1 << N); bit++) {
        int i = __builtin_popcount(bit);
        for(int j = 0; j < N; j++) {
            if(((bit >> j) & 1) == 1 && A[i - 1][j] == 1) {
                int prev = (bit & ~(1 << j));
                dp[bit] = (dp[bit] + dp[prev]) % MOD;
            }
        }
    }
    cout << dp[(1 << N) - 1] << endl;
    return 0;
}

Measured memory_bytes: 16640
#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <string>
#include <map>
#include <iomanip>
#include <algorithm>
#include <queue>
#include <stack>
#include <set>
#include <vector> 
// #include <bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define sp ' '
#define endl '\n'
#define inf  0x3f3f3f3f;
#define FOR(i,a,b) for( int i = a;i <= b;++i)
#define bug cout<<"--------------"<<endl
#define P pair<int, int>
#define fi first
#define se second
#define pb(x) push_back(x)
#define ppb() pop_back()
#define mp(a,b) make_pair(a,b)
#define ms(v,x) memset(v,x,sizeof(v))
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define repd(i,a,b) for(int i=a;i>=b;i--)
#define sca3(a,b,c) scanf("%d %d %d",&(a),&(b),&(c))
#define sca2(a,b) scanf("%d %d",&(a),&(b))
#define sca(a) scanf("%d",&(a));
#define sca3ll(a,b,c) scanf("%lld %lld %lld",&(a),&(b),&(c))
#define sca2ll(a,b) scanf("%lld %lld",&(a),&(b))
#define scall(a) scanf("%lld",&(a));


using namespace std;
typedef long long ll;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
ll powmod(ll a, ll b, ll mod){ll sum = 1;while (b) {if (b & 1) {sum = (sum * a) % mod;b--;}b /= 2;a = a * a % mod;}return sum;}

const double Pi = acos(-1.0);
const double epsilon = Pi/180.0;
const int maxn = 2e5+10;
int main()
{
	int n;
	cin>>n;
	int t = n%10;
	if(t == 3)
	{
		cout<<"bon"<<endl;
	}
	else if(t == 0 || t == 1 || t == 6 || t == 8)
	{
		cout<<"pon"<<endl;
	}
	else {
		cout<<"hon"<<endl;
	}
}

Measured memory_bytes: 3016
#include<stdio.h>
int main(void){
	
	int i,N,X,m[100];
	scanf("%d%d",&N,&X);
	
	for(i=0;i<N;i++){
		scanf("%d",&m[i]);
	}
	
	for(i=0;i<N;i++){
		X=X-m[i];
	}
	
	int m_min=m[0];
	
	for(i=1;i<N;i++){
		if(m_min>m[i]){
			m_min=m[i];
		}
	}
	
	int m_min_tuikakosuu=1;
	
	
	if(X>=m_min_tuikakosuu*m_min){
	while(X>=m_min_tuikakosuu*m_min){
		m_min_tuikakosuu++;
	}
	
	printf("\n%d\n\n",N+m_min_tuikakosuu-1);
	}else {
		printf("\n%d\n\n",N);
	}
	return 0;
}


Measured memory_bytes: 128
import java.util.*;
public class Main {

  public static void main(String[] args) { 
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int min = Integer.MAX_VALUE;
      int max = Integer.MIN_VALUE;
      while(n-- > 0) {
        int num = sc.nextInt();
        min = Math.min(min, num);
        max = Math.max(max, num);
      }
      System.out.println(max - min);
  } 
}


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

typedef long long int ll;
typedef long int li;

const ll mod = 1000000007;
const ll inf = 1000000000000000000;

typedef vector<int> vi;
typedef vector<li> vli;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<vi> vvi;
typedef vector<vli> vvli;
typedef vector<vll> vvll;
typedef vector<vs> vvs;
typedef map<ll, ll> mll;
typedef map<ll, string> mls;
typedef map<string, ll> msl;

#pragma GCC optimize ("-O3")
#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); 
#define PI 3.14159265358979323846
#define pb push_back
#define mp make_pair
#define fs first
#define sec second
#define pq priority_queue
#define lb lower_bound
#define ub upper_bound
#define tol(s) transform(s.begin(), s.end(), s.begin(), ::tolower);
#define tou(s) transform(s.begin(), s.end(), s.begin(), ::toupper);
#define all(v) v.begin(), v.end()
#define FOR(i, j, k, in) for(li i=j; i<k; i+=in)
#define RFOR(i, j, k, de) for(li i=j; i>=k; i-=de)
#define rep(i,j,k) FOR(i, j, k, 1)
#define rrep(i,j,k) RFOR(i, j, k, 1)
#define repc(v) for(auto it=v.begin(); it!=v.end(); it++)
#define T ll t; cin>>t; while(t--)

int main(){
  FAST

  string s;cin>>s;
  if(s[3]==s[2] && s[4]==s[5])
    cout<<"Yes\n";
  
  else cout<<"No\n";
  
  return 0;
}









Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
template <class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); }
template <class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); }
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
typedef vector<long long> vlong;
typedef vector<string> vstring;
#define vpush(a,x) a.push_back(x);
#define rep(i, n) REP(i, 0, n)
#define all(v) v.begin(), v.end()
#define REP(i, x, n) for(int i = x; i < n; i++)
const int INF = 1 << 30;
const int dx[] = {1,0,-1,0,1,1,-1,-1};
const int dy[] = {0,-1,0,1,1,-1,-1,1};
#define stp(x)  setprecision(x)
int main(){
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n;
  cin>>n;
  int count=0;
  REP(i,1,n+1){
    REP(j,1,n+1){
      if(i*j>=n){
        break;
      }
      count++;
    }
  }
  cout<<count<<'\n';
  return(0);
}


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

#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define endl '\n'

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

const int INF = 1e9;
const int MOD = 1e9 + 7;
const int MAXN = 2e5 + 5;

ll N;
int mp[4][50 + 1][23 + 1];

pii count(ll x) {
	pii ret = pii(0, 0);
	while(x % 2 == 0) {
		x /= 2;
		ret.fi++;
	}
	while(x % 5 == 0) {
		x /= 5;
		ret.se++;
	}
	return ret;
}

ll gcd(ll a, ll b) {
	if(a < b) swap(a, b);
	if(b == 0) return a;
	return gcd(b, a%b);
}

int f(int k, int x, int y) {
	int ret = 0;
	if(k == 0) for(int i=0; i<=x; i++) for(int j=0; j<=y; j++) ret += mp[k][i][j];
	if(k == 1) for(int i=0; i<=x; i++) for(int j=y; j<=23; j++) ret += mp[k][i][j];
	if(k == 2) for(int i=x; i<=50; i++) for(int j=0; j<=y; j++) ret += mp[k][i][j];
	if(k == 3) for(int i=x; i<=50; i++) for(int j=y; j<=23; j++) ret += mp[k][i][j];
	return ret;
}

ll ans;

int main() {
	ios::sync_with_stdio(0); cin.tie(0);
	cin >> N;
	for(int i=1; i<=N; i++) {
		string s; cin >> s;
		ll d = 1, a = 0, b = 1;
		for(int j=(int)s.size()-1; j>=0; j--) {
			if(s[j] == '.') b = d;
			else {
				a += d * (s[j]-'0');
				d *= 10;
			}
		}
		ll g = gcd(a, b);
		a /= g; b /= g;

		pii x, y;

		x = count(a);
		y = count(b);

		if(x.fi > 0 && x.se > 0) ans += f(0, x.fi, x.se);
		else if(x.fi > 0) ans += f(1, x.fi, y.se);
		else if(x.se > 0) ans += f(2, y.fi, x.se);
		else ans += f(3, y.fi, y.se);


		mp[0][y.fi][y.se]++;
		if(y.se == 0) mp[1][y.fi][x.se]++;
		if(y.fi == 0) mp[2][x.fi][y.se]++;
		if(y == pii(0, 0)) mp[3][x.fi][x.se]++;
	}
	cout << ans;
}

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

using namespace std;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
template<class T> inline T sqr(T x) {return x*x;}

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;

#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair
#define each(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define exist(s,e) ((s).find(e)!=(s).end())
#define range(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  range(i,0,n)
#define clr(a,b) memset((a), (b) ,sizeof(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

const double eps = 1e-10;
const double pi  = acos(-1.0);
const ll INF =1LL << 62;
const int inf =1 << 24;

int main(void){
    for(int n, m; cin >> n >> m;){
        vi a(n); for(auto && aa : a) cin >> aa;
        vi b(m); for(auto && bb : b) cin >> bb;

        vi v(n);
        for(int bb : b){
            rep(i, n){
                if(a[i] <= bb){
                    v[i]++;
                    break;
                }
            }
        }

        cout << max_element(all(v)) - v.begin() + 1 << endl;
    }

	return 0;
}

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

#define ASC(vec) vec.begin(), vec.end()		// 昇順ソート 例：sort(ASC(vec));
#define DESC(vec) vec.rbegin(), vec.rend()	// 降順ソート 例:sort(DESC(vec));
#define rep(i, n) for(int i = 0; i < n; i++)
#define Rep(i, n) for(int i = 1; i < n; i++)
#define In(vec) rep(i, n) cin>>vec[i];
#define ANS(s) cout << s << endl
#define inc(a, b) cin >> a >> b;

const int mod = 1000000007;
const int inf = (int)1e9 + 7;
const long long INF = 1LL << 60;

typedef long long ll;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<ll> vl;
typedef vector<vector<int> > vvi;
typedef vector<pair<int, int> > vii;

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

ll GCD(ll a, ll b) { return b ? GCD(b, a % b) : a; }
int round_int(int a, int b) { return (a + (b - 1)) / b; }


// 4,8方向に探索する際に用いる配列
//int dx[4] = { 0,  0, 1, -1 };
//int dy[4] = { 1, -1, 0,  0 };
//int dx[8] = { 1, 0, -1,  0, 1, -1, -1,  1 };
//int dy[8] = { 0, 1,  0, -1, 1,  1, -1, -1 };

// ────────────────────────────────────────────────────

bool isUruu(int y) {
	bool ok = true;

	if (y % 4 == 0) {
		if (y % 100 == 0) ok = false;
		if (y % 400 == 0) ok = true;
	}
	else ok = false;

	return ok;
}

int main() {
	int w, h;
	char c;
	cin >> w >> h >> c;

	vector<vector<char> > t(h, vector<char>(w));

	t[0][0] = t[0][w - 1] = t[h - 1][0] = t[h - 1][w - 1] = '+';
	for (int i = 1; i < h - 1; ++i) t[i][0] = t[i][w - 1] = '|';
	for (int i = 1; i < w - 1; ++i) t[0][i] = t[h - 1][i] = '-';
	for (int i = 1; i < h - 1; ++i) {
		for (int j = 1; j < w - 1; ++j) {
			t[i][j] = '.';
		}
	}
	t[(h - 1) / 2][(w - 1) / 2] = c;
	rep(i, h) {
		rep(j, w) {
			cout << t[i][j];
		}
		cout << endl;
	}
}

/*

	string s, t, u, v;
	cin >> s;

	t.push_back(s[0]);
	t.push_back(s[1]);
	t.push_back(s[2]);
	t.push_back(s[3]);
	u.push_back(s[5]);
	u.push_back(s[6]);
	v.push_back(s[8]);
	v.push_back(s[9]);

	int y = atoi(t.c_str());
	int m = atoi(u.c_str());
	int d = atoi(v.c_str());

*/


Measured memory_bytes: 3172
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <numeric>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>
#include <cstdarg>
#include <sys/time.h>
#include <fstream>
//#include "cout.h"

using namespace std;

#define SZ(x) ((int)x.size())
#define MSET(x,a) memset(x, a, (int)sizeof(x))
#define PB push_back
#define VI vector < int >
#define PII pair < int, int >
#define LL long long
#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(), (v).end()
#define FIT(it,v) for (__typeof((v).begin()) it = (v).begin(); it != (v).end(); it++)
#define OUT(A) cout << #A << " = "<< (A) << endl
#define OUT2(A, B) cout << "(" << #A << ", " << #B << ") = (" << (A) << ", "<< (B) << ")" << endl
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }

#define present(c, e) ((c).find((e)) != (c).end())
#define cpresent(c, e) (find(ALL(c), (e)) != (c).end())

int n, m;
int r;
vector<int> e[100010];
vector<int> topo;
// bool used[100010];
int in[100010];
int parent[100010];

void init() {

}

// void dfs(int i) {
//   if (used[i]) return;
//   used[i] = true;
//   REP(j, SZ(e[i])) dfs(e[i][j]);
//   topo.push_back(i);
// }
//
// void makeTopo() {
//   topo.clear();
//   REP(i, n) dfs(i);
//   reverse(ALL(topo));
// }

void input() {
  REP(i, 100010) {
    e[i].clear();
    parent[i] = -1;
    in[i] = 0;
  }
  cin >> n >> m;
  REP(i, n+m-1) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    e[a].push_back(b);
    in[b]++;
  }
  queue<int> q;
  REP(i, n) if (in[i] == 0) q.push(i);
  while(SZ(q)) {
    int i = q.front();
    topo.push_back(i);
    q.pop();
    REP(j, SZ(e[i])) {
      in[e[i][j]]--;
      if (in[e[i][j]] == 0) q.push(e[i][j]);
    }
  }
  REP(i, n) {
    REP(j, SZ(e[topo[i]])) {
      parent[e[topo[i]][j]] = topo[i];
    }
  }
  REP(i, n) cout << parent[i] + 1 << endl;
}

void solve() {

}

int main() {
	init();
	input();
	solve();
	return 0;
}


Measured memory_bytes: 7544
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String w = sc.next();
        String str[] = w.split("");
        Arrays.sort(str);
        boolean ans = true;
        int count = 1;
        for(int i = 0 ; i < w.length()-1 ; ++i){
            if(str[i].equals(str[i+1])){
                count++;
            }else if(count%2==1){
                ans = false;
                break;
            }else{
                count = 1;
            }
        }
        if(count%2==1) ans = false;
        if(ans) System.out.println("Yes");
        else System.out.println("No");
    }
}


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

#define pb push_back
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define sz(a) int((a).size())
#define endl '\n'

using namespace std;

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

int32_t main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
//	#ifndef ONLINE_JUDGE
//	freopen("input.txt","r",stdin);
//	freopen("output.txt","w",stdout);
//	#endif
	int g[3][3];
	for(int i=0;i<3;++i){
		for(int j=0;j<3;++j){
			cin>>g[i][j];
		}
	}
	int b[3];
	bool ok=false;
	for(int i=0;i<3;++i){
		bool tmp = true;
		for(int j=0;j<3;++j){
			b[j]=g[i][j];
		}
		for(int j=0;j<3;++j){
			int a = g[j][0]-b[0];
			for(int k=1;k<3;++k){
				if(g[j][k] != a+b[k])
					tmp=false;
			}
		}
		if(tmp)
			ok=true;
	}
	cout<<(ok?"Yes":"No")<<endl;
	return 0;
}

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

int main(void) {
	int i, j;
	int h, w;

	scanf("%d %d", &h, &w);

	for (i = 0; i < h; i++)
		for (j = 0; j < w; j++) {
			char s[6];
			scanf("%s", &s);
			if (!strcmp(s, "snuke"))
				printf("%c%d\n", 'A' + j, i + 1);
		}

	return 0;
}


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

i = 357
count = 0
if 357 <= N:
    while(1):
        flag = 0
        flag7 = 0
        flag5 = 0
        flag3 = 0
        for j,s in enumerate(str(i)):
            if s != "7" and s != "5" and s != "3":
                flag = 1
                i += 10 ** (len(str(i)) - j - 1)
                break
            if s == "7":
                flag7 = 1
            elif s == "5":
                flag5 = 1
            elif s == "3":
                flag3 = 1
        if flag == 0 and flag7 == 1 and flag5 == 1 and flag3 == 1:
            count += 1
        if flag == 0:
            i += 1
        if N < i:
            break

print(count)

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

int main()
{

    int a, b, c, d;
    cin >> a >> b >> c >> d;

    if (abs(a - c) <= d) {
        cout << "Yes";
    } else if (abs(a - b) <= d && abs(b - c) <= d) {
        cout << "Yes";
    } else {
        cout << "No";
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define precise(i) fixed << setprecision(i)
#define fastIO (cin.tie(0), cout.tie(0), ios::sync_with_stdio(false))
using lint = long int;
using llint = long long int;
using namespace std;

int main() {
    fastIO;
    int n;
    cin >> n;

    vector<int> L(n * 2);
    rep(i, n * 2) cin >> L.at(i);
    sort(L.begin(), L.end());

    int sum = 0;
    for (int i = L.size() - 1; i >= 0; i -= 2) {
        sum += min(L.at(i), L.at(i - 1));
    }
    cout << sum << endl;
}

Measured memory_bytes: 3568
//http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1127
//Building a Space Station
#include <bits/stdc++.h>
#if LOCAL
#include "dump.hpp"
#else
#define dump(...)
#endif
using namespace std;
using ll=long long;
const ll LINF = 0x1fffffffffffffff;
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
template<class T>bool chmax(T &a, const T &b) {if (a<b) { a=b; return 1; } return 0;}
template<class T>bool chmin(T &a, const T &b) {if (b<a) { a=b; return 1; } return 0;}

template< typename T >
struct edge {
	int src, to;
	T cost;
	edge(int _to, T _cost) : src(-1), to(_to), cost(_cost) {}
	edge(int _src, int _to, T _cost) : src(_src), to(_to), cost(_cost) {}
	edge &operator=(const int &x) {
		to = x;
		return *this;
	}
	operator int() const { return to; }
};

template< typename T>
struct node {
	vector<edge<T>> edges;
};

template< typename T >
using Edges = vector< edge< T > >;
template< typename T >
using WeightedGraph = vector< node< T > >;
using UnWeightedGraph = vector< vector< int > >;
template< typename T >
using Matrix = vector< vector< T > >;

template< typename T >
bool operator<(const edge<T> &e, const edge<T> &f) { return e.cost > f.cost; }
template< typename T >
std::pair<T, Edges<T>> prim(const WeightedGraph<T> &g, int r = 0) {
  Edges<T> edges;
  T total = T();
  std::vector<int> vis(g.size());
  std::priority_queue<edge<T>> q;
  q.emplace(-1, r, 0);
  while (q.size()) {
    auto e = q.top();
    q.pop();
    if (vis[e.to]) continue;
    vis[e.to] = true;
    total += e.cost;
    if (e.src != -1) edges.emplace_back(e);
    for (auto &f : g[e.to].edges)
      if (!vis[f.to]) q.emplace(f);
  }
  return std::make_pair(total, edges);
}

bool solve(){
  ll n; cin>>n;
  if(n<=0) return false;
  struct Posr{
    double x,y,z,r;
  };
  vector<Posr> tbl;
  REP(i,n){
    Posr pr;
    cin>>pr.x>>pr.y>>pr.z>>pr.r;
    tbl.emplace_back(move(pr));
  }
  auto length = [](const Posr& p0, const Posr& p1){
    auto x=p0.x-p1.x;
    auto y=p0.y-p1.y;
    auto z=p0.z-p1.z;
    return sqrt(x*x+y*y+z*z);
  };

  WeightedGraph<double> graph(n);
  FOR(i,0,tbl.size()){
    FOR(j,i+1,tbl.size()){
      const auto& p0=tbl.at(i);
      const auto& p1=tbl.at(j);
      auto len = length(p0,p1);
      auto cost=max<double>(0,len-p0.r-p1.r);
      graph.at(i).edges.emplace_back(i,j,cost);
      graph.at(j).edges.emplace_back(j,i,cost);
    }
  }

  auto mst=prim(graph);
  cout<<fixed<<std::setprecision(3)<<mst.first<<endl;

  return true;
}
int main() {
#if LOCAL&01
  //std::ifstream in("./test/sample-1.in");
  std::ifstream in("./input.txt");
  std::cin.rdbuf(in.rdbuf());
#else
  cin.tie(0);
  ios::sync_with_stdio(false);
#endif
  while(solve()){
  }
  return 0;
}


Measured memory_bytes: 3584
N, M = map(int, input().split())
X = [-1] * N
for _ in range(M):
    s, c = map(int, input().split())
    if s == 1 and N > 1 and c == 0:
        print(-1)
        exit()
    if X[s-1] < 0:
        X[s-1] = c
    elif X[s-1] != c:
        print(-1)
        exit()

if X[0] < 0: X[0] = 1 if N > 1 else 0
print("".join([str(x) if x >= 0 else "0" for x in X]))


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

using namespace std;

int main()
{
	int w, h, n;
	cin >> w >> h >> n;
	int x, y, a;
	int x1 = 0, x2 = w, y1 = 0, y2 = h;
	for (int i = 0; i < n; i++)
	{
		cin >> x >> y >> a;
		if (a == 1) x1 = max(x1, x);
		else if (a == 2) x2 = min(x2, x);
		else if (a == 3) y1 = max(y1, y);
		else if (a == 4) y2 = min(y2, y);
	}
	x2 = max(x1, x2);
	y2 = max(y1, y2);
	cout << (x2-x1)*(y2-y1) << endl;
	return 0;
}


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

int main(){
    int x, y;
    cin >> x >> y;
    int ans;
    if(x < y)   ans = min(y-x, abs(y+x)+1);
    else        ans = min(x-y+2, abs(y+x)+1);
    cout << ans << endl;
    return 0;
}

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

int main(){

    int a,b,c,d;
    int ans=0;

    cin >>a >>b >>c >>d;

    if(a>b){
        ans+=b;
    }else{
        ans+=a;
    }
    if(c>d){
        ans+=d;
    }else{
        ans+=c;
    }

    cout <<ans <<endl;

    return 0;
}

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

int main(){
    char s[1001];
    cin >> s;
    for(int i=0;i<strlen(s);i+=2){
        if(s[i] == '1') goto solve;
        if(s[i] == '0') {
            if(s[i+1] == 'U') {
                cout << "nn";
                continue;
            }
            cout << "w";
            goto solve;
        }
        if(s[i] == '2') cout << "k";
        else if(s[i] == '3') cout << "s";
        else if(s[i] == '4') cout << "t";
        else if(s[i] == '5') cout << "n";
        else if(s[i] == '6') cout << "h";
        else if(s[i] == '7') cout << "m";
        else if(s[i] == '8') cout << "y";
        else if(s[i] == '9') cout << "r";
    solve:
        if(s[i+1] == 'T') cout << "a";
        else if(s[i+1] == 'L') cout << "i";
        else if(s[i+1] == 'U') cout << "u";
        else if(s[i+1] == 'R') cout << "e";
        else if(s[i+1] == 'D') cout << "o";
    }
    cout << endl;
}

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

#define REP(i, n) for(int (i)=0;(i)<(n);++(i))
#define MOD 1000000007

using namespace std;

typedef long long ll;

int main()
{
    int N, C;
    cin >> N >> C;
    int D[C][C] = {0};
    int c[N][N] = {0};
    REP(i, C)
    {
        REP(j, C)
        {
            cin >> D[i][j];
        }
    }
    REP(i, N)
    {
        REP(j,N)
        {
            cin >> c[i][j];
            c[i][j]--;
        }
    }

    int ans = INT32_MAX;
    int scoreR0[C] = {0};
    int scoreR1[C] = {0};
    int scoreR2[C] = {0};
    REP(color, C)
    {
        for(int i = 0; i < N; ++i)
        {
            for(int j = 0; j < N; ++j)
            {
                if ((i + j) % 3 == 0) scoreR0[color] += D[c[i][j]][color];
                else if ((i + j) % 3 == 1) scoreR1[color] += D[c[i][j]][color];
                else if ((i + j) % 3 == 2) scoreR2[color] += D[c[i][j]][color];
            }
        }
    }
    
    REP(c0, C)
    {
        int score = 0;
        REP(c1, C)
        {
            if (c1 != c0)
            {
                REP(c2, C)
                {
                    if (c2 != c0 && c2 != c1)
                    {
                        score = scoreR0[c0] + scoreR1[c1] + scoreR2[c2];
                        ans = min(ans, score);
                    }
                }
            }
        }
    }

    cout << ans << endl;
}


Measured memory_bytes: 1280
#include<cstdio>
#include<algorithm>
#define re register
int m,ans = 0;
template <typename T>
inline void read(T &x){
    x = 0; char ch = getchar(); int f = 1;
    for(;ch > '9' || ch < '0'; ch = getchar()) if(ch == '-') f = -1;
    for(;ch <= '9' && ch >= '0'; ch = getchar()) x = x * 10 + ch - '0';
    x *= f;
}
int main(){
    read(m);
    for(re int i = 1,u;i <= m; i++){
        read(u);
        if((u & 1) && (i & 1)) ans++;
    }
    printf("%d\n",ans);
    return 0;
}
/*

*/

Measured memory_bytes: 1604
#include<bits/stdc++.h>
using namespace std;
int used[100005];
int main()
{
    int n;
    cin >> n;
    vector<int> num(n);
    for(int i = 0;i < n;i++)
        scanf("%d",&num[i]);

    for(int i = 0;i < n;i++)
    {
        used[num[i]]++;
        used[num[i]-1]++;
        used[num[i]+1]++;
    }
    int e = 0;
    for(int i = 0;i <= 1e5 + 2;i++)
        e = max(e,used[i]);
    cout << e;
    return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std; 
int main(){
    stack<int> s;
    int n,k;
    cin>>n>>k;
    int temp = n;
    while(temp>0){
    	s.push(temp%k);
    	temp/=k;
	}
	int count=0;
	while(!s.empty())
	{
		count++;
		s.pop();
	}
	cout<< count<< endl;
}

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

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

                if(x*2<=y&& x*4>=y && y%2==0)
                    cout << "Yes";
               
                else
                       cout << "No";
            
            return 0;
        }

Measured memory_bytes: 3584
#include<bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n ; i++)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define whole(f, x, ...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x) // decltypeで型取得、引数があればva_argsのところに入れる
using namespace std;
typedef long long ll; // long longをllでかけるようにした
const int INF = 1e9;

int main(void){
    int N; cin >> N;
    vector<pair<int, int>> student(N);
    REP(i, N){
        cin >> student[i].first;
        student[i].second = i + 1;
    }
    whole(sort, student);
    REP(i, N){
        if(i != 0) cout << " ";
        cout << student[i].second;
    }
    cout << endl;
}

Measured memory_bytes: 1664
#include <bits/stdc++.h>
using namespace std;
int main(){
    int N; cin>>N;
    map<string,int>mp;
    string S;
    int maximum=0;
    for(int i=0;i<N;i++){
        cin>>S;
        if(!mp.count(S)){
            mp[S]=1;
            maximum=max(maximum,1);
        }
        else{
            mp[S]++;
            maximum=max(maximum,mp[S]);
        }
    }
    for(auto i:mp){
        if(i.second==maximum){
            cout<<i.first<<endl;
        }
    }
    return 0;
}

Measured memory_bytes: 27008
#include <iostream>
#include <cstdio>
#include <vector>
#include <iomanip>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
using namespace std;

int main() {
    int A;

    cin >> A;

    cout << A+A*A+A*A*A << endl;
    return 0;
}

Measured memory_bytes: 3644
fun main(args: Array<String>) {
    val N = nextInt()
    val S = next()
    if (N % 2 == 0) {
        val T = S.substring(0 until N/2 )
        println(if (S == T + T) "Yes" else "No")
    } else {
        println("No")
    }
}
fun next() = readLine()!!
fun nextInt(delta: Int = 0) = Integer.parseInt(next()) + delta

Measured memory_bytes: 33744
/*
 * atcoder/abc116/c.cpp
 */

// C++ 14
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring> // memset
#include <cassert>
#include <stack>
using namespace std;
#define ll long long
#define loop(__x, __start, __end) for(int __x = __start; __x < __end; __x++)
template <class T> bool chmin(T &a, T b) { if (a > b) {a = b; return true; } return false; }
template <class T> bool chmax(T &a, T b) { if (a < b) {a = b; return true; } return false; }


const int INF = 1000000;
const int MAX = 101;
int N;
int H[MAX];
int A[MAX] = {0};

void solve() {
  cin >> N;
  loop(n,0,N) cin >> H[n];

  int count = 0;
  loop(n,0,N) {
    if (n==0) { count = H[0]; continue; }
    if (H[n] > H[n-1]) count += H[n] - H[n-1];
  }
  cout << count << endl;
}
int main() {
  // cout.precision(15);
  // cout << fixed << double

  solve();

  return 0;
}


Measured memory_bytes: 256
n, m, x = map(int, input().split())
c = [list(map(int, input().split())) for _ in range(n)]
ans = []
for i in range(2 ** n):
    price = 0
    und = [0 for _ in range(m)]
    for j in range(n):
        if (i >> j) & 1:
            price += c[j][0]
            for k in range(m):
                und[k] += c[j][k+1]
    if all(und[i] >= x for i in range(m)):
        ans.append(price)
 
if ans == []:
    print(-1)
else:
    print(min(ans))

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

void p(int ma[][5],int h){
  cout<<endl;
  for(int i=0;i<h;i++){
    for(int j=0;j<5;j++){
      if(j)cout<<" ";
      cout<<ma[i][j];
    }
    cout<<endl;
  }
}

int main(){
  int h;
  int ma[10][5];
  while(cin>>h,h){
    for(int i=0;i<h;i++){
      for(int j=0;j<5;j++)
	cin>>ma[i][j];
    }
    int ans=0;
    int flag=1;
    while(flag){
      flag=0;
      for(int x=0;x<h;x++){
	for(int i=0;i<3;i++){
	  if(ma[x][i]==0)continue;
	  int k=1;
	  for(int j=i+1;j<5;j++){
	    if(ma[x][j]==ma[x][j-1])k++;
	    else break;
	  }
	  if(k>=3){
	    flag=1;
	    for(int j=0;j<k;j++){
	      ans+=ma[x][i+j];
	      ma[x][i+j]=0;
	    }
	    break;
	  }
	}
      }
      // p(ma,h);
      for(int i=0;i<5;i++){
	for(int j=h-1;j>=0;j--){
	  if(ma[j][i]==0){
	    //cout<<"a"<<endl;
	    for(int k=j;k>=0;k--){
	      if(ma[k][i]!=0){
		swap(ma[j][i],ma[k][i]);
		break;
	      }
	    }
	  }
	}
      }
      // p(ma,h);
    }
    cout<<ans<<endl;
  }
  return 0;
}



Measured memory_bytes: 3048
import java.util.*;

class Main{
	public static void main(String[] args){
		Solve s = new Solve();
		s.solve();
	}	
}

class Solve{
	Solve(){}
	
	Scanner in = new Scanner(System.in);

	void solve(){
		int n = in.nextInt();
		int a = in.nextInt(), b = in.nextInt();
		int c = in.nextInt();

		int[] d = new int[n];
		for(int i = 0; i < n; i++) d[i] = -in.nextInt();

		Arrays.sort(d);

		int ans = c, i = 0;
		while(true){
			if((double)c/a < (double)(c - d[i])/(a + b)){
				c -= d[i];
				a += b;
				i++;
			}
			else break;
		}

		System.out.println(c/a);
	}
	
	
}

Measured memory_bytes: 26400
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int w = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        
        int answer = Math.max(a,b)-Math.min(a,b) -w;
        if(answer <0){
            System.out.println(0);
        }else{
            System.out.println(answer);
        }
    }
}

Measured memory_bytes: 21716
#include <bits/stdc++.h>
#define all(x) begin(x), end(x)
#define dbg(x) cerr << #x << " = " << x << endl
#define _ << ' ' <<
using namespace std;
using ll = long long;
using vi = vector<int>;

int a[26];

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    for (int i = 0; i < n; ++i)
    {
        string s;
        cin >> s;
        a[s[0] - 'A']++;
    }
    vi b(5);
    string s = "MARCH";
    for (int i = 0; i < 5; ++i)
        b[i] = a[s[i] - 'A'];
    ll sol = 0;
    for (int i = 0; i < 5; ++i)
        for (int j = i + 1; j < 5; ++j)
            for (int k = j + 1; k < 5; ++k)
                sol += 1ll * b[i] * b[j] * b[k];
    cout << sol;
}


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

using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define POW2(n) (1LL << (n))
#define FOR(i, begin, end) for (int i = (begin), i##_end_ = (end); i < i##_end_; i++)
#define IFOR(i, begin, end) for (int i = (end)-1, i##_begin_ = (begin); i >= i##_begin_; i--)
#define REP(i, n) FOR(i, 0, n)
#define IREP(i, n) IFOR(i, 0, n)

int main()
{
    lint n;cin >> n;
    lint ans=0;
    if(n%2){
        cout << 0 << "\n";
        return 0;
    }
    while(n){
        n /= 5;
        ans += n / 2;
    }
    cout << ans << "\n";
    return 0;
}

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

int main(){
    map<string, int> s;
    int n;
    cin >> n;

    rep(i, n){
        string tmp;
        cin >> tmp;
        s[tmp]++;
    }

    cout << "AC x " << s["AC"] << endl;
    cout << "WA x " << s["WA"] << endl;
    cout << "TLE x " << s["TLE"] << endl;
    cout << "RE x " << s["RE"] << endl;

    
}

Measured memory_bytes: 3632
// 2011/08/02 Tazoe

#include <iostream>
#include <string>
#include <map>
#include <vector>
using namespace std;

int min_cost(string str_itm, map<string, int>& itm, map<string, vector<string> >& rcp)
{
	// VsªÈ¢ê
	if(rcp.find(str_itm)==rcp.end())
		return itm[str_itm];

	int cost_rcp = 0;
	for(vector<string>::iterator p=rcp[str_itm].begin(); p<rcp[str_itm].end(); p++)
		cost_rcp += min_cost(*p, itm, rcp);

	if(cost_rcp<itm[str_itm])
		return cost_rcp;
	else
		return itm[str_itm];
}

int main()
{
	while(true){
		int n;
		cin >> n;
		if(n==0)
			break;

		map<string, int> itm;
		for(int i=0; i<n; i++){
			string str_i;
			int p;
			cin >> str_i >> p;
			itm[str_i] = p;
		}

		int m;
		cin >> m;

		map<string, vector<string> > rcp;
		for(int i=0; i<m; i++){
			string str_o;
			int k;
			cin >> str_o >> k;
			for(int j=0; j<k; j++){
				string str_q;
				cin >> str_q;
				rcp[str_o].push_back(str_q);
			}
		}

		string str_itm;
		cin >> str_itm;

		cout << min_cost(str_itm, itm, rcp) << endl;
	}

	return 0;
}

Measured memory_bytes: 0
/************************* In the name of Allah *************************/
#include <bits/stdc++.h>
using namespace std;

typedef long long       ll;
typedef long double     ld;
typedef string          str;
typedef pair<ll,ll>     pll;

#define F               first
#define S               second
#define pb              push_back
#define sep             ' '
#define endl            '\n'
#define fast_io         ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);

const ll MOD = 1e9 + 7,
         INF = 1e18,
         MAXN = 1e5 + 10;

int main(){
    fast_io
    ll n;
    cin >> n;
    cout << n * (n - 1) / 2;
    return 0;
}

/*
 __  __       _         _ _  _____ _           _                __ _
|  \/  |     | |       | (_)/ ____| |         | |              / _(_)
| \  / | __ _| |__   __| |_| (___ | |__   ___ | | _____  _   _| |_ _
| |\/| |/ _` | '_ \ / _` | |\___ \| '_ \ / _ \| |/ / _ \| | | |  _| |
| |  | | (_| | | | | (_| | |____) | | | | (_) |   < (_) | |_| | | | |
|_|  |_|\__,_|_| |_|\__,_|_|_____/|_| |_|\___/|_|\_\___/ \__,_|_| |_|
*/


Measured memory_bytes: 256