akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
 
#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)
 
#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=(int)(a)-1;i>=(int)(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)
 
#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define bit(n) (1LL<<(n))
 
// #define DEBUG
 
#ifdef DEBUG
    #define dump(...) fprintf(stderr, __VA_ARGS__)
#else
    #define dump(...)
#endif
 
template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}
 
using namespace std;
using ll=long long;
using vi=vector<int>;
using vll=vector<ll>;
 
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int inf = INT_MAX;
const ll INF = LLONG_MAX;
const ll MOD = 1000000007LL;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
 
ll extgcd(ll a,ll b,ll& x,ll& y){x=1,y=0;ll g=a;if(b!=0) g=extgcd(b,a%b,y,x),y-=a/b*x;return g;}
ll ADD(const ll &a, const ll &b, const ll mod=MOD) { return (a+b)%mod;}
ll SUB(const ll &a, const ll &b, const ll mod=MOD) { return (a-b+mod)%mod;}
ll MUL(const ll &a, const ll &b, const ll mod=MOD) { return (1LL*a*b)%mod;}
ll DIV(const ll &a, const ll &b, const ll mod=MOD) {ll x,y; extgcd(b,mod,x,y);return MUL(a,(x+mod)%mod,mod);}
 
int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n; cin >> n;
    int D, X; cin >> D >> X;
    vi a(n); for(auto& e : a) cin >> e;

    int res = X;
    rep(i, n){
        int d = 1;
        while(d <= D){
            res++;
            d += a[i];
        }
    }

    cout << res << endl;

    return 0;
}


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

using namespace std;

int a[10][10],b[10][10],ans[10][10];
int dx[]={1,0,-1,0,0},dy[]={0,1,0,-1,0};

void init(void){
  for(int i=0;i<10;i++){
    for(int j=0;j<10;j++){
      b[i][j]=a[i][j];
      ans[i][j]=0;
    }
  }
}

void rev(int x, int y){
  for(int k=0;k<5;k++){

    int ny=y+dy[k],nx=x+dx[k];

    if( 0<=ny && 0<=nx && ny<10 && nx<10)
      b[ny][nx]=!b[ny][nx];
  }
}

int ok(void){
  for(int i=0;i<10;i++)
    for(int j=0;j<10;j++)
      if(b[i][j])return 0;
  return 1;
}

void solve(int p[]){
  init();

  for(int i=0;i<10;i++){
    if(p[i])rev(i,0);
    ans[0][i]=p[i];
  }
  for(int i=1;i<10;i++){
    for(int j=0;j<10;j++){
      if(b[i-1][j]){
	rev(j,i);
	ans[i][j]=1;
      }
    }
  }

  if(ok()){
    for(int i=0;i<10;i++){
      for(int j=0;j<10;j++){
	cout << ans[i][j];
	if(j<9)cout << " ";
      }
      cout << endl;
    }
  }
}

void func(int p[], int cnt){
  if(9<cnt)solve(p);
  else {
    p[cnt]=0;
    func(p,cnt+1);
    p[cnt]=1;
    func(p,cnt+1);
  }
}

int main(void){
  int n;

  cin >> n;

  while(n--){

    for(int i=0;i<10;i++)
      for(int j=0;j<10;j++)
	cin >> a[i][j];

    int p[10]={0};
    func(p,0);
  }

  return 0;
}

Measured memory_bytes: 1160
#include<bits/stdc++.h>
using namespace std;
#define itn int

int main(void){
    string s;
    cin >> s;
    for(int i = 0;i < s.size();i++){
        if(s[i] == '?'){
                cout << "D";
                s[i] = 'D';
        } else cout << s[i];
    }
}

Measured memory_bytes: 3768
// https://beta.atcoder.jp/contests/abc077
// status:
// tag:

#define SUBMIT
//#define DEBUG

#include <utility>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <queue>
#include <numeric>
#include <limits>
#include <cmath>

using namespace std;
using ui64 = unsigned long long;
using i64 = long long;

int N;

int main() {
#ifdef SUBMIT
    auto& stream = cin;
#else
    auto program_input = std::string(R"(10
)");
    stringstream stream(program_input);
#endif
    stream >> N;
    int s = static_cast<int>(sqrt(N));
    int ans = s * s;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define E 2.718
using namespace std;
typedef long long ll;
const ll INF=0x7f7f7f7f;
const int maxn=1e6+8;
const double eps=1e-10;
const ll mod=1000000007;
ll n,m,b;
struct node{
    int e,next;
}edge[maxn];
int head[maxn];
ll cot[maxn];
ll res[maxn];
ll cnt=0;
void addedge(int u,int v)
{
    edge[cnt]=node{v,head[u]};
    head[u]=cnt++;
    edge[cnt]=node{u,head[v]};
    head[v]=cnt++;
}
void dfs(int u,int fa,ll sum)
{
    res[u]=sum;
    for(int i=head[u];i!=-1;i=edge[i].next)
    {
        int e=edge[i].e;
        if(e!=fa)
            dfs(e,u,sum+cot[e]);
    }
}
int main()
{
    memset(head,-1,sizeof(head));
    scanf("%lld%lld",&n,&m);
    for(int i=1;i<=n-1;i++)
    {
        int x,y;
        scanf("%d%d",&x,&y);
        addedge(x,y);
    }
    for(int i=1;i<=m;i++)
    {
        ll x,y;
        scanf("%lld%lld",&x,&y);
        cot[x]+=y;
    }
    addedge(0,1);
    dfs(0,-1,0);
    for(int i=1;i<=n;i++)
        printf("%lld ",res[i]);

    return 0;
}


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

const int MAXN = 1000010;

int suffix_one[MAXN];
int suffix_zero[MAXN];

int main() {
	string s;
	cin >> s;
	int suffix_0 = 0;
	int suffix_1 = 0;
	for (int i = s.size(); i > 0; i--) {
		suffix_one[i] = suffix_1;
		suffix_zero[i] = suffix_0;
		if (s[i - 1] == '1') {
			suffix_1++;
			suffix_0--;
		}
		else if (s[i - 1] == '0') {
			suffix_1--;
			suffix_0++;
		}
		else {
			suffix_1--;
			suffix_0--;
		}
		suffix_1 = max(suffix_1, 0);
		suffix_0 = max(suffix_0, 0);
	}
	int left = 0, right = s.size();
	while (left < right) {
		bool flag = true;
		int mid = (left + right) / 2;	
		int allowed_1 = mid;
		int allowed_0 = mid;
		for (int i = 0; flag && i < s.size(); i++) {
			if (s[i] == '1') {
				if (allowed_1 <= 0) {
					flag = false;
				}
				allowed_1--;
				allowed_0++;
			}
			else if (s[i] == '0') {
				if (allowed_0 <= 0) {
					flag = false;
				}
				allowed_1++;
				allowed_0--;
			}
			else {
				int capacity_1 = allowed_1 - suffix_one[i + 1];
				int capacity_0 = allowed_0 - suffix_zero[i + 1];
				bool favor_1 = capacity_1 > capacity_0;
				if (capacity_1 == capacity_0 && allowed_1 > allowed_0) {
					favor_1 = true;
				}
				if (allowed_1 > 0 && allowed_1 - 1 >= suffix_one[i + 1] && favor_1) {
					allowed_1--;
					allowed_0++;
				}
				else if (allowed_0 > 0 && allowed_0 - 1 >= suffix_zero[i + 1]) {
					allowed_1++;
					allowed_0--;
				}
				else {
					flag = false;
					break;
				}
			}
			allowed_1 = min(allowed_1, mid);
			allowed_0 = min(allowed_0, mid);
		}
		if (flag) {
			right = mid;
		}
		else {
			left = mid + 1;
		}
	}
	cout << left << endl;
}

Measured memory_bytes: 11816
/*やったぜ。　投稿者：変態糞土方 (8月16日（水）07時14分22秒)

昨日の8月15日にいつもの浮浪者のおっさん（60歳）と先日メールくれた汚れ好きの土方のにいちゃん

（45歳）とわし（53歳）の3人で県北にある川の土手の下で盛りあったぜ。

今日は明日が休みなんでコンビニで酒とつまみを買ってから滅多に人が来ない所なんで、

そこでしこたま酒を飲んでからやりはじめたんや。

3人でちんぽ舐めあいながら地下足袋だけになり持って来たいちぢく浣腸を3本ずつ入れあった。

しばらくしたら、けつの穴がひくひくして来るし、糞が出口を求めて腹の中でぐるぐるしている。

浮浪者のおっさんにけつの穴をなめさせながら、兄ちゃんのけつの穴を舐めてたら、

先に兄ちゃんがわしの口に糞をドバーっと出して来た。

それと同時におっさんもわしも糞を出したんや。もう顔中、糞まみれや、

3人で出した糞を手で掬いながらお互いの体にぬりあったり、

糞まみれのちんぽを舐めあって小便で浣腸したりした。ああ～～たまらねえぜ。

しばらくやりまくってから又浣腸をしあうともう気が狂う程気持ちええんじゃ。

浮浪者のおっさんのけつの穴にわしのちんぽを突うずるっ込んでやると

けつの穴が糞と小便でずるずるして気持ちが良い。

にいちゃんもおっさんの口にちんぽ突っ込んで腰をつかって居る。

糞まみれのおっさんのちんぽを掻きながら、思い切り射精したんや。

それからは、もうめちゃくちゃにおっさんと兄ちゃんの糞ちんぽを舐めあい、

糞を塗りあい、二回も男汁を出した。もう一度やりたいぜ。

やはり大勢で糞まみれになると最高やで。こんな、変態親父と糞あそびしないか。

ああ～～早く糞まみれになろうぜ。

岡山の県北であえる奴なら最高や。わしは163*90*53,おっさんは165*75*60、や

糞まみれでやりたいやつ、至急、メールくれや。

土方姿のまま浣腸して、糞だらけでやろうや。*/
#include "bits/stdc++.h"
#include <numeric>
#define rep(i,n) for(int i = 0; i < n; i++)
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define llMAX numeric_limits<long long>::max()
#define intMAX numeric_limits<int>::max()
#define llMIN numeric_limits<long long>::min()
#define intMIN numeric_limits<int>::min()
#define d_5 100000
#define d9_7 1000000007
#define vll vector<vector<long long>>
#define vl vector<long long>
#define vi vector<int>
#define vii vector<vector<int>>
#define pb push_back
#define pf push_front
#define ld long double

int main(void){
  int n;
  cin>>n;
  vi c(n+1);
  rep(i,n){
    cin>>c[i+1];
  }
  c[0]=100005;
  vl dp(1+n,0);
  vl colors(300010,0);
  dp[0]=1;
  rep(i,n){
    if(c[i+1]!=c[i]){
      dp[i+1]=dp[i]+colors[c[i+1]];
      dp[i+1]%=d9_7;
      colors[c[i+1]]+=dp[i];
    }else{
      dp[i+1]=dp[i];
    }

  }
  cout<<dp[n]<<endl;
  return 0;
}


Measured memory_bytes: 4992
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <iomanip>
#include <stack>
#include <set>
#include <map>
#include <queue>

using namespace std;

typedef long long int ll;
typedef pair<int, int> Pii;

const ll MOD = 1000000007;
const ll inf = (ll) 1e18;

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

  int n;
  cin >> n;
  vector<int> l(n);
  for (auto &x: l) cin >> x;

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

  int ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = i+1; j < n; j++) {
      int ab = l[i] + l[j];
      int ba = l[j] - l[i];
      // c < a + b
      auto up = lower_bound(l.begin() + j, l.end(), ab);
      int d1 = distance(l.begin() + j, up);
      // a - b > c
      // b - a > c
      auto down = lower_bound(l.begin() + j, l.end(), ba);
      int d2 = distance(l.begin() + j, down);
      ans += max(0, d1 - d2 - 1);
    }
  }

  cout << ans << endl;

  return 0;
}


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

#define vi vector<int>
#define vl vector<long long>
#define vvi vector< vector<int> >
#define vvl vector< vector<ll> >
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REPD(i, n) for (int i = (int)(n-1); i >= 0; i--)
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define FORD(i, a, b) for (int i = (int)(a); i >= (int)(b); i--)
#define INF 1e18
#define MOD 1e9+7

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

const int MAX_N = 110;
vector < vector<int> > G;
int d[MAX_N];

void bfs(int s) {
    d[s] = 0;
    queue<int> q;
    q.push(s);
    while (!q.empty()) {
        int u = q.front(); q.pop();
        REP(i, (int)G[u].size()) {
            int v = G[u][i];
            if (d[v] != -1) continue;
            d[v] = d[u]+1;
            q.push(v);
        }
    }
}

int main() {
    int n;
    cin >> n;
    G.resize(n);
    REP(i, n) {
        d[i] = -1;
        int u, k;
        cin >> u >> k;
        --u;
        REP(j, k) {
            int v;
            cin >> v;
            --v;
            G[u].push_back(v);
        }
    }

    bfs(0);
    REP(i, n) {
        cout << i+1 << ' ' << d[i] << endl;
    }
}


Measured memory_bytes: 3168
#include<iostream>
#include<stack>
#include<vector>
#include<queue>
#include<deque>
#include<string>
#include<map>
#include<unordered_map>
#include<set>
#include<algorithm>
#include <cstdlib>
#include<unordered_set>
#include<cmath>
#include<list>
#include<functional>
#include<cmath>
#include <iostream>
#include <fstream>
using namespace std;

int main() {
	int t5 = 0;
	int t7 = 0;
	for (int i = 0; i < 3; i++) {
		int n;
		cin >> n;
		if (n == 5) {
			t5++;
		}
		else {
			t7++;
		}
	}
	string seg = (t5 == 2 && t7 == 1) ? "YES" : "NO";
	cout << seg << endl;
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main() {
  int n,a,b;
  scanf("%d%d%d",&n,&a,&b);
  int q = (a-b)%2;
  if (q == 0) {
    printf("Alice\n");
  } else {
    printf("Borys\n");
  }
  return 0;
}


Measured memory_bytes: 128
import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    String s = scanner.next();
    if(s.charAt(2) == s.charAt(3) && s.charAt(4) == s.charAt(5)){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  }
}

Measured memory_bytes: 21844
# -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [input() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [int(input()) for i in range(n)]


class Math():
    @staticmethod
    def gcd(a, b):
        if b == 0:
            return a
        return Math.gcd(b, a % b)

    @staticmethod
    def lcm(a, b):
        return (a * b) // Math.gcd(a, b)

    @staticmethod
    def roundUp(a, b):
        return -(-a // b)

    @staticmethod
    def toUpperMultiple(a, x):
        return Math.roundUp(a, x) * x

    @staticmethod
    def toLowerMultiple(a, x):
        return (a // x) * x

    @staticmethod
    def nearPow2(n):
        if n <= 0:
            return 0
        if n & (n - 1) == 0:
            return n
        ret = 1
        while(n > 0):
            ret <<= 1
            n >>= 1
        return ret

    @staticmethod
    def isPrime(n):
        if n < 2:
            return False
        if n == 2:
            return True
        if n % 2 == 0:
            return False
        d = int(n ** 0.5) + 1
        for i in range(3, d + 1, 2):
            if n % i == 0:
                return False
        return True


MOD = int(1e09) + 7


def main():
    # sys.stdin = open("sample.txt")
    S = Scanner.string()
    K = Scanner.int()
    m = []
    N = len(S)
    for i in range(N):
        for j in range(i, min(i+K, N)):
            m.append(S[i: j + 1])
    m = sorted(set(m))
    print(m[K-1])


if __name__ == "__main__":
    main()


Measured memory_bytes: 41584
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define tcase int _; cin >> _; while(_--)
const int MAX = 1e6;

int n;

void solve() {
	cin >> n;
	if(n % 1000) cout << 1000-n%1000;
	else cout << 0;
}

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

 	solve();

  	return 0;
}



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

int main(){
  string s;
  cin >> s;
  if(s[0]==s[1]){
    cout << "Bad" << endl;
  }
  else if(s[1]==s[2]){
    cout << "Bad" << endl;
  }
  else if(s[2]==s[3]){
    cout << "Bad" << endl;
  }
  else if(s[0]==s[1] && s[0]==s[2] && s[0]==s[3]){
    cout << "Bad" << endl;
  }
  else{
    cout << "Good" << endl;
  }
    
//aaab
//aaba
//abaa
//baaa


}

Measured memory_bytes: 256
use std::str::FromStr;
use std::fmt::Debug;
use std::cmp;
#[allow(dead_code)]
fn read_as_vec<T>() -> Vec<T>
where T: FromStr, <T as FromStr>::Err : Debug{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().split_whitespace().map(|c| T::from_str(c).unwrap()).collect()

}

#[allow(dead_code)]
fn read_as_string() -> String{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

fn main(){
    let dummy = std::usize::MAX;
    let line = read_as_vec::<usize>();
    let (n, k) = (line[0], line[1]);
    let a = read_as_vec::<usize>().into_iter().map(|x| x-1).collect::<Vec<usize>>();
    let mut an: Vec<usize> = vec![dummy;n];
    let mut cur: usize = 0;

    let (mut ls, mut le) = (dummy, dummy);
    for i in 0..k{
        if an[cur] == dummy{
            an[cur] = i;
            cur = a[cur];
        }else{
            ls = an[cur];
            le = i;
            break;
        }
    }

    if ls == dummy{
        println!("{}", cur+1);
        return;
    }

    let rest = (k-ls)%(le-ls);
    for _ in 0..rest{
        cur = a[cur];
    }
    println!("{}", cur+1);

}


Measured memory_bytes: 5264
n, m = map(int, input().split())
if n >= m:
  ans = 0
else:
  x = list(map(int, input().split()))
  x.sort()
  d = [x[i] - x[i-1] for i in range(1,m)]
  d.sort()
  ans = sum(d[:m-n])
print(ans)

Measured memory_bytes: 13960
#include<iostream>
#include<vector>
#include<map>
#include<set>
#include<cassert>
#include<cassert>
#include<unordered_map>
#include<unordered_set>
#include<functional>
#include<queue>
#include<stack>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<sstream>
#include<iomanip>
#include<cstdio>
#include<cstdlib>
#include<numeric>
#include<random>
#include<chrono>
#include<bitset>
using namespace std;

#define all(x) (x).begin(), (x).end()
#define pb push_back
#define xx first
#define yy second
#define sz(x) (int)(x).size()
#define gc getchar
#define IO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define mp make_pair

#ifndef ONLINE_JUDGE
#  define LOG(x) (cerr << #x << " = " << (x) << endl)
#else
#  define LOG(x) ((void)0)
#endif

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

const double PI=3.1415926535897932384626433832795;
const ll INF = 1LL<<62;
const ll MINF = -1LL<<62;

template<typename T> T getint() {
	T val=0;
	char c;
	
	bool neg=false;
	while((c=gc()) && !(c>='0' && c<='9')) {
		neg|=c=='-';
	}

	do {
		val=(val*10)+c-'0';
	} while((c=gc()) && (c>='0' && c<='9'));

	return val*(neg?-1:1);
}

//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); uniform_int_distribution<int>(0, n-1)(rng)

const ll mod=1e9+7;
ll fp(ll a, ll b) {
	if(b==0) return 1;
	ll fele=fp(a,b/2);
	ll ans=fele*fele%mod;
	if(b&1) ans=ans*a%mod;
	return ans;
}
ll pre[100001];
int main() {
	IO;
	ll n,k;
	cin>>n>>k;
	ll ans=0;
	for(ll i=1;i<=k;++i) {
		ll kell=i-pre[i];
		for(ll j=i;j<=k;j+=i) {
			pre[j]+=kell;
		}
		
		ans+=(kell)*fp(k/i, n)%mod;
		ans%=mod;
	}
	
	
	cout<<ans<<"\n";
	
	return 0;
}


Measured memory_bytes: 4428
#include <stdio.h>
#include <math.h>
int main(){
	double a, b, c, d, e, f;
	double x, y, det;
	
	while( scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF){
		det = a * e - b * d;
		if( det != 0 ){
			x = ( e * c - b * f ) / det;
			y = ( a * f  - c * d) / det;
			if( x == fabs(x)){
				x = fabs(x);
			}
			if( y == fabs(y)){
				y = fabs(y);
			}
			printf("%.3f %.3f\n", x, y);
		}
	}
	return 0;
}

Measured memory_bytes: 652
#!/usr/bin/env python3

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(A: int, B: int, C: int, D: int):
    while True:
        # 高橋
        C -= B
        if C <= 0:
            return YES
        # 青木
        A -= D
        if A <= 0:
            return NO


def main():
    A, B, C, D = map(int, input().split())
    answer = solve(A, B, C, D)
    print(answer)


if __name__ == "__main__":
    main()


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

using namespace std;
#define  ll long long
#define ld long double
#define f first
#define s second
ld pi = acos(-1);

int main()
{

    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    ld n;
    cin >> n;
    cout << fixed << setprecision(9) << (ld)2*n*pi << '\n';



    return 0;
}

Measured memory_bytes: 3804
import math

N = int(input().split()[0])

# if (N - 1) % 2 == 0:
#     ans = int(N * ((N - 1) / 2))
# else:
#     mean_v = math.floor((N - 1) / 2) + 1
#     ans = int(N * math.floor((N - 1) / 2))
#     ans += mean_v

ans = N * (N-1) // 2

print(ans)


Measured memory_bytes: 2940
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int a[] = new int[n];

		for(int i = 0; i < n; i++){
			a[i] = sc.nextInt();
		}

		Arrays.sort(a);

		boolean[] valid = new boolean[n];
		Arrays.fill(valid, true);

		boolean[] dp = new boolean[1_000_001];
		Arrays.fill(dp, true);
		for(int i = 0; i < n; i++){
			if(!dp[a[i]]){
				continue;
			}
			if(i != 0 && a[i - 1] == a[i]){
				continue;
			}
			else{
				for(int j = 2; j*a[i] < dp.length; j++){
					dp[a[i]*j] = false;
				}
			}
		}
		for(int i = 0; i < n; i++){

			if(i != n - 1 && a[i] == a[i + 1]){
				valid[i] = false;
			}
			if(i != 0 && a[i] == a[i - 1]){
				valid[i] = false;
			}

			if(!dp[a[i]]){
				valid[i] = false;
			}
		}

//		if(n >= 2 && a[0] == a[1]){
//			valid[0] = false;
//		}

		int count = 0;
		for(int i = 0; i < n; i++){
			if(valid[i]){
//				System.out.println(a[i]);
				count++;
			}
		}

		System.out.println(count);
	}
}


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

using namespace std;

int checkeven(string a) {
	for (int i = 0; i < a.size()/2; i++) {
		if (a[i] != a[a.size()/2+i]) { return 1; }
	}
	return 0;
}

int main() {

	string s;
	cin >> s;

	while (1) {
		s.pop_back();
		s.pop_back();
		if (checkeven(s) == 0) {
			cout << s.size() << endl;
			return 0;
		}
	}
	cout << 0 << endl;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(int argc, char const *argv[]){
   int a,b,p;
   cin >> a >> b;
   if(a <= 0 && b >= 0){
      cout << "Zero" << endl;
   }else if((a < 0 && b < 0) && ((a+b)%2 == 0)){
      cout << "Negative" << endl;
   }else{
      cout << "Positive" << endl;
   }
   return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
    int h,w;
    char a[110][110];
    cin>>h>>w;
    for(int i=0;i<h;i++)
    {
        scanf("%s",&a[i]);
    }
    for(int i=0;i<h;i++)
    {
        printf("%s\n",a[i]);
        printf("%s\n",a[i]);
    }
    return 0;
}


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

using namespace std;

#define ll long long
constexpr ll inf = 1e9+7;

ll solve(vector<ll> As, bool flag) {
    ll ans = 0;
    ll sum = 0;
    for (auto A : As) {
        sum += A;
        if (flag && sum <= 0) { ans += 1 - sum; sum = 1; }
        else if (!flag && sum >= 0) { ans += 1 + sum; sum = -1; }
        flag = !flag;
    }
    return ans;
}

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

    ll N;
    cin>>N;
    vector<ll> A(N);
    for (ll n = 0; n < N; n++) cin>>A[n];

    cout<<min(solve(A, false), solve(A, true))<<endl;
    return 0;
}

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

#define rep(i, n) for(int i = 0; i<(n); i++)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
using ll = long long;

// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 1000000007;

struct mint {
    ll x; // typedef long long ll;
    mint(ll x = 0) : x((x % mod + mod) % mod) {}

    mint operator-() const { return mint(-x); }

    mint &operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }

    mint &operator-=(const mint a) {
        if ((x += mod - a.x) >= mod) x -= mod;
        return *this;
    }

    mint &operator*=(const mint a) {
        (x *= a.x) %= mod;
        return *this;
    }

    mint operator+(const mint a) const {
        mint res(*this);
        return res += a;
    }

    mint operator-(const mint a) const {
        mint res(*this);
        return res -= a;
    }

    mint operator*(const mint a) const {
        mint res(*this);
        return res *= a;
    }

    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1) a *= *this;
        return a;
    }

    // for prime mod
    mint inv() const {
        return pow(mod - 2);
    }

    mint &operator/=(const mint a) {
        return (*this) *= a.inv();
    }

    mint operator/(const mint a) const {
        mint res(*this);
        return res /= a;
    }
};

struct combination {
    vector<mint> fact, ifact;

    combination(int n) : fact(n + 1), ifact(n + 1) {
        fact[0] = 1;
        for (int i = 1; i <= n; ++i) fact[i] = fact[i - 1] * i;
        ifact[n] = fact[n].inv();
        for (int i = n; i >= 1; --i) ifact[i - 1] = ifact[i] * i;
    }

    mint operator()(int n, int k) {
        if (k < 0 || k > n) return 0;
        return fact[n] * ifact[k] * ifact[n - k];
    }
} comb(2000005);

mint f(int n, int k) {
    if (n < 0) return 0;
    // nPk = nCk * k!
    mint res = comb(n, k);
    res *= comb.fact[k];
    return res;
}

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

    vector<int> cnt(N + 1);
    cnt[0] = 3;
    mint ans = 1;
    rep(i, N) {
        if (!cnt[a[i]]) {
            cout << 0 << endl;
            return 0;
        }

        ans *= cnt[a[i]];
        cnt[a[i]]--;
        cnt[a[i] + 1]++;
    }

    cout << ans.x << endl;
}


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

int main() {
	int n,tmp;
	cin >> n;
	vector<int> ans(10500,0);
	for (int i = 1; i < 105; i++) {
		for (int j = 1; j < 105; j++) {
			for (int k = 1; k < 105; k++) {
				tmp = i * i + j * j + k * k + i * j + j * k + k * i;
				if (tmp <= 10050) {
					ans.at(tmp) = ans.at(tmp)+ 1;
				}
			}
		}
	}
	for (int i = 0; i < n; i++) {
		cout << ans.at(i+1) << endl;
	}
}


Measured memory_bytes: 3560
#include <iostream>
#include <cstdio>
#include <cstring>
#include <ctype.h>
#include <algorithm>
#define mp make_pair

using namespace std;

typedef long long LL;
typedef pair<int, int> pii;
typedef pair<int, LL> pil;

template<typename T> inline T read() {
	T res = 0, flag = 1; char in = getchar();
	while(!isdigit(in)) { if(in == '-') flag = -1; in = getchar(); }
	while(isdigit(in)) { res = (res << 1) + (res << 3) + in - '0'; in = getchar(); }
	return res * flag;
}

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


int main() {

	int n = read<int>();
	int k = read<int>();
	if(k == 1) printf("0\n"), exit(0);
	printf("%d\n", n - k);

	return 0;
}



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

int main()
{
    int64_t N;
    cin >> N;
    vector<int> A_vec(N), B_vec(N), C_vec(N);
    for (int i = 0; i < N; ++i)
        cin >> A_vec.at(i);
    for (int i = 0; i < N; ++i)
        cin >> B_vec.at(i);
    for (int i = 0; i < N; ++i)
        cin >> C_vec.at(i);
    sort(A_vec.begin(), A_vec.end());
    sort(B_vec.begin(), B_vec.end());
    sort(C_vec.begin(), C_vec.end());
    int64_t cnt = 0;
    int64_t idx_A = 0, idx_C = 0;
    for (int i = 0; i < N; ++i) {
        int B = B_vec.at(i);
        while (idx_A < N && A_vec.at(idx_A) < B)
            ++idx_A;
        while (idx_C < N && C_vec.at(idx_C) <= B)
            ++idx_C;
        cnt += idx_A * (N - idx_C);
    }
    cout << cnt << endl;
}


Measured memory_bytes: 4552
#include <iostream>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;

int main(void) {
  ios::sync_with_stdio(false);
  string S;
  cin >> S;
  int K;
  cin >> K;

  int N = S.size();
  rep(i, N) {
    if (S[i] == 'a') continue;
    int ops = 'z' - S[i] + 1;
    if (ops <= K) {
      S[i] = 'a';
      K -= ops;
      if (K == 0) break;
    }
  }
  if (K) {
    S[N - 1] += (K % 26);
  }
  cout << S << endl;
  return 0;
}


Measured memory_bytes: 592
//ishan.nitj
#include<bits/stdc++.h>
using namespace std;
#define dbg(x) cout << #x << " =  " << x << endl;
#define dbg2(x, y) cout << #x << " =  " << x << " " << #y << " =  " << y << endl;
#define N 200005
#define MX 30
#define int long long

int a[N], b[N], a_[N], b_[N];
int n;
int bit[MX];

int query(int lo, int hi) {
    int st = lower_bound(b_ + 1, b_ + n + 1, lo) - (b_);
    int en = upper_bound(b_ + 1, b_ + n + 1, hi) - (b_ + 1);
    return (en - st + 1);
}

signed main() {
    cin >> n;
    for(int i = 1; i <= n; i++)
        cin >> a[i];

    for(int i = 1; i <= n; i++)
        cin >> b[i];

    for(int j  = 0; j < MX; j++) {
        int mod = (1 << (j + 1));

        for(int i = 1; i <= n; i++)
            a_[i] =  a[i] % mod;

        for(int i = 1; i <= n; i++)
            b_[i] =  b[i] % mod;

        sort(a_ + 1, a_ + 1 + n);
        sort(b_ + 1, b_ + 1 + n);

        for(int i = 1; i <= n; i++) {
            int lo = (1 << j);
            int hi = (1 << (j+1)) - 1;
            lo -= a_[i];
            hi -= a_[i];
            bit[j] += query(lo, hi);

            lo = 3*(1<<j);
            hi = (1<<(j+2)) - 1;

            lo -= a_[i];
            hi -= a_[i];
            bit[j] += query(lo, hi);
        }
    }
    int ans = 0;
    for(int i = 0; i < MX; i++) {
        if(bit[i]%2 == 1)
            ans = ans + (1 << i);
    }
    cout << (ans);
}



Measured memory_bytes: 6528
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
//#define EACH(i, c) for (auto &(i): c)
#define all(c) begin(c),end(c)
//#define EXIST(s, e) ((s).find(e)!=(s).end())
//#define SORT(c) sort(begin(c),end(c))
//#define pb emplace_back
//#define MP make_pair
//#define SZ(a) int((a).size())

//#define LOCAL 0
//#ifdef LOCAL
//#define DEBUG(s) cout << (s) << endl
//#define dump(x)  cerr << #x << " = " << (x) << endl
//#define BR cout << endl;
//#else
//#define DEBUG(s) do{}while(0)
//#define dump(x) do{}while(0)
//#define BR
//#endif


//改造
typedef long long int ll;
using namespace std;
#define INF (1 << 30) - 1
#define INFl (ll)5e15
#define DEBUG 0 //デバッグする時1にしてね
#define dump(x)  cerr << #x << " = " << (x) << endl
#define MOD 1000000007
//ここから編集する


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a,b;
    cin >> a >> b;
    if(b == 100) b += 1;

    int ret = 1;
    rep(i,0,a) ret *= 100;
    ret *= b;
    cout << ret << endl;


    return 0;
}


Measured memory_bytes: 888
#include <bits/stdc++.h>
using namespace std;
#define SELECTER(_1, _2, _3, SELECT, ...) SELECT
#define REP1(i, n) for(int i=0; (i)<(n); (i)++)
#define REP2(i, a, b) for(int i=(a); (i)<(b); (i)++)
#define REP(...) SELECTER(__VA_ARGS__, REP2, REP1,) (__VA_ARGS__)
#define MOD 1'000'000'007

template <class T> ostream& operator<<(ostream& os, const vector<T>& v){ os << "{"; for(size_t i=0; i<v.size(); i++) os << v[i] << (i+1==v.size() ? "" : ", "); os << "}"; return os; }
template <class T, class U> ostream& operator<<(ostream& os, const pair<T, U>& p){ return os << "{" << p.first << ", " << p.second << "}"; }

int main(){
    int N;
    cin >> N;
    vector<int> A(N);
    REP(i, N) cin >> A[i];

    map<int, int> mp;
    REP(i, N) mp[A[i]]++;

    sort(A.begin(), A.end());
    vector<bool> B(1000001);
    int ans = 0;
    REP(i, N){
        if(!B[A[i]] && mp[A[i]] == 1) ans++;
        if(!B[A[i]]){
            for(int x=A[i]; x<=1000000; x+=A[i]){
                B[x] = true;
            }
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 13460
#include <bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define ll long long
#define mod 1000000007
#define INF (ll)1e19
#define N 200005

using namespace std;

int n, m, x, y, a[N], d[N], c, k;

int main() {
    //freopen("txt.in", "r", stdin);
    //freopen("txt.out", "w", stdout);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin >> n >> m;
    a[1] = 1;
    for (int i = 1; i <= n; i++)
        d[i] = 1;
    while(m--) {
        cin >> x >> y;
        if (a[x]) a[y] = 1;
        d[x]--;
        d[y]++;
        if (!d[x]) a[x] = 0;
    }
    for (int i = 1; i <= n; i++)
        c += a[i];
    cout << c<< endl;

	return 0;
}


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

int main() {
  string s;
  cin >> s;
  
  string ans;
  string rei = "0";
  string ichi = "1";
  int nagasa;
  for( int i = 0; i < s.size(); i++ ){
    if( s.at(i) == '0' ){
      ans += rei;
    }else if( s.at(i) == '1' ){
      ans += ichi;
    }else if( s.at(i) == 'B' ){
      nagasa = ans.size();
      if( nagasa == 0 ){
        continue;
      }else{
        ans.erase(ans.end()-1);
      }
    }
  }
  cout << ans << endl;
  
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod=1000000007;
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,a,b) for(int i=a;i<b+1;i++)
#define Per(i,b,a) for(int i=b;i>=a;i--)

int N,T;
vector<pair<int,int>> vec;
int dp[3001][3000];

int main(){
    cin>>N>>T;
    int a,b;
    rep(i,N){
        cin>>a>>b;
        vec.push_back(make_pair(a,b));
    }
    sort(vec.begin(),vec.end());
    rep(j,T) dp[0][j] = 0;
    rep(i,N){
        int a = vec[i].first;
        int b = vec[i].second;
        rep(j,T){
            if(j<a) dp[i+1][j] = dp[i][j];
            else dp[i+1][j] = max(dp[i][j],dp[i][j-a]+b);
        }
    }
    int ans = 0;
    rep(i,N){
        ans = max(ans,dp[i][T-1]+vec[i].second);
    }
    cout<<ans<<endl;
    
    return 0;
}

Measured memory_bytes: 35456
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;

#define ll long long
#define vi vector<int>
#define vll vector<ll>
#define frw(i, a, b) for(int i = a; i < b; i++)
#define fi first
#define se second
#define pb push_back
#define in insert
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define sz(a) int(a.size())
#define pii pair<int, int>
#define piii pair<int, pii>
#define pll pair<ll, ll>
#define plll pair<ll, pll>
#define vpii vector<pii>
#define vpiii vector<piii>
#define vpll vector<pll>
#define vplll vector<plll>
#define mo 1000000007
#define mems(a,x) memset(a,x,sizeof(a))
inline ll modpow(ll x,ll n){if(n==0)return 1;if(n==1)return(x%mo);ll u=(modpow(x,n/2));u=(u*u)%mo;if(n%2!=0)u=(u*x%mo)%mo;return u;}
inline ll modinv(ll x){return modpow(x,mo-2);}
inline ll madd(ll a, ll b){if(a>=mo)a=a%mo;if(b>=mo)b=b%mo;if(a+b>=mo)return(a+b)%mo;return(a+b);}
inline ll msub(ll a, ll b){if(a>=mo)a=a%mo;if(b>=mo)b=b%mo;return(((a-b)%mo+mo)%mo);}
inline ll mmul(ll a,ll b){    if(a>=mo)a=a%mo;if(b>=mo)b=b%mo;if(a*b>=mo)return(a*b)%mo;return(a*b);}
inline ll mdiv(ll a,ll bb){if(a>=mo)a=a%mo;ll b=modinv(bb);if(b>=mo)b=b%mo;if(a*b>=mo)return(a*b)%mo;return(a*b);}



int main() 
{ 
	
	int n;
	cin>>n;
	ll v[n];
	for(int i=0;i<n;i++)
		cin>>v[i];
	ll dp[n];
	
	for(int i=0;i<n;i++)
		dp[i]=mo;
	dp[0]=0;
	for(int i=0;i<n;i++)
	{
		if(i+1<n)
		{
			dp[i+1]=min(dp[i+1],dp[i]+abs(v[i]-v[i+1]));
		}
		if(i+2<n)
		{
			dp[i+2]=min(dp[i+2],dp[i]+abs(v[i]-v[i+2]));
		}

	}
	cout<<dp[n-1];

} 

Measured memory_bytes: 1792
package main

// https://atcoder.jp/contests/agc003/tasks/agc003_b
//

import (
	"fmt"
)

func less(i, j int) bool {
	return i < j
}

func solve(a []int) {
	count := 0
	for i := 0; i < len(a); i++ {
		count += a[i] / 2

		if a[i]%2 == 1 && (i+1 < len(a) && a[i+1] != 0) {
			count++
			a[i+1]--
		}
	}
	fmt.Printf("%v\n", count)
}

func main() {
	var n int
	var a []int
	fmt.Scanf("%d\n", &n)
	for i := 0; i < n; i++ {
		var ta int
		fmt.Scanf("%d\n", &ta)
		a = append(a, ta)
	}
	solve(a)
}


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

int gcd(int a, int b){
  if(b % a == 0) return a;
  return gcd(b, a%b);
}

int main() {
  int n;
  cin >> n;
  long long ans = 0;
  for(int i = 1; i <= n; i++){
    for(int j = 1; j <= n; j++){
      for(int k = 1; k <= n; k++){
        int temp = gcd(i,j);
        ans += gcd(temp, k);
      }
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3636
#include<iostream>
#include<string>
#include<stdio.h>
#include<cctype>
#include<algorithm>
#include<climits>
#include<cmath>
#include<map>
#include<vector>
#define INF INT_MAX
using namespace std;

int x,X;
int tmp;
int ans;
string s;

int main() {
	cin >> x;
	tmp = x / 500;
	ans = tmp * 1000;

	X = x % 500;
	tmp = X / 5;
	ans += tmp * 5;
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;using ll=long long;using uint=unsigned int;using pii=pair<int,int>;using pll=pair<ll,ll>;using ull = unsigned long long;using ld=long double;template<typename T>void _(const char*s,T h){cerr<<s<<" = "<<h<<"\n";}template<typename T,typename...Ts>void _(const char*s,T h,Ts...t){int b=0;while(((b+=*s=='(')-=*s==')')!=0||*s!=',')cerr<<*s++;cerr<<" = "<<h<<",";_(s+1,t...);}// break continue pop_back 998244353
#define int ll
#define pii pll
#define f first
#define s second
#define pb emplace_back
#define forn(i,n) for(int i=0;i<(n);++i)
#define sz(a)((int)(a).size())
#define sqr(x) ((x)*(x))
struct init{init(){cin.tie(0);iostream::sync_with_stdio(0);cout<<fixed<<setprecision(10);cerr<<fixed<<setprecision(5);}~init(){
#ifdef LOCAL
#define dbg(...) _(#__VA_ARGS__,__VA_ARGS__)
cerr<<"Time elapsed: "<<(double)clock()/CLOCKS_PER_SEC<<"s.\n";
#else
#define dbg(...) 
#endif
}}init;template<typename T,typename U>void upx(T&x,U y){if(x<y)x=y;}template<typename T,typename U>void upn(T&x,U y){if(x>y)x=y;}mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());const int D=4,dx[]={+1,0,-1,0},dy[]={0,+1,0,-1};
const int N=2020;
int a[N][N],el[N][N],eu[N][N],p[N][N];
int32_t main(){
    int n,m,q;
    cin>>n>>m>>q;
    for(int i=1;i<=n;++i){
        string s;cin>>s;s="#"+s;
        for(int j=1;j<=m;++j){
            a[i][j]=s[j]-'0';
            int pl=a[i][j]&a[i][j-1];
            int pu=a[i][j]&a[i-1][j];
            p[i][j]=p[i-1][j]+p[i][j-1]-p[i-1][j-1]+a[i][j];
            el[i][j]=el[i-1][j]+el[i][j-1]-el[i-1][j-1]+pl;
            eu[i][j]=eu[i-1][j]+eu[i][j-1]-eu[i-1][j-1]+pu;
        }
    }
    while(q--){
        int x1,y1,x2,y2;
        cin>>x1>>y1>>x2>>y2;
        int v=p[x2][y2]-p[x2][y1-1]-p[x1-1][y2]+p[x1-1][y1-1];
        int e=el[x2][y2]-el[x2][y1]-el[x1-1][y2]+el[x1-1][y1]+
            eu[x2][y2]-eu[x2][y1-1]-eu[x1][y2]+eu[x1][y1-1];
        cout<<v-e<<'\n';
    }
    return 0;
}

Measured memory_bytes: 129956
import sys
from collections import defaultdict
from collections import deque
import numpy as np
import heapq
from heapq import heappush, heappop


#read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 7)

a, b = map(int, input().split())


big = 0
small = 0

if a > b:
    big = a
    small = b
else:
    big = b
    small = a

ans = [str(small)] * big
ans = ''.join(ans)

print(ans)


Measured memory_bytes: 21140
use std::io::Read;
use std::collections::VecDeque;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let answer = solve(&buf);

    println!("{}", answer);
}

const INF: isize = 100_001;

fn solve(input: &str) -> String {
    let mut iterator = input.split_whitespace();

    let n: isize = iterator.next().unwrap().parse().unwrap();
    let x: isize = iterator.next().unwrap().parse().unwrap();
    let y: isize = iterator.next().unwrap().parse().unwrap();

    let x = x - 1;
    let y = y - 1;

    let mut counts: Vec<usize> = vec![0; (n + 1) as usize];

    for sv in 0..n {
        let mut dist: Vec<isize> = vec![INF; n as usize];
        let mut q: VecDeque<isize> = VecDeque::new();

        dist[sv as usize] = 0;
        q.push_back(sv);

        while !q.is_empty() {
            let v = q.pop_front().unwrap();
            let d = dist[v as usize];
            if v - 1 >= 0 {
                if dist[(v - 1) as usize] == INF {
                    dist[(v - 1) as usize] = d + 1;
                    q.push_back(v - 1);
                }
            }
            if v + 1 < n {
                if dist[(v + 1) as usize] == INF {
                    dist[(v + 1) as usize] = d + 1;
                    q.push_back(v + 1);
                }
            }
            if v == x {
                if dist[y as usize] == INF {
                    dist[y as usize] = d + 1;
                    q.push_back(y);
                }
            }
            if v == y {
                if dist[x as usize] == INF {
                    dist[x as usize] = d + 1;
                    q.push_back(x);
                }
            }
        }

        for i in 0..n {
            counts[dist[i as usize] as usize] += 1;
        }
    }

    let mut ans = String::new();
    for i in 1..n {
        ans.push_str(&format!("{}\n", counts[i as usize] / 2))
    }
    return ans.trim().to_string();
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
#define endl '\n'
#define fast ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define zy -2147382637
#define bql 2147483647
#define ll long long
#define ull unsigned long long
#define ld long double
#define il inline
#define sz(x) x.size()
#define maxn 100010
#define rp(i, l, r) for (int i = l; i <= r; i++)
#define rb(i, r, l) for (int i = r; i >= l; i--)
#define fi first
#define se second
#define pb push_back
#define mp make_pair

using namespace std;
ll max(ll a,ll b){if(a>b)return a;else return b;}
ll min(ll a,ll b){if(a<b)return a;else return b;}
ll lowbit(ll x){return x&(-x);}
ll prime(ll x){
   if(x<=1)return false;
   for(int i=2;i<=int(sqrt(x));i++){
       if(x%i==0)return false;
   }return true;
}bool cmp(ll a,ll b){return a>b;}
ll gcd(ll a,ll b){ll r;while(b>0){r=a%b;a=b;b=r;}return a;}
ll powmod(ll a,ll b,ll mod) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
inline int readint() {
    int f=1,x=0; char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-') f=-1; ch=getchar();}
    while(ch<='9'&&ch>='0') x=x*10+ch-'0',ch=getchar();
    return f*x;
}
inline ll readll() {
    ll f=1,x=0; char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-') f=-1; ch=getchar();}
    while(ch<='9'&&ch>='0') x=x*10+ch-'0',ch=getchar();
    return f*x;
}
void fl(string name){
    freopen((name+".in").c_str(),"r",stdin);
    freopen((name+".out").c_str(),"w",stdout);
}
const int dx[8] = {-1, 1, 0, 0, -1, 1, -1, 1},
          dy[8] = {0, 0, -1, 1, -1, -1, 1, 1};

int main(){
    string s;
    cin>>s;
    ll p=0,maxv=0;
    for(int i=0;i<s.size();i++){
        if(s[i]=='R'){
            p++;
            maxv=max(maxv,p);
        }
        else{
            
            maxv=max(maxv,p);p=0;
        }
    }
    cout<<maxv<<endl;
}
/* stuff to remember
    * int overflow, array bounds
    * special cases (n=1? n=0?)
    * do something instead of nothing and stay organized
    * USE STATIC ARRAYS
    * DEFINING ARRAYS BEFORE main()
    * DO NOT DEFINE ARRAYS IN main()
    * USE INT INSTEAD OF LL,NOTICE THE MLE
*/

Measured memory_bytes: 3720
//Radhe Radhe
#include<bits/stdc++.h>
#define ll long long
#define fixed cout.setf(ios::fixed);
#define Precise cout.precision(7);
using namespace std;

int main()
{
    ll n,x,prev,cnt=1;
    cin>>n;

    cin>>x;
    prev=x;
    while(--n)
    {
        cin>>x;
        if(x<prev)
        {
            prev=x;
            cnt++;
        }
    }


    cout<<cnt<<endl;


    return 0;
}





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

typedef pair<int, int> P;//y, id
vector<P> a[100000];
char ans[100000][20];

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
#ifdef LOCAL
	std::ifstream in("in");
	std::cin.rdbuf(in.rdbuf());
#endif

	int N, M;
	cin >> N >> M;
	for(int i = 0; i < M; i++){
		int p, y;
		cin >> p >> y;
		p--;
		int num = a[p].size();
		a[p].push_back({ y, i });
	}

	for(int i = 0; i < N; i++){
		sort(a[i].begin(), a[i].end());
		for(int j = 0; j < a[i].size(); j++){
			char s[20];
			sprintf(ans[a[i][j].second], "%06d%06d", i + 1, j + 1);
		}
	}

	for(int i = 0; i < M; i++){
		cout << ans[i] << endl;
	}
}


Measured memory_bytes: 8960
import java.util.Scanner;

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

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double a = sc.nextDouble();
        double b = sc.nextDouble();
        double c = Math.toRadians(sc.nextDouble());
        System.out.println(a * b * Math.sin(c) / 2.);
        System.out.println((a + b + Math.sqrt(a * a + b * b - 2 * a * b * Math.cos(c))));
        System.out.println(b * Math.sin(c));

    }

}


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

using namespace std;
typedef long long int ll;
typedef long double ld;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for (ll i = (ll)(n) - 1; i >= 0; i--)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007
#define INF (1LL << 62)

#define PI (acos(-1))
#define print(x) cout << x << endl
 
ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a;}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll countDigit(ll n) { return floor(log10(n) + 1); } 
typedef pair <ll,ll> P;
static const ll dy[4] = {0,1,0,-1}, dx[4] = {1,0,-1,0};

template <typename T> 
ostream& operator<<(ostream& os, const vector<T>& v) 
{ 
    for (int i = 0; i < (int)v.size(); ++i) os << v[i] << " ";  
    return os; 
}

template <typename T1, typename T2> 
ostream& operator<<(ostream& os, const map<T1, T2>& m) 
{ 
    for (auto p : m) os << "<" << p.first << ", " << p.second << "> "; 
    return os; 
}

int main()
{
    ll N, K;
    cin >> N >> K;
    vector<ll> A(N);
    rep(i, N) { 
        cin >> A[i];
    }
    bitset<64> bs(K);
    vector<ll> cnts(64);
    rep(i, N) {
        bitset<64> tmp(A[i]);
        rep(j, 64) {
            cnts[j] += tmp[63-j];
        }
    }
    vector<vector<ll>> mat(65, vector<ll>(2, -1));
    mat[0][0] = 0;
    rep(i, 64) {
        ll tmp0 = pow(2, 63-i) * cnts[i];
        ll tmp1 = pow(2, 63-i) * (N-cnts[i]);
        // 1 -> 1
        if (mat[i][1] != -1)
            mat[i+1][1] = max(mat[i+1][1], mat[i][1] + max(tmp0, tmp1));

        // 0 -> 1
        if (mat[i][0] != -1)
            if (bs[63-i])
                mat[i+1][1] = max(mat[i+1][1], mat[i][0] + tmp0);

        // 0 -> 0
        if (mat[i][0] != -1)
            mat[i+1][0] = max(mat[i+1][0], mat[i][0] + (bs[63-i] ? tmp1 : tmp0));

    }
    print(max(mat[64][0], mat[64][1]));
    return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <algorithm>
typedef long long int ll;
using namespace std;

//
int main()
{
  cin.tie(0);
ios::sync_with_stdio(false);
    int N;
    cin >> N;
    vector<ll> A;
ll common;
  cin>>common;
    for (int i = 1; i < N; i++)
    {
        ll ai;
        cin >> ai;
        common=__gcd(common,ai);
    }
    cout << common << endl;
}


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

#define rep(i,l,r) for(register int i = l ; i <= r ; i++)
#define repd(i,r,l) for(register int i = r ; i >= l ; i--)
#define rvc(i,S) for(register int i = 0 ; i < (int)S.size() ; i++)
#define rvcd(i,S) for(register int i = ((int)S.size()) - 1 ; i >= 0 ; i--)
#define fore(i,x)for (register int i = head[x] ; i ; i = e[i].next)
#define forup(i,l,r) for (register int i = l ; i <= r ; i += lowbit(i))
#define fordown(i,id) for (register int i = id ; i ; i -= lowbit(i))
#define pb push_back
#define prev prev_
#define stack stack_
#define mp make_pair
#define fi first
#define se second
#define lowbit(x) (x&(-x))

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<ll,ll> pr;

const ll mod = 998244353;
const int maxn = 4020;

char ch[maxn];
int mxr[maxn],mxb[maxn],r,b,n;
ll f[maxn][maxn];

inline void up(ll &x,ll y) { x = (x+y) % mod; }
int main(){
	scanf("%s",ch + 1);
	n = strlen(ch + 1);
	rep(i,1,n){
		if ( ch[i] == '0' ) r += 2;
		else if ( ch[i] == '2' ) b += 2;
		else r++ , b++;
		mxr[i] = min(mxr[i - 1] + 1,r);
		mxb[i] = min(mxb[i - 1] + 1,b);
	}
	rep(i,n + 1,n * 2){
		mxr[i] = min(mxr[i - 1] + 1,r);
		mxb[i] = min(mxb[i - 1] + 1,b);
	}
	f[0][0] = 1;
	rep(i,0,n * 2){
		rep(j,i - mxb[i],mxr[i]){
			up(f[i + 1][j],f[i][j]);
			up(f[i + 1][j + 1],f[i][j]);
		}
	}
	cout<<f[n * 2][r]<<endl;
}


Measured memory_bytes: 123520