akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <iomanip>
#include <utility>
#include <cmath>
#include <random>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <algorithm>
using namespace std;

#define rep(i,n) for(int i = 0; i<n; ++i)
#define REP(i,n) for(int i = 1; i<=n; ++i)
#define all(x) begin(x),end(x)
#define show(obj) {for(auto x:obj)cout<<x<<' ';cout<<endl;}
#define line "----------"
typedef long long ll;
typedef pair<int,int> ip;
typedef pair<ll,ll> lp;
const int inf = 1001001000;
const ll INF = 1LL<<60;
const int MOD = (int)1e9 + 7;

int main(){
	int sx, sy, tx, ty;
	cin>>sx>>sy>>tx>>ty;
	queue<char> ans;
	rep(i,tx-sx)ans.push('R');
	rep(i,ty-sy)ans.push('U');
	rep(i,tx-sx)ans.push('L');
	rep(i,ty-sy)ans.push('D');
	ans.push('D');
	rep(i,tx-sx+1)ans.push('R');
	rep(i,ty-sy+1)ans.push('U');
	ans.push('L');
	ans.push('U');
	rep(i,tx-sx+1)ans.push('L');
	rep(i,ty-sy+1)ans.push('D');
	ans.push('R');
	while(!ans.empty()){
		cout<<ans.front();
		ans.pop();
	}
	cout<<endl;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,k;
    cin>>n>>k;
    vector<int> a(n+1);
    for(int i=1;i<=n;i++)
    cin>>a[i];
    vector<int> dp(n+2,INT_MAX);
    dp[1]=0;
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=k;j++)
        {
            if(i+j<=n)
            dp[i+j]=min(dp[i+j],dp[i]+abs(a[i+j]-a[i]));
        }
    }
    cout<<dp[n]<<endl;
}

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

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

int ch(int a, int b) {
	if (a < b)
		swap(a, b);
	return gcd(a, b);
}

int main() {
	int n;
	cin >> n;
	vector<int> da(n),fo(n),ba(n);
	for (int i = 0;i < n;i++)
		cin >> da[i];

	if (n == 2) {
		cout << max(da[0], da[1]) << endl;
		return 0;
	}
	int x = da[0];
	fo[0] = x;
	for (int i = 1;i < n;i++) {
		fo[i] = ch(fo[i-1], da[i]);
	}
	x = da[n - 1];
	ba[n - 1] = x;
	for (int i = n - 2;i > -1;i--) {
		ba[i] = ch(ba[i+1], da[i]);
	}
	int ans = max(ba[1],fo[n-2]);
	for (int i = 1;i < n - 1;i++)
		ans = max(ans, ch(fo[i - 1], ba[i + 1]));
	cout << ans << endl;
}


Measured memory_bytes: 1408
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, n) for (int i = (int)(n); i >= 0; i--)
#define REP(i, m, n) for (int i = (int)(m); i <= (int)(n); i++)
#define all(v) v.begin(), v.end()
typedef long long ll;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

const long long INF = 1LL << 60;

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

  cout << n * 800 - (n/15) * 200 << endl;

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
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; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧  
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     
　　　　／　　　＼　 　  |　|     
　　　 /　　 /￣￣￣￣/　　|  
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿  
　 　　　＼/＿＿＿＿/　（u　⊃  
---------------------------------------------------------------------------------------------------*/






int D, N;
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> D >> N;
    if (N == 100) N++;
    cout << N;
    rep(i, 0, D) cout << "00";
    cout << endl;
}


Measured memory_bytes: 256
class in{struct It{int it;const bool rev;explicit constexpr It(int it_, bool rev=false):it(it_),rev(rev){}int operator*(){return it;}bool operator!=(It& r){return it!=r.it;}void operator++(){rev?--it:++it;}};const It i,n;public:explicit constexpr in(int n):i(0),n(n<0?0:n){}explicit constexpr in(int i,int n):i(i,n<i),n(n){}const It& begin(){return i;}const It& end(){return n;}};

#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    int n = s.size();
    function<bool(int)> ok = [&](int id) {
        if(id == n) return true;
        bool res = false;
        if(id + 4 < n) {
            string tmp = s.substr(id, 5);
            if(tmp == "dream" || tmp == "erase")
              res |= ok(id + 5);
        }
        if(!res && id + 5 < n) {
            string tmp = s.substr(id, 6);
            if(tmp == "eraser")
              res |= ok(id + 6);
        }
        if(!res && id + 6 < n) {
            string tmp = s.substr(id, 7);
            if(tmp == "dreamer")
              res |= ok(id + 7);
        }
        return res;
    };
    cout << (ok(0) ? "YES" : "NO") << endl;
    return 0;
}

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

using namespace std;

#define rep(i, n) REP(i,0,n)
#define REP(i,a,n) for(int i = a ; i < (int)n ; i++)

int N;
int data[20002];
int A[20002];
int B[20002];

int main(){
  cin >> N;
  rep(i,N){
    cin >> data[i];
  }

  rep(i, N){
    A[i] = N * (i+1);
    B[N-i-1] = N * (i+1);
  }
  
  int cnt=0;
  rep(i, N){
    int idx = data[i];
    A[idx-1] += cnt;
    cnt++;
  }
  
  rep(i, N){
    cout << A[i] << " ";
  }
  cout << "\n";

  rep(i, N){
    cout << B[i] << " ";
  }
  cout << "\n";
  
}


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

namespace id_0256cs
{
    class Program
    {
        static void Main(string[] args)
        {
            List<int> vs = new List<int>();
            foreach (var i in Enumerable.Range(0, 10))
            {
                vs.Add(int.Parse(Console.ReadLine()));
            }
            Console.WriteLine(vs.Sum());
        }
    }
}



Measured memory_bytes: 9420
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int maxn = 200005;
typedef long long LL;
LL n, k;
LL a[maxn];

int sgn(LL a) {
    if (a == 0) return 0;
    return a > 0 ? 1 : -1;
}

LL myfloor(LL a, LL b) {
    LL ret = a / b;
    if (a % b && sgn(a) != sgn(b)) -- ret;
    return ret;
}

LL myceil(LL a, LL b) {
    LL ret = a / b;
    if (a % b && sgn(a) == sgn(b)) ++ ret;
    return ret;
}

bool check(LL mid) {
    LL ret = 0;
    for (int i = 1; i <= n; ++i) {
        if (a[i] > 0) {
            int cur = upper_bound(a + 1, a + n + 1, myfloor(mid, a[i])) - a - 1;
            if (cur >= i) --cur;
            ret += cur;
        } else if (a[i] == 0) {
            if (mid >= 0) ret += n - 1;
        } else if (a[i] < 0) {
            int cur = lower_bound(a + 1, a + n + 1, myceil(mid, a[i])) - a - 1;
            if (cur < i) ++ cur;
            ret += n - cur;
        }
    }
    ret /= 2;
    //cerr << ret << endl;
    return ret >= k;
}

void test() {
    cout << myceil(5, 2) << endl;
    cout << myceil(-5, 2) << endl;
}

int main() {
#ifdef __APPLE__
    freopen("main.in", "r", stdin);
#endif
    //test(); return 0;
    cin >> n >> k;
    for (int i = 1; i <= n; ++i) cin >> a[i];
    sort(a + 1, a + n + 1);
    LL l = -LL(1e9) * LL(1e9)-1, r = LL(1e9) * LL(1e9);
    //check(0);
    while(l + 1 < r) {
        LL mid = l + ((r - l) >> 1);
        if (check(mid)) r = mid;
        else l = mid;
    }
    //cout << l << " " << r << endl;
    cout << r << endl;
    return 0;
}


Measured memory_bytes: 1792
#include <iostream>
#include <cmath>

using namespace std;

const int maxn=1e5;

int dp[maxn];

int main()
{
    int n;
    cin>>n;
    int h[n];
    for(int i=0;i<n;i++)
        cin>>h[i];
    dp[0]=0;
    dp[1]=fabs(h[0]-h[1]);
    for(int i=2;i<n;i++)
    {
        dp[i]=min(dp[i-1]+fabs(h[i-1]-h[i]),dp[i-2]+fabs(h[i-2]-h[i]));
    }
    cout<<dp[n-1];
	return 0;
}


Measured memory_bytes: 1024
import itertools


def actual(n, D):
    """
    combinations でゴリ押し
    """
    comb = itertools.combinations(D, 2)

    # return sum([x * y for x, y in comb])

    """
    「順番を考慮しない2要素の選び方」を全探索する際のポイント
        内側のループ変数の始点を外側のループ変数 +1 から始めるとよい。
        これにより、内側のループで選ぶインデックスが必ず外側のループで選ぶインデックスより大きくなり、
        同じ選び方を 2 回見てしまうことを回避できます。
    """
    # s = 0
    # for i in range(len(D)):
    #     for j in range(i + 1, len(D)):
    #         s += D[i] * D[j]
    #
    # return s

    """
    O(N)で解くパターン
    
    ex: a, b, c, d
        a*b + a*c + a*d = a * (b + c +d)
              b*c + b*d = b * (    c +d)
                    c*d = c * (       d)
    """
    s = 0
    for i in range(len(D) - 1):
        s += D[i] * sum(D[i + 1:])

    return s


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

print(actual(n, D))


Measured memory_bytes: 3064
#include <iostream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <cassert>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <string>
#include <algorithm>
#include <utility>
#define llint long long
#define inf 1e18
#define rep(x, s, t) for(llint (x) = (s); (x) < (t); (x)++)
#define Rep(x, s, t) for(llint (x) = (s); (x) <= (t); (x)++)
#define chmin(x, y) (x) = min((x), (y))
#define chmax(x, y) (x) = max((x), (y))

using namespace std;
typedef pair<llint, llint> P;

llint n;
llint x[200005], y[200005], u[200005], v[200005];
char c[200005];
vector<P> vec[6][4000005];

llint calc(vector<P> &vec)
{
	llint ret = inf, l = -inf;
	for(int i = 0; i < vec.size(); i++){
		if(vec[i].second == -1) l = vec[i].first;
		else ret = min(ret, vec[i].first - l);
	}
	return ret;
}

int main(void)
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	cin >> n;
	for(int i = 1; i <= n; i++){
		cin >> x[i] >> y[i] >> c[i];
		x[i] *= 10, y[i] *= 10;
		u[i] = x[i] + y[i], v[i] = x[i] - y[i] + 2000002;
	}
	
	for(int i = 1; i <= n; i++){
		if(c[i] == 'R') vec[0][y[i]].push_back(P(x[i], -1));
		if(c[i] == 'L') vec[0][y[i]].push_back(P(x[i], 1));
		
		if(c[i] == 'U') vec[1][x[i]].push_back(P(y[i], -1));
		if(c[i] == 'D') vec[1][x[i]].push_back(P(y[i], 1));
		
		if(c[i] == 'R') vec[2][u[i]].push_back(P(v[i], -1));
		if(c[i] == 'U') vec[2][u[i]].push_back(P(v[i], 1));
		
		if(c[i] == 'D') vec[3][u[i]].push_back(P(v[i], -1));
		if(c[i] == 'L') vec[3][u[i]].push_back(P(v[i], 1));
		
		if(c[i] == 'L') vec[4][v[i]].push_back(P(u[i], 1));
		if(c[i] == 'U') vec[4][v[i]].push_back(P(u[i], -1));
		
		if(c[i] == 'R') vec[5][v[i]].push_back(P(u[i], -1));
		if(c[i] == 'D') vec[5][v[i]].push_back(P(u[i], 1));
	}
	
	llint ans = inf;
	for(int i = 0; i < 6; i++){
		for(int j = 0; j < 4000005; j++){
			sort(vec[i][j].begin(), vec[i][j].end());
			ans = min(ans, calc(vec[i][j]));
		}
	}
	
	if(ans > inf/2) cout << "SAFE" << endl;
	else cout << ans / 2 << endl;
	
	return 0;
}

Measured memory_bytes: 591024
#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 long long 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;
}
// ----------------------------------------------------------------------------

int main(){
  int x;
  cin >> x;
  int sum=0;
  for(int i=1; i<=x; i++){
    sum += i;
    if(sum>=x){
      cout << i << endl;
      return 0;
    }
  }
  return 0;
}


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

int gcd( int a, int b)
{
   return b ? gcd(b,a%b):a;
}


int main()
{
    int a,b;
   while(scanf( "%d%d",&a,&b) != EOF)
    {

        cout << gcd( a,b )<< " "<< a/gcd( a,b) * b << endl;

    }
    return 0;
}

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

using namespace std;

#define int long long
#define all(v) begin(v), end(v)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define reps(i, s, n) for(int i = (int)(s); i < (int)(n); i++)

const int inf = 1LL << 55;
const int mod = 1e9 + 7;

int N, M, toys[100000];
int cnt[20], sum[20][100001];

int dp[1<<20];

int solve(int idx, int bit)
{
  if(bit == (1<<M)-1) return 0;
  int& ret =dp[bit];
  if(~ret) return ret;
  ret = inf;
  for(int i =0; i < M; i++) {
    if((bit >> i) & 1) continue;
    ret = min(ret, solve(idx + cnt[i], bit | (1<<i)) + cnt[i] - (sum[i][idx+cnt[i]]-sum[i][idx]));
  }
  return ret;
}

signed main()
{
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  cin >> N >> M;
  rep(i, N) cin >> toys[i], toys[i]--, cnt[toys[i]]++, sum[toys[i]][i+1]++;
  rep(i, M) rep(j, N) sum[i][j+1] += sum[i][j];

  memset(dp, -1, sizeof(dp));
  cout << solve(0, 0) << endl;

  return 0;
}

Measured memory_bytes: 27548
#include<stdio.h>
  int i,j;
int A[2000];
  int flag;
  int M[2000];
int q,n;

int solve(int sum,int count){
  //  printf("sum=%d  ",sum);

  if(sum==M[i]){
    flag=1;
    return;
  }
  if(count==n)return;
  solve(sum+A[count],count+1);
  solve(sum,count+1);
  return;
}
int main(void){

  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
  }
  scanf("%d",&q);
  for(i=0;i<q;i++){
    scanf("%d",&M[i]);
  }
 
  for(i=0;i<q;i++){
    flag=0;
    solve(0,0);   
    if(flag==1)printf("yes\n");
    else printf("no\n");
  }
   
   
 
 
  return 0;
}

Measured memory_bytes: 384
/*
If you want to shine like a sun, first burn like a sun.
*/

#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;
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define ll long long int
#define ld long double
#define vi vector<int>
#define vl vector<ll>
#define v2i vector<vector<int>>
#define v2l vector<vector<ll>>
#define ppi pair<int,int>
#define ppl pair<ll,ll>
#define vpi vector<ppi>
#define vpl vector<ppl>
#define all(x) x.begin(),x.end()
#define ii int,int 
#define ff first    
#define ss second
#define forn(i,a,b) for(int i=a;i<b;i++)
#define forr(i,a,b) for(int i=a;i>=b;i--)
#define forv(i,m) for(auto i : m)
#define imx INT_MAX
#define imn INT_MIN
#define inf 9000000000000000000
#define minf -inf
#define endl "\n"
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define sze size()
#define rvs reverse 
#define itr iterator 
#define pre cout<<fixed<<setprecision(10);
#define umap unordered_map
#define uset unordered_set
#define pi 3.141592653589793
#define MAXN 100005
#define test1(x) cout << #x " = " << x << endl;
#define test2(x,y) cout << #x " = " << x << " " << #y " = " << y << endl;
const ll infinity = 9e18;

/*
#define oset tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define MODM(a,b,md) ((a%md)*(b%md))%md
#define MODA(a,b,md) ((a%md)+(b%md))%md
#define ull unsigned long long int
*/

/*
bool compare(int a,int b) {return a > b;}
bool compare1(ppi a,ppi b) {return a.ff > b.ff;}
bool compare2(ppi a,ppi b) {return a.ss < b.ss;}
ll Npower(ll a,ll b) {ll product = 1; while(b){if(b&1){product = product*a;}a = a*a;b = b>>1;} return product;}
ll power(ll a,ll b,ll md) {ll product = 1; while(b){if(b&1){product = MODM(product,a,md);}a = MODM(a,a,md);b = b>>1;} return product%md;}
bool isprime(ll n){if(n < 2) return 0; ll i = 2; while(i*i <= n){if(n%i == 0) return 0; i++;} return 1;}
ll GCD(ll a,ll b) {return b==0 ? a:GCD(b,a%b);}
ll LCM(ll a,ll b) {return (a/GCD(a,b))*b; }
*/


int main()
{
    fast

/*
    #ifndef ONLINE_JUDGE
        freopen("input.txt",  "r",  stdin);
        freopen("output.txt", "w", stdout);
    #endif
//*/

        
	int n;
	cin>>n;

	int mini = imx;
	int k;
	int count = 0;
	forn(i,0,n)
	{
		cin>>k;
		if(k < mini)
		{
			count++;
		}
		mini = min(mini,k);
	}
        
    cout<<count;    












    return 0;
}	

Measured memory_bytes: 256
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
import numpy as np
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

b = input()

at = ["A", "T"]
gc = ["G", "C"]

if b == "A" or b == "T":
	at.remove(b)
	print(at.pop())
else:
	gc.remove(b)
	print(gc.pop())

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

const int maxn = 2e5 + 5, maxm = 4e5 + 5;
int head[maxn], next[maxm], ver[maxm], tot = 1;
long long val[maxn], tag[maxn];
int n, q;

void add(int a, int b){
	ver[++ tot] = b;
	next[tot] = head[a], head[a] = tot;
}

void dfs(int u, int f, long long t){
	val[u] += (t + tag[u]);
	for(int i=head[u];i;i=next[i]){
		if(ver[i] == f) continue;
		dfs(ver[i],u,t+tag[u]);
	}
}

int main(){
	scanf("%d%d",&n,&q);
	for(int i=1;i<n;i++){
		int a, b;
		scanf("%d%d",&a,&b);
		add(a,b);
		add(b,a);
	}
	for(int i=1;i<=q;i++){
		int p;
		long long x;
		scanf("%d%lld",&p,&x);
		tag[p] += x;
	}
	dfs(1,0,0);
	for(int i=1;i<=n;i++) printf("%lld ",val[i]);
	return 0;
}

Measured memory_bytes: 18560
#include <iostream>

using namespace std;
int main(){
	int n, maxNum = 0, sum = 0;
	cin >> n;
	
	for(int i = 0; i < n; i++){
		int tmp;
		cin >> tmp;
		sum += tmp;
		if(maxNum < tmp){
			maxNum = tmp;			
		}
	}

	if(maxNum < (sum - maxNum))
		cout << "Yes";
	else
		cout << "No";
	
	return 0;
}


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

using namespace std;

int main(){
    int A,B,C;
    cin>>A>>B>>C;
    if(A+B>=C){
        cout<<"Yes";
    }else{
        cout<<"No";
    }
    return 0;
}

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

int main() {
    string s, t;
    cin >> s >> t;
    int ans = 0;
    rep(i, s.size()) {
        if(s[i] == t[i]) ++ans;
    }

    cout << s.size()-ans << endl;
    return 0;
}


Measured memory_bytes: 3912
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner scanner = new Scanner(System.in);

		int n = scanner.nextInt();
		int r = scanner.nextInt();

		if(n>=10) {
			System.out.println(r);
		}else {
			System.out.println(r + 100*(10-n));
		}

		scanner.close();

	}

}


Measured memory_bytes: 35628
#define TEST_MODE true

#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep2(i, a, b) for (int i = (a); i < (int)(b); ++i)
#define rrep(i, n) for (int i = (n)-1; i >= 0; --i)
#define rrep2(i, a, b) for (int i = (a)-1; i >= (int)b; --i)
#define range(i, a, b, c) for (int i = a;             \
                                   c > 0 ? i < b : i > b; \
                                   i += c)
#define chmax(a, b) (a = (a) < (b) ? (b) : (a))
#define chmin(a, b) (a = (a) > (b) ? (b) : (a))
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define all(a) begin(a), end(a)
#define ifnot(a) if (not(a))
#define int long long

#ifdef LOCAL_ENV

#if TEST_MODE == true
const bool test = true;
#define dump(x) cerr << #x << " = " << (x) << " "
#define dumpl(x) dump(x) << endl
#else
const bool test = false;
#define dump(x) 
#define dumpl(x)
#endif

#else
const bool test = false;
#define dump(x) 
#define dumpl(x)
#endif

int dx[] = { 1, 0, -1, 0 };
int dy[] = { 0, 1, 0, -1 };
const int INF = (int)1 << 60;
const ll INFL = (ll)1 << 60;
ll mod_n = (int)1e9 + 7;
const double eps = 1e-10;
typedef long double Real;
// return -1, 0, 1
int sgn(const Real &r) { return (r > eps) - (r < -eps); }
int sgn(const Real &a, const Real &b) { return sgn(a - b); }

//.....................
const int MAX = (int)2e5 + 5;

vector<string> split(const string &str, char sep)
{
	vector<string> v;
	stringstream ss(str);
	string buffer;
	while (getline(ss, buffer, sep))
	{
		v.push_back(buffer);
	}
	return v;
}

template <class InputIterator>
int sum(InputIterator begin, InputIterator end)
{
	return accumulate(begin, end, 0ll);
}

template<typename T>
T gcd(T a, T b)
{
	T c;
	while (a != 0) {
		c = a; a = b%a;  b = c;
	}
	return b;
}

template<typename T>
T bit_count(T N) {
	T cnt = 0;
	while (N) {
		if (N & 1) cnt++;
		N >>= 1;
	}
	return cnt;
}

template<typename T>
void print_vec(ostream& ostream, vector<T> a) {
	rep(i, a.size() - 1) ostream << a[i] << " ";
	ostream << a.back() << endl;
}

template<class T>
T pow_n(T x, T n) {
	T res = 1;
	while (n > 0) {
		if (n & 1) res = res * x;
		x = x * x;
		n >>= 1;
	}
	return res;
}

class Solver {
public:
	int H, W;

	bool grid_ok(int y, int x) {
		return 0 <= y && y < H && 0 <= x && x < W;
	}

	int X;
	vector<bool> ok;

	int ans() {
		rrep(i, X + 1) {
			if (ok[i]) return i;
		}
		return 1;
	}

	void solve() {
		cin >> X;
		ok.resize(X + 1);
		rep2(i, 1, X + 1) rep2(j, 2, X + 1) {
			int v = pow_n(i, j);
			if (v > X) break;
			dump(i); dump(j); dumpl(v);
			ok[v] = true;
		}	

		cout << ans() << endl;
	}

};

signed main()
{
	srand((unsigned int)time(NULL));
	cout << fixed << setprecision(20);
	auto ptr = new Solver();
	ptr->solve();
	delete ptr;
	//while (true) {
	//	if (cin.eof() == true) break;
	//	auto ptr = new Solver();
	//	ptr->solve();
	//	delete ptr;
	//}
	return 0;
}


Measured memory_bytes: 256
// luogu-judger-enable-o2
#include<cstdio>
#include<map>
using namespace std;
const int MOD=1e9+7;
long long n,ans;
map<long long,long long>dp;
inline long long solve(long long x){
	if (dp[x]) return dp[x];
	else return dp[x]=((solve(x/2)+solve((x-1)/2)+solve((x-2)/2)))%MOD;
}
int main(){
	dp[0]=1,dp[1]=2;
	scanf("%lld",&n);
	ans=solve(n);
	printf("%lld",ans);
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
constexpr long MOD = 1e9 + 7;

long dp[101010][5];

int main() {
    string s;
    cin >> s;
    dp[0][0] = 1;
    for (int i = 0; i < s.size(); i++) {
        for (int j = 0; j < 5; j++) {
            if (s[i] != '?') {
                dp[i + 1][j] += dp[i][j];
            } else {
                dp[i + 1][j] += dp[i][j] * 3;
            }
            dp[i + 1][j] %= MOD;
        }
        if (s[i] == 'A' || s[i] == '?') {
            dp[i + 1][1] += dp[i][0];
            dp[i + 1][1] %= MOD;
        }
        if (s[i] == 'B' || s[i] == '?') {
            dp[i + 1][2] += dp[i][1];
            dp[i + 1][2] %= MOD;
        }
        if (s[i] == 'C' || s[i] == '?') {
            dp[i + 1][3] += dp[i][2];
            dp[i + 1][3] %= MOD;
        }
    }
    cout << dp[s.size()][3] << endl;
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
#define ll long long 
ll a[1000001];
int main() {
	ll i, j, k, l, test, n, sum=0;
	cin >> k >> n;
	for (i = 0; i < n; i++) cin >> a[i];
	sort(a, a + n);
	ll val = -1;
	for (i = 0; i < n-1; i++) {
		sum += a[i + 1] - a[i];
		if (a[i + 1] - a[i] > val) {
			val = a[i + 1] - a[i];
		}
	}
	val = max(val, k + a[0] - a[n - 1]);
	sum += k + a[0] - a[n - 1];

	sum -= val;
	cout << sum;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
const long long INF = LLONG_MAX / 2;
#define FOR(i, r, n) for(int i=(r); i<(n); i++) 
#define REP(i, n) FOR(i, (0), n)
#define ll long long int

template <typename T>
void remove(std::vector<T>& vector, unsigned int index)
{
	vector.erase(vector.begin() + index);
}

using namespace std;
ll ans = 0, sum = 0, n, k, t, counter = 0;
string s;

set<ll> st;
vector<ll> v;

int main()
{
	cin >> s;
	string s1 = "CODEFESTIVAL2016";
	REP(i,16)
	{
		if (s[i] != s1[i]) ans++;
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    N, K = map(int, readline().split())
    ans = 0
    for i in range(K + 1, N + 1):
        ans += N // i * (i - K)
        if N % i > 0:
            if K == 0:
                ans += N % i
            else:
                ans += max(0, N % i - K + 1)
    print(ans)
if __name__ == '__main__':
    main()


Measured memory_bytes: 9204
from collections import deque
from heapq import heapify,heappop,heappush,heappushpop
from copy import copy,deepcopy
from itertools import product,permutations,combinations,combinations_with_replacement
from collections import defaultdict,Counter
from bisect import bisect_left,bisect_right
from math import gcd,ceil,floor,factorial
# from fractions import gcd
from functools import reduce
from pprint import pprint
from statistics import mean,median,mode

INF = float("inf")

def mycol(data,col):
    return [ row[col] for row in data ]

def mysort(data,col,reverse_flag):
    data.sort(key=lambda x:x[col],reverse=reverse_flag)
    return data

def mymax(data):
    M = -1*float("inf")
    for i in range(len(data)):
        m = max(data[i])
        M = max(M,m)
    return M

def mymin(data):
    m = float("inf")
    for i in range(len(data)):
        M = min(data[i])
        m = min(m,M)
    return m

def mycount(ls,x):
    # lsはソート済みであること
    l = bisect_left(ls,x)
    r = bisect_right(ls,x)
    return (r-l)

def myoutput(ls,space=True):
    if space:
        if len(ls)==0:
            print(" ")
        elif type(ls[0])==str:
            print(" ".join(ls))
        elif type(ls[0])==int:
            print(" ".join(map(str,ls)))
        else:
            print("Output Error")
    else:
        if len(ls)==0:
            print("")
        elif type(ls[0])==str:
            print("".join(ls))
        elif type(ls[0])==int:
            print("".join(map(str,ls)))
        else:
            print("Output Error")

def I():
    return int(input())

def MI():
    return map(int,input().split())

def RI():
    return list(map(int,input().split()))

def CI(n):
    return [ int(input()) for _ in range(n) ]

def LI(n):
    return [ list(map(int,input().split())) for _ in range(n) ]

def S():
    return input()

def MS():
    return input().split()

def RS():
    return list(input().split())

def CS(n):
    return [ input() for _ in range(n) ]

def LS(n):
    return [ list(input().split()) for _ in range(n) ]

n,k = MI()
p = RI()

p.sort()

q = p[:k]

ans = sum(q)

print(ans)

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

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int N; cin >> N;
    long long Ans = 0;
    for (int i = 1; i < N; i++) {
        Ans += (N - 1) / i;
    }
    cout << Ans << "\n";
    return 0;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
const int MOD = 1e9 + 7;


signed main(){
  cin.tie(nullptr);
  ios::sync_with_stdio(false);

  int N, K, R, S, P;
  string T;
  cin >> N >> K >> R >> S >> P >> T;

  bool ok[N] = {};

  int ans = 0;

  for(int i=0;i<K;i++){
    if(T[i] == 'r'){
      ans += P;
      ok[i] = true;
    }
    else if(T[i] == 's'){
      ans += R;
      ok[i] = true;
    }
    else if(T[i] == 'p'){
      ans += S;
      ok[i] = true;
    }
  }

  for(int i=K;i<N;i++){
    if(ok[i-K] && T[i] != T[i-K]){

      if(T[i] == 'r'){
        ans += P;
        ok[i] = true;
      }
      else if(T[i] == 's'){
        ans += R;
        ok[i] = true;
      }
      else if(T[i] == 'p'){
        ans += S;
        ok[i] = true;
      }
    }
  
    else if(!ok[i-K]){
      if(T[i] == 'r'){
        ans += P;
        ok[i] = true;
      }
      else if(T[i] == 's'){
        ans += R;
        ok[i] = true;
      }
      else if(T[i] == 'p'){
        ans += S;
        ok[i] = true;
      }
    }
  }
  cout << ans << endl;

}

Measured memory_bytes: 592
import java.util.Scanner;

class Solver {
	static final Solver INSTANCE = new Solver();

	void solve(Scanner sc) {
		int M1 = sc.nextInt();
		int D1 = sc.nextInt();
		int M2 = sc.nextInt();
		int D2 = sc.nextInt();
		System.out.println(M1 == M2 ? 0 : 1);
	}
}

class Main {
	public static void main(String... args) {
		Scanner in = new Scanner(System.in);

		Solver.INSTANCE.solve(in);

		in.close();
	}
}

Measured memory_bytes: 22740
#include <algorithm>
#include <climits>
#include <iostream>
#include <string>
#include <utility>
#include <vector>

using namespace std;
using ll = long long int;

template <class T> ostream &operator<<(ostream &os, vector<T> &v) {
  for (auto i = v.begin(); i != v.end(); i++) {
    os << *i << " ";
  }
  return os;
}

ll gcd(ll a, ll b) {
  ll tmp;
  if ( b > a) {
    tmp = a;
    a = b;
    b = tmp;
  }
  while (a % b !=0) {
    tmp = b;
    b = a % b;
    a = tmp;
  }
  return b;
}

ll lcm(ll a, ll b) {
  return a * b / gcd(a, b);
}

int main(void) {
  int k, s;
  int cnt=0;
  cin>>k>>s;
  for(int i=0; i<=k; i++) {
    for(int j=0; j<=k; j++) {
      if(0<=s-(i+j) and s-(i+j)<=k)
	cnt++;
    }
  }
  std::cout << cnt << std::endl;
  return 0;
}



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

using namespace std;

struct Initializer {
  Initializer() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(15);
  }
} initializer;

int main() {
  int n, s = 0;
  cin >> n;
  for (int i = 0; ; ++i) {
    s += i;
    if (s < n) continue;
    for (int j = 1; j <= i; ++j) {
      if (s - n == j) continue;
      cout << j << endl;
    }
    return 0;
  }
}



Measured memory_bytes: 256
# 双方向連結リスト | アルゴリズムとデータ構造 | Aizu Online Judge http://is.gd/5CIlit
n = gets.chomp.to_i
doubleLinkedList = Array.new
n.times do
  command = gets.chomp
  if command == "deleteFirst" then
    doubleLinkedList.shift
  elsif command == "deleteLast" then
    doubleLinkedList.pop
  else
    command, x = command.split
    x = x.to_i
    if command == "insert" then
      doubleLinkedList.unshift(x)
    elsif command == "delete" then
      i = doubleLinkedList.index(x)
      doubleLinkedList.delete_at(i) if !i.nil?
    end
  end
end
puts doubleLinkedList.join(" ")

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

int main() {
  int64_t W, H, x, y;
  cin >> W >> H >> x >> y;
  cout << (W * H + 0.0) / 2 << " ";
  if ((W + 0.0) / 2 == x && (H + 0.0) / 2 == y) {
    cout << 1 << endl;
  }
  else {
    cout << 0 << endl;
  }
}

Measured memory_bytes: 3700
#include<iostream>
#include<map>
#include<vector>
using namespace std;
int main(){
    int max = 0;
    long long int n;
    vector<string> result;
    map<string,int> table;
    cin >> n;
    vector<string> text;
    for(int i = 1;i <= n;i++){
        string temp;
        cin >> temp;
        table[temp] += 1;
    }
    map<string,int>::iterator i;
    for(i = table.begin();i != table.end();i++){
        max = (max < i->second) ? i->second : max;
    }
    for(i = table.begin();i != table.end();i++){
        if(i->second == max){
            cout << i->first << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 25216
#include<iostream>
#include <fstream>
#include <vector>
#include <map>
#include <cmath>
#include <algorithm>

unsigned gcd(unsigned a, unsigned b) {
  if(a < b) return gcd(b, a);
  unsigned r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}

#define LOCAL  1
#define UPLOAD 2

using namespace std;

int main()
{
#if ENVIRONMENT == LOCAL
    std::ifstream in("input.txt");
    std::cin.rdbuf(in.rdbuf());
#endif

    int N;
    vector<int> A, B, C;
    cin >> N;

  for(int i=0;i<N;i++){
    int temp;
    cin >> temp;
    A.push_back(temp);
  }
    for(int i=0;i<N;i++){
    int temp;
    cin >> temp;
    B.push_back(temp);
  }
  for(int i=0;i<N-1;i++){
    int temp;
    cin >> temp;
    C.push_back(temp);
  }

  int sum = 0;
  for(int i=0;i<N;i++){
    sum +=B[A[i]-1];
    if(i >= 1 && A[i]-A[i-1] == 1){
      sum += C[A[i-1]-1];
    }
  }

  cout << sum << endl;

  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <vector>
#include <regex>
#include <map>
#include <set>
using namespace std;
using ll = long long;
const ll INF = 1LL << 60;


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

int main() {
    int N;
    cin >> N;
    ll h[111111] = {};
    ll dp[111111] = {};
    for(int i=0;i<N;i++){
        cin >> h[i];
        dp[i] = INF;
    }
    
    dp[0] = 0;
    dp[1] = abs(h[1]-h[0]);
    for(int i=2;i<N;i++){
        chmin(dp[i],dp[i-1]+abs(h[i]-h[i-1]));
        chmin(dp[i],dp[i-2]+abs(h[i]-h[i-2]));
    }
cout << dp[N-1]  << endl;
    return 0;
}



Measured memory_bytes: 1920
#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<cctype>
#include<cstring>
#include<cctype>
#include<cstdio>
#include<cstdlib>
#include<limits.h>

using namespace std;


int main()
{
  int low=1000000001;
  int high=-1;
  int n,i;
  scanf("%d",&n);
  int p[n];
  for(i=0;i<n;i++)
  {
      scanf("%d",&p[i]);
      if(low>p[i])
        low=p[i];
      if(high<p[i])
        high=p[i];
  }
  printf("%d\n",high-low);
    return 0;
}


Measured memory_bytes: 256
from collections import deque
n,m = tuple(map(int,input().split()))

edges = []

for _ in range(m):
  edges.append(tuple(map(int,input().split())))

ans = 0
for i in range(m):
  g = [[] for _ in range(n)]
  for j,e in enumerate(edges):
    if i==j:
      continue
    a,b = e
    a,b = a-1,b-1
    g[a].append(b)
    g[b].append(a)
    
  checked = [False]*n
  queue = deque([0])
  while(len(queue)>0):
    q = queue.popleft()
    if checked[q]:
      continue
    checked[q] = True
    for p in g[q]:
      queue.append(p)
  if not all(checked):
    ans+=1
print(ans)
  

Measured memory_bytes: 40816
import sys
N = int(sys.stdin.readline().strip());
H = sys.stdin.readline().split();
H = [int(x) for x in H]

q = [0 for x in range(N)]

u = H[::-1]
q[0] = u[0]
# 一番右は減らさないほうが得

flag = True

for i in range(1, N):
	# 左の方が右より2以上大きいなら
	if(u[i]>=q[i-1]+2):
		flag = False
		break
	# 左が右より1大きいなら
	if(u[i]==q[i-1]+1):
		# 減らす
		q[i] = u[i]-1
	else:
		# 何もなければ減らさない。→大きくしたいから。
		q[i] = u[i]

if(flag == True):
  print('Yes')
else:
  print('No')


Measured memory_bytes: 14684
k,n = map(int,input().split())
a = list(map(int,input().split()))
max = 0
for i in range(n-1):
    if max < a[i+1]-a[i]:
        max = a[i+1]-a[i]
if max < k-a[n-1]+a[0]:
    max = k-a[n-1]+a[0]
print(k-max)

Measured memory_bytes: 25452
n,a,b,c,d=map(int,input().split())
s=input()
# a->c, b->d
# a<b
if c>d:
  if '...' in s[b-2:d+1]:
    if '##' in s[a:c]:
      print('No')
      exit()
  else:
    print('No')
    exit()

else:
  if '##' in s[a:c]:
    print('No')
    exit()
  if '##' in s[b:d]:
    print('No')
    exit()
print('Yes')



Measured memory_bytes: 3572
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int mod = 1e9+7;

int main(){
    int h,w;
    cin >> h >> w;

    string math[h];

    for(int i = 0; i < h; i++) cin >> math[i];

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

    for(int i = 0; i < h; i++){
        for(int j = 0; j < w; j++){
            if(math[i][j] == '.'){
                int cnt = 0;
                for(int k = 0; k < 8; k++){
                    int y = i+dy[k];
                    int x = j+dx[k];
                    if(0 <= y && y < h && 0 <= x && x < w){
                        if(math[y][x] == '#') cnt++;
                    }
                }
                math[i][j] = '0'+cnt;
            }
        }
    } 
    
    for(int i = 0; i < h; i++){
        cout << math[i] << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define ll long long
#define ld long double
#define PB push_back
#define lc 2 * v
#define rc 2 * v + 1
#define mid (s + e) / 2
#define pii pair <int , int>
#define pll pair <long long , long long>
#define FAST ios::sync_with_stdio(false);cin.tie(0);
// #pragma GCC optimize("Ofast")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2")

const ll maxn = 4e5 , N = 1000 + 10 , mod = 1e9 + 7 , INF = 1e9 + 1 , lg = 32;

int n , m , k;
pii a[maxn] , b[maxn];
vector <int> s[maxn] , d[maxn];
bool mark1[maxn];

bool cmp(pii x , pii y) {
	return x.F > y.F;
}

int main() {
	FAST
	cin >> n >> m >> k;
	for (int i = 0; i < n; ++i) {
		a[i] = {0 , i};
	}
	for (int i = 0; i < m; ++i) {
		b[i] = {0 , i};
	}
	for (int i = 0; i < k; ++i) {
		int x , y; cin >> x >> y;
		x--; y--;
		s[x].PB(y);
		d[y].PB(x);
		a[x].F++; b[y].F++;
	}
	sort(a , a + n , cmp);
	sort(b , b + m , cmp);
	mark1[a[0].S] = 1;
	int lim = 1;
	for (int i = 1; i < n; ++i) {
		if(a[i].F == a[i - 1].F) {
			mark1[a[i].S] = 1;
			lim++;
		}
		else {
			break;
		}
	}
	for (int i = 0; i < m; ++i) {
		if(!i) {
			int cnt = 0;
			for (auto v : d[b[i].S]) {
				if(mark1[v]) {
					cnt++;
				}
			}
			if(cnt != lim) {
				cout << b[i].F + a[0].F << endl;
				return 0;
			}
		}
		else if(b[i].F == b[i - 1].F) {
			int cnt = 0;
			for (auto v : d[b[i].S]) {
				if(mark1[v]) {
					cnt++;
				}
			}
			if(cnt != lim) {
				cout << b[i].F + a[0].F << endl;
				return 0;
			}
		}
		else {
			break;
		}
	}
	cout << b[0].F + a[0].F - 1 << endl;
}


Measured memory_bytes: 46060
#include<bits/stdc++.h>
using namespace std;
///Welcome to Nasif's Code
#define bug printf("bug\n");
#define bug2(var) cout<<#var<<" "<<var<<endl;
#define co(q) cout<<q<<endl;
typedef long long int ll;
typedef unsigned long long int ull;
const int MOD = (int)1e9+7;
const int MAX = 1e6;
#define pi acos(-1)
#define inf 1000000000000000LL
#define FastRead    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{
    FastRead
    //freopen("output.txt", "w", stdout);
    int  a,b;
    string s;
    cin>>a>>b;
    cin>>s;
    if(s[a]!='-')
    {
        cout<<"No"<<endl;
        return 0;
    }
    for(int i=0; i<a; i++)
    {
        if(!(s[i]>='0' && s[i]<='9'))
        {
            cout<<"No"<<endl;
            return 0;
        }
    }
    for(int i=a+1; i<a+1+b; i++)
    {
        if(!(s[i]>='0' && s[i]<='9'))
        {
            cout<<"No"<<endl;
            return 0;
        }
    }




    cout<<"Yes"<<endl;

    return 0;
}


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

typedef long long ll;

int solve(ll N)
{
	ll pw[21];
	pw[0]=1;
	for(int i=1; i<=20; i++)
		pw[i] = pw[i-1] * 3LL;

	int res = 0;
	for(int i=1; i<=20; i++)
	{
		if(pw[i] >= N) return i;
	}

	return -1;
}

int main()
{
	ll N;
	cin >> N;

	cout << solve(N) << endl;
}

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

using ll = long long;

const int INF = 1001001001;
const ll INF_LL = 1001001001001001001LL;

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

  rep(i,s.size()){
    if(s[i]+n>'Z'){
      s[i] -= 65;
      s[i] += n;
      s[i] %= 26;
      s[i] += 65;
    }
    else{
      s[i]+=n;
    }
  }

  cout << s << endl;
  
  return 0;
}


Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
#define LD long double
#define LL long long int
#define ULL unsigned long long
#define vi vector<int>
#define mod 1000000007

int main(){
	string s;
  	cin>>s;
  	int len = s.length();
  	int i=0, j=len-1;
  	int count = 0;
  	while(i<j){
     	if( s[i] != s[j]){
         count++; 
        }
      i++;
      j--;
    }
  	cout << count <<endl;
  
  
}
  


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <clocale>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <regex>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i, s, n) for(int i = (s), i##_len=(n); i < i##_len; ++i)
#define FORS(i, s, n) for(int i = (s), i##_len=(n); i <= i##_len; ++i)
#define VFOR(i, s, n) for(int i = (s); i < (n); ++i)
#define VFORS(i, s, n) for(int i = (s); i <= (n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) FORS(i, 0, n)
#define VREP(i, n) VFOR(i, 0, n)
#define VREPS(i, n) VFORS(i, 0, n)
#define RFOR(i, s, n) for(int i = (s), i##_len=(n); i >= i##_len; --i)
#define RFORS(i, s, n) for(int i = (s), i##_len=(n); i > i##_len; --i)
#define RREP(i, n) RFOR(i, n, 0)
#define RREPS(i, n) RFORS(i, n, 0)
#define ALL(v) (v).begin(), (v).end()
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort(ALL(v), greater<decltype(v[0])>())
#define SZ(x) ((int)(x).size())
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define MT make_tuple
#define BIT(n) (1LL<<(n))
#define UNIQUE(v) v.erase(unique(ALL(v)), v.end())

using ld = long double;
using ll = long long;
using ui = unsigned int;
using ull = unsigned long long;
using Pi_i = pair<int, int>;
using VB = vector<bool>;
using VC = vector<char>;
using VD = vector<double>;
using VI = vector<int>;
using VLL = vector<ll>;
using VS = vector<string>;
using VSH = vector<short>;
using VULL = vector<ull>;

const int MOD = 1000000007;
const int INF = 1000000000;
const int NIL = -1;
const double EPS = 1E-10;

template<class T, class S>
bool chmax(T &a, const S &b){
    if(a < b){
        a = b; return true;
    }
    return false;
}
template<class T, class S>
bool chmin(T &a, const S &b){
    if(b < a){
        a = b; return true;
    }
    return false;
}


int main(){
    int H, N; cin >> H >> N;
    REP(i, N){
        int A; cin >> A;
        H -= A;
    }
    cout << (H<=0 ? "Yes" : "No") << endl;
    return 0;
}


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

int main(){
    int n,q;
    while(cin>>n>>q,n){
        vector<int> d(100,0);
        for(int i=0;i<n;i++){
            int m;
            cin>>m;
            for(int j=0;j<m;j++){
                int p;
                cin>>p;
                d[p-1]++;

            }

        }
        int res=1000;
        for(int i=0;i<100;i++){
            if(d[i]>=q)
                res=i+1,q=d[i]+1;
        }
        if(res==1000)
            res=0;
        cout<<res<<endl;
    }
    return 0;
}

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

using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef pair<ll, ll> pair_t;
using Graph = vector<vector<ll>>;

#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
/***** define constant start *******/
const ll MOD = 1000000007;
const double PI = 3.1415926535897932;
const ll INF = 1 << 29;
/****** define constant end ********/
/****** define variable start ******/
ll n;
vl a;
/******* define variable end *******/
ll solve() {
	cin >> n;
	a.resize(n);
	ll fo_c = 0;
	ll tw_c = 0;
	ll no_c = 0;
	REP(i, n){
		cin >> a[i];
		if(a[i] % 4 == 0){
			fo_c++;
		}else if(a[i] % 2 == 0){
			tw_c++;
		}else{
			no_c++;
		}
	}
	if(n == 1 && fo_c == 0){
		cout << "No" << endl;
	}
	else if(fo_c +1 == no_c && tw_c == 0){
		cout << "Yes"<<endl;
	}
	else if(n == 3 && fo_c == 1 && no_c == 2){
		cout << "Yes" << endl;
	}
	else if(no_c <= fo_c){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;
	}

	return 0;
}
int main() {
	// clock_t start = clock();
	cout << std::fixed << std::setprecision(10);
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	ll end_solve = solve();
	/*
	clock_t end = clock();
	const double time = static_cast<double>(end - start) / CLOCKS_PER_SEC *
	1000.0; printf("time %lf[ms]\n", time);
	*/

	return (int)end_solve;
}


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

int main() {
int W, H, x, y, r;
cin >> W >> H>> x >> y >> r;
int ans = 1;
if (x + r > W || x - r < 0) {
ans = 0;
} if ( y + r > H || y - r < 0) {
ans = 0;
} if (ans == 1) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} 


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

using namespace std;

#define INF 1000000007
#define LINF (1LL << 60)
#define PI 3.14159265358979

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

inline i64 mod(i64 a, i64 m) { return (a % m + m) % m; }

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



string s, t;
bool b[26];
vector<int> v[26];
void solve(){
	cin >> s >> t;
	int n = s.size(), m = t.size();
	
	for(int i = 0; i < n; i++) b[s[i]-'a'] = 1;
	for(int i = 0; i < m; i++){
		if(!b[t[i]-'a']){
			cout << -1 << endl;
			return;
		}
	}
	
	for(int i = 0; i < n+n; i++){
		v[s[i%n]-'a'].push_back(i);
	}
	
	i64 cnt = 0, now = -1;
	for(int i = 0; i < m; i++){
		int c = t[i]-'a';
		int nx = *lower_bound(v[c].begin(), v[c].end(), now+1);
		cnt += nx-now;
		now = nx%n;
	}
	cout << cnt << endl;
}

int main(){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	int t = 1;
	//cin >> t;
	while(t--){
		solve();
	}
	
	return 0;
}


Measured memory_bytes: 1736
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<cstring>
#include<math.h>
#include<bitset>
#include<queue>
#include<set>
#include<iomanip>
#include<assert.h>
#include<string>
#include<cstdlib>
#include<cctype>
#include<unordered_map>
#include<sstream>
#include<numeric>
#include<stack>
// #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
constexpr ll INF = 9e18;
constexpr int inf = 1e9;
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;
};

// intやllをstringに変換
template<typename T> inline string toString(const T &a){
  ostringstream oss;
  oss << a;
  return oss.str();
};
// ----------------------------------------------------------------------------

int main(){
  set<int> se;
  for(int i=0; i<3; i++){
    int a;
    cin >> a;
    se.insert(a);
  }
  if(se.size() == 2){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  return 0;
}


Measured memory_bytes: 256