akhauriyash/Code-Regression huggingface dataset:
/******techknight@3******/
#include<bits/stdc++.h>
using namespace std;
#define lld               long long int
#define ld                long double
#define pb                push_back
#define ppb               pop_back
#define mp                make_pair
#define F                 first
#define S                 second
#define nl                '\n'
#define all(c)            (c).begin(),(c).end()
#define rall(c)           (c).rbegin(),(c).rend()
#define sz(c)             (c).size()
#define tr(x,a)           for(auto &a : x)
#define psnt(x,a)         (x).find(a)!=(x).end()
#define vpsnt(x,a)        find(all(x),a)!=(x).end()
#define lexichar(x,y)     lexicographical_compare(x,x+strlen(x),y,y+strlen(y)) //modify the ranges
#define lexistr(x,y)      lexicographical_compare(x.begin(),x.end(),y.begin(),y.end()) 
#define MOD               1000000007
#define pi                3.1415926536
#define tod               1
#define itr(i,a,b)        for(lld i=a;i<=b;i++)
#define itrn(i,a,b)       for(lld i=a;i>=b;i--)
#define iot(n)            for(lld i=0;i<n;i++)
#define pls(n,arr)        lld arr[n]; iot(n)  cin>>arr[i];
#define bye               fflush(stdout)

typedef pair<lld,lld>     pii;
typedef pair<string,lld>  psi;
template <typename T>
bool mycomp(T x,T y){ 
   return (x==y);  //give your condition here
}
bool paircomp(const pair<lld,lld> &x,const pair<lld,lld> &y){ 
return x.second<y.second;
}

int main(){
       ios_base::sync_with_stdio(false);
             cin.tie(0);
            cout.tie(0);
          lld a; long double b; cin>>a; cin>>b;
 long double ff=(long double)a*b*1.00000000;//cout<<ff<<nl;
          lld f=ff;
  if(f-ff>0.00000000) f--;
          cout<<f;
      }



Measured memory_bytes: 3748
import sys


sys.setrecursionlimit(10 ** 6)
INF = float("inf")
MOD = 10 ** 9 + 7


def input():
    return sys.stdin.readline().strip()


def factorization(N):
    d = {}
    for n in range(2, N + 1):
        tmp = n
        for i in range(2, int(n ** 0.5) + 1):
            if tmp % i == 0:
                cnt = 0
                while tmp % i == 0:
                    cnt += 1
                    tmp //= i
                if i not in d:
                    d[i] = cnt
                else:
                    d[i] += cnt

        if tmp != 1:
            if tmp not in d:
                d[tmp] = 1
            else:
                d[tmp] += 1

    return d


def main():
    N = int(input())
    d = factorization(N)
    d = [v for k, v in d.items() if v > 1]
    n = len(d)
    ans = 0
    for i in range(n):
        val = d[i]
        if val >= 74:
            ans += 1

        if val >= 24:
            ans += n - 1

        if val >= 14:
            cnt = 0
            for j in range(n):
                if i == j:
                    continue
                if d[j] >= 4:
                    cnt += 1
            ans += cnt

    cnt_4 = 0
    cnt_2 = 0
    for i in range(n):
        if d[i] >= 4:
            cnt_4 += 1
        else:
            cnt_2 += 1

    ans += (cnt_4 - 1) * cnt_4 // 2 * cnt_2
    ans += (cnt_4 - 2) * (cnt_4 - 1) * cnt_4 // 2

    print(ans)


if __name__ == "__main__":
    main()


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

using namespace std;

typedef long long ll;

const int INF = 1e9;
const ll LLINF = 1e18;

int main()
{
  int N, M; scanf("%d %d", &N, &M);
  vector<int> A(N), B(N), C(M), D(M);
  for (int i = 0; i < N; ++i) {
    scanf("%d %d", &A[i], &B[i]);
  }
  for (int i = 0; i < M; ++i) {
    scanf("%d %d", &C[i], &D[i]);
  }
  for (int i = 0; i < N; ++i) {
    int point = -1;
    int min_d = INF;
    for (int j = 0; j < M; ++j) {
      int d = abs(A[i] - C[j]) + abs(B[i] - D[j]);
      if (d < min_d) {
        min_d = d;
        point = j + 1;
      }
    }
    printf("%d\n", point);
  }
  return 0;
}


Measured memory_bytes: 256
import scala.io.StdIn._
object Main extends App {
  var set: Set[String] = Set.empty
  readLine
  var flag = false
  val a = readLine.split(" ").iterator
  while (a.hasNext && !flag) {
    val aa = a.next
    if (set contains aa) {
      flag = true
    } else {
      set = set + aa
    }
  }

  println(if (flag) "NO" else "YES")
}


Measured memory_bytes: 103112
D, G = map(int, input().split())
dic = [0]*(D+1)
for i in range(D):
  p, c = map(int, input().split())
  dic[i+1] = (p,c)
ans = 10**9
for i in range(2**D):
  ls = []
  x = i
  v = 0
  count = 0
  for j in range(D):
    if x%2==1:
      ls += [j+1]
    x = x>>1
  for h in ls:
    p, c = dic[h]
    v += p*h*100 + c
    count += p
  if G>v:
    for j in range(D, 0, -1):
      if not j in ls:
        break
    else:
      continue
    m = dic[j][0]
    while m>1:
      v += j*100
      count += 1
      m -= 1
      if v>=G:
        break
    else:
      continue
  if count<ans:
    ans = count
print(ans)

Measured memory_bytes: 3064
function main(lines) {
  const [L, R, d] = splitN(lines[0]);

  let res = 0;
  for (let i = L; i <= R; i++) {
    if (i % d === 0) res++;
  }
  
  console.log(res);
}


main( require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n") );



function splitN(s) {
  return s.split(' ').map(Number);
}

Measured memory_bytes: 29644
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,e) for(int i = a;i < e;++i)
using LL = long long;

int main() {

	int N;
	cin >> N;
	vector<int> b(N - 1);
	for (int i = 0; i < N - 1; ++i) {
		cin >> b[i];
	}
	vector<int>a(N);
	a[0] = b[0];
	a.back() = b.back();
	FOR(i, 1, N - 1) {
		a[i] = min(b[i - 1], b[i]);
	}
	int ans = 0;
	FOR(i, 0, N)ans += a[i];
	cout << ans << endl;

}




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

using ll = long long;
using ld = long double;
using pii = pair<int, int>;

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
#define m0(x) memset(x,0,sizeof(x))

int dx4[4] = {1,0,-1,0}, dy4[4] = {0,1,0,-1};

int main()
{
    int x[2],ans=0;
    for (int i = 0; i < 2; i++)
    {
        cin>>x[i];
        if(x[i]==1) ans+=300000;
        if(x[i]==2) ans+=200000;
        if(x[i]==3) ans+=100000;
    }
    if(x[0]==1&&x[1]==1) ans+=400000;
    cout<<ans<<endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define UNIQUE(v) v.erase(unique(all(v)), v.end());
#define ZIP(v) sort(all(v)),UNIQUE(v)
#define ADD(a, b) a = (a + b) % mod
#define SUB(a, b) a = (a+mod-b)%mod
#define MUL(a, b) a = (a * b) % mod
#define repi(i,m,n) for(int i = m;i < n;i++)
#define drep(i,n,m) for(int i = n;i >= m;i--)
#define rep(i,n) repi(i,0,n)
#define rrep(i,n) repi(i,1,n+1)
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(), v.rend()
#define dmp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define fi first
#define se second
typedef pair<int,int> P;
typedef pair<int, P> PP;
typedef pair<P, int> Pi;
typedef vector<int> vi;
typedef deque<int> dq;
const int inf = 1e9+7;
const int INF = 1e18+7;

int a[4000], b[4000][4000];
signed main(){
	int n, t;
	scanf("%lld%lld", &n, &t);
	rep(i,n)scanf("%lld", &a[i]);
	rep(i,n)b[0][i] = a[i];
	rrep(i,n-1)rep(j,n){
		if(j == 0){b[i][j] = min(b[i-1][n-1], a[j]);continue;}
		b[i][j] = min(b[i-1][j-1], a[j]);
	}
	
	int ans = INF;
	rep(i,n){
		int x = t*i;
		rep(j,n)x += b[i][j];
		chmin(ans, x);
	}
	printf("%lld\n", ans);
	return 0;
}







Measured memory_bytes: 62976
/*input
2
10 30
*/
#include <bits/stdc++.h>
using namespace std;

#define el "\n"
#define mp make_pair
#define pb push_back
#define int long long

signed main() {
	long double n,a,sum=0;
	cin>>n;
	for(int i=0;i<n;i++) {
		cin>>a;
		a=1/a;
		sum+=a;
	}
	cout<<1/sum;
}

Measured memory_bytes: 384
// {{{ by shik
#include <bits/stdc++.h>
#pragma GCC diagnostic ignored "-Wunused-result"
#pragma GCC diagnostic ignored "-Wunused-function"
#define SZ(x) ((int)(x).size())
#define ALL(x) begin(x), end(x)
#define REP(i, n) for (int i = 0; i < int(n); i++)
#define REP1(i, a, b) for (int i = (a); i <= int(b); i++)
#define MP make_pair
#define PB push_back
using namespace std;
typedef int64_t LL;
typedef pair<int, int> PII;
typedef vector<int> VI;

namespace { namespace shik {

template<class T> void _R(T &x) { cin >> x; }
void _R(int &x) { scanf("%d", &x); }
void _R(int64_t &x) { scanf("%" SCNd64, &x); }
void _R(double &x) { scanf("%lf", &x); }
void _R(char &x) { scanf(" %c", &x); }
void _R(char *x) { scanf("%s", x); }
void R() {}
template<class T, class... U> void R(T &head, U &... tail) { _R(head); R(tail...); }

template<class T> void _W(const T &x) { cout << x; }
void _W(const int &x) { printf("%d", x); }
void _W(const int64_t &x) { printf("%" PRId64, x); }
void _W(const double &x) { printf("%.16f", x); }
void _W(const char &x) { putchar(x); }
void _W(const char *x) { printf("%s", x); }
template<class T> void _W(const vector<T> &x) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }
void W() {}
template<class T, class... U> void W(const T &head, const U &... tail) { _W(head); putchar(sizeof...(tail) ? ' ' : '\n'); W(tail...); }

#ifdef SHIK
#include "dump.hpp"
#else
#define dump(...)
#endif

template<class T, class F = less<T>> void sort_uniq(vector<T> &v, F f = F()) { sort(begin(v), end(v), f); v.resize(unique(begin(v), end(v)) - begin(v)); }
template<class T> inline T bit(T x, int i) { return (x >> i) & 1; }
template<class T> inline bool chkmax(T &a, const T &b) { return b > a ? a = b, true : false; }
template<class T> inline bool chkmin(T &a, const T &b) { return b < a ? a = b, true : false; }
template<class T> using MaxHeap = priority_queue<T>;
template<class T> using MinHeap = priority_queue<T, vector<T>, greater<T>>;

// }}}

const int N=110;
int n,a[N],b[N];
void main() {
    R(n);
    REP1(i,1,n) R(a[i]);
    VI sol;
    for ( int i=n; i>=1; i-- ) {
        int w=0;
        for ( int j=i; !w && j>=1; j-- ) if ( a[j]==j ) w=j;
        if ( !w ) {
            W(-1);
            return;
        }
        sol.PB(w);
        REP1(j,w,i-1) a[j]=a[j+1];
    }
    reverse(ALL(sol));
    for ( int i:sol ) W(i);
}

// {{{ main
}}
int main() { shik::main(); return 0; }
// }}}


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

#define itn int
#define all(x) (x).begin(), (x).end()
#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())

using namespace std;

inline int nxt() {
	int x;
	scanf("%d", &x);
	return x;
}

const int N = 111111;
int op[N * 3];
int cl[N * 3];

int main() {
	int n = nxt();
	for (int i = 0; i < n; ++i) {
		int l = nxt() + N;
		int r = nxt() + N;
		op[l] += 1;
		cl[r] += 1;
	}

	long long ans = 0;
	int cl_l = 0, op_r = n;
	for (int i = 0; i < 3 * N - 1; ++i) {
		cl_l += cl[i];
		op_r -= op[i];

		// auto old_ans = ans;
		if (i - N < 0) {
			ans += min(cl_l, op_r + 1);
		} else {
			ans += min(cl_l + 1, op_r);
		}
		// if (ans != old_ans) {
		// 	cerr << i - N << " -- " << i - N + 1 << ": " << ans - old_ans << "\n";
		// }
	}

	cout << ans * 2 << "\n";

	return 0;
}

Measured memory_bytes: 1792
# Your code here!

def partition(a, l, r)
  pivot = a[r-1][1]
  j = l-1
  (l...r).each do |i|
    if a[i][1] <= pivot
      j+=1
      a[j], a[i] = a[i], a[j]
    end
  end
  return j
end

def quick_sort(a, l, r)
  if 1 < r-l
    q = partition(a, l, r)
    quick_sort(a, l, q)
    quick_sort(a, q+1, r)
  end
end


def merge(a, l, m, r)
  l_arr = a[l, m-l] << ['死', 10000000000000000000]
  l_i = 0
  r_arr = a[m, r-m] << ['死', 10000000000000000000]
  r_i = 0
  
  (l...r).each do |idx|
    # 小さい方から入れていく
    if l_arr[l_i][1] <= r_arr[r_i][1]
      a[idx] = l_arr[l_i]
      l_i+=1
    else
      a[idx] = r_arr[r_i]
      r_i+=1
    end
  end
end

def merge_sort(a, left, right)
  if 1 < right-left
    mid = (right+left)/2
    merge_sort(a, left, mid)
    merge_sort(a, mid, right)
    merge(a, left, mid, right)
  end
end

n = gets.to_i
a = []
n.times do
  a << gets.chomp.split.map{|x| x.match?(/\d/) ? x.to_i : x}
end
b = a.clone
quick_sort(a, 0, n)
merge_sort(b, 0, n)

puts a == b ? "Stable" : "Not stable"
a.each do |av|
  puts "#{av[0]} #{av[1]}"
end


Measured memory_bytes: 24492
#include<bits/stdc++.h>
using namespace std;
 
typedef    long long          ll;
typedef    vector<long long>    vi; 
typedef    vector<vi>         vvi; 
typedef    pair<long,long>      ii; 
#define    sz(a)              long((a).size()) 
#define    pb                 push_back 
#define    mp                   make_pair
#define    all(c)             (c).begin(),(c).end() 
#define    tr(c,i)            for(typeof((c).begin() i = (c).begin(); i != (c).end(); i++) 
#define    present(c,x)       ((c).find(x) != (c).end()) 
#define    cpresent(c,x)      (find(all(c),x) != (c).end())  
#define    input(v,n)           for(ll i = 0 ; i<n ; i++) cin>>v[i]
#define    output(v,n)          for(ll i = 0 ; i<n ; i++) cout<<v[i]<<" "

ll g[1000000];
 
int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);

  ll n,k,i,j;
  cin>>n>>k;
  ll a[n+1];

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

  for(i=0;i<k;i++)
  {
    for(j=0;j<n;j++)
    {
      g[i+a[j]]|=(!g[i]);
    }
  }

  if(g[k])cout<<"First\n";
  else cout<<"Second\n";

  return 0;
}


Measured memory_bytes: 1792
n = int(input())
a = input().split()
for i in range(n):
	a[i] = int(a[i])

def gojo(num1, num2):
	if num2 > num1:
		num1, num2 = num2, num1
	if num2 == 0:
		return num1
	else:
		num3 = num1 % num2
		return gojo(num2, num3)
counter = gojo(a[0], a[1])
for i in range(n - 1):
	checker = gojo(a[i], a[i + 1])
	if checker < counter:
		counter = checker

print(counter)

Measured memory_bytes: 11100
from itertools import product
D,G = map(int,input().split())
p,c = [0]*D,[0]*D
for i in range(D):
  p[i],c[i] = list(map(int,input().split()))
m = 10*100*10
for a in product([True,False], repeat=D):
  g,n = G,0
  for i in range(D):
    if a[i]:
      n += p[i]
      g -= (c[i]+(i+1)*100*p[i])
  if g <= 0 and n <= m:
    m = n
    continue
  elif m < n:
    continue
  for i in range(D):
    if a[i]:
      continue
    if g > (i+1)*100*(p[i]-1):
      continue
    n += (g+(i+1)*100-1) // ((i+1)*100)
    if n < m:
      m = n
print(m)


Measured memory_bytes: 3064
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> P;
typedef pair<int, P> P1;

#define fr first
#define sc second
#define mp make_pair
#define pb push_back
#define rep(i, x) for (int i = 0; i < x; i++)
#define rep1(i, x) for (int i = 1; i <= x; i++)
#define rrep(i, x) for (int i = x - 1; i >= 0; i--)
#define rrep1(i, x) for (int i = x; i > 0; i--)
#define sor(v) sort(v.begin(), v.end())
#define rev(s) reverse(s.begin(), s.end())
#define lb(vec, a) lower_bound(vec.begin(), vec.end(), a)
#define ub(vec, a) upper_bound(vec.begin(), vec.end(), a)
#define uniq(vec) vec.erase(unique(vec.begin(), vec.end()), vec.end())
#define mp1(a, b, c) P1(a, P(b, c))

#define disp(x) cout << #x << ": " << x << endl
#define disp_vec(v)                                                                           \
    cout << #v << ":";                                                                        \
    rep(i, v.size()) cout << " " << v[i];                                                     \
    cout << endl

const int INF = 100000000;
const int M = 100000000;
const int dir_4[4][2] = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};
const int dir_8[8][2] = {{1, 0}, {1, 1}, {0, 1}, {-1, 1}, {-1, 0}, {-1, -1}, {0, -1}, {1, -1}};

/* ------------------------------------- */
int n, c[30], v[30];

int dfs(int i, int val) {
    if (i == n)
        return val;

    return max(dfs(i + 1, val), dfs(i + 1, val + v[i] - c[i]));
}

int main() {
    scanf("%d", &n);
    rep(i, n) scanf("%d", &v[i]);
    rep(i, n) scanf("%d", &c[i]);
    printf("%d\n", dfs(0, 0));

    /* --------------------------------- */
    return 0;
}

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

int main(){
	ios_base::sync_with_stdio(false),cin.tie(nullptr);
    long int n;
    cin>>n;
    long long int *a;
    a=new long long int [n];
    long long int c=0,sum=0;
    long long int b=pow(10,9)+7;
    for(long int i=0;i<n;i++){
        cin>>a[i];
        c+=sum*a[i];
        c=c%b;
        sum+=a[i];
        sum=sum%b;
        }
    
    cout<<c<<endl;
}



Measured memory_bytes: 5188
local mfl, mce, mmi = math.floor, math.ceil, math.min
local SegTree = {}
SegTree.create = function(self, ary, func, emptyvalue)
  self.n, self.func, self.emptyvalue = #ary, func, emptyvalue
  local stagenum, mul = 1, 1
  self.cnt, self.stage, self.size = {1}, {{}}, {}
  while mul < self.n do
    mul, stagenum = mul * 2, stagenum + 1
    self.cnt[stagenum], self.stage[stagenum] = mul, {}
  end
  for i = 1, stagenum do
    self.size[i] = self.cnt[stagenum + 1 - i]
  end
  self.stagenum = stagenum
  for i = 1, self.n do
    self.stage[stagenum][i] = ary[i]
  end
  for i = self.n + 1, mul do
    self.stage[stagenum][i] = emptyvalue
  end
  for i = stagenum - 1, 1, -1 do
    for j = 1, self.cnt[i] do
      self.stage[i][j] = func(self.stage[i + 1][j * 2 - 1], self.stage[i + 1][j * 2])
    end
  end
end
SegTree.getRange = function(self, left, right)
  if left == right then return self.stage[self.stagenum][left] end
  local start_stage = 1
  while right - left + 1 < self.size[start_stage] do
    start_stage = start_stage + 1
  end
  local ret = self.emptyvalue
  local tasks = {{start_stage, left, right}}
  while 0 < #tasks do
    local task = tasks[#tasks]
    table.remove(tasks)
    local stage, l, r = task[1], task[2], task[3]
    if (l - 1) % self.size[stage] ~= 0 then
      local newr = mce((l - 1) / self.size[stage]) * self.size[stage]
      table.insert(tasks, {stage + 1, l, mmi(r, newr)})
      l = newr + 1
    end
    if self.size[stage] <= r + 1 - l then
      local pos = mce(l / self.size[stage])
      ret = self.func(ret, self.stage[stage][pos])
      l = l + self.size[stage]
    end
    if l <= r then
      table.insert(tasks, {stage + 1, l, r})
    end
  end
  return ret
end

SegTree.new = function(ary, func, emptyvalue)
  local obj = {}
  setmetatable(obj, {__index = SegTree})
  obj:create(ary, func, emptyvalue)
  return obj
end

local n = io.read("*n", "*l")
local str = io.read()
local t = {}
local idx = 1
for v in str:gmatch("%d+") do
  table.insert(t, {idx, tonumber(v)})
  idx = idx + 1
end
local segtree = SegTree.new(t, function(a, b) return a[2] < b[2] and a or b end, {0, n + 1})
local tasks = {{1, n}}
local ret1, ret2 = 0, 0
local big = 1000000000
while 0 < #tasks do
  local l, r = tasks[#tasks][1], tasks[#tasks][2]
  table.remove(tasks)
  local p = segtree:getRange(l, r)
  local val = p[2] * (p[1] + 1 - l) * (r + 1 - p[1])
  ret2 = ret2 + val
  ret1, ret2 = ret1 + mfl(ret2 / big), ret2 % big
  if p[1] ~= l then
    table.insert(tasks, {l, p[1] - 1})
  end
  if p[1] ~= r then
    table.insert(tasks, {p[1] + 1, r})
  end
end
ret2 = 0 < ret1 and string.format("%09d", ret2) or ret2
ret1 = 0 < ret1 and ret1 or ""
print(ret1 .. ret2)


Measured memory_bytes: 58588
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <queue>
#include <list>
#include <cmath>
#include <stack>
#include <iomanip>

using namespace std;
typedef long long ll;
using Pll = pair<ll,ll>;

const ll INF = 1LL<<60;
const ll MOD = 1000000007;

//cout << fixed << setprecision(10);

int main() {
    ll N;
    cin >> N;
    vector<ll> A(N);
    for(int i=0;i<N;i++) cin >> A[i];

    vector<ll> ans(N,0),ct(N,0);
    ll ansct=0;
    for(int i=N/2;i<N;i++){
        ans[i]=A[i];
        ct[i]=A[i];
        if(ans[i]==1) ansct++;
    }
    for(int i=N/2-1;i>=0;i--){
        ll tmp=0;
        for(int j=i;j<N;j+=i+1){
            tmp+=ct[j];
        }
        if(tmp%2==0){
            if(A[i]==0){
                ct[i]=0;
                ans[i]=0;
            }
            else{
                ct[i]=1;
                ans[i]=1;
                ansct++;
            }
        }
        else{
            if(A[i]==0){
                ct[i]=1;
                ans[i]=1;
                ansct++;
            }
            else{
                ct[i]=0;
                ans[i]=0;
            }
        }
    }
    cout << ansct << endl;
    for(int i=0;i<N;i++){
        if(ans[i]==1){
            cout << i+1 << endl;
        }
    }

    return 0;
}

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

char ma[105][105];
int vis[105][105];
int ans;int w,h;

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

void dfs(int x,int y,char ch)
{
    if(vis[x][y]) return ;
    vis[x][y]=1;
    for(int i=0;i<4;i++)
    {
        int xx=x+dx[i];
        int yy=y+dy[i];
        if(xx>=0&&xx<w&&yy>=0&&yy<h&&ma[xx][yy]==ch)
        dfs(xx,yy,ma[xx][yy]);
    }
}


int main()
{

    while(scanf("%d%d",&w,&h)&&w!=0)
    {
        memset(vis,0,sizeof(vis));
        ans=0;
        for(int i=0;i<w;i++)
            scanf("%s",&ma[i]);

        for(int i=0;i<w;i++)
        {
            for(int j=0;j<h;j++)
            {
                if(vis[i][j])continue;
                dfs(i,j,ma[i][j]);ans++;
            }


        }
        printf("%d\n",ans);

    }
}

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

#define froop1(a,n) for(int i = a;i < n;i++)
#define froop2(a,n) for(int i = a;i > n;i--)
int main(){
	int h1,h2,m1,m2,k,t1,t2,i;
  cin >> h1 >> m1 >> h2 >> m2 >> k;
  t1 = h1 * 60 + m1;
  t2 = h2 * 60 + m2;
  i = t2 - t1 - k;
  cout << i << endl;
return 0;
}

Measured memory_bytes: 3636
#include <iostream>
using namespace std;
 
int main(){
 
 int r, c, t[101][101] = {};
 
 cin >> r >> c;
 
 for (int i = 0; i < r; i++) {
  for (int j = 0; j < c; j++) {
   cin >> t[i][j];
   t[r][j] += t[i][j];
   t[i][c] += t[i][j];
  }
  t[r][c] += t[i][c];
 }
 
 for (int i = 0; i <= r; i++) {
  for (int j = 0; j < c; j++) {
   cout << t[i][j] << " ";
  }
  cout << t[i][c] << endl;
 }
  
 return 0;
}

Measured memory_bytes: 1208
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby
    #from itertools import product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    n,m = map(int, input().split())
    def yakusuu(N):
        n = int(N**.5)+1
        res1 = []
        res2 = []
        for i in range(1, n):
            if N%i==0:
                res1.append(i)
                if N!=i**2:
                    res2.append(N//i)
        res2.reverse()
        return res1+res2
    a = yakusuu(m)
    a.sort(reverse=True)
    for i in a:
        if m//i >= n:
            print(i)
            break

if __name__ == '__main__':
    main()

Measured memory_bytes: 3316
// 比较好的方法
#include<iostream>
using namespace std;
#define MAXN 200005

int n, a[MAXN];
long long cnt[MAXN];

int main(){
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
        scanf("%d",&a[i]);
        cnt[a[i]]++;        		// 统计每个输入出现个数
    }
    long long total=0;
    for(int i=1;i<=n;i++)
        total+=cnt[i]*(cnt[i]-1)/2; // 总共可能出现的组合数
    for(int i=1;i<=n;i++){
        long long cur=cnt[a[i]];    // 当前输入的个数
        // 这句很棒，不需要进行复杂循环，直接计算结果
        // ans=total-cur能产生的组合数+cur去掉当前这个后实际产生的组合数
        long long ans=total-cur*(cur-1)/2+(cur-1)*(cur-2)/2;
        printf("%lld\n",ans);
    }
    return 0;
}

Measured memory_bytes: 3968
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> vvl;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvec;
typedef vector<vector<bool>> vveb;
typedef vector<vector<string>> vves;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define rep2(i,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define rev(v) reverse(v.begin(), v.end())
#define fs first
#define sc second
#define pb push_back
#define pp pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) *max_element(all(a))
#define minel(a) *min_element(all(a))
#define acc accumulate
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)
typedef long long int64;
//const int64 INF = 1LL << 58;
#define dame { puts("-1"); return 0;}
#define YES { cout << "YES" << endl; return 0; }
#define NO { cout << "NO" << endl; return 0; }
#define Yes { cout << "Yes" << endl; return 0; }
#define No { cout << "No" << endl; return 0; }
#define uniq(a) sort(all(a));(a).resize(unique(all(a)) - a.begin());
#define dab(v) for(auto i:v)cout<<i<<' '; cout << endl;
#define vin(v) for (ll i = 0; i < v.size(); ++i) cin >> v[i];
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 (a > b) { a = b; return 1; } return 0; }
int dx[] = { 0, 0, -1, 1 };
int dy[] = { 1, -1, 0, 0 };
int gcd(int a, int b) { if (a % b == 0) { return(b); } else { return(gcd(b, a % b)); } }


int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	//cout << fixed << setprecision(15);
	int R;
	cin >> R;
	cout << setprecision(15) << 2*R*PI << endl;
	return 0;
}


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

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

fn main() {
    let n:usize = read();
    let arr:Vec<i32> = (0..n).map(|_| read()).collect();
    bubble_sort(arr, n);
}

fn bubble_sort(mut a:Vec<i32>, n:usize) -> () {
    let mut flag = true;
    let mut cnt = 0;
    while flag {
        flag = false;
        for i in 1..n {
            if a[i] < a[i-1] {
                a.swap(i, i-1);
                cnt += 1;
                flag = true;
            }
        }
    }
    println!("{}", a.into_iter()
    .map(|x| x.to_string())
    .collect::<Vec<String>>()
    .join(" "));
    println!("{}", cnt);
}


Measured memory_bytes: 5032
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define mt make_tuple
#define show(x) cout<<x<<'\n'
#define showh(x) cout<<x<<' '
#define go(i,a,n) for(ll i=a;i<n;i++)
#define gor(i,a,n) for(ll i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define mod 1000000007
bool prime[100001];
bool ispoweroftwo(ll x)
{
    return x && !(x & (x-1));
}
ll xorcal(ll n)
{
    if(n%4==0)
        return n;
    if(n%4==1)
        return 1;
    if(n%4==2)
        return n+1;
    if(n%4==3)
        return 0;
}
void sieve(ll n)
{
    memset(prime,true,sizeof(prime));
    prime[0]=false;
    prime[1]=false;
    for(ll i=2;i*i<=n;i++)
    {
        if(prime[i]==true)
        {
            for(ll j=i*i;j<=n;j+=i)
            {
                prime[j]=false;
            }
        }
    }
    show(prime[89]);
}
bool isprime(ll n)
{
    if (n<=1) return false;
    if (n<=3) return true;

    if(n%2==0 or n%3==0) return false;

    for(ll i=5;i*i<=n;i+=6)
    {
        if(n%i==0 or n%(i+2)==0) return false;
    }
    return true;
}

ll modinverse(ll a,ll m)
{
    ll m0 = m;
    ll y = 0, x = 1;

    if (m == 1)
      return 0;

    while (a > 1)
    {
        ll q = a / m;
        ll t = m;

        m = a % m; a = t;
        t = y;

        y = x - q * y;
        x = t;
    }

    if (x < 0)
       x += m0;

    return x;
}

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

ll power(ll A, ll B)
{
    if (A == 0)
        return 0;
    if (B == 0)
        return 1;

    ll y;
    if (B % 2 == 0) {
        y = power(A, B / 2);
        y = (y * y) % mod;
    }

    else {
        y = A % mod;
        y = (y * power(A, B - 1) % mod) % mod;
    }

    return (ll)((y + mod) % mod);
}

int main()
{
    ios_base::sync_with_stdio(false);
    ll n;
    cin>>n;
    ll a[n];
    go(i,0,n)
    {
        cin>>a[i];
    }
    ll count=0;
    go(i,0,n-2)
    {
        if(a[i]<a[i+1] and a[i+1]<a[i+2] and a[i]<a[i+2])
        {
            count++;
        }
        else if(a[i]>a[i+1] and a[i+1]>a[i+2] and a[i]>a[i+2])
        {
            count++;
        }

    }
    show(count);
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main()
{
  static int flag=1,i,j,N,A[100],temp,cnt=0;

  scanf("%d",&N);
  for(i=0;i<N;i++)scanf("%d",&A[i]);

  while(flag>0)
  {
    flag = 0;
    for(i=N-1;i>=0;i--)
    {
      if(A[i]<A[i-1])
      {
        temp=A[i];
        A[i]=A[i-1];
        A[i-1]=temp;
        flag = 1;
        cnt++;
      }
    }
  }
  for(i=0;i<N;i++)
  {
   printf("%d",A[i]);
   if(i!=N-1)printf(" ");
  }
  printf("\n");
  printf("%d\n",cnt);
  return 0;
}



Measured memory_bytes: 2048
#include <stdio.h>
#include <math.h>

int box[1000000];

int main(void)
{

	double a;
	int b, c, d;
	int z, zz;
	
	while (scanf("%lf", &a) != EOF){
		for (b = 0; b <= a; b++) {
			box[b] = 0;
		}
		for (b = 1; b <= a; b++) {
			box[b] = b;
		}
		c = 0;
		d = 2;
		while (sqrt(a) >= d) {
			for (b = d; b <= a; b += d) {
				box[b] = -1;
			}
			c++;
			for (b = 2; b <= a; b++) {
				zz = 0;
				if (box[b] != -1) {
					for (z = b; z >= 1; z--) {
						if (b % z == 0) {
							zz++;
						}
					}
				}
				if (zz == 2) {
					d = b;
					b = a + 1;				}
			}
		}
		for (b = d; b <= a; b++) {
			if (box[b] != -1) {
				c++;
			}
		}
		printf("%d\n", c);
	}
	
	return (0);
}

Measured memory_bytes: 4528
#include <stdio.h>

int gcd(int x, int y){

  if(y)
    return gcd(y, x%y);
  else
    return x;


}

int main(){
  int x, y, ans;

  scanf("%d", &x);
  scanf("%d", &y);

  ans = gcd(x, y);

  printf("%d\n", ans);

  return 0;
}

Measured memory_bytes: 592
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] preorder = new int[n];
        int[] inorder = new int[n];
        for (int i = 0; i < n; i++) {
            preorder[i] = in.nextInt();
        }
        for (int i = 0; i < n; i++) {
            inorder[i] = in.nextInt();
        }
        Tree tree = Tree.reconstructTree(preorder, inorder, 0, 0, n-1);
        System.out.println(tree.postorder().trim());
    }
}

class Tree {
    int id;
    Tree left;
    Tree right;

    public Tree(int id, Tree left, Tree right) {
        this.id = id;
        this.left = left;
        this.right = right;
    }

    static Tree reconstructTree(int[] preorder, int[] inorder, int root, int left, int right) {
        if (left == right) {
            return new Tree(inorder[left], null, null);
        }

        int rootInorder = 0;
        while (inorder[rootInorder] != preorder[root]) {
            rootInorder++;
        }

        if (left == rootInorder) {
            return new Tree(preorder[root],
                    null,
                    reconstructTree(preorder, inorder, root+(rootInorder-left)+1, rootInorder + 1, right));
        } else if (right == rootInorder) {
            return new Tree(preorder[root],
                    reconstructTree(preorder, inorder, root+1, left, rootInorder - 1),
                    null);
        } else {
            return new Tree(preorder[root],
                    reconstructTree(preorder, inorder, root+1, left, rootInorder - 1),
                    reconstructTree(preorder, inorder, root+(rootInorder-left)+1, rootInorder + 1, right));
        }
    }

    boolean isLeaf() {
        return left == null && right == null;
    }

    String postorder() {
        if (isLeaf()) {
            return " " + id;
        } else if (left == null) {
            return right.postorder() + " " + id;
        } else if (right == null) {
            return left.postorder() + " " + id;
        } else {
            return left.postorder() + right.postorder() + " " + id;
        }
    }
}



Measured memory_bytes: 26420
import java.util.*;
import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.stream.Stream;

public class Main {
	public static void main(String[] args)throws IOException{
		Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] intarray = new int[N];
        BigInteger[] bigIntArr = new BigInteger[N];
        for(int i = 0; i < N; i++){
            int a = sc.nextInt();
            intarray[i] = a;
            bigIntArr[i] = BigInteger.valueOf(a);
        }
        /*BigInteger[] bigIntArr = {
            BigInteger.valueOf(2),
            BigInteger.valueOf(12),
            BigInteger.valueOf(36),
            BigInteger.valueOf(18)
        };*/
        //System.out.println("最大公約数： " + gcd(bigIntArr));
        // 最小公倍数
        //System.out.println("最小公倍数： " + lcm(bigIntArr));
        int bunbo = 0;
        int sum = 0;
        for(int i = 0; i < N; i++){
            BigInteger kari = lcm(bigIntArr);
            sum+= kari.intValue()/intarray[i];
        }
        //System.out.println(sum);
        BigDecimal lcm2 = new BigDecimal(lcm(bigIntArr).intValue());
        BigDecimal sum2 = new BigDecimal(sum);
        BigDecimal result1 = lcm2.divide(sum2,7, BigDecimal.ROUND_HALF_UP);
        System.out.println(result1);
      }
     
      // 最小公倍数（対象のすべての整数）
      public static BigInteger lcm(BigInteger... arr) {
        return Stream.of(arr).reduce((x, y) -> createLcm(x, y)).orElse(BigInteger.ONE);
      }
    
        //最小公倍数（指定した2つの整数）
        public static BigInteger createLcm(BigInteger x, BigInteger y) {
            return x.multiply(y)
                .divide(Objects.nonNull(creategcd(x, y)) ? creategcd(x, y) : BigInteger.ONE);
          }
         
          // 最大公約数（指定した2つの整数）
          public static BigInteger creategcd(BigInteger x, BigInteger y) {
            return (Objects.nonNull(x) ? x : BigInteger.ONE).gcd(y);
        }
      // 最大公約数（対象のすべての整数）
      public static BigInteger gcd(BigInteger[] arr) {
        return Stream.of(arr)
            .reduce(BigInteger::gcd)
            .orElse(BigInteger.ZERO);
        }
}

Measured memory_bytes: 35412
def examA():
    N = I()
    A = LI()
    ans = 0
    for i in range(N-1):
        if A[i+1]==A[i]:
            A[i+1] = 101
            ans +=1
    print(ans)
    return

def examB():
    return

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,inf
mod = 10**9 + 7
inf = 10**18

if __name__ == '__main__':
    examA()


Measured memory_bytes: 3436
#include <iostream>
#include <vector>
#include <algorithm>

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

int N;
ll K;
vector<ll> P, M, Z;

bool judge_m(ll mid) {
    ll sum = 0;
    for (int i = 0; i < (int)P.size(); i++) {
        ll d = (mid - P[i] + 1) / P[i];
        sum += upper_bound(M.begin(), M.end(), d) - M.begin();
    }
    return sum >= K;
}

bool judge_p(ll mid) {
    ll sum = 0;
    for (int i = 0; i < (int)P.size(); ++i) {
        ll d = mid / P[i];
        ll tmp = upper_bound(P.begin(), P.end(), d) - P.begin();
        if (i < tmp) tmp--;
        sum +=tmp;
    }
    for (int i = 0; i < (int)M.size(); ++i) {
        ll d = mid / M[i];
        ll tmp = upper_bound(M.begin(), M.end(), d) - M.begin();
        if (i < tmp) tmp--;
        sum += tmp;
    }
    sum /= 2;
    return sum >= K;
}

const int MAX = 510000;
const int MOD = 1000000007;

ll fac[MAX], finv[MAX], inv[MAX];

int main() {

    cin >> N >> K;
    vector<ll> A(N); for (auto& x:A) cin >> x;
    for (auto& x:A) {
        if (x > 0) {
            P.push_back(x);
        } else if (x < 0) {
            M.push_back(x);
        } else {
            Z.push_back(x);
        }
    }
    ll p = P.size();
    ll m = M.size();
    ll z = Z.size();

    ll minus = p * m;
    ll zero = z * (z - 1) / 2 + z * p + z * m;
    ll plus = p * p + m * m;
    
    if (K <= minus){
        sort(M.begin(), M.end());
        ll l = -1e18 - 1, u = -1;
        while (u - l > 1) {
            ll mid = (u + l) / 2;
            if (judge_m(mid)) {
                u = mid;
            } else {
                l = mid;
            }
        }
        cout << u << endl;
    }else if (K <= minus + zero) {
        cout << 0 << endl;
    }else {
        K -= (minus + zero);
        for (int i = 0; i < m; ++i) {
            M[i] = abs(M[i]);
        }
        sort(P.begin(), P.end());
        sort(M.begin(), M.end());
        ll l = -1, u = 1e18;
        while (u - l > 1) {
            ll mid = (u + l) / 2;
            if (judge_p(mid)) {
                u = mid;
            } else {
                l = mid;
            }
        }
        cout << u << endl;
    }
    return 0;
}

Measured memory_bytes: 4084
void main(){
	int dd;
	readf("2017/01/%d", &dd);
	writefln("2018/01/%02d", dd);
}

import std.stdio, std.conv, std.algorithm, std.numeric, std.string, std.math;

// 1要素のみの入力
T _scan(T= int)(){
	return to!(T)( readln().chomp() );
}

// 1行に同一型の複数入力
T[] _scanln(T = int)(){
	T[] ln;
	foreach(string elm; readln().chomp().split()){
		ln ~= elm.to!T();
	}
	return ln;
}


Measured memory_bytes: 2764
import java.util.*;

public class Main {
    static Scanner scanner = new Scanner(System.in);

    public static void main(String[]$) {
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int c = scanner.nextInt();
        System.out.println(b - a == c - b ? "YES" : "NO");
    }
}

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

int main() {
    int N;
    cin >> N;
    vector<int> vec(N);
    for(int i = 0; i < N; i++){
        cin >> vec.at(i);
    }
    sort(vec.begin(), vec.end());
    vector<int> num(100000,0);
    for(int i = 0; i < N; i++){
        num.at(vec.at(i))++;
    }

    int ma = 0;
    for(int i = 2; i < 100000; i++){
        ma = max(num.at(i-2) + num.at(i-1) + num.at(i), ma);
    }
    cout << ma << endl;
}

Measured memory_bytes: 4012
#include <bits/stdc++.h>
#define IO_OP std::ios::sync_with_stdio(0); std::cin.tie(0);
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define EB emplace_back
#define int ll

using namespace std;

typedef long long ll;
typedef pair<int, int> pi;
typedef vector<int> vi;

const int M = 1e9 + 7;

int a[100005][13], dp[100005][13];

int32_t main()
{
	IO_OP;
	
	string s;
	int p = 1;
	cin >> s;
	for(int i=s.size()-1;i>=0;i--) {
		if(s[i] != '?') {
			a[i][(s[i]-'0') * p % 13] = 1;
		} else {
			for(int j=0;j<10;j++)
				a[i][j*p%13] = 1;
		}
		p = p * 10 % 13; 
	}	
	for(int i=0;i<13;i++)
		dp[0][i] = a[0][i];
	for(int i=1;i<s.size();i++) {
		for(int j=0;j<13;j++) {
			for(int k=0;k<13;k++) {
				(dp[i][j] += a[i][k] * dp[i-1][(j-k+13)%13] % M) %= M;
			}
		}
	}
	cout << dp[s.size()-1][5] << endl;
}



Measured memory_bytes: 20816
n,m = map(int,input().split(" "))

city_road_count = [0] * n
for i in range(m):
      a,b = map(int,input().split(" "))
      city_road_count[a-1] += 1
      city_road_count[b-1] += 1
      
for c in city_road_count:
      print(c)


Measured memory_bytes: 2940
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
  int flag=0;
  while(n)
  {
    int temp=n%10;
    n=n/10;
    if(temp==7)
    {
      flag=1;
      break;
    }
  }
  
  if(flag)
    cout<<"Yes\n";
  else
    cout<<"\No\n";
}

Measured memory_bytes: 3612
#include<iostream>
#include<algorithm>
#include<climits>
#include<vector>
#include<utility>
#include<cmath>
#include<cstring>
#include<map>
#include<sstream>
 
using namespace std;

int N;

int main(){
  
  cin>>N;
  vector<int> X(N);
  
  // 1~100までの座標の最大値
  int cost = 1000000000;
  
  int X_max = 0;
  int X_min = 1000000000;
  
  for(int i = 0; i < N; ++i){
    cin>>X[i];
    X_max = max(X_max, X[i]);
    X_min = min(X_min, X[i]);
  }
  
  for(int P = X_min; P <= X_max; ++P){    
    int sum = 0;
    for(int i = 0; i < N; ++i){
    	sum += ((X[i] - P) * (X[i] - P));
    }
    
    cost = min(cost, sum);
  }
  
  cout << cost <<endl;
}


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

int main()
{
    int N, K;
    cin >> N >> K;

    int res = 1;
    for (int i = 0; i < N; i++)
    {
        res = min(res + K, res * 2);
    }
    cout << res << endl;
}

Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)


var sc = bufio.NewScanner(os.Stdin)


func main() {
	sc.Split(bufio.ScanWords)
	original := float64(100)
	goal := nextFloat64()
	count := 0
	tmp := original
	for ;; {
		tmp *= 1.01
		tmp = math.Floor(tmp)
		count++
		if goal <= tmp {
			break
		}
	}
	fmt.Println(count)
}

func nextFloat64() float64 {
	sc.Scan()
	f, e := strconv.ParseFloat(sc.Text(), 64)
	if e != nil {
		panic(e)
	}
	return f
}


Measured memory_bytes: 1752
#include <iostream>
#define MAXN 100001

using namespace std;

int height[MAXN];

int getCost(int a,int b){
	return abs(height[a]-height[b]);
}

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

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

 	int dp[n];
	dp[0]=0;
	int loops=0;

 	for (int i=1; i<n; i++)
 	{	

 		if (i<k){
 			loops=i;
 		}else {
 			loops=k;
 		}

 		dp[i] = getCost(i-1,i) + dp[i-1];
		for (int j=1; j<loops+1; j++){
 			dp[i] = min(dp[i],getCost(i,i-j) + dp[i-j]);
 		}

 	}

 	cout << dp[n-1] << endl;

	return 0;
}

Measured memory_bytes: 4412
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int X = sc.nextInt();
		
		int sum = 0;
		for (int i = 0; ;i++) {
			sum += i;
			if (sum >= X) {
				System.out.println(i);
				break;
			}
		}
	}
}


Measured memory_bytes: 22996
#include <bits/stdc++.h>
#define s second
#define f first
#define INF 1e9
using namespace std;
typedef pair<int,int> P;
typedef pair<int,P> iP;
int  n,m,e[201][201],h[201],used2[201];
P h2[201];

int prim(int cnt,int f[201][201]){
  int res=0,used[201]={};
  priority_queue <P,vector<P>,greater<P> > Q;
  Q.push(P(0,h2[n-1].s));
  
  while(!Q.empty()){
    P t=Q.top();Q.pop();
    int cost=t.f,pos=t.s;
    if(used[pos]||used2[pos])continue;
    used[pos]=1,cnt++,res+=cost;
    for(int i=0;i<n;i++)if(f[pos][i]<INF)Q.push(P(f[pos][i],i));
  }
  if(cnt==n)return res;
  return 0;
}

int main(){
  while(1){
    cin>>n>>m;
    if(!n&&!m)break;
    for(int i=0;i<n;i++)for(int j=0;j<n;j++)e[i][j]=INF;
    for(int i=0;i<n;i++) cin>>h[i],h2[i]=P(P(h[i],i));
    sort(h2,h2+n);
    for(int i=0,a,b,c;i<m;i++) cin>>a>>b>>c,e[--a][--b]=e[b][a]=c;
    
    memset(used2,0,sizeof(used2));
    int res,ans=prim(0,e),H=0,flg=ans;
    for(int i=0;i<n&&(res=prim(i,e));i++){
      int I=h2[i].s;
      ans=res,H=h[I];
      for(int j=i--;j<n&&h[h2[j].s]==H;j++) used2[h2[j].s]=1,i++;
    }
    for(int i=0;i<n;i++) if(h[i]==H) used2[i]=0;
    
    reverse(h2,h2+n);
    for(int i=0;i<n;i++){
      int I=h2[i].s,cnt=i;
      if(!used2[I]) continue;
      while(cnt+1<n&&h[I]==h[h2[cnt+1].s])cnt++;
      while(1){
	int J,mn=INF;
	for(int j=i;j<=cnt;j++)
	  for(int k=0;k<n&&used2[h2[j].s];k++)
	    if(!used2[k]&&mn>e[h2[j].s][k])mn=e[h2[j].s][k],J=h2[j].s;
	if(mn==INF)break;
	ans+=mn;
	used2[J]=0;
      }
      i=cnt;
    }
    
    if(flg) cout <<ans<<endl;
    else cout <<0<<endl;
  }
  return 0;
}

Measured memory_bytes: 2004
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
using namespace std;
typedef long long ll;
const  double PI = 3.141592654;
#define rep(i,x) for(int(i)=0;(i)<(ll)(x);(i)++)
#define all(s)      (s).begin(),(s).end()
#define allv(v)      (v).begin(),(v).end()
#define allvr(v)      (v).rbegin(),(v).rend()
#define pb          push_back
#define sz          s.size()
#define ssz          ss.size()
#define vz          v.size()
ll gcd(ll a, ll b) { return !b ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }
int dx[] = { 0, 0, -1, 1, -1, 1, -1, 1 };
int dy[] = { 1, -1, 0, 0, 1, 1, -1, -1 };
//x = atoill(s.c_str())
void fast()
{
#ifndef ONLINE_JUDGE
	/*

	**    ** ** **    *********   ** ** **
	**    **          **     **   **
	**    **          *********   **
	**    **          **          **
	**    ** ** **    **          ** ** **
	*/
	/*freopen("in.txt", "r", stdin);
	freopen("out.txt", "w", stdout);*/
#endif
	ios_base::sync_with_stdio(0);
	cin.tie(NULL), cout.tie(NULL);
}
int main()
{
	fast();
	vector<ll>v(3);
	int k;
	rep(i, 3)
		cin >> v[i];
	cin >> k;
	sort(allvr(v));
	ll sum = v[0] * pow(2, k);
	sum += v[1] + v[2];
	cout << sum;
	return 0;
}

Measured memory_bytes: 512
#include<stdio.h>
int main()
{
	char s[9];
	int c=0,i=0;
	scanf("%s",s);
	for(;i<3;i++)
	{
		if(s[i]=='1')
		{
			c++;
		}
	}
	printf("%d",c);
	return 0;
}

Measured memory_bytes: 128
// In the name of God

#include <bits/stdc++.h>

using namespace std;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int n, x;
	cin >> n >> x;
	vector<long long> a(n);
	for(int i = 0; i < n; i++) {
		cin >> a[i];
	}
	long long ans = 0;
	for(int i = 0; i < n; i++) {
		if(a[i] > x) {
			ans += a[i] - x;
			a[i] = x;
		}
	}
	for(int i = 1; i < n; i++) {
		if(a[i]+a[i-1]>x) {
			long long d = a[i]+a[i-1]-x;
			ans += d;
			a[i] -= d;
		}
	}
	cout << ans;

	return 0;
}


Measured memory_bytes: 1024
#include <stdio.h>
#include <stdlib.h>


#define	ll_int	long long int


int Binary_Search(ll_int *box, int n, ll_int num)
{
	int mid;
	int left, right;


	left = 0;
	right = n - 1;
	while(left <= right){
		mid = (left + right) / 2;

		if(num == box[mid])
			return 1;
		else if(num < box[mid])
			right = mid - 1;
		else if(box[mid] < num)
			left = mid + 1;
	}

	return 0;
}


int main()
{
	int n, q;
	ll_int *box, num;
	int i;


	scanf("%d", &n);

	box = (ll_int *)malloc(sizeof(ll_int) * n);

	for(i = 0; i < n; i++)
		scanf("%lld", &box[i]);


	scanf("%d", &q);

	for(i = 0; i < q; i++){
		scanf("%lld", &num);

		if(Binary_Search(box, n, num))
			printf("1\n");
		else
			printf("0\n");
	}

	return 0;
}


Measured memory_bytes: 2500
#include <bits/stdc++.h>//復習必須
#include<iostream>
#include<vector>
#include <cmath>
#include <map>
#include <algorithm>
#include <string>
#define rep(i, n) for (int i = 0; i < n; ++i)
using ll = long long;
using namespace std;
#define P pair<int, int>
int main () {
    int H, W, D; cin >> H >> W >> D;
    vector<vector<int>> a(H, vector<int>(W));
    vector<pair<int, int>> b(H * W + 1);//逆引き用
    rep(i, H)rep(j, W){
        int num;
        cin >> num;
        b[num] = make_pair(i, j);
        a[i][j] = num;
    }

    vector<vector<int>> cost(D + 1);
    for(int i = 1; i <= D; i++){
        int k = 1;
        cost[i].push_back(0);
        while(i + k * D <= H * W){
            cost[i].push_back(abs(b[i + k * D].first - b[i + (k - 1) * D].first) + abs(b[i + k * D].second - b[i + (k - 1) * D].second) + cost[i][k - 1]);
            k++;
        }
    }

    int Q;
    cin >> Q;
    vector<int> ans;
    rep(i, Q){
        int L, R; cin >> L >> R;
        int t = L % D;
        if(t == 0) t = D;
        R -= D;
        L -= D;
        ans.push_back(cost[t][(R + (D - 1)) / D] - cost[t][(L + (D - 1)) / D]);
    }
    rep(i, Q)cout << ans[i] << endl;
    return 0 ;
}

 


Measured memory_bytes: 6912