akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define SZ(x) ((int)(x).size())
#define rep(i,n) for(int i=0;i<(n);++i)
#define fore(i,a) for(auto &i:a)
#define min(...) min({__VA_ARGS__})
#define max(...) max({__VA_ARGS__})
#define Yes cout << "Yes" << endl;
#define No cout << "No" << endl;
#define ALL(x) (x).begin(),(x).end()
signed _main(); signed main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> using v = vector<T>;
template<class T> using vv = vector<v<T>>;
const int MOD=1e9+7;
const long long INF = 1LL << 60;
using P=pair<int,int>;

signed _main(){
  int N,M; cin >> N >> M;
  unordered_map<int,int> mp;
  int ans=0,ac=0;
  rep(i,M){
    int p;
    string S;
    cin >> p >> S;
    if(S=="AC"){
      if(mp[p]!=-1){
        ans+=mp[p];
        ac++;
        mp[p]=-1;
      }
    }
    if(S=="WA"){
      if(mp[p]!=-1) mp[p]++;
    }
  }
  cout << ac << " " << ans << endl;
  return 0;
}


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

typedef long long ll;
#define rep(i,x) for(int i=0;i<x;i++)
#define put(ans)    cout << ans << endl;

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

    cout << (a-1)*(b-1) << endl;

    return 0;
}

Measured memory_bytes: 3524
#include <iostream>
#include <stdio.h>
#include <bits/stdc++.h>
#include <math.h>
#include <string>
#include <sstream>
#define ll long long
#define F first
#define S second
#define pb push_back
#define ld long double
#define pll pair<long long,long long>
#define pld pair<long double,long double>
#define ios     ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
ll mod=1000000007;
ll INF=1e18;
ll gcd (ll a,ll b)
{
    if(b==0)
        return a;
    else
        return gcd(b,a%b);
}
ll fastexp(ll x ,ll n)
{
    ll result =1;
    while(n>0)
    {
        if(n%2==1)
            result*=x;
        x*=x;
        n=n/2;
    }
    return result;
}

ll modularExp(ll x,ll n,ll mod)
{
    ll result=1;
    while(n>0)
    {
        if(n%2==1)
            result=(result*x)%mod;
        x=((x%mod)*(x%mod))%mod;
        n=n/2;
    }
    return (result)%mod;
}
bool isPrime(ll n)
{
    for(ll i=2;i*i<=n;i++)
        if(n%i==0)
            return false;
    return true;
}
bool mycomp(pll &a,pll &b)
{
    if(a.F!=b.F)
        return a.F < b.F;
    else
        return a.S < b.S;
}
set<ll> v[200005];
vector<ll> visited(200005);
ll dfs(ll node)
{
     visited[node]=1;
     ll cnt=1;
     for(auto it:v[node])
     {
          if(!visited[it])
               cnt+=dfs(it);
     }
     return cnt;
}
void solve()
{
     ll n,m;
     cin>>n>>m;
     ll i,j;
     for(i=1;i<=m;i++)
     {
          ll x,y;
          cin>>x>>y;
          v[x].insert(y);
          v[y].insert(x);
     }
     ll ans =0;
     for(i=1;i<=n;i++)
     {
          if(!visited[i])
               ans=max(ans,dfs(i));
     }
     cout<<ans;
     
}

     
     


int main()
{
    ios;
    ll t;
//    cin>>t;
     t=1;
     while(t--)
     {
          solve();
     }
}

Measured memory_bytes: 38976
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>

#define ll long long
#define ull unsigned long long

using namespace std;

const ll INF = 100100100100;

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

	vector <ll> num;
	num.push_back(1);

	ll tmp = 6;
	while(tmp <= N){
		num.push_back(tmp);
		tmp *= 6;
	}

	tmp = 9;
	while(tmp <= N){
		num.push_back(tmp);
		tmp *= 9;
	}

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

	vector <ll> dp(N+1, INF);
	dp[0] = 0;
	dp[1] = 1;
	for (ll ii = 2; ii <= N; ++ii){
		for (ll jj = 0; jj < num.size(); ++jj){
			ll idx = ii - num[jj];
			if (idx < 0) break;
			dp[ii] = min(dp[ii], dp[idx] + 1);
		}
	}

	cout << dp[N] << "\n";

	return 0;
}


Measured memory_bytes: 3868
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
//template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

/* attention
    long longのシフト演算には気をつけよう
    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも
*/


int main(){
    ll ans = 0;
    int n; cin >> n;
    ll T; cin >> T;
    vector<ll> a(n);
    for(int i=0; i<n; i++) cin >> a[i];

    for(int i=1; i<n; i++) ans += min(T, a[i]-a[i-1]);

    ans += T;
    cout << ans << endl;
}

Measured memory_bytes: 1792
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>

using namespace std;

int my_hash(int num)
{
	int value = 0;
	while (num > 0)
	{
		value += (num % 10);
		num /= 10;
	}

	return value;
}

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

	if (N % my_hash(N) == 0)
	{
		cout << "Yes" << endl;
	}
	else
	{
		cout << "No" << endl;
	}

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <functional>
#include <vector>
#include <string>
#include <cstring>
#include <bits/stdc++.h>

typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n,m) for(int i=n;i<m;i++)
#define repn1(i,n,m) for(int i=n;i<=m;i++)
using namespace std;
const int INF = 1e+8;

ll dp[100][100];
int equ[100]; 

int main(){
	memset(dp, 0, sizeof(dp));
	memset(equ, 0, sizeof(equ));

	int n;

	cin >> n;
	rep(i, n) cin >> equ[i];

	dp[0][equ[0]] = 1;

	repn1(i, 1, n){
		rep(j,21){
			int data;
			data = j + equ[i];
			if(/*0 <= data &&*/ data <= 20) dp[i][data] += dp[i-1][j]; 
			data = j - equ[i];
			if(0 <= data /*&& data <= 20*/) dp[i][data] += dp[i-1][j];
		}
	}

	cout << dp[n-1][equ[n]] << endl;

	return 0;
}

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

using namespace std;

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

int gcm();
int lcm();

// 最大公約数
ll gcm(ll a, ll b) {
	if (a < b) swap(a, b);
	if (b == 0) return 0;
	while (b) {
		a %= b;
		swap(a, b);
	}
	return a;
}

// 最小公倍数
ll lcm(ll a, ll b) {
	return a / gcm(a, b) * b;
}

// 約分
P reduction(P a) {
	ll g = gcm(a.first, a.second);

	a.first /= g;
	a.second /= g;

	return a;
}

int main() {
	int n;

	while (cin >> n, n) {
		vector<P> data;
		for (int i = 0; i < n; ++i) {
			int d, v; cin >> d >> v;
			data.push_back( P(d, v) );
		}

		// 約分
		for (int i = 0; i < n; ++i)
			data[i] = reduction(data[i]);

		// 時間計算
		P now = data[0];
		for (int i = 1; i < n; ++i) {
			P next = data[i];

			ll l = lcm(now.second, next.second);
			now.first *= l / now.second;
			next.first *= l / next.second;
			now.second = l;

			now.first = lcm(now.first, next.first);

			now = reduction(now);
		}

		// 出力
		for (int i = 0; i < n; ++i) {
			cout << (now.first * data[i].second / now.second / data[i].first) << endl;
		}
	}
}

Measured memory_bytes: 916
#include <iostream>

int main() {
    int a, b, c;
    std::cin >> a >> b >> c;

    if(a == b) {
        std::cout << c << std::endl;
    } else if(b == c) {
        std::cout << a << std::endl;
    } else {
        std::cout << b << std::endl;
    }
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <math.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <sstream>
#include <iostream>
#include <time.h>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <string.h>
#define sf scanf
#define pf printf
#define lf double
#define ll long long
#define p123 printf("123\n");
#define pn printf("\n");
#define pk printf(" ");
#define p(n) printf("%d",n);
#define pln(n) printf("%d\n",n);
#define s(n) scanf("%d",&n);
#define ss(n) scanf("%s",n);
#define ps(n) printf("%s",n);
#define sld(n) scanf("%lld",&n);
#define pld(n) printf("%lld",n);
#define slf(n) scanf("%lf",&n);
#define plf(n) printf("%lf",n);
#define sc(n) scanf("%c",&n);
#define pc(n) printf("%c",n);
#define gc getchar();
#define re(n,a) memset(n,a,sizeof(n));
#define len(a) strlen(a)
using namespace std;
int main(){
    ll n;
    sld(n)
    pld(n*(n-1)/2);
    return 0;
}


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

int dp[50];

int fibo(int n) {
    if(n==0 || n==1) {
        return dp[n]=1;
    }
    else if(dp[n] != -1) {
        return dp[n];
    }
    else {
        return dp[n]=fibo(n-1)+fibo(n-2);
    }
}

int main() {
    int n;
    cin >>n;
    for(int i=0; i<=n; i++) dp[i]=-1;
    cout << fibo(n) << endl;
}


Measured memory_bytes: 3104
import java.io.*;
import java.util.*;


public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		char[] s1 = sc.next().toCharArray();
		char[] s2 = sc.next().toCharArray();
		char[] s3 = sc.next().toCharArray();

		StringBuilder ret = new StringBuilder();
		ret.append(s1[0]);
		ret.append(s2[0]);
		ret.append(s3[0]);

		pr.println(ret.toString().toUpperCase());
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);

		solve();

		pr.close();
		sc.close();
	}

	private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	}
}


Measured memory_bytes: 23764
[(a, b, c), (d, e, f), (g, h, i)] = \
    [map(int, input().split()) for _ in range(3)]
print('Yes' if a - b == d - e == g - h and b - c == e - f == h - i \
    and a - d == b - e == c - f and d - g == e - h == f - i else 'No')

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

        int main() {
            string a, b;
            cin >> a >> b;

           if ( a + "a" == b){ cout << "Yes" << endl; }
           else if (a + "b" == b) { cout << "Yes" << endl; }
           else if (a + "c" == b) { cout << "Yes" << endl; }
           else if (a + "d" == b) { cout << "Yes" << endl; }
           else if (a + "e" == b) { cout << "Yes" << endl; }
           else if (a + "f" == b) { cout << "Yes" << endl; }
           else if (a + "g" == b) { cout << "Yes" << endl; }
           else if (a + "h" == b) { cout << "Yes" << endl; }
           else if (a + "i" == b) { cout << "Yes" << endl; }
           else if (a + "j" == b) { cout << "Yes" << endl; }
           else if (a + "k" == b) { cout << "Yes" << endl; }
           else if (a + "l" == b) { cout << "Yes" << endl; }
           else if (a + "m" == b) { cout << "Yes" << endl; }
           else if (a + "n" == b) { cout << "Yes" << endl; }
           else if (a + "o" == b) { cout << "Yes" << endl; }
           else if (a + "p" == b) { cout << "Yes" << endl; }
           else if (a + "q" == b) { cout << "Yes" << endl; }
           else if (a + "r" == b) { cout << "Yes" << endl; }
           else if (a + "s" == b) { cout <<"Yes" << endl; }
           else if (a + "t" == b) { cout << "Yes" << endl; }
           else if (a + "u" == b) { cout << "Yes" << endl; }
           else if (a + "v" == b) { cout << "Yes" << endl; }
           else if (a + "w" == b) { cout <<"Yes" << endl; }
           else if (a + "x" == b) { cout << "Yes" << endl; }
           else if (a + "y" == b) { cout << "Yes" << endl; }
           else if (a + "z" == b) { cout << "Yes" << endl; }
           else   { cout << "No" << endl; }
           

            
        }

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


int main() {
    int K,i;
    string S;
    cin >>  K >> S;

    if(S.size()<=K)cout << S;
    else{
        for(i=0;i<K;i++){
            cout << S[i];
            if(i==K-1)cout << "..." << endl;
            
        }
    }
}






Measured memory_bytes: 3628
#include <iostream>
using namespace std;
int main(){
    int a,b,c,d=1,e=0;
    cin>>a;
    int x[a];
    for(b=0;b<a;b++){
        cin>>x[b];
    }
    for(c=0;c<a;c++){
        d=x[d-1];
        if(d==2){
            cout<<c+1;
            e=1;
            break;
        }
    }
    if(e==0){
        cout<<"-1";
    }
}

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

using namespace std;
typedef long long ll;
typedef pair<int,int> P;

//マクロ
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x))
#define INF 1000000000000 //10^12
#define MOD 10000007 //10^9+7
#define PB push_back
#define MP make_pair
#define F first
#define S second

int main(int argc, char const *argv[])
{
    int n;
    cin >> n;
    vector<P> p(n);
    REP(i,n)
        cin >> p[i].S >> p[i].F;
    sort(ALL(p));
    int now = 0;
    REP(i,n)
    {
        now += p[i].S;
        if (now > p[i].F)
        {
            cout << "No" << endl;
            return 0;
        }
    }    

    cout << "Yes" << endl;
    return 0;
}


// int main(int argc, char const *argv[]) {
//     int n;
//     cin >> n;
    
//     map<int,priority_queue<int>> ma;
//     priority_queue<int, vector<int>, greater<int>> q;
    
//     REP(i,n)
//     {
//         int a, b;
//         cin >> a >> b;
//         q.push(b);
//         ma[b].push(a);
//     }

//     int now = 0,top;

//     while(!q.empty())
//     {
//         top = q.top();
//         q.pop();
//         while (!ma[top].empty())
//         {
//             now+=ma[top].top();
//             ma[top].pop();
//             if (now > top)
//             {
//                 cout << "No" << endl;
//                 return 0;
//             }
//         }
//     }

//     cout << "Yes" << endl;

//     return 0;
// }


Measured memory_bytes: 1792
def main():
    i, o, t, j, l, s, z = map(int, input().split())
    x = [i % 2, j % 2, l % 2]
    if x.count(1) in [0, 3]:
        ans = i+j+l+o
    else:
        if min([i, j, l]) == 0:
            ans = 2*(i//2+j//2+l//2)+o
        else:
            ans = i+j+l+o-1
    print(ans)


main()


Measured memory_bytes: 3060
# 幅優先探索（行きがけ）
import collections
import sys


def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())


def main():
    L, R, d = LI()
    cn = 0
    for i in range(L, R+1):
        if i % d == 0:
            cn += 1
    print(cn)


if __name__ == '__main__':
    main()


Measured memory_bytes: 9456
import java.util.*;
import java.util.stream.*;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.nextLine();
        long k = in.nextLong();
        int pos = 0;
        while(pos < s.length() && s.charAt(pos) == '1') pos++;
        if(k <= pos) {
            System.out.println(1);
        } else {
            System.out.println(s.charAt(pos));
        }
    }
}


Measured memory_bytes: 21972
n,t=map(int, input().split())
l=[input().split() for i in range(n)]

k=[]

for x in range(n):
  if (int(l[x][1]) <= t):
    k.append(int(l[x][0]))
  
if (k==[]):
  print('TLE')
else:  
  print(min(k))


Measured memory_bytes: 2940
H = int(input())
waru = H
cont = 0
while(1):
  if waru<=1:
    break
  waru = int(waru/2)
  cont = cont + 1
  
  
  
kaizyo = []

for i in range(41):
  kaizyo.append(2**i)

print(sum(kaizyo[:cont+1]))

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

using boost::multiprecision::cpp_int;
using namespace std;

#if __has_include("print.hpp")
  #include "print.hpp"
#endif

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define MOD 1000000007

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;
typedef pair<ll, ll> p;


int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n;
  cin >> n;
  vector<p> edges;
  cpp_int res = 0;

  for (ll i = 1; i <= n; ++i) {
    res += i * (n-(i-1));
  }
  for (ll i = 0; i < n-1; ++i) {
    ll from, to;
    cin >> from >> to;
    from--; to--;
    edges.push_back({from, to});
    ll minv = min(from, to);
    ll maxv = max(from, to);
    res -= (minv+1) * (n-maxv);
  }
  cout << res << endl;
}


Measured memory_bytes: 7464
import java.util.*;
public class Main {
    
public static void main (String[]args){
  Scanner input = new Scanner (System.in);
  int n = input.nextInt();
  int l = input.nextInt();
  String [] arr = new String [n];
    for (int i = 0; i < arr.length; i++) {
        arr[i]=input.next();
    }
    Arrays.sort(arr);
    for (int i = 0; i < arr.length; i++) {
        System.out.print(arr[i]);
    }
    System.out.println();

}
}

Measured memory_bytes: 29716
#include <iostream>
#include <algorithm>
#include <vector>
#include <random>
#include <chrono>
using namespace std;
random_device seed;
mt19937_64 engine(seed());
uint_fast64_t rnd(){ return engine(); }
uint_fast64_t rnd(uint_fast64_t u){ return (u <= 1)?0:engine()%u; }
long long rnd(long long a, long long b){
    if(a > b) swap(a, b);
    return a + (engine()%(b-a+1));
}
const int alp = 26;
int D;
vector<long long> c(alp);
vector< vector< long long > > s;

long long sub(vector<int>& last, int x, int d){
    long long res = s[d][x];
    for(int j=0;j<alp;j++){
        if(j != x) res -= c[j] * (d-last[j]);
    }
    return res;
}

long long score(vector<int>& t){
    if(t.size() != D) return 0;
    vector< int > last(alp, -1);
    long long res = 0;
    for(int i=0;i<D;i++){
        res += s[i][t[i]];
        last[t[i]] = i;
        for(int j=0;j<alp;j++){
            res -= c[j] * (i-last[j]);
        }
    }
    return res;
}

void f(vector<int>& t){
    t.assign(D, 0);
    vector< int > last(alp, -1);
    for(int i=0;i<D;i++){
        int mxj = 0;
        long long mx = -1e9;
        for(int j=0;j<alp;j++){
            long long tmp = sub(last, j, i);
            if(tmp > mx){
                mxj = j;
                mx = tmp;
            }
        }
        t[i] = mxj;
        last[mxj] = i;
    }
}

bool print_t(vector<int>& t){
    if(t.size() != D) return false;
    for(int i=0;i<D;i++){
        cout << t[i]+1 << endl;
    }
    return true;
}

long long old_score;
bool change_t(vector<int>& t, int num){
    if(num > D) num = D;
    else if(num <= 0) num = 1;
    vector<int> i(num), od(num);
    int u = 0;
    for(int j=0;j<num;j++){
        i[j] = rnd(u, D-num+j);
        u = i[j] + 1;
    }
    for(int j=0;j<num;j++){
        od[j] = t[i[j]];
        t[i[j]] = rnd(0, alp-1);
    }
    long long new_score = score(t);
    if(new_score > old_score){
        old_score = new_score;
        return true;
    }else{
        for(int j=0;j<num;j++){
            t[i[j]] = od[j];
        }
    }
    return false;
}

int main(void){
    chrono::system_clock::time_point clk_start = chrono::system_clock::now();
    chrono::system_clock::time_point clk_end;
    cin >> D;
    for(int i=0;i<alp;i++) cin >> c[i];
    s.assign(D, vector<long long>(alp, 0));
    for(int i=0;i<D;i++){
        for(int j=0;j<alp;j++) cin >> s[i][j];
    }

    vector<int> t;
    f(t);
    old_score = score(t);
    for(int i=1;;i++){
        change_t(t, i%2+1);
        if(i%10000 == 0){
            clk_end = chrono::system_clock::now();
            int clk_time = static_cast<int>(chrono::duration_cast<chrono::microseconds>(clk_end - clk_start).count());
            if(clk_time > 1800000) break;
        }
    }

    print_t(t);
}


Measured memory_bytes: 3284
#include<iostream>
#include<algorithm>
#include<vector>
#include<map>
#include<string>

using namespace std;

int main(){


//重複組み合わせはnHr=n+r-1Crで求める
//今回はr=3なので
//n+2C3で求める
long  N,K;
cin >> N >> K;
long  devide1;//割ったあまりが0になる数の個数
long  devide2;//割ったあまりがK/2になる数の個数
long long Ans=0;
long long evenAns=0;
if(K%2==1){
devide1=N/K;//Kで割った余りが0の個数
Ans+=(devide1)*(devide1)*devide1;//nC3の組み合わせ

} 
else{
devide1=N/K;//Kで割った余りが0の個数
devide2=N/(K/2)-devide1;//Kで割った余りがK/2の個数
Ans+=(devide1)*(devide1)*devide1;//nC3の組み合わせ

evenAns+=(devide2)*(devide2)*devide2;//nC3の組み合わせ

Ans+=evenAns;
}

cout <<Ans<<endl;


 return 0;
}

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

int main(void){
    int N,K;
    cin>>N>>K;
    vector<int> D(K);
    for (int i=0;i<K;i++) cin>>D[i];
    int ans=N;
    while(1){
        bool use=false;
        int temp=ans;
        while(temp>0){
            int dd=temp%10;
            for (int i=0;i<K;i++){
                if (dd==D[i]) {
                    use=true;
                    break;
                }
            }
            temp/=10;
            if (use) break;
        }
        if (!use) break;
        ans++;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
n, l = map(int, input().split())

aji_souwa = n*(n + 2*l - 1)/2

if l > 0:
    print(int(aji_souwa - l))
elif l + n - 1 < 0:
    print(int(aji_souwa - (l + n - 1)))
else:
    print(int(aji_souwa))

Measured memory_bytes: 3060
#include <stdio.h>

int main () {
  int s;
  scanf ("%d", &s);
  int m;
  int h;
  h = s/60/60;
  m = (s-h*60*60)/60;
  s = s-h*60*60-m*60;
  printf ("%d:%d:%d\n",h,m,s);
  return 0;
}

Measured memory_bytes: 592
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int D = sc.nextInt();
		String ans = "Christmas";
		for(int i = D; i < 25; i++) {
			ans += " Eve";
		}
		System.out.println(ans);

	}

}


Measured memory_bytes: 23764
#include <bits/stdc++.h> 
#define rep(i,n) for (int i = 0; i < (n); ++i)
using ll =long long;
using namespace std;
using Graph=vector<vector<int>>;
using Field=vector<string>;
using P =pair<int,int>;

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

int main(){
    int n;
    cin>>n;
    int ans;
    rep(i,10){
        int tmp=(i+1)*111;
        if(tmp>=n){
            ans=tmp;
            break;
        }
    }
    cout<<ans<<endl;
}


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

using namespace std;

using ll = long long;

constexpr char newl = '\n';

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

    int H, W, K;
    cin >> H >> W >> K;
    vector<string> c(H);
    for (int i = 0; i < H; i++) {
        cin >> c[i];
    }

    int ans = 0;
    for (int i = 0; i < (1 << H); i++) {
        for (int j = 0; j < (1 << W); j++) {
            int cnt = 0;
            for (int k = 0; k < H; k++) {
                for (int l = 0; l < W; l++) {
                    if (i >> k & 1) continue;
                    if (j >> l & 1) continue;
                    cnt += (c[k][l] == '#');
                }
            }
            ans += (cnt == K);
        }
    }
    cout << ans << newl;

    return 0;
}

Measured memory_bytes: 3644
import java.util.*;
public class Main {
	public static ArrayList<Integer> list;
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		list = new ArrayList<Integer>();
		makeList(1000000);
		while(true) {
			int n  = stdIn.nextInt();
			int p = stdIn.nextInt();
			
			if(n == -1 &&p == -1) break;
			int ans = solv(n,p);
			System.out.println(ans);
			
		}
	}
	
	public static void makeList(int a) {
		boolean[] isPrime = new boolean[a];
		for(int i = 2; i < isPrime.length; i++) {
			isPrime[i] = true;
		}
		for(int i = 2; i < isPrime.length; i++) {
			if(isPrime[i]) {
				list.add(i);
				for(int j = i + i; j < isPrime.length; j += i) {
					isPrime[j] = false;
				}
			}
		}
	}
	
	public static int solv(int n, int p) {
		ArrayList<Integer> listTMP = new ArrayList<Integer>();
		int count = 0;
		for(int i = 0; i < list.size() && count <= p*3; i++) {
			if(list.get(i) > n) {
				listTMP.add(list.get(i));
				count++;
			}
		}
		PriorityQueue<Integer> listAns = new PriorityQueue<Integer>();
		
		for(int i = 0; i < listTMP.size(); i++) {
			for(int j = i; j < listTMP.size(); j++) {
				listAns.add(listTMP.get(i) + listTMP.get(j));
			}
		}
		for(int i = 0; i < p-1; i++) {
			
			int tmp = listAns.poll();
		}
		return listAns.poll();
		
	}
	
}

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

using namespace std;
#define sync   freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);freopen("error.txt","w",stderr);
#define ll long long
const int mod = int(1e9+7);
const int MN = int(2e6+7);
#define rep(i,a,b) for(int i=a;i<=n;i++)
int main(){
	// sync;
	int n,k;
	cin>>n>>k;
	vector<int> h(n+1,0);
	rep(i,1,n)cin>>h[i];
	
	vector<int> dp(n+1,INT_MAX);
dp[1]=0;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=k;j++){
			if(i+j<=n){
				dp[i+j]=min(dp[i+j],dp[i]+abs(h[i]-h[i+j]));
		
			}
		}
	}
	cout<<dp[n]<<endl;


}

Measured memory_bytes: 4028
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<set>
#include<map>
#include<queue>
#define REP(i,a) for (int i = 0;i < (a);++i)
#define FOR(i,a,b) for (int i = (a);i < (b); ++i)
#define FORR(i,a,b) for (int i = (a);i >= (b); --i)
#define ALL(obj) (obj).begin,(obj).end()
#define SORT(list) sort(ALL((list)));
#define MOD 1000000007
using namespace std;
using ll = long long;
int main(){
    int x,y,z;
    cin >> x >> y >> z;
    x-=z;
    cout << x / (y+z) << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr int Inf = 1000000001;
constexpr ll INF= 1e18;
constexpr ll MOD = 1000000007;
const double PI = 3.1415926535897;
typedef pair<int,int> P;

int main() {
    int N;
    cin >> N;
    vector<int> vec(N);
    for(int i = 0;i < N;i++) {
        cin >> vec.at(i);
    }
    bool issame = true;
    for(int i = 0;i < N - 1;i++) {
        if(vec.at(i) != vec.at(i + 1)) {
            issame = false;
        }
    }
    if(issame == true) {
        if(vec.at(0) == N - 1 || 2 * vec.at(0) <= N) {
            cout << "Yes" << endl;
        }
        else {
            cout << "No" << endl;
        }
    }
    else {
        sort(vec.begin(),vec.end());
        if(vec.at(N - 1) - vec.at(0) >= 2) {
            cout << "No" << endl;
        }
        else {
            int alone = 0;
            for(int i = 0;i < N;i++) {
                if(vec.at(i) == vec.at(0)) {
                    alone++;
                }
            }
            if(alone < vec.at(N - 1) && 2 * (vec.at(N - 1) - alone) <= (N - alone)) {
                cout << "Yes" << endl;
            }
            else {
                cout << "No" << endl;
            }
        }
    }
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
const ll mod=1000000007;
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// head

int n;
char s[66];
ll ans;
map<pair<string,string>,int> hs;
int main() {
	scanf("%d",&n);
	scanf("%s",s);
	rep(S,0,(1<<n)) {
		string s1,s2;
		rep(j,0,n) if (S&(1<<j)) s1.pb(s[j]);
			else s2.pb(s[j]);
		hs[mp(s1,s2)]++;
	}
	rep(S,0,(1<<n)) {
		string s1,s2;
		per(j,0,n) if (S&(1<<j)) s1.pb(s[j+n]);
			else s2.pb(s[j+n]);
		ans+=hs[mp(s1,s2)];
	}
	printf("%lld\n",ans);
}


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

int main() {
	int n = 0, x = 0, m = 0;
	int count[2] = {};
	int a[1000] = {};
	std::cin >> n >> m >> x;
	for (int i = 0; i < m; i++) { std::cin >> a[i]; }
	for (int i = 0; i < m; i++) {
		if (a[i] < x) {
			count[0]++;
		}
		else {
			count[1]++;
		}
	}
	std::cout << std::min(count[0], count[1]) << std::endl;
	
	return 0;
}


Measured memory_bytes: 256
// God put a smile upon your face <3

#include <bits/stdc++.h>`

#define slld(longvalue) scanf("%lld", &longvalue)

#define ll long long
#define ull unsigned long long
#define pll pair < long long, long long >

#define fastio ios_base:: sync_with_stdio(false); cin.tie(0); cout.tie(0)

#define pb push_back

#define bug printf("BUG\n")

#define mxlld LLONG_MAX
#define mnlld -LLONG_MAX

#define mxd 2e8
#define mnd -2e8

#define pi 3.14159265359

#define mod 958585860497

#define base 2001487

using namespace std;

bool check(ll n, ll pos)
{
	return n & (1LL << pos);
}

ll Set(ll n, ll pos)
{
	return n = n | (1LL << pos);
}

int main()
{
    ll i, j, k, l, m, n, o, r, q;
    ll testcase;
    ll input, flag, tag, ans;

//    freopen("input.txt", "r", stdin);

//    freopen("output.txt", "w", stdout);

    while(cin >> n)
    {
		string str = "";

		n--;

		while(n >= 0)
		{
			str += (n % 26) + 'a';

			n /= 26;
			n--;
		}

		reverse(str.begin(),str.end());
		cout << str << '\n';
    }


}






Measured memory_bytes: 3624
def primes(a):
    if a==2 or a%2 != 0:
        return True
    return False

P=[0]*100001

for i in range(2,100001):
    if P[i]==0 and primes(i):
        for j in range(i+i,100001,i):
            P[j] = 1

C=[0]*100002

for i in range(3,100000,2):
    if P[i]==0 and P[int((i+1)/2)]==0:
        C[i]+=1
for i in range(3,100000):
    C[i]+=C[i-1]

N= int(input())

L=[]
R=[]
for i in range(N):
    l,r=map(int, input().split())
    L.append(l)
    R.append(r)

for i in range(N):
    print(C[R[i]]-C[L[i]-1])


Measured memory_bytes: 15644
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <deque>
#include <vector>
#define ffor(_a,_f,_t) for(int _a=(_f),__t=(_t);_a<__t;_a++)
#define all(_v) (_v).begin() , (_v).end()
#define sz size()
#define pb push_back
#define SET(__set, val) memset(__set, val, sizeof(__set))
#define FOR(__i, __n) ffor (__i, 0, __n)
typedef long long LL;

using namespace std;

bool can[51];
vector<int> a, b;

bool dp[51][51], flag[51][51];

bool memo(int a, int b) {
	if (a < b)
		return false;
	if (a == b)
		return true;
	if (flag[a][b])
		return dp[a][b];
	bool &ret = dp[a][b];
	ret = false;
	flag[a][b] = true;
	ffor (i, 1, 51)
		if (can[i])
			ret |= memo(a % i, b);
	return ret;
}

int N;

int main() {
	cin >> N;
	a.clear();
	b.clear();
	int x;
	FOR (i, N) {
		cin >> x;
		a.pb(x);
	}
	FOR (i, N) {
		cin >> x;
		b.pb(x);
	}

	bool ok = true;
	FOR (i, 51)
		can[i] = true;
	SET(flag, 0);
	FOR (i, N)
		ok &= memo(a[i], b[i]);
	if (!ok) {
		cout << "-1" << endl;
		return 0;
	}
	LL ret = 0LL;
	for (int i = 50; i > -1; i--) {
		SET(flag, 0);
		ok = true;
		can[i] = false;
		FOR (j, N)
			ok &= memo(a[j], b[j]);
		if (!ok) {
			can[i] = true;
			ret |= 1LL << i;
		}
	}
	cout << ret << endl;
  return 0;
}

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

int main(){
  int a,b;
  char op;
  while (1){
    cin >> a>>op>>b;
    switch(op){
    case '+':
      printf("%d\n",a+b);
      break;
    case '-':
      printf("%d\n",a-b);
      break;
    case '*':
      printf("%d\n",a*b);
      break;
    case '/':
      printf("%d\n",a/b);
      break;
    case '?':
      return 0;
      break;
    }
  }

}



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


int main(){
    int n;
    cin>>n;
    vector<int> a(n),b(n);
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    for(int i=0;i<n;i++){
        b[i]=a[i];;
    }
    sort(a.begin(),a.end());
    for(int i=0;i<n;i++){
        if(b[i]!=a[n-1])
        cout<<a[n-1]<<endl;
        else
        cout<<a[n-2]<<endl;
    }
    
    return 0;
}

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

using namespace std;

int main(){
    int n;
    string s, t;
    cin>>n>>s>>t;
    for(int i=0;i<n;i++){
        cout<<(char)(s[i])<<(char)(t[i]);
    }
    cout<<endl;
    return 0;
}

Measured memory_bytes: 256
n=int(input())
s=input()
ans=0
for i in range(1,n):
    a=set(s[:i])
    b=set(s[i:])
    cnt = 0
    for i in a:
        for j in b:
            if i == j:
                cnt += 1
                break
        ans=max(cnt,ans)
print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define testing 1
#define FOR(i,s,e) for(ll i = s; i <= (ll)e; ++i)
#define DEC(i,s,e) for(ll i = s; i >= (ll)e; --i)
#define IAMSPEED ios_base::sync_with_stdio(false); cin.tie(0);
#define db(x) cerr << #x << "=" << x << "\n"
#define db2(x, y) cerr << #x << "=" << x << " , " << #y << "=" << y << "\n"
#define db3(a,b,c) cerr<<#a<<"="<<a<<","<<#b<<"="<<b<<","<<#c<<"="<<c<<"\n"
#define dbv(v) cerr << #v << ":"; for (auto ite : v) cerr << ite << ' '; cerr <<"\n"
#define dbvp(v) cerr << #v << ":"; for (auto ite : v) cerr << "{"  << ite.f << ',' << ite.s << "} "; cerr << "\n"
#define dba(a,ss,ee) cerr << #a << ":"; FOR(ite,ss,ee) cerr << a[ite] << ' '; cerr << "\n"
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define ll long long 
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define f first
#define s second
#define reach cerr << "LINE: " << __LINE__ << "\n";
typedef pair <int, int> pi;
typedef tuple<int,int,int> ti3;
string cts(char x) {string t(1,x); return t;}
ll rand(ll a, ll b) { return a + rng() % (b-a+1); }
const int MOD = 1e9 + 7;
const int inf = (int)1e9 + 500;
const long long oo = (ll)1e18 + 500;
template <typename T> void chmax(T& a, T b) { a = max(a, b); }
template <typename T> void chmin(T& a, T b) { a = min(a, b); }
const int MAXN = -1;
#if !testing
#define cerr if(0)cout
#endif

int32_t main() 
{
	IAMSPEED
	ll n,k; cin >> n >> k;
	ll ans = oo;
	ll times = n/k;
	FOR(i,0,1) {
		ll diff = llabs((times+i) * k-n);
		chmin(ans,diff);
	}
	cout<<ans;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(){
  long N, M;
  cin >> N >> M;
  if (N * 2 == M){
    cout << N << endl;
  } else if(N * 2 < M){
    cout << N + (M - N * 2) / 4 << endl;
  } else {
    cout << M / 2 << endl;
  }
}

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

int main(){
  int k,s;
  int count=0;
  cin >> k >> s;
  for(int i=0;i<=k;i++){
    for(int j=0;j<=k;j++){
      int l;
      l=s-i-j;
      if(l>=0&&l<=k){
        count++;
        }
      }
    }
  cout << count << endl;
}

Measured memory_bytes: 256
n = gets.chomp.to_i
h = gets.chomp.split(" ").map(&:to_i)
i, count = 0, 0

while true
  if h[i] > 0
    count += 1
    j = i
    while true
      if h[j] > 0
        h[j] -= 1
        if j < n - 1
          j += 1
        else
          break
        end        
      else
        break
      end
    end
  else
    i += 1
    if i == n
      break
    end
  end  
end
puts count



Measured memory_bytes: 3836
#include <bits/stdc++.h>
using namespace std;
using pp=pair<int,int>;
using ll=long long;

int main() {
  int N;
  string S;
  cin >> N >> S;
  vector<int> V(N+1,0);
  for(int i=0; i<N; i++) {
    if (S[i]=='E') {
      V[i+1]=V[i]+1;
    }
    else {
      V[i+1]=V[i];
    }
  }
  int m=1000000;
  for (int i=1; i<=N; i++) {
    m=min(m, i-1-V[i-1]+V[V.size()-1]-V[i]);
  }
  cout << m << endl;
}

Measured memory_bytes: 4836
def is_kaibun(kaibun):
    for i in range(len(kaibun)//2):
        if kaibun[i] != kaibun[-i-1]:
            return False
    return True

S = input()
N = len(S)

if is_kaibun(S) and is_kaibun(S[:int((N-1)/2)]) and is_kaibun(S[int((N+3)/2 -1):]):
    print('Yes')
else:
    print('No')

Measured memory_bytes: 3060
#include <iostream>
#include <algorithm>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<iomanip>
#define sqr(x) (x)*(x)
#define llx(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
#define rdst(st,len) {char ss[len];scanf("%s",ss);(st)=ss;}
using namespace std;
long long n,m,i,j,dp[705][705],a[705],b[705],mp[705][705],x,y,cnt,vis[705],ans=1ll<<50;
void dfs(int x,int y)
{
	if (vis[x]) return;
	vis[x]=y;
	if (y==2) b[cnt]++; else a[cnt]++;
	int i;
	for (i=1;i<=n;i++)
	{
		if (i!=x&&!mp[x][i])
		{
			if (vis[i]==y)
			{
				cout<<-1<<endl;
				exit(0);
			}
			dfs(i,3-y); 
		}
	}
}
int main()
{
	scanf("%lld%lld",&n,&m);
	for (i=1;i<=m;i++)
	{
		scanf("%lld%lld",&x,&y);
		mp[x][y]=mp[y][x]=1;
	}
	for (i=1;i<=n;i++)
	{
		if (vis[i]) continue;
		cnt++;
		dfs(i,1);
	}
	dp[0][0]=1;
	for (i=1;i<=cnt;i++)
	{
		for (j=a[i];j<=n;j++) dp[i][j]|=dp[i-1][j-a[i]];
		for (j=b[i];j<=n;j++) dp[i][j]|=dp[i-1][j-b[i]];
	}
	for (i=0;i<=n;i++) if (dp[cnt][i]) ans=min(ans,i*(i-1)/2+(n-i)*(n-i-1)/2);
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 7936
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep2(i, m, n) for(int i=int(m); i<int(n); ++i)
#define drep2(i, m, n) for(int i=int(m-1); i>=int(n); --i)
#define rep(i, n) rep2(i, 0, n)
#define drep(i, n) drep2(i, n, 0)
#define all(a) a.begin(), a.end()
#define fst first
#define snd second
using ll = long long;
using ld = long double;
using V = vector<int>;
using Vll = vector<ll>;
using Vld = vector<ld>;
using VV = vector<V>;
using VVll = vector<Vll>;
using VVld = vector<Vld>;
using P = pair<int, int>;
using Pll = pair<ll, ll>;
using Pld = pair<ld, ld>;
const int INF = 1<<30;
const ll INFll = 1ll<<62;
const ld EPS = 1e-10;
const int MOD = int(1e9)+7;
template<typename T> inline bool chmin(T& a, T b) {if(a>b) {a=b; return true;} return false;}
template<typename T> inline bool chmax(T& a, T b) {if(a<b) {a=b; return true;} return false;}
inline int Log2(ll x) {int k; for(k=0; x>0; ++k) x>>=1; return k;} // number of binary digits
template<typename T> inline int count_between(vector<T>& a, T l, T r) {
  return lower_bound(all(a), r) - lower_bound(all(a), l); // [l, r)
}


int main() {
  ll N; cin >> N;
  Vll A(N);
  rep(i, N) cin >> A[i];
  
  VVll dp(N+1, Vll(5));

  rep(i, N) {
    dp[i+1][0] = dp[i][0] + A[i];

    dp[i+1][1] = min({dp[i][0], dp[i][1]}) + A[i]%2;
    if (A[i] == 0) dp[i+1][1] += 2;

    dp[i+1][2] = min({dp[i][0], dp[i][1], dp[i][2]}) + (A[i]+1)%2;
    
    dp[i+1][3] = min({dp[i][0], dp[i][1], dp[i][2], dp[i][3]}) + A[i]%2;
    if (A[i] == 0) dp[i+1][3] += 2;
    
    dp[i+1][4] = min({dp[i][0], dp[i][1], dp[i][2], dp[i][3], dp[i][4]}) + A[i];
  }

  ll ans = *min_element(all(dp[N]));
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 15872
#include <stdio.h>
#include <algorithm>
#include <vector>
using namespace std;
using ll = long long;
using pii = pair<int, int>;

int n, m, a[100010];
vector<pii> q;
int main() {
	scanf("%d %d", &n, &m);
	for (int i = 0; i < n; i++)
		scanf("%d", a +	i);
	sort(a, a + n);

	for (int i = 0; i < m; i++) {
		int b, c;
		scanf("%d %d", &b, &c);
		q.emplace_back(c, b);
	}
	sort(q.begin(), q.end());

	ll sum = 0;
	for (int i = 0; i < n; i++) {
		if (!q.empty() && q.back().second == 0)
			q.pop_back();
		
		if (!q.empty() && q.back().first > a[i])
			sum += q.back().first, q.back().second--;
		else
			sum += a[i];
	}
	printf("%lld\n", sum);
}

Measured memory_bytes: 1784
sx,sy,tx,ty=map(int,input().split())

X=tx-sx
Y=ty-sy

for i in range(X):
    print("R",end="")

for i in range(Y):
    print("U",end="")

for i in range(X):
    print("L",end="")

for i in range(Y+1):
    print("D",end="")

for i in range(X+1):
    print("R",end="")

for i in range(Y+1):
    print("U",end="")

print("L",end="")
print("U",end="")

for i in range(X+1):
    print("L",end="")

for i in range(Y+1):
    print("D",end="")

print("R",end="")





Measured memory_bytes: 4468
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) FOR(i, 0, (n))
#define FOR(i, a, b) for(int i=(a); i<(b); i++)
#define LAR(a, b) ((a)=max((a),(b)))
#define SML(a, b) ((a)=min((a),(b)))
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vl = vector<ll>;
using pii = pair<int, int>;
using vpii = vector<pair<int, int>>;
template<typename T>
using pque = priority_queue<T, vector<T>, greater<T>>;
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define ALL(a) (a).begin(), (a).end()
#ifdef LOCAL_DEBUG
#define DEBUG(...) printf(__VA_ARGS__)
#else
#define DEBUG(...)
#endif

int main(){
	ll a; ld b; scanf("%lld%Lf", &a, &b);
	ll c = b * 100 + 0.1;
	DEBUG("%lld %Lf %lld\n", a, b, c);
	printf("%lld\n", a * c / 100);
}


Measured memory_bytes: 3844
#include<bits/stdc++.h>
using namespace std;
 
 
int N, M;
int s[100000], t[100000];
int sum[2][100003];
 
int main()
{
   
  scanf("%d %d", &N, &M);
  for(int i = 0; i < N; i++) {
    scanf("%d %d", &s[i], &t[i]);
  }
  vector< int > P(M);
  for(int i = 0; i < M; i++) {
    scanf("%d", &P[i]);
  }
  sort(P.begin(), P.end());
 
  long long ret = 0;
  for(int i = 0; i < N; i++) {
    auto p = lower_bound(P.begin(), P.end(), s[i]);
    auto q = lower_bound(P.begin(), P.end(), t[i]);
    if(p == q) {
      ret += abs(t[i] - s[i]);
    } else {
      s[i] > t[i] ? --p : --q;
 
      if((p - q) % 2 != 0) {
        ret += abs(*p - s[i]);
        ret += abs(*q - t[i]);
        if(abs(p - q) == 1) continue;
        s[i] < t[i] ? (++p, --q) : (--p, ++q);
        auto mm = min(p - P.begin(), q - P.begin());
        sum[mm & 1][mm]++;
        sum[mm & 1][max(p - P.begin(), q - P.begin())]--;
      } else {
        ret += abs(*p - s[i]);
        if(abs(p - q) == 0) continue;
        s[i] < t[i] ? ++p : --p;
        auto mm = min(p - P.begin(), q - P.begin());
        sum[mm & 1][mm]++;
        sum[mm & 1][max(p - P.begin(), q - P.begin())]--;
      }
    }
  }
  for(int i = 1; i < M; i++) {
    sum[0][i] += sum[0][i - 1];
    sum[1][i] += sum[1][i - 1];
  }
  for(int i = 0; i < M - 1; i++) {
    ret += 1LL * sum[i & 1][i] * (P[i + 1] - P[i]);
  }
  printf("%lld\n", ret);
}

Measured memory_bytes: 4820
#include<iostream>
#define M 100000007
using namespace std;

int r,c;
int dp[2][10][3][100000]; //dp[r][c][左からn本][上からn本]
int g[20][20];
char z;
int po3[21];

int main(){
  cin >> r >> c;

  po3[0] = 1;
  for(int i=0;i<c;i++)po3[i+1] = po3[i]*3;

  for(int i=0;i<r;i++)
    for(int j=0;j<c;j++){
      cin >> z;
      if(z=='.')g[i][j] = 0;
      else g[i][j] = z-'0';
    }

  for(int i=0;i<c;i++)
    for(int j=0;j<3;j++)
      for(int k=0;k<po3[c];k++)dp[0][i][j][k] = 0;
  dp[0][0][0][0] = 1;

  for(int i=0;i<r;i++){
    int id = i&1, nxt = 1-id;

    for(int j=0;j<c;j++)
      for(int k=0;k<3;k++)
	for(int l=0;l<po3[c];l++)dp[nxt][j][k][l] = 0;

    for(int j=0;j<c-1;j++){
      if(!g[i][j]){
	for(int k=0;k<3;k++){
	  for(int l=0;l<po3[c];l++){
	    int m = l/po3[j]%3;
	    if(m && k)continue;
	    dp[id][j+1][k][l] += dp[id][j][k][l];
	    dp[id][j+1][k][l] %= M;
	  }
	}
      }else{
	for(int k=0;k<3;k++){
	  for(int l=0;l<po3[c];l++){
	    int m = l/po3[j]%3;
	    int n = g[i][j] - m - k;
	    
	    if(n<0 || n>4)continue;
	    for(int x=0;x<3;x++){
	      if(n-x<0 || n-x>2)continue;
	      int w = l - m*po3[j] + (n-x)*po3[j];
	      dp[id][j+1][x][w] += dp[id][j][k][l];
	      dp[id][j+1][x][w] %= M;
	    }
	  }
	}
      }
    }

    if(!g[i][c-1]){
      for(int l=0;l<po3[c];l++){
	dp[nxt][0][0][l] += dp[id][c-1][0][l];
	dp[nxt][0][0][l] %= M;
      }
    }else{
      for(int k=0;k<3;k++){
	for(int l=0;l<po3[c];l++){
	  int m = l/po3[c-1]%3;
	  int n = g[i][c-1] - m - k;
	  if(n<0 || n>2)continue;
	  int w = l - m*po3[c-1] + n*po3[c-1];
	  dp[nxt][0][0][w] += dp[id][c-1][k][l];
	  dp[nxt][0][0][w] %= M;
	}
      }
    }
  }

  cout << dp[r&1][0][0][0] << endl;
}

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

N = int(input())
divisors = make_divisors(N)
ans = 12
for i in range(0, len(divisors), 2):
    a, b = divisors[i], divisors[i+1]
    m, n = 0, 0
    for x in range(1, 12):
        if a < 10 ** x:
            m = x
            break
    for x in range(1, 12):
        if b < 10 ** x:
            n = x
            break
    ans = min(ans, max(m, n))
print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const double pi=3.141592653589793;
typedef unsigned long long ull;
typedef long double ldouble;
const ll INF=1e18;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
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; }

 
template <int mod>
struct ModInt {
    int val;
    ModInt() : val(0) {}
    ModInt(long long x) : val(x >= 0 ? x % mod : (mod - (-x) % mod) % mod) {}
    int getmod() { return mod; }
    ModInt &operator+=(const ModInt &p) {
        if ((val += p.val) >= mod) {
            val -= mod;
        }
        return *this;
    }
    ModInt &operator-=(const ModInt &p) {
        if ((val += mod - p.val) >= mod) {
            val -= mod;
        }
        return *this;
    }
    ModInt &operator*=(const ModInt &p) {
        val = (int)(1LL * val * p.val % mod);
        return *this;
    }
    ModInt &operator/=(const ModInt &p) {
        *this *= p.inverse();
        return *this;
    }
    ModInt operator-() const { return ModInt(-val); }
    ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }
    ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }
    ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }
    ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }
    bool operator==(const ModInt &p) const { return val == p.val; }
    bool operator!=(const ModInt &p) const { return val != p.val; }
    ModInt inverse() const {
        int a = val, b = mod, u = 1, v = 0, t;
        while (b > 0) {
            t = a / b;
            swap(a -= t * b, b);
            swap(u -= t * v, v);
        }
        return ModInt(u);
    }
    ModInt pow(long long n) const {
        ModInt ret(1), mul(val);
        while (n > 0) {
            if (n & 1) ret *= mul;
            mul *= mul;
            n >>= 1;
        }
        return ret;
    }
    friend ostream &operator<<(ostream &os, const ModInt &p) { return os << p.val; }
    friend istream &operator>>(istream &is, ModInt &a) {
        long long t;
        is >> t;
        a = ModInt<mod>(t);
        return (is);
    }
    static int get_mod() { return mod; }
};
const int MOD = 1000000007;  // if inv is needed, this shold be prime.
using modint = ModInt<MOD>;

modint combination (ll n, ll k) {
	chmin(k, n-k);
	modint x = n, y = k;
	modint res = 1;
	rep(i, k) {
		res *= (modint)(x-y+(modint)i+1);
		res /= (modint)(i+1);
	}
	return res;
}

int main() {
  ll n, a, b;
	cin >> n >> a >> b;
	modint ans = ((modint)2).pow(n);
	ans -= combination(n, a);
	ans -= combination(n, b);
	ans -= 1;
	cout << ans << endl;
}

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

#define ipair pair<int,int>
#define rep(i,n) for(i=0;i<n;i++)
#define repj(i,j,n) for(i=j;i<n;i++)

#define PB(a,i) (a).push_back(i)
#define ALL(a) (a).begin(),(a).end()
#define SIZE(a,n) (a).resize(n)

#define OK(i) cout<<"OK "<<i<<endl
#define Yes cout<<"Yes"<<endl
#define YES cout<<"YES"<<endl
#define No cout<<"No"<<endl
#define NO cout<<"NO"<<endl

using namespace std;

typedef long long int lli;
typedef long long ll;
typedef vector<int> vi;
typedef vector< vector<int> > Matrix;



int main() {
	vi w, x;
	int n, i, j, k;

	cin >> n;
	SIZE(w, n + 1);
	w[0] = 0;
	rep(i, n) {
		cin >> k;
		w[i + 1] = w[i] + k;
	}
	j = w[n];
	rep(i, n) {
		j = min(j, abs(w[n] - 2 * w[i + 1]));
	}
	cout << j;

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
const int N = 1e5 + 10;
long long ans = 0;
int a[N],b[N];
int main(){
    ios::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);
    int n;
    cin >> n;
    for(int i = 0;i < n+1; ++i) cin >> a[i];
    for(int i = 0;i < n; ++i) cin >> b[i];
    for(int i = 0;i < n; ++i){
        if(b[i] >= a[i]){
            b[i] -= a[i];
            ans += a[i];
            a[i] = 0;
            if(b[i] >= a[i+1]){
                b[i] -= a[i+1];
                ans += a[i+1];
                a[i+1] = 0;
            }
            else {
                a[i+1] -= b[i];
                ans += b[i];
                b[i] = 0;
            }
        }
        else {
            ans += b[i];
            a[i] -= b[i];
        }
    }
    cout << ans ;
    return 0;
}

Measured memory_bytes: 1024