akhauriyash/Code-Regression huggingface dataset:
import numpy as np
import sys
read = sys.stdin.read


D = int(input())
CS = np.array(read().split(), np.int32)
C = CS[:26]
S = CS[26:].reshape((-1, 26))
del CS

last = np.zeros((26, ))
ans = []

def getContestType_at_d(d):
    s = -10000000
    for i in range(26):
        tmp = S[d][i] - np.sum(C * (d - last)) + C[i] * (d - last[i])
        if s < tmp:
            s = tmp
            t = i

    last[t] += 1

    return t + 1


for d in range(D):
    ans.append(getContestType_at_d(d))


print('\n'.join(map(str, ans)))

Measured memory_bytes: 27664
#include "bits/stdc++.h"
using namespace std;
int main()
{
    int n, c = 0;
    scanf("%d", &n);
    vector<vector<int>> a(n, vector<int>(2));
    for (int i = 0; i < n; i++)
    {
        scanf("%d %d", &a[i][0], &a[i][1]);
    }
    sort(a.begin(), a.end());
    c += a[0][0];
    for (int i = 1; i < n; i++)
    {
        c += min(a[i][0] - a[i - 1][0], a[i - 1][1] - a[i][1]);
    }
    c += a[n - 1][1];
    printf("%d\n", c);
}


Measured memory_bytes: 5760
#include <iostream>

int main() {
  int coins;

  int happiness;

  int x;

  int y;

  std::cin >> coins;

  if (coins/500 != 0) {
     x = coins/500;
     happiness =  (1000 * x);
     coins = coins - (500 * x);
  }

  if (coins/5 != 0) {
     y = coins/5;
     happiness = happiness + (5 * y);
  }

  std::cout << happiness << "\n";
}

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

using namespace std;

int main()
{
	int a, b, c, sum;
	cin >> a >> b >> c;
	if (a == b + c || b == a + c || c == a + b)
	{
		cout << "Yes"<<endl;
	}else
	{
		cout << "No" << endl;
	}
}

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

using namespace std;
#ifdef _DEBUG
#define _GLIBCXX_DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

#define int long long
#define ll long long
#define ll1 1ll
#define ONE 1ll
#define DBG 1
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define loop(n) rep(loop, (0), (n))
#define all(c) begin(c), end(c)
const int INF =
    sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
const double PI = acos(-1);
const double EPS = 1e-9;
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
using pii = pair<int, int>;
// template<class T> ostream &operator<<(ostream &os,T &t){dump(t);return os;}
template <typename T, typename S>
istream &operator>>(istream &is, pair<T, S> &p) {
  is >> p.first >> p.second;
  return is;
}
template <typename T, typename S>
ostream &operator<<(ostream &os, pair<T, S> &p) {
  os << p.first << " " << p.second;
  return os;
}

template <typename T> void printvv(const vector<vector<T>> &v) {
  cerr << endl;
  rep(i, 0, v.size()) rep(j, 0, v[i].size()) {
    if (typeid(v[i][j]).name() == typeid(INF).name() and v[i][j] == INF) {
      cerr << "INF";
    } else
      cerr << v[i][j];
    cerr << (j == v[i].size() - 1 ? '\n' : ' ');
  }
  cerr << endl;
}
/*
   typedef __int128_t Int;
   std::ostream &operator<<(std::ostream &dest, __int128_t value) {
   std::ostream::sentry s(dest);
   if (s) {
   __uint128_t tmp = value < 0 ? -value : value;
   char buffer[128];
   char *d = std::end(buffer);
   do {
   --d;
 *d = "0123456789"[tmp % 10];
 tmp /= 10;
 } while (tmp != 0);
 if (value < 0) {
 --d;
 *d = '-';
 }
 int len = std::end(buffer) - d;
 if (dest.rdbuf()->sputn(d, len) != len) {
 dest.setstate(std::ios_base::badbit);
 }
 }
 return dest;
 }

 __int128 parse(string &s) {
 __int128 ret = 0;
 for (int i = 0; i < s.length(); i++)
 if ('0' <= s[i] && s[i] <= '9')
 ret = 10 * ret + s[i] - '0';
 return ret;
 }
 */

#ifndef _DEBUG
#define printvv(...)
#endif
void YES(bool f) { cout << (f ? "YES" : "NO") << endl; }
void Yes(bool f) { cout << (f ? "Yes" : "No") << endl; }
template <class T> bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T> bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}

signed main(signed argc, char *argv[]) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(12);

  int N;
  cin >> N;
  vector<int> h(N);
  rep(i, 0, N) { cin >> h[i]; }
  vector<int> dp(N, INF);
  dp[0] = 0;
  rep(i, 0, N ) {
    if (i + 1 < N) {
      chmin(dp[i + 1], dp[i] + abs(h[i] - h[i + 1]));
    }
    if (i + 2 < N) {
      chmin(dp[i + 2], dp[i] + abs(h[i] - h[i + 2]));
    }
  }
  cout<<dp[N-1]<<endl;

  return 0;
}


Measured memory_bytes: 1792
import java.util.Scanner;

public class Main {

     static Scanner scanner;

     public static void main(String[] args) {
         scanner = new Scanner(System.in);

         int N=gi();
         long[] a=new long[N];
         long[] b=new long[N-1];
         long sum=0;
         long q=1000000007;
         for (int i=0; i<N;i++) {
        	 a[i]=gl();
        	 sum+=a[i];
         }
         b[0]=(sum-a[0])%q;
         sum-=a[0];
         for (int i=1; i<N-1;i++) {
        	 b[i]=sum-a[i];
        	 b[i]=b[i]%q;
        	 sum=sum-a[i];
         }

         long ans=0;
         for (int i=0; i<N-1;i++) {
        	 long tmp=(a[i]*b[i])%q;
        	 ans+=tmp;
        	 ans=ans%q;
         }

         System.out.println(ans);

     }

     // 文字列として入力を取得
     public static String gs() {
          return scanner.next();
     }

     // intとして入力を取得
     public static int gi() {
          return Integer.parseInt(scanner.next());
     }

     // longとして入力を取得
     public static long gl() {
          return Long.parseLong(scanner.next());
     }

     // doubleとして入力を取得
     public static double gd() {
          return Double.parseDouble(scanner.next());
     }
}

Measured memory_bytes: 62648
S = [int(i) for i in input()]


def count_reverse(t):
    count = 0
    for i, s_i in enumerate(S):
        if s_i != t:
            count += 1
        if t == 0:
            t = 1
        else:
            t = 0
    return count


c_0 = count_reverse(0)
c_1 = count_reverse(1)
print(min(c_0, c_1))

Measured memory_bytes: 3956
#include <bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c;
  cin >> a>>b;
  if((a+b)%2==0){
  	c = (a+b)/2;
    cout << c <<endl;
  }
  else{
    c =(a+b)/2+1;
  	cout << c <<endl;
  }
}

    


Measured memory_bytes: 256
#!/usr/bin/env python3
# Generated by https://github.com/kyuridenamida/atcoder-tools
from typing import *
import itertools
import math
import sys

INF = float('inf')
YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(X: int, Y: int):
    return [NO, YES][2*X <= Y <= 4*X and Y % 2 == 0]


def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  # type: int
    Y = int(next(tokens))  # type: int
    print(solve(X, Y))


if __name__ == '__main__':
    main()


Measured memory_bytes: 75252
#include<bits/stdc++.h>
using namespace std;
#define ll   long long int
#define T int t; cin>>t; while(t--)
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL)
#define PI 3.141592653589793238462643383
#define pb push_back
#define all(s) s.begin(),s.end()

ll power(ll x, ll y, ll p){  
    ll res = 1;  
  
    x = x % p; 
    if (x == 0) return 0; 
    while (y > 0)  
    {  
        if (y & 1)  
            res = (res*x) % p;  
        y = y>>1; 
        x = (x*x) % p;  
    }  
    return res;  
}  

int main (){
    fast;
    
    ll n, m = 1000000007;
    cin>>n;
    
    // for(int i=0;i<n;i++){
    //     ten = (ten*(ll)10)%m;
    //     nine = (nine*(ll)9)%m;
    //     eight = (eight*(ll)8)%m;
    // }
    ll ans=((power(10,n,m)%m + power(8,n,m)%m)%m - ((power(9,n,m))%m + (power(9,n,m))%m)%m + 10*m)%m;

    cout<<ans<<endl;


}

Measured memory_bytes: 3604
#include <stdio.h>
int main(void)
{
	int a[3],i,j,tmp;
	for(i=0; i<3; i++){
		scanf("%d",&a[i]);
	}
	for(i=0; i<3; i++){
		for(j=i+1; j<3; ++j){
			if(a[i]>a[j]){
				tmp=a[i];
				a[i]=a[j];
				a[j]=tmp;
			}
		}
	}
	printf("%d\n",(a[1]-a[0])+(a[2]-a[1]));
	return 0;
}

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

#define REP(i,num) for(int i=0;i<(num);++i)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto& x:c){cout<<x<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

constexpr int atcoder_mod = 1e9+7;

using namespace std;
using ll = long long;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

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

	int A=in(),B=in(),C=in(),D=in();
	out(min({A+C,A+D,B+C,B+D}));

	return 0;
}


Measured memory_bytes: 256
#include<stdio.h>	
int main(void)
{
		int a,b,c,d;
		scanf("%d %d %d",&a,&b,&c);
		d=a+b;
		if(c<d) {
			printf("Yes\n");
		}
	    else if(c==d) {
			printf("Yes\n");
		}
		else{
			printf("No\n");
		}
		return 0;		
}							

Measured memory_bytes: 128
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N,X=MI()
    if(X==1 or X==2*N-1):
        if(N==1):
            print("Yes")
            print(1)
        else:
            print("No")
    else:
        if(N==2):
            if(X==2):
                print("Yes")
                print("1\n2\n3")
            else:
                print("No")
        else:
            ans = [-1]*(2*N-1)
            ans[N-2] = 1
            ans[N-1] = X
            ans[N] = 2*N-1
            used = set([X,1,2*N-1])
            now = 2
            for i in range(N+1,2*N-1):
                while(now in used):
                    now += 1
                ans[i] = now
                used.add(now)
            for i in range(N-2):
                while(now in used):
                    now += 1
                ans[i] = now
                used.add(now)
            print("Yes")
            # print(ans)
            print(*ans,sep="\n")
if __name__ == '__main__':
    main()

Measured memory_bytes: 26284
import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        String a = scanner.next();
        String b = "";
        for(char c : a.toCharArray()){
            b += a(c);
        }
        System.out.println(b);
    }
    static String a(char c){
        if(c == '1'){
            return "9";
        }else{
            return "1";
        }
    }
}

Measured memory_bytes: 20948
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from collections import deque
# people on a line
n, m = map(int, input().split())

graph = {i: {} for i in range(1, n + 1)}


for _ in range(m):
    a, b, c = map(int, input().split())
    graph[a][b] = c
    graph[b][a] = -c



distance = ["inf" for i in range(n + 1)]

# グラフにおいて順に点を決めてって、矛盾がないかどうかを調べる
visited = [False for i in range(n + 1)]
visited[0] = True


def find(x):
    d = deque()
    visited[x] = True
    distance[x] = 0
    d.append(x)
    flag = True
    while d and flag:

        x = d.popleft()
        for node in graph[x]:
            if visited[node] == False:
                visited[node] = True
                d.append(node)
                if distance[node] == "inf":
                    distance[node] = distance[x] + graph[x][node]
                else:
                    if  distance[node] != distance[x] + graph[x][node]:
                        flag = False
                        break
            elif visited[node]==True:
                if distance[node]!=distance[x]+graph[x][node]:
                    flag=False
                    break
         
    if flag:
        return False
    else:
        return True

all_flag = True
not_visited = True
while not_visited and all_flag:
    judge = False
    for i in range(1, n + 1):
        if visited[i] == False:
            judge = True
            if find(i):
                all_flag = False
                break
            else:
                pass

    if not judge:
        not_visited = False

if all_flag:
    print("Yes")

else:
    print("No")


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


int main(void){
    std::cin.tie(nullptr); std::cin.sync_with_stdio(false);
    
    std::string S, T; std::cin >> S >> T;
    const int n = S.size();
    int res = 0;
    for(int i = 0; i < n; ++i) if(S[i] != T[i]) ++res;
    std::cout << res << '\n';
    return 0;
}


Measured memory_bytes: 3800
#include<stdio.h>

int main()
{
	int n, count[4][3][10] = { 0 };
	int i, b, f, r, v;
	scanf("%d", &n);
	for (i = 0; i<n; i++)
	{
		scanf("%d%d%d%d", &b, &f, &r, &v);
		count[b - 1][f - 1][r - 1] = count[b - 1][f - 1][r - 1]+v;
	}
	for (b = 0; b<4; b++)
	{
		for (f = 0; f<3; f++)
		{
			for (r = 0; r<10; r++)
			{
				printf(" %d", count[b][f][r]);
			}
			printf("\n");
		}
		if (b == 3) { break; }
		printf("####################\n");
	}
	return 0;
}

Measured memory_bytes: 612
// clang-format off
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define stoi stoll
using pii = pair<int,int>;
using vi = vector<int>;
using vvi = vector<vi>;
#define all(c) begin(c), end(c)
#define rall(c) rbegin(c), rend(c)
#define fore(x, c) for(auto &&x : c)
#define rep(i, a, n) for(int i = a, i##len = (int)(n); i < i##len; ++i)
#define rrep(i, a, n) for(int i = (int)(n - 1); i >= a; --i)
#define sz(c) ((int)c.size())
#define contains(c, x) (c.find(x) != end(c))
#define inseg(l, x, r) ((l) <= (x) && (x) < (r))
#define dump(...)
#define pb push_back
#define eb emplace_back
#define _ 0
const signed INF_ = 1001001001; const long long INF = 1001001001001001001LL;
const int DX[9] = {0,1,0,-1,1,1,-1,-1,0}, DY[9] = {-1,0,1,0,-1,1,1,-1,0};
template<class T> ostream& operator<<(ostream &os, const vector<T> &v) {
  for (auto i = begin(v); i != end(v); i++) os<<*i<<(i==end(v)-1?"":" ");return os;}
template<class T> istream& operator>>(istream &is, vector<T> &v) {
  for (auto i = begin(v); i != end(v); i++) is>>*i;return is;}
template<class T,class U> istream& operator>>(istream &is, pair<T,U> &p) {
  is>>p.first>>p.second;return is;}
template<class T, class U> bool chmax(T &a, const U &b){return a<b?a=b,1:0;}
template<class T, class U> bool chmin(T &a, const U &b){return a>b?a=b,1:0;}
template <class T> void psum(T& c) {partial_sum(begin(c), end(c), begin(c));}
template<class T> using heap = priority_queue<T, deque<T>, greater<T>>;
struct before_main_function {
  before_main_function() {
      cin.tie(nullptr); ios::sync_with_stdio(0);
      cout << setprecision(15) << fixed;
  }
} before_main_function;
// clang-format on
//------------------8<------------------------------------8<--------------------

signed main() {
  string S;
  string T;
  cin >> S >> T;
  if (T.substr(0, sz(S)) == S)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return (0 ^ _ ^ 0);
}



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

using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
using LL = long long;
using VL = vector<LL>;
using VVL = vector<VL>;
using PLL = pair<LL, LL>;
using VS = vector<string>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define MT make_tuple
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))

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

#define FF first
#define SS second

#define DUMP(x) cout<<#x<<":"<<(x)<<endl
template<class S, class T>
istream& operator>>(istream& is, pair<S,T>& p){
  return is >> p.FF >> p.SS;
}
template<class T>
istream& operator>>(istream& is, vector<T>& xs){
  for(auto& x: xs)
	is >> x;
  return is;
}
template<class S, class T>
ostream& operator<<(ostream& os, const pair<S,T>& p){
  return os << p.FF << " " << p.SS;
}
template<class T>
ostream& operator<<(ostream& os, const vector<T>& xs){
  for(unsigned int i=0;i<xs.size();++i)
	os << (i?" ":"") << xs[i];
  return os;
}
template<class T>
void maxi(T& x, T y){
  if(x < y) x = y;
}
template<class T>
void mini(T& x, T y){
  if(x > y) x = y;
}


const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL MOD = 1e9+7;

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

  int N;
  cin >> N;
  VL xs(N);
  cin >> xs;

  if(xs[0]){
	cout << -1 << endl;
	return 0;
  }

  LL ans = 0;
  int crt = 0;
  for(int i=N-1;i>=0;--i){
	if(xs[i] < crt){
	  cout << -1 << endl;
	  return 0;
	}
	else if(xs[i] == crt){
	}
	else{
	  ans += xs[i];
	  crt = xs[i];
	}
	--crt;
	maxi(crt, 0);
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 1792
#include <stdio.h>
#define MAX 249

int main() {
  int H, i;
  int A[MAX];

  scanf("%d", &H);
  for (i = 1; i <= H; i++) {
    scanf("%d", &A[i]);
  }

  for (i = 1; i <= H; i++) {
    printf("node %d: ", i);
    printf("key = %d, ", A[i]);
    if (i / 2 > 0 && i / 2 <= H) {
      printf("parent key = %d, ",A[i/2]);
    }
    if (i * 2 > 0 && i * 2 <= H) {
      printf("left key = %d, ", A[i * 2]);
    }
    if ((i * 2) + 1 > 0 && (i * 2) + 1 <= H) {
      printf("right key = %d, ", A[(i * 2) + 1]);
    }
    printf("\n");
  }

  return 0;
}



Measured memory_bytes: 2048
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<stdio.h>
using namespace std;
int main(){
	int a, L;
	while (1){
		cin >> a >> L;
		if (a == 0 && L == 0)return 0;
		vector<int> memo(1000000, -1);
		memo[a] = 0;
		
		for(int i=1;;i++){
			string s = to_string(a);
			while ((int)s.size() < L)s = "0" + s;
			string t = s;
			sort(s.begin(), s.end());
			sort(t.begin(), t.end());
			reverse(s.begin(), s.end());
			a = stoi(s) - stoi(t);

			if (memo[a] >= 0){
				printf("%d %d %d\n", memo[a], a, i - memo[a]);
				break;
			}
			memo[a] = i;
		}

	}
}

Measured memory_bytes: 5136
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include <set>
#include <vector>
#include <queue>
using namespace std;

int main(){
	int n;
	cin >> n;
	int64_t sum = 0;
	vector<int64_t> arr;
	for (int i = 0; i < n; ++i) {
		int64_t ai;
		cin >> ai;
		sum += ai;
		arr.push_back(sum);
	}
	int64_t b1 = 0;
	int64_t s1 = 0;
	int64_t b2 = 0;
	int64_t s2 = 0;
	for (int i = 0; i < n; ++i) {
		if (i % 2 == 0) {
			b1 += max(0LL,(long long int)( 1 - arr[i]-s1));
			s1 += max(0LL, (long long int)(1 - arr[i]-s1));
			b2 += max(0LL, (long long int)(arr[i] +s2+ 1));
			s2 -= max(0LL, (long long int)(arr[i] +s2+ 1));
		}
		else {
			b1 += max(0LL, (long long int)(arr[i] + s1 + 1));
			s1 -= max(0LL, (long long int)(arr[i] + s1 + 1));
			b2 += max(0LL, (long long int)(1 - arr[i] - s2));
			s2 += max(0LL, (long long int)(1 - arr[i] - s2));
		}
	}
	cout << min(b1, b2) << endl;
	return 0;
}

Measured memory_bytes: 1400
import logging

logging.basicConfig(level=logging.INFO, format="%(message)s")
#logging.disable(logging.CRITICAL)

def main():
    K, X = map(int, input().split())
    logging.info("Hello!")

    min_x = X - K + 1
    max_x = X + K - 1

    ans = ""
    for i in range(min_x, max_x + 1):
        if i < -1000000:
            continue
        elif i > 1000000:
            break

        ans += str(i)
        ans += " "

    print(ans)
    
if __name__ == "__main__":
    main()


Measured memory_bytes: 4712
from collections import deque
S = input()
deque = deque([s for s in S])
Q = int(input())
rev_flag = 0
for _ in range(Q):
    q = list(map(str, input().split()))
    if len(q) == 1:
        if rev_flag:
            rev_flag = 0
        else:
            rev_flag = 1
    else:
        if q[1] == "1":
            if rev_flag:
                deque.append(q[2])
            else:
                deque.appendleft(q[2])
        else:
            if rev_flag:
                deque.appendleft(q[2])
            else:
                deque.append(q[2])
if rev_flag:
    print("".join(deque)[::-1])
else:
    print("".join(deque))

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

using std::cin;
using std::cout;
using std::endl;

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

    std::vector<int> line(n);
    for (auto i = 0; i < n; i++) {
        cin >> line.at(i);
    }

    int swap_cnt = 0;
    for (auto i = 0; i < n; i++) {
        for (auto j = n - 1; j > i; j--) {
            if (line.at(j) < line.at(j - 1)) {
                int tmp = line.at(j);
                line.at(j) = line.at(j - 1);
                line.at(j - 1) = tmp;
                swap_cnt++;
            }
        }
    }

    for (auto i = 0; i < n; i++) {
        if (i != 0) {
            cout << " ";
        }
        cout << line.at(i);
    }
    cout << endl;

    cout << swap_cnt << endl;

    return 0;
}

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

int main() {
	int m, f, r;
	while (true)
	{
		scanf("%d %d %d", &m, &f, &r);
		if (m == -1 && f == -1 && r == -1)
		{
			return 0;
		}
		if ((m == -1 || f == -1) || (m + f < 30))
		{
			printf("F\n");
			continue;
		}
		if (m + f >= 80)
		{
			printf("A\n");
			continue;
		}
		if (m + f >= 65)
		{
			printf("B\n");
			continue;
		}
		if (m + f >= 50)
		{
			printf("C\n");
			continue;
		}
		if (m + f >= 30)
		{
			if (r >= 50)
			{
				printf("C\n");
				continue;
			}
			printf("D\n");
			continue;
		}
	}
}


Measured memory_bytes: 2692
N = int(input())
ans = []
A = [0 for i in range(N)]
Axy = [0 for i in range(N)]
for i in range(N):
    A[i] = int(input())
    Axy[i] = [[int(i) for i in input().split()] for j in range(A[i])]

for i in range(1<<N):#2^N通りやる
    Truth = []
    maru = 0
    for j in range(N):
        Truth.append(((i>>j)&1)==1)
        maru += ((i>>j)&1)#〇の数
    syogen = [0 for i in range(N)]
    for k in range(N):
        if Truth[k]:
            syogen[k] = 1
    isMujun = True
    for k in range(N):
        if Truth[k] and isMujun:
            for x,y in Axy[k]:
                if syogen[x-1]==y:
                    pass
                else:#矛盾発生
                    ans.append(0)
                    isMujun = False
                    break
    if isMujun:
        ans.append(maru)
print(max(ans))

Measured memory_bytes: 3572
import java.util.Scanner;
public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt( );
        int s = num % 60;
        int h = (num/60)/60;
        int m = (num/60)%60;
        System.out.println(h+":"+m+":"+s);
    }
}



Measured memory_bytes: 26244
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int n,m,x,y,i,s;
    cin>>n>>m>>y;
    s=n+m;
    if(s==y)
    {
        cout<<"0 0"<<endl;
    }
    else
    {
        if(y>n)
        {
            y=y-n;
            n=0;
        }
        else
        {
            n=n-y;
            y=0;
            cout<<n<<" "<<m<<endl;
        }

        if(y!=0 && y<m)
        {
            m=m-y;
            y=0;
            cout<<n<<" "<<m<<endl;
        }
        else if(y!=0 && y>m)
        {
            m=0;
            cout<<n<<" "<<m<<endl;
        }
    }
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
long long a [100010];
int main (){
int n;
cin>>n;
for(int i=0;i<n;i++) cin>>a[i];
int zero =0;

for(int i=0;i<n;i++)if(a[i]==0) zero ++;
if(zero >0){
// a[i] contains 0
cout<<"0"<<endl;
return 0;
}
long long prod =1;
for(int i=0;i<n;i++){
if(a[i ] <=1000000000000000000/ prod ){
// This condition is equivalent to prod*a[i] <=10ˆ18
prod *=a[i];
}else{
 cout<<"-1"<<endl;
return 0;
}
}
 cout<<prod<<endl;
}


Measured memory_bytes: 4416
s = str(input())

ans = [0] * len(s)
pos = 0
s = s + 'e'
while True:
    lpos = s.find('L')
    num_l = 1
    while s[lpos+num_l] == 'L':
        num_l += 1
    num_target = lpos + num_l
    r = lpos // 2
    l = num_l // 2
    ans[pos+lpos] = r + l + num_l%2
    ans[pos+lpos-1] = l +  r + lpos%2
    if num_target == len(s)-1:
        break
    s = s[num_target:]
    pos += num_target
for a in ans:
  print("{} ".format(a), end='')

Measured memory_bytes: 4848
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
const int N = 205; 
using namespace std;

int n, m, sum[N][N], f[2][N][N][N], ans; 
char s[N]; 

template < typename T >
inline T read()
{
	T x = 0, w = 1; char c = getchar();
	while(c < '0' || c > '9') { if(c == '-') w = -1; c = getchar(); }
	while(c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
	return x * w; 
}

int calc(int u, int l, int d, int r)
{
	if(r < l || d < u) return 0; 
	int res = (d - u + 1) * (r - l + 1), tmp; 
	tmp = sum[d][r] - sum[d][l - 1] - sum[u - 1][r] + sum[u - 1][l - 1]; 
	return tmp == res || !tmp; 
}

int binary(int opt, int u, int d, int k)
{
	int l = u, r = d - 1, mid, tmp1, tmp2, res = 0; 
	if(l > r) return 0; 
	while(l <= r)
	{
		mid = (l + r) >> 1;
		tmp1 = f[opt][u][mid][k], tmp2 = f[opt][mid + 1][d][k]; 
		res = max(res, min(tmp1, tmp2)); 
		if(tmp1 < tmp2) r = mid - 1; 
		else l = mid + 1; 
	}
	return res; 
}

void solve(int opt)
{
	for(int tmp, u = 1; u <= n; u++)
		for(int d = u; d <= n; d++)
			for(int l = 1; l <= m; l++)
			{
				tmp = f[opt ^ 1][u][d][l], f[opt][u][d][l] = tmp + f[opt ^ 1][u][d][l + tmp]; 
				f[opt][u][d][l] = max(f[opt][u][d][l], binary(opt ^ 1, u, d, l)); 
			}
}

int main()
{
	n = read <int> (), m = read <int> ();
	for(int i = 1; i <= n; i++)
	{
		scanf("%s", s + 1);
		for(int j = 1; j <= m; j++)
			sum[i][j] = sum[i - 1][j] + sum[i][j - 1] - sum[i - 1][j - 1] + (s[j] == '.'); 
	}
	for(int lst = m, u = 1; u <= n; u++)
		for(int d = u; d <= n; d++, lst = m)
			for(int l = m; l; l--)
			{
				while(lst >= l && !calc(u, l, d, lst)) lst--; 
				f[0][u][d][l] = lst - l + 1; 
			}
	for(int i = 1; f[(i & 1) ^ 1][1][n][1] < m; i++)
		solve(i & 1), ans = i; 
	printf("%d\n", ans); 
	return 0; 
}


Measured memory_bytes: 63488
N = int(input())
a =list(map(int, input().split()))

def gcd(a, b):
    while b:
        a, b = b, a%b
    return a

L = []
for i in range(len(a)):
    if i==0:
        L.append(None)
    elif i ==1:
        L.append(a[i-1])
    else:
        L.append(gcd(L[-1], a[i-1]))
        
R = []
for i in range(len(a)):
    if i==0:
        R.append(None)
    elif i ==1:
        R.append(a[-i])
    else:
        R.append(gcd(R[-1], a[-i]))
R = R[::-1]


max_val = 0
for r, l in zip(L,R):
    if r==None:
        val = l
    elif l==None:
        val = r
    else:
        val = gcd(r, l)
        
    if val > max_val:
        max_val = val
print(max_val)

Measured memory_bytes: 14440
#include<cstdio>

int d[6]={1,5,10,50,100,500};
int c[6];

int main(void){
    int all=0;
    for(int i=0;i<6;i++){
        scanf("%d",&c[i]);
        all+=c[i]*d[i];
    }
    printf("%d\n",all>=1000?1:0);
    return 0;
}

Measured memory_bytes: 1028
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define PI 3.141592653589793
#define rep(i, n) for (int i = 0; i < (n); i++)
#define REP(i, a, n) for (int i = a; i < (n); i++)
#define rrep(i, n, k) for (int i = (n); i >= (k); i--);
#define all(x) (x).begin(), (x).end()
#define vi vector<int>
template<class T> istream &operator>>(istream&is,vector<T>&v){for(auto &elemnt:v)is>>elemnt;return is;}
template<class T,class U> istream &operator>>(istream&is,pair<T,U>&p){is>>p.first>>p.second;return is;}
template<class T>vector<T> make_vector(size_t a){return vector<T>(a);}
template<class T, class... Ts>auto make_vector(size_t a, Ts... ts){return vector<decltype(make_vector<T>(ts...))>(a, make_vector<T>(ts...));}
const int MOD = 1e9 + 7;
const int INF = 2e18;

struct info {
    int add, nextIndex, before;
};

signed main() {
    int N, K;
    cin >> N >> K;
    vector<int> A(N);
    vector<set<int>> index(200100);
    cin >> A;
    for (int i = 0; i < N; i++) index[A[i]].insert(i);
    vector<info> temp(N + 1, {-1, -1, -1});
    for (int i = N - 1; i >= 0; i--) {
        auto itr = index[A[i]].upper_bound(i);
        if (itr != index[A[i]].end()) {
            if (*itr + 1 == N) {
                temp[i].nextIndex = -1;
            } else {
                temp[i].nextIndex = *itr + 1;
            }
            temp[i].before = temp[*itr + 1].add;
            if (temp[i].before == -1) temp[i].before = temp[*itr + 1].before;
        } else {
            temp[i].add = A[i];
            temp[i].nextIndex = i + 1;
        }
    }
    vector<int> check;
    int now = 0;
    while (true) {
        check.push_back(now);
        if (temp[now].nextIndex == -1) break;
        if (temp[now].add == -1) {
            if (temp[now].before == -1) break;
            now = *index[temp[now].before].begin() + 1;
        } else {
            now = *index[temp[now].add].begin() + 1;
        }
    }
    vector<int> ans;
    int next = check[(K - 1) % check.size()];
    while (next != -1) {
        if (temp[next].add != -1) ans.push_back(temp[next].add);
        next = temp[next].nextIndex;
    }
    for (int i = 0; i < ans.size(); i++) {
        cout << ans[i] << (i == ans.size() - 1 ? '\n' : ' ');
    }

}


Measured memory_bytes: 29940
#include <bits/stdc++.h>
using namespace std;
//#define cerr if (false) cerr
#define db(x) cerr << #x << "=" << x << endl
#define db2(x, y) cerr << #x << "=" << x << "," << #y << "=" << y << endl
#define db3(x, y, z) cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z << endl
#define dbv(v) cerr << #v << "="; for (auto _x : v) cerr << _x << ", "; cerr << endl
#define dba(a, n) cerr << #a << "="; for (int _i = 0; _i < (n); ++_i) cerr << a[_i] << ", "; cerr << endl
template <typename A, typename B>
ostream& operator<<(ostream& os, const pair<A, B>& x) {
	return os << "(" << x.first << "," << x.second << ")";
}
typedef long long ll;
typedef long double ld;
vector<vector<int>> solve(int n, int m) {
	if (n == 0) return {vector<int>(1 << m)};
	auto g = solve(n - 1, m - 1);
	int N = 1 << n, M = 1 << m;
	vector<vector<int>> ret(N, vector<int>(M));
	for (int i = 0; i < N; ++i)
		for (int j = 0; j < M; ++j) {
			if (i < N / 2) ret[i][j] = g[i][j % (M / 2)];
			else if (j < M / 2) ret[i][j] = g[N - i - 1][j];
			else ret[i][j] = 1 - g[N - i - 1][j - M / 2];
		}
	return ret;
}
int main() {
	int n, m;
	scanf("%d%d", &n, &m);
	vector<vector<int>> g;
	if (n <= m) g = solve(n, m);
	else {
		auto h = solve(m, n);
		g = vector<vector<int>>(1 << n, vector<int>(1 << m));
		for (int i = 0; i < h.size(); ++i)
			for (int j = 0; j < h[i].size(); ++j)
				g[j][i] = h[i][j];
	}
	for (int i = 1; i < (1 << n); ++i) {
		for (int j = 1; j < (1 << m); ++j) {
			int ans = g[i][j] ^ g[i - 1][j] ^ g[i][j - 1] ^ g[i - 1][j - 1];
			printf("%d", ans);
		}
		printf("\n");
	}
}


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

#define FOR(i, a, b) for (int i = (a); i < static_cast<int>(b); i++)
#define FORR(i, a, b) for (int i = (a); i >= static_cast<int>(b); i--)
#define rep(i, n) FOR (i, 0, n)
#define repall(i, arr) for (auto& i : (arr))
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define dump(x) cerr << #x << " = " << (x) << '\n'
template <typename T>
void print(const vector<vector<T>> matrix);
template <typename T>
void print(const vector<T> vec);
template <typename Arg>
void print(const Arg arg);
template <typename Head, typename... Args>
void print(const Head head, const Args... args);
template <typename T>
using pq = priority_queue<T>;
template <typename T>
using pqr = priority_queue<T, vector<T>, greater<T>>;
const int INF = INT_MAX / 2;
using ll = long long;

typedef pair<int, int> P;

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

    int n;
    cin >> n;
    vector<string> vec(n);
    rep (i, n)
        cin >> vec[i];

    string prev;
    rep (i, n) {
        if (i != 0 and prev[prev.size() - 1] != vec[i][0]) {
            print("No");
            return 0;
        }
        prev = vec[i];

        FOR (j, i + 1, n) {
            if (vec[i] == vec[j]) {
                print("No");
                return 0;
            }
        }
    }
    print("Yes");

    return 0;
}

//---------------------------------------------
template <typename T>
void print(const vector<vector<T>> matrix) {
    repall (vec, matrix)
        print(vec);
}
template <typename T>
void print(const vector<T> vec) {
    repall (i, vec)
        cout << i << ' ';
    cout << '\n';
}
template <typename Arg>
void print(const Arg arg) {
    cout << arg << '\n';
}
template <typename Head, typename... Args>
void print(const Head head, const Args... args) {
    cout << head << " ";
    print(args...);
}


Measured memory_bytes: 256
def main():
    N = int(input())
    A = list(map(int,input().split()))
    C = 1
    if 0 in A:
        print(0)
    else:
        for i in range(N):
            C *= A[i]
            if C > 10**18:
                C = '-1'
                break
            
        print(C)
    
if __name__ == '__main__':
    main()

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

songs = list()
times = {}
for i in range(0, N):
    # 2つの入力を空白で分割し、数値化
    s, t = input().split()

    songs.append(s)
    times[s] = int(t)

# そのまま入力文字列の入力
X = input()

sleeps = False
ans = 0
for song in songs:
    if song == X:
        sleeps = True
        continue

    if sleeps:
       ans += times[song]

print(ans)

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

int main() {
    int n, dp[26][101] = {}, ans, sum;
    string s;
    
    cin >> n;
    cin >> s;
    
    for ( int i = 0; i < n; i++ ) {
        dp[s[i]-'a'][i+1] ++;
        
        for ( int j = 0; j < 26; j++ ) {
            dp[j][i+1] += dp[j][i];
        }
    }
    
    ans = 0;
    for ( int i = 1; i < n; i++ ) {
        sum = 0;
        
        for ( int j = 0; j < 26; j++ ) {
            if (dp[j][i] > 0 && dp[j][n] - dp[j][i] > 0 ) {
                sum++;
            }
        }
        
        ans = max(ans, sum);
    }
    
    cout << ans << endl;
    
    return (0);
}

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

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

int main() {
    string s,t; cin>>s>>t;
    reverse(s.begin(),s.end());
    reverse(t.begin(),t.end());
    
    string s1 = s;
    
    int m = s.size();
    int n = t.size();
    
    rep(i, m){
        if(s[i] == t[0] || s[i] == '?'){
            int tmp = 0;
            rep(j, n){
                if(s[i+j]!=t[j] && s[i+j]!= '?'){
                    tmp = 1;
                    break;
            }
            }
            if(tmp == 0){
                rep(l,m){
                    if(l>=i && l < i+n)s1[l] = t[l-i];
                    else if(s[l]=='?')s1[l] = 'a';
//                    else s1[l] = s1[l];
                }
                reverse(s1.begin(),s1.end());
                cout<<s1<<endl;
                return 0;
            }
        }
    }
    cout<<"UNRESTORABLE"<<endl;
	return 0;
}

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

int main()
{
    string s, t;
    cin >> s >> t;

    ll ans = 0;
    for (int i = 0; i < s.size(); i++)
    {
        if (s[i] != t[i])
        {
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3912
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] nmList = sc.nextLine().split(" ");
		StringBuilder sb = new StringBuilder();
		sb.append(nmList[0]);
		sb.append(nmList[1]);
		Integer nm = Integer.parseInt(sb.toString());
		double k = Math.sqrt(nm);
		int k2 = (int)k;
		if(k2*k2 == nm) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
		
	}
}


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

int main(){
  ll n,k,ans;
  cin>>n>>k;
  ans=n%k;
  ans=min(ans,abs(ans-k));
  cout<<ans<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(void){
    string S;
    cin>>S;
    int ans=0;
    int count=0;
    for(int i=0;i<S.size();i++){
        if(S.at(i)=='A'||S.at(i)=='C'||S.at(i)=='G'||S.at(i)=='T'){
            count++;
            ans=max(ans,count);
        }
        else count=0;
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
l = list(map(int,list(input())))
sum = 0

if l[0] == 0:
	for i in range(len(l)):
		if i%2 == 0:
			if l[i] == 0:
				continue
			else:
				sum += 1
		else:
			if l[i] == 0:
				sum += 1
				
if l[0] == 1:
	for i in range(len(l)):
		if i%2 == 0:
			if l[i] == 1:
				continue
			else:
				sum += 1
		else:
			if l[i] == 1:
				sum += 1

print(sum)

Measured memory_bytes: 4652
#include<bits/stdc++.h>
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3f
#define EPS (1e-10)
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef pair<int, int>P;

int a[100000];
signed main() {
	int n; scanf("%d", &n);
	rep(i, n)scanf("%d", &a[i]);
	//+,-,+,-...
	ll Min = 0;
	ll sum = 0;
	rep(i, n) {
		if (i % 2 == 0) {
			if (sum + a[i] <= 0) {
				Min += 1 - (sum + a[i]);
				sum = 1;
			}
			else sum += a[i];
		}
		else {
			if (sum + a[i] >= 0) {
				Min += abs(-1 - (sum + a[i]));
				sum = -1;
			}
			else sum += a[i];
		}
	}
	sum = 0;
	ll Max = 0;
	rep(i, n) {
		if (i % 2 == 1) {
			if (sum + a[i] <= 0) {
				Max += 1 - (sum + a[i]);
				sum = 1;
			}
			else sum += a[i];
		}
		else {
			if (sum + a[i] >= 0) {
				Max += abs(-1 - (sum + a[i]));
				sum = -1;
			}
			else sum += a[i];
		}
	}
	cout << min(Min, Max) << endl;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ul;
typedef signed long long ll;
ul over = 1000000007;

mt19937 mt(time(nullptr));
// uniform_int_distribution< int > rand_int(0, 10) // rand[0, 10] inclusive

int main(void)
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed;
  int n;
  cin >> n;
  for (int i=1; i*(i+1)<=n*2; ++i) {
    if (i*(i+1)==n*2) {
      cout << "Yes" << endl;
      cout << i+1 << endl;
      for (int j=0; j<i+1; ++j) {
        cout << i;
        int p = j;
        for (int k=0; k<j; ++k) {
          cout << " " << p;
          p += i-k-1;
        }
        for (int k=j; k<i; ++k) {
          p++;
          cout << " " << p;
        }
        cout << endl;
      }
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 1408
#include<stdio.h>

int a,b;

int main(void){
    scanf("%d %d",&a,&b);
    if(a > 12){
        printf("%d\n",b);
    }
    if(a <= 12 && a >= 6){
        printf("%d\n",b / 2);
    }

    if(a < 6){
        printf("0\n");
    }
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(int)(n); i++)

using namespace std;
typedef long long LL;

int main(){
	int N, M;
	cin >> N >> M;
	vector<int> A(N);
	rep(i,N) cin >> A[i];
	int sum=0;
	rep(i,N) sum+=A[i];
	sort(A.begin(),A.end(),greater<int>());
	if(A[M-1]*4*M<sum) cout << "No" << endl;
	else cout << "Yes" << endl;

	return 0;
}


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

using namespace std;

int main()
{
	string s;
	cin >> s;
	
	int n = s.length();
	int count = 0;
	
	for (int i = 0; i < n / 2; i++)
	{
		if (s[i] != s[n - 1 - i])
		{
			count++;
		}
	}
	cout << count;
	
	return 0;
}
	



Measured memory_bytes: 256
import java.io.*;

class Main{
	public static void main(String[] args) throws IOException{
	
		int x,y,ans1,ans2;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str[] = br.readLine().split(" ");
		x = Integer.parseInt(str[0]);
		y = Integer.parseInt(str[1]);
		ans1 = x*y;
		ans2 = (x+y)*2;
		System.out.println(ans1 + " " + ans2);
	}
}

Measured memory_bytes: 16896
#include <stdio.h>
long long n,d=1,ans=1;
long long sumof(long long x)
{
	long long sum=0;
	for (;x;x/=10) sum+=x%10;
	return sum;
}
int main()
{
	scanf("%lld",&n);puts("1");
	for (long long i=1;i<n;i++)
	{
		if ((ans+10*d)*sumof(ans+d)<(ans+d)*sumof(ans+10*d)) d*=10;
		ans+=d;printf("%lld\n",ans);
	}
	return 0;
}

Measured memory_bytes: 128
n=int(input())
x=[0]*n
y=[0]*n
for i in range(n):
  x[i],y[i]=map(int,input().split())
Sum=0
for i in range(n):
  for j in range(n):
    Sum += ((x[i]-x[j])**2+(y[i]-y[j])**2)**(1/2)
print(Sum/n)

Measured memory_bytes: 9376
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<cmath>
using namespace std;
typedef long long ll;
const int Nmax = 1000;
int N;
ll Xs,Ys,Xt,Yt,X[Nmax+2],Y[Nmax+2],R[Nmax+2];
double dist[Nmax+2];


int main(){
	cin >> Xs >> Ys >> Xt >> Yt;
	cin >> N;
	for(int i=1; i<N+1; i++){
		cin >> X[i] >> Y[i] >> R[i];
	}
	X[0] = Xs;
	Y[0] = Ys;
	R[0] = 0;
	X[N+1] = Xt;
	Y[N+1] = Yt;
	R[N+1] = 0;

	for(int i=0; i<N+2; i++){
		dist[i] = 1e18;
	}
	dist[0] = 0;

	priority_queue<pair<double, int>, vector<pair<double, int> >,
		greater<pair<double, int> > > que;
	que.push(make_pair(0,0));

	while(!que.empty()){
		double d = que.top().first;
		int n = que.top().second;
		que.pop();
		if(n == N+1) break;
		if(dist[n] < d) continue;
		for(int i=0; i<N+2; i++){
			if(n == i) continue;
			double dx = X[n]-X[i];
			double dy = Y[n]-Y[i];
			double di = max(0.0,sqrt(dx*dx+dy*dy)-R[n]-R[i]);
			if(d + di < dist[i]){
				dist[i] = d+di;
				que.push(make_pair(dist[i], i));
			}
		}
	}

	cout << setprecision(10) << dist[N+1] << endl;

	return 0;
}


Measured memory_bytes: 4464
#include<bits/stdc++.h>
#define ll long long
#define mp make_pair
#define pb push_back
using namespace std;
int main()
{
    ll n;
    cin>>n;
    ll k;
    cin >> k;
    ll arr[n];
    for(ll i = 0; i < n; i++)
        cin>>arr[i];
    vector<ll>ans(n, INT_MAX);
    ans[0] = 0;
    for(ll i = 1; i < n; i++)
    {
        for(ll j = 1; j <= k; j++)
        {
            if(i-j >= 0)
            ans[i] = min(ans[i], ans[i-j] + abs(arr[i] - arr[i-j]));
        }
    }
    cout<<ans[n-1];
}

Measured memory_bytes: 4732
#include <bits/stdc++.h>
#include<cmath>
using namespace std;
#define int long long int
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define mp make_pair
#define F first
#define S second
#define all(a) a.begin(),a.end()
#define endl '\n'
#define boost ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define mod 1000000007
#define inf 1e18
#define pf push_front
#define pob pop_back
#define pof pop_front
#define deb(x) cout<<#x<<" "<<x<<endl;
#define deb2(x,y) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<endl;
#define deb3(x,y,z) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<" "<<#z<<" "<<z<<endl;
#define file freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);

typedef pair<int,int> pi;
typedef pair<int,pair<int,int>> piii;
typedef vector<int> vi;
typedef vector<pi> vpi;
typedef vector<vi> vvi;

int32_t main()
{
   // boost
    int t=1;
    //cin>>t;
    while(t--)
    {
        int d,tt,s;
        cin>>d>>tt>>s;
        if(s>=((double)d/tt))
        cout<<"Yes"<<endl;
        else
        {
            cout<<"No"<<endl;

        }
        
    }


    

}

Measured memory_bytes: 3628
#include <iostream>
#include <fstream>
#include <vector>
#include <deque>
#include <set>
#include <map>
#include <unordered_map>
#include <list>
#include <array>
#include <cstdlib>
#include <stack>
#include <string>
#include <queue>
#include <chrono>
#include <functional>
#include <limits>
#include <cmath>
#include <algorithm>
#include <random>
#include <regex>
#include <tuple>
#include <utility>
#include <bitset>
#include <complex>
#include <iomanip>
#include <ostream>
#include <sstream>
#include <ctime>
using namespace std;
#define for0(i, n) for(int i = 0; i < n; i++)
#define for1(i, n) for(int i = 1; i <= n; i++)
#define pb push_back
#define mp make_pair
#define all(v) v.begin(), v.end()
#define V vector<int>
#define VP vector<pair<int, int> >
#define FASTIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define index INDEX
#ifndef ONLINE_JUDGE
#define print(x) PRINT(x, #x)
template<typename T> inline const void PRINT(T VARIABLE, const string& NAME) {
	cerr << NAME << " = " << fixed << VARIABLE << "\n";
}
#else
#define print(x) 0 
#endif
#ifdef RAND_MAX
#undef RAND_MAX
#endif
#define RAND_MAX 999999937 
int generate_random() {
	const int MAX_RANDOM = (int)1e6;
	mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
	return uniform_int_distribution<int>(0, MAX_RANDOM)(rng);
}
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const ll INFLL = 2 * (ll)1e18 + 100;
#define int ll
#ifdef int 
const int INFINT = INFLL;
#else
const int INFINT = 2 * (int)1e9 + 100;
#endif
const double PI = atan(1) * 4;
const double EPS = 1e-6;
const int SEED = (int)1e3 + 7;
const int MOD = (int)1e9 + 7;
const int NMAX = (int)1e6 + 5;

bool can_find[NMAX];
int parent[NMAX];

int find_parent(int nod)
{
	if (nod != parent[nod]) parent[nod] = find_parent(parent[nod]);
	return parent[nod];
}
bool can_find_dsu[NMAX];

int32_t main() {
#ifndef ONLINE_JUDGE
	double START_PROGRAM = clock();
#endif
	srand(time(0));
	cout << setprecision(20) << fixed;
	FASTIO;
	int n, m;
	cin >> n >> m;
	for1(i, n) parent[i] = i;
	for1(i, m)
	{
		int a, b, c;
		cin >> a >> b >> c;
		parent[find_parent(a)] = find_parent(b);
		find_parent(a);
		find_parent(parent[a]);
	}

	set<int> unique;
	for1(i, n) unique.insert(find_parent(i));
	cout << unique.size();






#ifndef ONLINE_JUDGE
	double END_PROGRAM = clock();
	double ELAPSED_TIME = (END_PROGRAM - START_PROGRAM) / CLOCKS_PER_SEC;
	cerr << "\n\nElapsed Time: " << ELAPSED_TIME * 1000 << "\n";
	system("pause");
#endif
	return 0;
}







Measured memory_bytes: 6008