akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(void)
{
	int N[31]={0},a=0;
	for(int i=1;i<31;i++)
	{
		scanf("%d",&a);
		N[a]=1;
	}
	for(int i=1;i<31;i++)
	{
		if(N[i]!=1){printf("%d\n",i);}
	}
	return 0;
}
//前回記録31:37.770クリア


Measured memory_bytes: 3208
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define mfill(x,y) memset(x,y,sizeof(x))
#ifdef LOCAL
#define eprintf(...) fprintf(stderr,__VA_ARGS__)
#else
#define eprintf(...) 42
#endif
#define y0 y12345
#define y1 y54321
typedef unsigned long ul;
typedef long long ll;
//typedef pair<int, int> mpair;
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;}
using namespace std;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,m,r,g,b;cin>>r>>g>>b>>n;
    int cou = 0;
    rep(i, 3001){
        if(i*r > n)break;
        rep(j, 3001){
            if(i*r+j*g > n)break;
            for(int k = (n-i*r-j*g)/b;k < 3001 ;k++){
                if(i*r+j*g+k*b == n){
                    cou++;
                }else if(i*r+j*g+k*b > n){
                    break;
                }
            }
        }
    }
    cout << cou << endl;
    return 0;
}


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

using namespace std;

int main() {

	int x[4], y[4], dx ,dy;
	bool a = false, b = false;

	cin >> x[0] >> y[0] >> x[1] >> y[1];

	dx = x[1] - x[0];
	dy = y[1] - y[0];


	cout << x[1] - dy << " " << y[1] + dx << " " << x[1] -dy - dx << " " << y[1] + dx - dy;

	return 0;

}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <unordered_map>
#include <functional>
#include <utility>
#include <tuple>
#include <cctype>
#include <bitset>
#include <complex>
#include <cmath>
#include <array>
using namespace std;
#define INF 0x3f3f3f3f
#define INFLL 0x3f3f3f3f3f3f3f3fLL
#define MOD 1000000007
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pint;
typedef pair<ll,ll> pll;
typedef tuple<int,int,int> tint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<ull> vull;
typedef vector<pint> vpint;
int dx[8]={0,0,-1,1,1,1,-1,-1};
int dy[8]={-1,1,0,0,1,-1,1,-1};
const int SIZE=100050;
//ここまでテンプレ
int main(){
	int N,T;
	cin>>N>>T;
	vpint vec;
	for(int i=0;i<N;i++){
		int c,t;
		cin>>c>>t;
		if(t<=T)
			vec.eb(c,t);
	}
	sort(vec.begin(),vec.end());
	if(vec.size())
		cout<<vec[0].first<<endl;
	else
		cout<<"TLE"<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include <vector>
#include <algorithm>
#include <cstdlib>
#include <math.h>
#include <unordered_map>
#include <numeric>
using namespace std;

int main()
{
	int n;

	cin >> n;

	vector<int> v(n);
	vector<int> a;
	vector<int> b;

	for(int i=0; i<n; i++) cin >> v[i];

	sort(v.begin(), v.end(), std::greater<int>() );

	for(int i=0; i<n; i++)
		if(i%2 == 0)
			a.push_back(v[i]);
		else
			b.push_back(v[i]);

	//for(int i=0; i<n; i++) std::cout << v[i];
	std::cout << std::accumulate(a.begin(), a.end(), 0) - std::accumulate(b.begin(), b.end(), 0) << '\n';

	return 0;
}


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

const long long MOD = 1000000007;

const int MAX = 510000;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int 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;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

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

void solve(long long n, long long k){
    ll ans = 0;
    COMinit();
    k = min(k, n);
    for(int i = 0;i <= k;i++){
        //cout<< modpow(n - i, i, MOD)%MOD * COM(n, i) % MOD<<endl;
        //if(i <= 10)cout<<(n+i-1 < n ? 1: COM(n - 1, i)) * COM(n, i) % MOD<<endl;
        ans += COM(n - 1, i) * COM(n, i) % MOD;
    }
    cout<<ans%MOD<<endl;
}

int main(){
    long long n;
    scanf("%lld",&n);
    long long k;
    scanf("%lld",&k);
    solve(n, k);
    return 0;
}


Measured memory_bytes: 12160
import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;
import std.bigint;


void main()
{
  auto d=readln.chomp.to!int;
  write("Christmas");
  foreach(i; 0..25-d) {
    write(" Eve");
  }
  writeln("");
}


Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	sc.Split(bufio.ScanWords)

	_ = getString()
	s := getString()
	_ = getString()

	fmt.Printf("A%cC\n", s[0])
}


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

def solve():
    import sys

    N, W = list(map(int, sys.stdin.readline().split()))

    dp = [[0 for w in range(W+1)] for _ in range(N+1)]  # dp[i][w] := i個の品物を使って、重さの総和がw以下のときの価値の最大値

    for i in range(1, N+1):
        v, w = list(map(int, sys.stdin.readline().split()))
        for j in range(0, W+1):
            dp[i][j] = max(dp[i][j], dp[i-1][j])
            if j+w <= W:
                dp[i][j+w] = max(dp[i-1][j+w], dp[i-1][j]+v)

    print(dp[N][W])


if __name__ == "__main__":
    solve()



Measured memory_bytes: 25952
#include<bits/stdc++.h> 
#define REP(i, b) for(int i = 0; i < (b); i++)
#define REPS(i, b) for(int i = 1; i <= (b); i++)
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
using ll = long long;

signed main()
{
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    ll N, M; cin >> N >> M;
    ll ans = 0;
    vector<ll> A(N); REP(i, N) cin >> A[i];
    vector<ll> sum(N+1); REP(i, N) sum[i+1] = (sum[i] + A[i]) % M;
    map<ll, ll> count;
    REP(i, N+1)
    {
        if(count.find(sum[i]) == count.end()) count.insert(make_pair(sum[i], 0));
        count[sum[i]]++;
    }
    //vector<ll> count(M); REP(i, N+1) count[sum[i]]++;
    for(auto itr = count.begin(); itr != count.end(); itr++)
    {
        ll c = itr->second;
        if(c >= 2) ans += c * (c-1) / 2;
    }
    cout << ans << endl;
    //REP(i, N+1) cout << sum[i] << " ";
    //cout << endl;
}

Measured memory_bytes: 5760
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>

using namespace std;

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

using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int l;
    cin >> l;
    
    cout <<  fixed << std::setprecision(10) << (1.0* l/3.0) * (1.0 * l/3.0) * (1.0 * l/3.0) <<"\n";
}

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

int main() {
  string S;
  cin >> S;
  string answer;
  for(int i = 0;i < S.size();i++) {
    if(S.at(i) == '0') {
      answer = answer + '0';
    }
    if(S.at(i) == '1') {
      answer = answer + '1';
    }
    if(S.at(i) == 'B') {
      if(answer.size() > 0) {
        answer.pop_back();
      }
    }
  }
  cout << answer << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<set>
#include<algorithm>
#include<bits/stdc++.h>
#define pb push_back
#define pf push_front

using namespace std;	
typedef long long int lli;

lli n,k,l,m,t,a,b,r,c,temp1,temp2,x,y,temp,q,d,mod=1e9+7,w;
bool possible(vector<lli> v,lli f)
{
	if(f==0)return false;
	sort(v.begin(),v.end());
	lli cnt=0;
	for(int i =0;i<n;i++)
	{
		if(v[i]>=f)
		{
			if(v[i]%f!=0)
			cnt+=(v[i]/f);
			else
			cnt+=(v[i]/f)-1;
		}
	}
	
	if(cnt<=k)return true;
	return false;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    cin>>n>>k;
    
    vector<lli>v(n);
	
	
	for(int i =0;i<n;i++)
	{
		cin>>v[i];
	}
	

	lli r =2000000000,l=0;
	lli mid= (l+r)/2;
	lli cnt=0;
	while(l<r)
	{
		mid = (l+r)/2;
		
	//	cout<<"Mid is "<<mid<<endl;
	//	cout<<"L is "<<l<<" r is "<<r<<endl;
		if(possible(v,mid))
		{
			r=mid;
		}
		else
		{
		//	if(mid*2< l+r)mid++;
			l=mid;
		}
		cnt++;
		
		if(cnt>100)break;
	}
	
	if(possible(v,mid))
	cout<<mid<<endl;
	else
	cout<<mid+1<<endl;
}

Measured memory_bytes: 6312
//OPTIMIZATONS
#pragma GCC optimize("02")
//CODE
#include<bits/stdc++.h>
#define int long long
#define float double
#define endl "\n"
#define debug cout<<"Good uptill here"<<endl<<flush;
#define deb(x) cout<<#x<<":"<<x<<endl<<flush;

using namespace std;
const int N = 3e4 + 1;

int32_t main(){
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	//CODE FOR SPECIFIED INPUT AND OUTPUT
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	int a,b,c,k;
	cin>>a>>b>>c>>k;
	int ans = 0;
	ans += min(a,k);
	k -= min(a,k);
	k -= min(k,b);
	ans -= k;
	cout<<ans<<endl;
}


Measured memory_bytes: 3648
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

var sc = bufio.NewScanner(os.Stdin)

func Scanner() string {
	sc.Scan()
	return sc.Text()
}

func intScanner() int {
	n, _ := strconv.Atoi(Scanner())
	return n
}

func floatScanner() float64 {
	n, _ := strconv.ParseFloat(Scanner(), 64)
	return n
}
func stringToInt(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}
func stringSliceScanner(n int) []string {
	a := make([]string, n)
	for i := 0; i < n; i++ {
		a[i] = Scanner()
	}
	return a
}
func intSliceScanner(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = intScanner()
	}
	return a
}
func larger(a, b int) int {
	if a < b {
		return b
	} else {
		return a
	}
}
func smaller(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}
func max(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x < a[i] {
			x = a[i]
		}
	}
	return x
}
func min(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x > a[i] {
			x = a[i]
		}
	}
	return x
}

var mod int

func main() {
	mod = 1000000007
	buf := make([]byte, 0)
	sc.Buffer(buf, mod)
	sc.Split(bufio.ScanWords)
	s := Scanner()
	d := make(map[string]struct{})
	for _, r := range s {
		d[string(r)] = struct{}{}
	}
	ans := mod
	for k, _ := range d {
		x := strings.Split(s, k)
		a := 0
		for i := 0; i < len(x); i++ {
			a = larger(a, len(x[i]))
		}
		ans = smaller(ans, a)
	}
	fmt.Println(ans)
}


Measured memory_bytes: 640
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    k = S()
    d = I()
    t = [0] * d
    c = 0
    for i in k:
        i = int(i)
        u = t[:]
        for j in range(c,c+i):
            u[j%d] += 1
        c += i
        c %= d
        d1 = max(0, d-10)
        for j in range(d1):
            for jj in range(j+1,j+10):
                u[jj] += t[j]
            u[j] %= mod

        for j in range(d1, d):
            for jj in range(j+1,j+10):
                u[jj%d] += t[j]
            u[j] %= mod
        t = u

    if c == 0:
        return t[0] % mod

    return (t[0] - 1) % mod


print(main())


Measured memory_bytes: 5464
/*
This code By @1353055672(Ligen)
[Warning]You're not excepted to understand this code!
RP++
*/
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<queue>
#define ll long long
#define ull unsigned long long
#define mn 1000020
#define FOR(a,b,c) for (int a=b;a<=c;a++)
#define FORD(a,b,c) for (int a=b;a>=c;a--)
using namespace std;
inline ll read(){
    ll x=0,f=1;
    char c=getchar();
    while (c<'0'||c>'9'){
        if (c=='-')f=-1;
        c=getchar();
    }
    while (c>='0'&&c<='9'){
        x=x*10+c-'0';
        c=getchar();
    }
    return x*f;
}
int Max(int a,int b){return (a>b)?a:b;}
int Min(int a,int b){return (a<b)?a:b;}

int main(){
	int n=read();
	FOR(i,0,n/4)if(n-i*4>=0&&(n-i*4)%7==0){printf("Yes\n");return 0;}
	printf("No\n");
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<int,int> Pi;
#define rep(i,n) for(ll i=0;i<n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define fi first
#define se second
#define endl "\n"

template<typename T> inline bool chmax(T &a, T b){if(a<b){a=b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if(a>b){a=b;return true;}return false;}
template<typename T> ostream& operator<<(ostream& s,const complex<T>& d) {return s<<"("<<d.real()<<", "<<d.imag()<< ")";}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const pair<T1,T2>& d) {return s<<"("<<d.first<<", "<<d.second<<")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& d){int len=d.size();rep(i,len){s<<d[i];if(i<len-1) s<<" ";}return s;}
template<typename T> ostream& operator<<(ostream& s,const vector<vector<T>>& d){int len=d.size();rep(i,len){s<<d[i]<<endl;}return s;}
template<typename T> ostream& operator<<(ostream& s,const set<T>& v){s<<"{ ";for(auto itr=v.begin();itr!=v.end();++itr) {if (itr!=v.begin()) {s<< ", ";}s<<(*itr);}s<<" }";return s;}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const map<T1,T2>& m){s<<"{"<<endl;for(auto itr=m.begin();itr!=m.end();++itr){s<<" "<<(*itr).first<<" : "<<(*itr).second<<endl;}s<<"}"<<endl;return s;}

const ll mod=1e9+7;
const ll inf=1e17;
const int INF=1e9;
const double PI=acos(-1);
const double EPS=1e-10;

int main(){
	cin.tie(0);ios::sync_with_stdio(false);
	int n,l;
	cin>>n>>l;
	vector<string> s(n);
	rep(i,n){
		cin>>s[i];
	}
	sort(begin(s),end(s));
	rep(i,n){
		cout<<s[i];
	}
	cout<<endl;
}

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

class Solution {
  string s[3];
  int n;
public:
  void run() {
    cin >> n;
    for (int i = 0; i < 3; ++i) cin >> s[i];
    int ans = 0;
    for (int j = 0; j < n; ++j) {
      ans += (set<int>{s[0][j], s[1][j], s[2][j]}).size() - 1;
    }
    cout << ans << '\n';
  }
};

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


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main(void)
{
	vector<int> vec;
	int a, b, c;
	cin >> a >> b >> c;
	vec.push_back(a);
	vec.push_back(b);
	vec.push_back(c);
	sort(vec.begin(), vec.end());
	cout << vec[0];
	for (int i = 1; i<vec.size(); ++i)
	{
		cout << " " << vec[i];
	}
	cout << endl;
	return 0;
}


Measured memory_bytes: 3140
s = input()
k = int(input())
sub = set()
for i in range(0,len(s)):
    j = 1
    while i+j<=len(s) and j<=5:
        sub.add(s[i:i+j])
        j = j + 1
ans = list(sub)
ans.sort()
print(ans[k-1])

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

int main(int argc, char const *argv[]) {
  int sum = 0, f;
  string n;
  cin >> n;
  for(int i = 0;i < n.size();i++) {
    int tmp;
    tmp = n.at(i) - '0';
    sum += tmp;
  }
  f = atoi(n.c_str());

  if(f % sum == 0) {
    cout << "Yes" << '\n';
  }
  else {
    cout << "No" << '\n';
  }
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
  int n, m;
  int c[51] = {0};
  int a, b;
  int i;
  scanf("%d %d", &n, &m);
  for ( i=0; i<m; i++ ) {
    scanf("%d %d", &a, &b);
    c[a-1]++; c[b-1]++;
  }
  for ( i=0; i<n; i++ ) {
    printf("%d\n", c[i]);
  }
  return 0;
}

Measured memory_bytes: 128
/*
これを入れて実行
g++ code.cpp
./a.out
 */
 
#include <iostream>
#include <stdio.h>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <unordered_map>
#include <cmath>
#include <math.h>
#include <tuple>
#include <iomanip>
#include <bitset>
 
using namespace std;
typedef long long ll;
typedef long double ld;
 
int dy4[4] = {-1, 0, +1, 0};
int dx4[4] = {0, +1, 0, -1};
int dy8[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dx8[8] = {0, 1, 1, 1, 0, -1, -1, -1};
 
const long long INF = 1LL << 60;
const ll MOD = 1e9 + 7;
 
bool greaterSecond(const pair<int, int>& f, const pair<int, int>& s){
    return f.second > s.second;
}
 
ll gcd(ll a, ll b){
	if (b == 0)return a;
	return gcd(b, a % b);
}
 
ll lcm(ll a, ll b){
    return a / gcd(a, b) * b;
}
 
ll nCr(ll n, ll r){
    if(r == 0 || r == n){
        return 1;
    } else if(r == 1){
        return n;
    }
    return (nCr(n - 1, r) + nCr(n - 1, r - 1));
}
 
ll nPr(ll n, ll r){
    r = n - r;
    ll ret = 1;
    for (ll i = n; i >= r + 1; i--) ret *= i;
    return ret;
}
 
//-----------------------ここから-----------
int n;
vector<int> h;
ll memo[100100];

ll dp(int i){
    if(i == 0) return 0;
    if(memo[i] != INF) return memo[i];

    ll res; 
    if(i >= 2){
        res = min(dp(i - 1) + abs(h[i] - h[i - 1]), dp(i - 2) + abs(h[i] - h[i - 2]));
    } else {
        res = dp(i - 1) + abs(h[i] - h[i - 1]);
    }

    return memo[i] = res;
}

int main(void){
    cin >> n;
    h.resize(n);
    for(int i = 0; i < n; i++) cin >> h[i];

    for(int i = 0; i <= n; i++){
        memo[i] = INF;
    }

    cout << dp(n - 1) << endl;
}

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

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define deg_to_rad(deg) (((deg) / 360) * 2 * M_PI)
#define rad_to_deg(rad) (((rad) / 2 / M_PI) * 360)

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

typedef long long ll;

void solve(long long N)
{
    ll tot = 0;
    for (int i = 1; i <= N; i++)
    {
        if (i % 15 == 0 || i % 5 == 0 || i % 3 == 0)
            continue;
        tot += i;
    }
    cout << tot << endl;
}

int main()
{
    long long N;
    scanf("%lld", &N);
    solve(N);
    return 0;
}


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

using i64 = int64_t;

using Graph = vector<vector<int>>;

int dfs(int u, int t, vector<pair<int, int>> &ans, const Graph &graph){
    ans[u].first = t;
    for(auto v: graph[u]){
        if(ans[v].first == -1){
            t = dfs(v, t+1, ans, graph);
        }
    }
    ans[u].second = t + 1;
    return t + 1;
}

int main(){
    int n;
    cin >> n;
    Graph graph(n+1, vector<int>());
    for(int i=0;i<n;++i){
        int u, k;
        cin >> u >> k;
        for(int j=0;j<k;++j){
            int v;
            cin >> v;
            graph[u].push_back(v);
        }
    }
    vector<pair<int, int>> ans(n+1, make_pair(-1, -1));
    int t = 0;
    for(int u=1;u<=n;++u){
        if(ans[u].first == -1)
            t = dfs(u, t+1, ans, graph);
    }
    for(int i=1;i<=n;++i){
        cout << i << " " << ans[i].first << " " << ans[i].second << endl;
    }

    return 0;
}



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

int l[51]={0};

int main(){
    int n, k;
    cin >> n >> k;
    for(int i=0;i<n;++i){
        cin >> l[i];
    }
    sort(l, l+n);
    int ans=0;
    for(int i=n-1;i>=n-k;--i)ans += l[i];
    cout << ans << endl;

    return 0;
}


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


int main()
    {
        int n,ans=0;
        cin>>n;
        int arr[n];
        for(int i=0;i<n;i++)cin>>arr[i];
        
        for(int i=1;i<n-1;i++){
           if((arr[i]<arr[i+1]&&arr[i]>=arr[i-1])||(arr[i]<arr[i-1]&&arr[i]>=arr[i+1]))
           ans++;
        }
        
    cout<<ans;
        
        
    
	return 0;
}


Measured memory_bytes: 256
import java.util.*;
public class Main {
    public static void main(String args[]) {
     Scanner sc = new Scanner(System.in);
     
   int n = sc.nextInt();
   int  k =sc.nextInt();
   long s =0;
   int[] a = new int[n];
   for(int  i=0;i<n;++i){
       a[i]= sc.nextInt();
      
   }
   Arrays.sort(a);
   
   for(int j =0;j<a.length-k;j++){
        s+=a[j];
   }
      
   
   System.out.println(s);
  
    }
}

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

int main(){
 cout<<fixed<<setprecision(12);
	double x1,y1,x2,y2 ;
	cin >> x1 >> y1 >> x2 >> y2 ;
	
	cout << sqrt(pow((x2-x1),2)+pow((y2-y1),2)) << endl ;
    return 0;
    
}


Measured memory_bytes: 3288
using System;

namespace ConsoleApplication1
{
    internal class Program
    {
        public static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());

            var R = new int[n];
            
            for (var i = 0; i < n; i++)
            {
                R[i] = int.Parse(Console.ReadLine());
            }

            int maxv = -2000000000;
            int minv = R[0];

            for (var i = 1; i < n; i++)
            {
                maxv = Math.Max(maxv, R[i] - minv);
                minv = Math.Min(minv, R[i]);
            }
            
            Console.WriteLine(maxv);
        }
    }
}


Measured memory_bytes: 20312
c = 1
loop do
  w = gets.to_i
  break if w == 0
  n = gets.to_i
  table = Array.new
  n.times {table << gets.split(',').map(&:to_i)}

  mw, mv = w, 0
  dp = Array.new(n+1).map{Array.new}
  dp[0][0] = 0
  table.each.with_index(1) do |p, i|
    (0..w).reject{|wi| dp[i-1][wi].nil?}.each do |wi|
      t = dp[i][wi] = [dp[i][wi]||0, dp[i-1][wi]].max
      mw, mv = wi, t if ( t > mv || ( t == mv && wi < mw ) )
      if wi + p[1] <= w
        t = dp[i][wi + p[1]] = [dp[i][wi + p[1]]||0, dp[i-1][wi] + p[0]].max
        mw, mv = wi + p[1], t if ( t > mv || ( t == mv && wi + p[1] < mw ) )
      end
    end
  end

  puts "Case #{c}:", mv, mw

  c += 1
end

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

#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))

using namespace std;

typedef long long int lli;
typedef unsigned long long ull;
typedef complex<double> point;

template <typename P, typename Q>
ostream& operator<<(ostream& os, pair<P, Q> p)
{
  os << "(" << p.first << "," << p.second << ")";
  return os;
}

template <typename T>
ostream& operator<<(ostream& os, vector<T> v)
{
  os << "(";
  each (i, v)
    os << i << ",";
  os << ")";
  return os;
}

int main(int argc, char* argv[])
{
  ios_base::sync_with_stdio(0);
  cin.tie(0);

  int n;
  while (cin >> n) {
    vector<int> v(n);
    each (i, v)
      cin >> i;
    map<int, int> a, b;
    for (int i = 0; i < v.size(); ++i) {
      if (i % 2) {
        ++a[v[i]];
      } else {
        ++b[v[i]];
      }
    }

    vector<pair<int, int>> p;
    p.push_back(make_pair(n / 2, 1 << 29));
    each (i, a) {
      p.push_back(make_pair(n / 2 - i.second, i.first));
    }
    sort(p.begin(), p.end());
    // reverse(p.begin(), p.end());

    vector<pair<int, int>> q;
    q.push_back(make_pair(n / 2, (1 << 29) - 1));
    each (i, b) {
      q.push_back(make_pair(n / 2 - i.second, i.first));
    }
    sort(q.begin(), q.end());
    // reverse(q.begin(), q.end());

    // cout << p << endl;
    // cout << q << endl;

    int mn = 1 << 28;
    for (int i = 0; i < 2; ++i) {
      for (int j = 0; j < 2; ++j) {
        if (p[i].second != q[j].second) {
          mn = min(mn, p[i].first + q[j].first);
        }
      }
    }
    cout << mn << endl;
  }

  return 0;
}


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

map<int, int> mmp;
multiset<int> mst;

int main( void ) {
    
    int n;
    cin >> n;
    
    for (int i = 1; i <= n; ++i) {
        int x;
        cin >> x;
        
        if (mmp[x] == 0)
            mmp[x] = 1;
        else
            mst.insert(x), mmp[x] = 0;
    }
    
    if (mst.size() <= 1)
        cout << 0;
    else
        cout << 1LL * (*mst.rbegin()) * (*prev(prev(mst.end())));
    
    return 0;
}


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

int main() {
	ios::sync_with_stdio(false);
	int w, a, b;
	cin >> w >> a >> b;
	if (a > b) swap(a, b);
	if (a + w >= b) {
		cout << 0 << endl;
		return 0;
	}
	cout << min(abs(a - b), abs(a + w - b)) << endl;
	return 0;
}

Measured memory_bytes: 256
// Rakib (CSE'19)
         
        #include<bits/stdc++.h>
         
         
        #define               ll               long long
        #define               boost_           ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
        #define               pb               push_back
        #define               ull              unsigned long long
        #define               read(i,n,a)      for(i=0;i<n;++i) cin>>a[i];
        #define               show(i,a)        for(auto i:a) cout<<i<<" "; cout<<endl;
        #define               dpoint(n)        cout<<showpoint<<fixed<<setprecision(n);
         
        using namespace std;
         
        int gcd(int x,int y){
            if(!y) return x;
            return gcd(y,x%y);
        }
        bool sortbysec(const pair<int,int>&a, const pair<int,int>&b){ return (a.second<b.second); }
        bool sortbysecinrev(const pair<int,int>&a, const pair<int,int>&b){ return (a.second>b.second); }
        bool sortbysize(string &s1,string &s2){ return s1.size() < s2.size(); }
        bool sortinrev(const pair<int,int> &a, const pair<int,int> &b){ return (a.first > b.first); }
        bool sortcol( const vector<int>& v1, const vector<int>& v2 ) { return v1[0] < v2[0]; }

        ll proceed(){
           
           string s;
           cin >> s;
           s[s.size()-1]=='s'? s+="es" : s+='s';
           cout << s << endl;

           return 0;
       }
            //** Main **//
         
        int main(){
         
                boost_;
                int t=1,i=0;
               // cin >> t;
                while(t--){
         
                    proceed();
         
                }
         
                return 0;
        }

Measured memory_bytes: 3644
N = int(input())
C = []

for _ in range(N):
    a = int(input())
    comment = [[int(_) for _ in input().split()] for i in range(a)]
    C.append(comment)

ans = 0
for z in range(2 ** N):
    chk = [0] * N
    honests = []
    for b in range(N):
        if (1 << b) & z:
            honests.append(b)
            chk[b] = 1

    err = False
    for honest in honests:
        # コメントチェック
        for _i, v in C[honest]:
            i = _i - 1
            if chk[i] != v:
                err = True
                break
        if err: break
    if err: continue
    ans = max(ans, len(honests))

print(ans)


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

int main()
{
    int N;
    int cnt = 1;
    string s;
    cin >> N;
    cin >> s;

    for (int i = 1; i < N; i++)
    {
        if (s[i - 1] != s[i])
            cnt++;
    }

    cout << cnt << endl;

    return 0;
}

Measured memory_bytes: 512
using System;
 
namespace Aizu
{
    class OnlineJudge
    {
        public static void Main()
        {
            for(int i = int.Parse(Console.ReadLine()); i > 0; --i) {
                var d = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
                Console.WriteLine((d[0] - 1) % d[1] + 1);
            }
        }
    }
}

Measured memory_bytes: 5656
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int N,k;
    cin>> N;
    vector<int> X(N);
    for(int i = 0;i < N ; i++ ){
        cin>> X.at(i);
    }
    k=9999999;
    for(int p = 1;p < 101 ; p++){
        int a=0 ;
        for(int j= 0 ; j< N;j++){
            a += (X.at(j)-p)*(X.at(j)-p);
        }
        if(k>a){
            k = a;
            }
    }
    cout<< k << endl;



}

Measured memory_bytes: 256
/**
 *    author:  RM07
 *    created: August 29, 2020 5:31 PM
 *    motto: Knowledge is Power, Strive for Excellence
**/
#include<bits/stdc++.h>
using namespace std;
#define int long long 
signed main(){
    int d,t,s;
    cin >> d >> t >> s;
    if(t * s >= d) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define LL long long
using namespace std;


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

    LL sum = 0;
    for (LL i = 1; i * i <= n; i++){
        if (n % i > 0) continue;
        LL a = i, b = n / i, c = a - 1;
        if (c > 0 && n / c == n % c) sum += c;

        if (a == b) continue;
        swap(a,b);
        c = a - 1;
        if (c > 0 && n / c == n % c) sum += c;
    }
    cout<<sum<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bit>
#include <bitset>
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <math.h>
#include <stdlib.h>
#include <queue>
#include <stack>


typedef long double ld;
typedef long long ll;

using namespace std;

map<string, int> m;

void print(string s) {
	cout << s << " x " << m[s] << endl;
}

int main() {
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		string s;
		cin >> s;
		m[s]++;
	}
	print("AC");
	print("WA");
	print("TLE");
	print("RE");
	return 0;
}


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

using namespace std;

int main(){
        int N;
        cin >> N;
        set<int> st{1,2,3,5,6,9,10,13,17};
        if (N > 3 && st.count(N%28) == 0) cout << "Yes" << endl;
        else cout << "No" << endl;
        return 0;
}


Measured memory_bytes: 256
import sys
#import numpy as np

sys.setrecursionlimit(10 ** 9)

K = int(input())

def gcd(x,y):
    while y:
        x, y = y, x % y
    return x

ans = 0
for i in range(K):
    for j in range(K):
        for k in range(K):
            ans += gcd(gcd(i+1,j+1), k+1)

print(ans)


Measured memory_bytes: 73852
#include <iomanip>
#include <iostream>
#include <algorithm>
#include <vector>
#include <array>
#include <unordered_set>

using namespace std;

template<class T> using vec = vector<T>;
template<class T> using vvec = vector<vector<T>>;
using ll = long long;
using ld = long double;

#define REPi(i, s, e) for(int i = (s); i < (e); ++i)
#define REPll(i, s, e) for(ll i = (s); i < (e); ++i)

ll gcd(ll a, ll b)
{
	return b != 0 ? gcd(b, a % b) : a;
}

int main()
{
	cin.tie(0);

	int N, M; cin >> N >> M;
	int l = 0, r = N + 1;
	REPi(i, 0, M)
	{
		int L, R; cin >> L >> R;
		if (l < L) l = L;
		if (R < r) r = R;
	}

	if (l > r) cout << 0 << endl;
	else cout << r - l + 1 << endl;


	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
	string s;
	cin >> s;
	long long ans=0;
	int A=0;
	for (int i=0;i<s.size()-1;i++)
	{
		if (s[i]=='A')
		A++;
		else if (s[i]=='B' && s[i+1]=='C')
		{
			ans+=A;
			i++;
		}
		else
		A=0;
	}
	printf("%lld",ans);
}

Measured memory_bytes: 640
#include <iostream>
#include <fstream>
#include <set>
#include <vector>
#include <algorithm>
#include <cmath>
#include <chrono>
using namespace std;

int func(int x) {
    int sum = 0;
    while (x > 0) {
        sum += x % 10;
        x /= 10;
    }
    return sum;
}

int main(int argc, const char * argv[]) {
    
    int N;
    cin >> N;
    
    if (N % func(N) == 0) cout << "Yes" << endl; else cout << "No" << endl;
    
    return 0;
}


Measured memory_bytes: 256
h , w , k = map(int,input().split())
c = [list(input()) for i in range(h)]
ans = 0
for i in range(2**h):
    for j in range(2**w):
        cou = 0
        for a in range(h):
            if (i >> a) & 1 == 1:
                continue
            for b in range(w):
                if (j >> b) & 1 == 1:
                    continue
                if c[a][b] == "#":
                    cou += 1
        if cou == k:
            ans += 1
print(ans)

Measured memory_bytes: 9180
import sys

n=int(input())
w=[]
flag=True
for i in range(n):
    w+=[input()]
if(n!=len(set(w))):
    print('No')
    sys.exit()

f=w[0][0]
e=w[0][-1]
for i in range(1,n):
    if(e==w[i][0]):
        e=w[i][-1]
        continue
    else:
        flag=False
        break
    
if(flag):print('Yes')
else:print('No')

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

using namespace std;


#define ff				first
#define ss				second
#define int				long long
#define pb				push_back
#define mp				make_pair
#define pii				pair<int,int>
#define vi				vector<int>
#define mii 			map<int,int>
#define	pqb				priority_queue<int>
#define pqs				priority_queue<int,vi,greater<int> >
#define setbits(x)		__builtin_popcountll(x)
#define zrobits(x)		__builtin_ctzll(x)
#define mod				1000000007
#define inf 			1e18
#define ps(x,y)			fixed<<setprecision(y)<<x
#define mk(arr,n,type)	type *arr = new type[n]
#define w(x)			int x; cin>>x; while(x--)
#define FIO             ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define endl			'\n'

void c_p_c()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

}


bool isPrime(int n)
{
	if (n <= 1)
		return false;
	if (n <= 3)
		return true;
	if (n % 2 == 0 || n % 3 == 0)
		return false;
	for (int i = 5; i * i <= n; i += 6)
	{
		if (n % i == 0 || n % (i + 2) == 0)
			return false;

	}
	return true;
}

vector<int> Sieve(int n)
{
	bool prime[n + 1];
	memset(prime, true, sizeof(prime));
	for (int i = 2; i * i <= n; i++)
	{
		if (prime[i])
		{
			for (int j = i * i; j <= n; j += i)
			{
				prime[j] = false;
			}
		}
	}
	vector<int> primes;

	for (int i = 2; i <= n; i++)
	{
		if (prime[i])
			primes.pb(i);
	}
	return primes;
}
map<int, int> primeFactors(int  n)
{
	mii factors;
	while (n % 2 == 0)
	{
		n /= 2;
		factors[2]++;

	}
	for (int i = 3; i <= sqrt(n); i += 2)
	{
		// int count = 0;
		while (n % i == 0)
		{
			factors[i]++;
			n /= i;
		}
	}
	if (n > 2)
		factors[n]++;
	return factors;
}

// Graph------------------------------------------------------------------------

int32_t main()
{
	FIO;
	// c_p_c();
// --------------------------------------------------
// Never GIVE UP !!!!

	int n;
	cin >> n;
	string s;
	map<string, int> occ;
	for (int i = 0; i < n; i++)
	{
		cin >> s;
		occ[s]++;
	}
	cout << "AC x " << occ["AC"] << endl << "WA x " << occ["WA"] << endl << "TLE x " << occ["TLE"] << endl << "RE x " << occ["RE"] << endl;


}




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

using namespace std;

int main()
{
    int x,y;
    vector<int> arrayX;
    vector<int> arrayY;
    int count;

    while(1)
    {
        cin >> x >> y;
        if(x == 0 && y == 0)
        {
            break;
        }
        else
        {
            if(x > y)
            {
                arrayX.push_back(y);
                arrayY.push_back(x);
            }
            else
            {
                arrayX.push_back(x);
                arrayY.push_back(y);
            }
            count++;
        }
    }
    for(int i = 0; i < count; i++)
    {
        cout << arrayX[i] << " " << arrayY[i] << endl;
    }
    return 0;
} 

Measured memory_bytes: 1240
#include<stdio.h>

int main(){
    int W,H,x,y,r;
    scanf("%d%d%d%d%d",&W,&H,&x,&y,&r);
    if(x-r>=0 && 
       x+r<=W && 
       y-r>=0 &&
       y+r<=H ){
        printf("Yes\n");
    }else{
        printf("No\n");
    }
}


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

int main(int argc, char const *argv[]) {
    std::string s;
    std::cin >> s;
    if (s.length() == 2)
        std::cout << s;
    else {
        std::reverse(s.begin(), s.end());
        std::cout << s;
    }
    std::cout << '\n';
    return 0;
}

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

int main() {
    int N1, N2, N3, N4;
    cin >> N1 >> N2 >> N3 >> N4;
    vector<int>vec = {N1, N2, N3, N4};
    sort(all(vec));
    vector<int>ans = {1,7,9,4};
    sort(all(ans));
    if (vec==ans) cout << "YES" << endl;
    else cout << "NO" << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <queue>
#include <utility>
#include <map>
#include <bitset>
#define ll long long
using namespace std;
using p = pair<ll, ll>;
ll dx[2] = {0, 1};
ll dy[2] = {1, 0};

int main(void){
    ll n, m;
    cin >> n >> m;
    ll sum = 0;
    for(ll i = 0; i < m; i++){
        ll a;
        cin >> a;
        sum+=a;
    }
    ll ans = n-sum;
    if(ans>=0)
        cout << ans << endl;
    else
        cout << -1 << endl;
    return 0;
}


Measured memory_bytes: 3640
#define _USE_MATH_DEFINES
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <memory>
#include <string>

#include <algorithm>
#include <complex>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <vector>

using namespace std;

#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#define __typeof__ decltype
#endif

#define ITER(c)         __typeof__((c).begin())
#define FOREACH(it, c)  for (ITER(c) it=(c).begin(); it != (c).end(); ++it)
#define RITER(c)        __typeof__((c).rbegin())
#define RFOREACH(it, c) for (RITER(c) it=(c).rbegin(); it != (c).rend(); ++it)
#define REP(i, n)       REPEAT(i, 0, n)
#define REPEAT(i, k, n) for (int i = (k); i < (n); ++i)
#define REVREP(i, n)    for (int i = ((n)-1); i >= 0; --i)
#define FIND(c, n)      std::find((c).begin(), (c).end(), (n));
#define BSEARCH(c, n)   std::binary_search((c).begin(), (c).end(), (n))
#define ESIZEOF(A)      (sizeof(A)/sizeof((A)[0]))
#define MIN(p1,p2)      (((p1)<(p2))?(p1):(p2))
#define MAX(p1,p2)      (((p1)>(p2))?(p1):(p2))
#define CIN_NO_SYNC     do { cin.tie(0); ios_base::sync_with_stdio(false); } while(0)

#ifdef _DEBUG
#define pf printf
#else
#define pf(...) /* */
#endif

typedef long long ll;
typedef unsigned long long ull;

#define X real()
#define Y imag()
typedef double D;
typedef complex<double>P;

D inprd(const P &a, const P &b){ return (conj(a) * b).X; }
D outprd(const P &a, const P &b){ return (conj(a) * b).Y; }
P circum_center(const P &a, const P &b, const P &c){
    P bc = c - b, ca = a - c, ab = b - a;
    return (a + b - (inprd(bc, ca) / outprd(ab, bc)) * ab * P(0,1)) / 2.0;
}

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

    REP(i, n){
        double x1,y1,x2,y2,x3,y3;
        cin >> x1>>y1>>x2>>y2>>x3>>y3;
        P p1(x1,y1), p2(x2,y2), p3(x3,y3);
        P c = circum_center(p1, p2, p3);
        printf("%.3f %.3f %.3f\n", c.X, c.Y, abs(p1 - c));
    }

    return 0;
}

Measured memory_bytes: 1264
#include<bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef pair<int,int> pii;
typedef vector< pii > vii;

#define ll          long long
#define ff          first
#define ss          second
#define pb          push_back
#define mkp         make_pair
#define sz          size()

#define forf(a,b,c)    for(int i=a;i<=b;i+=c)
#define forr(a,b,c)    for(int i=a;i>=b;i-=c)
#define all(a)      a.begin(),a.end()
#define mem(a,b)    memset(a,b,sizeof(a))
#define pi          2*acos(0.0)
#define End         return 0;
#define nl endl

#define scan1(a)    scanf("%d",&a)
#define scan2(a,b)  scanf("%d %d",&a,&b)
#define scan3(a,b,c)  scanf("%d %d %d",&a,&b,&c)
#define scanl(a)    scanf("%lld",&a)
#define scanll(a,b) scanf("%lld %lld",&a,&b)
#define scanlll(a,b,c) scanf("%lld %lld %lld",&a,&b,&c)

#define print1(a)    printf("%d",a)
#define print2(a,b)  printf("%d %d",a,b)
#define print3(a,b,c)  printf("%d %d %d",a,b,c)
#define printl(a)    printf("%lld",a)
#define printll(a,b) printf("%lld %lld",a,b)
#define printlll(a,b,c) printf("%lld %lld %lld",a,b,c)

#define MAXN        100000007
#define INF 0x3f3f3f3f
bool mark[100005];vi prime;
void seive(ll N){for(int i=2;i<=N;i++){if(mark[i]==false){prime.pb(i);for(int j=i+i;j<N;j+=i)mark[j]=true;}}}
//freopen("input.txt", "r", stdin);

int main()
{
   ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int n;
    cin>>n;
    map<int,int>mp;
    mp[1]=9;mp[3]=909; mp[5]=90909;
    int dig=0;
    int nn=n;
    while(nn){
        dig++;
        nn/=10;
    }
    nn=n/10;
    int pos=1;
    while(nn) {
       pos*=10;
       nn/=10;
    }
    if(dig%2==0){
        cout<<mp[dig-1]<<endl;
    }
    else {
        cout<<abs(mp[dig-2]+(n-pos)+1)<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define all(c) (c).begin(),(c).end()
#define pii pair<long long,long long>
#define endl '\n'

using namespace std;

signed main(){
    std::ios::sync_with_stdio(false);
    cin.tie(NULL);
    int t=1;
    //cin >> t;
    while(t--){
        int n;
        cin >> n;
        int ans=0;
        int p=100;
        while(n>p){
            p+=p/100;
            //p/=100;
            ans++;
        }
        cout << ans << endl; 
        //cout << p;
    }
}

Measured memory_bytes: 3640
s = list(map(str,input()))

ans = []

for i in range(len(s)):
    if s[i] == '0':
        ans.append('0')
    elif s[i] == '1':
        ans.append('1')
    else:
        if ans == []:
            continue
        else:
            ans.pop(-1)

print(''.join(ans))


Measured memory_bytes: 3060
;; -*- coding:utf-8 -*-

(defparameter *file-path* *load-pathname*)

(defun clip-to-string ()
  (with-output-to-string (out)
    (sb-ext:run-program "C:/msys64/usr/bin/cat.exe" '("/dev/clipboard") :output out)))

(defun test ()
  (with-input-from-string (*standard-input* (clip-to-string))
    (load *file-path*)))


(defstruct (queue (:constructor
		  $make-queue))
  arr
  (start 0 :type fixnum)
  (end 0 :type fixnum))

(defun make-queue (size)
  ($make-queue :arr (make-array size :initial-element nil)
	       :start 0
	       :end 0))

(defun null-queue (queue)
  "Gibt T zurück, wenn QUEUE leer ist."
  (= (queue-start queue) (queue-end queue)))

(defun enqueue (obj queue)
  (setf (aref (queue-arr queue) (queue-end queue)) obj)
  (incf (queue-end queue))
  queue)

(defun enqueue-list (lst queue)
  (if (null lst)
      queue
      (enqueue-list (cdr lst)
		    (enqueue queue (car lst)))))
	

(defun dequeue (queue)
  (if (null-queue queue)
      (error "QUEUE ist leer.")
      (prog1 (aref (queue-arr queue) (queue-start queue))
	(incf (queue-start queue)))))

(defun reset-queue (queue)
  (setf (queue-start queue) 0
	(queue-end queue) 0))

(defstruct edge
  (dest 0 :type fixnum)
  (weight 0 :type fixnum))

(defun read-graph (n m)
  (let ((graph (make-array n :element-type 'list :initial-element nil)))
    (dotimes (x m graph)
      (let* ((left (- (read) 1))
	     (right (- (read) 1))
	     (dist (read)))
	(push (make-edge :dest right :weight dist)
	      (aref graph left))
	(push (make-edge :dest left :weight (- dist))
	      (aref graph right))))))

(defun find-new-idx (graph table)
  (loop for idx from 0 below (length graph)
     do (when (and (aref graph idx)
		   (= (aref table idx) most-negative-fixnum))
	  (return idx))
     finally (return -1)))

(defun valid-p (graph)
  "Breitensuche."
  (let* ((size (length graph))
	 (queue (make-queue size))
	 (table (make-array size
			    :element-type 'fixnum
			    :initial-element most-negative-fixnum)))
    (loop named main-loop
       for new-idx = (find-new-idx graph table)
       until (= -1 new-idx)
       finally (return-from main-loop t)
       do
	 (reset-queue queue)
	 (enqueue new-idx queue)
	 (setf (aref table new-idx) 0) ; Die erste Zahl ist egal.
	 (loop named sub-loop
	    until (null-queue queue)
	    do (let* ((start-idx (dequeue queue))
		      (start-number (aref table start-idx))
		      (edges (aref graph start-idx)))
		 (dolist (edge edges)
		   (let ((dest-idx (edge-dest edge))
			 (dest-number (+ start-number (edge-weight edge))))
		     (cond ((= most-negative-fixnum (aref table dest-idx))
			    (setf (aref table dest-idx) dest-number)
			    (enqueue dest-idx queue))
			   ((/= (aref table dest-idx) dest-number)
			    (return-from main-loop nil))))))))))
	  
	

(defun main ()
  (let* ((n (read))
	 (m (read))
	 (graph (read-graph n m)))
    (format t (if (valid-p graph)
		  "Yes~%"
		  "No~%"))))
	

(main)


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

using namespace std;
using ll = long long;

ll mod = 1e9 + 7;

ll fact[200001];

ll po(ll a, int x);

ll get_binomal(int n, int r);

int main() 
{
    cin.tie(0); cout.tie(0);
    ios::sync_with_stdio(false);
    
    int n, a, b;
    cin >> n >> a >> b;
    
    fact[0] = fact[1] = 1;
    for (int i = 2; i <= max(a, b); ++i)
        fact[i] = fact[i - 1] * i % mod;
    
    ll entire = po(2, n) - 1;
    entire -= get_binomal(n, a);
    entire -= get_binomal(n, b);

    while (entire < 0)
        entire += mod;
    cout << entire;
}

ll po(ll a, int x)
{
    if (!x)
        return 1;

    if (x == 1)
        return a;
    
    if (x & 1)
        return po(a, x - 1) * a % mod;
    
    return po(a * a % mod, x / 2);
}

ll get_binomal(int n, int r)
{    
    if (n - r < r)
        r = n - r;

    ll upper = 1;
    ll lower = fact[r];
    
    for (int i = n; i > n - r; --i)
        upper = (upper * i) % mod;
    
    return upper * po(lower, mod - 2) % mod;
}

Measured memory_bytes: 1792
N=input()
x=len(N)
if x==2:
    N=N[1:]
if x==3:
    N=N[2:]
if N=="2" or N=="4" or N=="5" or N=="7" or N=="9":
    print("hon")
if N=="0" or N=="1" or N=="6" or N=="8":
    print("pon")
if N=="3":
    print("bon")
    

    
    

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

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

  vector<int> p(N);
  int pmax = 0;
  int sum = 0;
  for ( int i=0; i<N; i++ ) {
    cin >> p[i];
    pmax = max(pmax, p[i]);
    sum += p[i];
  }
  cout << sum - pmax/2 << endl;
  return 0;
}


Measured memory_bytes: 256