akhauriyash/Code-Regression huggingface dataset:
import java.util.*;
import java.lang.*;
import java.io.*;
import java.awt.Point;
 
class Main{
 
      public static void main(String args[])throws IOException
    {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    int N = Integer.parseInt(in.readLine());   
    LinkedList<Point> list = new LinkedList<Point>();  
    for(int i=0;i<N;i++)
        {
        String line = in.readLine();
        int A,B;
        A = Integer.parseInt(line.substring(0,line.indexOf(" ")));
        B = Integer.parseInt(line.substring(line.indexOf(" ")+1));
        list.add(new Point(B-A,B));
        }
     
 
    Collections.sort(list,new Comparator<Point>(){
                        @Override
                            public int compare(Point a,Point b)
                        {
                if(a.x < b.x)
                {
                    return 1;
                }  
                else if(a.x == b.x)
                {
                    return 0;
                }  
                else
                {
                    return -1;
                }      
                        }
        });
 
    int cnt = 0;
    for(int i=0;i<list.size();i++)
        {
        if(list.get(i).x >= 0)
            {
            cnt++;
            for(int j=i+1;j<list.size();j++)
                {
                 
                if(list.get(j).y > list.get(i).x)
                    {
                    int dif = Math.min(list.get(j).y-list.get(i).x,list.get(i).y-list.get(i).x);
                    Point p = list.get(j);
                    list.set(j,new Point(p.x-dif,p.y-dif));
                     
                    }
                 
 
                }
 
            Collections.sort(list,new Comparator<Point>(){
                @Override
                    public int compare(Point a,Point b)
                {
                    if(a.x < b.x)
                {
                    return 1;
                }  
                    else if(a.x == b.x)
                    {
                        return 0;
                    }  
                    else
                    {
                    return -1;
                    }      
                }
                });
             
            }
         
         
         
        }
 
     
    System.out.println(cnt);   
 
    }
 
}

Measured memory_bytes: 17068
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (true) {
            int m = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            if (m == -1 && f == -1 && r == -1) {
                break;
            } else {
                if ((m == -1 || f == -1) || (m + f < 30)) {
                    System.out.println("F");
                } else if (m + f >= 80) {
                    System.out.println("A");
                } else if (m + f >= 65) {
                    System.out.println("B");
                } else if ((m + f >= 50) || (m + f >= 30 && r >= 50)) {
                    System.out.println("C");
                } else {
                    System.out.println("D");
                }
            }
        }
    }
}


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

int main() {
    int n;
    cin >> n;
    while (n--) {
        double xa, ya, ra, xb, yb, rb;
        cin >> xa >> ya >> ra >> xb >> yb >> rb;

        double d = (xa - xb) * (xa - xb) + (ya - yb) * (ya - yb);
        double sr = (ra + rb) * (ra + rb);
        double dr = (ra - rb) * (ra - rb);

        int res = 1;
        if (sr < d) {
            res = 0;
        } else if (d < dr) {
            res = (ra > rb) ? 2 : -2;
        }
        cout << res << endl;
    }
}

Measured memory_bytes: 1236
f=lambda:map(int,input().split())
n,m=f()
S=[[0]*n for _ in [0]*m]
for i in range(m):
  _,*s=f()
  for j in s: S[i][j-1]=1
p=[*f()]
print(sum(all(sum(i>>j&1*S[k][j] for j in range(n))%2==p[k] for k in range(m)) for i in range(2**n)))

Measured memory_bytes: 9196
/*
Created on 13-09-20 17:30

@author: roastedcoder

*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int mod = 1e9+7;
const int INF = INT_MAX;
#define endl "\n"
#define pb push_back
#define roastedcoder ios_base::sync_with_stdio(false); cin.tie(NULL);
//__________________________________________________________________

vector <int> graph[100001];
bool vis[100001];

/*
void dfs(int node) {
	vis[node] = true;
	for(auto child : graph[node])
		if(!vis[child]) dfs(child);
}
*/

int main() {
	roastedcoder
	ll a, b, c, d; cin>>a>>b>>c>>d;
	ll p = b*d;
	p = max(p, b*c);
	p = max(p, a*d);
	p = max(p, a*c);
	cout<<p<<endl;
}

//__________________________________________________________________
/*
Sample Input:


Sample Output:


*/



Measured memory_bytes: 6000
#include <stdio.h>
#define MAX 100000

int b[MAX];

int cnt(int n)
{
  if ( n == 0 ) {
    return b[0] + b[1];
  } else if ( n == MAX-1 ) {
    return b[n-1] + b[n];
  } else {
    return b[n-1] + b[n] + b[n+1];
  }
}

int main(void)
{
  int max = 0;
  int n;
  int t;
  int i;

  scanf("%d", &n);
  for ( i=0; i<n; i++ ) {
    scanf("%d", &t);
    b[t]++;
  }
  for ( i=0; i<MAX; i++ ) {
    t = cnt(i);
    if ( max < t ) {
      max = t;
    }
  }
  printf("%d\n", max);
  return 0;
}

Measured memory_bytes: 512
using System;
using System.Collections.Generic;

namespace abc169
{
    class Program
    {
        static void Main()
        {
            var n = long.Parse(Console.ReadLine());
            var dic = PDiv(n);
            var total = 0;
            foreach (var kv in dic)
            {
                var num = kv.Value;
                var counter = 1;
                while (num >= counter)
                {
                    num -= counter;
                    ++counter;
                    ++total;
                }
            }
            Console.WriteLine(total);
        }
        static Dictionary<long, long> PDiv(long n)
        {
            var dic = new Dictionary<long, long>();
            var tmpn = n;
            var p = 2L;
            while (Decimal.Multiply(p, p) < n)
            {
                if (tmpn % p == 0)
                {
                    tmpn /= p;
                    if (dic.ContainsKey(p))
                    {
                        ++dic[p];
                    }
                    else
                    {
                        dic.Add(p, 1);
                    }
                }
                else
                {
                    ++p;
                }
            }
            if (tmpn > 1)
            {
                dic.Add(tmpn, 1);
            }
            return dic;
        }
    }
}


Measured memory_bytes: 27876
#bit使うversion
S = input()
N = len(S)
res = 0
for i in range(2**(N-1)):
  formula = ""
  for j in range(N-1):
    if (i>>j) & 1: 
      formula += S[j]
      formula += "+"
    else:
      formula += S[j]
  formula += S[N-1]
  res += eval(formula)
print(res)  

Measured memory_bytes: 73716
x1,y1,x2,y2 = map(int,input().split())
y = y2 - y1
x = x2 - x1
x3 = x2 - y
y3 = y2 + x
x4 = x3 - x
y4 = y3 - y
print(x3,y3,x4,y4)

Measured memory_bytes: 3060
arr1 = gets.split.map(&:to_i)
arr2 = gets.split.map(&:to_i).sort

len = arr2.length
num = len - arr1[1]
ans = 0
if num > 0
	num.times do |i|
		ans += arr2[i]
	end
	p ans
else
	p ans
end

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

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

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<bool> VB;
typedef vector<double> VD;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SQ(a) ((a)*(a))
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define LB lower_bound
#define UB upper_bound

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

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL INF = 1000000000;
const LL MOD = 1000000007;

//other
//-------------------------------------------
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define FI first
#define SE second

int main() {
  int N, x, y;
  cin >> N;
  x = 800*N;
  y = N / 15 * 200;
  cout << x-y << endl;
  return 0;
}

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

int up(const void*a,const void*b){
  return *(double*)a-*(double*)b;
}

int main(void){
  int n;
  scanf("%d",&n);
  double a[n],ans=0;
  for(int i=0;i<n;i++){
    scanf("%lf",a+i);
  }
  qsort(a,n,sizeof(double),up);
  for(int i=1;i<n;i++){
    a[0]/=2.0;
    for(int j=0;j<n-i;j++){
      a[i]/=2.0;
    }
    ans+=a[i];
  }
  printf("%f\n",ans+a[0]);
  return 0;
}
    
  

Measured memory_bytes: 128
#include "bits/stdc++.h"
using namespace std;
string str1, str2;
 
int main() {
  cin >> str1;
  cin >> str2;
  int count = 0;
  for(int i = 0; i < str1.length(); i++){
      count += (str1[i] == str2[i]);
  }
  cout << count << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
  int A, B, T;
  cin >> A >> B >> T;
  int ans = 0;
  for(int i = 1; i <= T; i++) {
    if(i % A) continue;
    ans += B;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"

// Begin {{{
using namespace std;
#define all(x) x.begin(), x.end()
#define rep(i, n) for (i64 i = 0, i##_limit = (n); i < i##_limit; ++i)
#define reps(i, b, e) for (i64 i = (b), i##_limit = (e); i <= i##_limit; ++i)
#define repr(i, b, e) for (i64 i = (b), i##_limit = (e); i >= i##_limit; --i)
#define var(Type, ...) Type __VA_ARGS__; input(__VA_ARGS__)
using i64 = int_fast64_t;
using pii = pair<i64, i64>;
template <class T> using MaxHeap = priority_queue<T>;
template <class T> using MinHeap = priority_queue<T, vector<T>, greater<>>;
template <class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); }
template <class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); }
inline i64 sigma(i64 n) { return n * (1 + n) >> 1; }
inline i64 updiv(i64 n, i64 d) { return (n + d - 1) / d; }
constexpr int INF = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int MOD = int(1e9) + 7;
#ifndef DEBUG
#define dump(...)
#endif

inline void input() {}
template <class Head, class... Tail>
inline void input(Head&& head, Tail&&... tail) {
    cin >> head;
    input(forward<Tail>(tail)...);
}

inline void outs() { cout << "\n"; }
template <class Head, class... Tail>
inline void outs(Head&& head, Tail&&... tail) {
    cout << head << (sizeof...(tail) ? " " : "");
    outs(forward<Tail>(tail)...);
}

template <class T>
inline void outs(vector<T> &vec) { for (auto &e : vec) cout << e << " \n"[&e == &vec.back()]; }

template <class T>
inline void outs(vector<vector<T>> &df) { for (auto &vec : df) outs(vec); }

inline void outl() { cout << "\n"; }
template <class Head, class... Tail>
inline void outl(Head&& head, Tail&&... tail) {
    cout << head << (sizeof...(tail) ? "\n" : "");
    outl(forward<Tail>(tail)...);
}

template <class T>
inline void outl(vector<T> &vec) { for (auto &e : vec) cout << e << "\n"; }

inline void outn() {}
template <class Head, class... Tail>
inline void outn(Head&& head, Tail&&... tail) {
    cout << head;
    outn(forward<Tail>(tail)...);
}

template <class T>
inline void outn(vector<T> &vec) { for (auto &e : vec) cout << e; }

template <class T>
inline vector<T> make_v(const T &initvalue, size_t sz) {
    return vector<T>(sz, initvalue);
}

template <class T, class... Args>
inline auto make_v(const T &initvalue, size_t sz, Args... args) {
    return vector<decltype(make_v<T>(initvalue, args...))>(sz, make_v<T>(initvalue, args...));
}
// }}} End

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    var(int, a, b);
    int res = a - b * 2;
    outl(max(0, res));
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<map>
#define mod 1000000007
#define pb push_back
using namespace std;
int digitsum(int x){
	int res=0;
	while(x>0){
		res+=x%10;
		x=x/10;
	}
	return res;
}
int main(){
	int ans=mod;
	int n;
	cin>>n;
	for(int i=1;i<n;i++){
		int t = digitsum(i) + digitsum(n-i);
		if(t<ans)ans=t;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
import itertools

N = int(input())
P = tuple(list(map(int,input().split())))
Q = tuple(list(map(int,input().split())))

list = []
numList = []

for i in range(N + 1):
  if i == 0:
    continue
  numList.append(i)
  
for x in itertools.permutations(numList):
  list.append(x)

a = 0
b = 0

for index, t in enumerate(list):
  if t == P:
    a = index + 1
  
  if t == Q:
    b = index + 1

print(abs(a - b))

Measured memory_bytes: 7924
let abn = readLine()!.split(separator: " ").map { Int($0)! }
let a = abn[0], b = abn[1], n = abn[2]
var x = n
if n >= b - 1 {
  x = b - 1
}
let ans = a * x / b - a * (x / b)
print(ans)

Measured memory_bytes: 8212
#include <iostream>

using namespace std;

int main(void)
{
	int X, A;
	int result;

	cin >> X >> A;

	if (X < 0 || X > 9 || A < 0 || A > 9)
		return 1;

	if (X < A)
		result = 0;
	else
		result = 10;

	cout << result;

	return 0;
}

Measured memory_bytes: 256
# from itertools import combinations

# N, M, X = map(int, input().split())

# L = []
# for _ in range(N):
#     L.append(list(map(int, input().split())))

# s = float('inf')
# r = False

# for i in range(1, N + 1):
#     C = combinations(range(0, N), i)
#     for c in C:
#         _s = 0
#         t = [0 for _ in range(M)]
#         for _c in c:
#             _s += L[_c][0]
#             for k in range(M):
#                 t[k] += L[_c][k + 1]
#         _r = True
#         for _t in t:
#             if _t < X:
#                 _r = False
#                 break
#         if _r and _s < s:
#             r = True
#             s = _s
# if r:
#     print(s)
# else:
#     print(-1)

N, M, X = map(int, input().split())

L = []
for _ in range(N):
    L.append(list(map(int, input().split())))

s = float('inf')
r = False

for i in range(2 ** N):
    _s = 0
    t = [0 for _ in range(M)]
    for k in range(N):
        if (i >> k & 1):
            _s += L[k][0]
            for j in range(M):
                t[j] += L[k][j + 1]
    _r = True
    for _t in t:
        if _t < X:
            _r = False
            break
    if _r and _s < s:
        r = True
        s = _s
if r:
    print(s)
else:
    print(-1)


Measured memory_bytes: 9236
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
inline ll read(){
	ll res=0,f=1;
	char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-f;ch=getchar();}
	while(ch>='0'&&ch<='9'){res=(res<<3)+(res<<1)+ch-'0';ch=getchar();}
	return res*f;
}
void write(ll x){
	if(x<0) putchar('-'),x=-x;
	if(x>9) write(x/10);
	putchar(x%10|'0');
}
const int N=1e5+7;
int a[N],n,T;
signed main(){
//	freopen("t1.in","r",stdin);
//	freopen("t1.out","w",stdout);
//	T=read();
//	while(T--){
	n=read();
    for (int i=1; i<=n; ++i) a[i]=read();
    sort(a+1,a+n+1,greater<int>());
    for (int i=1; i<=n; ++i)
    if (i+1>a[i+1]){
    	int j=i+1,ans=0; 
		while (a[j]==i) ans++,j++;
		if (ans%2==1||(a[i]-i)%2==1) puts("First");
		else puts("Second");
		break;
    }
//	}
}	



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

int main () {
  string S;
  cin >> S;

  for (int bit = 0; bit < (1 << 3); bit++) {
    int judge = S.at(0) - '0';
    for (int i = 0; i < 3; i++) {
      if (bit & (1 << i)) { // i番目のopが1である('+')
		judge += S.at(i+1) - '0';
      } else { // i番目のopが0である('-')
        judge -= S.at(i+1) - '0';
      }
    }
    if (judge == 7) {
      for (int i = 0; i < 3; i++) {
        cout << S.at(i);
        if (bit & (1 << i)) {
          cout << '+';
        } else {
          cout << '-';
        }
      }
      cout << S.at(3) << "=7";
      return 0;
    }
  }
}

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

int main() {
  int N;
  int a=0,sum=0;
  cin >> N;
  vector<int> A(N);
  vector<int> B(N);
  for (int i = 0; i < N-1; i++) {
    cin >> B.at(i);
  }
  B.at(N-1)=100001;
  sum=B.at(0);
  for (int i = 1; i < N; i++) {
    sum+=min(B.at(i-1),B.at(i));
  }
  
  cout << sum << endl;

}

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

int main()
{
    ll N, M;
    cin >> N >> M;
    int A[M];

    ll ans = 0;
    for (int i = 0; i < M; i++)
    {
        cin >> A[i];
    }
    for (int i = 0; i < M; i++)
    {
        ans += A[i];
    }

    int bad = -1;
    cout << ((N - ans >= 0) ? (N - ans) : bad) << endl;
    return 0;
}

Measured memory_bytes: 3656
def main():
    A, B, K = map(int, input().split())
    count = 0
    for i in range(min(A, B), 0, -1):
        if A % i == 0 and B % i == 0:
            count += 1
        if count == K:
            return i

if __name__ == '__main__':
    print(main())

Measured memory_bytes: 2940
#include <cstdlib>
#include <cmath>
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <cstring>
#include <string>
#include <map>
#include <list>
#define MOD 1000000007
#define INF 1000000000
typedef long long ll;
using namespace std;
typedef pair<int,int> P;

int main(void){
    int n;
    cin>>n;
    int a[4];
    int i=0;
    while(n){
        a[i++]=n%10;
        n/=10;
    }
    if((a[0]==a[1]&&a[1]==a[2])||(a[1]==a[2]&&a[2]==a[3])){
        printf("Yes\n");
    }else printf("No\n");
        return 0;
}


Measured memory_bytes: 256
/**
 *    author:  FromDihPout
 *    created: 2020-08-21
**/

#include <bits/stdc++.h>
using namespace std;

const int MOD = 1e9 + 7;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    long long n, k;
    cin >> n >> k;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    
    long long ans = 0;
    for (int i = 0; i < n; i++) {
        long long cnt1 = 0, cnt2 = 0;
        for (int j = i + 1; j < n; j++) {
            if (a[i] > a[j]) cnt1++;
        }
        for (int j = 0; j < n; j++) {
            if (a[i] > a[j]) cnt2++;
        }
        ans += cnt1 * k + (((k - 1) * k / 2) % MOD) * cnt2 % MOD;
        ans %= MOD;
    }
    cout << ans << '\n';
    return 0;
}

Measured memory_bytes: 3632
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		String odd = sc.next();
		String even = sc.next();
		int len = odd.length() + even.length();
		int oc = 0;
		int ec = 0;
		String ans = "";
		for(int i =1; i <= len;i++){
			String c;
			if(i % 2 == 0){//偶数
				if(ec == len){
					c = even.substring(ec);
				}else{
					c = even.substring(ec, ec+1);
				}
				ans = ans + c;
				ec++;
			}else{//奇数
				if(oc == len){
					c = odd.substring(oc);
				}else{
					c = odd.substring(oc, oc+1);
				}
				ans = ans + c;
				oc++;
			}
		}
		System.out.println(ans);
	}

}


Measured memory_bytes: 21588
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
ll n,m,ans;
int main(){
	scanf("%lld%lld",&n,&m);
	if (2LL*n>m){
		ans=m/2;
	}else{
		ans=n;m-=2LL*n;
		ans+=m/4;
	}
	printf("%lld\n",ans);
	return 0;
}

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

#define rep(i, x, n) for (int i = x; i < n; i++)
typedef long long ll;

const int INF = 1e9 + 7;

using namespace std;

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

	string s;
	int k;
	cin >> s >> k;

	set<string> st;
	for (int i = 0; i < s.size(); i++) {
		for (int j = 1; j <= min((int)s.size() - i, k); j++)
			st.insert(s.substr(i, j));
	}

	int count = 0;
	for (auto it = st.begin(); it != st.end(); it++) {
		if (++count == k) {
			cout << *it << endl;
			break;
		}
	}

	return 0;
}

Measured memory_bytes: 1664
#include<stdio.h>


int main(void)
{
    char c[3][4];
    int i;
    for(i=0;i<3;i++){
            scanf("%s",c[i]);   
    }   
    printf("%c%c%c\n",c[0][0],c[1][1],c[2][2]);


    return 0;
}


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

int main() {
  
  int N,M,S;
  M=0;
  S=0;
  cin >> N;
  
  vector<int> A(N);
  vector<int> B(N); 
    
  for (int i=0; i<N; i++) {
    cin >> A.at(i);
  } 
  
  for (int i=0; i<30; i++) {
     
    for (int j=0; j<N; j++){
     B.at(j)=A.at(j)%2;
      
      if(B.at(j)==0){ 
        A.at(j)=A.at(j)/2;
      }
      else{
        M=1;
        break;
      }
    }
      
   if(M==1){
    break;
   }
   S=i+1;
 }   
  cout << S << endl;
}

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

int main(){

    vector<int> order_time(5);
    int min_mod = 1e5, pos = 0;

    for (int i=0; i<5; i++){
        cin >> order_time.at(i);

        int mod_temp;
        mod_temp = order_time.at(i)%10;

        if (mod_temp != 0){
            min_mod = min(mod_temp, min_mod);
            
            if (mod_temp == min_mod){
                pos = i;
            }
        }
    }

    int ans = 0;
    for (int i=0; i<5; i++){
        if (i == pos) ans += order_time.at(i);
        else if (order_time.at(i)%10 == 0) ans += order_time.at(i);
        else ans += (order_time.at(i) + (10 - order_time.at(i)%10));
    }

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

Measured memory_bytes: 256
#define _GIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
const double EPS = 1e-10;


int main(void) {
  int N, M;
  cin >> N >> M;
  vector<int> X(M);
  rep(i, M) cin >> X[i];

  if (N >= M) {
    cout << 0 << endl;
    return 0;
  }

  sort(X.begin(), X.end());
  vector<int> L(M - 1, 0);
  rep(i, M - 1) {
    L[i] = X[i + 1] - X[i];
  }

  sort(L.rbegin(), L.rend());
  ll num = 0;
  rep(i, N - 1) num += L[i];

  cout << X[M - 1] - X[0] - num << endl;
  
  return 0;
}

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

int main()
{
    long int n,count=0;
    cin >> n;
    for(int i=1; i<=n; i++){
        if(i % 3 == 0 && i % 5 ==0)
        {
        }
        else if(i % 3 == 0)
        { 
        }
        else if(i % 5 == 0)
        {

        }
        else
        {
            count += i;
        }
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 3648
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,k,i,count=0;
    cin>>n>>k;
    int p[n];
    for(i=0;i<n;i++)
    {
        cin>>p[i];
        
    }
    sort(p,p+n);
    for(i=0;i<k;i++)
    {
        count=count+p[i];
    }
    cout<<count<<"\n";
}

Measured memory_bytes: 3608
sx,sy,tx,ty = map(int,input().split())
y_diff = ty-sy
x_diff = tx-sx
ans = ""
for i in range(y_diff):
    ans += "U"
for j in range(x_diff):
    ans += "R"
for k in range(y_diff):
    ans += "D"
for l in range(x_diff):
    ans += "L"
ans += "L"
for s in range(y_diff+1):
    ans += "U"
for t in range(x_diff+1):
    ans += "R"
ans += "DR"
for p in range(y_diff+1):
    ans += "D"
for q in range(x_diff+1):
    ans += "L"
ans+="U"
print(ans)

Measured memory_bytes: 73264
#include <bits/stdc++.h>
	using namespace std;
	typedef long long int ll;
	
	#define pii                 pair<int,int>
	#define vi                  vector<int>
	#define vii                 vector<std::vector<int>> v;
	#define mem(dp,a)           memset(dp,a,sizeof dp)
	#define sonic               ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	#define pb(x)               push_back(x)
	#define mkp(x,y)             make_pair(x,y)
	#define all(c)              c.begin(), c.end()
	#define ff                  first
	#define ss                  second
	#define INF                 INT_MAX
	
	/* Bit Manipulation */
	
	#define isOn(S, j) (S & (1 << j))
	#define setBit(S, j) (S |= (1 << j))
	#define clearBit(S, j) (S &= ~(1 << j)) // to turn off
	#define toggleBit(S, j) (S ^= (1 << j))
	#define lowBit(S) (S & (-S)) // to get lsb
	#define setAll(S, n) (S = (1 << n) - 1)
	
	#define modulo(S, N) ((S) & (N - 1))   // returns S % N, where N is a power of 2
	#define isPowerOfTwo(S) (!(S & (S - 1)))
	#define nearestPowerOfTwo(S) ((int)pow(2.0, (int)((log((double)S) / log(2.0)) + 0.5)))
	#define turnOffLastBit(S) ((S) & (S - 1))
	#define turnOnLastZero(S) ((S) | (S + 1))
	#define turnOffLastConsecutiveBits(S) ((S) & (S + 1))
	#define turnOnLastConsecutiveZeroes(S) ((S) | (S - 1))
	
	void printSet(int vS) {                         // in binary representation
	  printf("S = %2d = ", vS);
	  stack<int> st;
	  while (vS)
	    st.push(vS % 2), vS /= 2;
	  while (!st.empty())                         // to reverse the print order
	    printf("%d", st.top()), st.pop();
	  printf("\n");
	}
		
	/* Bit Manipulation Ends. */
		
	// Global variables declared here...
	
	//*******User-Defined Functions*********//
	
	
	
	//*******Functions end here************//
	
	//*******Main func starts**************//
	int main()
	{
	    sonic;
		int n;
		cin >> n;
		string s;
		int a=0,b=0,c=0,d=0;
		while (n--)
		{
			cin >> s;
			if (s == "AC") a++;
			else if (s == "WA") b++;
			else if (s == "TLE") c++;
			else if (s == "RE") d++;
		}
		cout << "AC x " << a <<endl;
		cout << "WA x " << b <<endl;
		cout << "TLE x " << c <<endl;
		cout << "RE x " << d <<endl;
	}
	//******Main Ends here****************//
	
	
	


Measured memory_bytes: 3656
from math import gcd, ceil
n, m = map(int, input().split())
a = list(map(int, input().split()))
a = [i // 2 for i in a]
l = 1
for i in a:
    l *= i // gcd(l, i)
for i in a:
    if l // i % 2 == 0:
        print(0)
        exit()
print(ceil((m // l) / 2))


Measured memory_bytes: 20516
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
s = input()
alpha = [chr(i) for i in range(97, 97+26)]
for c in alpha:
    if c in s:
        continue
    else:
        print(c)
        exit()
print("None")


Measured memory_bytes: 3188
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 *
 */

/**
 * @author cthanh
 *
 */
public class Main {

	/**
	 * @param args
	 * @throws IOException
	 */
	public static void main(String[] args) throws IOException {
		// TODO ?????????????????????????????????????????????
		 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));// ??\?????????
		    String str = br.readLine();
		    double r =  Double.parseDouble( str);
		    double men = r *r *Math.PI;
		    double syu = r*2* Math.PI;
		   // System.out.println(Math.PI);
		    System.out.printf( "%.6f %.6f",men , syu );


	}

}

Measured memory_bytes: 24536
#define _USE_MATH_DEFINES
#include<iostream>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
#include<algorithm>
#include<iterator>
#include<sstream>
#include<iomanip>
#include<map>
#include<queue>
#include<deque>
#include<fstream>
#include<random>

#define rep(i, n) for (ll i = 0; i < n; i++) 
#define rrep(i, n) for(ll i = n-1; i>=0; i--)
#define range(i, n, m) for (ll i = n; i < m; i++) 
#define rrange(i, n, m) for (ll i = n - 1; i => m; i--) 
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define vl vector<ll>
#define vvl vector<vector<ll> >
#define vp vector<pair<ll, ll> >
#define vvp vector<vector<pair<ll, ll> > >
#define First first
#define Second second.first
#define Third second.second
#define Sort(X) sort(X.begin(), X.end())
#define RSort(X, T) sort(X.begin(), X.end(), greater<T>())
//#define MOD 998244353
#define MAX 100000

typedef long long int ll;
typedef unsigned long long int ull;

using namespace std;

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

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

	ll M, D;
	cin >> M >> D;

	ll cnt = 0;
	rep(m, M) {
		rep(i, D) {
			ll d1, d2;
			d1 = (i+1) / 10;
			d2 = (i+1) % 10;
			if (d1 < 2 || d2 < 2)continue;
			if (d1 * d2 == m+1) cnt++;
		}
	}


	cout << cnt << endl;



	return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
 
// headers {{{
using namespace std;
// using namespace rel_ops;
 
typedef long long int64;
typedef unsigned long long uint64;
const double pi=acos(-1.0);
const double eps=1e-11;
const int INF=0x7FFFFFFF;
template<class T> inline bool checkmin(T &a,T b){return b<a?a=b,1:0;}
template<class T> inline bool checkmax(T &a,T b){return b>a?a=b,1:0;}
template<class T> inline T sqr(T x){return x*x;}
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<PII> VII;
#define MP(A,B) make_pair(A,B)
#define PB(X) push_back(X)
#define mem(a,b) memset(a, b, sizeof(a))
#define clr(a) memset(a, 0, sizeof(a))
#define rep(i,n) for(int i=0; i<(int)n; i++)
#define ff first
#define ss second
#ifdef LOCAL
#define dbg(args...) printf(args); //##__VA_ARGS__
#define dout cout
#define out(x) (cout<<#x<<": "<<x<<endl)
template<class T>void show(T a, int n){for(int i=0; i<n; ++i) cout<<a[i]<<' '; cout<<endl;}
template<class T>void show(T a, int r, int l){for(int i=0; i<r; ++i)show(a[i],l);cout<<endl;}
#else
#define dbg(...)
#define dout if(true);else cout
#define out(...)
#define show(...)
#endif
// }}}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL); 
    string s;
    while (cin >> s) {
        int N = s.length();
        rep(i, N) {
            if (s[i] == '?') {
                s[i] = 'D';
            }
        }
        cout << s << endl;
    }
    return 0;
}



Measured memory_bytes: 3744
s=input()
from itertools import*
g=[[k,len(list(v))] for k,v in groupby(s)]
ans=0
for i,j in g:
    ans+=j*(j+1)//2
for i in range(len(g)-1):
    if g[i][0]=="<":
        ans-=min(g[i][1],g[i+1][1])
print(ans)

Measured memory_bytes: 30108
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i,n) for(int i=0;i<n;++i)
#define MOD (int) 1e9+7

int main(){
    ll n, k;
    cin >> n >> k;
    vector<ll> a(n);
    ll s=0;
    rep(i, n){
        cin >> a[i];
        s += a[i];
    }

    vector<ll> mod;
    for (ll i = 1; i <=sqrt(s); i++)
    {
        if(s%i==0){
            mod.emplace_back(i);
            mod.emplace_back(s/i);
        }
    }
    sort(mod.begin(), mod.end(), greater<>());

    for (int i = 0; i < mod.size(); i++){
        ll m = mod[i];
        ll cnt=0;
        vector<ll> amari(n);
        rep(j, n){
            amari[j] = a[j]%m;
        }
        sort(amari.begin(), amari.end());
        ll l=0, r = n-1;
        while(l<r){
            if(amari[l] < m-amari[r]){
                cnt += amari[l];
                amari[r] += amari[l];
                amari[l] = 0;
                l++;
            }else{
                cnt += (m-amari[r]);
                amari[l] -= (m-amari[r]);
                amari[r] = m;
                r--;
            }
        }
        if(cnt<=k){
            cout << m << endl;
            return 0;
        }
    }
}

Measured memory_bytes: 256
#include<stdio.h>

int main() {
    int height, width, brack, i;

    scanf("%d %d %d", &height, &width, &brack);
    
    if(height>width) {
        for(i=0;i*height<brack;i++) {
        }
    }
    else {
        for(i=0;i*width<brack;i++) {
        }
    }

    printf("%d", i);
}

Measured memory_bytes: 128
n = int(input())
h = [int(i) for i in input().split()]
dp = [0,abs(h[0]-h[1])]
for i in range(2,n): dp.append(min(dp[-1]+abs(h[i]-h[i-1]),dp[-2]+abs(h[i]-h[i-2])))
print(dp[-1])

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

int main(){
    int n,x,ans=1;cin>>n>>x;vector<int> d(n+1);d.at(0)=0;
    for(int i=1;i<=n;i++){
        int l;cin>>l;
        d.at(i)=d.at(i-1)+l;
        if(d.at(i)<=x) ans++;
        else break;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i <= b; i++)
#define per(i, a, b) for (int i = a; i >= b; i--)
using namespace std;

typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef long long ll;

template <typename _T>
inline void read(_T &f) {
	f = 0; _T fu = 1; char c = getchar();
	while (c < '0' || c > '9') { if (c == '-') { fu = -1; } c = getchar(); }
	while (c >= '0' && c <= '9') { f = (f << 3) + (f << 1) + (c & 15); c = getchar(); }
	f *= fu;
}

template <typename T>
void print(T x) {
	if (x < 0) putchar('-'), x = -x;
	if (x < 10) putchar(x + 48);
	else print(x / 10), putchar(x % 10 + 48);
}

template <typename T>
void print(T x, char t) {
	print(x); putchar(t);
}

const int N = 105, md = 998244353;

inline int add(int x, int y) {
	x += y;
	if (x >= md) x -= md;
	return x;
}

inline int sub(int x, int y) {
	x -= y;
	if (x < 0) x += md;
	return x;
}

inline int mul(int x, int y) { return 1ll * x * y % md; }

vector <int> a;
char c[N];
int n;

int solve(vector <int> a) {
	int n = (int)a.size();
	vector <int> f(n + 1, 0);
	f[0] = 1;
	for (int l = 0; l < n; l++) {
		for (int r = l; r < n; r++) {
			int len = r - l + 1, nowl = l, nowr = r;
			vector <int> v(len, 0);
			for (int i = l; i <= r; i++) v[i - l] = a[i];
			while (nowr + len < n) {
				nowl += len; nowr += len;
				for (int i = nowl; i <= nowr; i++) v[i - nowl] = min(v[i - nowl], a[i]);
				int multi = solve(v);
				f[nowr + 1] = add(f[nowr + 1], mul(f[l], multi));
			}
		}
		f[l + 1] = add(f[l + 1], mul(f[l], a[l] + 1));
	}
	return f[n];
}

int main() {
	scanf("%s", c + 1); n = strlen(c + 1);
	for (int i = 1; i <= n; i++) a.push_back(c[i] - 48);
	print(solve(a), '\n');
	return 0;
}

Measured memory_bytes: 3692
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <limits>

using namespace std;

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

//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x * x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18



int main() {
	//入力
	int h, w, k; cin >> h >> w >> k;
	vector<string> f(h);
	for (int i = 0; i < h; i++) {
		cin >> f[i];
	}

	//横線区切る
	int ans = INF;
	for (int bit = 0; bit < (1 << h-1); ++bit) {
		int tmp = 0;
		
		//横線に応じた矩形の数、区切り+1個ある
		int nc = 1;
		for (int j = 0; j < h-1; j++) {
			if (bit&(1 << j)) {
				nc++;
				tmp++;
			}
		}


		vector<int> v(nc);

		bool valid = true;
		for (int j = 0; j < w; j++) {
			vector<int> vt(nc);
			int loc = 0;

			//列ごとに集計
			for (int i = 0; i < h; i++) {

				if (f[i][j] == '1')vt[loc]++;
				if (bit&(1 << i)) {
					loc++;
				}
			}

			//1列分でk超えちゃったら、この横線の区切り方では達成できない
			for (int i = 0; i < nc; i++) {
				if (vt[i] > k)valid = false;
			}

			//現在の列をたしたらkを超えるか判定する
			bool need_cut = false;
			for (int i = 0; i < nc; i++) {
				if (v[i]+vt[i] > k)need_cut = true;
			}
			
			//超えるなら切って、保存していたデータを捨てる
			if (need_cut) {
				tmp++;
				v = vt;
			}
			//切らないなら1列分足す
			else {
				for (int i = 0; i < nc; i++) {
					v[i] += vt[i];
				}
			}

		}



		if (valid) {
			ans = min(ans, tmp);
		}

	}

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

Measured memory_bytes: 384
# マイナスが大きいものの開催頻度をあげる
d=int(input())
c= list(map(int, input().split()))
D= [list(map(int, input().split())) for i in range(d)]
cc=[0]*26
for i in range(26):
    cc[i]=[c[i],i+1]
cc.sort(reverse=True)

ans=[0]*d
# 最後にどの試験がいつ行われたか？
PL=[0]*26

for i in range(d):
    cnt=0
    cntt=-10**9
    x=1
    for k in range(len(c)):
        v=PL[:]
        cnt = D[i][cc[k][1]-1]
        v[cc[k][1]-1] = i+1
        for j in range(len(c)):
            cnt-=(i+1-v[j])*c[j]
        if cnt>cntt+30:
            x=cc[k][1]
            cntt=max(cnt,cntt)
    ans[i]=x
    PL[x-1]=i


for i in range(d):
    print(ans[i])

Measured memory_bytes: 68496
import scala.annotation.tailrec
import scala.collection.mutable
import scala.io.StdIn._

object Main extends App {

  solve()
  @tailrec def solve(): Unit = {
    val Array(n, m) = readLine.trim.split(' ').map(_.toInt)
    if (n == 0 && m == 0) return
    val scores = Array.tabulate(n){_ ⇒ readLine.trim.split(' ').map(_.toInt)}
    val subjects = Array.tabulate(m){i ⇒ (0 until n).sortBy(d ⇒ scores(d)(i)).toArray}
    val nodes = Array.fill(m){Nil: List[Int]}
    for (i ← 1 until m; j ← 0 until i) {
      var isCo = true
      var prev = 0
      for (d ← (0 until n).sortWith((a, b) ⇒ if (scores(a)(i) == scores(b)(i)) scores(a)(j) < scores(b)(j) else scores(a)(i) < scores(b)(i)) if isCo) {
        if (prev > scores(d)(j)) {
          isCo = false
        }
        prev = scores(d)(j)
      }
      if (!isCo) {
        nodes(i) ::= j
        nodes(j) ::= i
      }
    }
    println(calMax(nodes))
    solve()
  }
  object Flag {
    def fill(size: Int): Flag = new Flag((1L << size) - 1)
  }
  class Flag(val toLong: Long) {
    def each: List[Int] = {
      var state = toLong
      var res = Nil: List[Int]
      for (i ← 0 until 63 if state != 0){
        if ((state & 1) == 1) {
          res ::= i
        }
        state >>= 1
      }
      res
    }
    def add(flag: Int*): Flag = {
      new Flag(flag.foldLeft(toLong){case (acc, i) ⇒ acc | (1L << i)})
    }
    def remove(flag: Int*): Flag = {
      new Flag(flag.foldLeft(toLong){case (acc, i) ⇒ acc & ~(1L << i)})
    }
    def isOn(flag: Int): Boolean = ((1L << flag) & toLong) != 0
    def isEmpty: Boolean = toLong == 0L
  }


  def calMax(nodes: Array[List[Int]]): Int = {
    val default = nodes.indices.filter{i ⇒
      nodes(i) match {
        case Nil ⇒ true
        case j::Nil if i < j || nodes(j).length > 1 ⇒ true
        case _ ⇒ false
      }
    }
    val flag = Flag.fill(nodes.length).remove(default.flatMap(nodes):_*).remove(default:_*)
    def calMax(set: Flag, nodes: Array[List[Int]])(implicit memo: mutable.Map[Long, Int]): Int = {
      memo.getOrElseUpdate(set.toLong,
        {
          if (set.isEmpty) {
            0
          }else {
            val max = set.each.maxBy { i ⇒ nodes(i).count(j ⇒ set.isOn(j)) }
            math.max(1 + calMax(set.remove(max).remove(nodes(max):_*), nodes), calMax(set.remove(max), nodes))
          }
        }
      )
    }
    calMax(flag, nodes)(mutable.Map[Long, Int]()) + default.length
  }
}



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

using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using ull = unsigned long long;
using vb = vector<bool>;
using vvb = vector<vb>;
using vd = vector<double>;
using vvd = vector<vd>;
using vvvd = vector<vvd>;
using vs = vector<string>;
using vvs = vector<vs>;
using vc = vector<char>;
using vvc = vector<vc>;
using ii = pair<int,int>;
using vii = vector<ii>;
using vvii = vector<vii>;
using dd = pair<double, double>;
using vdd = vector<dd>;
using vvdd = vector<vdd>;
using Mii = map<int,int>;
using vMii = vector<Mii>;
using Si = set<int>;
using vSi = vector<Si>;
using vvSi = vector<vSi>;

#define fi first
#define se second
#define INF 1e9 + 5
#define mod(a,m) (a%m+m)%m
#define PB push_back
#define MP make_pair

double ang(ii& a) {
	return atan2(double(a.second), double(a.first));
}

bool comp(ii& a, ii& b) {
	return ang(a) < ang(b);
}

double normsq(ii& a) {
	double x = a.first;
	double y = a.second;
	return x * x + y * y;
}

int main(){
	cout.setf(ios::fixed);
	cout.precision(30);
	int n;
	while(cin >> n) {
		vii v(n);
		for (int i = 0; i < n; ++i) cin >> v[i].first >> v[i].second;
		sort(v.begin(), v.end(), comp);
		double anssq = 0.0;
		for (int i = 0; i < n; ++i) {
			ii sum = {0,0};
			for (int j = 0; j < n; ++j) {
				sum.first += v[(i+j)%n].first;
				sum.second += v[(i+j)%n].second;
				anssq = max(anssq, normsq(sum));
			}
		}
		double ans = sqrt(anssq);
		cout << ans << '\n';
	}
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <math.h>
#include <vector>
#include <queue>
#include <iomanip>
#include <string>
using namespace std;
using Graph = vector<vector<int>>;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep_1 (i,j,n) for(int i=j;i<n;i++)
typedef long long ll;
typedef long l;
const ll l_INF = 101010101000;
const int INF = 1010101010;
const int dx[4] = {-1,0,1,0};
const int dy[4] = {0,-1,0,1};
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int,int>;

int main(){
  ll n;
  cin >> n;
  const string x = "abcdefghijklmnopqrstuvwxyz";
  string ans="";
  while(n>0){
    n--;
    int y=n%26;
    ans = x[y]+ans;
    n/=26;
  }
  /*rep(i,20){
    if(n<=pow(26,i)){
      n--;
      rep(j,i){
        int y=n%26;
        ans = x[y] + ans;
        n/=26;
      }
      break;
    }else{
      n -= pow(26,i);
    }
  }*/
  cout << ans;
}

Measured memory_bytes: 3608
function factorization1(n) {
    let primes= []
    for(let i=2; i*i<=n; i++) {
        let exponent = 0
        while(n%i===0) {
            n /= i
            exponent++
        }
        if(exponent) {
            primes.push({p:i, e:exponent})
        }
    }
    
    if(n!==1) {
        primes.push({p:n, e:1})
    }
    return primes
}


function main(arg) {
    let N = Number(arg)
    let MOD = 10**9+7
    
    let factors = {}
    for(let i=1; i<=N; i++) {
        let tmpFactors = factorization1(i)
        tmpFactors.forEach(f=>{
            if(factors[f.p]) {
                factors[f.p] += f.e
            } else {
                factors[f.p] = f.e
            }
        })
    }
    let ans = 1
    Object.keys(factors).forEach(f=>{
        ans*=(factors[f]+1)
        ans%=MOD
    })
    console.log(ans)
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 33700
from collections import deque


def getPath(adj, start, goal):
    q = deque()
    q.appendleft((start, 0))
    while len(q):
        cur, p = q.pop()
        if cur == goal:
            return p
        for nxt, nhop in adj[cur]:
            if 2**nhop & p:
                continue
            npath = p | 2**nhop
            q.appendleft((nxt, npath))


def bitcount(x):
    return bin(x).count("1")


def main():
    N = int(input())
    adj = [set() for _ in range(N)]
    for i in range(N-1):
        a, b = map(int, input().split())
        adj[a-1].add((b-1, i))
        adj[b-1].add((a-1, i))
    M = int(input())
    dp = [0] * (2**M)
    for i in range(M):
        u, v = map(int, input().split())
        path = getPath(adj, u-1, v-1)
        for j in range(2**i):
            dp[j + 2**i] = dp[j] | path
    ans = 0
    for i in range(2**M):
        ans += (-1) ** bitcount(i) * 2 ** (N - bitcount(dp[i]) - 1)
    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 51500
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
using namespace std;

int main(){
  int K, X;
  cin >> K >> X;

  for(int i = X - K + 1; i < X + K; i++){
    cout << i << " ";
  }
  cout << endl;
  return 0;
}


Measured memory_bytes: 256
// https://atcoder.jp/contests/abcXXX/tasks/abcXXX_x

#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ull = unsigned long long;
using pll = pair<ll, ll>;

static const ll INF = 1001001001;
static const ll LLINF = 1001001001001001001;
static const ll MOD = (ll)1e9 + 7;
static const double EPS = 1e-9;

#define REP(i, n) for(ll i = 0; i < (n); ++i)
#define RANGE(i, m, n) for(ll i = (m); i <= (n); ++i)
#define RRANGE(i, m, n) for(ll i = (m); i >= (n); --i)
#define POSITIVE(x) (x)=((x) < 0) ? 0 : (x)

ll power(ll x, ll y) {
    ll ret = 1;
    while(y-- > 0) ret *= x;
    return ret;
}

ll gcd(ll a, ll b) {
    assert(a >= 0);
    assert(b >= 0);
    if (b == 0) return a;
    return gcd(b, a % b);
}

ll extgcd(ll a, ll b, ll& x, ll& y) {
    x = 1; y = 0;
    assert(a >= 0);
    assert(b >= 0);
    if (b == 0) return a;
    ll X, Y;
    auto d = extgcd(b, a % b, X, Y);
    x = Y;
    y = X - (a / b) * Y;
    return d;
}

int run(istream& in, ostream& out) {
    string S;
    in >> S;
    ll N = S.size();
    REP(i, S.size()) {
        if (S[i] != S[N-1-i]) {
            out << "No" << endl; return 0;
        }
        ll m1 = (N-1)/2;
        if (i < m1 && S[i] != S[m1-1-i]) {
            out << "No" << endl; return 0;
        }
        if (i > m1 && S[i] != S[N-1-(i-m1-1)]) {
            out << "No" << endl; return 0;
        }
    }
    out << "Yes" << endl; return 0;
}

int main() {
    return run(cin, cout);
}


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

int main() {
    int a, b, x = 0;
    cin >> a >> b;
    for (int i = 0; i < 2; i++) {
        if (a >= b) {
            x += a;
            a--;
        }
        else {
            x += b;
            b--;
        }
    }
    cout << x << endl;
    return 0;
}

Measured memory_bytes: 256
n, k = map(int, input().split())
d = []
a = []
result = 0
for i in range(2 * k):
    if i % 2 == 0:
        d.append(int(input()))
    else:
        a.append(list(map(int, input().split())))

mem = [i + 1 for i in range(n)]
for i in range(n):
    for s in a:
        if (i + 1) in s:
            mem.remove(i + 1)
            break
        
print(len(mem))

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

int main(){
  int N;
  cin >> N;
  vector<double> A(N);
  for(int i=0; i<N; i++)
    cin >> A[i];

  double sum_recip = 0.0;

  for(int i=0; i<N; i++)
    sum_recip += 1 / A[i];

  cout << 1 / sum_recip << endl;
}


Measured memory_bytes: 256