akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define st first
#define nd second

using namespace std;

void debug_out() { cerr << endl; }
template<class T> ostream& prnt(ostream& out, T v) { out << v.size() << '\n'; for(auto e : v) out << e << ' '; return out;}
template<class T> ostream& operator<<(ostream& out, vector <T> v) { return prnt(out, v); }
template<class T> ostream& operator<<(ostream& out, set <T> v) { return prnt(out, v); }
template<class T1, class T2> ostream& operator<<(ostream& out, map <T1, T2> v) { return prnt(out, v); }
template<class T1, class T2> ostream& operator<<(ostream& out, pair<T1, T2> p) { return out << '(' << p.st << ' ' << p.nd << ')'; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << " " << H; debug_out(T...);}

#define dbg(...) cerr << #__VA_ARGS__ << " ->", debug_out(__VA_ARGS__)
#define dbg_v(x, n) do{cerr<<#x"[]: ";for(int _=0;_<n;++_)cerr<<x[_]<<" ";cerr<<'\n';}while(0)
#define dbg_ok cerr<<"OK!\n"

// const int N = ;
int n, h, w, x, y;

int main() {
	ios_base::sync_with_stdio(false);

	cin >> w >> h >> x >> y;
	cout << 1. * w * h / 2 << ' ' << (2 * x == w && 2 * y == h);
}	

	

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

int main(){
  cout << fixed << setprecision(12);
  //小数点12ケタのおまじない
  double  x1,y1,x2,y2;
  cin >> x1 >> y1 >> x2 >> y2;
  double L = 0;
  L = sqrt((x2 - x1)*(x2-x1) + (y2 - y1)*(y2-y1));
  cout << L << endl;
  return 0;
}



Measured memory_bytes: 3260
N, MOD = int(input()), 10 ** 9 + 7
memo = [{} for i in range(N+1)]

def ok(last4):
    for i in range(4):
        t = list(last4)
        if i >= 1:
            t[i-1], t[i] = t[i], t[i-1]
        if ''.join(t).count('AGC') >= 1:
            return False
    return True

def dfs(cur, last3):
    if last3 in memo[cur]:
        return memo[cur][last3]
    if cur == N:
        return 1
    ret = 0
    for c in 'ACGT':
        if ok(last3 + c):
            ret = (ret + dfs(cur + 1, last3[1:] + c)) 
    memo[cur][last3] = ret
    return ret
    
print(dfs(0, 'TTT') % MOD)

Measured memory_bytes: 3932
S = list(input())
k = int(input())
S_sorted = "".join(sorted(list(set(S))))
#print(S_sorted[:5])
Ans = []
counter = 0
for counter in range(0, 10000000):
  Ans_temp = []
  moji = S_sorted[counter]
  Index = [i for i, chr in enumerate(S) if moji == chr]
  for j in range(0, k + 1):
    for index in Index:
      if len(S[index : index+j]) != 0:
        Ans_temp.append("".join(S[index : index+j]))
#  print(Ans_temp)
  Ans = Ans + sorted(list(set(Ans_temp)))
  if len(Ans) >= k:
    break
print(Ans[k-1])

Measured memory_bytes: 40688
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <cstdio>
#include <stack>

using namespace std;
typedef long long ll;

#define _SI(arr) (sizeof(arr)/sizeof(arr[0])

int main() {
	ll A, B, N;
	cin >> N >> A >> B;

	ll sum = 0;

	for (ll i = 1; i <= N; i++)
	{
		string s = to_string(i);
		ll temp = 0;
		for (ll k = 0; k < s.size(); k++)
		{
			temp += s[k] - '0';
		}
		if (temp >= A && temp <= B)
			sum += i;
	}

	cout << sum << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<long long> vll;
typedef pair<int,int> pint;
typedef pair<long long, long long> pll;

#define MP make_pair
#define PB push_back
#define ALL(s) (s).begin(),(s).end()
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P) 
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P) 
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P) 
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P) 
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s; }


const int MAX = 10001000;
bool IsPrime[MAX];
bool IsDPrime[MAX];
vector<int> Era(int n = MAX) {
    vector<int> res;
	IsPrime[0] = false; IsPrime[1] = false; 
	for (int i = 2; i < n; ++i) IsPrime[i] = true;
	for (int i = 2; i < n; ++i) {
		if (IsPrime[i]) {
            res.push_back(i);
			for (int j = i*2; j < n; j += i) IsPrime[j] = false;
		}
	}
    return res;
}

int main() {
    Era();
    memset(IsDPrime, 0, sizeof(IsDPrime));
    for (int i = 2; i <= 10000; ++i) if (IsPrime[i] && IsPrime[i+2]) IsDPrime[i] = true;
    
    int n;
    while (cin >> n) {
        if (n == 0) break;
        int res = n-1;
        for (res = n-2; res >= 3; --res) if (IsDPrime[res]) {
            cout << res << " " << res+2 << endl;
            break;
        }
    }
    return 0;
}


Measured memory_bytes: 20884
A_list = list(map(int, input().split()))
A_list = A_list + A_list # リストのインデックスが足りないから伸ばす

score_list = []
for i in range(3):
    score = 0
    score += abs(A_list[i] - A_list[i + 1]) +\
             abs(A_list[i + 1] - A_list[i + 2])
    score_list.append(score)

print(min(score_list))


Measured memory_bytes: 2940
#include<bits/stdc++.h>
using namespace std;
typedef long double D;
typedef pair<D,int> pdi;

const D EPS = 1e-10;
D px[220],py[220],pz[220],vx[220],vy[220],vz[220],r[220],vr[220];

vector<D> cal(int a, int b){
  vector<D> res;

  D dpx = px[a]-px[b], dpy = py[a]-py[b], dpz = pz[a]-pz[b], dpv = r[a]+r[b];
  D dtx = vx[a]-vx[b], dty = vy[a]-vy[b], dtz = vz[a]-vz[b], dtv = vr[a]+vr[b];
  D A = dtx*dtx + dty*dty + dtz*dtz - dtv*dtv;
  D B = 2*dtx*dpx + 2*dty*dpy + 2*dtz*dpz + 2*dtv*dpv;
  D C = dpx*dpx + dpy*dpy + dpz*dpz - dpv*dpv;

  if(abs(A)<EPS){
    if(abs(B)<EPS)return res;
    else{
      D t = -C/B;
      if(t>-EPS)res.push_back(t);
      return res;
    }
  }
  
  D d = B*B-4*A*C;
  if(d<-EPS)return res;
  if(abs(d)<EPS){
    D t = -B/2/A;
    if(t>-EPS)res.push_back(t);
    return res;
  }
  
  D t1 = (-B-sqrt(d))/(2*A);
  D t2 = (-B+sqrt(d))/(2*A);
  if(t1>-EPS){
    res.push_back(t1); 
    return res;
  }else if(t2>-EPS){
    res.push_back(t2); 
    return res;
  }
  return res;
}

int main(){
  int n;
  while(cin >> n, n){
    priority_queue<pdi> q;

    for(int i=0;i<n;i++){
      cin >> px[i] >> py[i] >> pz[i] >> vx[i] >> vy[i] >> vz[i] >> r[i] >> vr[i];
      q.push( pdi(-r[i]/vr[i], i) );
    }

    for(int i=0;i<n;i++){
      for(int j=0;j<i;j++){
	vector<D> tmp = cal(i,j);
	for(D t : tmp){
	  q.push( pdi(-t, (i+1)*n + j) );
	}
      }
    }

    vector<D> ans(n);
    vector<int> del(n,0);
    while(q.size()){
      D t = -q.top().first;
      int id = q.top().second;
      q.pop();

      int id1 = id%n, id2 = id/n-1;
      if(id2<0){
	if(!del[id1]){
	  ans[id1] = t;
	  del[id1] = 1;
	}
      }else{
	if(!del[id1] && !del[id2]){
	  ans[id1] = t; ans[id2] = t;
	  del[id1] = 1; del[id2] = 1;
	}
      }
    }

    for(int i=0;i<n;i++){
      cout << fixed << setprecision(10) << ans[i] << endl;
    }
  }
}

Measured memory_bytes: 2760
#include<stdio.h>
#include<string.h>
int main(void){
    int n,m;
    int e[100001]={0}, idx[200001]={0};
    scanf("%d%d",&n,&m);
    for(int i=1;i<=m;i++){
        scanf("%d",&e[i]);
        idx[e[i]]=1;
    }
    //puts("");
    for(int i=m;i>0;i--){
        if(idx[e[i]]==1){
            idx[e[i]]=-1;
            printf("%d\n",e[i]);
        }
    }
    //puts("");
    for(int i=1;i<=n;i++){
        if(idx[i]==0){
            printf("%d\n",i);
        }
    }
    return 0;
}



Measured memory_bytes: 3012
#include <iostream>
#include <cmath>
#include <string>
#include <cstdlib>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cctype>
#include <map>
#include <cstring>
#include <typeinfo>
#include <utility>
#define REP(i,n) for(int i = 0;i < n ;i++)
#define FOR(i,m,n) for(int i= m ;i<n;i++)
using namespace std;

int main(void){
  string str;
  cin >> str;
  map<char,int>mp;
  int i;
  for(i=0;i<str.size();i++){
    mp[str[i]]++;
  }
  for(i=0;i<str.size();i++){
    if(mp[str[i]]%2!=0){
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}


Measured memory_bytes: 256
x = int(input())
kyu = 8
if (x >= 600):
    kyu -= 1
if (x >= 800):
    kyu -= 1
if (x >= 1000):
    kyu -=1
if (x >= 1200):
    kyu -= 1
if (x >= 1400):
    kyu -=1
if (x >= 1600):
    kyu -=1
if (x >= 1800):
    kyu -=1
print(kyu)

Measured memory_bytes: 9184
import math


def main():
    N, M = map(int, input().split())

    routes = {i:[] for i in range(N)}
    directions = [None for _ in range(N)]
    queue = [0]
    current_time = 1

    for i in range(M):
        A, B = map(lambda n: int(n)-1, input().split())
        routes[A].append(B)
        routes[B].append(A)

    # print(routes)
    directions[0] = 0
    while len(queue) != 0:
        i = queue.pop(0)
        # print("pop: ", i)
        go = routes[i]
        # print("go:", go)
        for j in go:
            if directions[j] == None:
                # 訪れたことのない
                directions[j] = i
                queue.append(j)
                # print("pushed: ", j)
                # print("queue: ", queue)

    # print(directions)
    if None in directions:
        print("No")
        return
    else:
        print("Yes")
        for i in range(1,N):
            print(directions[i]+1)


if __name__ == '__main__':
    main()


Measured memory_bytes: 41608
import numpy as np
from functools import *
import sys
sys.setrecursionlimit(100000)
input = sys.stdin.readline



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

N=int(input())

if N%10==3:
    print("bon")
elif N%10 in [0,1,6,8]:
    print("pon")
else:
    print("hon")
    


Measured memory_bytes: 27160
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,c,d,i,j,k,n=0;
    cin>>a>>b>>c>>d;
    for(i=0;i<=a&&500*i<=d;i++)
    {
        for(j=0;j<=b&&100*j+500*i<=d;j++)
        {
            for(k=0;k<=c&&50*k+100*j+500*i<=d;k++)
            {
                if(500*i+100*j+50*k==d)
                  n++;
            }
        }
    }
    cout<<n;
    return 0;
}

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

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

srt_as = sorted(As, reverse=True)

Alice = 0
Bob = 0

for i in range(n):
    if i % 2 == 0:
        Alice += srt_as[i]
    else:
        Bob += srt_as[i]

print(Alice-Bob)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#include <math.h>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1001001001;
const int mINF = -1001001001;


int main() {
int a,b,c;
cin >> a >> b >> c;
int ans;
ans = b+c-a;
if(ans<0) ans = 0;
cout << ans << endl;
return 0;
}


Measured memory_bytes: 256
def abc133_c():
    L, R = map(int, input().split())
    # 区間の幅が673あれば、673の倍数と3の倍数が含まれて、2019の倍数が作れる
    if R - L > 673: return 0
    # それ以外は試す
    ans = 2019
    for i in range(L, R+1):
        for j in range(L, i):
            m = i * j % 2019
            ans = min(m, ans)
            if ans == 1: return 1
    return ans

print(abc133_c())

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

vector<P> g[100005];
vector<bool> vi(100005);
vector<int> res(100005);

bool dfs(int a, int d = 0) {
	if (vi[a]) return res[a] == d;
	res[a] = d;
	vi[a] = true;
	for (auto& c : g[a]) {
		if (!dfs(c.first, d + c.second)) return false;
	}
	return true;
}


int main() {
	int n, m;
	cin >> n >> m;
	rep(i, m) {
		int l, r, d;
		cin >> l >> r >> d;
		l--; r--;
		g[l].emplace_back(r, d);
		g[r].emplace_back(l, -1*d);
	}
	bool elf = true;
	rep(i, n) {
		if (vi[i]) continue;
		if (!dfs(i)) {
			puts("No");
			return 0;
		}
	}
	puts("Yes");
	return 0;
}


Measured memory_bytes: 11008
#include <iostream>
#include <set>
#include <vector>
#include <algorithm>
#include <bitset>
#include <sstream>
#include <iomanip>
#include <map>
#include <tuple>

using namespace std;

#define rep(i, a, b) for(int i = a; i < b; i++)
#define rrep(i, a, b) for(int i = a; i <= b; i++)
#define all(a)  begin((a)),end((a))
#define uniq(c) (c).erase(unique(all((c))), end((c)))

string create_id(int prefecture, int city)
{
    ostringstream stream;
    stream << setfill('0') << setw(6) << prefecture;
    stream << setfill('0') << setw(6) << city;
    return stream.str();
}

map<tuple<int, int>, string> create_id_vec(vector<tuple<int, int>> &pairs)
{

    map<tuple<int, int>, string> ids;
    int prefecture = 0;
    int city = 0;
    rep (i, 0, pairs.size()) {
        if (i == 0) {
            prefecture = get<0>(pairs[i]);
            ++city;
            ids[pairs[i]] = create_id(prefecture, city);
            continue;
        }
        if (prefecture != get<0>(pairs[i])) {
            prefecture = get<0>(pairs[i]);
            city = 0;
        }
        ++city;
        ids[pairs[i]] = create_id(prefecture, city);
    }
    return ids;
}

void output(vector<tuple<int, int>> &original, map<tuple<int, int>, string> &ids)
{
    rep (i, 0, original.size()) {
        cout << ids[original[i]] << endl;
    }
}

int main()
{
    int N, M; cin >> N >> M;
    vector<tuple<int, int>> original(M);
    rep (i, 0, M) {
        int P, Y; cin >> P >> Y;
        original[i] = make_tuple(P, Y);
    }
    vector<tuple<int, int>> sorted;
    copy(original.begin(), original.end(), back_inserter(sorted));
    sort(sorted.begin(), sorted.end());

    map<tuple<int, int>, string> ids = create_id_vec(sorted);
    output(original, ids);
}

Measured memory_bytes: 14068
#include <iostream>
#include <algorithm>
#include <math.h>
using namespace std;
int main(){
	int a,b,c;
	cin>>a>>b;
	if((a*b)%2==0){
		printf("No");
		return 0;
	}else{

			printf("Yes");
			return 0;
		}
	
	return 0;
}

Measured memory_bytes: 256
#![allow(unused_macros)]
#![allow(dead_code)]
#![allow(unused_imports)]

use itertools::Itertools;
use proconio::*;
use smallvec::alloc::collections::VecDeque;
use text_io::*;

const U_INF: usize = 1 << 60;
const I_INF: isize = 1 << 60;

fn main() {
    input! {
        h:usize,
        w:usize,
        s:[String;h],
    }

    let s = s.into_iter().map(|c| c.chars().collect_vec()).collect_vec();

    let mut queue = VecDeque::new();
    queue.push_back(((0, 0), 0));
    let mut dp = vec![vec![U_INF; w]; h];

    while let Some(((i, j), acc)) = queue.pop_front() {
        if (i, j) == (h - 1, w - 1) {
            break;
        }

        let (i, j) = (i as isize, j as isize);
        for (i, j) in &[(i - 1, j), (i + 1, j), (i, j - 1), (i, j + 1)] {
            if !((0..h as isize).contains(i) && (0..w as isize).contains(j)) {
                continue;
            }

            let (i, j) = (*i as usize, *j as usize);

            if dp[i][j] != U_INF || s[i][j] == '#' {
                continue;
            }

            dp[i][j] = acc + 1;
            queue.push_back(((i, j), acc + 1));
        }
    }

    if dp[h - 1][w - 1] == U_INF {
        println!("{}", -1);
        return;
    }

    let sum = s
        .into_iter()
        .map(|s| s.into_iter().filter(|&c| c == '#').count())
        .sum::<usize>();

    let h = h as isize;
    let w = w as isize;

    println!(
        "{}",
        h * w - dp[h as usize - 1][w as usize - 1] as isize - sum as isize - 1
    );
}


Measured memory_bytes: 2172
#include <bits/stdc++.h>
using namespace std;
void print() {
    cout << endl;
}
template <class Head, class... Tail>
void print(Head &&head, Tail &&... tail) {
    cout << head;
    if (sizeof...(tail) != 0)
        cout << " ";
    print(forward<Tail>(tail)...);
}
template <class T>
void print(vector<T> &vec) {
    for (auto &a : vec) {
        cout << a;
        if (&a != &vec.back())
            cout << " ";
    }
    cout << endl;
}
template <class T>
void print(vector<vector<T>> &df) {
    for (auto &vec : df) {
        print(vec);
    }
}
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define xrep(i, a, b) for (int i = int(a); i < int(b); ++i)
using ll = long long;
const int INF = 1001001001;

int main() {
    int A, B, C, X, Y;
    cin >> A >> B >> C >> X >> Y;
    int min_cost = INF;
    for(int z=0; z<=300000; z+=2) {
        if (X-z/2<0 || Y-z/2<0) continue;
        int cost = A*(X-z/2)+B*(Y-z/2)+C*z;
        min_cost = min(cost, min_cost);
        if (cost==110000000) {
        }
    }
    int c = C*(max(X, Y))*2;

    print(min(min_cost, c));

    return 0;
}

Measured memory_bytes: 3616
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#define len(X) ((int)(X).size())

#ifdef __LOCAL
#define DBG(X) cout << #X << "=" << (X) << '\n';
#define SAY(X) cout << (X) << '\n';
#else
#define DBG(X)
#define SAY(X)
#endif

using namespace std;

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

const int INT_INF = (int)(2e9);
const ll  LL_INF = (ll)(2e18);

const int NIL = -1;
static mt19937 _g(time(nullptr));

std::string pad(int num)
{
    char buffer[4];
    std::snprintf(buffer, sizeof(buffer), "%03d", num);
    return buffer;
}

inline ll randint(ll a, ll b) { ll w = (_g() << 31LL) ^ _g(); return a + w % (b - a + 1); }
inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T> inline T sign(T x) { return T(x > 0) - T(x < 0); }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline T fetch() { T ret; cin >> ret; return ret; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for (auto& elem : ret) cin >> elem; return ret; }

#ifdef _MSC_VER
#  include <intrin.h>
#  define __builtin_popcount __popcnt
#endif

ll solve()
{
    ll N, M;

    std::cin >> N >> M;

    return N * (N - 1) / 2 + M * (M - 1) / 2;
}

int main()
{
    std::cout << solve() << std::endl;
    //solve();

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cstdio>
using namespace std;
#define MAX 1000000
bool prime[MAX];

char maze[13][13];

void dfs(int y,int x){
  int dx[] = {-1,1,0,0};
  int dy[] = {0,0,-1,1};
  maze[y][x] = '0';
  for(int i = 0 ; i < 4 ; i ++){
    if(maze[y+dy[i]][x+dx[i]]=='1')dfs(y+dy[i],x+dx[i]);
  }
}
int main(void){ 
  while(cin>>maze[0][0]){
    //cout<<maze[0][0];
    for(int i = 1 ; i < 12  ; i ++){
      cin>>maze[0][i];
      //cout<<maze[0][i];
    }
    //cout<<endl;
    for(int i = 1 ; i < 12 ; i ++){
      for(int j = 0 ; j < 12 ; j ++){
	cin>>maze[i][j];
	//cout<<maze[i][j];
      }
      //cout<<endl;
    }

    int cnt = 0;
    for(int i = 0 ; i <= 12 ; i ++){
      for(int j = 0 ; j <= 12 ; j ++){
	if(maze[i][j] == '1'){
	  cnt++;
	  dfs(i,j);
	}
      }
    }
    cout<<cnt<<endl;
  }
  
}

Measured memory_bytes: 1144
while True:
    arr = input().split()
    x = int(arr[0])
    op = arr[1]
    y = int(arr[2])
    if op == '+':
        print(f'{x+y}')
    elif op == '-':
        print(f'{x-y}')
    elif op == '*':
        print(f'{x*y}')
    elif op == '/':
        print(f'{x//y}')
    else:
        break



Measured memory_bytes: 5604
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

//		long ans2 = 0;
//		long ans = 0;
		long ans = 0;
//		String ans = "";

		Scanner sc = new Scanner(System.in);


		long a = sc.nextInt();
		long b = sc.nextInt();
//		int k = sc.nextInt();
//		String s = sc.next();
//		String t = sc.next();

//		String string = sc.next();
//		StringBuilder s = new StringBuilder(string);

		boolean f = false;

//

//		int[] b = new int[n];
//		int[][] aa = new int[h][w];
//		int[] bb = new int[n];
//		for (int i = 0; i < h; i++) {
//			for(int j = 0; j < w; j++) {
//				a[i][j] = sc.nextInt();
//			}
//		}
//		for (int i = 0; i < n; i++) {
//			b[i] = sc.nextInt();
//			bb[i] = b[i];
//		}

		ans = lcm(a, b);


		System.out.println(ans);

		sc.close();
	}

	private static long gcd(long m, long n) {
	    if(m < n) return gcd(n, m);
	    if(n == 0) return m;
	    return gcd(n, m % n);
	}

	private static long lcm(long m, long n) {
	    return m * n / gcd(m, n);
	}
}

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

using namespace std;

int main(){
	int n;
	cin>>n;
	long long ans=pow(10,17);
	long long sum=0;
	long long snuke=0;
	vector<int> card(n);

	for(int i=0;i<n;i++){
		cin>>card.at(i);
		sum+=card.at(i);
	}

	for(int i=0;i<n-1;i++){
		sum-=card.at(i);
		snuke+=card.at(i);
		ans=min(ans,abs(sum-snuke));
	}

	cout<<ans<<endl;

	return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <limits>
#include <numeric>

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;

int main()
{
	int a, b;
	string s;
	cin >> a >> b >> s;

	if (s[a] != '-') {
		cout << "No" <<endl;
		return 0;
	}

	for (int i = 0; i < a+b+1; i++) {
		if (i != a) {
			if (!isdigit(s[i])) {
				cout << "No" << endl;
				return 0;
			}
		}
	}

	cout << "Yes" << endl;
	return 0;

}

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

#define ll long long 
#define pb push_back
#define mp make_pair
#define F first
#define S second 
#define pl pair<long ,long >
#define pi pair<int ,int >
#define lb(v,x) lower_bound(v.begin(),v.end(),x)-v.begin();
#define ub(v,x) upper_bound(v.begin(),v.end(),x)-v.begin();
#define ct(i) cout<< i << "\n";
#define sv(v) sort(v.begin(),v.end());
#define mod 1000000007
#define M 100005

void answer(){
    ll n,m,ans=0,c=0;
    cin>>n;
    int a[n],h[1000001]={},h1[1000001]={};
    for(int i=0;i<n;i++){
        cin>>a[i];
        h[a[i]]++;
        h1[a[i]]=1;
        if(a[i]==1) c++;
    }
    if(c==1){
        cout<<1;
        return;
    }
    if(c>=2){
        cout<<0;
        return;
    }
    for(int i=0;i<n;i++){
        if(h[a[i]]>1){ h[a[i]]=0; continue;}
        for(int j=2;j*j<=a[i];j++){
            if(a[i]%j==0){
                if(h1[j]==1 || h1[a[i]/j]==1){
                    h[a[i]]=0;
                    //cout<<i<<" "<<j<<endl;
                    break;
                }
            }
        }
    }
    for(int i=1;i<1000001;i++)
        if(h[i]>0) ans++;
    
    cout<<ans;
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL); 
    int q;
    //cin>>q; while(q--)
        answer();

    return 0;
}


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

lst = []

for i in range(n):
    lst.append(list(input()))


lst[0].sort()
sta = list(set(lst[0]))
sta.sort()
res = []

for i in sta:
    min = 100
    for j in range(n):
        if lst[j].count(i) < min:
            min = lst[j].count(i)
    res.append(min)

for i in range(len(sta)):
    for j in range(res[i]):
        print(sta[i], end = "")


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

#define     F       first
#define     S       second
typedef pair<int, int>  pi;
typedef long long       ll;

const int MAX=2e5+9;
int k, n, a[MAX];

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

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

    int mn=1e9+9;
    for (int i=2; i<=n; ++i) {
        mn=min(mn, k-(a[i]-a[i-1]));
    }

    mn=min(mn, k-((k-a[n])+a[1]));
    cout << mn;

    return 0;
}


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

int main() {
    int n;
    cin >> n;
    vector<int> x (n);
    for(int i=0; i<n; i++){
        int a;
        cin >> a;
        x.at(i) = a;
    }
    sort(x.begin(),x.end());
    ll ans = 2000000000;
    for(int i=x.at(0); i<=x.at(n-1); i++){
        ll count = 0;
        for(int j=0; j<n; j++){
            count += (i-x.at(j)) * (i-x.at(j));
        }
        if(ans > count){
            ans = count;
        }
    }
    if(n == 1){
        ans = 0;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
def lsc(str1,str2):
    table1=[0]*(len(str2)+1)
    for i in range(len(str1)):
       table2=table1[:]
       for j in range(len(str2)):
            if(str1[i] == str2[j]):
               table1[j+1] = table2[j] +1
            else:
                if(table1[j+1] < table1[j]):
                    table1[j+1]=table1[j]
    return table1[-1]




n=int(input())

for loop in range(n):
    str1=input()
    str2=input()
    print(lsc(str1,str2))


Measured memory_bytes: 5632
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ff first
#define ss second
#define endl "\n"
#define all(x) (x).begin(), (x).end()
#define PI 3.1415926535897932384626433832795
int MOD=1e9+7;
int powmod(int a,int l, int md){int res=1;while(l){if(l&1)res=res*a%md;l/=2;a=a*a%md;}return res;}
typedef long long ll; typedef vector<ll> vi; typedef pair<ll, ll> ii; typedef vector<ii> vii;
#define pb push_back
int __set(int b, int i) {return b|(1<<i);} //set ith bit
int __unset(int b, int i) {return b&!(1<<i);}
int __check(int b, int i) {return b&(1<<i);} //returns 0 if ith bit is 0
int mul(int a, int b) {return ((a%MOD)*(b%MOD))%MOD;}
int add(int a, int b) {return (a+b)%MOD;}
int sub(int a, int b) {return (((a-b)%MOD)+MOD)%MOD;}
int __div(int a, int b) {return mul(a, powmod(b, MOD-2, MOD));} //if MOD is prime;
const int inf = 0xFFFFFFFFFFFFFFFL; //very large number
priority_queue<int, vector<int>, greater<int> > pq; //for min priority_queue
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
clock_t time_p=clock();
void time()
{
    time_p=clock()-time_p;
    cerr<<"Time Taken : "<<(float)(time_p)/CLOCKS_PER_SEC<<"\n";
}

int32_t main(void)
{
	IOS;
	int n, W; 
	cin>>n>>W;
	vi v(n); vi w(n);
	for(int i = 0; i < n; i++)
		cin>>w[i]>>v[i];
	int LIM = 100010;
	int dp[n][LIM];
	memset(dp, W+1, sizeof(dp));
	for(int i = 0; i < n; i++) {
		for(int j = 0; j < LIM; j++)
			dp[i][j]=inf;
	}
	dp[0][v[0]]=w[0];
	for(int i = 0; i < n; i++)
		dp[i][0]=0;
	for(int i = 1; i < n; i++) {
		for(int j = 0; j < LIM; j++) {
			int mn1=W+1, mn2=W+1;
			if(j-v[i] >= 0)
				mn1=dp[i-1][j-v[i]]+w[i];
			mn2=dp[i-1][j];
			dp[i][j]=min(mn1, mn2);
		}
	}
	// for(int i = 0; i < n; i++) {
	// 	for(int j = 0; j < 29; j++) {
	// 		if(dp[i][j]>W)
	// 			cout<<-1<<" ";
	// 		else cout<<dp[i][j]<<" ";
	// 	}
	// 	cout<<endl;
	// }
	int mx=0;
	// cout<<dp[n-1][17]<<endl;
	for(int i = 0; i < LIM; i++) {
		if(dp[n-1][i] <= W)
			mx=i;
	}
	cout<<mx<<endl;
	time();	
	return 0;
}

Measured memory_bytes: 78464
#include <stdio.h>
int main(void) {
	while(1){
		long long int n;
		scanf("%lld",&n);
		if(n==(-1)) break;
		long long int d=0,b=1;
		while(n>0){
			d=d+(n%4)*b;
			n=n/4;
			b=b*10;
		}
		printf("%lld\n",d);
	}
	return 0;
}


Measured memory_bytes: 2036
#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include <algorithm>
#define _USE_MATH_DEFINES
#include <cmath>
#include <numeric>
#include <iomanip>
#include <deque>
#include <tuple>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <sstream>
#include <stdexcept>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>

#define rep(i, x) for (int i = 0; i < (int)(x); i++)
#define FOR(i, a, done) for (int i = (a); i < (done); ++i)
#define all(a) (a).begin(), (a).end()
#define x first
#define y second
#define debug(a) cout << (a) << endl
namespace mp = boost::multiprecision;
using cpp_int = mp::cpp_int;
using ll = long long;
using namespace std;
template <class T>
bool chmax(T &a, const T &b)
{
	if (a < b)
	{
		a = b;
		return 1;
	}
	return 0;
}
template <class T>
bool chmin(T &a, const T &b)
{
	if (a > b)
	{
		a = b;
		return 1;
	}
	return 0;
}

ll M = 1000000007;
using tdii=tuple<double,int,int>;
void solve()
{
	
	int n,k;
	cin>>n>>k;
	vector<double>a(n);
	double x=0;
	rep(i,n){
		cin>>a[i];
		x=max(x,a[i]);
	}
	if(k==0){
		cout<<(int)x<<endl;
		return;
	}
	double l=0;
	double ans=1e9;
	while(x-l>0.001){
		int cnt=0;
		double mid=(l+x)/2.0;
		rep(i,n){
			cnt+=(int)(a[i]-1)/mid;
		}
		if(cnt<=k){
			ans=min(ans,mid);
			x=mid;
		}else if(cnt>k){
			l=mid;
		}
	}

	cout<<(int)ceil(ans)<<endl;

	
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	solve();
	return 0;
}


Measured memory_bytes: 4756
import sys
N,K = list(map(int, input().split(' ')))
d = {}
for i in range(N):
    S = str(input())[0]
    if S in d:
        d[S] += 1
    else:
        d[S] = 1
p = list(d.values())
if len(p) < K:
    print(0)
    sys.exit()
c = 0
while(len(p) >= K):
    c += 1
    sq = sorted(p, reverse=True)
    for i in range(K):
        sq[i] = sq[i] - 1
    p = [i for i in sq if i != 0]
print(c)


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define GET_ARRAY_SIZE(a)   (sizeof(a)/sizeof(a[0]))
#define LL long long
int main(){
    LL a,b,ans;
    vector<LL> ary(2);
    cin >> a >> b;
    ary[0] = a;
    ary[1] = b;
    sort(ary.begin(),ary.end());
    if(ary[0] != 1) cout << 1 << endl;
    else if(ary[1] == 3) cout << 2 << endl;
    else if(ary[1] == 2) cout << 3 << endl;

    return 0;
}

Measured memory_bytes: 256
long a[3001],dp[3001][3001];
i,j;
main(n)
{
	for(;~scanf("%d",a+j++););
	for(;i++<*a;)
	{
		for(j=i;j--;)
		{
			dp[j][i]=fmax(a[j+1]-dp[j+1][i],a[i]-dp[j][i-1]);
		}
	}
	printf("%ld",dp[0][*a]);
}

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

int main(){
  string n;
  cin>>n;
  bool a=true;
  for(int i=0;i<3;i++){
    if(n.at(i)==n.at(i+1)) a=false;
  }
  if(a) cout<<"Good"<<endl;
  else cout<<"Bad"<<endl;
}

Measured memory_bytes: 256
a, b, c=map(int, input().split())
if a==b and b==c:
  if a%2==1:
    print(0)
  else:
    print(-1)
else:
  cnt=0
  while(1):
    if a%2==1 or b%2==1 or c%2==1:
      print(cnt)
      break
    cnt+=1
    ha=a/2
    hb=b/2
    hc=c/2
    a=hb+hc
    b=ha+hc
    c=ha+hb

Measured memory_bytes: 3064
package main

import "fmt"

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func main() {
	var l, r int
	fmt.Scan(&l, &r)
	ans := 1000000000
	for i := l; i <= min(r, l+2019); i++ {
		for j := i + 1; j <= min(r, l+2019); j++ {
			x := (i % 2019) * (j % 2019) % 2019
			ans = min(ans, x)
		}
	}
	fmt.Println(ans)
}


Measured memory_bytes: 512
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

d,t,s = na()

print('Yes' if t >= d/s else 'No')

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

// rep(i, 0, sz(v)) cout << v[i] << " \n"[i==sz(v)-1];

////////////////////////////////////////////////////////

const ll max_n = 500050;

// [1, n]
ll bit[max_n + 1], n;

ll sum(ll i){
    ll s = 0;
    while(i > 0){
        s += bit[i];
        i -= i & -i;
    }
    return s;
}

void add(ll i, ll x){
    while(i <= n){
        bit[i] += x;
        i += i & -i;
    }
}

int main() {
    ll q; cin >> n >> q;
    Vl c(n);
    rep(i, 0, n) cin >> c[i];

    Vl pi(n+1, -1);
    vector<Vl> ps(n);
    rep(i, 0, n){
        ll l = pi[c[i]];
        if(l != -1) ps[l].push_back(i);
        pi[c[i]] = i;
    }

    vector<Vp> vq(n);
    rep(qi, 0, q){
        ll l, r; cin >> l >> r;
        l--; r--;
        vq[l].emplace_back(r, qi);
    }

    Vl ans(q);
    for(int l = n-1; l >= 0; l--){
        rep(i, 0, sz(ps[l])) add(ps[l][i], 1);
        rep(j, 0, sz(vq[l])){
            ll r = vq[l][j].first, i = vq[l][j].second;
            ans[i] = (r-l+1) - sum(r);
        }

    }

    rep(i, 0, q) co(ans[i]);

    return 0;
}
 
 


Measured memory_bytes: 70672
//42-00

#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef pair<int,pair<int,int> > DAT;

bool cmp(DAT a,DAT b){
	return a.second.first < b.second.first;
}
int main(){
	int N;
	cin >> N;
	while(N--){
		vector< DAT > gr;
		int n,k;
		cin >> n >> k;
		k--;
		vector<int> data(n);
		rep(i,n)cin >> data[i];
		sort(data.begin(),data.end());
		int ret = data.back()-data[0];
		rep(i,n-1){
			gr.push_back(make_pair(data[i+1]-data[i],make_pair(i,i+1)));
		}
		sort(gr.begin(),gr.end(),greater<DAT>());
		for(int i=0;i<k && i < gr.size() ; i++){
			ret-=gr[i].first;
		}
		cout << ret << endl;
	}
}

Measured memory_bytes: 2716
DIRS = [[0, -1], [1, 0], [0, 1], [-1, 0]]

def inside(n, x, y)
  (x >= 0 && x < n && y >= 0 && y < n)
end

def no_barrier(n, flds, x, y)
  (! inside(n, x, y) || flds[y][x] != '#')
end

d = gets.strip.to_i

need_blank = false

d.times.each do |di|
  n = gets.strip.to_i

  flds = n.times.map{" " * n}

  x = 0
  y = n - 1
  flds[y][x] = '#'
  dir = 0
  fwd = 0
  turn = 0

  while true
    dx, dy = DIRS[dir]
    x0 = x + dx
    y0 = y + dy
    x1 = x0 + dx
    y1 = y0 + dy

    if inside(n, x0, y0) && no_barrier(n, flds, x1, y1)
      x = x0
      y = y0
      flds[y][x] = '#'
      fwd += 1
    elsif fwd < 2 && turn > 0
      break
    else
      dir = (dir + 1) % 4
      fwd = 0
      turn += 1
    end
  end

  puts if need_blank
  need_blank = true

  flds.each{|hl| puts hl}
end

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

void func(int t, vector<long long>& f, vector<long long>& n, vector<int>& v, vector<long long>& y){
  if(t == f.size()){
    long long yy=1;
    for(int k=0; k< f.size(); ++k) for(int l=0; l<v[k]; ++l) yy*=f[k];
    y.push_back(yy);
    return;
  }
  for(int j=0; j<n[t]+1; ++j){
    v[t]=j;
    func(t+1, f, n, v, y);
  }
  return;
}
  

int main(){
  long long N, K, S=0;
  cin >> N >> K;

  long long A[N];
  for(long long i=0; i<N; ++i){
    cin >> A[i];
    S += A[i];
  }

  int n_factor = 0;
  vector<long long> f;
  vector<long long> n;
  long long s = S;
  for(long long i=2; i*i<=s; ++i){
    if(s%i>0) continue;

    ++n_factor;
    f.push_back(i);
    n.push_back(0);
    while(s%i==0){
      n[n_factor-1]++;
      s/=i;
    }
  }

  if(s>1){
    ++n_factor;
    f.push_back(s);
    n.push_back(1);
  }

  vector<int> v;
  for(int i=0; i<n.size(); ++i) v.push_back(0);
  vector<long long> y;
  func(0, f, n, v, y);

  long long m = 0;
  
  for(int iy=0; iy<y.size(); ++iy){
    long long yy = y[iy];

    vector<long long> cost;
    for(int i=0; i<N; ++i){
      cost.push_back(A[i]%yy);
    }
    sort(cost.begin(), cost.end());

    int tgt_down=0, tgt_up=N-1, total_cost=0;
    while(tgt_down<tgt_up){
      if(cost[tgt_down]<yy-cost[tgt_up]){
        total_cost += cost[tgt_down];
        cost[tgt_up] += cost[tgt_down];
        cost[tgt_down] = 0;        
      }else{
        total_cost += yy-cost[tgt_up];
        cost[tgt_down]-=yy-cost[tgt_up];
        cost[tgt_up]=yy;
      }
      if(cost[tgt_up]==yy) tgt_up--;
      if(cost[tgt_down]==0) tgt_down++;
    }

    //cout <<"yy "<< yy << " tc " << total_cost << endl;
    if(total_cost <= K){ m = max(m,yy);}
  }

  cout << m << endl;;
  
  return 0;
}

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

using namespace std;

typedef long long ll;

int main() {
  int n;
  cin >> n;
  int last;
  cin >> last;
  ll res = 0;
  for (int i = 1; i < n; i++) {
    int x;
    cin >> x;
    res += max(0, last - x);
    last = max(last, x);
  }
  cout << res << '\n';
}



Measured memory_bytes: 3584
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(V) V.begin(),V.end()
#define MOD 1000000007

int main() {
	ll N, M;
	cin >> N >> M;
	if (N == 4) {
		cout << "2 3\n";
	}
	else if (N & 1) {
		for (int i = 0;i < M;i++) {
			cout << i + 1 << " " << N - i - 1 << "\n";
		}
	}
	else {
		vector<pair<int, int>> V;
		for (int i = 1;i < N / 2;i++) {
			if (i <= (N / 2 - 1) / 2) {
				V.push_back({ i, N - i });
			}
			else {
				V.push_back({ i,N - 1 - i });
			}
		}
		for (int i = 0;i < M;i++) {
			cout << V[i].first << " " << V[i].second << "\n";
		}
	}
}

Measured memory_bytes: 4064
#include <iostream>
#define rep(i, n)   for(int i = 0; i < (n); i++)
using namespace std;

int main(){
    int n,k,x,y;
    cin >> n >> k >> x >> y;
    int ans = 0;
    rep(i, n){
        if(i < k)   ans+=x;
        else        ans+=y;
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <numeric>
#include <string>
#include <cstdio>
#include <cstring>
#include <queue>
#include <stack>
#include <set>
#include <cmath>
#include <bitset>

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

#define FALSE printf("false\n");
#define TRUE printf("true\n");
#define all(x) (x).begin(),(x).end()
#define print(x) cout<<(x)<<endl
#define rep(i,n) for(int i = 0;i < ((int)(n));++i)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define SUM(vec) accumulate(all(vec),0LL)
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define test(a) cout<<"line:"<<__LINE__<<"["<<(#a)<<": "<<(a)<<"]"<<endl

const int INF = 1e9+7;
const ll INFL = 9*1e18;

ll inline digit(ll num){int tmp = 0;while(num){tmp++;num/=10;}return tmp;}
template<typename T>inline T digitSum(T num){T sum = 0;while(num){sum+=num%10;num/=10;}return sum;} // 各桁の和
template<typename T>inline T gcd(T a,T b){if(b == 0)return a;return gcd(b,a%b);}
template<typename T>inline T lcm(T a, T b){T g = gcd(a,b);return a/g*b;}
template<typename T>inline T power(T a,T b){T tmp=1;rep(i,b){tmp*=a;}return tmp;}


bool isOk(ll key,ll value){
  return key >= value;
}

ll binary_search(vector<ll> a,ll key){
  ll ok = a.size()-1;
  ll ng = 0;

  while(abs(ok - ng) > 1){
    ll mid = (ok + ng) / 2;
    if(isOk(key,a[mid]))ok = mid;
    else ng = mid;
  }
  return ok;
}

bool isPrime(ll n) {
	for (int i = 2; n >= i * i; ++i) {
		if(!(n % i))return false;
	}
  return true;
}
vector<ll> primes(ll n){
  vector<ll> v(1,1);
  for (ll i = 2; n >= i * i; ++i) {
		if(!(n % i)){
      v.pb(i);
	  }
  }
  if(v.size()==1)v.pb(n);
  return v;
}


int main() {
  cin.tie(0); ios::sync_with_stdio(0);
  int n;cin>>n;
  int m = n / 100;
  int tmp = n%100;
  print(tmp <= m*5);
  return 0;
} 

Measured memory_bytes: 256
/*
Author: CNYALI_LK
LANG: C++
PROG: c.cpp
Mail: cnyalilk@vip.qq.com
*/
#include<bits/stdc++.h>
#define debug(...) fprintf(stderr,__VA_ARGS__)
#define DEBUG printf("Passing [%s] in LINE %d\n",__FUNCTION__,__LINE__)
#define Debug debug("Passing [%s] in LINE %d\n",__FUNCTION__,__LINE__)
#define all(x) x.begin(),x.end()
#define x first
#define y second
using namespace std;
const double eps=1e-8;
const double pi=acos(-1.0);
typedef long long ll;
typedef pair<int,int> pii;
template<class T>int chkmin(T &a,T b){return a>b?a=b,1:0;}
template<class T>int chkmax(T &a,T b){return a<b?a=b,1:0;}
template<class T>T sqr(T a){return a*a;}
template<class T>T mmin(T a,T b){return a<b?a:b;}
template<class T>T mmax(T a,T b){return a>b?a:b;}
template<class T>T aabs(T a){return a<0?-a:a;}
template<class T>int dcmp(T a,T b){return a>b;}
template<int *a>int cmp_a(int x,int y){return a[x]<a[y];}
#define min mmin
#define max mmax
#define abs aabs
int read(){
	int s=0;
	int base=0;
	char c;
	while(!isdigit(c=getchar()))if(c=='-')base=1;
	while(isdigit(c)){s=s*10+(c^48);c=getchar();}
	if(base)s=-s;
	return s;
}
int n,k,s;
int beg[2005],to[4005],lst[4005],e,cnt[2005];
void add(int u,int v){to[++e]=v;lst[e]=beg[u];beg[u]=e;}
int dfs(int x,int fa,int dep){
	if(dep>s){cnt[x]=1;return 0;}
	int tot=1;
	cnt[x]=0;
	for(int i=beg[x];i;i=lst[i])if(to[i]!=fa){
		tot+=dfs(to[i],x,dep+1);
		cnt[x]+=cnt[to[i]];
	}
	return tot;
}
int calc(int x){
	int s=dfs(x,0,0),g=0;
	if(k)for(int i=beg[x];i;i=lst[i])chkmax(g,cnt[to[i]]);
	return s+g;
}
int main(){
#ifdef cnyali_lk
	freopen("c.in","r",stdin);
	freopen("c.out","w",stdout);
#endif
	n=read();
	k=read();
	int u,v;
	s=k>>1;
	k=k&1;
	for(int i=1;i<n;++i){
		u=read();v=read();
		add(u,v);
		add(v,u);
	}	
	int ans=0;
	for(int i=1;i<=n;++i)chkmax(ans,calc(i));
	printf("%d\n",n-ans);
	return 0;
}



Measured memory_bytes: 384
#include <algorithm>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>

void readCsv2(int *a, int *b) {
	char *buf = new char[512], *ptok;
	scanf("%511s", buf);
	if ((ptok = strtok(buf, ",")) != NULL) {
		*a = atoi(ptok);
		if ((ptok = strtok(NULL, ",")) != NULL) {
			*b = atoi(ptok);
		} else {
			b = 0;
		}
	} else {
		a = b = 0;
	}
	delete [] buf;
}

int main() {
	using namespace std;
	int w, n, a, b;
	vector<int> l;
	scanf("%d\n%d", &w, &n);
	for (int i = 1; i <= w; ++i) {
		l.push_back(i);
	}
	for (; n > 0; --n) {
		readCsv2(&a, &b);
		swap(l[a - 1], l[b - 1]);
	}
	for (vector<int>::iterator i = l.begin(); i != l.end(); ++i) {
		printf("%d\n", *i);
	}
	return 0;
}

Measured memory_bytes: 0
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<cstring>
#include<cmath>
#include<ctime>
#include<algorithm>
#include<utility>
#include<stack>
#include<queue>
#include<vector>
#include<set>
#include<map>
#define EPS 1e-9
#define PI acos(-1.0)
#define INF 0x3f3f3f3f
#define LL long long
const int MOD = 1E9+7;
const int N = 1000000+5;
const int dx[] = {0,0,-1,1,-1,-1,1,1};
const int dy[] = {-1,1,0,0,-1,1,-1,1};
using namespace std;
struct Edge {
    int to,next,val;
    Edge(){}
    Edge(int to,int next,int val):to(to),next(next),val(val){}
    bool operator < (const Edge& rhs)const{
        return val>rhs.val;
    }
}edge[N*2];
int tot,head[N];
void addEdge(int from,int to,int val) {
    edge[tot].next=head[from];
    edge[tot].to=to;
    edge[tot].val=val;
    head[from]=tot++;
}
bool vis[N];
int dis[N];
int SPFA(int s,int e) {
    memset(vis,false,sizeof(vis));
    memset(dis,INF,sizeof(dis));
    dis[s]=0;

    priority_queue<Edge> Q;
    Q.push(Edge(s,0,0));
    while (!Q.empty()) {
        Edge temp=Q.top();
        Q.pop();
        if(vis[temp.to])
            continue;
        vis[temp.to]=true;

        for(int i=head[temp.to]; i!=-1; i=edge[i].next) {
            if(dis[edge[i].to]>dis[temp.to]+edge[i].val) {
                dis[edge[i].to]=dis[temp.to]+edge[i].val;
                Q.push(Edge(edge[i].to,0,dis[edge[i].to]));
            }
        }
    }
    if(dis[e]!=INF)
        return dis[e]/2;
    return -1;
}
map<int,int> mp[N];
int allPoint;
int getPoint(int x,int y) {
    if (!mp[x][y])
        mp[x][y]=++allPoint;
    return mp[x][y];
}
int main() {
    int n,m;
    scanf("%d%d",&n,&m);
    memset(head,-1,sizeof(head));
    allPoint=n;
    for (int i=1; i<=m; i++) {
        int x,y,w;
        scanf("%d%d%d",&x,&y,&w);

        int newX=getPoint(x,w);
        int newY=getPoint(y,w);

        addEdge(x,newX,1);
        addEdge(newX,x,1);
        addEdge(newX,newY,0);
        addEdge(newY,newX,0);
        addEdge(y,newY,1);
        addEdge(newY,y,1);
    }
    int res=SPFA(1,n);
    printf("%d\n",res);
    return 0;
}

Measured memory_bytes: 93044
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <sstream>
#include <algorithm>
#include <deque>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <list>
#include <cstdio>
#include <iostream>
#include <cmath>
#include <climits>
#include <bitset>
#include <functional>
#include <numeric>
#include <ctime>
#include <cassert>
#include <cstring>
#include <fstream>

using namespace std;

int main() {
    int n;
    cin >> n;
    map<int, int> cnt1, cnt2;
    for (int i = 0; i < n; i++) {
        int v;
        cin >> v;
        if (i % 2 == 0) {
            cnt1[v]++;
        }
        else {
            cnt2[v]++;
        }
    }

    if (n == 2) {
        cout << (cnt1[0] == cnt2[0] ? 1 : 0) << endl;
        return 0;
    }
    vector<pair<int, int>> num1, num2;
    int ans = 0;

    for (auto t : cnt1) {
        num1.push_back(make_pair(t.second, t.first));
    }
    for (auto t : cnt2) {
        num2.push_back(make_pair(t.second, t.first));
    }
    num1.push_back(make_pair(0, 0));
    num2.push_back(make_pair(0, 0));
    sort(num1.begin(), num1.end(), greater<pair<int,int>>());
    sort(num2.begin(), num2.end(), greater<pair<int,int>>());

    if (num1[0].second == num2[0].second) {
        ans = min(n - num1[0].first - num2[1].first, n - num1[1].first - num2[0].first);
    }
    else {
        ans = n - num1[0].first - num2[0].first;
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 6136
#include<bits/stdc++.h>
using namespace std;
 
#define ll long long
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pi pair<ll,int> 
#define pii pair<int,ll>
 
ll mod = 1e9+7;
ll INF = 1e17;
/*ll gcd(ll a,ll b)
{
    if(a==0)
    return(b);
    return(gcd(b%a,a));
}*/
int main()
{
    IOS
    string s;
    cin>>s;
    ll flag=0,flag1=0;
    for(ll i=0;i<3;i++)
    {
        if(s[i]=='A')
        flag=1;
        if(s[i]=='B')
        flag1=1;
    }
    if(flag&&flag1)
    cout<<"Yes";
    else
    cout<<"No";
    return(0);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rrep(i,n) for (int i = (int)(n)-1; i>=0; --i)
#define For(i,a,b) for(auto i=(a);i<=(b);++i)
#define rFor(i,a,b) for(auto i=(b);i>=(a);--i)
#define call(var) cerr<<#var<<"="<<var<<"\n";
#define dup(x,y) (((x)+(y)-1)/(y))
#define all(x) (x).begin(),(x).end()
using ll=long long;
using vi = vector<int>;
using vl = vector<ll>;
using vb = vector<bool>;
using Graph = vector<vi>;
using P = pair<int,int>;
const int MOD=(int)1e9+7;
const int INF=(int)1e9;
const ll LINF=(ll)1e18;
const double pi = acos(-1);
template<class t,class u> inline bool chmax(t&a,u b){if(a<b){a=b;return true;}return false;}
template<class t,class u> inline bool chmin(t&a,u b){if(b<a){a=b;return true;}return false;}
template<class T> istream& operator>>(istream& is, vector<T>& a){rep(i,a.size()) is >> a[i]; return is;}
template<class T> ostream& operator<<(ostream& os, vector<T>& a){rep(i,a.size()) os << a[i] << " "; return os;}
template<class T, class U> istream& operator>>(istream& is, pair<T,U>& p){is >> p.first >> p.second; return is;}
template<class T, class U> ostream& operator<<(ostream& os, const pair<T,U>& p){os << "("<< p.first << "," << p.second << ")"; return os;}
template<class T, class U> ostream& operator<<(ostream& os, const map<T,U>& mp){for(auto& t : mp) os << t.first << " " << t.second << "\n"; return os;}

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

Measured memory_bytes: 3916