akhauriyash/Code-Regression huggingface dataset:
/*
このコード、と～おれ!
Be accepted!
∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>
#include <functional>
#include <complex>
#include <list>
#include <cassert>
/*多倍長整数/cpp_intで宣言
#include <boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;
*/

//#pragma GCC target ("avx2")
//#pragma GCC optimization ("O3")
//#pragma GCC optimization ("unroll-loops")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "imposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0
#define addf(T) [](T a, T b){return (a + b);}
#define minf(T) [](T a, T b){return min(a, b);}
#define maxf(T) [](T a, T b){return max(a, b);}


using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const long double PI = acos(-1.0L);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);//最初の改行対策
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

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

ll lcm(ll number1, ll number2) {//lcmを求める
	return number1 / gcd(number1, number2) * number2;
}

ll LSB(ll n) { return (n & (-n)); }

/*-----------------------------------------ここからコード-----------------------------------------*/



int main() {

	string s;
	scans(s);
	bool f = true;
	if (s[0] != 'A')f = false;
	int cnt = 0;
	rep(i, s.length()) {
		if (s[i] == 'C') {
			if (i < 2 || i > s.length() - 2)f = false;
			else ++cnt;
		}
		else if (s[i] <= 'Z' && s[i] >= 'B')f = false;
	}
	if (cnt > 1 or cnt == 0)f = false;
	printf("%s\n", f ? "AC" : "WA");

	Please AC;
}


Measured memory_bytes: 256
import java.util.*;

public class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int T = sc.nextInt();
    int A = sc.nextInt();
    int H[] = new int[N];
    for(int i=0; i<N; i++){
      H[i] = sc.nextInt();
    }
    int ans = 0;
    double min = Integer.MAX_VALUE;
    for (int i = 0; i < N; i++) {
      double d = Math.abs(A - (T - H[i] * 0.006));
      if (min > d) {
        min = d;
        ans = i + 1;
      }
    }
    System.out.println(ans);
  }
}
        


Measured memory_bytes: 38804
def main() -> None:
    N, M = map(int, input().split())
    l = [tuple(map(int, input().split())) for _ in range(N)]
    l.sort()
    yen = 0
    hon = M
    for v in l:
        if hon - v[1] > 0:
            hon -= v[1]
            yen += v[0] * v[1]
        elif hon - v[1] == 0:
            hon -= v[1]
            yen += v[0] * v[1]
            break
        else:
            yen += v[0] * hon
            break
    print(yen)


if __name__ == '__main__':
    main()


Measured memory_bytes: 16984
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int INF = (1LL << 30) - 1;
int MOD = 1e9+7;
vector<P> graph[100010];
vector<int> color(100010, -1);
void dfs(int from, int to, ll sum){
    for(auto p:graph[to]){
        int next = p.first;
        int cost = p.second + sum;
        if(next == from)continue;
        if(cost % 2 == 0){
            color[next] = 0;
        }else{
            color[next] = 1;
        }
        dfs(to, next, cost);
    }
}
main(){
    int N;
    cin >> N;
    vector<int> U(N-1),V(N-1),W(N-1);
    rep(i,0,N-1)cin >> U[i] >> V[i] >> W[i];

    
    rep(i,0,N-1){
        graph[U[i]-1].emplace_back(V[i]-1, W[i]);
        graph[V[i]-1].emplace_back(U[i]-1, W[i]);
    }
    color[0] = 0;
    dfs(-1, 0, 0);

    rep(i,0,N){
        cout << color[i] << endl;
    }
}

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

int a[100007];
int dp[100007];

int n;
int cal(int i)
{
    if(i==n){
        return 0;
    }
    if(dp[i]!=-1)return dp[i];
    dp[i]=cal(i+1)+abs(a[i]-a[i+1]);
    if(i+2<=n){
        dp[i]=min(dp[i],cal(i+2)+abs(a[i]-a[i+2]));
    }
    return dp[i];
}
int main()
{
    memset(dp,-1,sizeof(dp));
    cin>>n;
    for(int i=1;i<=n;i++)cin >>a[i];
    
    cout << cal(1)<<endl;
    return 0;
}

Measured memory_bytes: 4096
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    A, B, K = map(int, readline().split())

    if K < A:
        print(A - K, B)
    elif K < A + B:
        print(0, A + B - K)
    else:
        print(0, 0)

    return


if __name__ == '__main__':
    main()


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

const static int MAX = 100;
const static int INFTY = (1<<21);
const static int WHITE = 0;
const static int GRAY = 1;
const static int BLACK = 2;

int n, M[MAX][MAX];

void dijkstra(){
  int minv;
  int d[MAX], color[MAX];

  for(int i=0; i<n; ++i){
    d[i] = INFTY;
    color[i] = WHITE;
  }

  d[0] = 0;
  color[0] = GRAY;

  while(true){
    minv = INFTY;
    int u = -1;
    for(int i=0; i<n; ++i){
      if(minv>d[i] && color[i] != BLACK){
	u = i;
	minv = d[i];
      }
    }
    if(u == -1) break;
    color[u] =BLACK;
    for(int v = 0; v < n; ++v){
      if(color[v] != BLACK && M[u][v] != INFTY){
	if(d[v] > d[u] + M[u][v]){
	  d[v] = d[u] + M[u][v];
	  color[v] = GRAY;
	}
      }
    }
  }
  
  for(int i=0; i<n; ++i){
    cout << i << " " << (d[i] == INFTY ? -1 : d[i]) << endl;
  }
  
}

int main(){
  cin >> n;
  
  for(int i=0; i<n; ++i){
    for(int j=0; j<n; ++j){
      M[i][j] = INFTY;
    }
  }

  int k, c, u, v;
  for(int i=0; i<n; ++i){
    cin >> u >> k;
    for(int j=0; j<k; ++j){
      cin >> v >> c;
      M[u][v] = c;
    }
  }

  dijkstra();
  

  return 0;
}



Measured memory_bytes: 3112
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <stdio.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <deque>
#include <tuple>
#include <map>
#include <sstream>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#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 REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define FOR(i,a,b) for(int i=a; i<(int)(b); i++)
#define ALL(x) (x).begin(),(x).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SORT(c) sort(ALL(x))
#define CLR(a) memset((a), 0 ,sizeof(a))
#define PB push_back
#define MP make_pair
#define SP << " " <<
const int INF = 1001001001;
const ll LINF = 100100100100100100;
const double EPS = 1e-10;
const double PI  = acos(-1.0);
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}
__attribute__((constructor))
void initial(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

int h,w;
int A[505][505];
VVI B;
VVI Y1,Y2;

signed main(){
	cin>>h>>w;
  rep(i,h){
    rep(j,w) cin>>A[i][j];
  }
  rep(i,h){
    if(!(i%2)){
      rep(j,w){
        VI b;
        b.PB(A[i][j]); b.PB(i); b.PB(j);
        B.PB(b);
      }
    }else{
      REP(j,w){
        VI b;
        b.PB(A[i][j]); b.PB(i); b.PB(j);
        B.PB(b);
      }
    }
  }
  rep(i,B.size()-1){
    if(!B[i][0]) continue;
    if(B[i][0]%2==1){
      B[i][0]--; B[i+1][0]++;
      VI X1, X2;
      X1.PB(B[i][1]+1); X1.PB(B[i][2]+1); X2.PB(B[i+1][1]+1); X2.PB(B[i+1][2]+1);
      Y1.PB(X1); Y2.PB(X2);
    }
  }

  cout << Y1.size() << endl;
  rep(i,Y1.size()){
    cout << Y1[i][0] SP Y1[i][1] SP Y2[i][0] SP Y2[i][1] << endl;
  }

  return 0;
}


Measured memory_bytes: 30764
#include <iostream>
#include <string>
#include <algorithm>

int main(void) {
  std::string word;
  std::string text;

  std::cin >> word;
  std::cin >> text;

  int count = 0;
  
  while (text != "END_OF_TEXT") {
    std::transform(text.begin(), text.end(), text.begin(), ::tolower);      
				  
    if (text == word) {
      count++;
    }
    
    std::cin >> text;
  }

  std::cout << count << std::endl;
  
  return 0;
}

Measured memory_bytes: 1192
using System;
using System.Linq;

class Dice
{
    public int up;
    public int front;
    public int right;
    public int left;
    public int back;
    public int down;
    
    public Dice(int [] saikoro)
    {
        this.up=saikoro[0];
        this.front=saikoro[1];
        this.right=saikoro[2];
        this.left=saikoro[3];
        this.back=saikoro[4];
        this.down=saikoro[5];
    }
    public void kaiten(char keyword)
    {
        if(keyword=='N')
        {
            int a=this.up;
            this.up=this.front;
            this.front=this.down;
            this.down=this.back;
            this.back=a;
        }
        if(keyword=='S')
        {
            int a=this.up;
            this.up=this.back;
            this.back=this.down;
            this.down=this.front;
            this.front=a;
        }
        if(keyword=='W')
        {
            int a=this.up;
            this.up=this.right;
            this.right=this.down;
            this.down=this.left;
            this.left=a;
        }
        if(keyword=='E')
        {
            int a=this.up;
            this.up=this.left;
            this.left=this.down;
            this.down=this.right;
            this.right=a;
        }
    }
    
}


public class Hello{
    public static void Main(){
        string[] str=Console.ReadLine().Split(' ');
        int [] saikoro=str.Select(int.Parse).ToArray();
        Dice d=new Dice(saikoro);
        string way=Console.ReadLine();
        for(int i=0;i<way.Length;i++)
        {
            d.kaiten(way[i]);
        }
        Console.WriteLine(d.up);
    }
}



Measured memory_bytes: 18380
#include <bits/stdc++.h>
using namespace std;
int main ( )
{
	int n;
	cin>>n;
	int s=0;
	int min;
	int a[n];
	min=9999999999;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
	}
	for(int i=1;i<=100;i++)
	{
		for(int j=1;j<=n;j++)
		{
			s+=(a[j]-i)*(a[j]-i);
		}
		if(s<=min)
			{
				min=s;
			}
			s=0;
	}
	cout<<min;
	return 0;
}

Measured memory_bytes: 256
X = int(input())

A = 0
B = 0
if X == 0:
    print(0,0)
while(True):
    B = 0
    A5 = A ** 5
    if A5 <= X:
        while(B<A):
            B5 = B ** 5
            if A5 + B5 == X:
                print(A,-B)
                exit(0)
            B += 1
    else:
        while(B<A):
            B5 = B ** 5
            if A5 - B5 == X:
                print(A,B)
                exit(0)
            B += 1
    A += 1


Measured memory_bytes: 9204
import sys
from bisect import *

sys.setrecursionlimit(100000000)
input = lambda: sys.stdin.readline().rstrip()

N = int(input())
odd, even = 0, 0
for i in range(1, N + 1):
    if i % 2 == 0:
        even += 1
    else:
        odd += 1
print('{:.8f}'.format(odd / (even + odd)))



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

using namespace std;



int main(void){
string S;
string T;
//int N;
cin >> S;
cin >> T;
T += S;
//vector<int> P(N), Q(N);
/*int result = 0;

for(int i = 0; i < N; i++){
  cin >> P.data[i];
}
for(int i = 0; i < N; i++){
  cin >> Q.data[i];
}

if(P < Q){
  while(next_permutation(P.data.begin(), P.data.end()) != false){
    result++;
    if(P == Q) break;
  }
}else if(Q < P){
  while(next_permutation(Q.data.begin(), Q.data.end()) != false){
    result++;
    if(P == Q) break;
  }
}*/
cout << T << endl;

return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <functional>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <bitset>
#include <climits>

#define all(c) (c).begin(), (c).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)
#define fr first
#define sc second

const int INF=100000000;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
using namespace std;
typedef pair<int ,int > P;
typedef long long ll;

set<int> S;
int N,M,Q;

set<int>::iterator next_it(set<int>::iterator it) {
    ++it;
    if(it==S.end()) it=S.begin();
    return it;
}
set<int>::iterator prev_it(set<int>::iterator it) {
    if(it==S.begin()) it=S.end();
    --it;
    return it;
}

int main() {
    cin>>N>>M>>Q;
    rep(i,N) S.insert(i);
    set<int>::iterator it = S.begin();

    while(M-->0) {
        int a;
        cin>>a;
        if(a%2==0) rep(i,a) it=next_it(it);
        else rep(i,a) it=prev_it(it);

        it= S.erase(it);
        if(it==S.end()) it=S.begin();
    }

    while(Q-->0) {
        int q;
        cin>>q;
        if(S.find(q)==S.end()) cout<<"0"<<endl;
        else cout<<"1"<<endl;

    }


    return 0;
}

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

int main() {
    int N;
    cin >> N;
    int v[N];
    for (int i = 0; i < N ; ++i ){
        cin >> v[i];
    }
    sort(v,v+N);
    
    double ans = 0;
    for (int i = 0; i < N; ++i ){
        if ( i == 0 ) {
            ans = v[i];
        } else {
            ans = (double) ( ans + v[i] ) / 2;
        }
    }
    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 256
/*
 *
 * Author: r3gz3n
 * 3b 13 12 9 56 4e
 * 6 56 a a 5f f
 * 6 56 47 18 56 d
 * 13 46 14 1f 13 27
 * 52 52 a 5a 47 1
 * 1d 13 b 1b 49 17
 *
 */


#include <utility>
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstring>
#include <unordered_set>
#include <unordered_map>
#include <numeric>
#include <ctime>
#include <bitset>
#include <complex>
#include <random>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;


#define repeach(i, a) for(auto i: a)


class Solution {
public:
    void solve(std::istream& in, std::ostream& out) {
		int x = 0, n, ans = 0;
		string s;
		in >> n>> s;
		repeach(c, s) {
			if (c == 'I') x++;
			else x--;
			ans = max(x, ans);
		}
		out << ans << endl;
    }
};

void solve(std::istream& in, std::ostream& out)
{
    out << std::setprecision(12);
    Solution solution;
    solution.solve(in, out);
}


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


    istream& in = cin;


    ostream& out = cout;

    solve(in, out);
    return 0;
}




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

using namespace std;

int main()
{
	string S;
	cin >> S;

	for (int i = 0; i < S.length(); i++) {
		if (S[i] == ',') {
			cout << " ";
		}
		else {
			cout << S[i];
		}
	}
	cout << endl;
}


Measured memory_bytes: 3592
N, K = map(int, input().split())
S = input()

l = 0
count = 0

ans = 0
for r in range(N):
    if S[r] == '0':
        if r == 0 or S[r - 1] == '1':
            count += 1
    if count > K:
        while S[l] == '1':
            l += 1
        while S[l] == '0':
            l += 1
        count -= 1
    ans = max(ans, r - l + 1)

print(ans)


Measured memory_bytes: 3316
#include <iostream>
#include <map>
#include <set>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <fstream>
#include <bitset>
#include <queue>
#include <stack>
#include <deque>
#include <complex>
#include <iomanip>
#include <stdio.h>
#include <string.h>
#include <random>
#include <functional>

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

using std::map;
using std::set;
using std::bitset;
using std::vector;
using std::string;
using std::multimap;
using std::multiset;
using std::deque;
using std::queue;
using std::stack;
using std::pair;
using std::iterator;

using std::sort;
using std::stable_sort;
using std::reverse;
using std::max_element;
using std::min_element;
using std::unique;
using std::ios_base;
using std::swap;
using std::fill;

using std::setprecision;
using std::fixed;

long long min(long long a, long long b) {return a < b ? a : b;}
long long min(int a, long long b) {return a < b ? a : b;}
long long min(long long a, int b) {return a < b ? a : b;}
long long min(int a, int b) {return a < b ? a : b;}

long long max(long long a, long long b) {return a > b ? a : b;}
long long max(int a, long long b) {return a > b ? a : b;}
long long max(long long a, int b) {return a > b ? a : b;}
long long max(int a, int b) {return a > b ? a : b;}

#define int long long

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef string S;

#define F(i, n) for (int (i) = 0; (i) != (n); (i)++)
#define fi first
#define se second
#define re return
#define all(x) (x).begin(), (x).end()

const long long INF = 1e18;
const int N = 210110;
const int MOD = 998244353;
const double eps = 1e-8;

ll n, e, t;
ll a[N];

ll dp[N];
ll kek, j = -1;

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n >> e >> t;
    for (int i = 0; i < n; i++) cin >> a[i];
    kek = 1e18;
    set<pair<int, int> > ss;
    ss.insert({0, -1});
    for (int i = 0; i < n; i++)
    {
        dp[i] = (i > 0 ? dp[i - 1] : 0) + t;
        while (2 * (a[i] - a[j + 1]) >= t)
        {
            ss.erase({(j >= 0 ? dp[j] : 0), j});
            kek = min(kek, (j >= 0 ? dp[j] : 0) - 2 * a[j + 1]);
            j++;
        }
        if (ss.size())
        {
            pair<int, int> it = *(ss.begin());
            dp[i] = min(dp[i], min(it.first + t, kek + 2 * a[i]));
        }
        else
        {
            dp[i] = min(dp[i], kek + 2 * a[i]);
        }
        ss.insert({dp[i], i});
        //cout << j << " " << kek << " " << dp[i] << endl;
    }
    cout << dp[n - 1] + e;
}


Measured memory_bytes: 4480
/*
                                             ::                     ::
                                             ':                     :
                                              :.                    :
                                           ;' ::                   ::  '
                                          .'  ';                   ;'  '.
                                         ::    :;                 ;:    ::
                                         ;      :;.             ,;:     ::
                                         :;      :;:           ,;"      ::
                                         ::.      ':;  ..,.;  ;:'     ,.;:
                                          "'"...   '::,::::: ;:   .;.;""'
                                              '"""....;:::::;,;.;"""
                                          .:::.....'"':::::::'",...;::::;.
                                         ;:' '""'"";.,;:::::;.'""""""  ':;
                                        ::'         ;::;:::;::..         :;
                                       ::         ,;:::::::::::;:..       ::
                                       ;'     ,;;:;::::::::::::::;";..    ':.
                                      ::     ;:"  ::::::"""'::::::  ":     ::
                                       :.    ::   ::::::;  :::::::   :     ;
                                        ;    ::   :::::::  :::::::   :    ;
                                         '   ::   ::::::....:::::'  ,:   '
                                          '  ::    :::::::::::::"   ::
                                             ::     ':::::::::"'    ::
                                             ':       """""""'      ::
                                              ::                   ;:
                                              ':;                 ;:"


                                                     P_r_A_d_Y
*/
#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define endl "\n"
#define mod 1000000007
#define inf 1e18
const int N = 300005;
#define fastIO ios_base::sync_with_stdio(false); cin.tie(NULL);
void cs(int &x)
{
    cout << "Case #" << x << ": ";
}
bool cmp(string a, string b)
{
    return a + b < b + a;
}

int32_t main()
{
    fastIO;
    // int t; cin >> t;
    // int x = 1;
    // while (t--)
    // {

        int x;
        cin>>x;

        int r=100,y=0;
        while(r<x)
        {
            r=r+ (r/100);
            y++;
        }
        cout<<y<<endl;
    //}
    return 0;
}

Measured memory_bytes: 3608
#include <time.h>

#include <stdlib.h>
#include <cstdint>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <limits>
#include <cstdint>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <limits>
#include <vector>
#include <map>
#include <set>
#include <iomanip>
#include <numeric>

using namespace std;

int main(){
	string s;
	cin>>s;
	reverse(s.begin(),s.end());
	int64_t free_sum=0;
	int64_t obey_sum=0;
	for(int64_t i1=0;i1<s.size();i1++){
		if(s[i1]=='0'){
			//no change to obeysum
		}else{
			obey_sum=max(obey_sum+(s[i1]-'0'),free_sum+(s[i1]-'1'));
		}
		free_sum+=9;
	}
	cout<<obey_sum<<endl;

}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
//#include <functional>

using namespace std;

int main (){
  //vector<int> vec(10003);

  //for(int i = 0; i < vec.size(); i++){
    //cin >> vec[i];
    //cout << vec[i] << endl;
  //}

  //long long n, sum = 0;
  //vector<int> vec(10000);

  //cin >> n;
  //for(int i = 0; i < n; i++){
    //cin >> vec[i];
    //if(i >= 2) sum = vec[i] + vec[i-1];
    //sum += vec[i];
    //cout << vec[i] << endl;
  

  //cout << sum << endl;

  //stable_sort(vec.begin(), vec.end());
  //cout << vec[1] << vec[2] << vec[3] << vec[4] << endl;
  //cout << vec[1] << endl;

  //cout << *min_element(vec.begin(), vec.end()) << endl;

  //sort(vec.begin(), vec.end(), greater<>());
  //cout << vec[0] << endl;

  //cout << sum << endl;

  long long n, sum = 0;
  int a[10002];
  
  cin >> n;
  for(int i = 0; i < n; i++){
    cin >> a[i];
  }

  long long value_max = a[0];
  long long value_min = a[0];

  for(int i = 0; i < n; i++){
    sum += a[i];
    if(value_max < a[i]){
      value_max = a[i];
    }else if(value_min > a[i]){
      value_min = a[i];
    }
  }

  cout << value_min << " " << value_max << " " << sum << endl;
}



Measured memory_bytes: 3124
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

//INSERT ABOVE HERE
signed main(){
  Int n;
  cin>>n;
  vector<Int> a(n);
  for(Int i=0;i<n;i++) cin>>a[i];

  Int ans=0;
  for(Int x=1;x<=200;x++){
    Int res=0,ok=1;
    for(Int i=0;i<n;i++){
      res+=a[i];
      res-=x;
      if(res<0) ok=0;
    }
    if(ok) ans=x;
  }
  cout<<ans<<endl;
  return 0;
}



Measured memory_bytes: 3092
import sys
from collections import deque


input = sys.stdin.readline

n = int(input())
orders = []
for i in range(n):
    orders.append(input().strip())

#orders = ["insert 5","insert 2","insert 3","insert 1","delete 3","insert 6","delete 5"]
#orders = ["insert 5","insert 2","insert 3","insert 1","delete 3","insert 6","delete 5","deleteFirst","deleteLast"]

data = deque()
for d in orders:
    if " " in d:
        order, value = d.split(" ")
    else:
        order = d

    if order == "insert":
        data.appendleft(value)
    elif order == "delete":
        try:
            data.remove(value)
        except ValueError:
            pass
    elif order == "deleteFirst":
        data.popleft()
    elif order == "deleteLast":
        data.pop()
    else:
        print('Unknown order')

# print result
print(" ".join(data))




Measured memory_bytes: 212316
#include <iostream>
using namespace std;
int main(){
  int M,N,A[100],cnt=0,Asum=0;
  cin >> N >> M;
  for(int i=0;i<N;i++){
    cin >> A[i];
    Asum+=A[i];
  }
  for(int i=0;i<N;i++){
    if(A[i]*4*M>=Asum)cnt++;
  }
  cout << (cnt>=M?"Yes":"No") << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;  
#define rep(i, a, b) for(ll i = a; i < b; i++)
#define Rep(i, a, b) for(ll i = a; i <= b; i++)
#define repr(i, a, b) for(ll i = b-1; i >= a; i--)
#define _GLIBCXX_DEBUG
#define Vl vector<ll>
#define Vs vector<string>
#define Vp vector<pair<ll, ll>>
using ll = long long;
#define ALL(v) (v).begin(),(v).end()
#define endl "\n"
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define co(x) cout << x << endl
#define coel cout << endl
#define pb push_back
#define sz(v) ((ll)(v).size())
const double pi = acos(-1.0);
const ll MOD = 1e9 + 7;
// const ll INF = 1LL << 60;
const ll INF = 100000000000;
#define pp pair<ll, pair<ll, ll>> 
#define fi first
#define se second

void debug_out() { cout << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << H << " ";
  debug_out(T...);
}
#ifdef _DEBUG
#define debug(...) debug_out(__VA_ARGS__)
#else
#define debug(...) 
#endif          // -D_DEBUG をつけて実行 cf)可変引数
 
// rep(i, 0, sz(v)) cout << v[i] << " \n"[i==sz(v)-1];
 
////////////////////////////////////////////////////////


int main() {
	ll n; cin >> n;
	Vl a(n);
	rep(i, 0, n) cin >> a[i];
	Vl wa(n, 0);
	wa[n-1] = a[n-1];
	repr(i, 0, n-1) wa[i] = (a[i] + wa[i+1])%MOD;
	ll ans = 0;
	// rep(i, 0, sz(wa)) cout << wa[i] << " \n"[i==sz(wa)-1];
	rep(i, 0, n-1){
		ans =  (ans +((a[i]*wa[i+1])%MOD))%MOD;
	}
	co(ans);

    return 0;
}

Measured memory_bytes: 6424
#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, m, n) for (int i = m; i < n; i++)
#define pb push_back
#define mp make_pair
#define fill(x, y) memset(x, y, sizeof(x))
#define even(x) x % 2 == 0
#define odd(x) x % 2 != 0
#define all(x) x.begin(), x.end()
#define pcnt __builtin_popcount
#define buli(x) __builtin_popcountll(x)
#define F first
#define S second
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end());

// these functions return the position of result of Binary Search.
#define LB(s, t, x) (int) (lower_bound(s, t, x) - s)
#define UB(s, t, x) (int) (upper_bound(s, t, x) - s)

ll qp(ll a, ll b, int mo) { ll ans = 1; do { if (b & 1) ans = 1ll * ans * a % mo; a = 1ll * a * a % mo; } while (b >>= 1); return ans; }
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int dx8[] = { 1, -1, 0, 0, 1, 1, -1, -1 };
int dy8[] = { 0, 0, -1, 1, -1, 1, -1, 1 };

template <typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }
template <typename T, typename... Ts>
auto make_v(size_t a, size_t b, Ts... ts) { return vector<decltype(make_v<T>(b, ts...))>(a, make_v<T>(b, ts...)); }
template <typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T &t, const V &v) { t = v; }
template <typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T &t, const V &v) { for (auto &e : t) fill_v(e, v); }
// auto dp = make_v<int>(4, h, w);
// fill_v(dp, 0);

const ll INF_LL = (1ll << 60);
const int INF_INT = (int)1e9;
const ll MOD_CONST = (ll)(1e9 + 7);

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

inline tuple<ll, ll> rotate45(tuple<ll, ll> p) { ll x = get<0>(p), y = get<1>(p); return tuple<ll, ll>(x + y, x - y); }
inline bool rangeCheck2D(int nx, int ny, int Width, int Height) { return nx >= 0 and nx < Width and ny >= 0 and ny < Height; }

int main(void)
{
	cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(20);

	ll N, K; cin >> N >> K;
	ll M, G;
	vector<ll> a(N); 
	REP(i, N) {
		cin >> a[i];
		if (i == 0) {
			M = a[i], G = a[i];
		} else {
			chmax(M, a[i]);
			G = gcd(G, a[i]);
		}
	}
	if (K <= M and K % G == 0) cout << "POSSIBLE" << endl;
	else cout << "IMPOSSIBLE" << endl;	

	return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
#include<vector>
#include<algorithm>
using namespace std;
#define lli                                 long long int
#define lb                                  long double
#define pi                                  acos(-1)
#define FindDistance(ax,ay,bx,by)           sqrt((ax-bx)*(ax-bx)+(ay-by)*(ay-by))
#define gcd(a,b)                            __gcd(a,b)
#define lcm(a,b)                           (a/gcd(a,b))*b
#define T                                  int t;cin>>t;for(int tt=1;tt<=t;tt++)
#define all(v)                             v.begin(),v.end()
#define pb                                 push_back
#define inf                                999999999999999
#define mod                                1000000007
#define maxn                               100003
#define FastIO                             ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
int main()
{
    lli n,i,x,j,ans=0;
    vector<lli>val,cost;
    cin>>n;
    for(i=0;i<n;i++)
    {
        cin>>x;
        val.pb(x);
    }
    for(i=0;i<n;i++)
    {
        cin>>x;
        cost.pb(x);
    }
    for(i=0;i<n;i++)
    {
        if(val[i]>cost[i])
        {
            ans+=(val[i]-cost[i]);
        }
    }
    cout<<ans<<endl;

    return 0;
}


Measured memory_bytes: 3596
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAXNUM (1 << 15)
struct suc {
	int data;
	struct suc *next;
};

int main(void){
	int n, i, j;
	int dp[4][MAXNUM + 1];
	struct suc s, *p, *p2, *p3;
	for(i = 1,p = &s;i * i <= MAXNUM;i++,p = p->next){
		p->next = (struct suc *)malloc(sizeof(struct suc));
		p->data = i * i;
	}
	p->next = NULL;
	while(1){
		scanf("%d",&n);
		if(!n)
			break;
		memset(dp,0,sizeof(dp));
		for(p = &s;p->next != NULL;p = p->next)
			dp[3][p->data] = 1;
		for(i = 3;i > 0;i--){
			for(j = 0;j <= n;j++){
				if(dp[i][j]){
					for(p = &s;j + p->data <= n && p->next != NULL;p = p->next)
						dp[i - 1][j + p->data] += dp[i][j];
				}
			}
		}
//		for(i = 0;i < 4;i++)
//			printf("dp[%d][%d] = %d\n",i,n,dp[i][n]);
		for(p = &s;p->next != NULL;p = p->next){
			if(p->data * 3 == n)
				dp[1][n] += 5;
			else if(p->data * 2 == n)
				dp[2][n]++;
			for(p2 = &s;p2->next != NULL;p2 = p2->next){
				if(p->data * 2 + p2->data == n)
					dp[1][n] += 3;
				for(p3 = &s;p3->next != NULL;p3 = p3->next){
					if(p->data * 2 + p2->data + p3->data == n){
						if(p->data == p2->data == p3->data)
							dp[0][n] += 23;
						else if(p2->data == p3->data)
							dp[0][n] += 9;
						else if(p->data == p2->data || p->data == p3->data)
							dp[0][n] += 10;
						else
							dp[0][n] += 6;
					}
				}
			}
		}
//		printf("\n");
//		for(i = 0;i < 4;i++)
//			printf("dp[%d][%d] = %d\n",i,n,dp[i][n]);
		
		printf("%d\n",(dp[0][n] / 24) + (dp[1][n] / 6) + (dp[2][n] / 2) + dp[3][n]);
	}
	return 0;
}

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

#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for(int64 i = 0;i < (n);i++)
#define FOR(i, a, b) for(int64 i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

const double eps = 1e-10;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
	return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value!=0>::type
fill_v(U &u,const V... v){u=U(v...);}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value==0>::type
fill_v(U &u,const V... v){
	for(auto &e:u) fill_v<T>(e,v...);
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int64 N, Q;
  cin >> N >> Q;
  dsu d(N);
  REP(i, Q) {
    int64 t, u, v;
    cin >> t >> u >> v;
    if (t == 0) {
      d.merge(u, v);
    } else {
      cout << d.same(u, v) << endl;
    }
  }
}


Measured memory_bytes: 4008
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define REP(i,j,n) for(int i = j;i < (n);i++)
#define intput(i) cout << i << endl
#define ll long long
#define stringput(s) cout << (string)(s) << endl
int main(){
  vector<int> A(3);
  rep(i, 3) cin >> A[i];
  sort(A.begin(), A.end());
  int ans = 0;
  while(1){
    if(A[0] == A[1]) {
      ans += A[2] - A[1];
      break;
    }
    else if(A[0]%2 == 0 && A[1]%2 == 0){
      ans += (A[1] - A[0])/2;
      A[0] = A[1];
    }
    else if(A[1] - A[0] >= 2){
      A[0] += 2;
      ans++;
    }
    else {
      A[1]++;
      A[2]++;
      ans++;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
            int[] counter = new int[128];
            while(stdIn.hasNext()) {
                String str = stdIn.nextLine().toLowerCase();
                for(int i = 0; i < str.length(); i++) {
                    counter[str.charAt(i)]++;
                }
            }
            for(char ch = 'a'; ch <= 'z'; ch++) {
                System.out.println(ch + " : " + counter[ch]);
            }
        
    }
}


Measured memory_bytes: 26200
#include <stdio.h>

int main(void){

    int n,a;
    int max=-1000000,min=1000000;
    long kei=0;

    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%d",&a);
        if(max < a ){
            max = a;
        }if(min > a){
            min = a;
        }
        kei +=a;
    }
    printf("%d %d %ld\n",min,max,kei);
}


Measured memory_bytes: 2120
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define dbg(...) do{cerr<<__LINE__<<": ";dbgprint(#__VA_ARGS__, __VA_ARGS__);}while(0);

using namespace std;

namespace std{template<class S,class T>struct hash<pair<S,T>>{size_t operator()(const pair<S,T>&p)const{return ((size_t)1e9+7)*hash<S>()(p.first)+hash<T>()(p.second);}};template<class T>struct hash<vector<T>>{size_t operator()(const vector<T> &v)const{size_t h=0;for(auto i : v)h=h*((size_t)1e9+7)+hash<T>()(i)+1;return h;}};}
template<class T>ostream& operator<<(ostream &os, const vector<T> &v){os<<"[ ";rep(i,v.size())os<<v[i]<<(i==v.size()-1?" ]":", ");return os;}template<class T>ostream& operator<<(ostream &os,const set<T> &v){os<<"{ "; for(const auto &i:v)os<<i<<", ";return os<<"}";}
template<class T,class U>ostream& operator<<(ostream &os,const map<T,U> &v){os<<"{";for(const auto &i:v)os<<" "<<i.first<<": "<<i.second<<",";return os<<"}";}template<class T,class U>ostream& operator<<(ostream &os,const pair<T,U> &p){return os<<"("<<p.first<<", "<<p.second<<")";}
void dbgprint(const string &fmt){cerr<<endl;}template<class H,class... T>void dbgprint(const string &fmt,const H &h,const T&... r){cerr<<fmt.substr(0,fmt.find(","))<<"= "<<h<<" ";dbgprint(fmt.substr(fmt.find(",")+1),r...);}
typedef long long ll;typedef vector<int> vi;typedef pair<int,int> pi;const int inf = (int)1e9;const double INF = 1e12, EPS = 1e-9;

int main(){
	cin.tie(0); cin.sync_with_stdio(0);
	
	int n; cin >> n;
	set<pi> s;
	rep(i, 1 << n){
		int x; cin >> x;
		s.emplace(x, i);
	}
	set<pi> cur;
	cur.emplace(*s.rbegin()); s.erase(*s.rbegin());
	
	rep(i, n){
		//dbg(s);
		for(pi x: cur){
			auto p = s.lower_bound(pi(x.first, 0));
			if(p == s.begin()){
				cout << "No" << endl;
				return 0;
			}
			--p;
			cur.emplace(*p);
			s.erase(*p);
		}
	}
	cout << "Yes" << endl;
	
	return 0;
}

Measured memory_bytes: 12544
#include<bits/stdc++.h>
using namespace std;
#define deb(x) cout << #x << ':' << x << endl;
#define loop3(i, k, n) for(i=k; i<n; i++)
#define ll  long long 
#define loop(i,n) for(int i=0;i<n;i++)
#define loop2(i,n) for(int i = 1;i<=n;i+=1)
#define pb push_back
#define mp make_pair
#define v1d vector<ll> 
#define v2d vector<vector<ll>>
const int INF = 1e9 +5 ;
int main()
{
    ll a,b,c;
    cin>>a>>b;
    cout<<max(a+b,max(a-b,a*b));
}

Measured memory_bytes: 256
def number(a):
    MAX=int(a**0.5)+1
    l=[]
    for i in range(1,MAX):
        if(a%i==0):
            l.append(i)
            if(i != a//i):
                l.append(a//i)
    l=sorted(l)
    return l

def check(c,t):
    for i in c:
        if(t%i==0):
            if(i!=1):
                return False
    
    return True


A,B=map(int,input().split())

listA=number(A)
listB=number(B)
a=0
b=0
c=[]
while(True):
    if(listA[a]==listB[b]):
        if(check(c,listA[a])):
            c.append(listA[a])
        a+=1
        b+=1
    elif(listA[a]>listB[b]):
        b+=1
    else:
        a+=1
    if(len(listA)==a or len(listB)==b):
        print(len(c))
        exit()  

Measured memory_bytes: 41708
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using static System.Console;
using static System.Math;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = ReadInt();
            var old = 0.0;
            for (int i = 1; i <= n; i++)
            {
                if (i % 2 != 0) old++;
            }
            WriteLine(old / n);
        }



        private static string Read() { return ReadLine(); }
        private static string[] Reads() { return (Read().Split()); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }
    }
}

Measured memory_bytes: 13140
#include <bits/stdc++.h>
#define int long long
#define double long double
using namespace std;
const int MOD = 1000000007;
const int INF = 1e14;
using Graph = vector<vector<int>>;

//既に同じ行でi個拾った状態でj行k列にいるときの最大値
int dp[4][3100][3100];

signed main(){
  int R, C, K;
  cin >> R >> C >> K;

  vector<vector<int>> L(R+10, vector<int>(C+10, 0));
  for( int i = 0; i < K; i++ ){
    int r, c, v;
    cin >> r >> c >> v;
    L[r][c] = v;
  }

  dp[0][0][0] = 0;

  for( int h = 1; h <= R; h++ ){
    for( int w = 1; w <= C; w++ ){
      for( int i = 2; i >= 0; i-- ){
        dp[i+1][h][w] = max(dp[i+1][h][w], dp[i][h][w]+L[h][w]);
      }
      for( int i = 0; i <= 3; i++ ){
        dp[0][h+1][w] = max(dp[0][h+1][w], dp[i][h][w]);
        dp[i][h][w+1] = max(dp[i][h][w+1], dp[i][h][w]);
      }
    }
  }

  int ans = 0;
  for( int i = 0; i <= 3; i++ ){
    ans = max(ans, dp[i][R][C]);
  }
  cout << ans << endl;


}


Measured memory_bytes: 364876
// #include<iostream>
// #include<vector>
// #include<algorithm>
// #include<map>
// #include<cstring>
// #include<math.h>
// #include<bitset>
// #include<queue>
// #include<set>
// #include<iomanip>
// #include<math.h>
// #include<assert.h>
// #include<string>
// #include<cstdlib>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr ll INF = 1LL << 40;
const double INFD = 1e100;
const ll mod = 1000000007;
const double PI = 3.1415926535897932384626433832795028841971;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
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;
}
// ----------------------------------------------------------------------------

ll f(ll H,ll W){
  ll ret = INF;
  for(ll i=1; i<H; i++){
    ll S1,S2,S3;
    S1 = W*i;
    S2 = (H-i)*(W/2);
    S3 = H*W - (S1+S2);
    ll temp = max({S1,S2,S3}) - min({S1,S2,S3});
    chmin(ret,temp);
  }
  return ret;
}

int main(){
  ll H,W;
  cin >> H >> W;
  if(H%3==0 || W%3==0){
    cout << 0 << endl;
    return 0;
  }
  cout << min({H,W,f(H,W),f(W,H)}) << endl;
  return 0;
}


Measured memory_bytes: 256
import java.util.*;
 
public class Main {
  	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int k = sc.nextInt();
        int n = sc.nextInt();
        ArrayList<Integer> list = new ArrayList<Integer>();
        for (int i = 0; i < n; i++) {
            list.add(sc.nextInt());
        }
        int distance = k - list.get(n-1) + list.get(0);
        for (int j = 2; j < n; j++) {
            if (distance < list.get(j) - list.get(j-1)) {
                distance = list.get(j) - list.get(j-1);
            }
        }
        System.out.println(k - distance);
    }
}


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

using namespace std;
int n,k;
int ar[100005];
int mem[100005];

int solve(int ind){
    if(ind==n-1){
        return 0;
    }
    if(ind>=n){
        return 1e9;
    }
    if(mem[ind]!=-1){
        return mem[ind];
    }
    int ret=1e9;
    for(int i=1;i<=k;i++){
        ret=min(ret,solve(ind+i)+abs(ar[ind]-ar[ind+i]));
    }
    return mem[ind]=ret;
}

int main() {
    //freopen("input.in", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    memset(mem,-1,sizeof mem);
    cin>>n>>k;
    for(int i=0;i<n;i++){
        cin>>ar[i];
    }
    cout<<solve(0)<<endl;
    return 0;
}

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

vector<int> apple;
vector<int> peach;

int main(void){
  string sentence;
  getline(cin, sentence);
  int i = 0;
  while(true){
    i = min(sentence.find("apple", i), sentence.find("peach", i));
    if(i < 0) break;
    if(sentence[i] == 'a'){
      sentence.replace(i, 5, "peach");
    }else if(sentence[i] == 'p'){
      sentence.replace(i, 5, "apple");
    }
    i++;
  }
  cout << sentence << endl;
  return 0;
}

Measured memory_bytes: 1180
function main() {
  var
  c = 1,
  i, j, res,
  w, n, ws, vs;
  for(i = 0; w = parseInt(input[i++], 10); c++) {
    n = parseInt(input[i++], 10);
    ws = [];
    vs = [];
    for(j = 0; j < n; j++) {
      line = input[i++].split(',').map(parseFloat);
      vs.push(line[0]);
      ws.push(line[1]);
    }
    console.log('Case %d:', c);
    console.log(thief(n, ws, vs, w).join('\n'));
  }
}

function max(a, b) {
  return a > b ? a : b;
}

function thief(n, ws, vs, m) {
  var
  i, j, v, w,
  _back,
  back = {};
  for(i = 0; i < n; i++) {
    w = ws[i];
    v = vs[i];
    _back = [];
    for(j = 0; j <= m; j++) {
      if(j < w) {
        _back[j] = back[j]||0;
      } else {
        _back[j] = max(back[j]||0, (back[j - w]||0) + v);
      }
    }
    back = _back;
  }
  w = v = 0;
  for(j = 0; j <= m; j++) {
    if(v < back[j]) {
      w = j;
      v = back[j];
    }
  }
  return [v, w];
}

var
input = '';

process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', function(chunk) {
  input += chunk;
});
process.stdin.on('end', function() {
  input = input.split('\n');
  main();
});

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

using namespace std;
#define all(a)a.begin(),a.end()
using ll=long long;
const int INF = 1<<30;
const ll INFll =1LL<<62;
const int mod= int(1e9)+7;
using P = pair<ll,ll>;
using ld=long double;

int main(){
   int n;cin >>n;
   vector<int>h(n);
   int ans=0,mx=0;
    for (int i = 0; i < n; ++i) {
        cin >>h[i];
        if(h[i]>=mx){
            ans++;
            mx=h[i];
        }
    }
    cout <<ans <<endl;
}


Measured memory_bytes: 3624
/*
[ ( ^ _ ^ ) ]
*/

import java.io.*;
import java.util.*;


public class Main {
    int INF = (int)1e9;
    long MOD = 1000000007;

    boolean pal(String s) {
        String r = new StringBuilder(s).reverse().toString();
        return r.equals(s);
    }
    

    void solve(InputReader in, PrintWriter out) throws IOException {
        String s = in.next().trim();
        int n = s.length();
        int i = (n-1)/2 - 1;
        if(pal(s) && pal(s.substring(0, i+1)) && pal(s.substring(i+2, n))) {
            out.println("Yes");
        } else out.println("No");
    }
    
    
    public static void main(String[] args) throws IOException {
        if(args.length>0 && args[0].equalsIgnoreCase("d")) {
            DEBUG_FLAG = true;
        }
        InputReader in = new InputReader();
        PrintWriter out = new PrintWriter(System.out);
        int t = 1;//in.nextInt();
        long start = System.nanoTime();
        while(t-- >0) {
            new Main().solve(in, out);
        }
        long end = System.nanoTime();
        debug("\nTime: " + (end-start)/1e6 + " \n\n");
        out.close();
    }
    
    static boolean DEBUG_FLAG = false;
    static void debug(String s) {
        if(DEBUG_FLAG) System.out.print(s);
    }
    
    public static void show(Object... o) {
        System.out.println(Arrays.deepToString(o));
    }
    
    static class InputReader {
        static BufferedReader br;
        static StringTokenizer st;
    
        public InputReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        
        String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        
        int nextInt() {
            return Integer.parseInt(next());
        }
        
        long nextLong() {
            return Long.parseLong(next());
        }
        
        double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}

Measured memory_bytes: 21332
#include <bits/stdc++.h>
using namespace std;
int f(int a)
{
    int k = 0;
    while (a != 0)
    {
        k++;
        a /= 10;
    }
    return k;
}
int main()
{
    int n, ans = 0;
    cin >> n;
    for (int i(1); i <= n; i++)
    {
        if (f(i) % 2 == 1)
            ans++;
    }
    cout << ans;
}


Measured memory_bytes: 256
#include<string.h>
int main()
{
        int k;
        char s[101];
        scanf("%d",&k);
        scanf("%s",s);
        int store=strlen(s);
        if(store<=k)
                printf("%s\n",s);
        else
        {
                char str[105];
                int i;
                for(i=0;i<k;i++)
                {
                        str[i]=s[i];
                }
                int j=0;
                while(j<3)
                {
                        str[i]='.';
                        i++;j++;
                }
                printf("%s\n",str);
        }
}

Measured memory_bytes: 1648