akhauriyash/Code-Regression huggingface dataset:
//PKMKB
#include <bits/stdc++.h>
#define ll long long int
#define max(a,b) (a>b?a:b)
#define min(a,b) (a<b?a:b)
#define scanarr(a,b,c) for( i=b;i<c;i++)cin>>a[i]
#define showarr(a,b,c) for( i=b;i<c;i++)cout<<a[i]<<' '
#define ln cout<<'\n'
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);
#define mod 1000000007
#define MAX 100005
using namespace std;
////////////////////////////////////////////////////////////////CODE STARTS HERE////////////////////////////////////////////////////////////////

void solve(){
    
    char c;
    cin >> c;
    char ans = 'A';

    if( c >= 'a' && c <= 'z')
        ans = 'a';
    
    cout << ans << endl;
}
int main(){
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    #endif
    
        solve();
}

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

using namespace std;

void warshall_floid(vector<vector<int>> &matrix){
    for(int k=0; k<matrix.size(); k++){
        for(int i=0; i<matrix.size(); i++){
            for(int j=0; j<matrix.size(); j++){
                if (matrix[i][j]>matrix[i][k]+matrix[k][j]){
                    matrix[i][j]=matrix[i][k]+matrix[k][j];
                }
            }
        }
    }
}

int main(){
    int H,W;
    cin >> H >> W;

    vector<vector<int>> c(10, vector<int>(10,0));

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

    warshall_floid(c);
    int ans=0;
    for(int i=0; i<H; i++){
        for(int j=0; j<W; j++){
            int A;
            cin >> A;
            if(A>=0){
                ans+=c[A][1];
            }
        }
    }
    cout << ans << '\n';
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using VI = vector<int>;
using VL = vector<ll>;
using loop = int;
template<class T> using PQ = priority_queue<T, vector<T>, greater<T>>;
#define FOR(i,a,n) for(loop (i)=(a);(i)<(n);++(i))
#define eFOR(i,a,n) for(loop (i)=(a);(i)<=(n);++(i))
#define rFOR(i,a,n) for(loop (i)=(n)-1;(i)>=(a);--(i))
#define erFOR(i,a,n) for(loop (i)=(n);(i)>=(a);--(i))
#define each(i, a) for(auto &i : a)
#define SORT(i) sort((i).begin(),(i).end())
#define rSORT(i,a) sort((i).begin(),(i).end(),(a))
#define all(i) (i).begin(),(i).end()
#define out(y,x) ((y) < 0 || h <= (y) || (x) < 0 || w <= (x))
#define line cout << "------------------------\n" 
#define ENDL(i,n) ((i) == (n) - 1 ? "\n" : " ")
#define stop system("pause") //comment out this on AOJ.
constexpr ll INF = 1000000000;
constexpr ll LLINF = 1LL << 60;
constexpr ll mod = 1000000007;
constexpr ll MOD = 998244353;
constexpr ld eps = 1e-10;
constexpr ld pi = 3.1415926535897932;
template<class T>inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; }return false; }
template<class T>inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; }return false; }
inline void init() { cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); }
template<class T>inline istream& operator>>(istream& is, vector<T>& v) { for (auto& elemnt : v)is >> elemnt; return is; }
template<class T, class U>inline istream& operator>>(istream& is, pair<T, U>& p) { is >> p.first >> p.second; return is; }
template<class T>inline vector<T> vec(size_t a) { return vector<T>(a); }
template<class T>inline vector<T> defvec(T def, size_t a) { return vector<T>(a, def); }
template<class T, class... Ts>inline auto vec(size_t a, Ts... ts) { return vector<decltype(vec<T>(ts...))>(a, vec<T>(ts...)); }
template<class T, class... Ts>inline auto defvec(T def, size_t a, Ts... ts) { return vector<decltype(defvec<T>(def, ts...))>(a, defvec<T>(def, ts...)); }

int main() {
    init();

    int n; cin >> n;
    cout << int(sqrt(n)) * int(sqrt(n)) << "\n";
}

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

using namespace std;

#define int long long
#define rep(i,n) for(int i = 0; i < (n); i++)
#define endl "\n"

const long long INF = (long long)1e18;
const long long MOD = (long long)1e9 + 7; 

string yn(bool f){return f?"Yes":"No";}
string YN(bool f){return f?"YES":"NO";}

#define MAX

signed main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(10);
	
	string s;
	int r[30] = {};
	int count = 0;
	cin>>s;
	
	for(int i = 0; i < 4; i++){
		
		if(r[s[i] - 'A'] == 0) count++;
		r[s[i] - 'A']++;
	}
	
	if(count != 2) cout<<"No"<<endl;
	else {
		for(int i = 0; i < 26; i++){
			if(r[i] != 2 && r[i] != 0){
				cout<<"No"<<endl;
				return 0;
			}
		}
		cout<<"Yes"<<endl;
	}
	
	
	return 0;
}

Measured memory_bytes: 764
require 'set'
def solve(str1, str2, words)
  dp = 10.times.map{ Set.new }
  dp[0] << str1
  (1..9).each do |count|
    dp[count - 1].each do |w|
      words.each do |s1, s2|
        if w.include?(s1)
          word = w.gsub(s1, s2)
          return count if word == str2
          dp[count] << word if word.length <= 10
        end
      end
    end
    return -1 if dp[count].all?{ |w| w.length > 10 }
  end
  -1
end

while n = gets.to_i
  break if n == 0
  words = n.times.map{ gets.split }
  str1 = gets.chomp
  str2 = gets.chomp
  puts solve(str1, str2, words)
end

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

#define inrep int t; cin >> t; for(int tc=1; tc<=t; tc++)
#define ios ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

int main()
{
	ios;
	long long n, a, b; cin >> n >> a >> b;
	cout << min(a*n, b) <<"\n";
}


Measured memory_bytes: 256
from collections import Counter
N,M=map(int,input().split())
a=list(map(int,input().split()))
s=[a[0]]
if N==1:
    if a[0]%M==0:
        print(1)
    else:
        print(0)
else:
    for i in range(N-1):
        s.append(s[i]+a[i+1])
    for i in range(N):
        s[i]%=M
    count=0
    b=Counter(s)
    c=b.most_common()
    def calc(n):
        ans=0
        for i in range(1,n+1):
            ans+=i
        return ans
    for i in range(len(c)):
        if c[i][1]!=1:
            count+=calc(c[i][1]-1)
            if c[i][0]==0:
                count+=c[i][1]
        else:
            break
    print(count)

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

typedef pair<ld,ld> pd;
vector<pd> V[MAXN];
vector<ti3> elist;
ld dist[MAXN];
int32_t main() {
	IAMSPEED
	// set testing to 0 when submitting to judge
	cout << fixed << setprecision(11);
	cerr << fixed << setprecision(10);
	ld sx,sy,ex,ey;cin>>sx>>sy>>ex>>ey;
	int n;cin>>n;
	elist.pb(ti3(sx,sy,(ld)0));
	elist.pb(ti3(ex,ey,(ld)0));
	FOR(i,1,n) {
		ld a,b,c;cin>>a>>b>>c;
		elist.pb(ti3(a,b,c));
	}
	int i = 0;
	for (auto vv:elist) {
		ld a = get<0>(vv);
		ld b = get<1>(vv);
		ld c = get<2>(vv);
		FOR(j,0,i-1) {
			ld x = get<0>(elist[j]);
			ld y = get<1>(elist[j]);
			ld z = get<2>(elist[j]);
			ld d1 = abs(x-a)*abs(x-a);
			ld d2 = abs(y-b)*abs(y-b);
			ld cost = sqrtl(d1+d2);
			cost=cost-z-c;
			maxself(cost,(ld)0);
			db2(i,j);
			V[i].pb(pd(j,cost));
			V[j].pb(pd(i,cost));
		}
		++i;
	}
	FOR(j,0,n+1) {
		dbvp(V[j]);
	}
	priority_queue<pd,vector<pd>,greater<pd>>pq;
	pq.push(pd(0,0));
	FOR(j,0,MAXN-1)dist[j]=-1;
	dist[0]=0;
	while(pq.size()) {
		pd c = pq.top();pq.pop();
		ld d = c.f;
		int x = c.s;
		if(dist[x]<d)continue;
		for (auto v:V[x]) {
			int nx = v.f;
			ld nd = d+v.s;
			if(dist[nx]==-1||dist[nx]>nd) {
				dist[nx]=nd;
				pq.push(pd(nd,nx));
			}
		}
	}
	cout << dist[1];
}


Measured memory_bytes: 42128
import java.util.*;
import java.io.*;
 
public class Main {
    static boolean[][] used;
    static int[] ans;
    public static void main(String[] args) throws Exception {
        FastScanner sc = new FastScanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        if(a > 0){
            System.out.println("Positive");
        }else if(a <= 0 && b >= 0){
            System.out.println("Zero");
        }else{
            if(Math.abs(b-a) % 2 != 0){
                System.out.println("Positive");
            }else{
                System.out.println("Negative");
            }
        }
    }
}

class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;
    public FastScanner(InputStream in) {
        reader = new BufferedReader(new InputStreamReader(in));
        tokenizer = null;
    }

    public String next() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public String nextLine() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken("\n");
    }

    public long nextLong() {
        return Long.parseLong(next());
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public double nextDouble() {
         return Double.parseDouble(next());
    }

    public int[] nextIntArray(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = nextInt();
        return a;
    }

    public long[] nextLongArray(int n) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++)
            a[i] = nextLong();
        return a;
    } 
}


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

int main() {
	int a, b, c;
	cin >> a;
	if(a < 1200){
		cout << "ABC" << endl;
	}else if(1200 <= a && a < 2800){
		cout << "ARC" << endl;
	}else{
		cout << "AGC" << endl;
	}
	// your code goes here
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
  int a,b;
  char z;
  while(1){
    cin>>a>>z>>b;
    if(z=='?'){
      break;
    }
    if(z=='+'){
      cout<<a+b<<endl;
    }
    if(z=='-'){
      cout<<a-b<<endl;
    }
    if(z=='*'){
      cout<<a*b<<endl;
    }
    if(z=='/'){
      cout<<a/b<<endl;
    }
  }
  return(0);
}

Measured memory_bytes: 3108
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
#include<cstring> 
using namespace std;
const int M = 1e5 + 50;
long long dp[M][13] = {0};
const int MOD = 1e9 + 7;
int main(){
	string s;
	cin>>s;
	memset(dp,0,sizeof(dp));
	if(s[0] == '?'){
		for(int i = 0; i < 10;i++)
			dp[0][i] = 1;
	}
	else
		dp[0][s[0]-'0'] = 1;
	for(int i = 1; i < s.length();i++){
		if(s[i] == '?'){
			for(int j = 0; j < 13;j++){
				for(int k = 0; k < 10;k++){
					dp[i][(j*10+k)%13] += dp[i-1][j];
					dp[i][(j*10+k)%13]%=MOD;
				} 
			}
		}
		else{
			for(int k = 0 ;k < 13; k++){
				dp[i][((s[i]-'0')+10*k)%13] += dp[i-1][k];
				dp[i][((s[i]-'0')+10*k)%13]%=MOD;
			}
		}
//		for(int j = 0 ; j < 13; j++)
//			cout<<dp[i-1][j]<<endl;
//		for(int j = 0; j < 13;j++)
//			dp[i][j]%=MOD;
	}
	cout<<dp[s.length()-1][5]<<endl;
	return 0;
} 

Measured memory_bytes: 10624
#include<bits/stdc++.h>
#define int long long
#define mod 1000000007
#define all(x) x.begin(),x.end()
using namespace std;
void solve() {
    int n;
    cin>>n;
    int arr[n];
    for(int i=0;i<n;++i)
    {
        cin>>arr[i];
    }
    sort(arr,arr+n);
    int cnt=0;
    for(int i=n-1;i>=1;--i)
    {
        int l=0,r=i-1;
        while(l<r){
            if(arr[l]+arr[r]>arr[i]){
                cnt+=r-l;
                r--;
            }
            else l++;
        }
    }
    cout<<cnt;
}
int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int t = 1;
    //cin>>t;
    while (t--) solve();
}


Measured memory_bytes: 3608
using System;
using System.Linq;
using System.Collections.Generic;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            MainStream();
        }
        static void MainStream()
        {
            Scan sc = new Scan();
            write wr = new write();

            int n = sc.intarr[0];
            int a = sc.intarr[0];

            if(n % 500 <= a)
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }
        }


    }

    class Scan
    {
        public string str => Console.ReadLine();

        public string[] strarr => str.Split(' ');

        public long[] longarr => strarr.Select(long.Parse).ToArray();
        public int[] intarr => strarr.Select(int.Parse).ToArray();
        public char[] chararr => str.ToArray();


    }



    class write
    {
        public void wri<Type>(Type x)
        {
            Console.WriteLine(x);
        }
    }

    class Method
    {
        static public int max(params int[] nums)
        {

            int maxx = nums[0];
            for (int i = 1; i < nums.Length; i++)
            {
                maxx = Math.Max(maxx, nums[i]);
            }
            return maxx;
        }
    }
}


Measured memory_bytes: 13268
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    d, t, s = LI()
    if d > t * s:
        print("No")
    else:
        print("Yes")

main()



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

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

  // 1. DP配列全体を「DPの種類に応じた初期値」で初期化
  // 2. 初期条件を入力
  // dp[pos(sition)][len(gth)][current] = bool
  vector<vector<vector<bool>>> dp(n+1, vector<vector<bool>>(4, vector<bool>(1000, false)));

  dp.at(0).at(0).at(0) = true;

  // 3. ループを回す
  // i=position
  for (int i = 0; i < n; i++) {
    // j=length
    for (int j = 0; j < 4; j++) {
      // k=current
      for (int k = 0; k < 1000; k++) {
        if (dp.at(i).at(j).at(k) == false) { continue; }

        // 例 n=4, s=0224
        //
        // 0 0 0
        //   1 0 0   = true
        //   1 1 "0" = true
        // 0 0 1 〜 0 0 999
        // 0 1 0 〜 0 1 999
        // 0 2 0 〜 0 2 999
        // 0 3 0 〜 0 3 999
        //   この状態にできないため false であり、continue
        // 1 0 0
        //   2 0 0     = true // 次の文字を残さない
        //   2 1 "2"   = true // 次の文字を残す
        // 1 1 "0"
        //   2 1 "0"   = true
        //   2 2 "02"  = true
        // 2 0 0
        //   3 0 0     = true
        //   3 1 "2"   = true
        // 2 1 "2"
        //   3 1 "2"   = true
        //   3 2 "22"  = true
        // 2 1 "0"
        //   3 1 "0"   = true
        //   3 2 "02"  = true
        // 2 2 "02"
        //   3 2 "02"  = true
        //   3 3 "022" = true
        // 3 0 0
        //   4 0 0     = true
        //   4 1 "4"   = true
        // 3 1 "2"
        //   4 1 "2"   = true
        //   4 2 "23"  = true
        // 3 1 "0"
        //   4 1 "0"   = true
        //   4 2 "04"  = true
        // 3 2 "22"
        //   4 2 "22"  = true
        //   4 3 "224" = true
        // 3 2 "02"
        //   4 2 "02"  = true
        //   4 3 "024" = true
        // 3 3 "022"
        //   4 3 "022" = true
        //   (j = 3 のため、この処理は行われない) 4 4 xxx

        // ### 文字を残さない場合
        // 文字を残さないため、length と current は変わらない。
        // position だけ1進める。
        //
        // 例えば、db[0][0][0] から dp[1][0][0] に遷移した場合、
        // length も current も上限をあふれないため、この状態にできるため
        // dp[1][0][0] = true に更新する。
        dp.at(i+1).at(j).at(k) = true;

        // ### 文字を残す場合
        // j = 3 の状態で文字を残すと4桁になるため、j <= 2 とする
        if (j <= 2) {
          // pos: ポジションを1つ前に進める。
          // len: そのポジションの数字を残すため、len をインクリメントする。
          // current: 遷移元で残していた数字が 22 の場合、22 * 10 = 220 で桁をあげる。文字列 s から残す数字を取得し、1桁目にセットする。
          dp.at(i+1).at(j+1).at(k*10 + (s.at(i)-'0')) = true;
        }
      }
    }
  }

  // 4. テーブルから解を得て出力
  int ans = 0;
  for (int k = 0; k < 1000; k++) {
    if (dp.at(n).at(3).at(k) == true) {
      ans++;
    }
  }

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


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

using namespace std;

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

#define each(i,a) for (auto&& i : a)
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
#define pb push_back
#define all(a) (a).begin(),(a).end()
#define chmin(x,v) x = min(x, v)
#define chmax(x,v) x = max(x, v)

const ll linf = 1e18;
const int inf = 1e9;
const double eps = 1e-12;
const double pi = acos(-1);

template<typename T>
istream& operator>>(istream& is, vector<T>& vec) {
    each(x,vec) is >> x;
    return is;
}
template<typename T>
ostream& operator<<(ostream& os, const vector<T>& vec) {
    rep(i,vec.size()) {
        if (i) os << " ";
        os << vec[i];
    }
    return os;
}
template<typename T>
ostream& operator<<(ostream& os, const vector< vector<T> >& vec) {
    rep(i,vec.size()) {
        if (i) os << endl;
        os << vec[i];
    }
    return os;
}

const ll n = 10;
vector<vector<ll>> A(n, vector<ll>(n));
ll f(ll a, ll b) {
    return A[a][b];
}
ll f(const vector<ll>& v) {
    ll res = 0;
    rep(i, 0, v.size()) {
        res = f(res, v[i]);
    }
    return res;
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> A;
    ll ans = 0;
    rep(i, 10000) {
        vector<ll> v(4);
        ll k = i;
        rep(j, 4) {
            v[3-j] = k % 10;
            k /= 10;
        }
        v.pb(f(v));
        assert(f(v) == 0);
        try {
            rep(j, 5) rep(k, 10) {
                if (v[j] == k) continue;
                vector<ll> nv = v;
                nv[j] = k;
                if (f(nv) == 0) throw 1;
            }
            rep(j, 4) {
                if (v[j] == v[j+1]) continue;
                vector<ll> nv = v;
                swap(nv[j], nv[j+1]);
                if (f(nv) == 0) {
                    // cout << v << endl;
                    // cout << nv << endl;
                    // cout << endl;
                    throw 1;
                }
            }
        }
        catch (int err) {
            ++ans;
        }
    }
    cout << ans << endl;
}

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

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;
  if (A + B > C + D) {
    cout << "Left";
  }
  else if (A + B < C + D) {
    cout << "Right";
  }
  else {
    cout << "Balanced";
  }
}

Measured memory_bytes: 256
N = input()

def rest_nine(x):
  for i in range(1, len(x)):
    if int(x[i]) != 9:
      return False
  return True

if rest_nine(N):
  print(int(N[0])+(len(N)-1)*9)
else:
  print(int(N[0])-1+(len(N)-1)*9)

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

int main() {
  int h, w;
  cin >> h >> w;
  vector<vector<char>> a(h, vector<char>(w));
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      cin >> a.at(i).at(j);
    }
  }
  vector<bool> row(h, 0);//行のうち出力すべきものを保持する
  vector<bool> col(w, 0);//列のうち出力すべきものを保持する
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      if (a.at(i).at(j) == '#') {
        row.at(i) = 1;
        break;
      }
    }
  }
  for (int j = 0; j < w; j++) {
    for (int i = 0; i < h; i++) {
      if (a.at(i).at(j) == '#') {
        col.at(j) = 1;
        break;
      }
    }
  }
    
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      if (row.at(i) and col.at(j))
      cout << a.at(i).at(j);
    }
    if (row.at(i))
      cout << endl;
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h> 
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
ll INFL = 1000000000000000010;//10^18 = 2^60
int INF = 2147483600;//10^9
ll MOD  = 1000000007;
int N,M;
int a[2010];
int b[2010];
ll c[2010];
ll cost[2010];


void BF(int m){
    for(int i = 0; i < m; i++){
        if(cost[a[i]] + c[i] > cost[b[i]]){
            cost[b[i]] = cost[a[i]] + c[i];
        }
    }
}




int main(void){
    // Your code here!
    cin >> N >> M;
    for(int i = 0; i < M; i++){
        cin >> a[i] >> b[i] >> c[i];
        a[i]--;
        b[i]--;
    }
    for(int i = 0; i < N; i++){
        cost[i] = (-1) * INFL;
    }
    cost[0] = 0;
    
    
    ll ans;
    for(int i = 0; i < N+10; i++){
        BF(M);
    }
    
    ans = cost[N-1];
    
    
    for(int i = 0; i < N+10; i++){
        BF(M);
    }
    
    if(ans != cost[N-1]){
        cout << "inf" << endl;
    }else{
        cout << ans << endl;
    }
    
    
    
}



Measured memory_bytes: 256
#include"bits/stdc++.h"
using namespace std;
typedef long long ll;
const ll MOD = (ll)(1e9+7);
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int (i)=0; (i)<(int)(n); (i)++)
#ifdef LOCAL
#define debug(x) cerr << #x << ": " << x << endl
#else
#define debug(x)
#endif
int dx[4]={ 1,0,-1,0 };
int dy[4]={ 0,1,0,-1 };

//累乗 O(log N)
long long power(long long x, long long N){
	if(N == 0) return 1LL;
	if(N == 1) return x;
	long long tmp = power(x, N/2);
	if(N%2 == 0) return tmp * tmp % MOD;
	else return tmp * tmp % MOD * x % MOD;
}

//逆元 O(log x)
long long inverse(long long x){
	return power(x, MOD-2);
}

//nCa = n!/{(n-a)!a!} = n(n-1)(n-2)...(n-a+1)/1.2.3.....a

ll N, a, b;
signed main(){
	cin >> N >> a >> b;
	ll ans = power(2, N)-1;

	ll tmp = 1;
	for(ll i=1; i<=a; i++){
		tmp *= (N-i+1);
		tmp %= MOD;
		tmp *= inverse(i);
		tmp %= MOD;
	}
	ans -= tmp;

	tmp = 1;
	for(ll i=1; i<=b; i++){
		tmp *= (N-i+1);
		tmp %= MOD;
		tmp *= inverse(i);
		tmp %= MOD;
	}
	ans -= tmp;

	cout << (ans+MOD+MOD)%MOD << endl;
}

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

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

  string S; cin >> S;
  string ans = "No";
  if (S == "hi") ans = "Yes";
  if (S == "hihi") ans = "Yes";
  if (S == "hihihi") ans = "Yes";
  if (S == "hihihihi") ans = "Yes";
  if (S == "hihihihihi") ans = "Yes";
  cout << ans << '\n';

  return 0;
}

Measured memory_bytes: 256
/*
confirm 0LL and 1LL
confirm cornercases such as 0
confirm times of cin < 10^6
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
using Pld = pair<ld, ld>;
using Vec = vector<ll>;
using VecP = vector<P>;
using VecB = vector<bool>;
using VecC = vector<char>;
using VecD = vector<ld>;
using VecS = vector<string>;
using Graph = vector<VecP>;
template <typename T>
using Vec1 = vector<T>;
template <typename T>
using Vec2 = vector<Vec1<T> >;
#define REP(i, m, n) for(ll (i) = (m); (i) < (n); ++(i))
#define REPN(i, m, n) for(ll (i) = (m); (i) <= (n); ++(i))
#define REPR(i, m, n) for(ll (i) = (m)-1; (i) >= (n); --(i))
#define REPNR(i, m, n) for(ll (i) = (m); (i) >= (n); --(i))
#define rep(i, n) REP(i, 0, n)
#define repn(i, n) REPN(i, 1, n)
#define repr(i, n) REPR(i, n, 0)
#define repnr(i, n) REPNR(i, n, 1)
#define all(s) (s).begin(), (s).end()
#define pb push_back
#define fs first
#define sc second
template <typename T>
bool chmax(T &a, const T b){if(a < b){a = b; return true;} return false;}
template <typename T>
bool chmin(T &a, const T b){if(a > b){a = b; return true;} return false;}
template <typename T>
ll pow2(const T n){return (1LL << n);}
template <typename T>
void cosp(const T n){cout << n << ' ';}
void co(void){cout << '\n';}
template <typename T>
void co(const T n){cout << n << '\n';}
template <typename T1, typename T2>
void co(pair<T1, T2> p){cout << p.fs << ' ' << p.sc << '\n';}
template <typename T>
void co(const Vec1<T> &v){for(T i : v) cosp(i); co();}
template <typename T>
void co(initializer_list<T> v){for(T i : v) cosp(i); co();}
template <typename T>
void ce(const T n){cerr << n << endl;}
void sonic(){ios::sync_with_stdio(false); cin.tie(0);}
void setp(const ll n){cout << fixed << setprecision(n);}
constexpr int INF = 1e9+1;
constexpr ll LINF = 1e18+1;
constexpr ll MOD = 1e9+7;
//constexpr ll MOD = 998244353;
constexpr ld EPS = 1e-11;
const ld PI = acos(-1);

ll dp[15][10] = {};
ll k;

string ans(ll x, ll y, ll sum){
	//co({x, y, sum});
	if(x < 0) return "";
	if(y < 9) sum -= dp[x - 1][y + 1];
	if(sum < k) return to_string(y) + ans(x - 1, y + 1, sum + dp[x - 1][y + 1]);
	sum -= dp[x - 1][y];
	if(sum < k) return to_string(y) + ans(x - 1, y, sum + dp[x - 1][y]);
	return to_string(y) + ans(x - 1, y - 1, sum);
}

int main(void){
	cin >> k;

	ll x, y;
	ll sum = 0;
	rep(i, 15){
		rep(j, 10){
			if(i == 0){
				dp[i][j] = 1;
			}else{
				dp[i][j] += dp[i - 1][j];
				if(j > 0) dp[i][j] += dp[i - 1][j - 1];
				if(j < 9) dp[i][j] += dp[i - 1][j + 1];
			}

			if(j) sum += dp[i][j];
			if(sum >= k){
				x = i, y = j;
				break;
			}
		}
		if(sum >= k) break;
	}

	co(ans(x, y, sum));

	return 0;
}


Measured memory_bytes: 256
let m = 1039999
let t = Array.make m "\000"

let split_on_char sep s =
  let open String in
  let r = ref [] in
  let j = ref (length s) in
  for i = length s - 1 downto 0 do
    if get s i = sep then begin
      r := sub s (i + 1) (!j - i - 1) :: !r;
      j := i
    end
  done;
  sub s 0 !j :: !r

let to_x = Array.make 128 0

let to_key s =
  let ret = ref 0 in
  let p = ref 1 in
  for i = 0 to String.length s - 1 do
    ret := !ret + !p * (to_x.(Char.code s.[i]));
    p := 5 * !p;
  done;
  !ret

let to_h1 k = k mod m
let to_h2 k = 1 + (k mod (m - 1))

let insert s =
  let k = to_key s in
  let h1 = to_h1 k in
  let h2 = to_h2 k in
  let rec doit i =
    let h = (h1 + h2*i) mod m in
    if t.(h) = s then ()
    else if t.(h) = "\000" then t.(h) <- s
    else doit (i + 1) in
  doit 0

let find s =
  let k = to_key s in
  let h1 = to_h1 k in
  let h2 = to_h2 k in
  let rec doit i =
    let h = (h1 + h2*i) mod m in
    if t.(h) = s then true
    else if t.(h) = "\000" then false
    else doit (i + 1) in
  doit 0

let () =
  to_x.(Char.code 'A') <- 1;
  to_x.(Char.code 'C') <- 2;
  to_x.(Char.code 'G') <- 3;
  to_x.(Char.code 'T') <- 4;
  let n = read_int () in
  for _ = 0 to n - 1 do
    match split_on_char ' ' (read_line ()) with
    | ["find"; s] -> print_endline (if find s then "yes" else "no")
    | [_; s] -> insert s
    | _ -> assert false
  done

Measured memory_bytes: 20724
for a in iter(input,'0 0'):
 m=[input()for _ in[0]*int(a.split()[0])]
 y=x=0;s={(0,0)}
 while'.'!=m[y][x]:
  c=m[y][x]
  if'>'==c:x+=1;
  if'v'==c:y+=1;
  if'<'==c:x-=1;
  if'^'==c:y-=1;
  if(x,y)in s:print('LOOP');break
  else:s|={(x,y)}
 else:print(x,y)


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

#define rep(i,n) for(int i = 0;i<n;i++)
#define vv(Type,Name, n,m,d)vector<vector<Type>> Name(n, vector<Type>(m, d))
#define P pair
using namespace std;
using ll = long long;


int main(void) {

	ios::sync_with_stdio(false);
	cin.tie(0);

	string str, sstr;

	cin >> str >> sstr;

	int S = str.length();
	int SS = sstr.length();

	int ans = SS;
	rep(i, S - SS+1) {
		int cnt = 0;

		rep(j, SS){
		//	cout << str[i + j] << flush;
			if (str[i + j] != sstr[j]) cnt++;
		}
		ans = min(ans, cnt);
		//cout << endl;
	}


	cout << ans << endl;



	return 0;
}


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

typedef long long   signed int LL;
typedef long long unsigned int LU;

#define incID(i, l, r) for(int i = (l)    ; i <  (r); i++)
#define incII(i, l, r) for(int i = (l)    ; i <= (r); i++)
#define decID(i, l, r) for(int i = (r) - 1; i >= (l); i--)
#define decII(i, l, r) for(int i = (r)    ; i >= (l); i--)
#define  inc(i, n) incID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define  dec(i, n) decID(i, 0, n)
#define dec1(i, n) decII(i, 1, n)

#define inII(v, l, r) ((l) <= (v) && (v) <= (r))
#define inID(v, l, r) ((l) <= (v) && (v) <  (r))

#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define PQ priority_queue

#define  ALL(v)  v.begin(),  v.end()
#define RALL(v) v.rbegin(), v.rend()
#define  FOR(it, v) for(auto it =  v.begin(); it !=  v.end(); ++it)
#define RFOR(it, v) for(auto it = v.rbegin(); it != v.rend(); ++it)

template<typename T> bool   setmin(T & a, T b) { if(b <  a) { a = b; return true; } else { return false; } }
template<typename T> bool   setmax(T & a, T b) { if(b >  a) { a = b; return true; } else { return false; } }
template<typename T> bool setmineq(T & a, T b) { if(b <= a) { a = b; return true; } else { return false; } }
template<typename T> bool setmaxeq(T & a, T b) { if(b >= a) { a = b; return true; } else { return false; } }
template<typename T> T gcd(T a, T b) { return (b == 0 ? a : gcd(b, a % b)); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }

// ---- ----

const int B = 17;
int n, x[100000], l, q, s[100001][B];

int main() {
	cin >> n;
	inc(i, n) { cin >> x[i]; }
	cin >> l;
	
	{ int j = n - 1;
	dec(i, n) {
		while(! (x[j] - x[i] <= l)) { j--; }
		s[i][0] = j;
	}
	}
	s[n - 1][0] = s[n][0] = n;
	
	inc(k, B - 1) {
	inc(i, n + 1) {
		s[i][k + 1] = s[s[i][k]][k];
	}
	}
	
	cin >> q;
	inc(qq, q) {
		int a, b;
		cin >> a >> b;
		a--; b--;
		if(a > b) { swap(a, b); }
		
		int ans = 0;
		dec(k, B) { if(s[a][k] <= b) { a = s[a][k]; ans += (1 << k); } }
		if(a != b) { ans++; }
		
		cout << ans << "\n";
	}
	
	return 0;
}


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

int main() {
  int A, B;
  cin >> A;
  cin >> B;
  vector<int> tax_8per(2);
  vector<int> tax_10per(2);
  
  if (A * 100 % 8) {
    tax_8per.at(0) = A * 100 / 8 + 1;
  } else {
    tax_8per.at(0) = A * 100 / 8;
  }
  
  if ((A + 1) * 100 % 8) {
    tax_8per.at(1) = (A + 1) * 100 / 8;
  } else {
    tax_8per.at(1) = (A + 1) * 100 / 8 - 1;
  }
  
  tax_10per.at(0) = B * 100 / 10;
  tax_10per.at(1) = (B + 1) * 100 / 10 - 1;

  if (tax_8per.at(0) < tax_10per.at(0)) {
    if (tax_8per.at(1) < tax_10per.at(0)) {
      cout << "-1" << endl;
    } else {
      cout << tax_10per.at(0) << endl;
    }
  } else {
    if (tax_10per.at(1) < tax_8per.at(0)) {
      cout << "-1" << endl;
    } else {
      cout << tax_8per.at(0) << endl;
    }
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(void){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(15);

    int a,b;
    cin>>a>>b;
    a--;
    b--;
    cout<<(b+a-1)/a<<endl;
    return 0;
}

Measured memory_bytes: 3640
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
sys.setrecursionlimit(10**7)
from pprint import pprint as pp
from pprint import pformat as pf
# @pysnooper.snoop()
#import pysnooper # debug

import math
#from sortedcontainers import SortedList, SortedDict, SortedSet # no in atcoder
import bisect


if __name__ == '__main__':
    n, m = list(map(int, input().split()))
    a_s = list(map(int, input().split()))

    threshold = sum(a_s) / (4 * m)
    count = 0
    for a in a_s:
        if a < threshold:
            continue
        count += 1
    #print('count') # debug
    #print(count) # debug
    if count >= m:
        print("Yes")
    else:
        print("No")

    #print('\33[32m' + 'end' + '\033[0m') # debug


Measured memory_bytes: 68628
N,M=map(int,input().split())
ks=[list(map(int,input().split())) for i in range(M)]

p=list(map(int,input().split()))

ans=0
for i in range(2**N):
    on=[0]*N
    tmp=0
    for j in range(N):
        if((i>>j)&1):
            on[j]=1
    for j in range(M):
        count=0
        for h in range(1,ks[j][0]+1):
            if(on[ks[j][h]-1]==1):
                count+=1
        if(count%2==p[j]):
            tmp+=1
    if(tmp==M):
        ans+=1

print(ans)

Measured memory_bytes: 3064
from collections import defaultdict

N = int(input())
# 奇数
a = list(map(int, input().split()))
# 操作
# 3枚カードを選び、真ん中の数のカードだけ戻す
# 残されたカードに書かれた値が互いに異なるようにしたい
# 何枚のカードを残すことが可能か

d = defaultdict(int)
for aa in a:
    d[aa] += 1

to_rem = 0
for vv in d.values():
    to_rem += vv - 1

to_rem_rest = to_rem % 2

ans = N - to_rem - to_rem_rest
print(ans)


Measured memory_bytes: 18656
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<numeric>
#include<utility>
#include<unordered_map> //hash map
#include<cmath>

#define rep(i,a,n) for(int (i)=(a);(i)<(n);(i)++)
#define rrep(i,a,n) for(int (i)=(a);(i)>=(n);(i)--)

#define INF 10000007

typedef  long long ll;

using namespace std;

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

ll deg(int i){
  ll ret = 1;
  while(i != 0){
    if(i/10 == 0){
      break;
    }
    i/=10;
  }
  
  return i;
}

void solve(){
  ll x,y,a,b,c;
  cin >> x >> y >> a >> b>> c;
  ll p[a],q[b];
  vector<ll>r;
  for(int i = 0;i < a;i++){
    cin >> p[i];
  }
  for(int i = 0;i < b;i++){
    cin >> q[i];
  }

  for(int i = 0; i < c;i++){
    ll t;
    cin >> t;
    r.push_back(t);
  }

  sort(p,p+a);reverse(p,p+a);
  sort(q,q+b);reverse(q,q+b);

  for(ll i = 0;i < x;i++){
    r.push_back(p[i]);
  }
  for(ll i = 0;i < y;i++){
    r.push_back(q[i]);
  }
  
  sort(r.begin(),r.end());reverse(r.begin(),r.end());

  ll  ans = 0;
  for(ll i = 0;i < x+y;i++){
    ans += r[i];
  }
  cout << ans << endl;
}


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


Measured memory_bytes: 7536
#include <bits/stdc++.h>
#define x first
#define y second
#define pii pair<int,int>
using namespace std;
int cmp(string s1, string s2){
	//if(s1.compare(s2)==0) return 0;
	if(s1.length() == s2.length()) return s1.compare(s2); 
	return (s1.length() < s2.length() ? -1 : 1);
	
}
int main() {
	// your code goes here
	string num1,num2;
	cin>>num1>>num2;
	int res = cmp(num1,num2);
	if(res==0) printf("EQUAL");
	else printf("%s\n", res <0 ?  "LESS" : "GREATER");
	return 0;
}

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

#define lli long long int
#define REP(i,s,n) for(int i=s;i<n;i++)
#define MOD 1000000007
#define NUM 2520
#define INF (1LL<<50)
#define DEBUG 0
#define mp(a,b) make_pair(a,b)
#define SORT(V) sort(V.begin(),V.end())
#define PI (3.141592653589794)


lli d[60];
lli p[60];
lli calc(lli level,lli num){
    if(level==0)return 1;
    
    if(num==0) return 0;
    if(num==d[level]-1)return p[level];
    if(num==(d[level]/2))return 1+p[level-1];
    if(0<num && num<(d[level])/2)return calc(level-1,num-1);
    return 1+p[level-1]+calc(level-1,num-d[level]/2-1);
}

void func(long long N, long long X){
    d[0] = 1;
    p[0] = 1;
    REP(i,1,60){
        d[i] = 2*d[i-1]+3;
        p[i] = 2*p[i-1]+1;
    }

    cout<<calc(N,X-1)<<endl;

}

int main(){
    // cout << fixed << setprecision(5);

    long long N;
    scanf("%lld",&N);
    long long X;
    scanf("%lld",&X);
    func(N, X);
    return 0;
}


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

Measured memory_bytes: 584
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n) for (int i=1; i < (int)(n); i++)
#define rrep(i, n) for (int i=((int)(n)-1); i>=0; i--)
#define rreps(i, n) for (int i=((int)(n)-1); i>0; i--)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
using namespace std;
using lint = long long;
using p = pair<int, int>;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main() {
  int a, b, c, k; cin >> a >> b >> c >> k;
  int sum = 0;
  int na = min(a, k);
  int nb = min(k-na, b), nc = min(k-na-nb, c);
  sum = na - nc;
  cout << sum << endl;
  return 0;
}


Measured memory_bytes: 3624
#include <stdlib.h>
#include <string>
#include <iostream>
using namespace std;

class node{
public:
	int data;
	node *prev;
	node *next;
    node(){
    	prev = 0;
    	next = 0;
    	data = 0;
    }
    node(int data){
    	prev = 0;
    	next = 0;
    	this->data = data;
    }
    node(int data, node *next){
    	prev = 0;
    	this->next = next;
    	this->data = data;
    }    friend class double_linked_list;
};

class double_linked_list{
public:
	node *first;
	node *last;
	double_linked_list(){
		first = 0;
		last  = 0;
	}
	void insert_value(int data);
	void delete_value(int data);
	void delete_first();
	void delete_last();
};

void double_linked_list::insert_value(int data){
	if(first == 0){
		node *new_first = new node(data);
		first = new_first;
		last = new_first;
	}else{
		node *new_first = new node(data, first);
		first->prev = new_first;
		first = new_first;
	}
}
void double_linked_list::delete_value(int data){
	node *current_node = first;
	// no data
	if(current_node == 0){
		return;
	}
	// first
	if(current_node->data == data){
		this->delete_first();
		return;
	}
	current_node = current_node->next;
	while(current_node != 0){
		if(current_node->data == data){
			if(current_node->next != 0){
				current_node->prev->next = current_node->next;
				current_node->next->prev = current_node->prev;
			}else{
				//last
				current_node->prev->next = 0;
				last = current_node->prev;
			}
			return;
		}
	current_node = current_node->next;
	}
}
void double_linked_list::delete_first(){
	node *current_node = first;
	// no data
	if(current_node == 0){
		return;
	}
	if(current_node->next != 0){
		current_node->next->prev = 0;
		first = current_node->next;
		return;
	}
	first = 0;
	last = 0;
	return;
}
void double_linked_list::delete_last(){
	if(this->last == 0){
		return;
	}
	if(last->prev != 0){
		last->prev->next = 0;
		last = last->prev;
	}else{
		last = 0;
		first = 0;
	}
}
int main(){
	int num;

	cin >> num;

	char command[12];
	int value;
	double_linked_list *result_list = new double_linked_list();
	for(int i = 0; i < num; ++i){
		cin >> command;
		if(command[0] == 'i'){
			cin >> value;
			result_list->insert_value(value);
		}else{
			if(command[6] == '\0'){
				cin >> value;
				result_list->delete_value(value);
			}
			else if(command[6] == 'F'){
				result_list->delete_first();
			}
			else if(command[6] == 'L'){
				result_list->delete_last();
			}
		}
	}
	node *test = result_list->first;
	while(test != 0){
		cout << test->data;
		if(test->next != 0){
			cout << " ";
		}
		test = test->next;
	}
	cout << endl;
	return 0;
}

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

int main(){
    long long int h, w;
    cin >> h >> w;
    long long int res = ((h+1)/2)*((w+1)/2) + (h/2)*(w/2);
    if(h == 1 || w == 1) res = 1;
    cout << res << endl;
    
    return 0;
}

Measured memory_bytes: 256
// atcoder/abc089/A/main.cpp
// author: @___Johniel
// github: https://github.com/johniel/

#include <bits/stdc++.h>

#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))

using namespace std;

typedef long long int lli;
typedef unsigned long long ull;
typedef complex<double> point;

template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << "," << p.second << ")"; return os; }
template<typename P, typename Q> istream& operator >> (istream& is, pair<P, Q>& p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; each (i, v) os << i << ","; os << ")"; return os; }
template<typename T> istream& operator >> (istream& is, vector<T>& v) { each (i, v) is >> i; return is; }

template<typename T> inline T setmax(T& a, T b) { return a = std::max(a, b); }
template<typename T> inline T setmin(T& a, T b) { return a = std::min(a, b); }

int main(int argc, char *argv[])
{
  ios_base::sync_with_stdio(0);
  cin.tie(0);

  int n;
  while (cin >> n) {
    cout << n / 3 << endl;
  }

  return 0;
}


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

int main(void) {
    string s;
    cin >> s;
    
    // AA pattern
    for(int i = 0; i < (int)s.length()-1; ++i) {
        if(s[i] == s[i+1]) {
            cout << i+1 << " " << i+2 << endl;
            return 0;
        }
    }
    
    // ABA pattern
    if((int)s.length() == 2) {
        cout << "-1 -1" << endl;
        return 0;
    }
    for(int i = 0; i < (int)s.length()-2; ++i) {
        if(s[i] == s[i+2]) {
            cout << i+1 << " " << i+3 << endl;
            return 0;
        }
    }
    cout << "-1 -1" << endl;
    return 0;
}
        

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back((a))
#define all(x) (x).begin(),(x).end()
#define uniq(x) sort(all(x)),(x).erase(unique(all(x)),end(x))
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

#define INF 2147483600
#define MOD 100000

int dpdp[2][1<<20][2];

int main(){
  int m,n;
  cin>>m>>n;
  vector<string> vec(m);
  rep(i,m) cin>>vec[i];
  // ??????m,??????n

  auto dp = dpdp[0];
  fill(dp[0], dp[1<<n], 0);
  auto nxt= dpdp[1];
  dp[0][0] = 1;

  rep(i,m)rep(j,n){
    fill(nxt[0], nxt[1<<n], 0);
    rep(mask, 1<<n) rep(b,2) if(dp[mask][b]>0){
      dp[mask][b] %= MOD;
      if(vec[i][j]=='?' || vec[i][j]=='J'){
        int nmask = mask | (1<<j);
        if(j>0) nmask &= ~(1<<(j-1));
        nxt[nmask][b] += dp[mask][b];
      }
      if(vec[i][j]=='?' || vec[i][j]=='O'){
        int nmask = mask & ~(1<<j);
        nxt[nmask][b] += dp[mask][b];
      }
      if(vec[i][j]=='?' || vec[i][j]=='I'){
        int nmask = mask & ~(1<<j);
        if(j>0) nmask &= ~(1<<(j-1));
        int nb = b;
        if(j<n-1 && (mask&(1<<j))) nb=1;
        nxt[nmask][nb] += dp[mask][b];
     }
   }
   swap(nxt, dp);
 }

 int ans = 0;
 rep(i,1<<n) (ans += dp[i][1])%=MOD;
 cout << ans << endl;

  return 0;
}

Measured memory_bytes: 19528
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <numeric>
#include <utility>
#include <string>

using namespace std;

int main() {
	long long money = 100;
	long long x;
	cin >> x;

	int ans = 0;
	while (money < x) {
		money += money / 100;
		ans++;
	}

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


Measured memory_bytes: 3188
n = int(input())
t = list(map(int, input().split()));
m = int(input())
p, x = [0] * m, [0] * m
for i in range(m) :
  p[i], x[i] = map(int, input().split())

for i in range(m) :
  res = 0
  for j in range(n) :
    if j+1 == p[i] : 
      res += x[i]
    else :
      res += t[j]
  print(res)

Measured memory_bytes: 3064
import std.algorithm;
import std.array;
import std.bigint;
import std.bitmanip;
import std.conv;
import std.numeric;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

// 差の絶対値
@nogc @safe pure T diff(T)(const ref T a, const ref T b) { return a > b ? a - b : b - a; }

// 切り上げ除算
@nogc @safe pure T divCeil(T)(const ref T a, const ref T b) {
    return (a+b-1)/b;
}

T[] readToArray(T)() {
    return readln.split.to!(T[]);
}

void readInto(T...)(ref T ts) {
    auto ss = readln.split;
    foreach(ref t; ts) {
        t = ss.front.to!(typeof(t));
        ss.popFront;
    }
}

// 冪乗をmod取りつつ計算
@nogc @safe pure ulong modPow(ulong a, ulong n, ulong m) {
    ulong r = 1;
    while (n > 0) {
        if(n % 2 != 0) r = r * a % m;
        a = a * a % m;
        n /= 2;
    }
    return r;
}

// フェルマーの小定理から乗法逆元を計算
// 定理の要請により法は素数
@nogc @safe pure ulong modInv(ulong a, ulong m) {
    return modPow(a, m-2, m);
}

// mod取りつつ順列を計算
@nogc @safe pure ulong modPerm(ulong n, ulong k, ulong m) {
    if (n < k) return 0;

    ulong r = 1;
    for (ulong i = n-k+1; i <= n; i++) {
        r *= i;
        r %= m;
    }
    return r;
}

// mod取りつつ順列を計算
@nogc @safe pure ulong modFact(ulong n, ulong m) {
    return modPerm(n, n, m);
}

// mod取りつつ組み合わせを計算
// modInvを使っているので法は素数
@nogc @safe pure ulong modComb(ulong n, ulong r, ulong m) {
    return modPerm(n, r, m)*modInv(modFact(r, m), m) % m;
}

immutable ulong MOD = 1000000007;

void main() {
    ulong n;
    readInto(n);
    ulong[] p = readToArray!(ulong);

    ulong cnt = 0;
    for(ulong i = 0; i < n; i++) {
        ulong min = p[i];
        ulong min_idx = i;
        for(ulong j = i+1; j < n; j++) {
            if (p[j] < min) {
                min_idx = j;
            }
        }
        if (min_idx != i) {
            if (cnt != 0) {
                writeln("NO");
                return;
            }
            ulong tmp = p[i];
            p[i] = p[min_idx];
            p[min_idx] = tmp;
            cnt++;
        }
    }
    writeln("YES");
}


Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;

typedef long long LL;
const LL MAXN = 60;
const LL MOD = 1000000007;
char s[2][MAXN];
LL n;
LL ans=1;

void solve(){
	LL i;
	for(i=1;i<=n;i++){
		if(s[0][i]==s[1][i]){
			if(i==1){
				ans*=3;
			}
			else if(s[0][i-1]==s[1][i-1])
				ans*=2;
			else
				ans=ans;
			ans%=MOD;
		}
		else{
			if(i==1)
				ans*=6;
			else if(s[0][i-1]==s[1][i-1])
				ans*=2;
			else
				ans*=3;
			ans%=MOD;
			i++;
		}
	}
	printf("%lld\n",ans);
}

int main(){
	scanf("%lld",&n);
	scanf("%s%s",s[0]+1,s[1]+1);
	solve();
	return 0;
}


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

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

constexpr ll LLINF {1001002003004005006};//ll = 9*LLINF
constexpr int INTINF {1000000000};//int = 2*INTINF

#define  rep(i,n)   for(int i = 0; i < (n); ++i)
#define rrep(i,n)   for(int i = 1; i <= (n); ++i)
#define drep(i,n)   for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for(int i = s; i < t;  ++i)

template<typename T>
void maxs(T& x, T&& y) {
  x=std::max(x,y);
}
template<typename T>
void maxs(T& x, T& y) {
  x=std::max(x,y);
}

template<typename T>
void mins(T& x, T&& y) {
  x=std::min(x,y);
}
template<typename T>
void mins(T& x, T& y) {
  x=std::min(x,y);
}

ull conv(const int& x, const int& y, const int& z) {
  if (x==y&&y==z) return 1;
  else if (x==y||y==z) return 3;
  else return 6;
}
int main() {
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);

  int n;
  cin >> n;
  vector<ull> pattern(n+1, 0);
  for (int x = 1;x < n;++x) {
    int tmp1 = x*x;
    if (tmp1 > n) break;
    for (int y = x;y < n;++y) {
      int tmp2 = tmp1 + x*y + y*y;
      if (tmp2 > n) break;
      for (int z = y;z < n;++z) {
        int tmp3 = tmp2 + z*z + y*z + z*x;
        if (tmp3 > n) break;
        pattern[tmp3] += conv(x,y,z);
      }
    }
  }
  rep(i, n) {
    cout << pattern[i+1] << '\n';
  }
}


Measured memory_bytes: 3648