akhauriyash/Code-Regression huggingface dataset:
import java.io.BufferedInputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;

/**
 *
 */
public class Main {

    public static void solve() {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int t = sc.nextInt();
        long a[] = new long[n];
        for (int i = 0 ; i < n ; i++)
            a[i]=sc.nextLong();
        long ans = 0, last =0;

        for (int i = 1; i < n ; i ++) {
            if ( last + t < a[i]) {
                ans += t;
                last = a[i];
            } else {
                ans += a[i]-a[i-1];
                last = a[i];
            }
        }
        ans+=t;
        System.out.println(ans);

    }

    public static void main(String[] argc) {
        solve();
    }
}


Measured memory_bytes: 92208
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(j, m) for (int j = 0; j < (int)(m); j++)
#define rep2(i, l, n) for (int i = l; i < (int)(n); i++)


int main() {
    int N;
    cin >> N;
    int i = 1;
    while (i*2 <= N) {
        i *= 2;
    }
    cout << i << endl;
}



Measured memory_bytes: 3576
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
L = LIST()
m = max(L)
for i in range(N):
    a = L[i]
    # b = L[:i-1] + L[i:]
    # print(L[:i-1] + L[i:])
    if a == m:
        if sum(L)-a > a:
            print("Yes")
            break
        else:
            print("No")
            break

Measured memory_bytes: 5396
#pragma GCC optimize("O3")
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

using ll = long long;
using P = pair<int, int>;

template <class T> inline T chmax(T &a, const T b) {return a = (a < b) ? b : a;}
template <class T> inline T chmin(T &a, const T b) {return a = (a > b) ? b : a;}

constexpr int MOD = 1e9 + 7;
constexpr long long INF = 1e18;
constexpr double pi = acos(-1);
constexpr double EPS = 1e-10;

int dx[] = {1, 0, -1, 0};
int dy[] = {0, -1, 0, 1};

// dp[i][j][tight] := i 桁目, mod D = j, 未満フラグ tight
ll dp[10010][110][2];

string k;
int d;

ll rec(int i, int j, int tight){
    
    if(i == k.size()){
        return j == 0;
    }

    int num = k[i] - '0';

    int lim = tight ? 9 : num;

    ll &res = dp[i][j][tight];

    if(~res) return res;

    res = 0;

    for(int x=0; x<=lim; x++){
        res += rec(i + 1, (j + x) % d, tight || (x < lim));
        res %= MOD;
    }

    return res;
}

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

    memset(dp, -1, sizeof(dp));

    ll ans = rec(0, 0, 0) - 1 + MOD;

    cout << ans % MOD << endl;
}

Measured memory_bytes: 17792
#include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stdio.h>
#include <string>
#include <vector>

#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using LP = pair<ll, ll>;
const double PI = 3.1415926535897932;

int main()
{
	int K, X;
	cin >> K >> X;
	int total = 500 * K;
	if (total >= X) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}

	return 0;
} 

Measured memory_bytes: 3572
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0;i<n;i++)
using namespace std;
const long long MOD = 1e9+7;
int main(){
    int n;
    cin >> n;
    string s;
    cin >> s;
    int cnt = 0;
    for(int i = 0;i<s.size()-2;i++){
        if(s[i]=='A' && s[i+1]=='B' && s[i+2]=='C') cnt++;
    }
    cout << cnt << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>
#include <bits/stdc++.h>

using namespace std;
using ll = long long ;
const int INF = 1001001001;

int main() {

    ll a,v,b,w,t;
    cin >> a >> v >> b >> w >> t  ;

    ll dif = abs(b-a);
    ll sdif = v-w ;

    //cout << dif << " " << sdif << endl ;

    if(w>=v){
        cout << "NO" << endl ;
        return 0; 
    }else if(dif<=t*sdif){
       // ll ans = dif/sdif ;
       // if(ans<=t){
            cout << "YES" << endl ;
            return 0 ;
        //}
    }

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

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

int n, t, a, x, ans, deff = 1e9;

int main() {
    cin >> n >> t >> a;
    rep(i, n) {
        cin >> x;
        int d = abs(1000 * t - x * 6 - a * 1000);
        if (d < deff) {
            deff = d;
            ans = i+1;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
import std.stdio, std.conv, std.array, std.string;
import std.algorithm;
import std.container;
import std.range;
import core.stdc.stdlib;

void main() {
  auto N = readln.chomp.to!int;
  int[][] gameOrders;
  gameOrders.length = N;
  foreach(i; N.iota()) {
    gameOrders[i] = readln.split.to!(int[]);
  }

  int days = 0;
  auto ordersPerPlayer = gameOrders.map!(o => o.empty() ? -1 : o[0]).array;
  while(true){

    bool[int] gamedPlayers;
    for(int player=0; player<N; player++) {
      if (ordersPerPlayer[player] == -1) continue;

      if (ordersPerPlayer[ordersPerPlayer[player]-1] == player+1) {
        gamedPlayers[player] = true;
        gamedPlayers[ordersPerPlayer[ordersPerPlayer[player]-1]-1] = true;
      }
    }
    if (gamedPlayers.length == 0) {
      writeln(-1);
      exit(0);
    }
    foreach(player; gamedPlayers.keys) {
      gameOrders[player].popFront();
      ordersPerPlayer[player] = gameOrders[player].empty ? -1 : gameOrders[player][0];
    }
    days++;

    if (!gameOrders.any!(o => !o.empty)) break;
  }

  writeln(days);
}


Measured memory_bytes: 15740
require("fs").readFileSync("/dev/stdin","utf8").trim().split('\n').map(function(z){i=z.split(' ');console.log(x=((i[2]*i[4]-i[1]*i[5])/(i[0]*i[4]-i[1]*i[3])).toFixed(3),((i[2]-i[0]*x)/i[1]).toFixed(3))})

Measured memory_bytes: 7644
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define ll long long
#define INF 1000000000000000000

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

    deque<char> que, left, right;
    deque<char> ans;

    int N;
    cin >> N;
    rep(i, N) {
        char a;
        cin >> a;
        ans.push_back(a);
        if (!que.empty() && que.back() == '(' && a == ')')
            que.pop_back();
        else
            que.push_back(a);
    }

    while (!que.empty()) {
        if (que.front() != ')')
            break;
        else
            que.pop_front(), ans.push_front('(');
    }

    while (!que.empty()) {
        if (que.back() != '(')
            break;
        else
            que.pop_back(), ans.push_back(')');
    }

    rep(i, ans.size()) { cout << ans[i]; }
}

Measured memory_bytes: 256
n = int(input())
ans = 0
d = dict()
for i in range(n):
    a = int(input())
    if a not in d:
        d[a] = 0
    d[a] += 1
da = list(d.values())
for i in range(len(da)):
    if da[i] % 2 == 1:
        ans += 1
print(ans)


Measured memory_bytes: 15072
Field = [list(map(int, input().split(" "))) for i in range(3)]
N = int(input())
num =[]
for i in range(N):
    t = int(input())
    num.append(t)
count=0
for i in Field:
    for t in range(3):
        if i[t] in num:
            i[t] = 0

for i in Field:
    if sum(i) == 0:
        count+=1

for i in range(3):
    if Field[0][i] == 0 and Field[1][i] == 0 and Field[2][i] == 0:
        count+=1

if Field[0][0] == 0 and Field[1][1] == 0 and Field[2][2] == 0:
    count+=1
if Field[0][2] == 0 and Field[1][1] == 0 and Field[2][0] == 0:
    count+=1

if count != 0:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> mp;
ll inf =  1e9;


int main(){
 ll n,m;
 cin>>n>>m;
 vector<ll> a(n);
 for(int i=0;i<n;i++)cin>>a[i];
 double sum = 0;
 ll cnt = 0;
 for(int i=0;i<n;i++)sum+=a[i];
 for(int i=0;i<n;i++){
  if( a[i] >= sum/(4*m) ){
   cnt++;
  }
 }
 if( cnt >= m ) cout<<"Yes"<<endl;
 else cout<<"No"<<endl;
    return 0;
}


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

int main()
{
	int a , b, c;
	int x;
	cin>>a>>b>>c;
	cin>>x;
	int cnt = 0;
	for(int i = 0; i <= a; i++)
	{
		for(int j = 0; j <= b; j++)
		{
			
			for(int k = 0; k <= c; k++)
			{
				int tmp = i*500 + j*100 + k*50;
			
				if(tmp==x)
				cnt++;
			}
		}
	} 
	cout<<cnt<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

typedef long long ll;

#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=b-1LL;i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)
#define print(x) cout<<#x<<" = "<<x<<endl;

#define MOD 1000000007

int main(){
  ll a,b;
  cin>>a>>b;
  if(a>=13){
    cout << b << endl;
  }
  else if(a<=5){
    cout << 0 << endl;
  }
  else{
    cout << b/2 << endl;
  }
  return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
    public static void main(String[] args) throws java.io.IOException{
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        String relation = "==";
        if (a<b) {
            relation = "<";
        }else if (a>b) {
            relation = ">";
        }
        System.out.println("a " + relation + " b");
    }
}

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

ll N, M;

vector<ll> Enumdiv(ll n){
	vector<ll> ret;
	for(int i = 1; i * i <= n; i++){
		if(n % i == 0){
			ret.push_back(i);
			if(i != n / i) ret.push_back(n / i); 
		}
	}
	return ret;
}

int main(void){
    
	scanf("%lld %lld", &N, &M);
	
	auto v = Enumdiv(M);
	sort(v.begin(), v.end(), greater<ll>());
	
	for(int i = 0; i < v.size(); ++i) if((M / N) >= v[i]) { printf("%lld\n", v[i]); return 0; }
	
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <numeric>
#include <tuple>
#include <stack>

#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) x.begin(),x.end()
#define print(s) cout << s << endl
typedef long long ll;
using namespace std;

int main() {
    string a, b; cin >> a >> b;
    rep(i,a.size()){
        bool can = true;
        rep(j, a.size()){
            if (b[j] != a[(j+i)%a.size()]){
                can = false;
                break;
            }
        }
        if (can) {
            print("Yes");
            return 0;
        }
    }
    print("No");
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define rep(i,n) for (ll i = 0; i < (n); ++i)
#define vcout(v) rep(i,v.size()) cout << v[i] << " "; cout << endl
#define mcout(m) rep(j,m.size()){vcout(m[j]);}
const ll MOD = 1e9 + 7;

void mainsolve(){

	string s;
	cin >> s;
	ll k;
	cin >> k; 

	ll dp[101][2][101];
	memset(dp,0,sizeof(dp));
	// 1桁目
	ll first = s[0] - '0';
	rep(i,first+1) dp[0][i < first][i != 0]++;
	
	// 2桁目以降
	rep(i,s.size()-1) rep(j,2) rep(kk,101){
		ll lim = j? 9 : s[i+1] - '0';
		rep(next, lim+1){
			ll tmp = 0;
			if(next != 0) tmp++;
			dp[i+1][j || next < lim][kk + tmp] += dp[i][j][kk];
		}
	}

	cout << dp[s.size()-1][true][k] + dp[s.size()-1][false][k] << endl;

	return;
}

int main(){
	
	//ll TC;cin>>TC;rep(I,TC){cout<<"case:"<<I+1<<"---"<<endl; // comment out!
		mainsolve();
	//} // comment out!
	return 0;
}


Measured memory_bytes: 384
#include "bits/stdc++.h"
#define FILE_IN freopen("in", "r", stdin);
#define FILE_OUT freopen("out", "w", stdout);
#define fr(i,a,b) for(int i =a;i<b;i++)

bool debug = 1;
#define prin(a) if(debug) cout << #a << " = " << (a) << endl
#define par(a,b) if(debug) printf("%d/%d\n", (a), (b))
#define separa() if(debug) cout << endl

#define pb push_back
#define fi first
#define se second
#define ll long long
#define pii pair<int,int>
#define pll pair<ll, ll>

const ll MOD = 1000000007;
const double PI = acos(-1.0);
const double eps = 1e-9;
using namespace std;
#define N 110

int n;
vector<int> v;

int retira() {
	for(int i=v.size()-1;i>=0;i--) {
		if(v[i] == i+1) {
			v.erase(v.begin()+i);
			return i+1;
		}
	}
	return -1;
}

int main () {

	cin >> n;
	
	int x;
	for(int i=0;i<n;i++) {
		cin >> x;
		v.pb(x);
	}

	stack<int> res;
	while(v.size() > 0) {
		int aux = retira();
		if(aux == -1) break;
		res.push(aux);
	}

	if(res.size() < n) printf("-1\n");
	else 
		while(!res.empty()) {
			printf("%d\n", res.top());
			res.pop();
		}


	return 0;

}





Measured memory_bytes: 256
from itertools import combinations
import numpy as np
        #買う本
N, M, X = map(int, input().split())
items = np.array([list(map(int, input().split())) for _ in range(N)], dtype=np.int32)
all_book= [i for i in range(N)]  
out = 10**18
#for c in itertools.product([False, True], repeat=N):
for num in range(1,N+1): #1冊からN冊まで
    for t in combinations(all_book,num): #参考書を買う組合せ、全列挙
        book_buy        =np.array(t,dtype=int) 
        understand_now  = items[book_buy] 
        tmp             = np.sum(understand_now, axis=0)
        if np.all(tmp[1:] >= X):
            out = min(out, tmp[0])

if out == 10**18:
  print(-1)
else:
  print(out) 

Measured memory_bytes: 27344
#include <bits/stdc++.h>
#define all(vec) vec.begin(),vec.end()
#define mp make_pair
using namespace std;
using ll=long long;
using P=pair<int,int>;
const ll INF=1LL<<30;
const ll LINF=1LL<<61;
const double eps=1e-5;
const ll MOD=1e9+7;
int main(){
    int n;cin>>n;int k;cin>>k;
    vector<ll> h(n+10),dp(n+10,LINF);
    for(int i=0;i<n;i++)cin>>h[i];
    dp[0]=0;
    for(int i=1;i<n;i++){
        for(int j=1;j<=k;j++){
            if(i<j)break;
            dp[i]=min(dp[i],dp[i-j]+abs(h[i]-h[i-j]));
        }
    }
    cout<<dp[n-1]<<endl;
}   


Measured memory_bytes: 1792
n=int(input())
if n==3:
    print("2 5 63")
elif n==6:
    print("3 4 6 8 9 12")
elif n==7:
    print("2 3 4 6 8 10 15")
else:
    res=[]
    count = 0
    for i in range(1,50000):
        if i % 2 == 0 or i % 3 == 0:
            res.append(i)
            count += 1
        if count == n-1:
            break

    s=sum(res)
    t=res[-1]
    f1 = s%2
    f2 = s%3
    if f1==0 and f2 == 0:
        flag = 0
    elif f1==0 and f2==1:
        flag = 2
    elif f1==0 and f2==2:
        flag = 4
    if f1==1 and f2 == 0:
        flag = 3
    elif f1==1 and f2==1:
        flag = 5
    elif f1==1 and f2==2:
        flag = 1

    if flag == 5 or flag ==1:
        res.pop(1)
        f=0
        for i in range(t+1,t+10):
            if i % 2==0:
                res.append(i)
                f+=1
            if f==2:
                break

    else:
        for i in range(t+1,t+10):
            if i % 6 == flag:
                res.append(i)
                break

    print(" ".join(map(str, res)))

Measured memory_bytes: 5212
x,y=gets.split.map &:to_i
l,q,r=$<.map{|s|[9e9,*s.split.map(&:to_i).sort]}
s=(l[-x,x]+q[-y,y]).inject:+
p [s,*(1..x+y).map{s-=!r[1]?0:(l[-x]<q[-y]?l[~x-=1]:q[~y-=1])-r.pop}].max

Measured memory_bytes: 28428
using System;

namespace _2_C {
    class Program {
        static void Main (string[] args) {
            var input = Console.ReadLine ().Split ();
            var a = Convert.ToInt32 (input[0]);
            var b = Convert.ToInt32 (input[1]);
            var c = Convert.ToInt32 (input[2]);

            if (a > b) {
                var temp = a;
                a = b;
                b = temp;
            }
            if (b > c) {
                var temp = b;
                b = c;
                c = temp;
            }
            if (a > b) {
                var temp = a;
                a = b;
                b = temp;
            }
            Console.WriteLine ($"{a} {b} {c}");
        }
    }
}


Measured memory_bytes: 18016
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric;

void main()
{
    auto hn = readln.split.to!(int[]);
    long H = hn[0];
    auto N = hn[1];
    long[] AS, BS;
    foreach (_; 0..N) {
        auto ab = readln.split.to!(long[]);
        AS ~= ab[0];
        BS ~= ab[1];
    }

    auto DP = new long[][](N, H+1);
    foreach (ref dp; DP) dp[] = -1;
    long solve(int i, long h) {
        if (i == N) return h == 0 ? 0 : long.max/3;
        if (DP[i][h] == -1) {
            if (h == 0) {
                DP[i][h] = solve(i+1, h);
            } else {
                DP[i][h] = min(solve(i+1, h), solve(i, max(0, h - AS[i])) + BS[i]);
            }
        }
        return DP[i][h];
    }
    writeln(solve(0, H));
}

Measured memory_bytes: 83324
import sys
import re
for line in sys.stdin:
	line=line.replace('\n','')
	s=re.split('[+=]',line)
	line=line.replace('=','==')
	ans="NA"
	f=any([x!='X' and x[0]=='X' for x in s])
	for i in '0123456789'[f:]:
		if eval(line.replace('X',i)):
			ans=i
			break
	print(ans)

Measured memory_bytes: 7872
H, W = map(int, input().split())

S = []

dxy_list = [(-1, -1), (-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1)]

for _ in range(H):
    S.append(list(input()))

for i in range(H):
    for j in range(W):
        if(S[i][j] == '#'): continue
        
        num = 0
        for dxy in dxy_list:
            ni = i + dxy[0]
            nj = j + dxy[1]

            if (ni < 0 or H <= ni): continue
            if (nj < 0 or W <= nj): continue
            
            if(S[ni][nj] == '#'): num += 1

        S[i][j] = str(num)

for row in S:
    print(''.join(row))


Measured memory_bytes: 3188
#include <stdio.h>
int X, Y, T, R;
int gcd(int x, int y) {
	if(x == 0) return y;
	if(y == 0) return x; T++;
	if(x > y) return gcd(y, x % y);
	return gcd(x, y % x);
}
int main() {
	while(true) {
		scanf("%d%d",&X,&Y); T = 0;
		if(X == 0 && Y == 0) return 0;
		R = gcd(X, Y);
		printf("%d %d\n", R, T);
	}
}



Measured memory_bytes: 2668
import Data.Char
main = do
  [n,a,b] <- map read . words <$> getLine :: IO [Int]
  let x = map (solve a b) [1..n]
  print $ sum $ zipWith (*) x [1..n]

solve :: Int -> Int -> Int -> Int
solve a b n = let s = sum . map digitToInt . show $ n
              in if a <= s && s <= b then 1 else 0


Measured memory_bytes: 892
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
h1, m1, h2, m2, k = M()
a = h1*60 + m1
b = h2*60 + m2
print(max(b-k-a, 0))

Measured memory_bytes: 68404
#include <bits/stdc++.h>
#define r(i,n) for(int i = 0; i<n; i++)
#define R(i,n) for(int i = 1; i<=n; i++)
typedef long long ll;
using namespace std;

int main(){
  int n;
  string s,t;
  double ans = 0;
  cin >> n;
  while(n--){
    cin >> t >> s;
    if(s=="JPY")ans+=stoi(t);
    else ans+=stod(t)*380000;
  }
  printf("%.8lf\n",ans);
}

Measured memory_bytes: 256
import numpy as np
N = int(input())
A = list(map(int, input().split()))
prod = 1
if 0 in A:
    print(0)
else:
    for i in A:
        prod *=i
        if prod > int(1e18):
            print(-1)
            break
    if prod <= int(1e18):
        print(prod)

Measured memory_bytes: 39860
use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
  let stdin = stdin();
  let stdin = stdin.lock();
  let token: String = stdin
    .bytes()
    .map(|c| c.expect("failed to read char") as char)
    .skip_while(|c| c.is_whitespace())
    .take_while(|c| !c.is_whitespace())
    .collect();
  token.parse().ok().expect("failed to parse token")
}

use std::cmp::{max, min};
use std::collections::HashMap;

fn main() {
  let s = read::<String>();
  let front = &s[..3];
  let back = &s[1..];
  let mut ok = false;
  for i in 0..10 {
    let i_char = i.to_string().chars().nth(0).unwrap();
    if front.chars().all(|x| x == i_char) || back.chars().all(|x| x == i_char) {
      ok = true;
    }
  }

  if ok {
    println!("Yes");
  } else {
    println!("No");
  }
}



Measured memory_bytes: 4352
#include<iostream>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<numeric>
#include<cmath>
#include<queue>
#include<stack>
#include<list>
#include<unordered_map>
#include<unordered_set>

using namespace std;
typedef long long int ll;typedef pair<int, int> P;
const long long mod = 1e9 + 7;
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define ALL(a) (a).begin(),(a).end()

int main(void) {
	int n, m, x, y; cin >> n >> m >> x >> y;
	vector<int> xx(n); rep(i, n)cin >> xx[i];
	vector<int> yy(m); rep(i, m)cin >> yy[i];
	int z; bool q = 1, s = 1;
	for (z = x+1; z <= y; z++) {
		q = 1; s = 1;
		rep(i, n) {
			if (xx[i] >= z)q = false;
		}
		rep(i, m) {
			if (yy[i] < z)s = false;
		}
		if (q && s)break;
	}
	cout << (q && s ? "No War" : "War") << endl;
	return 0;
}

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

int main() {
  string S;
  cin >> S;
  
  if(S == "Sunny"){
    cout << "Cloudy" << endl;
  } else if(S== "Cloudy"){
    cout << "Rainy" << endl;
  } else {
    cout << "Sunny" << endl;
  }
}


Measured memory_bytes: 3468
import Control.Applicative ((<$>), (<*>))
import Control.Monad
import Data.List

main :: IO ()
main = do
  solve <$> replicateM 4 (getl toInt) >>= mapM_ print

solve :: [Int] -> [Int]
solve = f . sum
  where
    f x = [x `div` 60, x `mod` 60]

toInt :: String -> Int
toInt = read

getl :: (String -> a) -> IO a
getl f = f <$> getLine

Measured memory_bytes: 3668
w, h, n = map(int, input().split())
x_min = 0
y_min = 0
for i in range(n):
  x, y, a = map(int, input().split())
  if a == 1:
    x_min = max(x_min, x)
  elif a == 2:
    w = min(w, x)
  elif a == 3:
    y_min = max(y_min, y)
  elif a == 4:
    h = min(h, y)
print(max(0, w-x_min) * max(0, h-y_min))


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

int main()
{
    int c1, price, remainder;
    cin >> price >> c1;

    remainder = price % 500;
    if (remainder > c1){
        cout << "No" << '\n';
    }
    else{
        cout << "Yes" << '\n';
    }

    return 0;
}

Measured memory_bytes: 256
from collections import defaultdict

vertice,edge = map(int,input().split(" "))
cost = [[0 if m == n else float("inf") for n in range(vertice)] for m in range(vertice)]
link = defaultdict(dict)
weight = defaultdict(dict)

for e in range(edge):
    i,j,w = map(int,input().split(" "))
    link[i] = link.get(i,set()) | {j}
    weight[i].update({j:w})

vertice_cnt = 0
while 1:
    if vertice_cnt >= vertice:
        print("NEGATIVE CYCLE")
        break
    update = False
    for source in range(vertice):
        for k,value in link.items():
            for v in value:
                if cost[source][v] > cost[source][k] + weight[k][v]:
                    cost[source][v] = cost[source][k] + weight[k][v]
                    update = True
    if not update:
        for o in range(vertice):

            print(*([n if n != float("INF") else "INF" for n in cost[o]]))
        break
    vertice_cnt += 1

Measured memory_bytes: 9968
#include <iostream>
#include <vector>
#include <queue>
#define rep(i, n)  for (int i = 0; i < (n); ++i)

int n, q;
int mp[200020], cnt[200020];
std::vector<int>v[200020];
std::queue<int>que;
bool used[200020];
int main() {
	scanf("%d %d", &n, &q);
	rep(i, n - 1) {
		int a, b;
		scanf("%d %d", &a, &b);
		--a; --b;
		v[a].emplace_back(b);
		v[b].emplace_back(a);
	}
	rep(i, q) {
		int p, x;
		scanf("%d %d", &p, &x);
		cnt[p - 1] += x;
	}
	que.push(0);
	mp[0] = cnt[0];
	used[0] = true;
	while (!que.empty()) {
		int p = que.front(); que.pop();
		const std::vector<int>& k = v[p];
		for (const int& i : k) {
			if (used[i]) continue;
			mp[i] = mp[p] + cnt[i];
			que.push(i);
			used[i] = true;
		}
	}
	rep(i, n) printf("%d ", mp[i]);
	printf("\n");
}

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


int main() {
    int n;
    cin >> n;
    if(n == 2){
        cout << 2;
        return 0;
    }
    for(int i = n; i<10000001; i++){
       //if(i % 2 == 0) continue;
        for(int j = 3; j <= i; j++){
            if(j < i && i % j == 0){
                //cout << "i = " << i <<"j = " <<j << "割り切れたからbreakだよ" << endl;
                break;
            } 
            if(j == i){
                cout << j;
                return 0;
            }
        }
    }
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
using namespace std;
int main(){
	int n;
	while(true){
	cin>>n;
	if(n==0)
		break;
	int set,best=0;
	int p,d1,d2;
	for(int i=0;i<n;i++){
		cin>>p>>d1>>d2;
		if(d1+d2>best){
			best=d1+d2;
			set=p;
		}
	}
	cout<<set<<" "<<best<<endl;
	}
	return 0;
}

Measured memory_bytes: 1160
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>  // sort, 二分探索, etc
#include <iomanip>  // setprecision (浮動小数点の出力の誤差)
#include <map>
#include <queue>
#include <set>
#include <stack>

#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=a,i##_len=(b);i<i##_len;++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define cauto const auto&
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x))
#define INF 1000000000000
#define MOD 1000000007
#define perm(c) sort(all(c));for(bool c##p=1;c##p;c##p=next_permutation(all(c)))

using namespace std;
using ui = unsigned int;
using ll = long long;
using ull = unsigned long long;

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

int qp(int a,ll b){int ans=1;do{if(b&1)ans=1ll*ans*a;a=1ll*a*a;}while(b>>=1);return ans;}
int qp(int a,ll b,int mo){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}

ll comb(int n, int r) {
    vector<vector<ll> > v(n+1, vector<ll>(r+1, 0));
    for(int i=0;i<n+1;i++) {v[i][0]=1; if(i < r+1)v[i][i]=1; }
    for(int i=1;i<n+1;i++) {for(int j=1;j<min(i,r+1);j++) {v[i][j]=v[i-1][j-1]+v[i-1][j];}}
    return v[n][r];
}

// CHAR_MAX  = 127
// INT_MAX   = 2.1e+09 (2147483647)
// LONG_MAX  = 9.2e+18 (9223372036854775807)
// LLONG_MAX = 9.2e+18 (9223372036854775807)


int main() {
    ll n, k;
    cin >> n >> k;
    ll total = 0;
    for (ll i = k; i < n + 2; i++) {
        ll min_val = i * (i - 1) / 2;
        ll max_val = n * (n + 1) / 2 - (n - i) * (n - i + 1) / 2;
        total = (total + (max_val - min_val) + 1) % MOD;
    }

    cout << setprecision(10) << total << '\n';


    return 0;
}


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

	public static void main(String[] args) {

		Scanner sc=new Scanner(System.in);
		int a=sc.nextInt();
		int b=sc.nextInt();
		
		int d=a/b;
		int r=a%b;
		double f=(double)a/(double)b;
				
		System.out.print(d+" "+r+" ");
		System.out.printf("%.8f \n",f);
	}

}

Measured memory_bytes: 17180
#include <stdio.h>

void swap(int* a, int* b)
{
  int tmp;
  if (*a > *b) {
    tmp = *a;
    *a = *b;
    *b = tmp;
  }
}

int main()
{
  int i, j;
  int a, b ,c;
  int v;

  scanf("%d %d %d", &a, &b, &c);

  swap(&a, &b);
  swap(&b, &c);
  swap(&a, &b);

  printf("%d %d %d\n", a, b, c);
  
  return 0;
}

    
    



Measured memory_bytes: 2100
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define whole(x) (x).begin(),(x).end()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
using P = pair<int, int>;
#define debug(var) cerr << "[" << #var << "] " << var << endl
const ll mod = 1000000007;
const int INF = 1001001001;



int main(){
    int n, m;
    cin >> n >> m;
    int arr[9] = {2, 5, 5, 4, 5, 6, 3, 7, 6};
    vector<int> a(m);
    rep(i, m) cin >> a[i];
    sort(whole(a));
    reverse(whole(a));
    vector<int> x(m);
    rep(i, m) x[i] = arr[a[i]-1];
    
    vector<P> dp(n+1, P(-INF, -1));
    dp[0] = P(0, -1);
    rep(i, n+1) {
        for (int j=0; j<x.size(); j++) {
            int e = x[j];
            if (i-e>=0 && dp[i-e].first>=0) {
                if (dp[i].first<dp[i-e].first+1) {
                    dp[i].first = dp[i-e].first + 1;
                    dp[i].second = a[j];
                }
            }
        }
    }
    int keta = dp[n].first;
    int index = n;
    map<int, int> mp;
    while (index) {
        mp[dp[index].second]++;
        index -= arr[dp[index].second-1];
    }
    string ans;
    for (auto m: mp) {
        rep(i, m.second) {
            ans += m.first+'0';
        }
    }
    reverse(whole(ans));
    
    
    
    
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 384
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] h = new int[n];
		boolean flag = true;

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

		h[0]--;
		for(int i = 1; i < n; i++) {
			if(h[i-1] < h[i]) {
				h[i]--;
			}else if(h[i-1] > h[i]) {
				flag = false;
				break;
			}
		}

		System.out.print(flag ? "Yes" : "No");
		sc.close();
	}
}

Measured memory_bytes: 51016
#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;
#define endl "\n"
#define ll long long
#define sz(s) (int)(s.size())
#define INF 0x3f3f3f3f3f3f3f3fLL
#define all(v) v.begin(),v.end()
#define watch(x) cout<<(#x)<<" = "<<x<<endl
const int dr[] { -1, -1, 0, 1, 1, 1, 0, -1 };
const int dc[] { 0, 1, 1, 1, 0, -1, -1, -1 };
#if __cplusplus >= 201402L
template<typename T>
vector<T> create(size_t n) {
	return vector<T>(n);
}
template<typename T, typename ... Args>
auto create(size_t n, Args ... args) {
	return vector<decltype(create<T>(args...))>(n, create<T>(args...));
}
#endif
void run() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
#ifdef EZZAT
	freopen("input.in", "r", stdin);
	//freopen("output.out", "w", stdout);
#else
#endif
}

int main() {
	run();
	int r;
	cin >> r;
	cout << fixed << setprecision(9) << acos(-1) * r * 2 << endl;
}


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

int a[2000];
int dp[2001][2];

void solve(){
  int n,z,w;
  cin>>n>>z>>w;
  for(int i=0;i<n;++i) cin>>a[i];
  reverse(a,a+n);
  a[n]=w;
  dp[0][0] = dp[0][1] = abs(a[0] - a[1]);
  for(int i=1;i<n;++i){
    int ans=abs(a[i+1]-a[0]);
    for(int j=i-1;j>=0;--j)
      ans = min(ans, dp[j][1]);
    dp[i][0] = ans;
    ans = abs(a[i+1]-a[0]);
    for(int j=i-1;j>=0;--j)
      ans = max(ans, dp[j][0]);
    dp[i][1] = ans;
  }
  cout<<dp[n-1][1];
}

int main(){
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  solve();
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
using namespace std;
typedef long long ll;
int INF = (1LL << 30) - 1;
int MOD = 1e9+7;
main(){
    int D,G;
    cin >> D >> G;
    vector<int> p(D),c(D);
    rep(i,0,D)cin >> p[i] >> c[i];
    rep(i,1,1010){
        int ans = 0;
        rep(j,0,1 << D){
            int cnt = 0,sum = 0;
            rep(k,0,D){
                if(j & (1 << k)){
                    cnt += p[k];
                    sum += p[k] * 100 * (k+1) + c[k];
                }
            }
            if(cnt > i)continue;
            for(int k = D-1;k >= 0;k--){
                if(j & (1 << k))continue;
                if(i - cnt <= p[k]){
                    sum += (i - cnt) * (k+1) * 100; 
                    cnt = i;
                }else{
                    sum += p[k] * (k+1) * 100 + c[k];
                    cnt += p[k];
                }
            }
            ans = max(ans, sum);
        }

        if(ans >= G){
            //cout << ans << endl;
            cout << i << endl;
            return 0;
        }
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
template<typename T, size_t size> ostream& operator<<(ostream &os, const array<T, size> &arr) { os << '{'; string sep; for (const auto &x : arr) os << sep << x, sep = ", "; return os << '}'; }
template<class T> ostream& operator<<(ostream &os, vector<T> V) { os << "[ "; for(auto v : V) os << v << " "; return os << "]"; }
template<class T> ostream& operator<<(ostream &os, set<T> S){ os << "{ "; for(auto s:S) os<<s<<" ";return os<<"}"; }
template<class L, class R> ostream& operator<<(ostream &os, pair<L,R> P) { return os << "(" << P.first << "," << P.second << ")";}
template<class L, class R> ostream& operator<<(ostream &os, map<L,R> M) { os << "{ "; for(auto m:M) os<<"("<<m.first<<":"<<m.second<<") "; return os<<"}"; }
#ifdef LMAO
    #define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){cerr << name << " : " << arg1 << endl;}
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){ const char* comma = strchr(names + 1, ','); cerr.write(names, comma - names) << " : " << arg1<<" | "; __f(comma+1, args...); }
#else
    #define trace(...) 42
#endif
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define endl "\n"
#define tcase int tt; cin>>tt; while(tt--)
#define tcase2 int tt; cin>>tt; for(int qq=1;qq<=tt;qq++)
#define all(x) x.begin(), x.end()
typedef long long int ll;
typedef  unsigned long long int ull;
typedef long double ld;
const int MAX = 1000010;
const int MOD2 = 998244353;
const int MOD = 1000000007; 
const int INF = 1e8;    
const ll LLINF = 0x3f3f3f3f3f3f3f3f;
const ld EPS = 1e-7;
#define forn(i, n) for(int i = 0; i < (int)n; i++)
#define forne(i, a, b) for(int i = a; i <= b; i++)   
/*****************start************/

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);cout<<fixed<<setprecision(25);cerr<<fixed<<setprecision(10);
    ll n;
    cin>>n;
    ll ans=0;
    ll lo1=0;
    while(n%2==0)
    {
        n/=2;
        lo1++;
    }
    if(lo1)
        ans+=max(0ll,(ll)(-1+sqrt(1+8*lo1))/2);
    for(int i=3;i*1ll*i<=n;i+=2)
    {
        ll lo=0;
        while(n%i==0)
        {
            n/=i;
            lo++;
        }
        if(lo)
        {
            ans+=max(0ll,(ll)(-1+sqrt(1+8*lo))/2);
        }
    }
    if(n>2)
    {
        ans++;
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 3704
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import numpy as np
import statistics
from statistics import mean, median,variance,stdev
import math

def main():
	N = int(input())
	A = input().split(" ")
	A = [int(s) for s in A]
	
	base = 0
	for i, val in enumerate(A):
		if i == 0:
			tmp = abs(0 - A[i])
		else:
			tmp = abs(A[i-1] - A[i])
		base += tmp
		
	base += abs(A[-1] - 0)
		
	for i, val in enumerate(A):
		tmp = 0
		if i == 0:
			tmp = base + abs(0 - A[i+1]) - (abs(0 - A[i]) + abs(A[i] - A[i+1]))
		elif i == N-1:
			tmp = base + abs(A[i-1] - 0) - (abs(A[i-1] - A[i]) + abs(A[i] - 0))
		else:
			tmp = base + abs(A[i-1] - A[i+1]) - (abs(A[i-1] - A[i]) + abs(A[i] - A[i+1]))
			
		print(tmp)
	
if __name__ == "__main__":
	main()


Measured memory_bytes: 23336
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a;
  int b;
  int i,j;
  
  
  // 変数aで入力を受け取る


  cin >> a >> b;
  for(i=0;i<b+2;i++){
    cout << "#";
  }
    cout << endl;
  vector <char> vec(b);
  for(j=0;j<a;j++){
  for (i=0;i<b;i++){
    cin >> vec.at(i);
  }
  cout<<"#";
  for(i=0;i<b;i++){
  cout << vec.at(i);
  }
  cout<< "#"<< endl;
  }
  for(i=0;i<b+2;i++){
    cout << "#";
  }
  cout << endl;
  
}
    


Measured memory_bytes: 3600
N, C = map(int, input().split())
STC = [[*map(int, input().split())] for _ in range(N)]
mx_t = 200002
R = [0]*mx_t
for cc in range(1, C+1):
    TZ = [0]*mx_t
    for s,t,c in STC:
        if c == cc:
            TZ[2*s - 1] += 1
            TZ[2*t] -= 1
    for i in range(mx_t - 1):
        TZ[i+1] += TZ[i]
        if TZ[i+1] > 0: R[i+1] += 1
print(max(R))



Measured memory_bytes: 122188
#include <bits/stdc++.h>
using namespace std;
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
typedef pair<int, int> Pint;
typedef pair<int64_t, int64_t> Pll;
typedef int64_t ll;

int main() {
    double A, B, H, M;
    cin >> A >> B >> H >> M;
    long double S = min(abs(30 * H + 0.5 * M - 6 * M), abs(360 - 30 * H - 0.5 * M+ 6 * M));
    cout << setprecision(13)<< fixed << pow(A * A + B * B - 2 * A * B * cos(S / 180 * (long double)(3.1415926535897932)), 0.5) << endl;
}

Measured memory_bytes: 4152
n = int(input())

score = [0,0]
for _ in range(n):
    card = list(map(str, input().split()))
    if card[0] > card[1]:
        score = list(map(lambda x,y: x+y, score, [3,0]))
    elif card[0] < card[1]:
        score = list(map(lambda x,y: x+y, score, [0,3]))
    else:
        score = list(map(lambda x,y: x+y, score, [1,1]))
print(*score)


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

using namespace std;

typedef pair <int, int> cell;

#define x first
#define y second
#define mp make_pair

const int N = 205;

int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};

char g[N][N];
int h, w, sx, sy, d[N][N];
int princess;
vector <int> soldiers;

bool valid (int x, int y) {
	return x >= 1 and y >= 1 and x <= h and y <= w and g[x][y] != '#';
}

void bfs (void) {
	queue <cell> q;
	q.push(mp(sx, sy));
	memset(d, -1, sizeof d);
	d[sx][sy] = 0;

	while (not q.empty()) {
		cell u = q.front(); q.pop();
		for (int k = 0; k < 4; ++k) {
			int nx = u.x + dx[k], ny = u.y + dy[k];
			if (!valid(nx, ny)) continue;
			if (d[nx][ny] != -1) continue;

			d[nx][ny] = d[u.x][u.y] + 1;
			q.push(mp(nx, ny));

			if (g[nx][ny] == '@') princess = d[nx][ny];
			else if (g[nx][ny] == '$') soldiers.push_back(d[nx][ny]);
		}
	}
}

int main (int argc, char const *argv[]) {
	scanf("%d %d", &h, &w);
	for (int i = 1; i <= h; ++i) {
		scanf("%s", g[i] + 1);
		for (int j = 1; j <= w; ++j) {
			if (g[i][j] == '%') sx = i, sy = j;  
		}
	}

	bfs();

	int flag = 1;
	for (int i = 0; i < (int) soldiers.size(); ++i) {
		if (soldiers[i] <= princess) {
			flag = 0;
			break;
		}
	}

	puts(flag ? "Yes" : "No");
    return 0;
}

Measured memory_bytes: 3500
import sys
sys.setrecursionlimit(10**8)
N = int(input())
num_edges = N-1
edges = [list(map(int, input().split())) for i in range(num_edges)]

adj = [[] for i in range(N+1)]
for ed in edges:
    adj[ed[0]] += [[ed[1], ed[2]]]
    adj[ed[1]] += [[ed[0], ed[2]]]
col_list = [-1 for i in range(N+1)]
def recfun(v, col):
    col_list[v] = col #色を更新
    for ed in adj[v]: #隣接する頂点をみる
        if col_list[ed[0]] == -1: #更新していない場合
            if ed[1] % 2 == 0:
                recfun(ed[0], col) #偶数なら同じ色でその先をみる
            else:
                recfun(ed[0], 1-col) #奇数なら違う色でその先をみる
recfun(1, 0)
for col in col_list[1:]:
    print(col)

Measured memory_bytes: 162904
#include <bits/stdc++.h>
using namespace std;
#define INF 2147483647
#define INFF 9223372036854775807
#define ll long long
#define pb push_back
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,m,n) for(int i=m;i<n;i++)
#define ALL(N) (N.begin(),N.end())

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N, ans=0;
  string S;
  cin >> N >> S;
  for(int i=0; i<(N/2); i++) {
    if(S[i]!=S[i+(N/2)]) {
      ans=1;
      break;
    }
  }
  if(N%2==1) ans=1;
  if(ans==0) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 256
import sys

n=int(input())
A=list(map(int,input().split()))

if n==1:
    print(1)
    sys.exit()


A.sort()
A_max=A[-1]

dp=[False]*(A_max+1)
ans=0

temp=A[0]
while True:
    if temp>A_max:
        break
    dp[temp]=True
    temp+=A[0]

if A[0]!=A[1]:
    ans+=1


for i in range(1,n-1):
    if dp[A[i]]:
        continue

    temp=A[i]
    while True:
        if temp>A_max:
            break
        dp[temp]=True
        temp+=A[i]
    
    if A[i-1]!=A[i] and A[i]!=A[i+1]:
        ans+=1


if not dp[A[n-1]] and A[n-2]!=A[n-1]:
    ans+=1

print(ans)


    










Measured memory_bytes: 32340
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))

char s[110];
int main(){
	scanf("%s",s);
	ll n=strlen(s);
	printf("%c%lld%c",s[0],n-2,s[n-1]);
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define FOR(i,l,r) for(i=l;i<r;i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define P pair<ll,ll>
#define F first
#define S second
signed main(){
  ll N,A,B,i,ans=0;cin>>N>>A>>B;ll X[N];REP(i,N)cin>>X[i];
  REP(i,N-1)ans+=min(A*(X[i+1]-X[i]),B);
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 4392
#include<bits/stdc++.h>
//#include<iostream>
//#include<cstdio>
//#include<stdlib.h>
//#include<string.h>
//#include<algorithm>
using namespace std;
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define READ freopen("in.txt","r",stdin)
#define WRITE freopen("out.txt","w",stdout);
#define pb push_back
#define mem(arr,val) memset(arr,val,sizeof(arr))
#define sf(x) scanf("%d",&x)
#define sf2(x,y) scanf("%d %d",&x,&y)
#define sf3(x,y,z) scanf("%d %d %d",&x,&y,&z)
#define sl(x) scanf("%lld",&x)
#define sl2(x,y) scanf("%lld %lld",&x,&y)

#define sl3(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)
#define sd(x) scanf("%lf",&x);
#define pLL pair<long long,long long>
#define pDB pair<double,double>
#define ff first
#define sn second
#define PRINT_CASE  printf("Case %d: ",tc++)
#define PRINT_CASENL  printf("Case %d:\n",tc++)
//#define mx 100005
#define lnd tree[ind<<1]
#define rnd tree[(ind<<1)+1]
#define cnd tree[ind]
#define lndp b,(b+e)>>1,(ind<<1)
#define rndp ((b+e)>>1)+1,e,(ind<<1)+1
#define IN(a,x,y) (a>=x && a<=y)
#define popcountL __builtin_popcountll
#define popcount __builtin_popcount
/// int other=mask^((1<<n)-1);
typedef long long ll;
typedef long long int lln;
typedef pair<int,int> pii;
ll INF=1<<28;
//typedef long long lld;
const double PI=acos(-1.0);
//int fx[]={1,-1,0,0}; //direction array
//int fy[]={0,0,1,-1};
int dir[4][2]={1,0,-1,0,0,-1,0,1};
int knight[8][2]={1,2,1,-2,2,1,2,-1,-1,2,-1,-2,-2,1,-2,-1};
const long double EPS=1e-7;
//#define INF 10000

struct compare
{
  bool operator()(const pair<int,pii>& l, const pair<int,pii>& r)
  {
      if(l.ff==r.ff)
      {
          return l.sn.ff>r.sn.ff;
      }
      return l.ff<r.ff;
  }
};
// bool operator<(pair<int,pii> l, pair<int,pii> r)
//  {
//      if(l.ff==r.ff)
//      {
//          cout<<"ok "<<endl;
//          return l.sn.ff<r.sn.ff;
//      }
//      return l.ff>r.ff;
//  }

/////////////////////////////////////template sesh/////////////////////////////////////////////////////

///code goes from here
const int mx=300015;
///
int mod=1e9+7;
int main()
{
//    SPEED;
    int t,tc=1;
    t=1;
    while(t--)
    {
        ll D,T,S;
        sl3(D,T,S);
        ll gese=T*S;
        if(gese>=D)
        {
            cout<<"Yes"<<endl;
        }
        else
            cout<<"No"<<endl;

    }



    return 0;
}



Measured memory_bytes: 3756
#include<bits/stdc++.h>
#include <math.h>
#include <cmath>
#include <limits>
#include <iostream>
#include <assert.h>

#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define yesno(flg) if(flg){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define MAX_N 1002
#define i197 1000000007

using namespace std;

typedef long long ll;
typedef pair<ll,ll> P1;
typedef pair<int,int> Pi;
typedef pair<double,Pi> Pdi;
typedef pair<ll,int>Pli;
typedef pair<P1,ll> P2;
const ll INF=1000000000000000001;
struct edge{int to,cost;};
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
struct Road{double cost;int a,b;};
int main(){

	int n;
	int x[9],y[9];

	cin>>n;
	rep(i,n){
		cin>>x[i]>>y[i];
	}
	double t2=0;
	rep(i,n-1){
		for(int j=i+1; j<n; j++){
			int k;
			k=(x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]);
			t2+=sqrt(k);
		}
	}
	cout<<setprecision(11)<<((double)t2*2)/n<<endl;

	return 0;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int M,N;
  cin>>M>>N;
  vector<pair<pair<int,int>,int>> A(N);
  for(int i=0;i<N;i++){
    cin>>A[i].first.second>>A[i].first.first;
    A[i].second=i;
  }
  sort(A.begin(),A.end());
  vector<int> B(M+1,1),C(N),D(N);
  for(int i=0;i<N;i++){
    C[A[i].second]=B[A[i].first.second];
    B[A[i].first.second]++;
    D[A[i].second]=A[i].first.second;
  }
  for(int i=0;i<N;i++){
    for(int j=to_string(D[i]).size();j<6;j++)
      cout<<0;
    cout<<D[i];
    for(int j=to_string(C[i]).size();j<6;j++)
      cout<<0;
    cout<<C[i]<<endl;
  }
}


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

int main() {
string S;
cin >> S;
string a, b;
int L =S.size();
a = S.substr(0, (L-1)/2);
b = S.substr((L+3)/2-1, (L-1)/2);
string sinv=S, ainv=a, binv=b;
reverse(S.begin(), S.end());
reverse(a.begin(), a.end());
reverse(b.begin(), b.end());
if(a==ainv && S==sinv && b == binv) cout << "Yes" << endl;
else cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 3620