akhauriyash/Code-Regression huggingface dataset:
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

n=ii()
ans=0
for i in range(1,n+1):
    if i%15==0 or i%3==0 or i%5==0:
        pass
    else:
        ans+=i
        
print(ans)







Measured memory_bytes: 77292
#include<iostream>
using namespace std;
int main (){
	int n, m;
	while(cin >> n >> m){
		if(n == 0 && m == 0)break;
		int count = 0;
		for(int i = 1; i <= n; i++){
			for(int j = i + 1; j <= n; j++){
				for(int k = j + 1; k <= n; k++){
					if(i + j + k == m) count ++;
				}
			}
		}
		
		cout << count << endl;
	}
	return 0;
}



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

using namespace std;

typedef long long int llint;
typedef pair<int, int> pii;
typedef pair<llint, llint> pll;
typedef vector<int> vi;
typedef vector<llint> vl;
typedef vector<pii> vii;
typedef vector<pll> vll;

#define ci cin
#define co cout
#define en endl
#define ln cout<< '\n'
#define rep(i, n) for(int i = 0; i < n; i++)
#define outl(x) cout<< (x) << '\n'
#define pb push_back
#define fi first
#define se second
#define MOD 1000000007

template<typename Tn> Tn gcd(Tn a, Tn b)
{
    return (b ? gcd(b, a % b) : a);
}

template<typename Tn> Tn lcm(Tn a, Tn b)
{
    return a / gcd(a, b) * b;
}

string IntToString(int number)
{
	stringstream ss;
	ss << number;
	return ss.str();
}

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

llint n, k;
llint a[100001];

int bitcnt(llint m)
{
    int c = 0;
    while(m) {
	c++;
	m >>= 1;
    }

    return c;
}

int main()
{
    ci >> n >> k;
    rep(i, n) ci >> a[i];

    llint ans = 0;
    
    for(int i = bitcnt(k) - 1; i >= 0; i--) {

	int bf, bt = 0;
	for(int j = 0; j < n; j++) {
	    if((1LL << i) & a[j]) bt++;
	}
	bf = n - bt;

	llint tmp = ans;
	if(bf > bt) tmp |= (1LL << i); //1

	if(tmp <= k) ans = tmp;

    }
    
    llint f = 0;
    rep(i, n) f += ans ^ a[i];

    co << f << en;
    
    return 0;
}







Measured memory_bytes: 1024
a,b,c,d = map(int, input().split())

turn = 0

while(a > 0 and c > 0):
    if turn == 0:
        c -= b
        turn = 1
    else:
        a -= d
        turn = 0

if turn == 0:
    print('No')
else:
    print('Yes')

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

ll N,W,w[N_MAX],v[N_MAX];
ll dp[N_MAX][N_MAX][3*N_MAX];

int main(){
  
  cin>>N>>W;    
  
  for(int i=0;i<N;i++) cin>>w[i]>>v[i];
  
  memset(dp,-1,sizeof(dp));
  
  dp[0][0][0]=0;

  for(int i=0;i<N;i++){
    for(int j=0;j<N;j++){
      for(int k=0;k<3*N;k++){
	
	if(dp[i][j][k]==-1)continue;

	if((j+1)*w[0]+k+(w[i]-w[0])<=W)
	  dp[i+1][j+1][k+(w[i]-w[0])]=
	    max(dp[i+1][j+1][k+(w[i]-w[0])],dp[i][j][k]+v[i]);
	
	dp[i+1][j][k]=max(dp[i+1][j][k],dp[i][j][k]);
	
      }
    }
  }

  ll ans=0;

  for(int i=0;i<=N;i++)
    for(int j=0;j<=3*N;j++)
      ans=max(ans,dp[N][i][j]);

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


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

map<long long, int> prime_factor(long long n){
    map<long long, int> res;
    for(long long i = 2; i*i <= n; i++){
        while(n%i == 0){
            res[i]++;
            n /= i;
        }
    }
    if(n != 1) res[n] = 1;
    return res;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    long long n, p; cin >> n >> p;
    map<long long, int> memo = prime_factor(p);
    long long ans = 1;
    for(auto q : memo){
        long long hoge = q.second;
        long long cnt = hoge / n;
        for(long long i = 0; i < cnt; i++){
            ans *= q.first;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
from math import ceil, sqrt, floor


H, W = list(map(int, input().split()))

if H == 1 or W == 1:
    print(1)
    exit(0)

areas = [ceil(H / 2), H // 2]

ret = areas[0] * (ceil(W / 2)) + areas[1] * (W // 2)

print(ret)



Measured memory_bytes: 38384
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
use std::io::{BufWriter, Write};
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};
    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, [graph1; $len:expr]) => {{
        let mut g = vec![vec![]; $len];
        let ab = read_value!($next, [(usize1, usize1)]);
        for (a, b) in ab {
            g[a].push(b);
            g[b].push(a);
        }
        g
    }};
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };
    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };
    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };
    ($next:expr, usize1) => (read_value!($next, usize) - 1);
    ($next:expr, [ $t:tt ]) => {{
        let len = read_value!($next, usize);
        read_value!($next, [$t; len])
    }};
    ($next:expr, $t:ty) => ($next().parse::<$t>().expect("Parse error"));
}

#[allow(unused)]
macro_rules! debug {
    ($($format:tt)*) => (write!(std::io::stderr(), $($format)*).unwrap());
}
#[allow(unused)]
macro_rules! debugln {
    ($($format:tt)*) => (writeln!(std::io::stderr(), $($format)*).unwrap());
}

fn solve() {
    let out = std::io::stdout();
    let mut out = BufWriter::new(out.lock());
    macro_rules! puts {
        ($($format:tt)*) => (let _ = write!(out,$($format)*););
    }
    input! { s: chars }
    let mut b = 0;
    for i in 0..s.len() {
        if s[i] == 'B' {
            b += 1;
        }
    }
    let mut ans = 0;
    let mut i = 0;
    while i < s.len() {
        if s[i] == 'B' {
            ans += s.len() - i - b;
            b = b - 1;
        }
        i += 1;
    }
    puts!("{}\n", ans);
}

fn main() {
    // In order to avoid potential stack overflow, spawn a new thread.
    let stack_size = 104_857_600; // 100 MB
    let thd = std::thread::Builder::new().stack_size(stack_size);
    thd.spawn(|| solve()).unwrap().join().unwrap();
}

Measured memory_bytes: 2344
N, M = map(int, input().split())
a = list(map(int, input().split()))
for k in range(N):
  a[k] //= 2

foo = 1
while a[0]%2 == 0:
  foo *= 2
  a[0] //= 2
for k in range(1, N):
  if a[k] % foo == 0 and a[k]%(2*foo) !=0:
    a[k] //= foo
    continue
  else:
    print(0)
    exit()
ans = 0

for odd in [3]:
  flag = False
  for k in range(N):
    if a[k]%odd == 0:
      a[k] //= odd
      flag = True
  if flag:
    foo *= odd
 
 
import math

lcm = a.pop()
for k in range(1, N):
  b = a.pop()
  lcm = lcm * b // math.gcd(lcm, b)
  if lcm* foo > M:
    print(0)
    exit()
lcm *= foo
ans = int((M / lcm -1)//2 + 1)
print(ans)



Measured memory_bytes: 20020
#include<iostream>
#include<cmath>
#include<climits>
using namespace std;

int main(){
	int num=0;
	while(1){
		cin>>num;
		if(num==0)break;
		int anum=0;
		for(int i=1;i<=num;i++){
			if(i%5==0){
				int cnt=i;
				while(cnt%5==0){
					anum++;
					cnt=cnt/5;
				}
			}
		}
		cout<<anum<<endl;
	}
	return 0;
}

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

int main() {
    init();

    string s, t; cin >> s >> t;
    map<char, char> m;
    FOR(i, 0, s.length()) {
        if (m.count(s[i])) {
            if (m[s[i]] != t[i]) {
                print("No");
                return 0;
            }
        }
        else m[s[i]] = t[i];
    }

    set<char> se;
    each(i, m)se.insert(i.second);
    print(se.size() == m.size() ? "Yes" : "No");
}

Measured memory_bytes: 916
def cmb(n, r, mod):#コンビネーションの高速計算　
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 2*10**6
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

K=int(input())
S=input()
N=len(S)
ans=0
for i in range(0,K+1):
    ans+=((cmb(N-1+K-i,N-1,mod)*pow(25,K-i,mod))%mod)*pow(26,i,mod)
    ans%=mod
print(ans)


Measured memory_bytes: 174416
#include<iostream>
#include<vector>
#include<list>
#include<algorithm>
#include<cmath>
#include<math.h>
using namespace std;

int main () {
  int N;
  cin >> N ;
  int A[N];
  for (int i=0;i<N;i++){
    A[i]=0;
  }
  int as=0;
  for (int i=0;i<N-1;i++){
    cin >> as;
    A[as-1]++;
  }

  for (int i : A) {
    cout << i << endl;
  }

  return 0;
}


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

typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev
#define dump(x)  cout << #x << " = " << (x) << endl;	//debug
#define SZ(x) ((int)(x).size())
#define REP(i, n) for(ll i = 0; i < (n); i++)
#define REPR(i, n) for (ll i = (n); i >= 0; i--)
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define RFOR(i, a, b) for (ll i = (a); i >= (b); i--)
#define ps(s) cout << #s << endl;
#define pv(v) cout << (v) << endl;
#define pvd(v) cout << setprecision(16) << (v) << endl;
#define ALL(a)  (a).begin(),(a).end()
#define RANGE(a, l, r)  (a).begin()+(l),(a).begin()+(r)


int main() {
	double a, b, x;
	cin >> a >> b >> x;
	if (a*a*b / 2.0f > x) {
		double d = 2.0f*x / a / b;
		double res = atan(b/d) * 180 / M_PI;
		pvd(res);
		return(0);
	}

	double d = 2 * b - 2 * x / pow(a, 2);
	double res = atan(d / a) * 180 / M_PI;
	pvd(res);
	return(0);
}

Measured memory_bytes: 512
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Text;


class Program
{
    static void Main(string[] args)
    {
        // 入力
        //var s = Console.ReadLine();
        var n = int.Parse(Console.ReadLine());
        int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();

        bool[] table = new bool[1000001];
        bool[] res = new bool[1000001];
        Array.Sort(a);
        foreach (var item in a)
        {
            if (res[item]) res[item] = false;
            if (table[item]) continue;
            res[item] = true;
            for (int i = item; i < table.Length; i += item)
            {
                table[i] = true;
            }
        }

        var ans = res.Where(x => x == true).Count();
        Console.WriteLine(ans);
    }
}


Measured memory_bytes: 45380
import std.stdio, std.string, std.conv;
import std.range, std.algorithm, std.array;

import std.math : abs;

void main() {
    int n;
    scan(n);

    int t, x, y;
    bool ok = 1;

    foreach (i ; 0 .. n) {
        int ti, xi, yi;
        scan(ti, xi, yi);

        int dt = ti - t;
        int dist = abs(xi - x) + abs(yi - y);

        if (dt < dist || dt % 2 != dist % 2) {
            ok = 0;
        }

        t = ti, x = xi, y = yi;
    }

    writeln(ok ? "Yes" : "No");
}




void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}



void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}

Measured memory_bytes: 1276
implicit none
integer :: n,m
integer,allocatable :: a(:),res1(:),cnt1(:),res2(:),cnt2(:)
integer(8) :: s
integer :: i,j,nres1,nres2,b
logical :: flg

read *,n,m
allocate(a(n))
read *,a

allocate(cnt1(0:n))
allocate(res1(0:n))
allocate(cnt2(0:n))
allocate(res2(0:n))

res1(:) = -1
res1(0) = 0
cnt1(:) = 0
cnt1(0) = 1
res2(:) = -1
res2(0) = 0
cnt2(:) = 0
cnt2(0) = 1
nres1 = 0
nres2 = 0
b = 0
s = 0
do i = 1, n
   b = mod(b + a(i),m)
   flg = .false.
   if (b < m/2) then
   do j = 0, nres1
      if (res1(j) == b) then
         s = s + cnt1(j)
         cnt1(j) = cnt1(j) + 1
         flg = .true.
         exit
      endif
   enddo
   if (.not. flg) then
      nres1 = nres1 + 1
      res1(nres1) = b
      cnt1(nres1) = 1
   endif
   else
   do j = 0, nres2
      if (res2(j) == b) then
         s = s + cnt2(j)
         cnt2(j) = cnt2(j) + 1
         flg = .true.
         exit
      endif
   enddo
   if (.not. flg) then
      nres2 = nres2 + 1
      res2(nres2) = b
      cnt2(nres2) = 1
   endif
   endif
enddo

print '(i0)',s
end

Measured memory_bytes: 2816
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
	string s,t;
	cin>>s>>t;
	int count=0;
	for(int i=0;i<s.length();i++)
	   {
	   	if(s[i]!=t[i])
	   	   count++;
	   }
	   cout<<count<<endl;
	   return 0;
}

Measured memory_bytes: 3848
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
template<typename T> bool chmax(T &a,T b){if(a<b){a=b;return true;}return false;}
template<typename T> bool chmin(T &a,T b){if(a>b){a=b;return true;}return false;}
#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 rrep(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define all(vec) vec.begin(),vec.end()
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef tuple<ll,ll,ll> tlll;
typedef tuple<int,int,int> tiii;
const ll mod=1e9+7;
const int inf=1<<30;

int main(){
  int n,k; cin >> n >> k;
  vector<ll> a(n);
  vector<ll> b(0);
  vector<ll> c(0);
  rep(i,n){
    cin >> a[i];
    if(a[i]<0) b.push_back(a[i]);
    else c.push_back(a[i]);
  }
  sort(all(b));
  sort(all(c));
  reverse(all(c));
  if(k==n){
    ll ans=1;
    rep(i,n){
      ans=(ans*a[i])%mod;
    }
    cout << (ans+mod)%mod << endl;
    return 0;
  }
  if(k%2==1&&c.empty()){
    ll ans=1;
    for(int i=n-1;i>n-1-k;i--){
      ans=(ans*b[i])%mod;
    }
    cout << (ans+mod)%mod << endl;
    return 0;
  }
  ll ans=1;
  int K=0;
  if(k%2==1){
    ans=c[0];
    c.erase(c.begin());
    K++;
    if(K==k){
      cout << ans << endl;
      return 0;
    }
  }
  vector<ll> pm(0);
  for(int i=0;i<b.size();i+=2){
    if(i+1>=b.size()) break;
    pm.push_back(b[i]*b[i+1]);
  }
  for(int i=0;i<c.size();i+=2){
    if(i+1>=c.size()) break;
    pm.push_back(c[i]*c[i+1]);
  }
  sort(all(pm));
  reverse(all(pm));
  for(int i=0;;i++){
    ans=(ans*(pm[i]%mod))%mod;
    K+=2;
    if(K==k) break;
  }
  cout << ans << endl;
}


Measured memory_bytes: 8192
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0, i##_len = (n); i < i##_len; ++i)
#define REPS(i, _s, n) for(int i = _s, i##_len = (n); i < i##_len; ++i)
#define ALL(x) (x).begin(), (x).end()
using namespace std;

#define repi(itr, ds) for(auto itr = ds.begin(); itr != ds.end(); itr++)
// vector
template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
  for(T &x : vec) is >> x;
  return is;
}
// pair
template <typename T, typename U>
ostream &operator<<(ostream &os, pair<T, U> &pair_var) {
  os << "(" << pair_var.first << ", " << pair_var.second << ")";
  return os;
}
// vector
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  os << "{";
  for(int i = 0; i < vec.size(); i++) {
    os << vec[i] << (i + 1 == vec.size() ? "" : ", ");
  }
  os << "}\n   ";
  return os;
}
// map
template <typename T, typename U>
ostream &operator<<(ostream &os, map<T, U> &map_var) {
  os << "{";
  repi(itr, map_var) {
    os << *itr;
    itr++;
    if(itr != map_var.end()) os << ", ";
    itr--;
  }
  os << "}";
  return os;
}
// set
template <typename T>
ostream &operator<<(ostream &os, set<T> &set_var) {
  os << "{";
  repi(itr, set_var) {
    os << *itr;
    itr++;
    if(itr != set_var.end()) os << ", ";
    itr--;
  }
  os << "}";
  return os;
}

#define DUMPOUT cerr

void dump_func() { DUMPOUT << endl; }
template <class Head, class... Tail>
void dump_func(Head &&head, Tail &&... tail) {
  DUMPOUT << head;
  if(sizeof...(Tail) > 0) {
    DUMPOUT << ", ";
  }
  dump_func(std::move(tail)...);
}
#ifdef DEBUG_
#define DEB
#define dump(...)                                                             \
  DUMPOUT << "  " << string(#__VA_ARGS__) << ": "                             \
          << "[" << to_string(__LINE__) << ":" << __FUNCTION__ << "]" << endl \
          << "    ",                                                          \
      dump_func(__VA_ARGS__)
#else
#define DEB if(false)
#define dump(...)
#endif

typedef long long int ll;
const int MOD = 1e9 + 7;
const int INF = 1e9;

int main() {
  string S;
  cin >> S;
  string prev = "";
  string s = "";
  int cnt = 0;
  for(auto c : S) {
    s += c;
    if(prev == s) {
      continue;
    } else {
      prev = s;
      s = "";
      cnt++;
    }
  }

  cout << cnt << endl;
}


Measured memory_bytes: 644
#include <bits/stdc++.h>
typedef long long int ll;
using namespace std;
const ll mod=1e18+7;
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}



int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    string s;
    cin>>s;
    for(int i=0;i<s.length();i++){
        if((i+1)%2==1){
            if(s[i]=='L'){cout<<"No"<<endl;return 0;}
        }
        else{
            if(s[i]=='R'){cout<<"No"<<endl;return 0;}
        }
        }
    cout<<"Yes"<<endl;
    return 0;
    }


Measured memory_bytes: 256
import java.io.InputStream;
import java.io.PrintStream;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        solve(System.in, System.out);
    }

    static void solve(InputStream is, PrintStream os) {
        // Your code here!
        Scanner scan = new Scanner(is);
        int N = scan.nextInt();
        HashMap<Integer, Set<Integer>> graph = new HashMap<>();
        for (int i = 0; i < N; i++) {
            graph.put(i, new HashSet<>());
        }

        for (int i = 0; i < N; i++) {
            String S = scan.next();
            char sChar[] = S.toCharArray();
            for (int j = 0; j < sChar.length; j++) {
                if (sChar[j] == '1') {
                    graph.get(i).add(j);
                    graph.get(j).add(i);
                }
            }
        }

        int min = 1000;//N <= 200
        long answer = -1;
        for (int i = 0; i < graph.size(); i++) {

            answer = Math.max(answer, depth(i, graph, N));
        }
        os.println(answer);

    }

    private static long depth(int start, Map<Integer, Set<Integer>> graph, int N) {
        HashMap<Integer, Set<Integer>> tempGraph = new HashMap<>();
        for (int j = 0; j < N; j++) {
            tempGraph.put(j, new HashSet<>(graph.get(j)));
        }
        HashSet<Integer> firstGp = new HashSet<>();
        HashSet<Integer> visited = new HashSet<>();
        firstGp.add(start);

        long count = 0;
        while (!firstGp.isEmpty()) {
            count++;
            HashSet<Integer> secondGp = new HashSet<>();
            for (Integer pos : firstGp) {
                visited.add(pos);
                for (Integer childPos : tempGraph.get(pos)) {
                    if (visited.contains(childPos)) {
                        return -1;
                    }
                    secondGp.add(childPos);
                }
            }
            for (Integer deletePos : firstGp) {
                for (Integer pos : secondGp) {
                    tempGraph.get(pos).remove(deletePos);
                }
            }
            firstGp.clear();
            firstGp.addAll(secondGp);
        }
        return count;
    }
}

Measured memory_bytes: 160808
import java.util.Scanner;

public class Main {

	public static void main(String []args) {
	Scanner in = new Scanner(System.in);
		int a = in.nextInt();
		int b = in.nextInt();
		int c = in.nextInt();
		int n = 0;
		for(int i=a;i<=b;i++) {
			if(c%i==0)  n++;
		}
		System.out.println(n);
	
	in.close();
	}
}


Measured memory_bytes: 26224
#include <stdio.h>

int main(void)
{
	int n;
	char str[4];
	int a[4];
	int i;

	for (i = 0; i < 4; i++){
		a[i] = 0;
	}

	while (scanf("%d,%s", &n, str) != EOF){
		if (strcmp(str, "A") == 0){
			a[0]++;
		}
		else if (strcmp(str, "B") == 0){
			a[1]++;
		}
		else if (strcmp(str, "AB") == 0){
			a[2]++;
		}
		else if (strcmp(str, "O") == 0){
			a[3]++;
		}
	}

	for (i = 0; i < 4; i++){
		printf("%d\n", a[i]);
	}

	return (0);
}

Measured memory_bytes: 596
import java.math.*;
import java.util.*;
import java.util.function.*;
import java.util.stream.*;

public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    ArrayList<Integer> a = new ArrayList<>();
    for (int i = 0; i < n; i++) {
      a.add(sc.nextInt() - 1);
    }
    ArrayList<Integer> b = new ArrayList<>();
    for (int i = 0; i < n; i++) {
      b.add(sc.nextInt());
    }
    ArrayList<Integer> c = new ArrayList<>();
    for (int i = 0; i < n - 1; i++) {
      c.add(sc.nextInt());
    }
    int result = 0;
    int prev = -1;
    for (int i = 0; i < n; i++) {
      int now = a.get(i);
      result += b.get(now);
      if (prev >= 0 && now == prev + 1) {
        result += c.get(prev);
      }
      prev = now;
    }
    System.out.println(result);
  }
}


Measured memory_bytes: 26972
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <numeric>
#include <queue>
using namespace std;

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

int main(){
    int n ;
    string s ;
    cin >> s ;
    for (int i = 0; i < s.size(); i++)
    {
        for (int j = i+1; j < s.size(); j++)
        {
            if (s.at(i) == s.at(j))
            {
                cout << "no" << endl ;
                return 0 ;
            }
            
        }
        
    }
    cout << "yes" << endl ;
}


Measured memory_bytes: 3604
#include <stdio.h>
#include <iostream>
using namespace std;
int main(){

int R,G,B,N;

cin >> R >> G >>B>>N ;

int count = 0;

int r=0;

while (R*r<=N){

    int g=0;

    while (g*G+R*r<=N){
        if ((N-r*R-g*G) % B==0){
            int b=(N-r*R-g*G)/B;

            if (0<=b){
                count +=1;
            }
                
            else{
                break;
            }
        }

            
        g += 1;
    }
    r += 1;


}
cout << count << endl;   


return 0;
}


Measured memory_bytes: 888
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define INF 1e9
#define PI 3.14159265359
#define MOD 1000000007
#define ALL(v) v.begin(),v.end()
#define ALLR(v) v.rbegin(),v.rend()
typedef long long ll;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
//isPrime
//modpow modinv
//getDigit
int main() {
  cout << fixed << setprecision(10);
  int n,i;
  cin >> n >> i;
  cout << n-i+1 << endl;
}


Measured memory_bytes: 256
s=input()
n=len(s)
A=[]
b=0
a=1
for i in range(n-1):
  if s[i+1]==s[i]:
    a=a+1
  else:
    A.append(a)
    a=1
A.append(n-sum(A))
B=[0]*n
c=0
for i in range(len(A)):
  c+=A[i]
  if i%2==0:
    B[c-1]+=(A[i]+1)//2
    B[c]+=A[i]//2
  else:
    c-=A[i]
    B[c-1]+=A[i]//2
    B[c]+=(A[i]+1)//2
    c+=A[i]
for i in range(n):
  print(B[i],end=" ")

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

int main()
{
    int a, b, c;
    cin >> a >> b >> c;
    if(a == b && b == c){
        if(a % 2 == 0) cout << -1 << endl;
      	else cout << 0 << endl;
        return 0;
    }
    int ab, bc, ca;
    int ans = 0;
    while((a % 2 + b % 2 + c % 2) == 0){
        ab = a + b;
        bc = b + c;
        ca = c + a;
        a = bc / 2;
        b = ca / 2;
        c = ab / 2;
        ans++;
    }
    cout << ans << endl;
}

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

int gcd(int a, int b){
    int r;

    cin >> a >> b;
    if(b > a){
        r = a;
        a = b;
        b = r;
    }
    while(1){
        r = a % b;
        if(r == 0)break;
        a = b;
        b = r;
    }
    return b;
}

int main(){
    int64_t A, B, LCM, cnum = 0, dnum = 0, lcmnum = 0, C, D, GCD;

    cin >> A >> B >> C >> D;
    GCD = gcd(C, D);
    LCM = C * D / GCD;

    cnum = B / C - (A-1) / C;
    dnum = B / D - (A-1) / D;
    lcmnum = B / LCM - (A-1) / LCM;

    cout << B - A + 1 - (cnum + dnum - lcmnum) << endl;
}

Measured memory_bytes: 256
#from collections import deque,defaultdict
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 10**18
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

n,a,b = inm()
x = inl()
sm = 0
for i in range(1,n):
    sm += min(a*(x[i]-x[i-1]),b)
print(sm)


Measured memory_bytes: 14480
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iomanip>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cassert>
#include <complex>
#include <stdio.h>
#include <time.h>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#define all(a) a.begin(),a.end()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define pb push_back
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef long double ld;
typedef complex<ld> com;
constexpr int inf = 1000000000;
constexpr ll INF = 1000000000000000000;
constexpr ld EPS = 1e-12;
constexpr ld PI = 3.141592653589793238;
template<class T, class U> inline bool chmax(T &a, const U &b) { if (a < b) { a = b; return true; } return false; }
template<class T, class U> inline bool chmin(T &a, const U &b) { if (a > b) { a = b; return true; } return false; }


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

	int k, x, y;
	cin >> k >> x >> y;
	bool flagx = false; bool flagy = false; bool flagr = false;
	if (x < 0) {
		x = -x;
		flagx = true;
	}
	if (y < 0) {
		y = -y;
		flagy = true;
	}
	if (x > y) {
		swap(x, y);
		flagr = true;
	}
	int dis = x + y;
	vector<int> ansx, ansy;
	if (k % 2 == 0) {
		if (dis % 2 == 1) {
			cout << -1 << '\n';
			return 0;
		}
		if (dis < k) {
			ansx.pb(k - (y - x) / 2);
			ansy.pb((y - x) / 2);
			ansx.pb(x); ansy.pb(y);
		}
		else {
			int cnt = (dis + k - 1) / k;
			int rem = (cnt * k - dis) / 2;
			rep(i, cnt) {
				int move = (i + 1) * k;
				if (rem + y >= move) {
					ansx.pb(-rem);
					ansy.pb(move - rem);
				}
				else {
					ansx.pb(move - y - rem * 2);
					ansy.pb(y);
				}
			}
		}
	}
	else {
		if (dis < k) {
			if (dis % 2 == 0) {
				int rem = (2 * k - dis) / 2;
				ansx.pb(-rem);
				ansy.pb(k - rem);
			}
			else {
				ansx.pb(x);
				ansy.pb(k - x);
				int rem = k - x - y;
				ansx.pb(x + k - rem / 2);
				ansy.pb(k - x - rem / 2);
			}
			ansx.pb(x); ansy.pb(y);
		}
		else {
			int cnt = (dis + k - 1) / k;
			if (dis % 2 == 0) {
				if (cnt % 2 == 1) cnt++;
				int rem = (cnt * k - dis) / 2;
				rep(i, cnt) {
					int move = (i + 1)*k;
					if (rem + y >= move) {
						ansx.pb(-rem);
						ansy.pb(move - rem);
					}
					else {
						ansx.pb(move - y - rem * 2);
						ansy.pb(y);
					}
				}
			}
			else {
				if (cnt % 2 == 0) cnt++;
				int rem = (cnt * k - dis) / 2;
				rep(i, cnt) {
					int move = (i + 1)*k;
					if (rem + y >= move) {
						ansx.pb(-rem);
						ansy.pb(move - rem);
					}
					else {
						ansx.pb(move - y - rem * 2);
						ansy.pb(y);
					}
				}
			}
		}
	}
	cout << ansx.size() << '\n';
	rep(i, ansx.size()) {
        if (flagr) swap(ansx[i], ansy[i]);
		if (flagx) ansx[i] = -ansx[i];
		if (flagy) ansy[i] = -ansy[i];
		cout << ansx[i] << ' ' << ansy[i] << '\n';
	}
}

Measured memory_bytes: 4076
import sys
import math  # noqa
import bisect  # noqa
import queue  # noqa


def is_prime(n):
    if n == 1:
        return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True


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


def main():
    # [0 is True?, 1 is True?, ..., 10000 is True?]
    table = [False for _ in range(100001)]
    for i in range(1, 100001, 2):
        table[i] = is_prime(i) and is_prime((i + 1) // 2)

    cumsum = [0 for _ in range(100001)]
    for i in range(1, 100001):
        cumsum[i] = cumsum[i - 1]
        if table[i]:
            cumsum[i] += 1

    Q = int(input())
    for _ in range(Q):
        l, r = map(int, input().split())
        res = cumsum[r] - cumsum[l]
        if table[l]:
            res += 1
        print(res)


if __name__ == '__main__':
    main()


Measured memory_bytes: 54300
#[test]
fn check_solve() {
    println!("input:\n4\n\noutput:\n{}\n", solve("4\n"));
    println!("input:\n7\n\noutput:\n{}\n", solve("7\n"));
    println!("input:\n3\n\noutput:\n{}\n", solve("3\n"));
    println!("input:\n6\n\noutput:\n{}\n", solve("6\n"));
    println!("input:\n10\n\noutput:\n{}\n", solve("10\n"));
}
fn solve(src: &str) -> String {
    let mut sc = Scanner::from_str(src);
    let mut ret = String::new();
    use std::fmt::Write;

    let n: usize = sc.read();
    let d = (n as f64 * 8. + 1.).sqrt() as usize;
    if d * d != n * 8 + 1 {
        return "No\n".to_string();
    }
    let k = (1+d)/2;

    let mut ss = vec![Vec::with_capacity(k-1); k];
    let mut cnt = 1;
    for i in 0..k {
        for j in i+1..k {
            ss[i].push(cnt);
            ss[j].push(cnt);
            cnt += 1;
        }
    }

    ret.extend("Yes\n".chars());
    writeln!(&mut ret, "{}", k).unwrap();

    for s in ss {
        write!(&mut ret, "{}", k-1).unwrap();
        for a in s {
            write!(&mut ret, " {}", a).unwrap();
        }
        ret.push('\n');
    }

    ret
}
fn main() {
    let mut buf = String::new();
    use std::io::{Read, Write};
    std::io::stdin().read_to_string(&mut buf).unwrap();
    std::io::stdout().write_all(solve(&buf).as_bytes()).unwrap();
}
struct Scanner<'a>(std::str::SplitWhitespace<'a>);
impl<'a> Scanner<'a> {
    fn from_str(src: &str) -> Scanner {
        Scanner(src.split_whitespace())
    }
    fn get(&mut self) -> &str {
        self.0.next().unwrap()
    }
    fn read<T: std::str::FromStr>(&mut self) -> T {
        self.get().parse().ok().unwrap()
    }
}


Measured memory_bytes: 9032
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define endl "\n"
#define se second
#define ls( s) (s&(-s))
#define ll long long
#define inf 0x3f3f3f3f
#define fast    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const int N = 2e5;
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
const ll mod =    2019;

int main()
{  fast

string s;
cin>>s;
if(s=="ABC")
cout<<"ARC";
else
cout<<"ABC";
}


Measured memory_bytes: 3612
#include <iostream>
#include <stack>
#include <cstring>

using namespace std;
stack<int> numbers;

int main() {
    bool backtrack=false;
    char* str=new char[1000];
    cin.getline(str,1000);

        int pointer=0;
        int n=0;
        while(pointer!=strlen(str))
        {
            if(str[pointer]>='0'&&str[pointer]<='9')
            {
                n*=10;
                n+=str[pointer]-'0';
                backtrack=false;
            }
            else if(str[pointer]==' ')
            {
                if(backtrack==false)
                {
                    numbers.push(n);
                    n = 0;
                }
            }
            else
            {
                int result;
                int n1,n2;
                n2=numbers.top();numbers.pop();
                n1=numbers.top();numbers.pop();
                switch(str[pointer])
                {
                    case'+':result=n1+n2;
                        break;
                    case'-':result=n1-n2;
                        break;
                    case'*':result=n1*n2;
                        break;
                    case '/':result=n1/n2;
                        break;
                }
                numbers.push(result);
                backtrack=true;
            }

            pointer++;
        }
        cout<<numbers.top()<<endl;
        numbers.pop();


    return 0;
}

Measured memory_bytes: 3076
#include <iostream>

int main()
{
  long int a, b;
  int k;

  std::cin >> a >> b >> k;

  
  for (long int i = a; i <= b; ++i) {
    if (( i >= a && i < a+k) || (i > b-(k) && i <= b)) {
      std::cout << i << std::endl;
    }
  }

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define PREP(i, s, x) for(ll i = (s); i < (x); i++)
#define MREP(i, s, x) for(ll i = (s); i >= (x); i--)
#define REP(i, x) PREP(i, 0, x)
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
template<typename T> inline bool chmax(T &a, T b) { return ((a < b) ? (a = b, true) : (false)); }
template<typename T> inline bool chmin(T &a, T b) { return ((a > b) ? (a = b, true) : (false)); }

// variable -------------------------------------------

constexpr ll INF = (1ll << 59);
constexpr ll MOD = 1000000007ll;

// structure ------------------------------------------

// function -------------------------------------------

// main -----------------------------------------------

int main() {
	ll n, x, m;
	cin >> n >> x >> m;

	vector<ll> memo;
	vector<ll> a;
	ll len = 0;
	a.push_back(0);
	a.push_back(x);
	memo.push_back(0);
	memo.push_back(x);
	unordered_set<ll> st;

	ll nandakke = -1;
	ll dokodatta = -1;

	ll ans = 0;
	PREP(i, 2, n+1){
		a.push_back(a[i-1] * a[i-1] % m);
		memo.push_back(memo[i-1] + a[i]);
		if(st.count(a[i-1] * a[i-1] % m) != 0){
			nandakke = a[i-1] * a[i-1] % m;
			dokodatta = i;
			break;
		}
		st.insert(a[i-1] * a[i-1] % m);
	}
	if(nandakke == -1){
		cout << memo[n] << endl;
		return 0;
	}

	PREP(i, 1, n+1){
		if(a[i] == nandakke){
			len = dokodatta - i;
			ans = memo[i];
			ans += ((n-i)/len) * (memo[dokodatta] - memo[i]) + (memo[(n-i)%len+i] - memo[i]);
			cout << ans << endl;
			return 0;
		}
	}
	return 0;
}

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

#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep1(i, n) for (ll i = 1; i <= (ll)(n); i++)
#define INF 10000000000
#define MOD 1000000007
using ll = long long;
using Graph = vector<vector<int>>;

int main(){
    int X; cin>>X;
    if(X>=30)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}

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

typedef long long LL;
typedef long double LD;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef pair<LD, LD> PDD;

#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
#define dbl(k, x) fixed << setprecision(k) << (x)

template <typename _T>
inline void _DBG(const char *s, _T x) {
  cerr << s << " = " << x << "\n";
}
template <typename _T, typename... args>
void _DBG(const char *s, _T x, args... a) {
  while (*s != ',') cerr << *s++;
  cerr << " = " << x << ',';
  _DBG(s + 1, a...);
}

#define _upgrade                \
  ios_base::sync_with_stdio(0); \
  cin.tie(0);                   \
  cout.tie(0);
#define DBG(...) _DBG(#__VA_ARGS__, __VA_ARGS__)

// ********************** CODE ********************** //

int main() {
  _upgrade;
  LL h1, h2, m1, m2, k;
  cin >> h1 >> m1 >> h2 >> m2 >> k;

  LL time = (h2 * 60 + m2) - (h1 * 60 + m1);
  cout << max(0LL, time - k) << "\n";
}

Measured memory_bytes: 3636
fn main() {
    let s = read::<String>().chars().collect::<Vec<_>>();
    let t = read::<String>().chars().collect::<Vec<_>>();

    if s.len() < t.len() {
        println!("UNRESTORABLE");
        return
    }

    let mut v: Vec<usize> = Vec::new();
    for i in 0..(s.len() - t.len() + 1) {
        for j in 0..t.len() {
            if s[i+j] != '?' && s[i+j] != t[j] {
                break;
            }
            if j == t.len() - 1 {
                v.push(i);
            }
        }
    }

    if v.is_empty() {
        println!("UNRESTORABLE");
        return
    }

    for i in 0..s.len() {
        if s[i] == '?' {
            if v[v.len()-1] <= i && i < v[v.len()-1] + t.len() {
                print!("{}", t[i-v[v.len()-1]]);
            } else {
                print!("a");
            }
        } else {
            print!("{}", s[i]);
        }
    }
    println!("");
}

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().parse().ok().unwrap()
}


Measured memory_bytes: 4352
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const double EPS=1e-6;
const double PI=acos(-1.0);
int ABS(int a){return max(a,-a);}
long long ABS(long long a){return max(a,-a);}
char in[120];
int main(){
	for(int i=0;i<3;i++){scanf("%s",in);printf("%c",in[0]);}
}

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

int main(){
  int N;
  int T,A;
  cin>>N;
  cin>>T>>A;
  int H[N];
  for (int i=0;i<N;i++){
    cin>>H[i];
  }
  double t[N];
  int top=1;
  double a=(double )A;
  double near=abs(T-0.006*H[0]-a);
  for (int i=0;i<N;i++){
    t[i]=T-0.006*H[i];
    if (abs(t[i]-a)<near){
      top=i+1;
      near=abs(t[i]-a);
    }
  }
  cout<<top;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <tuple>
#define mkp make_pair
#define mkt make_tuple
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;
template<class T> void chmin(T &a,const T &b){if(a>b) a=b;}
template<class T> void chmax(T &a,const T &b){if(a<b) a=b;}

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

  int N;
  cin>>N;

  N%=10;
  if(N==3) cout<<"bon"<<endl;
  else if(N==0||N==1||N==6||N==8) cout<<"pon"<<endl;
  else cout<<"hon"<<endl;

  return 0;
}


Measured memory_bytes: 3652
n = int(input())

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

ans = 0

for i in range(1,n-1):
	if p[i-1]<p[i]<p[i+1] or p[i+1]<p[i]<p[i-1] :
		ans = ans + 1

print(ans)
	


Measured memory_bytes: 2940
#include <iostream>
#include <algorithm>

using namespace std;

int v[4];

int main() {
cin >> v[1] >> v[2] >> v[3];
sort(v + 1, v + 4);
int ans = 1;
for(int i = 1; i < 3; ++i) {
if(v[i] != v[i + 1]) {
++ans;
}
}
cout << ans;
return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <vector>
#include <bitset>
#include <algorithm>
#include <stack>
#include <queue>
#include <map>
#include <climits>
#include <set>
#include <map>
#include <iomanip>
#include <cassert>
#include <functional>
#include <cstring>

using namespace std;

typedef pair<int, int> P;
#define mp make_pair
#define FOR(i, a, b) for(int (i)=a;(i)<(b);++(i))
#define rep(i, n)  FOR(i,0,n)
#define rrep(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define vsort(v) sort((v).begin(), (v).end());
#define rvsort(v) sort(v.begin(), v.end(),greater<int>());
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl  
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define all(c) (c).begin(),(c).end()
#define ll long long
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define vs vector<string>
#define vc vector<char>
#define vvc vector<vector<char>>
#define Print(p) cout<<(p)<<endl
#define F first
#define S second
#define pb push_back
#define mod 1000000007LL
#define INF 105000000000

const int maxn = 1e5 + 10;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	int n; cin >> n;
	string s; cin >> s;

	int count = 0;
	int max = 0, min = 0;
	rep(i, n)
	{
		if (s[i] == '(') count++;
		else count--;
		max = count > max ? count : max;
		min = count < min ? count : min;
	}
	
	max = count - min;

	while (min < 0)
	{
		min++;
		s = "(" + s;
	}
	while (max > 0)
	{
		max--;
		s = s + ")";
	}
	

	Print(s);
	return 0;
	
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define repl(i, l, r) for (ll i = l; i < r; i++)
#define rep(i, n) repl(i, 0, n)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;

int main()
{
    int n;
    cin >> n;
    vector<int> a(n);
    int sum = 0;
    rep(i, n) {
        cin >> a[i];
        sum += a[i];
    }
    int ave = 0;
    if(sum % n < (n + 1) / 2) {
        ave = sum / n;
    }
    else {
        ave = sum / n + 1;
    }
    int ans = 0;
    rep(i, n) {
        ans += (a[i] - ave) * (a[i] - ave);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3588
import bisect
n = int(input())
a = sorted(list(map(int, input().split())))
b = sorted(list(map(int, input().split())))
c = sorted(list(map(int, input().split())))

ans = 0
for i in b:
  x = bisect.bisect_left(a,i)
  y = bisect.bisect_right(c, i)
  #print(x, y)
  ans = ans+x*(n-y)

print(ans)

Measured memory_bytes: 29116
#pragma GCC optimize(3)
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
bool Finish_read;
template<class T>inline void read(T &x){Finish_read=0;x=0;int f=1;char ch=getchar();while(!isdigit(ch)){if(ch=='-')f=-1;if(ch==EOF)return;ch=getchar();}while(isdigit(ch))x=x*10+ch-'0',ch=getchar();x*=f;Finish_read=1;}
template<class T>inline void print(T x){if(x/10!=0)print(x/10);putchar(x%10+'0');}
template<class T>inline void writeln(T x){if(x<0)putchar('-');x=abs(x);print(x);putchar('\n');}
template<class T>inline void write(T x){if(x<0)putchar('-');x=abs(x);print(x);}
/*================Header Template==============*/
struct node {
	ll atk,bom;
	inline bool operator < (const node &rhs) const {
		return bom>rhs.bom;
	}
}p[100010];
ll n,hp,ans,mx;
int main() {
	read(n);read(hp);
	for(int i=1;i<=n;i++) {
		read(p[i].atk);
		read(p[i].bom);
	}
	sort(p+1,p+n+1);
	for(int i=1;i<=n;i++) {
		mx=max(mx, p[i].atk);
		if(mx>=p[i].bom) {
			printf("%lld\n",ans+hp/mx+(hp%mx!=0));
			return 0;
		}
		hp-=p[i].bom;
		ans++;
		if(hp<=0) {
			printf("%lld\n",ans);
			return 0;
		}
	}
	printf("%lld\n",ans+hp/mx+(hp%mx!=0));
}

Measured memory_bytes: 1792
num_player, initial_point, num_quiz = map(int, input().split(' '))
answerer = [int(input()) for _ in range(0, num_quiz)]

points = [initial_point - num_quiz] * num_player

for i in answerer:
    points[i-1] += 1

survival = [point > 0 for point in points]

for b in survival:
    if b:
        print("Yes")
    else:
        print("No")

exit(0)


Measured memory_bytes: 11240
#include <string>
#include <bits/stdc++.h>
#include <stdio.h>
#include<math.h>
#include <ctype.h>
using namespace std;

int main() {
  int n;
  cin >>n;
  string a,b,c;
  cin >> a >> b >> c;
 int ans=0;
  for(int i=0;i<a.size();i++){
    if(a.at(i)==b.at(i)&&a.at(i)!=c.at(i)){
      ans++;
    }
    else if(b.at(i)==c.at(i)&&a.at(i)!=b.at(i)){
      ans++;
    }
    else if(a.at(i)==c.at(i)&&a.at(i)!=b.at(i)){
      ans++;
    }
    else if(a.at(i)!=b.at(i)&&b.at(i)!=c.at(i)&&c.at(i)!=a.at(i)){
      ans=ans+2;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
/*
    B - Shiritori
    https://atcoder.jp/contests/abc109/tasks/abc109_b
*/
#include <bits/stdc++.h>
using namespace std;

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

    int n;
    cin >> n;
    vector<string> vs(n);
    set<string> st;
    for (int i = 0; i < n; i++) {
        cin >> vs[i];
        st.insert(vs[i]);
    }

    if (vs.size() != st.size()) {
        cout << "No" << endl;
        return 0;
    }

    for (int i = 0; i < n - 1; i++) {
        if (vs[i].back() != vs[i + 1].front()) {
            cout << "No" << endl;
            return 0;
        }
    }

    cout << "Yes" << endl;
}

Measured memory_bytes: 256