akhauriyash/Code-Regression huggingface dataset:
#include<cmath>
#include<cstdio>
#include<vector>

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

using namespace std;

const double EPS=1e-8;

template<class T>
struct point{
	T x,y;
	point operator+(const point &a)const{ return (point){x+a.x,y+a.y}; }
	point operator-(const point &a)const{ return (point){x-a.x,y-a.y}; }
};

template<class T>
point<T> operator*(T c,const point<T> &a){ return (point<T>){c*a.x,c*a.y}; }

template<class T>
T cross(const point<T> &a,const point<T> &b){ return a.x*b.y-a.y*b.x; }

template<class T>
struct line{ point<T> a,b; };

template<class T>
struct polygon:vector< point<T> >{
	polygon(){}
	polygon(int n):vector< point<T> >(n){}
};

enum {CCW=1,CW=-1,ON=0};
int ccw(const point<double> &a,const point<double> &b,const point<double> &c){
	double rdir=cross(b-a,c-a);
	if(rdir> EPS) return CCW;
	if(rdir<-EPS) return CW;
	return ON;
}

point<double> get_intersect(const line<double> &L1,const line<double> &L2){
	double a1=cross(L1.b-L1.a,L2.b-L2.a);
	double a2=cross(L1.b-L1.a,L1.b-L2.a);
	if(abs(a1)<EPS) return L1.a;
	return L2.a+a2/a1*(L2.b-L2.a);
}

template<class T>
polygon<double> convex_cut(const polygon<T> &G,const line<T> &L){
	int n=G.size();
	polygon<double> H;
	rep(i,n){
		int d1=ccw(L.a,L.b,G[i]);
		int d2=ccw(L.a,L.b,G[(i+1)%n]);
		if(d1!=CW) H.push_back(G[i]);
		if(d1==CCW && d2==CW || d1==CW && d2==CCW){
			H.push_back(get_intersect(L,(line<T>){G[i],G[(i+1)%n]}));
		}
	}
	return H;
}

template<class T>
T area2(const polygon<T> &G){
	int n=G.size();
	T a=0;
	rep(i,n) a+=cross(G[i],G[(i+1)%n]);
	return abs(a);
}

template<class T>
line<double> perp_bisector(const point<T> &a,const point<T> &b){
	point<double> p={(a.x-a.y+b.x+b.y)/2.0,(a.y+a.x+b.y-b.x)/2.0};
	point<double> q={(a.x+a.y+b.x-b.y)/2.0,(a.y-a.x+b.y+b.x)/2.0};
	return (line<double>){p,q};
	// why compilation error !!??
	// return (line<double>){(point<double>){(a.x-a.y+b.x+b.y)/2.0,(a.y+a.x+b.y-b.x)/2.0},
						  // (point<double>){(a.x+a.y+b.x-b.y)/2.0,(a.y-a.x+b.y+b.x)/2.0}}};
}

int main(){
	for(int T=1;;T++){
		point<int> a,b,c;
		scanf("%d%d%d%d%d%d",&a.x,&a.y,&b.x,&b.y,&c.x,&c.y);
		if(a.x==0 && a.y==0 && b.x==0 && b.y==0 && c.x==0 && c.y==0) break;

		polygon<double> G(4);
		G[0]=(point<double>){ 0 , 0 };
		G[1]=(point<double>){ 0 ,1e4};
		G[2]=(point<double>){1e4,1e4};
		G[3]=(point<double>){1e4, 0 };

		G=convex_cut(G,perp_bisector(a,b));
		G=convex_cut(G,perp_bisector(a,c));

		printf("%d %.9f\n",T,area2(G)/2/1e8);
	}

	return 0;
}

Measured memory_bytes: 0
#MLE注意！0や1のケースに注意

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, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    import math
    #from math import gcd

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

    n,m = map(int, input().split())
    h = list(map(int, input().split()))
    adj = [[] for _ in range(n)] #頂点数, 場合によって変える
    for _ in range(m):
        a,b = map(int, input().split())
        adj[a-1].append(b-1)
        adj[b-1].append(a-1)
    res = 0
    for i in range(n):
        c = h[i]
        for j in adj[i]:
            if h[i] <= h[j]:
                break
        else:
            res += 1
    print(res)



if __name__ == '__main__':
    main()

Measured memory_bytes: 30532
#include <bits/stdc++.h>
#define PI 3.14159265359
using namespace std;

int main() {
    int A, B;
    char op;
    cin >> A >> op >> B;

    if (op == '+') {
        A += B;
    }
    else {
        A -= B;
    }

    cout << A << endl;
}

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

int main() {
  int n;
  cin >> n;
  vector<P> a(n);
  rep(i, n) {
    int a1;
    cin >> a1;
    a[i].first = a1;
    a[i].second = i;
  }

  sort(a.begin(), a.end());

  rep(i, n) cout << a[i].second + 1 << endl;

  return 0;
}

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

#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define int  long long
#define rep(i,a,b)    for(int i=a;i<b;i++)
#define repn(i,a,b)   for(int i=a;i>=b;i--)
#define F first
#define S second
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pii>
#define pb push_back
#define mp  make_pair
#define all(v) (v).begin(), (v).end()
#define pie 3.14159265358
#define mod2 998244353

 // lcm+min(a,b)
void solve(){   
    int n;cin>>n;
    vi a(n);int ans=0;
    map<int,int> m;
    rep(i,0,n){
        cin>>a[i];
        m[a[i]+i]++;
    }
    rep(i,0,n){
        ans=ans+m[i-a[i]];
    }
    cout<<ans;
} 

signed main(){
    IOS;
    int n=1; 
     // cin>>n; 
    rep(i,0,n)solve();
    
    return 0;
}

Measured memory_bytes: 27484
import java.util.Arrays;
import java.util.Scanner;

public class Main{

	public static void main(String args[]){
		new Main().mainrun();
	}

	private Scanner scan;
	private int N;
	private int R;
	private int L;

	private int topteam = 0;
	private int lasttime = 0;


	private int team[][];//0:得点、1:時間

	private void mainrun() {
		scan = new Scanner(System.in);

		N = scan.nextInt();
		R = scan.nextInt();
		L = scan.nextInt();

		team = new int[N][2];

		for(int i = 0; i < N ;i++) {
			Arrays.fill(team[i],0);
		}


		for(int i = 0;i < R ; i++) {
			looprun();
		}

		team[topteam][1] += L - lasttime;

		//Arrays.asList(team).stream().forEach(e -> System.out.println("score: " + e[0] + ",time: " + e[1] ));

		System.out.println(timeTopteam() + 1);

	}

	private void looprun() {
		int d = scan.nextInt();
		int t = scan.nextInt();
		int x = scan.nextInt();

		team[topteam][1] += t - lasttime;
		team[d - 1][0] += x;

		topteam = scoreTopteam(d - 1,x);
		lasttime = t;
	}

	private int timeTopteam() {
		int ansS = team[0][1];
		int ansT = 0;
		for(int i = 0;i < N;i++) {
			if(ansS < team[i][1]) {
				ansS = team[i][1];
				ansT = i;
			}
		}

		return ansT;
	}

	private int scoreTopteam(int addId ,int addX) {

		int ansT = topteam;

		if(addX > 0) {
			if(addId != topteam && (team[topteam][0] < team[addId][0] || (team[topteam][0] == team[addId][0] && addId < topteam ))) {
				ansT = addId;
			}
		}else {
			if(topteam == addId) {
				int ansS = team[0][0];
				ansT = 0;
				for(int i = 0;i < N;i++) {
					if(ansS < team[i][0]) {
						ansS = team[i][0];
						ansT = i;
					}
				}
			}
		}

		return ansT;
	}
}



Measured memory_bytes: 374968
P, Q, R = map(int, input().split())

if ((P+Q) <= (P+R) and (P+Q) <= (R+Q)):
	print(P+Q)

elif((P+R) <= (P+Q) and (P+R) <= (R+Q)):
	print(P+R)

else:
	print(R+Q)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define INF 5000000000000000000
#define ll long long
#define pll pair<ll, ll>
using namespace std;

int main()
{
  string S;
  cin >> S;
  vector<ll> abc(3, 0);
  for (ll i = 0; i < S.size(); ++i) {
    abc.at(S[i] - 'a') += 1;
  }
  if (abs(abc.at(0) - abc.at(1)) <= 1 && abs(abc.at(0) - abc.at(2)) <= 1 && abs(abc.at(1) - abc.at(2)) <= 1) {
    cout << "YES" << "\n";
  }
  else {
    cout << "NO" << "\n";
  }
}


Measured memory_bytes: 512
from collections import defaultdict

N = int(input())
A = list(map(int, input().split()))
s = [0]*(N+1)
d = defaultdict(int)
for i in range(N):
    s[i+1] = s[i] + A[i]
    d[s[i+1]]+=1

ans = 0
for v in d.values():
    if v >= 2:
        ans += v*(v-1)//2
ans += d[0]
print(ans)

Measured memory_bytes: 112976
#include <stdio.h>

unsigned long gcd(unsigned long a, unsigned long b);
unsigned long lcm(unsigned long a, unsigned long b, unsigned long g);

void swap(unsigned long *x, unsigned long *y)
{
  unsigned long tmp;
  tmp = *x;
  *x = *y;
  *y = tmp;
}

int main(void)
{
  unsigned long a[50], b[50];
  int i = 0;
  int n = 0;
  unsigned long gc[50], lc[50];

  while((scanf("%lu%lu", &a[i], &b[i])) != EOF){
    if((0 < a[i], b[i]) && (a[i], b[i] <= 2000000000)){
       i++;
       n++;
    }
    if(i > 50) break;
  }

  for(i = 0; i < n; i++){
    if(a[i] < b[i]) swap(&a[i], &b[i]);
    gc[i] = gcd(a[i], b[i]);
    lc[i] = lcm(a[i], b[i], gc[i]);
  }

  for(i = 0; i < n; i++){
    printf("%lu %lu\n", gc[i], lc[i]);
  }

    return 0;
}

unsigned long gcd(unsigned long a, unsigned long b)
{
  unsigned long r;

  if(a == b) return a;

  r = a%b;
  while(r != 0){
    a = b;
    b = r;
    r = a%b;
  }
  return b;
}

unsigned long lcm(unsigned long a, unsigned long b, unsigned long g)
{
  unsigned long l;

  l = (a*b)/g;

  return l;
}

Measured memory_bytes: 604
#include <stdio.h>
#include <inttypes.h>

int main(void)
{
    intmax_t a, b, x;
    scanf("%" SCNdMAX " %" SCNdMAX " %" SCNdMAX, &a, &b, &x);
    printf("%" PRIdMAX "\n", b / x - (a == 0 ? -1 : (a - 1) / x));
    return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
#define N 200010
int n,k,a[N],l,r,mid;
bool check(int x)
{
	int res=0;
	for(int i=1;i<=n;i++)
	  if(res+(a[i]-1)/x>k)return false;
	  else res+=(a[i]-1)/x;
	return true;
}
int main()
{
	scanf("%d%d",&n,&k);
	for(int i=1;i<=n;i++)
	  scanf("%d",&a[i]);
	l=1,r=1e9;
	while(l<r)
	  {
	  mid=l+r>>1;
	  if(check(mid))r=mid;
	  else l=mid+1;
	  }
	printf("%d\n",l);
}

Measured memory_bytes: 4588
n = int(input())
a = list(map(int,input().split()))
M = 10**6 + 1
t = [0] * M

for i in sorted(a):
  t[i] += 1
  if t[i] == 1:
    for j in range(2*i,M,i):
      t[j] += 10
      
print(t.count(1))

Measured memory_bytes: 32124
#include <bits/stdc++.h>
#define INF 1000000000
#define LINF 1000000000000000000
#define MOD 1000000007
#define mod 1000007
#define INF63 1061109567
#define INF127 9187201950435737471
#define UINF 18446744073709551615
#define F first
#define S second
#define ll long long
#define N 15
#define M 5010
using namespace std;
ll n,m;
bool dp[M],rc[N][N];
string s[N];
vector<ll> seq;
void mkrand()
{
	vector<ll> v;
	ll i;
	for(i=0;i<n;i++)
	{
		v.push_back(i);
	}
	seq.clear();
	while(!v.empty())
	{
		i=(rand()+(rand()%7+1)*rand()-rand()%2+172)%v.size();
		seq.push_back(v[i]);
		v.erase(v.begin()+i);
	}
	return;
}
int main(){
	ll i,j,k,mask,tran;
	//srand(time(NULL));
	random_device rd;
	mt19937 mt(rd());
	cin>>n>>m;
	for(i=0;i<n;i++)
	{
		cin>>s[i];
	}
	tran=100000;
	while(tran--)
	{
		//mkrand();
		memset(rc,true,sizeof(rc));
		memset(dp,false,sizeof(dp));
		for(i=0;i<m;i++)
		{
			for(j=0;j<m;j++)
			{
				for(k=0;k<n;k++)
				{
					if(s[k][i]!=s[n-k-1][j])
					{
						rc[i][j]=false;
					}
				}
			}
		}
		dp[0]=true;
		for(mask=0;mask<(1<<m);mask++)
		{
			if(!dp[mask])
			{
				continue;
			}
			for(i=0;i<m;i++)
			{
				for(j=i+1;j<m;j++)
				{
					if((mask&(1<<i))||(mask&(1<<j)))
					{
						continue;
					}
					if(rc[i][j])
					{
						dp[mask|(1<<i)|(1<<j)]=true;
					}
				}
			}
		}
		mask--;
		if(m%2==0)
		{
			if(dp[mask])
			{
				puts("YES");
				return 0;
			}
		}
		else
		{
			for(i=0;i<m;i++)
			{
				if(dp[mask^(1<<i)]&&rc[i][i])
				{
					puts("YES");
					return 0;
				}
			}
		}
		shuffle(s,s+n,mt);
	}
	puts("NO");
	return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define sz(x) (int)(x).size()
#define uni(x) x.erase(unique(rng(x)),x.end())
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define EPS (1e-10)
#define equals(a, b) (fabs((a)-(b)) < EPS)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef set<int> S;
typedef queue<int> Q;
typedef queue<P> QP;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<double> vd;
typedef pair<double,double> PD;
typedef pair<int,P> ed;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int MOD = 1000000007;
  
int main() {
  int N;
  cin >> N;
  int ans = 1;
  while(ans*2<=N) {
    ans *= 2;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <fstream>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <limits.h>
#include <math.h>
#include <functional>
#include <bitset>
#include <iomanip>

#define repeat(i,n) for (long long i = 0; (i) < (n); ++ (i))
#define debug(x) cerr << #x << ": " << x << '\n'
#define debugArray(x,n) for(long long i = 0; (i) < (n); ++ (i)) cerr << #x << "[" << i << "]: " << x[i] << '\n'
#define debugArrayP(x,n) for(long long i = 0; (i) < (n); ++ (i)) cerr << #x << "[" << i << "]: " << x[i].first<< " " << x[i].second << '\n'

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> Pii;
typedef vector<int> vint;
typedef vector<ll> vll;
const ll INF = INT_MAX;
const ll MOD = 1e9+7;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;cin>>N;
  int ans = 0;
  repeat(i,N){
    if(i&1)continue;
    int cnt=0;int j;
    for(j=1;j*j<i+1;j++){
      if((i+1)%j==0)cnt+=2;
    }
    if(j*j!=i+1&&cnt==8){
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define debug(v) cout<<#v<<":";for(auto x:v){cout<<x<<' ';}cout<<endl; 
#define INF 1000000000
#define mod 1000000007
typedef long long ll;
const ll LINF = 1001002003004005006ll;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

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

    ll n,c,k;cin>>n>>c>>k;
    vector<ll> t(n);rep(i,n) cin>>t[i];
    sort(ALL(t));
    ll tm=LINF,ans=0,rem=0;
    for(int i=n-1;i>=0;i--){
        if(tm-k>t[i]||rem==0){
            ans++;
            rem=c-1;
            tm=t[i];
        }
        else{
            rem--;
        }
    }

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


Measured memory_bytes: 1024
#![allow(unused_imports)]
#![allow(unused_macros)]
use std::cmp::{ min, max };

macro_rules! ewriteln {
    ($($args:expr),*) => { let _ = writeln!(&mut std::io::stderr(), $($args),*); };
}
macro_rules! trace {
    ($x:expr) => { ewriteln!(">>> {} = {:?}", stringify!($x), $x) };
    ($($xs:expr),*) => { trace!(($($xs),*)) }
}
macro_rules! put {
    ($x:expr) => { println!("{}", $x) };
    ($x:expr, $($xs:expr),*) => { print!("{} ", $x); put!($($xs),*) }
}

#[allow(dead_code)]
const M: i64 = 1_000_000_007;

fn solve(xs: &[i32], num: usize, negative: bool) -> i32{
    if xs.len() == 2 {
        if !negative {
            println!("{} {}", xs[1], xs[0]);
            xs[1] - xs[0]
        } else {
            println!("{} {}", xs[0], xs[1]);
            xs[0] - xs[1]
        }
    } else {
        if !negative {
            if num > 1 {
                let right = solve(&xs[1..], num - 1, negative);
                println!("{} {}", right, xs[0]);
                right - xs[0]
            } else {
                let left = solve(&xs[0..xs.len() - 1], num, !negative);
                println!("{} {}", xs[xs.len()-1], left);
                xs[xs.len() - 1] - left
            }
        } else {
            if num > 1 {
                let right = solve(&xs[1..], num - 1, !negative);
                println!("{} {}", xs[0], right);
                xs[0] - right
            } else {
                let left = solve(&xs[0..xs.len() - 1], num, negative);
                println!("{} {}", left, xs[xs.len()-1]);
                left - xs[xs.len() - 1]
            }
        }
    }
}

fn main() {
    let mut sc = Scanner::new();
    let n: usize = sc.cin();
    let mut xs: Vec<i32> = (0..n).map(|_| sc.cin()).collect();
    xs.sort();
    let mut num_neg = xs.iter().filter(|&x| *x < 0).count();
    if num_neg == 0 { num_neg = 1; }
    if num_neg == n { num_neg = n - 1; }
    let ans: i32 = (num_neg..n).map(|i| xs[i]).sum::<i32>() - (0..num_neg).map(|i| xs[i]).sum::<i32>();
    put!(ans);
    let _ = solve(&xs[..], num_neg, false);

}

use std::io::{self, Write};
use std::str::FromStr;
use std::collections::VecDeque;

struct Scanner { stdin: io::Stdin, buffer: VecDeque<String>, }
impl Scanner {
    fn new() -> Scanner { Scanner { stdin: io::stdin(), buffer: VecDeque::new() } }
    fn cin<T: FromStr>(&mut self) -> T {
        while self.buffer.len() == 0 {
            let mut line = String::new();
            let _ = self.stdin.read_line(&mut line);
            for w in line.split_whitespace() {
                self.buffer.push_back(String::from(w));
            }
        }
        self.buffer.pop_front().unwrap().parse::<T>().ok().unwrap()
    }
}


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

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

typedef long long ll;

//#define INF 0x3fffFFFF
//#define INF_NEG (INF * -1)

//int isFirst = 1;
//template <class T> void print(T t) { if (isFirst) cout << t, isFirst = 0; else cout << " " << t; }

signed main()
{
    int n,k,x,y; cin >> n >> k >> x >> y;

    if (n > k){
        int r = n - k;
        cout << k * x + r * y << endl;        
    } else {
        cout << n * x << endl;
    }

    return 0;
}


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

int main(){
    ll h; cin >> h;
 	 ll ans=0;
    for(int i=1; i>=0; i++){
        ll check=pow(2,i);
        if(h<check){
            ans=check-1;
            break;
        }
    }
  cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
using System;
class P
{
    static void Main()
    {
        string[] nk = Console.ReadLine().Split();
        int n, k;
        n = int.Parse(nk[0]);
        k = int.Parse(nk[1]);
        ulong ans;
        if (k % 2 == 1)
            ans = (ulong)Math.Pow(n / k, 3);
        else
        {
            ans = 0;
            ans += (ulong)Math.Pow(n / k, 3);
            ans += (ulong)Math.Pow(n / (k / 2) - n / k, 3);
        }
        Console.WriteLine(ans);
    }
}

Measured memory_bytes: 13268
#!/usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    a = input()
    print(" ".join(a.split(",")))
    return

#B
def B():
    return

#C
def C():
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    A()


Measured memory_bytes: 38512
#define _GIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main(void) {
  int A, B;
  cin >> A >> B;

  int answer = -1;
  for (int i = 1; i <= 10000; ++i) {
    int a, b;
    a = i * 8 / 100;
    b = i * 10 / 100;
    if (a == A && b == B) {
      answer = i;
      break;
    }
  }

  cout << answer << endl;

  return 0;
}

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

static const int INF=100000;
typedef long long ll;
typedef pair<int,int> P;

int main(){
    int n;
    cin >> n;
    int p[n];
    for(int i=0;i<n;i++) cin >> p[i];
    int cnt=0;
    for(int i=1;i<n-1;i++){
        if(p[i-1]<p[i]&&p[i]<p[i+1]){
            cnt++;
        }
        if(p[i-1]>p[i]&&p[i]>p[i+1]){
            cnt++;
        }
    }
    cout << cnt << endl;
}


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


int main() {
  string s;
  cin >> s;
  if (s == "ABC") cout << "ARC" << endl;
  else cout << "ABC" << endl;
  return 0;
}


Measured memory_bytes: 3624
#include "bits/stdc++.h"

using namespace std;
using ll = long long;

int main(){
    ll ans = 1;
    int n;
    cin >> n;
    vector<ll> b(n);
    for(int i = 0; i < n; i++){
        cin >> b[i];
        if(b[i] == 0){
            cout << 0 << endl;
            return 0;
        }
    }
    for(int i = 0; i < n; i++){
        ll a = b[i];
        if(a > (ll)1e18 / ans){
            cout << -1 << endl;
            return 0;
        }
        ans *= a;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3980
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;

public class Main{
    public static void main(String args[]){
        Scanner sn = new Scanner(System.in);
        double A = sn.nextLong();
        double B = sn.nextDouble();

        BigDecimal bd1 = new BigDecimal(String.valueOf(A));
        BigDecimal bd2 = new BigDecimal(String.valueOf(B));

        BigDecimal result = bd1.multiply(bd2);
        
        System.out.println(result.setScale(0, RoundingMode.DOWN).toPlainString());
    }
}

Measured memory_bytes: 37528
aI,aO,_,aJ,aL,_,_ = map(int, input().split())

ans1 = (aI // 2 + aJ // 2 + aL // 2) * 2
if min(aI, aJ, aL) > 0:
    ans2 = 3 + ((aI-1) // 2 + (aJ-1) // 2 + (aL-1) // 2) * 2
else:
    ans2 = 0

print(max(ans1, ans2) + aO)

Measured memory_bytes: 38384
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric;
import std.container.rbtree;

long[10^^5] PtoN;

void main()
{
    auto N = readln.chomp.to!int;
    auto PS = readln.split.to!(long[]);
    foreach (i, p; PS) PtoN[p-1] = i.to!long+1;

    auto rbt = redBlackTree!long();
    long r;
    foreach_reverse (long n; 0..N) {
        auto c = PtoN[n];
        rbt.insert(c);

        long a = 0, b = 0, d = N+1, e = N+1;
        auto ls = rbt.lowerBound(c);
        if (!ls.empty) {
            b = ls.back();
            ls.popBack();
            if (!ls.empty) a = ls.back;
        }
        auto rs = rbt.upperBound(c);
        if (!rs.empty) {
            d = rs.front();
            rs.popFront();
            if (!rs.empty) e = rs.front;
        }

        r += ((b-a)*(d-c) + (e-d)*(c-b))*(n+1);
    }

    writeln(r);
}

Measured memory_bytes: 13256
#if __has_include("noamoa_atcoder_lib.h")
#include "noamoa_atcoder_lib.h"
#else
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define endl '\n'
#define all(x) (x).begin(),(x).end()
namespace atcoder {
	using namespace std;
	using ll = long long;
	using llv = vector<ll>;
	using intv = vector<int>;
	using charv = vector<char>;
	using boolv = vector<bool>;
	using floatv = vector<float>;
	using doublev = vector<double>;
	using stringv = vector<string>;

	constexpr ll MOD7 = 1000000007;
	constexpr ll MOD9 = 1000000009;

	template<typename T>
	void init(vector<T>& v, T initVal = T()){
		for(auto& e : v){
			e = initVal;
		}
	}

	template<typename T>
	void sort(vector<T>& v){
		sort(all(v));
	}
	template<typename T>
	void sortInv(vector<T>& v){
		sort(all(v), greater<T>());
	}

	template<typename T>
	void reverse(vector<T>& v){
		reverse(all(v));
	}

	template<typename T>
	T sum(const vector<T>& v){
		T ret = 0;
		for(const auto& e : v) ret += e;
		return ret;
	}

	template<typename T>
	inline vector<T>& operator+=(vector<T>& v, const T& e){
		v.push_back(e);
		return v;
	}

	template<typename T1, typename T2>
	inline vector<T1>& operator+=(vector<T1>& v1, const vector<T2>& v2){
		for(const auto& e : v2) v1.push_back(e);
		return v1;
	}

	template<typename T>
	void in(vector<T>& v){
		for(auto& e : v) cin >> e;
	}

	template<typename T1, typename T2>
	void in(vector<T1>& v1, vector<T2>& v2){
		for(int i=0;i<v1.size();i++)
			cin >> v1[i] >> v2[i];
	}
	template<typename T1, typename T2, typename T3>
	void in(vector<T1>& v1, vector<T2>& v2, vector<T3>& v3){
		for(int i=0;i<v1.size();i++)
			cin >> v1[i] >> v2[i] >> v3[i];
	}
	template<typename T1, typename T2, typename T3, typename T4>
	void in(vector<T1>& v1, vector<T2>& v2, vector<T3>& v3, vector<T4>& v4){
		for(int i=0;i<v1.size();i++)
			cin >> v1[i] >> v2[i] >> v3[i] >> v4[i];
	}

	template<typename T>
	istream& operator>>(istream &stream, vector<T>& v){
		for(auto& e : v) stream >> e;
		return stream;
	}

	template<typename T>
	void out(const vector<T>& v){
		for(const auto& e : v) cout << e << ' ';
		cout << endl;
	}

	template<typename T>
	void outln(const vector<T>& v){
		for(const auto& e : v) cout << e << endl;
	}

	template<typename T>
	inline set<T>& operator+=(set<T>& v, const T& e){
		v.insert(e);
		return v;
	}

	template<typename T1, typename T2>
	inline set<T1>& operator+=(set<T1>& v1, const set<T2>& v2){
		for(const auto& e : v2) v1.insert(e);
		return v1;
	}

	constexpr ll modPow(ll x, ll n, ll m){ // O(logn)
		if(n == 0) return 1;
		else if(n % 2 == 0) return modPow((x * x) % m, n / 2, m);
		else return x * modPow(x, n - 1, m) % m;
	}
}
using namespace atcoder;
#endif



int main(){
	cout << fixed << setprecision(15);
	
	ll X;cin>>X;

	for(ll A=-200;A<=200;A++){
		for(ll B=-200;B<=200;B++){
			if(A*A*A*A*A-B*B*B*B*B==X){
				cout << A << " " << B;
				return 0;
			}
		}
	}
}


Measured memory_bytes: 3648
/*
...........__________    							 |										    ___  __
.............|       |     						     |											 |   /
.............|       |     						     |									  		 |  /
.............|       |                               |                         __                | /      _______
.............|_______|  _______            _______   |______   ________   /|  /  |               |/       |      |
.............| \               | |      | |          |      |          | / | /   |               |\       |
.............|  \       _______| |      | |_______   |      |   _______|   |/    |               | \      |
.............|   \      |      | |      |         |  |      |  |       |   |     |               |  \     |
.........  __|    \__|  |______| |______| ________|  |      |_ |_______|   |     |__|           _|   \__ _|        .

*/
#include<bits/stdc++.h>
using namespace std ;
#define int 				long long
#define ull 				unsigned long long int
#define ld 					long double
#define vi 					vector<int>
#define vii 				vector<pair<int,int>>
#define vvi 				vector<vector<int>>
#define pf 					push_front
#define popb 				pop_back
#define pb 					push_back
#define eb 					emplace_back
#define pii 				pair<int,int>
#define prec(x) 			fixed<<setprecision(15)<<x
#define all(x) 				x.begin(),x.end()
#define rall(x) 			x.rbegin(),x.rend()
#define mset(a,b) 			memset(a,b,sizeof(a))
#define mcpy(a,b) 			memcpy(a,b,sizeof(a))
#define fo0(i,n) 			for(int i=0,i##end=n;i<i##end;i++)
#define fo1(i,n) 			for(int i=1,i##end=n;i<=i##end;i++)
#define fo(i,a,b) 			for(int i=a,i##end=b;i<=i##end;i++)
#define foe(i,x)			for(__typeof((x).end())i=(x).begin();i!=(x).end();++i)
#define fre(i,x)			for(__typeof((x).rend())i=(x).rbegin();i!=(x).rend();++i)
#define fast ios_base::sync_with_stdio(false); cin.tie(0);cout.tie(0)
#define inf 1e18
const int mod=1e9+7;
const int N=4e5+10;

void raushan_kumar(){
	string s;cin>>s;
	int flag=0;
	if(s.length()%2)
	{
		cout<<"No"<<endl;
		return;
	}
	for(int i=0;i<s.length()-1;i+=2){
		if(s[i]=='h' and s[i+1]=='i'){

		}
		else{
			flag=1;
		}
	}
	if(flag){
		cout<<"No";
	}
	else{
		cout<<"Yes";
	}
	cout<<endl;
}

int32_t main()
{
	
	fast;int t=1;
	// cin>>t;
	while(t--){
		raushan_kumar();
	}

}

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

int main(int argc, const char * argv[]) {
    
    int n;
    char u[256][11];
    int m;
    char t[11];
    int i,j,judge=1;
    
    scanf("%d",&n);
    
    for (i =0; i < n; i++) {
        scanf("%s",u[i]);

    }
    scanf("%d",&m);
    int openclose=0;
    for (i=0; i<m; i++) {
        
        scanf("%s",t);
        
        for (j=0; j<n; j++) {
            
            judge = strcmp(u[j],t);
            
            if (judge == 0){
                break;
            }
        }
        
        if (judge == 0) {
            
            if (openclose == 0) {
                printf("Opened by %s\n",t);
                openclose++;
            } else {
                printf("Closed by %s\n",t);
                openclose--;
            }
            
        } else if (judge != 0) {
            printf("Unknown %s\n",t);
        }
        
        judge = -1;
        
    }
    
    return 0;
}

Measured memory_bytes: 608
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>
using namespace std;
int INF = 1000000000;
int dx[] = {1,0,-1,0}, dy[] = {0,1,0,-1};

bool in_range(int x, int r){
  return (x >= 0 && x < r);
}

int dfs(vector< vector<int> > &B, int p, int g, int ret){
  if(ret > 10) return INF;
  if(p == g) return ret;
  int h = B.size(), w = B[0].size();
  int r = INF;
  for(int k = 0; k < 4; ++k){
    int x = p/w, y = p%w;
    while(in_range(x,h) && in_range(y,w) && B[x][y] == 0){
      x += dx[k];
      y += dy[k];
    }
    if(in_range(x,h) && in_range(y,w)){
      if(B[x][y] == 3) r = min(r,ret+1);
      else{
        B[x][y] = 0;
        x -= dx[k];
        y -= dy[k];
        if(in_range(x,h) && in_range(y,w) && x*w+y != p){
          r = min(r,dfs(B,x*w+y,g,ret+1));
        }
        B[x+dx[k]][y+dy[k]] = 1;
      }
    }
  }
  if(r > 10) return INF;
  return r;
}

int main(){
  int w, h;
  while(cin >> w >> h, w){
    vector< vector<int> > B(h, vector<int>(w));
    int s, g;
    for(int i = 0; i < h; ++i){
      for(int j = 0; j < w; ++j){
        cin >> B[i][j];
        if(B[i][j] == 2){
          s = i*w + j;
          B[i][j] = 0;
        }
        if(B[i][j] == 3){
          g = i*w + j;
        }
      }
    }
    int ans = dfs(B,s,g,0);
    if(ans == INF) cout << -1 << endl;
    else cout << ans << endl;
  }
  return 0;
}



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

typedef vector<string> vs;
#define rep(i, n) for(int i = 0; i < (n); i++)
template<class T> istream& operator >> (istream& s, vector<T>& v)
{ for (T& x: v) { s >> x; } return s;}
template<class T> void cout_h(const vector<T>& c, int n=INT_MAX)
{ rep(i, min(n, (int)c.size())) cout << c[i] << (i==c.size()-1?"\n":" "); }

int main()
{
    int H,W; cin >>H>>W;
    vs grid(H); cin >> grid;

    vector<vs> ans(2, vs(grid)); 

    rep(h, H) {
        rep(w, W) {
            if (grid[h][w]=='#') continue;
            if (w == 0) {
                ans[0][h][w]='#';
            } else if (w==W-1) {
                ans[1][h][w]='#';
            } else {
                ans[h%2][h][w]='#';
            }
        }
    }

    rep(i,2) {
        rep(j,H) cout<<ans[i][j]<<endl;
        cout<<endl;
    }
}


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

// 総数を1000000007（素数）で割った余り
const long long mod = 1e9 + 7;

using ll = long long;
using pii  = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pii>
#define vpll vector<pll>

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; i++)
#define rep1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; i++)
#define repr(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rep1r(i, n) for (int i = ((int)(n)); i >= 1; i--)

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RSORT(x) sort(rall(x));
#define pb push_back
#define mp make_pair

#define INF (1e9)
#define PI (acos(-1))
#define EPS (1e-7)

ull gcd(ull a, ull b) { return b ? gcd(b, a % b) : a; }
ull lcm(ull a, ull b) { return a / gcd(a, b) * b; }

int main(){
    int n, m, k;
    cin >> n >> m >> k;
    vi a(n), b(m);
    rep(i, n) cin >> a[i];
    rep(i, m) cin >> b[i];
    vll s(m+1);
    rep(i, m) s[i+1] = s[i] + b[i];
    ll sum = 0;
    int ans = 0;
    rep(i, n+1) {
        if (sum > k) break;
        int j = upper_bound(all(s), k-sum) - s.begin() - 1;
        ans = max(ans, i+j);
        if (i < n) sum += a[i];
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 6392
import math

a, b, C = map(float, input().split())

S = (a * b * math.sin(math.radians(C))) / 2
L = a + b + (math.sqrt(a**2 + b**2 - 2*a*b*math.cos(math.radians(C))))
h = b * math.sin(math.radians(C))

print("{:.8f}".format(S))
print("{:.8f}".format(L))
print("{:.8f}".format(h))



Measured memory_bytes: 5696
import sys,queue,math
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = 10**18
MOD = 10**9 + 7
LI = lambda : [int(x) for x in input().split()]
_LI = lambda : [int(x)-1 for x in input().split()]

while True:
    N = int(input())
    if N == 0 : break

    puyo = [[int(x) for x in input().split()] + [0] for _ in range(N)]
    p = 0
    update = True
    while update:
        update = False
        for i in range(N):
            cl = puyo[i][0]
            cnt = cl > 0
            for j in range(1,6):
                if puyo[i][j] == cl and cl > 0:
                    cnt += 1
                else:
                    if cnt >= 3:
                        p += cl * cnt
                        for k in range(cnt):
                            puyo[i][j-k-1] = 0
                        update = True
                    cl = puyo[i][j]
                    cnt = cl > 0
        for i in range(N-1,0,-1):
            for j in range(5):
                if puyo[i][j] > 0: continue
                x = i
                while x > 0:
                    x -= 1
                    if puyo[x][j] > 0:
                        puyo[i][j] = puyo[x][j]
                        puyo[x][j] = 0
                        break
    print (p)



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

typedef long long ll;
typedef pair<int, int> P;

int MOD = 1e9 + 7;
ll INF = 1e18;

int main() {
    int n, m; cin>>n>>m;
    cout << (n-1)*(m-1) << endl;
}

Measured memory_bytes: 256
import java.util.*;
import java.io.*;
 
public class Main {
    public static void main (final String[] args) {
        final Scanner s = new Scanner(System.in);
          int n = Integer.parseInt(s.next());
      	  int m = Integer.parseInt(s.next());
      	
      	int[] vote = new int[n];
      	int sum = 0;
      	for(int i = 0; i < n; i++) {
          vote[i] = Integer.parseInt(s.next());
          sum += vote[i];
        }
      	
      	Arrays.sort(vote);
      
      	if ((double)vote[n-m] >= (double)sum/(4*(double)m)) System.out.println("Yes");
      	else System.out.println("No");
    }
}

Measured memory_bytes: 23892
#include <cstdio>
#include <cmath>
#include <vector>
#include <utility>

#define incID(i, l, r) for(int i = (l)    ; i <  (r); i++)
#define incII(i, l, r) for(int i = (l)    ; i <= (r); i++)
#define decID(i, l, r) for(int i = (r) - 1; i >= (l); i--)
#define decII(i, l, r) for(int i = (r)    ; i >= (l); i--)
#define inc( i, n) incID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define dec( i, n) decID(i, 0, n)
#define dec1(i, n) decII(i, 1, n)

typedef long long   signed int LL;
typedef long long unsigned int LU;

template<typename T> void swap(T &x, T &y) { T t = x; x = y; y = t; return; }
template<typename T> T abs(T x) { return (0 <= x ? x : -x); }
template<typename T> T max(T a, T b) { return (b <= a ? a : b); }
template<typename T> T min(T a, T b) { return (a <= b ? a : b); }
template<typename T> bool setmin(T &a, T b) { if(a <= b) { return false; } else { a = b; return true; } }
template<typename T> bool setmax(T &a, T b) { if(b <= a) { return false; } else { a = b; return true; } }
template<typename T> T gcd(T a, T b) { return (b == 0 ? a : gcd(b, a % b)); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }

// ---- ----

int n, k;
std::vector<int> vec[100000];
std::pair<int, int> range[100000];
bool has_val[100000];

void prod(int x, int y) {
	auto & xp = range[x];
	auto   yp = range[y];
	if(has_val[x] && has_val[y] && (xp.first - yp.first) % 2 == 0) { xp = std::make_pair(2, 0); return; }
	if(has_val[y]) {
		has_val[x] = true;
		xp = std::make_pair( max(xp.first, yp.first - 1), min(xp.second, yp.second + 1) );
	}
}

void dfs(int node, int pre) {
	if(pre != -1) { prod(node, pre); }
	for(auto && i : vec[node]) {
		if(i != pre) {
			dfs(i, node);
			prod(node, i);
		}
	}
}

int main() {
	scanf("%d", &n);
	inc(i, n - 1) {
		int a, b;
		scanf("%d%d", &a, &b);
		a--; b--;
		vec[a].push_back(b);
		vec[b].push_back(a);
	}
	scanf("%d", &k);
	inc(i, n) { range[i] = std::make_pair(-2000000, 3000000); }
	inc(j, k) {
		int v, p;
		scanf("%d%d", &v, &p);
		v--;
		range[v] = std::make_pair(p, p);
		has_val[v] = true;
	}
	
	dfs(0, -1);
	dfs(0, -1);
	
	bool flag = true;
	inc(i, n) {
		if(range[i].first > range[i].second) { flag = false; break; }
	}
	
	printf("%s\n", flag ? "Yes" : "No");
	if(flag) { inc(i, n) { printf("%d\n", range[i].first); } }
	
	return 0;
}


Measured memory_bytes: 11904
ret = gets
while a = gets.scan(/\d+/).map(&:to_i) rescue nil
  x = a.size
  x = x.times { |i|
    if a[i] != i+1
      if x > i
        x = i 
      else
        break  if a[x]!=i+1 || a[i]!=x+1
      end
    end
  }
  puts (x==a.size ? 'YES' : 'NO')
end

Measured memory_bytes: 3836
#include "bits/stdc++.h"
using namespace std;

typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define REP(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) std::cout << x << '\n'
#define all(a) a.begin(), a.end()
#define pb push_back
#define sz(x) ((int)(x).size())
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { ll g = gcd(a, b); return a / g * b; }
const int dx[4] = { 1, 0, -1,  0 };
const int dy[4] = { 0, 1,  0, -1 };
const int INF = (int)1e9;
const ll  inf = (ll)1e18;
const int mod = 1000000007;
const int MAX_N = 100010;

bool cmp(P a, P b) { return a.second < b.second; }

int a[101], b[101];
int dp[101][101][10010];

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(10);
	/*------------------------------*/

	int s, w;
	cin >> s >> w;

	if (s <= w) {
		out("unsafe");
	}
	else {
		out("safe");
	}

	return 0;
}

Measured memory_bytes: 3652
package main

import (
	"fmt"
)

func main() {
	var intArray []int

	n := 3

	intArray = make([]int, n)
	i := 0
	for i = 0; i < n; i++ {
		fmt.Scanf("%d", &intArray[i])
	}
	if (intArray[2] > intArray[0] && intArray[2] < intArray[1]) || (intArray[2] > intArray[1] && intArray[2] < intArray[0]) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


Measured memory_bytes: 512
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    int cakeMax = N/4;
    int donutMax = N/7;
    String result = "No";

    for (int i = 0; i <= cakeMax; i++) {
      for (int j = 0; j <= donutMax; j++) {
        if ( i*4 + j*7 == N) {
          result = "Yes";
          break;
        }
      }
    }

    System.out.println(result);
    scanner.close();
  }

}

Measured memory_bytes: 23636
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,l,r) for(long long i=(l);i<(r);++i)
#define REP(i,n) FOR(i,0,n)
#define int long long
#define pb push_back
#define mp make_pair
const int MOD=1e9+7;
const int INF=1e15;

signed main(){
    int D,N;cin>>D>>N;
    int x=pow(100,D);
    int ans=0;
    REP(i,N){
        ans+=x;
        if((ans/x)%100==0)ans+=x;
    }
    cout<<ans<<endl;
}


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


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


    string s[n+1];
    int a[n];
    int sum = 0;
    for(int i = 0; i < n; i++){
        cin >> s[i] >> a[i];
        sum += a[i];
    }

    cin >> s[n];

    for(int i = 0; i < n; i++){
        if(s[n] == s[i]){
            sum -= a[i];
            break;
        }
        else{
            sum -= a[i];
        }
    }

    cout << sum << "\n";





}


Measured memory_bytes: 256
# 累積和で区間に操作ができる
import math
n,k=map(int,input().split())
A=list(map(int,input().split()))
kukan=[]
ans=[0]*n
for i in range(k):
    B=[0]*(n+1)#番兵は最後尾
    for j in range(n):
        l=max(0,j-A[j])
        r=min(j+A[j]+1,n)#右端の次の座標
        #print(l,r)
        B[l]+=1
        B[r]-=1
    for j in range(n):
        B[j+1]+=B[j]
    B.pop()#比較するために要素数を揃える
    if A==B:#飽和したら終わり
        break
    A=B#AにBをコピー
for b in B:
    print(b)

Measured memory_bytes: 152560
#include <cstdio>
#include <functional>
#include <vector>
#include <algorithm>

int main()
{
    int N = 0;

    scanf("%d", &N);
    std::vector<int> d;
    int temp = 0;
    for (int i = 0; i < N; ++i)
    {
        scanf("%d", &temp);
        d.push_back(temp);
    }
    std::sort(d.begin(), d.end(), std::greater<int>());
    std::vector<int>::iterator result = std::unique(d.begin(), d.end());
    d.resize(std::distance(d.begin(), result));

    // Output
    printf("%ld\n", d.size());
    return 0;
}


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

int getgcd(int n, int m)
{
    int r;
    if (n > m) {
        int t = m;
        m = n;
        n = t;
    }
    while ((r = m % n) != 0) {
        m = n;
        n = r;
    }
    return n;
}
 
int main(){
    long long K;
    int gcd;
    long long sum=0;

    cin >> K;

    for(int i=1;i<=K;i++){
        for(int j=1;j<=K;j++){
            for(int k=1;k<=K;k++){
                gcd = getgcd(getgcd(i,j),k);
                sum += gcd;
            }
        }
    }


    
 
    cout << sum << endl;
 
    return 0;
}

Measured memory_bytes: 3616
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#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>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
# define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
using namespace std;

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

int N, K;
vector<int> h;
int F[100001];

int main() 
{
	cin >> N >> K;
	h.resize(N);
	rep (i, N) { cin >> h[i]; }
	F[0] = 0;
	F[1] = abs(h[0] - h[1]);

	for (int i = 2; i < N; i++)
	{
		int minimum = INT_MAX;
		int loop_num = 0;
		if (i - K < 0)
		{
			loop_num = i;
			
		}
		else
		{
			loop_num = K;
		}

		for (int k = 1; k <= loop_num; ++k)
		{
			chmin(minimum, F[i - k] + abs(h[i - k] - h[i]));
		}
		F[i] = minimum;
	}

	cout << F[N - 1] << endl;

	return 0;
}

Measured memory_bytes: 1024
n = int(input())
ww = list(map(int,input().split()))
sum_list = sum(ww)
absolutes = []
current_sum = 0
other_sum = 0
ww.sort
for w in ww:
  current_sum += w
  other_sum = sum_list - current_sum
  absolutes.append(abs(current_sum - other_sum))

print(min(absolutes))  

Measured memory_bytes: 3060
import math
N,K = map(int,input().split())
mod = 10**9+7

A = [0]*K #A[i-1]はgcdがiになるN個の数の組の個数
for i in range(K//2,K):
  A[i] = 1
for i in range(K//2,0,-1):#大きい方から攻める
  a = pow(math.floor(K//i),N,mod)
  for j in range(2,math.floor(K//i)+1):
    a -= A[i*j-1]
  A[i-1] = a
      
ans = 0  
for i in range(1,K+1):
  ans = (ans + (A[i-1]*i)) % mod

print(ans)

Measured memory_bytes: 69204
//By TheOneYouWant
#pragma GCC optimize ("-O2")
#include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define memreset(a) memset(a,0,sizeof(a))
#define testcase(t) int t;cin>>t;while(t--)
#define forstl(i,v) for(auto &i: v)
#define forn(i,e) for(int i = 0; i < e; i++)
#define forsn(i,s,e) for(int i = s; i < e; i++)
#define rforn(i,s) for(int i = s; i >= 0; i--)
#define rforsn(i,s,e) for(int i = s; i >= e; i--)
#define leadzero(a) __builtin_clz(a) // count leading zeroes
#define trailzero(a) __builtin_ctz(a) // count trailing zeroes
#define bitcount(a) __builtin_popcount(a) // count set bits (add ll)
#define ln endl
#define dbg(x) cerr<<#x<<" = "<<x<<endl
#define dbg2(x,y) cerr<<#x<<" = "<<x<<" & "<<#y<<" = "<<y<<endl;
#define dbgstl32(v) cerr<<#v<<" = \n"; { int c=0; forstl(it,v) \
cerr<<"    Term "<< ++c <<" = "<<it<<ln;} cerr<<endl
#define dbgstlp32(v) cerr<<#v<<" = \n"; { int c=0; forstl(it,v) \
cerr<<"    Term "<< ++c <<" = "<<it.fi<<" , "<<it.se<<ln;} cerr<<endl
#define dbgarr(v,s,e) cerr<<#v<<" = "; forsn(i,s,e) cerr<<v[i]<<", "; cerr<<endl
#define inp freopen("input.txt", "r", stdin)
#define outp freopen("output.txt", "w", stdout)
#define dbgm(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); \
stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << " = " << a << endl;
	err(++it, args...);
}
typedef long long int  ll;
typedef long double  ld;
typedef pair<ll,ll> p64;
typedef pair<int,int> p32;
typedef vector<ll> v64;
typedef vector<int> v32; 
typedef vector<v32> vv32;
typedef vector<v64> vv64;
typedef vector<p32> vp32;
typedef vector<vp32> vvp32;
typedef map<int,int> m32;

const int LIM = 2e5+5, MOD = 1e9+7, EPS = 1e-9;
	v32 adj[(int)1e5+2];
	int visited[(int)1e5+2];
	ll dp[2][(int)1e5+2];
ll dfs(int c, int n,int par){
	if(dp[c][n]!=-1) return dp[c][n];
	ll ans=1;
	visited[n]=1;
	if(c==1){
		forstl(r,adj[n]){
			if(r!=par){
				ans*=dfs(0,r,n);
				ans%=MOD;
			}
		}
		return dp[c][n]=ans;
	}
	forstl(r,adj[n]){
		if(r!=par){
			ans*=(dfs(0,r,n)+dfs(1,r,n));
			ans%=MOD;
		}
	}
	return dp[c][n]=ans;
}

int t,n,m,k,x,y;
int main(){
	fastio;
	cin>>n;
	forn(i,(int)1e5+2){
		forn(j,2){
			dp[j][i]=-1;
		}
	}
	forn(i,n-1){
		cin>>x>>y;
		adj[x].pb(y);
		adj[y].pb(x);
	}
	forn(i,n+1) visited[i]=0;
	//cout<<dfs(0,1)<<" "<<dfs(1,1)<<ln;
	//cout<<dp[0][2]<<" "<<dp[1][2]<<ln;
	cout<<(dfs(0,1,0)+dfs(1,1,0))%MOD<<ln;
	//cout<<dp[0][2]<<" "<<dp[1][2]<<ln;
	return 0;
}

Measured memory_bytes: 14592
import collections

def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table

N,P=map(int,input().split())
counter=collections.Counter(prime_decomposition(P))

ans=1
for i in counter.keys():
    life=counter[i]
    flag=True
    while flag:
        if(life>=N):
            life-=N
            ans*=i
        else:
            flag=False
            
print(ans)


Measured memory_bytes: 3316