akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <math.h>

using namespace std;
using ll = long long int;

int main()
{
  int n, k;
  cin >> n >> k;
  vector<int> h(n, 0);
  for(int i = 0; i < n; i++)
  {
    cin >> h[i];
  }
  sort(h.begin(), h.end());
  reverse(h.begin(), h.end());
  int be = h[0];
  for(int i = 0; i < n - k + 1; i++)
  {
    int hmax = h[i];
    int hmin = h[i + k - 1];
    be = min(be, hmax - hmin);
  }
  cout << be << endl;
}


Measured memory_bytes: 640
#include <iostream>
#include <math.h>
#include <string>
#include <string.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <stdlib.h>
#include <deque>  
#include <iomanip>

using namespace std;

int main(){
    int N,ans=0;
    cin>>N;
    for(int i=0;i<15;i++){
        for(int k=0;k<26;k++){
            if(N==7*i+4*k)ans=1;
        }
    }
    if(ans==1)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <functional>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <bitset>
#include <climits>

#define all(c) (c).begin(), (c).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)
#define fr first
#define sc second

const int INF=100000000;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
using namespace std;
typedef pair<int ,int > P;
typedef long long ll;

int N,M;
vector<pair<int,P> > vec;
bool f[20004];

void solve() {
    rep(i,20004) f[i]=false;
    f[1]=true;
    vec.clear();

    rep(i,M) {
        int t,s,d;
        cin>>t>>s>>d;
        vec.pb(mp(t,mp(s,d)));
    }
    sort(all(vec));

    rep(i,vec.size()) {
        int t=vec[i].fr;
        int s=vec[i].sc.fr;
        int d=vec[i].sc.sc;
        if(f[s]) f[d]=true;
    }
    int ans=0;
    rep(i,20004) if(f[i]) ans++;
    cout<<ans<<endl;

}

int main() {
    while(cin>>N>>M) {
        if(N+M==0) break;
        solve();
    }
    return 0;
}

Measured memory_bytes: 1700
#include <bits/stdc++.h>
#define FOR(i, m, n) for (ll i = m; i < (n); i++)
#define RFOR(i, m, n) for (ll i = (m - 1); i >= 0; i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, n, 0)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
#define print(ele) cout << (ele) << "\n"
#define print10(ele) cout << fixed << setprecision(10) << (ele) << "\n"

using namespace std;
typedef long long ll;
typedef vector<int> ivec;
typedef vector<string> svec;
typedef vector<ll> lvec;

const int mod = 1e9 + 7;
const ll INF = 1000000000000000000LL;

int main() {
  int n, m;
  cin >> n >> m;
  int ans = n * (n - 1) / 2 + m * (m - 1) / 2;
  print(ans);
  return 0;
}

Measured memory_bytes: 256
#!/usr/bin/env python3
#ABC128 D

import sys
import math
import bisect
from heapq import heappush, heappop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
mod = 10**9 + 7

n,k = map(int,input().split())
v = list(map(int,input().split()))

ans = -float('inf')
for a in range(min(n,k)+1):
    for b in range(min(n,k)+1 - a):
        x = v[:a] + v[n-b:]
        x.sort()
        preans = sum(x)
        for i in range(k-a-b):
            if i < len(x):
                if x[i] < 0:
                    preans += abs(x[i])
                else:
                    break
            else:
                break
        ans = max(ans,preans)
print(ans)


Measured memory_bytes: 41192
# B - Distance
from math import sqrt


def main():
    N, D, *XY = map(int, open(0).read().split())
    res = sum(sqrt(x ** 2 + y ** 2) <= D for x, y in zip(*[iter(XY)] * 2))
    print(res)


if __name__ == "__main__":
    main()


Measured memory_bytes: 55064
s = gets.chomp
p = gets.chomp

n = 0
s.each_char do |i|
    k = s[n,s.size].index(p[0])
    if !k then
        break
    end
    n += k
    
    if (s[n,s.size] + s[0, n]).index(p) then
        print "Yes\n"
        exit
    end
    
    n += 1
end

print "No\n"



Measured memory_bytes: 6880
#include<bits/stdc++.h>
#define ll long long
#define double long double
#define rep(i,n) for(ll i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
#define mod (ll)(1e9+7)
#define inf (ll)(3e18+7)
#define pi (double) acos(-1)
#define P pair<int,int>
#define PiP pair<int,pair<int,int>>
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
using namespace std;

int main() {
    int n, m;
    cin >> n >> m;
    int x = 1, y = n;
    vector<int> l(m), r(m);
    rep(i, m)cin >> l.at(i) >> r.at(i);
    int lm = *max_element(all(l)), rm = *min_element(all(r));
    if(rm < lm)cout << 0;
    else cout << rm-lm+1 << endl;
}


Measured memory_bytes: 1024
#include <iostream>

int main() {
  int hour, rate, flat_fee;
  std::cin >> hour >> rate >> flat_fee;

  int per_hour_fee = rate * hour;
  int min_parking_fee = per_hour_fee > flat_fee ? flat_fee : per_hour_fee;
  std::cout << min_parking_fee << std::endl;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<cmath>
#include<queue>
#include<algorithm>
#include<queue>
#include<bitset>
#include<map>
#include<set>

using namespace std;

typedef long long ll;

const int __SIZE = 1 << 18;
char ibuf[__SIZE], *iS, *iT;

#define ge (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, __SIZE, stdin), (iS == iT ? EOF : *iS++)) : *iS++)
#define ri read_int()
#define rl read_ll()
#define FILE(s) freopen(s"in", "r", stdin), freopen(s"out", "w", stdout)

template<typename T>
inline void read(T &x) {
	char ch, t = 0; x = 0;
	while(!isdigit(ch = ge)) t |= ch == '-';
	while(isdigit(ch)) x = x * 10 + (ch ^ 48), ch = ge;
	x = t ? -x : x;
}
inline int read_int() { int x; return read(x), x; }
inline ll read_ll() { ll x; return read(x), x; }

template<typename T>
inline void chkmin(T&a, T b) { a = a < b ? a : b; }

const int mod = 1e9 + 7;

int s[1010][1010];

struct Node {
	int a, b, c;

	Node() {}
	Node(int a, int b, int c):a(a), b(b), c(c) {}

	friend Node operator * (Node a, Node b) {
		Node c;
		c.a = 1LL * a.a * b.a % mod;
		c.b = (1LL * a.a * b.b + 1LL * a.b * b.c) % mod;
		c.c = 1LL * a.c * b.c % mod;
		return c;
	}
};

inline Node ksm(Node a, ll k) {
	Node s(1, 0, 1);
	while(k) {
		if(k & 1) s = s * a;
		a = a * a, k >>= 1;
	} return s;
}

inline int fsp(int x, ll k) {
	int s = 1;
	while(k) {
		if(k & 1) s = 1LL * s * x % mod;
		x = 1LL * x * x % mod, k >>= 1;
	}
	return s;
}

int main() {
	int n = ri, m = ri; ll k = rl;
	if(!k) return puts("1"), 0;
	for(int i = 1; i <= n; i++)
		for(int j = 1; j <= m; j++) {
			char c = ge;
			while(c != '.' && c != '#') c = ge;
			s[i][j] = c == '#';
		}
	int ud = 0, lr = 0, c = 0, UD = 0, LR = 0;
	for(int i = 1; i <= n; i++)
		for(int j = 1; j <= m; j++) {
			c += s[i][j];
			if(i == 1) UD += s[1][j] && s[n][j];
			else ud += s[i][j] && s[i - 1][j];
			if(j == 1) LR += s[i][1] && s[i][m];
			else lr += s[i][j] && s[i][j - 1];
		}
	if(!UD && !LR) printf("%d\n", fsp(c, k - 1));
	else if(UD && LR) puts("1");
	else {
		Node f;
		if(UD) f = ksm(Node(c, ud, UD), k - 1);
		else f = ksm(Node(c, lr, LR), k - 1);
		printf("%d\n", (f.a - f.b + mod) % mod);
	}
}

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

using namespace std;

int load[17][17] = {0};
int mem[20][20] = {0};
int f(int x,int y)
{
    if(mem[x][y]!=0)return mem[x][y];
    if(x == 1 && y == 1)return 1;
    if(x <= 0 || y <= 0)return 0;
    if(load[x][y] == 0) return mem[x][y]=f(x - 1,y) + f(x,y - 1);
    return 0;
}

int main()
{
    int a,b,n,x,y;
    while(1){
        memset(load,0,sizeof(load));
        memset(mem,0,sizeof(mem));
        cin >> a >> b;
        if(a == 0 && b == 0)break;
        cin >> n;
        for(int i = 0;i < n;i++){
            cin >> x >> y;
            load[x][y]=-1;
        }
    cout << f(a,b) << endl;
    }
    return 0;
}

Measured memory_bytes: 1160
#include <algorithm>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>


using namespace std;


int main() {
    int A, B, C, X;
    cin >> A;
    cin >> B;
    cin >> C;
    cin >> X;
    if (500*A + 100*B + 50*C < X) {
        std::cout << 0 << '\n';
        return 0;
    }

    int counter = 0;
    for (size_t i = 0; i <= A; i++) {
       for (size_t j = 0; j <= B; j++) {
           for (size_t k = 0; k <= C; k++) {
               if (500*i + 100*j + 50*k == X) {
                   counter++;
               }
           }
       } 
    }
    std::cout << counter << '\n';

    return 0;
}

Measured memory_bytes: 256
def solve(s):
    
    pre = ""
    c_pre = ""
    count = 0
    next_flag = False
    for c in s:
        if next_flag:
            c = c_pre + c
        if c != pre:
            count += 1
            pre = c
            c_pre = ""
            next_flag = False
        else:
            c_pre = c
            next_flag = True

    print(count)

if __name__ == '__main__':
    s = input().strip()
    solve(s)

Measured memory_bytes: 41820
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    while(cin>>n,n){
        int num[25];
        for(int i=0;i<n;i++)cin>>num[i];
        for(int i=0,now=32,turn=1;now>0;turn++){
            if(turn==1)now-=(now-1)%5;
            else{
                if(i==n)i=0;
                now-=num[i];
                turn=0;
                i++;
            }
            if(now<0)now=0;
            cout<<now<<endl;
        }
    }
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
using namespace std;
#define fol(i,n) for(int i=0;i<n;++i)
#define pb push_back
typedef long long ll;
typedef pair<int,int> P;
typedef vector<P> vip;

int main(){
  string s;cin>>s;
  int n = s.size();
  if(n%2){
    int a = stoi(s);
    if(n==1){
      cout << a << endl;
    }else if(n==3){
      cout << a-90 << endl;
    }else{
      cout << a - 9090 << endl;
    }
  }else{
    if(n==6){
      cout << 90909 << endl;
    }else{
      cout << (n==4?909:9)<<endl;
    }
  }
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
	string s;
	cin >> s;
	s = ' ' + s; // 确保编号与题目描述一致 
	bool flag = 0;
	for(int i = 1; i < s.size(); i++)
	{
		if(i%2==1&&s[i]=='L' || i%2==0&&s[i]=='R')
		{
			flag = 1;
			break;
		}
	}
	cout << (flag?"No":"Yes");
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <iomanip>
#include <random>
#include <cstdio>
#include <cmath>
#include <map>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)

int gcd(int x, int y) {
  if (y == 0) return x;
  return gcd(y, x%y);
}

int main() {
  int n; cin >> n;
  vector<int> a(n);
  rep(i,n) cin >> a[i];
  // 今までの結果に次の結果も考慮する... 累積和
  // L[i] == a[i-1]までの区間のgcd
  // R[i] == a[i+1]までの区間のgcd
  // 左右区間それぞれのgcdのgcdを取る(gcdは結合則)
  // ただしL[0] == R[N-1] == 0で，gcd(0,x)==gcd(x,0)==0とする．
  vector<int> l(n), r(n);
  l[0] = r[n-1] = 0;
  rep(i,n-1) l[i+1] = gcd(l[i], a[i]);
  for (int i = n-1; i >= 1; --i) r[i-1] = gcd(r[i], a[i]);
  int ans = 1;
  // i番目の数字を消したときに一番大きくなるgcdを探す
  rep(i,n) ans = max(ans, gcd(l[i],r[i]));
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 1408
main :: IO ()
main = do
  s <- getLine
  putStrLn $ solve s

solve :: String -> String
solve [a,b,c,d]
  | 0 < x && x <= 12 && 0 < y && y <= 12 = "AMBIGUOUS"
  | 0 < x && x <= 12                     = "MMYY"
  | 0 < y && y <= 12                     = "YYMM"
  | otherwise                            = "NA"
  where
    x = read [a, b]
    y = read [c, d]

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

typedef long long int ll;
typedef long double ld;
typedef pair<int,int> pi;
typedef pair<ll,ll> pll;

#define endl '\n'
#define ff first
#define ss second
#define int long long
#define pb push_back
#define f(i,l,r) for(ll i=l;i<=r;i++)
#define rf(i,r,l) for(ll i=r;i>=l;i--)
#define Max 5000001
#define inf 2147483647
#define llinf 9223372036854775807
#define all(v) v.begin(),v.end()
#define bp(n) __builtin_popcountll(n)
#define fast ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)

#define d0(a) cout<<a<<' ';
#define d1(a) cout<<a<<endl;
#define d2(a,b) cout<<a<<' '<<b<<endl;
#define d3(a,b,c) cout<<a<<' '<<b<<' '<<c<<endl;
#define d4(a,b,c,d) cout<<a<<' '<<b<<' '<<c<<' '<<d<<endl;
#define d5(a,b,c,d,e) cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e<<endl;
#define d6(a,b,c,d,e,f) cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e<<' '<<f<<endl;

const ll N=1e5+5,mod=1e9+7,bit=61;

ll dp[N];

signed main()
{
    fast;

    ll t=1;
    //cin>>t;
    while(t--)
    {
        f(i,1,N-1)
        {
            dp[i]=inf;
        }
        dp[0]=0;
        ll n,w;
        cin>>n>>w;
        f(i,1,n)
        {
            ll cw,cv;
            cin>>cw>>cv;
            for(int i=N-1-cv;i>=0;i--)
            {
                dp[i+cv]=min(dp[i+cv],dp[i]+cw);
            }
        }
        rf(i,N-1,0)
        {
            if(dp[i]<=w)
            {
                return cout<<i,0;
            }
        }
    }
    return 0;
}


















Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin>>N;
  vector<int>d(N);
  for(int &i:d)cin>>i;
  int ans=1;
  sort(d.begin(),d.end());
  for(int i=0;i<N-1;i++){
    if((d.at(i)-d.at(i+1))!=0){
      ans++;
    }
  }
  cout<<ans<<endl;
}

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

int main()
{
    int a,b,c,d;
    cin >> a >> b >> c >> d;
    if( abs(a - c)<= d )
    {cout << "Yes" << endl;}
    else if( abs(a - b)<= d && abs(b - c)<= d )
    {cout << "Yes" << endl;}
    else{cout << "No" << endl;}

    return 0;
}


Measured memory_bytes: 3636
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <string>
#include <cmath>
using namespace std;
#define MOD 1000000007
#define INF 1<<30
#define LINF (ll)1<<62
#define MAX 510000
#define rep(i,n) for(ll i=0; i<(n); i++)
#define REP(i,a,b) for(ll i=(a); i<(b); i++)
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll, ll> P;
typedef vector<pair<ll, ll>> vpl;

vector<ll> fac(MAX), finv(MAX), inv(MAX);

void comInit(){
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for(ll i=2; i<MAX; 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;
    }
}


ll com(ll n, ll k){
    if(n < k) return 0;
    if(n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n-k] % MOD) % MOD;
}

int main(){
    ll n; cin >> n;
    vl a(n+1);
    map<ll,ll> mp;
    ll t;
    ll left=-1,right,mid;
    rep(i,n+1){
        cin >> a[i];
        mp[a[i]]++;
        if(mp[a[i]] == 2) t = a[i];
    }
    rep(i,n+1){
        if(a[i] == t){
            if(left == -1) left = i;
            else right = n-i;
        }
    }
    mid = n+1-left-right;
    comInit();
    //cout << left << right << endl;
    ll ans = 0;
    REP(i,1,n+2){
        ans = com(n+1,i);
        ans %= MOD;
        ans -= com(n+1-mid,i-1);
        if(ans<0) ans += MOD;
        cout << ans << endl;
    }
}


Measured memory_bytes: 20224
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <cstring>
#include <algorithm>
#include <numeric>
#define maxn 1000000

using namespace std;

int paint[110][110];
int main()
{
    int h,w,n,x=0;
    cin>>h>>w>>n;
    int a[n];
    for(int i=0; i<n; i++)
    {
        cin>>a[i];
        for(int j=0; j<a[i]; j++)
        {
            if((x/w)%2==0) paint[x/w][x%w]=i+1;
            else paint[x/w][w-(x%w)-1]=i+1;
            x++;
        }
    }
    for(int i=0; i<h; i++)
    {
        for(int j=0; j<w; j++)
        {
            if(j==w-1) printf("%d\n",paint[i][j]);
            else printf("%d ",paint[i][j]);
        }
    }
    return 0;
}


















Measured memory_bytes: 384
#include <stdio.h>
int main(void){
    int h, m, s;
    scanf("%d",&s);
    h = s / 3600;
    s %= 3600;
    m = s / 60;
    s %= 60;
    printf("%d:%d:%d\n",h,m,s);
    return 0;
}

Measured memory_bytes: 2748
#include<iostream>
#include<sstream>
#include<cmath>
using namespace std;

class Parsing
{
private:
  string parse;
  int pos;
  int size;
  int x;
public:

  Parsing(string parse,int x):parse(parse),pos(0),x(x),size(0){}

  int StringToInt(string v)
  {
    int ret = 0;
    for(int i=0;i<v.size();i++)
      ret += (v[i]-'0')*(int)pow(10.0,v.size()-i-1);
    return ret;
  }

  string getCnt()
  {
    string v;
    while('0' <= parse[pos] && parse[pos] <= '9') 
      v += parse[pos++];
    return v;  
  }

  int getCntInt(){return StringToInt(getCnt());}

  string decode()
  {
    int power = getCntInt();
    if(parse[pos] == '(')
      pos++;
    else 
      {
	string mes,ret;
	while('A' <= parse[pos] && parse[pos] <= 'Z')	
	  mes += parse[pos++];
	
	for(int i=0;i<power;i++)
	  {
	    ret += mes;
	    if(ret.size() >= x)
	      break;
	  }
	return ret;	  
      }
    string message;
    while(('0' <= parse[pos] && parse[pos] <= '9') || ('A' <= parse[pos] && parse[pos] <= 'Z') )
      {
	if('0' <= parse[pos] && parse[pos] <= '9')
	  message += decode();
	else if('A' <= parse[pos] && parse[pos] <= 'Z')
	  message += parse[pos++];
      }  
    
    if(parse[pos] == ')')
      pos++;
    
    string ret;
    for(int i=0;i<power;i++)
      {
	ret += message,size += message.size();
	if(ret.size() >= x)
	  break;
      }
    return ret;
  }
  
  string exp()
  {
    string ret;
    for(;pos<parse.size();)
      {
	if('0' <= parse[pos] && parse[pos] <= '9')
	  ret += decode();
	else
	  ret += parse[pos++],size++;
	if(ret.size() >= x)
	  break;
      }
    return ret;
  }

  int getSize()
  {
    return size;
  }

};

int main()
{
  string Genome;  
  int pos;
  while(cin >> Genome >> pos, Genome != "0" || pos != 0)
    {
      Parsing par = Parsing(Genome,pos+1);
      string message = par.exp();
      message.size() <= pos?cout << 0 << endl:cout << message[pos] << endl;
    }
  return 0;
}

Measured memory_bytes: 6480
#include <bits/stdc++.h>
using namespace std;
#define all(x) x.begin(),x.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
template<class T> inline bool chmax(T&a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T&a,T b){if(a>b){a=b;return 1;}return 0;}
typedef long long ll;

int n,m,k;
string s,t;

int main() {
  cin >> n;
  map<char,ll> m;
  rep(i,n){
    cin >> s; m[s[0]]++;
  }
  string t="MARCH"; ll ans=0;
  rep(i,5)rep(j,i)rep(k,j) ans+=m[t[i]]*m[t[j]]*m[t[k]];
  cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define pb push_back
const int maxn = 10000;
const int INF32 = 1'050'000'000;
const long long INF64 = 4'000'000'000'000'000'000;
const int MOD7 = 1'000'000'007;
const int MOD9 = 1'000'000'009;
const int mod = MOD7;

void ERROR(int num) { cout << "ERROR" << num << endl; }
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
int dx[8]={-1,0,1,0,1,1,-1,-1};
int dy[8]={0,-1,0,1,1,-1,1,-1};


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

    ll A;
    double B;
    cin >> A >> B;

    ll ans = A * (ll)(B * 100 + 0.01) / 100;

    cout << ans << endl;

}

Measured memory_bytes: 3744
#define _CRT_SECURE_NO_WARNINGS

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <list>
#include <random>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <array>
#include <cassert>
#include <bitset>
#include <cstdint>
#include <random>
using namespace std;
using LL = long long;

LL N, X, M;

int main() {
	cin >> N >> X >> M;
	LL now = X;
	LL ans = X;
	LL loop = 1;
	map<LL, pair<LL, LL>>path;//first: value second: tobu
	path[X] = { X,1 };

	bool hasfast = false;
	LL tobu = 0;
	LL plus = 0;
	while (loop < N) {
		if (hasfast) {
			if (loop + tobu <= N) {
				LL lo = 1, hi = 1000000000;
				while (hi - lo > 1) {
					LL mid = (lo + hi) / 2;
					if (loop + tobu * mid <= N) {
						lo = mid;
					}
					else {
						hi = mid;
					}
				}
				loop += tobu * lo;
				ans += plus * lo;
			}
			else {
				now *= now;
				now %= M;
				ans += now;
				++loop;
			}
		}
		else {
			now *= now;
			now %= M;
			ans += now;
			++loop;
			if (path.count(now)) {
				hasfast = true;
				tobu = loop - path[now].second;
				plus = ans - path[now].first;
			}
			else {
				path[now] = { ans,loop };
			}

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

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

def solve():
    N = input()
    A = list(map(int, input().split()))
    min_a = float("inf")
    max_a = 0
    for a in A:
        min_a = min(min_a, a)
        max_a = max(max_a, a)
    print(max_a - min_a)

if __name__ == "__main__":
    solve()


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

int main() {
	int checked[27]={};
	char s[110];
	scanf("%s",s);
	int i,j;
	int size=strlen(s);
	for(i=0;i<size;i++){
		checked[s[i]-'a']++;
	}
	for(j=0;j<26;j++){
		if(checked[j]%2!=0){
			printf("No\n");
			return 0;
		}
	}
	printf("Yes\n");
	return 0;
}



Measured memory_bytes: 128
#include <iostream>
#include <math.h>
#include <algorithm>
#include <vector>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
#define ll long long int
#define PI 3.141592653589793
using namespace std;

int main(void){
    int ans=0;
    string S;

    cin >> S;
    int len = S.length();
    REP(i, len / 2){
        if(S[i] != S[len - i - 1]) ans++;
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using static System.Console;
using static System.Math;

namespace Atcoder
{
    class Program
    {
        static StreamWriter sw = new StreamWriter(OpenStandardOutput()) { AutoFlush = false };
        static void Main(string[] args)
        {
            try
            {
                SetOut(sw);
                Solve.Answer();
                Out.Flush();
            }
            catch (Exception ex)
            {
                WriteLine(ex.ToString());
                Out.Flush();
            }
        }
    }

    public class Solve
    {
        public static void Answer()
        {
            var nab = IO.RSLong;

            if ((nab[2] - nab[1]) % 2 == 0)
            {
                WriteLine((nab[2] - nab[1]) / 2);
            }
            else
            {
                var f = nab[1] - 1;
                var l = nab[0] - nab[2];

                long ans;
                if (f < l)
                {
                    ans = f + 1;
                    nab[2] -= f + 1;
                    ans += (nab[2] - 1) / 2;
                    WriteLine(ans);
                }
                else
                {
                    ans = l + 1;
                    nab[1] += l + 1;
                    ans += (nab[0] - nab[1]) / 2;
                    WriteLine(ans);
                }
            }
        }
    }

    public class IO
    {
        #region Input
        public static int RInt => int.Parse(ReadLine());
        public static long RLong => long.Parse(ReadLine());
        public static double RDouble => double.Parse(ReadLine());

        public static string[] RSString => ReadLine().Split();
        public static int[] RSInt => ReadLine().Split().Select(s => int.Parse(s)).ToArray();
        public static long[] RSLong => ReadLine().Split().Select(s => long.Parse(s)).ToArray();
        public static double[] RSDouble => ReadLine().Split().Select(s => double.Parse(s)).ToArray();
        #endregion

        #region Output
        public static void OutJoinSpace<T>(IEnumerable<T> list) => WriteLine(string.Join(" ", list));
        public static void WriteLineYes_or_No(bool flag) => WriteLine(flag ? "Yes" : "No");
        public static void WriteLineYES_or_NO(bool flag) => WriteLine(flag ? "YES" : "NO");
        #endregion
    }

    public class Mod
    {
        #region
        private readonly static long M = 1000000007;

        public static long Add(long a, long b) => (a * b) % M;
        public static long Sub(long a, long b) => (a - b) % M >= 0 ? (a - b) % M : (a - b) % M + M;
        public static long Multi(long a, long b) => (a * b) % M;
        #endregion
    }
}

Measured memory_bytes: 19128
#include <iostream>
#include <string>
#include <vector>
#include <array>

using namespace std;

int main(int argc, const char * argv[])
{
    string b;
    
    cin >> b;
    
    if (b == "A")
        cout << "T";
    else if (b == "T")
        cout << "A";
    else if (b == "C")
        cout << "G";
    else
        cout << "C";
    
    return 0;
}


Measured memory_bytes: 256
package main
 
import (
	"fmt"
)
 
func main() {
	var s string
	var a, b, c, d byte
	fmt.Scanf("%s", &s)
	a = s[0]
	b = s[1]
	c = s[2]
	d = s[3]
	if (a == b && b == c) || (b == c && c == d) {
		fmt.Printf("%s", "Yes")
	} else {
		fmt.Printf("%s", "No")
	}
}

Measured memory_bytes: 1832
#include<bits/stdc++.h>
#define endl "\n"
#define pb push_back
#define ll long long
#define d1(x)  cerr << #x << "--> " << x << endl
#define d2(x, y)  cerr << #x << "--> " << x << " | " << #y << "--> " << y <<endl
#define d3(x, y,z)  cerr << #x << "--> " << x << " | " << #y << "--> " << y <<" | " << #z << "--> "<< z<< endl
#define vpll vector<pair<ll,ll>>
#define F first
#define S second
#define T ll tt; cin>>tt; while(tt--)
using namespace std;
ll mode=pow(10,9)+7;
bool cmp(pair<long double, int > x, pair<long double, int> y){ return x.F<y.F && x.S<y.S; }
const ll maxn=2*1e3+10;
int main() 
{
//	ios::sync_with_stdio(0);
//	cin.tie(0);
    long long int i,j,l,inc,dec,t,r,mod=1000000007;
   	long long int c,d,q,e,ans=0,n,temp,m,p,w,h,k,x,y;
	//cin>>t;
	t=1;
	while(t--)
	{
		cin>>n>>k;
		long long int a[n];
		ll dp[k+1],m=INT_MAX;
		for(i=0;i<n;i++)
		{
			cin>>a[i];
		}
		sort(a,a+n);
		m=a[0];
		for(i=0;i<m;i++)
		{
			dp[i]=1;
		}
		for(i=m;i<=k;i++)
		{
			dp[i]=1;
			for(j=0;j<n;j++ )
			{
				if(a[j]>i)
				break;
				if(dp[i-a[j]]==1)
				{
					dp[i]=0;
					break;
				}
			}		
		}
		for(i=0;i<=k;i++)
		{
		//	cout<<dp[i]<<" ";	
		}	
		if(dp[k]==0)
		{
			cout<<"First";	
		}	
		else
		{
			cout<<"Second";
		}
	}

   return 0;
}
/*
1
5
1 1 6 1 6

*/



Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <string.h>
#include <time.h>

using namespace std;
bool IsPrime[10000001];
vector<int> Prime;

void calc()
{
	Prime.reserve(665000);
	memset(IsPrime, 1, sizeof(IsPrime));
	for(int i = 2; i < 10000001; ++i)
	{
		if(IsPrime[i])
		{
			Prime.push_back(i);
			for(int j = 2 * i; j < 10000001; j += i)
			{
				IsPrime[j] = false;
			}
		}
	}
}

void solve()
{
	calc();
	int n;
	while(cin >> n, n)
	{
		int pos = 0;
		while(Prime[pos] < n)
		{
			++pos;
		}
		if(Prime[pos] > n)
		{
			--pos;
		}
		for(int i = pos; i >= 3; --i)
		{
			if(Prime[i - 3] + 2 == Prime[i - 2] && Prime[i - 3] + 6 == Prime[i - 1] && Prime[i - 3] + 8 == Prime[i])
			{
				cout << Prime[i] << endl;
				break;
			}
		}
	}
}

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

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define REP(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, a, b) for(int i=(a); i<(b); ++i)
#define FORR(i, a, b) for(int i=(b)-1; i>=(a); --i)

#define DEBUG(x) cout<<#x<<": "<<x<<'\n'
#define DEBUG_VEC(v) cout<<#v<<":";REP(i, v.size())cout<<' '<<v[i];cout<<'\n'
#define ALL(a) (a).begin(), (a).end()

#define CHMIN(a, b) a=min((a), (b))
#define CHMAX(a, b) a=max((a), (b))

const ll MOD=1000000007ll;
// const ll MOD=998244353ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

const double EPS=1e-11;
#define EQ0(x) (abs((x))<EPS)
#define EQ(a, b) (abs((a)-(b))<EPS)

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	ll a[114514], b[114514], ab[214514];
	pair<ll, int> aa[114514], bb[114514];
	cin>>n;
	REP(i, n){
		cin>>a[i]>>b[i];
		ab[i]=a[i];
		ab[n+i]=b[i];
		aa[i]=make_pair(a[i], i);
		bb[i]=make_pair(b[i], i);
	}
	sort(ab, ab+n*2);
	sort(aa, aa+n);
	sort(bb, bb+n);
	ll ans=0, sum1=0, sum2=0;
	REP(i, n){
		ans+=ab[i];
		sum1+=a[i];
		sum2+=b[i];
	}
	if(sum1!=ans && sum2!=ans){
		bool ok=false;
		REP(i, n){
			if((a[i]<ab[n-1] && b[i]<ab[n-1]) || (a[i]==ab[n-1] && b[i]==ab[n-1] && ab[n-2]==ab[n-1])){
				ok=true;
				break;
			}
		}
		if(!ok){
			ll tmp=ans;
			ans=1e18;
			REP(i, n){
				if(aa[i].first>ab[n-1]){
					break;
				}
				if(b[aa[i].second]!=ab[n]){
					ans=min(ans, tmp-aa[i].first+ab[n]);
				}
				else{
					ans=min(ans, tmp-aa[i].first+ab[n+1]);
				}
			}
			REP(i, n){
				if(bb[i].first>ab[n-1]){
					break;
				}
				if(a[bb[i].second]!=ab[n]){
					ans=min(ans, tmp-bb[i].first+ab[n]);
				}
				else{
					ans=min(ans, tmp-bb[i].first+ab[n+1]);
				}
			}
		}
	}
	cout<<ans<<'\n';
	return 0;
}


Measured memory_bytes: 7296
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <limits>
#include <string>
#include <vector>

using namespace std;

int main() {
  int n;
  scanf("%d", &n);

  vector<int> X(n);
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    X[i] = x;
  }

  sort(X.begin(), X.end());

  int head = X[0];
  int tail = X[n-1];
  int min_p = 0;
  int min_cost = numeric_limits<int>::max();
  for (int p = head; p <= tail; p++) {
    int cost = 0;
    for (int i = 0; i < n; i++) {
      cost += (X[i] - p) * (X[i] - p);
    }
    if (cost < min_cost) {
      min_cost = cost;
      min_p = p;
    }
  }

  cout << min_cost << endl;

  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);
		
		String a = sc.next();
		String b = sc.next();
		String c = sc.next();
		
		System.out.println(a.charAt(a.length()-1) == b.charAt(0) && b.charAt(b.length()-1) == c.charAt(0) ? "YES" : "NO");		
	}
}

Measured memory_bytes: 35496
#include"bits/stdc++.h"
using namespace std;
int main(){
  int n;cin >> n;
  vector<int>a(n);for(int i=0;i<n;i++)cin >> a[i];
  long long ans=0;
  for(int i=0;i<log2(1000000000);i++){
    for(int j=0;j<a.size();j++){
      if(a[j]%2==0){
        a[j]/=2;if(j==a.size()-1)ans++;
      }
      else break;}
  }
  cout << ans;}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include  <iostream>
#include  <algorithm>
#include  <climits>
#include  <vector>
#include  <string>
#include  <cstring>
#include  <stack>
#include  <queue>
#include  <cmath>
#include  <iomanip>
#include  <set>
#include  <map>
#include  <new>
#include <cstdint>
#include <cctype>
using namespace std;
#define rep(i,n)  for(int i = 0; i < n; i++)
#define lrep(i,n,m)  for(int i = n; i < m; i++)

using ll = long long;
using Vii = vector<vector<int> >;
using Gjudge = vector<vector<bool>>;
using Vi = vector<int>;
using Vl = vector<ll>;
using Vll = vector<vector<ll> >;
using Vs = vector<string>;
using Vb = vector<bool>;
using the = pair<int, int>;
using lthe = pair<ll, ll>;

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; }

const int Mod = static_cast<int>(1e9 + 7);
const int INF = INT_MAX;
const int dx[4] = { 1,0,-1,0 };
const int dy[4] = { 0,1,0,-1 };


int main()
{
	int d[5];
	rep(i, 5)  cin >> d[i];
	int ans = 0;
	rep(i, 5) {
		if (d[i] == 0) {
			ans = i;
			break;
		}
	}
	cout << ++ans << endl;
}


Measured memory_bytes: 3592
#include <stdio.h>
 
int main(void){
  int n,i,t,min,max;
  long long int sum;
  scanf("%d",&n);
  min=10000000; max=-10000000; sum=0;
  for(i=0;i<n;i++){
    scanf("%d",&t);
    if(min>t) min=t;
    if(max<t) max=t;
    sum+=t;
  }
  printf("%d %d %lld\n",min,max,sum);
  return 0;
}

Measured memory_bytes: 600
#include<cstdio>

using namespace std;
const long long maxn=1e18;
int n;

int main()
{
//    int T;
//    scanf("%d",&T);
//    printf("\n");
//
//    while (T--)
//    {
//        scanf("%d",&n);
//    }

    long long x,y;
    scanf("%lld %lld",&x,&y);
    if (x == y || x % y == 0)
        printf("-1\n");
    else
    {
        for (long long i = 1; ; i++)
        {
            long long ans = i * x;
            if (ans >= maxn)
            {
                printf("-1\n");
                break;
            }
            if (ans % y != 0)
            {
                printf("%lld\n", ans);
                break;
            }
        }
    }

    return 0;
}



Measured memory_bytes: 128
import sys
N=int(input())
alist=list(map(int,input().split()))
alist.sort()

if alist[0]==0:
  print(0)
  sys.exit(0)

answer=1
e18=10**18
for a in alist:
  answer*=a
  if answer>e18:
    print(-1)
    break
else:
  print(answer)

Measured memory_bytes: 21604
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(long long i=0; i<(n); ++i)
#define REP(i, d, n) for(long long i=(d); i<(n); ++i)
#define all(v) v.begin(), v.end()
using ll = long long;
int main() {//言語変えろ言語変えろ言語変えろ言語変えろ言語変えろ

int a; cin>>a;
  int b=a%10;
  if(b==0||b==1||b==6||b==8){cout<<"pon"<<endl;}
  else if(b==3){cout<<"bon"<<endl;}
  else{cout<<"hon"<<endl;}
  
}


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

int main()
{
  vector<vector<int>> c(3, vector<int>(3));
  for (int i = 0; i < 3; i++)
    for (int j = 0; j < 3; j++)
      cin >> c[i][j];
  bool res = true;
  vector<int> a(3), b(3);
  // assuming a0 = 0
  for (int i = 0; i < 3; i++) { b[i] = c[0][i]; a[i] = c[i][i] - b[i];} 
  for (int i = 0; i < 3; i++)
    for (int j = 0; j < 3; j++)
      if (a[i] + b[j] != c[i][j]) {res = false; break;}
  cout << (res ? "Yes" : "No") << endl;
}

Measured memory_bytes: 3640
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
#ifdef _DEBUG_
#define dump(val) cerr << __LINE__ << ":\t" << #val << " = " << (val) << endl
#else
#define dump(val)
#endif

using namespace std;

typedef long long int ll;

template<typename T>
vector<T> make_v(size_t a, T b) {
    return vector<T>(a, b);
}

template<typename... Ts>
auto make_v(size_t a, Ts... ts) {
    return vector<decltype(make_v(ts...))>(a, make_v(ts...));
}

class SegmentTree {
public:
    vector<ll> Max;
    int N;
    SegmentTree(int n) {
        N = 1;
        while (N < n) N *= 2;
        Max.resize(2 * N - 1, 0);
    }
    ll get(int a, int b, int l, int r, int x) {
        if (b <= l || r <= a) return 0;
        if (a <= l && r <= b) return Max[x];
        int mid = (l + r) / 2;
        return max(get(a, b, l, mid, 2 * x + 1), get(a, b, mid, r, 2 * x + 2));
    }
    ll get(int a, int b) {
        return get(a, b, 0, N, 0);
    }
    void update(int p, ll x) {
        p += N - 1;
        Max[p] = x;
        while (p > 0) {
            p = (p - 1) / 2;
            Max[p] = max(Max[2 * p + 1], Max[2 * p + 2]);
        }
    }
};

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    vector<ll> h(N), a(N);

    REP(i, 0, N) {
        cin >> h[i];
    }
    REP(i, 0, N) {
        cin >> a[i];
    }

    SegmentTree segtree(N);
    ll ans = 0;
    REP(i, 0, N) {
        ll res = segtree.get(0, h[i] - 1) + a[i];
        segtree.update(h[i] - 1, res);
        ans = max(ans, res);
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 7552
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <functional>
using namespace std;

#define Rep(b, e, i) for(int i = b; i <= e; i++)
#define Repr(e, b, i) for(int i = e; i >= b; i--)
#define rep(n, i) Rep(0, n-1, i)
#define repr(n, i) Repr(n-1, 0, i)
#define all(v) (v).begin(), (v).end()
#define pb(v) push_back(v)
#define uniq(v) (v).erase(unique(all(v)),(v).end())
#define bitcnt(x) __builtin_popcount(x)
#define fst first
#define snd second
#define ENJYU std::ios::sync_with_stdio(false);std::cin.tie(0);

//vector の中身を出力
template <class T>ostream &operator<<(ostream &o,const vector<T>&v)
{o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}

void solve(void){
	ENJYU;
	int N;
	cin >> N;
	if (N == 3) {
		cout << "2 5 63" << endl;
		return;
	}
	if (N == 4) {
		cout << "2 5 20 63" << endl;
		return;
	}
	if (N == 5) {
		cout << "2 3 4 6 9" << endl;
		return;
	}
	vector <int> zwei, drei, sechs;
	Rep(1, 30000, i) {
		if (i % 6 == 0) sechs.pb(i);
		else if (i % 2 == 0) zwei.pb(i);
		else if (i % 3 == 0) drei.pb(i);
	}
	int rest = 0;
	if (N > 15000) {
		rest = N - 15000;
		N = 15000;
	}
	int k = N / 6;
	rep(4*k, i) {
		cout << zwei[i] << ' ';
	}
	rep(2*k, i) {
		cout << drei[i] << ' ';
	}
	rep(N-k*6+rest, i) {
		cout << sechs[i] << ' ';
	}
	cout << endl;
}

int main(void){
	solve();
	//cout << "yui(*-v・)yui" << endl;
	return 0;
}


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

// 入力
int N, M;
int dp[100100];        // メモ化再帰
vector<vector<int>> G; // グラフ

int rec(int v) {
    if (dp[v] != 0)
        return dp[v]; // 既に更新済み

    int res = 0;
    for (auto nv : G[v]) {
        res = max(res, rec(nv) + 1);
    }
    return dp[v] = res; // メモしながらリターン
}

int main() {
    // 入力受け取り
    cin >> N >> M;
    G.resize(N);
    // G.assign(N, vector<int>());
    for (int i = 0; i < M; ++i) {
        int x, y;
        cin >> x >> y;
        --x, --y; // 0-indexed にする
        G[x].push_back(y);
    }

    // 全ノードを一通り更新しながら答えを求める
    int res = 0;
    for (int v = 0; v < N; ++v) {
        res = max(res, rec(v));
    }
    cout << res << endl;
}

Measured memory_bytes: 8192
a,q,o,x,b;
main(){
  for(scanf("%d");~scanf("%s",&a);o=o==3?b=x=!printf("%d\n",x):o){
    //printf("%d\n",a%9);
    ///*
    //printf("bef x:%d b:%d o:%d\n",x,b,o);
    if(a%9==7)b=b*2+1,x+=b>>3&1;
    if(a%9==8)o++;
    if(a%9==6)for(x++,b&=7;b;b/=2)x+=b&1;
    //printf("x:%d b:%d o:%d\n",x,b,o);
     //*/
  }
}

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

int main() {
    string s;
    cin >> s;
    int n = s.length();
    bool OK = false;
    int pos1 = -1, pos2 = -1;
    for (int i  = 0; i < n - 1; i++) {
        if (s[i] == s[i + 1]) {
            OK = true;
            pos1 = i + 1;
            pos2 = i + 2;
            break;
        }
    }
    
    if (n > 2 && !OK) {
        for (int i = 0; i < n - 2; i++) {
            if (s[i] == s[i + 2]) {
                pos1 = i + 1;
                pos2 = i + 3;
                break;
            }
        }
    }
    printf("%d %d\n", pos1, pos2);
    return 0;
}

Measured memory_bytes: 512
#include <cstdio>
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <algorithm>
using namespace std;
const int maxn = 100000 + 5;
typedef long long int64;
int n, c, k;
int data[maxn];

int main()
{
  while (scanf("%d%d%d", &n, &c, &k) == 3)
  {
    for (int i = 0; i < n; ++i) scanf("%d", data+i);
    int ans = 0;
    sort(data, data+n);
    int on = 0;
    int earliest = 0;
    for (int i = 0; i < n; ++i)
    {
      int now = data[i];
      if (i == 0 || on == c || earliest + k < now)
      {
        on = 0;
        earliest = 0;
        ++ans;
      }
      if (on == 0) earliest = now;
      ++on;
    }
    cout << ans << endl;
  }
  return 0;
}

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

#define IOS ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define I insert
#define endl '\n'
#define all(x) x.begin(), x.end()

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<class T> using oset=tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
 
using vvll = vector< vector<ll> >;
using vll = vector<ll> ;
using vb = vector<bool> ;
using pll = pair<ll, ll> ;

const ll maxs = 1e6+5;
const ll lmaxs = 20;
ll mod = 1e9+7;
ll oo = 1e18;


void pre(){



}

 

void solve(){

    ll n;
    cin >> n;
    ll a[n+1];
    for(ll i=1;i<=n;i++)    
        cin >> a[i];
    ll ans=0;
    for(ll i=1;i<=n;i++){
        if(i&1){
            if(a[i]&1)
                ans++;
        }
    }
    cout << ans ;
    
}

int main(){
    // #ifndef ONLINE_JUDGE
    // freopen("input00.txt","r",stdin);
    // #endif
    IOS;
    pre();
    ll T = 1;
    //cin>>T;
    while(T--){
        solve();   
    }
    return 0;
}

Measured memory_bytes: 3604
from string import ascii_lowercase

S = raw_input()
if S == "zyxwvutsrqponmlkjihgfedcba":
    print -1
elif len(S) == 26:
    S = [ascii_lowercase.index(s) for s in S]
    while True:
        S[-1] += 1
        if S[-1] >= 26:
            S.pop()
        elif len(set(S)) == len(S):
            break
    print ''.join([ascii_lowercase[i] for i in S])
else:
    for a in ascii_lowercase:
        if a not in S:
            print S + a
            break


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

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int answer = 0;
		if(a + b >= c - 1) answer = b + c;
		else answer = a + b*2 + 1;
		System.out.println(answer);
	}

}


Measured memory_bytes: 21972
#include <iostream>
#include <algorithm>
#include <vector>
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
using namespace std;
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; }
typedef long long ll;
int main()
{
  ll n,k; cin >> n >> k;
  vector<ll> a(n),f(n);
  rep(i,n) cin >> a[i];
  rep(i,n) cin >> f[i];

  sort(a.begin(), a.end());
  sort(f.begin(), f.end(), [](int x, int y) {
			     return x > y;
			   });

  auto isok = [&](ll x) {
		ll cnt = 0;
		rep(i,n) {
		  cnt += max((ll)0, (a[i] * f[i] - x + f[i] - 1) / f[i]);
		}
		return cnt <= k;
	      };
  
  ll lb = -1, ub = 1e+12;
  while(ub - lb > 1) {
    ll mid = (ub + lb) / 2;
    (isok(mid) ? ub : lb) = mid;
  }
  cout << ub << "\n";

  return 0;
}


Measured memory_bytes: 6396
#include <iostream>
using namespace std;
int main(void){
    int a,b,c;
    cin >> a >> b >> c;
    int score=0;
    for(int i=1;;i++){
        score +=a;
        if(i%7 == 0){
            score +=b;
        }
        if(score >= c){
            cout << i << endl;
            break;
        }
    }
}


Measured memory_bytes: 3104
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int i,num,seisuu;
  int bairitu[3] = {100,10,1};
  cin >> num;
  bool flag = false;
  for(i=0;i<3;i++){
    seisuu = num / bairitu[i];
    if(seisuu == 7) flag = true;
    num -= seisuu * bairitu[i];
  }
  if(flag)
  {
      cout << "Yes" << endl;
  }
  else
  {
      cout << "No" << endl;
  }
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
const double exps = 1e-6;

double quick_pow(double x, int n) {
    double res = 1;
    double p = x;
    while(n) {
        if(n & 1) res *= p;
        p *= p;
        n >>= 1;
    }
    return res;
}

int main() {
    int n, m;
    while(~scanf("%d%d", &n, &m)) {
        double ans = 0;
        int i = 1;
        while(1) {
            double temp = ((double)i * (1900 * m + (n - m) * 100) * quick_pow((1 - quick_pow(0.5, m)), i - 1) * quick_pow(0.5, m));
            ans += temp;
            if(fabs(temp) < exps) break;
            i++;
        }
        printf("%d\n", (int)(ans + 0.5));
    }
    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <ctime>
#include <cstring>
#include <functional>
#include <iostream>
#include <iomanip>
#include <limits>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <regex>
#include <vector>

#define fix(n)          cout<<fixed<<setprecision(n)
#define rep(i,n)        for (int i = 0; i < (n); ++i)
#define all(a)          (a).begin(), (a).end()
#define sort(a)         sort(all(a))
#define uniq(a)         sort(a);(a).erase(unique(all(a)), (a).end())
#define reverse(a)      reverse(all(a))
#define ctos(c)         string(1, (c))
#define out(d)          cout << (d)
#define outl(d)         std::cout<<(d)<<"\n"
#define YES()           cout << "YES" << endl
#define NO()            cout << "NO" << endl
#define Yes()           cout << "Yes" << endl
#define No()            cout << "No" << endl
#define ceil(x, y)      ((x + y - 1) / (y))
#define debug(x)        cerr << #x << ": " << (x) << '\n'
#define debug2(x, y)    cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << '\n'
#define debug3(x, y, z) cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << ", " << #z << ": " << (z) << '\n'
#define dbg(v)          for (size_t _ = 0; _ < v.size(); ++_){ cerr << #v << "[" << _ << "] : " << v[_] << '\n'; }
#define pb              push_back
#define fst             first
#define int             long long
#define INF             __LONG_LONG_MAX__

using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll,ll>;

const ll MOD = 1000000007; // 10^9 + 7
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

void solve() {
  ll N, K; cin >> N >> K;
  vector<ll> nums(K);
  ll ans = 0;
  for (int i = 1; i <= N; i++) nums[i%K]++;
  for (int a = 0; a < K; a++) {
    ll b = (K - a) % K;
    if (b * 2 % K != 0) continue;
    ans += nums[a] * nums[b] * nums[b];
  }
  outl(ans);
}

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  srand((unsigned)time(NULL));
  fix(12);

  solve();
}


Measured memory_bytes: 1792
N = int(input())
ab = []
for i in range(N):
    ab.append(tuple(map(int,input().split())))
 
up = sorted(ab,key=lambda a:a[1])
down = sorted(ab,key=lambda a:a[0])
 
if N%2 == 1:
    print(up[N//2][1]-down[N//2][0]+1)
else:
    up2 = sorted(ab,key=lambda a:a[1],reverse=True)
    down2 = sorted(ab,key=lambda a:a[0],reverse=True)
    r = (up[N//2][1]+up2[N//2][1])
    l = (down[N//2][0]+down2[N//2][0])
    print(r-l+1)


Measured memory_bytes: 45184
import java.util.*;class Main{public static void main(String[]z){Scanner s=new Scanner(System.in);String l;for(int r=0,x[]={95,63,7,2,3,-3},i;!(l=s.nextLine()).equals("0 0 0 0 0 0");System.out.println(r+100))for(r=i=0;i<6;)r+=new Integer(l.split(" ")[i])*x[i++];}}

Measured memory_bytes: 12000