akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;

int main(){
	int i,N,count=0;
	cin >> N;
	int a[N],b[N];
	for(i=0;i<N;i++){
		a[i]=i+1;
	}
	for(i=0;i<N;i++){
		cin >> b[i];
    	if(a[i]==b[i]){}else{count++;}
	}
	if(count==2||count==0){
		cout << "YES" << endl;
	}else{
		cout << "NO" << endl;
	}
}

Measured memory_bytes: 256
// import kotlin.comparisons.*
// import kotlin.math.*
import java.util.*

fun readI() = readLine()!!.toInt()
fun readL() = readLine()!!.toLong()
fun readD() = readLine()!!.toDouble()
fun readIs() = readLine()!!.split(' ').map(String::toInt)
fun readLs() = readLine()!!.split(' ').map(String::toLong)
fun readDs() = readLine()!!.split(' ').map(String::toDouble)

fun main(args: Array<String>) {
  val (n, k) = readIs()
  println(Integer.toString(n, k).length)
}


Measured memory_bytes: 38288
import sys
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    C = 0
    C_diag = 0
    for i in range(3):
        input_raw = read_func().strip().split()
        C += int(input_raw[0]) + int(input_raw[1]) + int(input_raw[2])
        C_diag += int(input_raw[i])
    if C % 3 == 0 and C/3 == C_diag :
        print "Yes"
    else:
        print "No"



if __name__ == '__main__':
    main()

Measured memory_bytes: 2692
fun main(args: Array<String>) {

    val (n, k) = readLine()!!.split(" ").map(String::toInt)
    val s = readLine()!!

    println(abc140d(n, k, s))
}


fun abc140d(n: Int, k: Int, s: String): Any? {

    val initScore = countHappy(s)

    return Math.min(initScore + 2 * k, s.length - 1)
}

fun countHappy(s: String): Int {
    var count = 0
    for (i in s.indices) {

        // 右端と左端は特別
        if (i == 0) {

            if (s[i] == 'L') {
                continue
            }

            if (s.length < 2) {
                continue
            }

            if (s[i + 1] == 'R') {
                count++
            }
            continue
        }
        if (i == s.length - 1) {
            if (s[i] == 'R') {
                continue
            }

            if (s[i - 1] == 'L') {
                count++
            }
            continue
        }

        if (s[i] == 'L') {
            if (s[i] == s[i - 1]) {
                count++
            }
        } else {
            if (s[i] == s[i + 1]) {
                count++
            }
        }
    }

    return count
}


Measured memory_bytes: 37868
#include<bits/stdc++.h>
typedef long long ll;
#define REP(i,n) for(int i = 0;i < (n);i++)
#define rep(i,m,n) for(int i = (m);i < (n);i++)
#define P pair<int,int>
#define pb push_back
#define mk make_pair
using namespace std;
#define Vec(a) vector <int> a
#define F first
#define S second
const int INF = 1 << 20;
const int MOD = 1e9+7;





int main(){

    ll n,p;
    cin >> n >> p;
    ll a[1000001] = {};
    ll c = p;
    int b = 2;
    bool f = false;
    while(sqrt(p) >= b){
        if(c%b == 0){
            c /= b;
            a[b]++;
            f = true;
        }else{
            b++;
        }
    }
    ll res = 1;
    if(n == 1){
        cout << p << endl;
        return 0;
    }
    REP(i,1000001){
        ll x = a[i] / n;
        ll y = 1;
        REP(j,x){
            y *= i;
        }
        res *= y;
    }
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 8064
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/rope>

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define long long long 
#define PI 3.141592653589793238

#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")

#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
        cout << name << " : " << arg1 << endl;
        //use cerr if u want to display at the bottom
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
    }
#else
#define trace(...)
#endif

typedef trie<string,null_type,trie_string_access_traits<>,pat_trie_tag,trie_prefix_search_node_update> pref_trie;
typedef tree<long int,null_type,less<long int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
typedef cc_hash_table<long int,long int, hash<long int>, equal_to<long int>, direct_mask_range_hashing<long int>, 
hash_standard_resize_policy<hash_exponential_size_policy<>, hash_load_check_resize_trigger<true>, true>> ht;
typedef gp_hash_table<long int,long int> HashTable;

int main(){
   IOS;
 /*    #ifndef ONLINE_JUDGE
         freopen("in.txt",  "r",  stdin);
         freopen("out.txt", "w", stdout);
     #endif */
   
   long int n;
   cin>>n;


   if(n >= 400 && n <= 599)
    cout<<"8";
   else if(n >= 600 && n <= 799)
    cout<<"7";
  else if(n >= 800 &&  n <= 999)
    cout<<"6";
  else if(n >= 1000 && n <= 1199)
    cout<<"5";
  else if(n >= 1200 && n <= 1399)
    cout<<"4";
  else if(n >= 1400 && n <= 1599)
    cout<<"3";
  else if(n >= 1600 && n <= 1799)
    cout<<"2";
  else if(n >= 1800 && n <= 1999)
    cout<<"1";
  

   return 0;
}

Measured memory_bytes: 3648
#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
using namespace std;
using ll = long long;
using VL=vector<ll>;

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
const long long INF =  999999999;

ll N,S,a[100100];

int main(){
  cin>>N>>S;
  int ans=N+1;
  REP(i,N){
    cin>>a[i];
  }
  ll sum=0;
  int i=0,j=0;
  //[j,i)
  while(true){
    while(sum<S && i<N){
      sum+=a[i++];
    }

    while(sum>=S && j<N){
      ans=min(ans,i-j);
      sum-=a[j++];
    }
    //jを動かすwhileを抜けた時、sum<s
    //よってiが右端まで動いていたら探索終了
    if(i==N)break;
  }
  if(ans!=N+1)cout<<ans<<endl;
  else cout <<0<<endl;
}



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

int main(){
	int n;
	cin >> n;
    vector<int> d(n);
    for(int i=0; i<n; i++) cin >> d[i];

    int ans=0;
    for(int i=0; i<n-1; i++){
        for(int j=i+1; j<n; j++){
            ans += d[i]*d[j];
        }
    }
	cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
//　宣言
 	double a = 0,b = 0,c = 0.1;
  	int x = 0;
   
  
 //入力    
    cin >> a >> b;
     
 //処理
    x = ((a + b) / 2) - c;
   
 //出力
   cout << x + 1 << endl;
 }

Measured memory_bytes: 3720
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i=0; i<(int)(n); i++)
int main(){
int N, ans=0; cin >> N; int A[N];
REP(i, N){ cin >> A[i]; if((i+1)%2 && A[i]%2){ ans++; } }
cout << ans << "\n";
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define all(x) (x).begin(),(x).end()
template <class T> inline bool chmin(T &a, T b) {if (a > b){a = b;return true;}return false;}
template <class T> inline bool chmax(T &a, T b) {if (a < b){a = b;return true;}return false;}

const ll INF = 1LL << 60;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n, k;cin>>n>>k;
    vector<int> h(n+110, 0);
    rep(i,n) cin>>h[i];
    vector<ll> dp(n+110, INF);
    dp[0]=0;
    for(int i=0; i<n; i++){
        for(int j=1; j<=k; j++){
            dp[i+j] = min(dp[i+j], dp[i] + abs(h[i]-h[i+j]));
        }
    }
    cout<<dp[n-1]<<endl;

}
// dp_b

Measured memory_bytes: 1408
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define fi first
#define se second
typedef pair<ll,ll> P;
#define Mod 1000000007
using VP = vector<P>; using VVP = vector<VP>;
using VI = vector<ll>; using VVI = vector<VI>; using VVVI = vector<VVI>;
#define INF 1ll<<59

ll h,w;

bool isvalid(ll i,ll j){
  if(i>=1&&i<=h&&j>=1&&j<=w) return 1;
  else return 0;
}

int main(){
  ll i,j;
  
  cin>>h>>w;

  queue<P> q;

  ll used[h+10][w+10];

  ll xx[4];
  ll yy[4];

  xx[0]=-1;
  xx[1]=0;
  xx[2]=0;
  xx[3]=1;

  yy[0]=0;
  yy[1]=1;
  yy[2]=-1;
  yy[3]=0;

  ll a[h+10][w+10];

  for(i=1;i<=h;i++){
    for(j=1;j<=w;j++){
      char x;
      cin>>x;
      if(x=='#') {
        a[i][j]=1;
        q.push(P(i,j));
        used[i][j]=0;
      }
      else {
        a[i][j]=0;
        used[i][j]=-1;
      }
    }
  }

  while(!q.empty()){
    P s=q.front();
    q.pop();
    ll x=s.fi;
    ll y=s.se;
    for(i=0;i<4;i++){
      ll x2=x+xx[i];
      ll y2=y+yy[i];
      if(isvalid(x2,y2)){
        if(used[x2][y2]<0){
          used[x2][y2]=used[x][y]+1;
          q.push(P(x2,y2));
        }
      }
    }
  }
  ll ans=0;

  for(i=1;i<=h;i++){
    for(j=1;j<=w;j++){
      ans=max(ans,used[i][j]);
    }
  }
  cout<<ans<<endl;

  return 0;
}

Measured memory_bytes: 32436
n = int(input())
s = []
for i in range(n):
    order = list(map(int,input().split()))
    if order[0] == 0:
        s.append(order[1])
    elif order[0] == 1:
        print(s[order[1]])
    elif order[0] == 2:
        s.pop()


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

using namespace std;

int main() {
  int x1,y1,x2,y2;cin>>x1>>y1>>x2>>y2;
  int x=y2-y1,y=x1-x2;
  cout<<x2-x<<" "<<y2-y<<" "<<x1-x<<" "<<y1-y<<endl;
}

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

#define rep(X,N) for(ll X = 0LL; X < (N); X++)
#define ALL(V) (V).begin(),(V).end()
#define endl "\n"

using namespace std;
typedef long long ll;

const double PI = 3.1415926535897932384626;
const ll MODN = 1000000007;
const ll MODN2 = 998244353;
const double EPS = 1e-10;

int main(){

    int n,x, t;
    cin >> n >> x >> t;

    int ans = 0;

    while(n > 0){
        n -= x;
        ans += t;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P  = pair<int, int>;
int main() {
    int n, m;
    cin >> n >> m;
    vector<vector<int>> G(n);
    rep(i, m) {
        int a, b;
        cin >> a >> b;
        --a, --b;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    vector<int> res(n, -1);
    queue<int> que;
    que.push(0);
    res[0] = 0;
    while (!que.empty()) {
        int q = que.front();
        que.pop();
        for (int i : G[q])
            if (res[i] < 0) que.push(i), res[i] = q;
    }
    cout << "Yes\n";
    for (int i = 0; i < n - 1; ++i) cout << res[i + 1] + 1 << endl;
    return 0;
}

Measured memory_bytes: 10208
#include <bits/stdc++.h>
using namespace std;
int main(){
	int a,b,c=0;
	cin>>a;
	b=a;
	while(b!=0)
	{
		c=c+b%10;
		b/=10;
	}
	if(a%c==0)
		cout<<"Yes";
	else
		cout<<"No";
	return 0;
}

Measured memory_bytes: 256
def main():
    from sys import stdin
    input = stdin.readline

    n, m = map(int, input().split())
    ab = []
    c = []

    for i in range(m):
        ab.append(list(map(int, input().split())))
        c.append(list(map(int, input().split())))

    for i in range(m):
        temp = 0
        for j in range(len(c[i])):
            temp += 2**(c[i][j]-1)
        c[i] = temp
        # c[i]=(("0"*n)+bin(temp)[2:])[-n:]

    dp = dict()

    for i in range(2**n):
        dp[i] = 10**9
        # dp[(("0"*n)+bin(i)[2:])[-n:]]=-1

    dp[0] = 0

    # print(dp)
    for i in range(m):
        for k, item in dp.items():
            dp[c[i] | k] = min(dp[c[i] | k], dp[k]+ab[i][0])

    if dp[2**n-1] == 10**9:
        print(-1)
    else:
        print(dp[2**n-1])

main()

Measured memory_bytes: 3900
typedef char Bool;
#define true 39
#define false 0 
typedef long long int64;
typedef unsigned long long uint64;
typedef int int32;
typedef unsigned int uint32;
typedef unsigned char byte;
#pragma warning (disable:4996)
#include <stdio.h>


int main()
{
	int x, y;
	scanf("%d %d", &x, &y);

	for (int i = 0; i != x + 1; i++)
	{
		if ((i * 4 + (x - i) * 2) == y)
		{
			printf("Yes");
			return 0;
		}
		if ((i * 4 + (x - i) * 2) > y)
		{
			printf("No");
			return 0;
		}

	}
	printf("No");

	return 0;
}

Measured memory_bytes: 1732
import java.util.Scanner;

public class Main
{
	public static void main(String aeg[])
	{
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext())
		{
			int n =sc.nextInt();
			if(n==0)
				return;
			while(n-->0)
			{
				int pm =sc.nextInt();
				int pe =sc.nextInt();
				int pj =sc.nextInt();

				if(pm==100||pe==100||pj==100)
					System.out.println("A");
				else if((pm+pe)/2 >=90)
					System.out.println("A");
				else if((pm+pe+pj)/3 >= 80)
					System.out.println("A");
				else if((pm+pe+pj)/3 >= 70)
					System.out.println("B");
				else if((pm+pe+pj)/3 >= 50 && (pm>=80|| pe>=80))
					System.out.println("B");
				else
					System.out.println("C");
			}
		}
	}
}

Measured memory_bytes: 12000
use proconio::marker::*;
use proconio::*;
use std::cmp::*;

pub trait MoOperator {
    type Query;
    type Answer;
    fn size(&self) -> usize;
    fn init(&mut self);
    fn insert(&mut self, v: usize);
    fn delete(&mut self, v: usize);
    fn answer(&mut self, q: Self::Query) -> Self::Answer;
    fn solve(
        &mut self,
        mut query: Vec<(usize, usize, Self::Query)>,
        answer: &mut [Self::Answer],
    ) {
        let state = self;
        let size = state.size();
        assert!(query.len() <= answer.len());
        assert!(query.iter().all(|p| p.0 < p.1 && p.1 <= size));
        if query.is_empty() {
            return;
        }
        let batch = (size as f64 / (query.len() as f64).sqrt()).ceil() as usize;
        let mut q = vec![];
        std::mem::swap(&mut q, &mut query);
        let mut query = (0..(size / batch + 1)).map(|_| vec![]).collect::<Vec<_>>();
        for (i, (l, r, op)) in q.into_iter().enumerate() {
            query[l / batch].push((r, l, i, op));
        }
        state.init();
        let mut x = 0;
        let mut y = 0;
        for (i, mut query) in query.into_iter().enumerate() {
            query.sort_unstable_by_key(|p| p.0);
            if i & 1 == 1 {
                query.reverse();
            }
            for (r, l, k, op) in query.into_iter() {
                for v in (min(x, l)..x).rev() {
                    state.insert(v);
                    x = l;
                }
                for v in min(y, r)..r {
                    state.insert(v);
                    y = r;
                }
                for v in min(x, l)..l {
                    state.delete(v);
                    x = l;
                }
                for v in (min(y, r)..y).rev() {
                    state.delete(v);
                    y = r;
                }
                answer[k] = state.answer(op);
            }
        }
    }
}

struct State {
    c: Vec<usize>,
    cnt: Vec<u32>,
    ans: usize,
}

impl MoOperator for State {
    type Query = ();
    type Answer = usize;
    fn size(&self) -> usize {
        self.c.len()
    }
    fn init(&mut self) {
        for c in self.cnt.iter_mut() {
            *c = 0;
        }
        self.ans = 0;
    }
    fn insert(&mut self, x: usize) {
        let c = &mut self.cnt[self.c[x]];
        if *c == 0 {
            self.ans += 1;
        }
        *c += 1;
    }
    fn delete(&mut self, x: usize) {
        let c = &mut self.cnt[self.c[x]];
        if *c == 1 {
            self.ans -= 1;
        }
        *c -= 1;
    }
    fn answer(&mut self, _q: Self::Query) -> usize {
        self.ans
    }
}

#[fastout]
fn run() {
    input! {
        n: usize,
        q: usize,
        c: [Usize1; n],
        ask: [(Usize1, usize); q],
    }
    let ask: Vec<_> = ask.into_iter().map(|(l, r)| (l, r, ())).collect();
    let mut ans = vec![0; q];
    State {
        c: c,
        cnt: vec![0; n],
        ans: 0,
    }.solve(ask, &mut ans);
    for a in ans {
        println!("{}", a);
    }
}

fn main() {
    run();
}


Measured memory_bytes: 41760
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<ll,ll> ii;
typedef pair<ll,ii> iii;
const int INF=(int)2e9;
const double EPS=(double)1e-9;
const double PI=(double)acos(-1.0);
const ll MOD=(ll)1e9+7;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define FOR(i,n) for(int i=0;i<n;i++)
#define MAX 100005
#define wa cout<<"wa"<<endl;

void base(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
}

vector<ii> g[MAX];
ll dis[MAX];

int main(){
	ll n,u,v,cost;
	cin>>n;
	for(int i=1;i<n;i++){
		cin>>u>>v>>cost;
		dis[i] = 1e18;
		g[u].pb(ii(cost,v));
		g[v].pb(ii(cost,u));
	}
	dis[n] = 1e18;
	ll q,k;
	cin>>q>>k;
	priority_queue<ii,vector<ii>,greater<ii> > pq;
	pq.push(ii(0,k));
	dis[k] = 0;
	while(!pq.empty()){
		ii u = pq.top();
		pq.pop();
		ll from = u.se;
		ll cost = u.fi;
		for(int i=0;i<g[from].size();i++){
			ii x = g[from][i];
			ll to = x.se;
			ll costx = x.fi;
			if (dis[to] > dis[from]+costx){
				dis[to] = dis[from] + costx;
				pq.push(ii(dis[to],to));
			}
		}
	}
	
	while(q--){
		cin>>u>>v;
		cout<<dis[u] + dis[v]<<endl;	
	}
	
	return 0;
}



Measured memory_bytes: 11120
#include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <numeric>
#include <set>
#include <unordered_set>
#include <queue>
#include <cmath>
 
using namespace std;
#define ll long long
#define rep(i, n) for(int i = 0;i < n;i++)
#define FOR(i, n, m) for(int i=n; i<m; ++i)

using Graph = vector<vector<int>>;

// 深さ優先探索
vector<bool> seen;
void dfs(const Graph &G, int v) {
    seen[v] = true; // v を訪問済にする

    // v から行ける各頂点 next_v について
    for (auto next_v : G[v]) { 
        if (seen[next_v]) continue; // next_v が探索済だったらスルー
        dfs(G, next_v); // 再帰的に探索
    }
}

bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            // 素数ではない
            return false;
        }
    }

    // 素数である
    return true;
}

int main() {
  ll N;
  cin >> N;
  /*rep(i,N){
    cout << A[i] << endl;
  }*/
  cout << N+N*N+N*N*N << endl;
  
}

Measured memory_bytes: 3676
#include <bits/stdc++.h>
#define ll long long int
#define IOS ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define vi vector<int>
#define pb emplace_back
#define all(x) (x).begin(), (x).end()
#define deb(x) cout << #x << " - " << x << endl;
const ll MOD = 1e9 + 7;
const ll INF = 1 << 29;
const ll MAX_N = 1e6 + 7;
using namespace std;

int main() {
    IOS;
    int n,flag=1; cin>>n;
    while(n){
        if(n%10==7){
            flag=0;
            break;
        }
        n/=10;
    }
    if(flag) cout<<"No";
    else cout<<"Yes";
    return 0;
}


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

int main() {
    ios::sync_with_stdio(false);

    int n; cin >> n;
    int mat[n][n];
    memset(mat, -1, sizeof mat);
    for(int i = 0; i < n; i++) {
        int A; cin >> A;
        while(A--) {
            int x, y; cin >> x >> y; x--;
            mat[i][x] = y;
        }
    }

    int ans = 0;

    for(int mask = 0; mask < (1 << n); mask++) {
        bool ok = true;
        for(int i = 0; i < n; ++i) {
            if(mask & (1 << i)) {
                for(int j = 0; j < n; ++j) {
                    if(mat[i][j] == -1) continue;
                    if(mask & (1 << j) and mat[i][j] == 0) ok = false;
                    if(!(mask & (1 << j)) and mat[i][j] == 1) ok = false;
                }
            }
        }

        if(ok) ans = max(ans, __builtin_popcount(mask));

    }
        
    cout << ans << '\n';


    return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000
#define int long long

signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N; cin >> N;
    int A[100010];
    rep(i, N) cin >> A[i];
    int ans = 0;
    int minimum = 0;
    //cout << "####" << endl;
    rep(i, N) {
        if (A[i] - minimum - 1 > 0) {
            int cnt = (A[i] - 1)/(minimum + 1);
            ans += cnt;
            A[i] = 1;
        }
        minimum = max(minimum, A[i]);
        //cout << A[i] << " " << ans << endl;
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 1024
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        String s = scan.next();
        int out = n;
        for(int i = 1; i < n; i++){
            if(s.charAt(i) == s.charAt(i - 1)){
                out--;
            }
        }
        System.out.println(out);
    }
}

Measured memory_bytes: 23636
#include <bits/stdc++.h>
using namespace std;
char t[1005];
int main(){
	scanf("%s", t);
	bool n=0, s=0, e=0, w=0;
	for(int i=0;i<strlen(t);i++){
		if(t[i] == 'N') n = 1;
		if(t[i] == 'S') s = 1;
		if(t[i] == 'E') e = 1;
		if(t[i] == 'W') w = 1;
	}
	if( (n == 1 && s == 0) || (n == 0 && s == 1) || (e == 1 && w == 0) || (e == 0 && w == 1) ) printf("No\n");
	else printf("Yes\n");
}

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

#define REP(i, n) for(int (i) = 0; (i) < (n); ++(i))
#define REPR(i, n) for(int (i) = (n); (i) >= 0; --(i))
#define FOR(i, n, m) for(int (i) = (n); (i) < (m); ++(i))

constexpr int INF = 1e9;
// constexpr ll INF = 1LL<<61;
constexpr ll mod = 1e9+7;

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


Measured memory_bytes: 3588
#include <iostream>

int main()
{
	long double x1, y1, x2, y2, x3, y3, x4, y4;
	while (std::cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4) {
		long double inner_product = (x2-x1) * (x4-x3) + (y2-y1) * (y4-y3);
		if (inner_product==0.0) std::cout << "YES" << std::endl;
		else std::cout << "NO" << std::endl;
	}
	return 0;
}


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

#define for_(i,a,b) for(int i=(a);i<(b);++i)
typedef long long lint;
template< typename T > using Vec = vector< T >;

struct Edge {int to, c; };

Vec< bool > checkVisible(int N, Vec< Vec< int > >& rev) {
	queue< int > que;
	que.push(N-1);
	
	Vec< bool > vis(N, false);
	vis[N-1] = true;
	
	while (!que.empty()) {
		int v = que.front(); que.pop();
		for (int u : rev[v]) {
			if (vis[u]) continue;
			que.push(u);
			vis[u] = true;
		}
	}
	
	return vis;
}

void solve(int N, Vec< Vec< Edge > >& edges, Vec< Vec< int > >& rev) {
	Vec< bool > vis = checkVisible(N, rev);
	Vec< lint > cst(N, -(1LL << 60));
	cst[0] = 0;
	
	bool inf = false;
	for_(rep,0,N+1) {
		for_(v,0,N) for (Edge& e : edges[v]) {
			if (vis[e.to] && cst[e.to] < cst[v] + e.c) {
				cst[e.to] = cst[v] + e.c;
				if (rep == N) inf = true;
			}
		}
	}
	
	if (inf) puts("inf");
	else cout << cst[N-1] << endl;
}

int main() {
	int N, M;
	cin >> N >> M;
	
	Vec< Vec< Edge > > edges(N);
	Vec< Vec< int > > rev(N);
	
	for_(i,0,M) {
		int a, b, c;
		cin >> a >> b >> c;
		--a; --b;
		edges[a].push_back(Edge{b, c});
		rev[b].push_back(a);
	}
	
	solve(N, edges, rev);
}

Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <cstdint>

using namespace std;

static void inputArray(uint32_t A[], int num) {
  for (int i = 0; i < num; i++) {
    cin >> A[i]; 
  }
}

static void printArray(uint32_t A[], int num) {
  for (int i = 0; i < num; i++) {
    cout << (i != 0 ? " " : "") << A[i];
  }
  cout << endl; 
}

static int compared = 0;

static vector<uint32_t> L(250000 + 1);
static vector<uint32_t> R(250000 + 1);

static inline void merge(uint32_t A[], uint32_t left, uint32_t mid, uint32_t right) {
  uint32_t n1 = mid - left;
  uint32_t n2 = right - mid;

  L.assign(&A[left], &A[left + n1]);
  R.assign(&A[mid], &A[mid + n2]);
  L[n1] = R[n2] = UINT32_MAX;

  for (uint32_t i = 0, j = 0, k = left; k < right; k++) {
    compared++;
    if (L[i] <= R[j]) {
      A[k] = L[i];
      i++;
    } else {
      A[k] = R[j];
      j++;
    }
  } 
}

static inline void mergeSort(uint32_t A[], uint32_t left, uint32_t right) {
  if (left + 1 < right) {
    uint32_t mid = (left + right) / 2;
    mergeSort(A, left, mid);
    mergeSort(A, mid, right);
    merge(A, left, mid, right);
  } 
}

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

  vector<uint32_t> A(n);
  inputArray(&A[0], n);
  
  mergeSort(&A[0], 0, n);
  
  printArray(&A[0], n);
  
  cout << compared << endl;
  
  return 0;
}



Measured memory_bytes: 6724
// 失敗するからこそ そこから立ち向かって行く強さがあってそんな強さが本当の強さだと私は思うから
#ifdef DAIJOBU
#include "/home/v-o_o-v/deb.h"
#define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#include <bits/stdc++.h>
#define deb(x...)
#endif 

using namespace std;

#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef long long lint;
typedef double ld;

void a(); void b(); void c(); void d(); void e(); void f();

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

	// a();
	b();
	// c();
	// d();
	// e();
	// f();
	return 0;
}


void a(){
	string s, t;
	cin >> s >> t;
	t.erase(t.begin() + s.size());
	if(s == t)puts("Yes");
	else puts("No");
}

void b(){
	lint a, b, c, k;
	cin >> a >> b >> c >> k;
	lint ans = min(a, k);
	k -= min(a, k);
	k -= min(b, k);
	ans -= min(c, k);
	cout << ans;
}

void c(){

}

void d(){

}

void e(){

}

void f(){

}

Measured memory_bytes: 3656
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1000003 ;

bool dp0[9010][9010],dp1[9010][9010];

int main(){
  string s;
  cin >> s;
  int x,y;
  cin >> x >> y;
  int dist=abs(x)+abs(y);
  vector<int> v[2]; // v[0]:transversal,v[1]:vertical
  int temp=0;
  int cnt=0;
  int n=s.size();
  bool news=true;
  for(int i=0;i<n;i++){
    if(s[i]=='F'){
      cnt++;
    }
    if(s[i]=='T' || i==n-1){
      if(news && s[0]=='F'){
        news=false;
        x-=cnt;
        cnt=0;
        temp++;
        temp%=2;
        continue;
      }
      v[temp].push_back(cnt);
      cnt=0;
      temp++;
      temp%=2;
    }
  }
  dp0[0][4500]=true;
  dp1[0][4500]=true;
  for(int i=1;i<=v[0].size();i++){
    for(int j=-abs(x);j<=abs(x);j++){
      if(dp0[i-1][j-v[0][i-1]+4500] || dp0[i-1][j+v[0][i-1]+4500])dp0[i][j+4500]=true;
    }
  }
  for(int i=1;i<=v[1].size();i++){
    for(int j=-abs(y);j<=abs(y);j++){
      if((j-v[1][i-1]+4500>=0 && dp1[i-1][j-v[1][i-1]+4500]) || (j+v[1][i-1]+4500<=8000 && dp1[i-1][j+v[1][i-1]+4500]))dp1[i][j+4500]=true;
    }
  }
  if(dp0[v[0].size()][x+4500] && dp1[v[1].size()][y+4500])cout << "Yes" << endl;
  else cout << "No" << endl;
return 0;}

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

// fastIO
namespace fastIO {
#define BUF_SIZE 100000
    //fread -> read
    bool IOerror = 0;
    inline char nc() {
        static char buf[BUF_SIZE], *p1 = buf + BUF_SIZE, *pend = buf + BUF_SIZE;
        if(p1 == pend) {
            p1 = buf;
            pend = buf + fread(buf, 1, BUF_SIZE, stdin);
            if(pend == p1) {
                IOerror = 1;
                return -1;
            }
        }
        return *p1++;
    }
    inline bool blank(char ch) {
        return ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t';
    }
    inline void read(int &x) {
        char ch;
        while(blank(ch = nc()));
        if(IOerror)
            return;
        for(x = ch - '0'; (ch = nc()) >= '0' && ch <= '9'; x = x * 10 + ch - '0');
    }
#undef BUF_SIZE
};
using namespace fastIO;




const int maxn = 5e5 + 10;
typedef pair<int, int> pii;
map<int, int> mp[100001];
vector<int> Z[maxn], O[maxn];
vector<pii> G[1000001];
int cnt;

const int INF = 1e9;
deque<int> q;
int dis[maxn];
void BFS(int s) {
    for(int i = 1; i <= cnt; ++i) dis[i] = INF;
    dis[s] = 0;
    q.push_back(s);
    while(!q.empty()) {
        int x = q.front(); q.pop_front();
        for(int i = 0; i < Z[x].size(); ++i) {
            int to = Z[x][i];
            if(dis[to] > dis[x]) dis[to] = dis[x], q.push_front(to);
        }
        for(int i = 0; i < O[x].size(); ++i) {
            int to = O[x][i];
            if(dis[to] > dis[x] + 1) dis[to] = dis[x] + 1, q.push_back(to);
        }
    }
}

int cl[maxn], id[maxn];
void check(int x, int c) {
    if(cl[x] == c) return;
    cl[x] = c, id[x] = ++cnt;
    O[id[x]].push_back(x);
    O[x].push_back(id[x]);
}
int main() {
//     freopen("data.in", "r", stdin);
    int N, M;
    while(read(N), !IOerror) {
        read(M);
        cnt = N;
        for(int i = 1; i <= N + M + M; ++i) Z[i].clear(), O[i].clear();
        for(int i = 1; i <= N; ++i) cl[i] = 0, id[i] = 0;
        for(int i = 1; i <= M; ++i) {
            int u, v, w;
            read(u), read(v), read(w);
            G[w].push_back(pii(u, v));
        }
        for(int i = 1; i <= 1000000; ++i) {
            if(G[i].empty()) continue;
            for(int j = 0; j < G[i].size(); ++j) {
                int u = G[i][j].first, v = G[i][j].second;
                check(u, i), check(v, i);
                Z[id[u]].push_back(id[v]);
                Z[id[v]].push_back(id[u]);
            }
            G[i].clear();
        }
        BFS(1);
        printf("%d\n", dis[N] == INF ? -1 : dis[N] / 2);
    }
    return 0;
}

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

const double PI = acos(-1);
const double EPS = 1e-15;
using ll = long long;
using ull = unsigned long long;
const int inf = 2e9;
const ll INF = 2e18;
const ll MOD = 1e9+7;
typedef pair<int,int> P;

#define REP(i,n) for (int i = 0; i < (n); i++)
#define sz(s) (s).size()
#define pb push_back
#define fi first
#define se second
#define mp make_pair

int a[200010];

int main(){
  string s;
  int n;
  cin >> n >> s;
  REP(i,n) {
    if (s[i] == '#') a[i+1]++;
  }
  REP(i,n+1) {
    if (i == 0) continue;
    a[i] += a[i-1];
  }
  int ans = n;
  for (int i = 0; i <= n; i++) {
    int k = a[i] + (n - i - (a[n] - a[i]));
    ans = min(ans,k);
  }
  cout << ans << endl;
  return 0;
}


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

int main()
{
    long double A, V, B, W, T;
    cin >> A >> V >> B >> W >> T;
    string ans = "NO";

      if (V <= W)
    {
        cout << ans << endl;
        return 0;
    }
    if (abs(A - B) / abs(V - W) <= T)
        ans = "YES";

    cout << ans << endl;
}

Measured memory_bytes: 3756
def main():
    from sys import stdin, setrecursionlimit
    #setrecursionlimit(10**6)
    #r = stdin.readline()[:-1]
    #n = int(stdin.readline()[:-1])   
    #r = [stdin.readline() for i in range(n)]
    #t = [int(stdin.readline()) for i in range(n)]
    r = [stdin.readline() for i in range(3)]
    
    print(r[0][0]+r[1][1]+r[2][2])
    #'Yes', 'No', 'YES', 'NO', ':(', 'Yay!'
    #res = 0
    #a, b = map(int, r.split())
    #print()

if __name__ == '__main__':
    main()



Measured memory_bytes: 38384
#include <iostream>
#define llint long long
#define mod 1000003

using namespace std;

llint Q;
llint x, d, n;

const int FACT_MAX = 1000005;
llint fact[FACT_MAX], fact_inv[FACT_MAX];

llint modpow(llint a, llint n)
{
	if(n == 0) return 1;
	if(n % 2){
		return ((a%mod) * (modpow(a, n-1)%mod)) % mod;
	}
	else{
		return modpow((a*a)%mod, n/2) % mod;
	}
}

void make_fact()
{
	llint val = 1;
	fact[0] = 1;
	for(int i = 1; i < FACT_MAX; i++){
		val *= i;
		val %= mod;
		fact[i] = val;
	}
	fact_inv[FACT_MAX-1] = modpow(fact[FACT_MAX-1], mod-2);
	for(int i = FACT_MAX-2; i >= 0; i--){
		fact_inv[i] = fact_inv[i+1] * (i+1) % mod;
	}
}

int main(void)
{
  cin >> Q;
  make_fact();

  for(int q = 0; q < Q; q++){
    cin >> x >> d >> n;
    if(x == 0){
      cout << 0 << endl;
      continue;
    }
    if(d == 0){
      cout << modpow(x, n) << endl;
      continue;
    }
    if(n >= mod){
      cout << 0 << endl;
      continue;
    }

    llint s = x * modpow(d, mod-2) % mod;
    llint t = (x+(n-1)*d%mod)%mod * modpow(d, mod-2) % mod;
    if(s > t || s == 0 || t == 0){
      cout << 0 << endl;
      continue;
    }
    s--;
    llint ans = fact[t] * modpow(fact[s], mod-2) % mod;
    ans *= modpow(d, t-s), ans %= mod;
    cout << ans << endl;
  }
  return 0;
}


Measured memory_bytes: 16512
#include <bits/stdc++.h>
using namespace std;
#define ALL(x) (x).begin(),(x).end()
#define COUT(x) cout<<(x)<<"\n"
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define REP(i, n) for(int i=0;i<n;i++)
#define YES(x) cout<<(x?"YES":"NO")<<"\n"
#define Yes(x) cout<<(x?"Yes":"No")<<"\n"
#define dump(x) cout<<#x<<" = "<<(x)<<"\n"
#define endl "\n"
using G = vector<vector<int>>;
using M = map<int,int>;
using P = pair<int,int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int,vector<int>,greater<int>>;
using V = vector<int>;
using ll = long long;
using edge = struct { int to; int cost; };
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; }
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

int main() {
  IOS;
  ll n; cin >> n;
  vector<ll> a(n);
  M m;
  ll sum = 0;
  REP(i,n) {
    cin >> a[i];
    m[a[i]]++;
    sum += a[i];
  }
  ll q; cin >> q;
  vector<ll> b(q),c(q);
  REP(i,q) cin >> b[i] >> c[i];
  // input


  REP(i,q) {
    m[c[i]] += m[b[i]];
    sum -= (b[i] * m[b[i]]);
    sum += (c[i] * m[b[i]]);
    m[b[i]] = 0;
    COUT(sum);
  }
  return 0;
}


Measured memory_bytes: 10052
#[allow(unused_imports)]
use std::char::*;
#[allow(unused_imports)]
use std::cmp::*;
use std::io::*;
use std::str::FromStr;
#[allow(unused_imports)]
use std::collections::*;

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

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")
}

#[derive(PartialEq, PartialOrd)]
pub struct Total<T>(pub T);

impl<T: PartialEq> Eq for Total<T> {}

impl<T: PartialOrd> Ord for Total<T> {
    fn cmp(&self, other: &Total<T>) -> std::cmp::Ordering {
        self.0.partial_cmp(&other.0).unwrap()
    }
}

#[allow(dead_code)]
const MAX:usize = 100006;
#[allow(dead_code)]
const INF_U32:u32 = 1 << 31;
#[allow(dead_code)]
const INF_I32:i32 = 1 << 30;
#[allow(dead_code)]
const INF_U64:u64 = 1 << 63;
#[allow(dead_code)]
const INF_I64:i64 = 1 << 62;

fn main() {
    let a:u32 = read();
    let b:u32 = read();

    println!("{}", a*b - (a+b-1));

}


Measured memory_bytes: 4352
//~ while (clock()<=69*CLOCKS_PER_SEC)
    //~ #pragma comment(linker, "/stack:200000000")
    #pragma GCC optimize("O3")
    //~ #pragma GCC optimize("Ofast")
    //~ #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
    //~ #pragma GCC optimize("unroll-loops")
    #include <bits/stdc++.h>
    #include <ext/pb_ds/assoc_container.hpp>
    #include <ext/pb_ds/tree_policy.hpp>

    using namespace __gnu_pbds;
    using namespace std;

    template <typename T>
    using ordered_set =
        tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

    #define sim template < class c
    #define ris return * this
    #define dor > debug & operator <<
    #define eni(x) sim > typename \
    enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
    sim > struct rge { c b, e; };
    sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
    sim > auto dud(c* x) -> decltype(cerr << *x, 0);
    sim > char dud(...);
    struct debug {
    #ifdef LOCAL
    ~debug() { cerr << endl; }
    eni(!=) cerr << boolalpha << i; ris; }
    eni(==) ris << range(begin(i), end(i)); }
    sim, class b dor(pair < b, c > d) {
    ris << "(" << d.first << ", " << d.second << ")";
    }
    sim dor(rge<c> d) {
    *this << "[";
    for (auto it = d.b; it != d.e; ++it)
        *this << ", " + 2 * (it == d.b) << *it;
    ris << "]";
    }
    #else
    sim dor(const c&) { ris; }
    #endif
    };
    #define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

    #define shandom_ruffle random_shuffle

    using ll=long long;
    using pii=pair<int,int>;
    using pll=pair<ll,ll>;
    using vi=vector<int>;
    using vll=vector<ll>;
    const int nax=1000*1007;
    const ll mno=1007;
    const ll mod = 1e9 + 7;

    void addSelf(ll& a, ll b) {
        a += b;
        if(a > mod) {
            a -= mod;
        }
    }

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


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

int main(){
  int a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,x,y;
  scanf("%d",&n);
  q=10000;
  for (a = 1; a < n; a++) {
    b=n-a;
    c=a/100000;
    d=a/10000-10*c;
    e=a/1000-100*c-10*d;
    f=a/100-1000*c-100*d-10*e;
    g=a/10-10000*c-1000*d-100*e-10*f;
    h=a-100000*c-10000*d-1000*e-100*f-10*g;
    x=c+d+e+f+g+h;
    i=b/100000;
    j=b/10000-10*i;
    k=b/1000-100*i-10*j;
    l=b/100-1000*i-100*j-10*k;
    m=b/10-10000*i-1000*j-100*k-10*l;
    o=b-100000*i-10000*j-1000*k-100*l-10*m;
    y=i+j+k+l+m+o;
    p=x+y;
    if(p<=q){
      q=p;
    }
  }
  printf("%d",q);
  return 0;
}


Measured memory_bytes: 128
#include <iostream>

typedef long long ll;

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

#define debug(x) cout << #x << "=" << x << endl;

using namespace std;

int main(void){

    int x,y;

    cin >> x >> y;

    cout << x + y/2 << endl;

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
int main ()
{
	using namespace std;
	char x, y;
	cin >> x;
	cin >> y;
	if (x>y)
	{
		printf(">\n");
	//	printf("%d > %d", x-55, y-55);
	}
	else if (x<y)
	{
		printf("<\n");
	//	printf("%d < %d", x-55, y-55);
	}
	else if (x==y)
	{
		printf("=\n");
	//	printf("%d = %d", x-55, y-55);
	}
	return 0;
}	

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstring>
#include <vector>
#include <numeric>
#include <cstdlib>
#include <map>
#include <set>
#include <algorithm>
#include <math.h>
 
using namespace std;
 
int main(){
    int x,y,z;

    cin >> x >> y >> z;

    cout << z << " " << x << " " << y << endl;
    
    return 0;
}

Measured memory_bytes: 256
def main():
    from collections import Counter

    N = int(input())
    S = [input() for _ in range(N)]

    c = Counter(S)
    _max = max(c.values())

    keys = [k for k, v in c.items() if v == _max]

    for a in sorted(keys):
        print(a)


if __name__ == '__main__':
    main()

Measured memory_bytes: 35572
#include <stdio.h>
#include <string.h>

#define MAX_INPUT_LEN 1001

int dp[MAX_INPUT_LEN][MAX_INPUT_LEN];
char s1[MAX_INPUT_LEN];
char s2[MAX_INPUT_LEN];
int len1, len2;

int min(int a, int b);

int main(void)
{
    int i, j, tmp;

    scanf("%s %s",s1, s2);
    len1 = strlen(s1);
    len2 = strlen(s2);

    for (i = 0; i <= len1; i++) {
        dp[i][0] = i;
    }

    for (i = 0; i <= len2; i++) {
        dp[0][i] = i;
    }
        
    for (i = 1; i <= len1; i++) {
        for (j = 1; j <= len2; j++) {
            tmp = (s1[i-1] == s2[j-1]) ? 0:1;
            dp[i][j] = min(dp[i-1][j-1]+tmp, 
                    min(dp[i-1][j]+1, dp[i][j-1]+1));
        }
    }

    printf("%d\n",dp[len1][len2]);

    return 0;
}

int min(int a, int b) 
{
    if (a > b) {
        return b;
    } else {
        return a;
    }
}

Measured memory_bytes: 4452
from __future__ import print_function
n = int(raw_input())
bilding1 = [[" 0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0"],
           [" 0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0"],
           [" 0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0"]
           ]
bilding2 = [[" 0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0"],#35~44
           [" 0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0"],#46~55
           [" 0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0"]
           ]
bilding3 = [[" 0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0"],#69~78
           [" 0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0"],#80~89
           [" 0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0"]
           ]
bilding4 = [[" 0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0"],#103~112
           [" 0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0"],#114~123
           [" 0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0 ","0"]
           ]
bilding = []
bilding.append(bilding1)
bilding.append(bilding2)
bilding.append(bilding3)
bilding.append(bilding4)

for i in range(0,n):
    inf = raw_input()
    inf= inf.split(" ")
    b = int(inf[0]) -1
    f = int(inf[1]) -1
    r = int(inf[2]) -1
    v = int(inf[3])
    bilding[b][f][r] = int(bilding[b][f][r]) + v
    if(r == 0):
        bilding[b][f][r] = " " + str(bilding[b][f][r]) + " "
    elif(r < 9):
        bilding[b][f][r] = str(bilding[b][f][r]) + " "
    else:
        bilding[b][f][r] = str(bilding[b][f][r])

count = 0
for j in range(0,4):
    for k in range(0,3):
        for l in range(0,10):
            print((bilding[j][k][l]),end="")
        print("")
    if(count < 3):
        print("####################")
        count += 1



Measured memory_bytes: 4840
#include<bits/stdc++.h>
using namespace std;
int main(){
  int64_t n,a,i,ans=1e18;
  cin>>n;
  vector<int64_t> b(n+1);
  for(i=0;i<n;i++){
    cin>>a;
    b.at(i+1)=b.at(i)+a;
  }
  for(i=1;i<n;i++) ans=min(ans,abs(b.at(n)-2*b.at(i)));
  cout<<ans<<endl;
}

Measured memory_bytes: 4844
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a) (a).begin(),(a).end()
#define ll long long
int main(){
  int N,A,B;
  cin>>N;
  if(N-1){
    cin>>A>>B;
    cout<<A+B<<endl;
  }else cout<<"Hello World"<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <cmath>
#include <numeric>
using namespace std;
#define rep(i,a,b) for(int64_t i=(a);i<(b);++i) // a ≦ i < b 
#define Rrep(i,a,b) for(int64_t i=(a);i>=(b);--i) // reverse repeat. a から b まで減少．
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend() //逆イテレータ
#define RANGE(a,b,c) (a).begin()+(b),(a).begin()+(c) // [b,c) イテレータ
#define INF 1000000000000000
#define MOD 1000000007
using PII = pair<int64_t, int64_t>;
using VI = vector<int64_t>;
using VVI = vector<VI>;
using VS = vector<string>;
using VP = vector<PII>;
using i64 = int64_t;
template<typename T> void invec(vector<T> &A){for(T& a:A) cin >> a;} 


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

i64 N, K; cin >> N >> K;
VI A(N), F(N); invec(A), invec(F);
sort(ALL(A));
sort(ALL(F), greater<i64>());

i64 ng = -1, ok = 1e12+3;
while(ok - ng > 1){
    i64 mid = (ok + ng) / 2;

    // 全員のタイムを　mid  以下にするための最小修行回数
    i64 train = 0;
    rep(i, 0, N) if (A[i]*F[i] > mid) 
        train += A[i] - mid / F[i];

    if (train <= K) ok = mid;
    else ng = mid;
}


cout << ok << "\n";

return 0;
}
// コンテスト前はtemplate振り返り。
// 書いて考える．場合分け．情報整理．
// 単純に分かる量から．愚直解を実装して研究．
// 境界，出力文字列 チェック．行末にスペース入れない．
// 可読性優先．高速化次点．
// まずは全探索，分割，次にDP(小さい問題から大きな問題)
// 制限を見る．境界に注意．求めたい量の変域．動かせる量．
// 偶奇，逆から，ソート，出現回数，出現位置，DP， 余事象，包除
// データ構造． 問題の特徴量．単調性→二分探索
// 存在判定：構成方法，入力の特徴
// 構築問題。極端解を試す。
// 例外を十分に含む一般化．想像力の限界
// 小さい系から例示
// 代数的処理．前処理によるクエリ高速化．
// 始めは過剰に例示・場合分けしてもいい．各場合を確実に対処．
// 自明な例から処理，除外．
// 小数のときは，精度の設定する．doubel 変数に数値を入力するときは 123. とする．
// コーナーケース。境界値。数表出力プログラム作る
// 実行エラー：vector添え字超え．0割り．



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

int n, t, a[2000000];
typedef long long ll;
ll sum = 0;

int main() {
	cin >> n >> t;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}

	for (int i = 0; i < n-1; i++) {
		if (a[i + 1] - a[i] >= t) {
			sum += t;
		}
		else {
			sum += (a[i + 1] - a[i]);
		}
	}
	sum += t;
	cout << sum << endl;
}

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

using ll=long long;
#define int ll

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

int read(){
	int i;
	scanf("%lld",&i);
	return i;
}

signed main(){
	while(true){
		int H=read(),W=read();
		if(H==0&W==0) break;
		
		int crosslength = H*H+W*W;
		bool flag=false;
		for(int h=H+1;h<150;h++){
			for(int w=1;w<=150;w++){
				if(h>=w) continue;
				if(h*h+w*w == crosslength&&h>H){
					cout << h << ' ' << w << endl;
					flag=true;
					break;
				}
			}
			if(flag) break;
		}
		
		if(flag==false){
			int tmpw,tmph;
			int min = 1000000;
			for(int w=1;w<=150;w++){
				for(int h=1;h<w;h++){
					if(h*h+w*w > crosslength&&h*h+w*w<=min){
						min = h*h+w*w;
						tmpw=w;
						tmph=h;
					}
				}
			}
			cout << tmph << ' ' << tmpw << endl;
		}
	}
}

Measured memory_bytes: 3200
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    if len(x) == 0:
        return []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

def pow_k(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans

"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

n = onem()

po = 100
co = 0
while True:
    if po >= n:
        break
    co += 1
    po += po//100

print(co)







Measured memory_bytes: 67824