akhauriyash/Code-Regression huggingface dataset:
#pragma region
#pragma GCC target("avx2")
#pragma GCC optimize("03")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std; typedef long double ld; typedef long long ll;
typedef unsigned long long ull;
#define endl "\n"
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define PII pair<int, int>
#define PLL pair<ll, ll>
#define ALL(x) (x).begin(), (x).end()
constexpr int INF=1<<30; constexpr ll LINF=1LL<<60; constexpr ll mod=1e9+7; constexpr int NIL = -1;
template<class T>inline bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>inline bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
#pragma endregion
//-------------------
constexpr int MX = 2e5+5;
ll a[MX];

int main(){
    cin.tie(0); ios::sync_with_stdio(false); //cout << fixed << setprecision(15);
    int n,k; cin >> n >> k;
    rep(i,0,n) cin >> a[i];

    rep(i,k,n) {
        if(a[i-k] < a[i]) {
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 5204
//package com.atcoder.contest171.b;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) {
        FastScanner fs = new FastScanner();
        int n = fs.nextInt();
        int k = fs.nextInt();
        int[] arr = fs.readArray(n);
        Arrays.sort(arr);
        int ans = 0;
        int i = 0;
        while(k-- != 0) {
            ans += arr[i++];
        }
        System.out.println(ans);
    }

    static class FastScanner {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer("");

        String next() {
            while (!st.hasMoreTokens())
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] readArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++) a[i] = nextInt();
            return a;
        }

        long nextLong() {
            return Long.parseLong(next());
        }
    }
}


Measured memory_bytes: 33132
import java.util.*;
public class Main {
	
	private void doit(){
		Scanner sc = new Scanner(System.in);
		int [] count = new int[101];
		while(sc.hasNext()){
			count[sc.nextInt()]++;
		}
		int max = 0;
		for(int i=0; i < 101; i++){
			max = Math.max(count[i], max);
		}
		for(int i=0; i < 101; i++){
			if(count[i] == max){
				System.out.println(i);
			}
		}
	}

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

Measured memory_bytes: 12000
n = int(input())
p = [int(x) for x in input().split()]

ans = 0
cnt = 0
'''
index = 0
while index <= n-1:
    if p[index] == index+1:
        if p[index+1] != index+2:
            index += 1
        else:
            index += 2
        ans += 1
    else:
        index += 1
'''

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

if p[-1] == n:
    cnt += 1

print(cnt)

Measured memory_bytes: 20156
import java.util.*;
import java.util.function.*;
import java.lang.*;
import java.io.*;


public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        
        System.out.println(a + a*a + a*a*a);
        
    }
}


Measured memory_bytes: 35716
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;(i)--)
#define rrep1(i,n) for(int i=((int)(n));i>0;(i)--)
#define sz(c) ((int)(c).size())
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define fi first
#define se second

using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> P;
typedef pair<int, pair<int, int> > PP;
//const int MAX=;

string S,T;
void input(){
	cin>>S>>T;
	int ans=0;
	rep(i,3){
		if(S[i]==T[i])ans++;
	}
	cout<<ans<<endl;
}

void solve(){

}

void output(){
  
}

int main(){
  input();
  solve();
  output();
}

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

#define Max 10000

int isprime(int);

int main(){

  int i,j,x,count=0,N[Max];

  
  scanf("%d",&x);

  for(i=0;i<x;i++){
    scanf("%d",&N[i]);
    j = isprime(N[i]);
    if(j==1) count++;
  }
  
  printf("%d\n",count);
  return 0;
  
}

int isprime(int x)
{
  int i;
  
  if(x==2)
    {
      return 1;
    }
  
  if(x<2 || x%2==0) {
    return 0;
  }

  i=3;
  while(i<=sqrt(x)){
    if(x%i==0) {
      return 0;
    }
    i = i+2;
  }
  return 1;
}

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

int N, M;
int P[100000], Y[100000];
vector<int> yd[1000001];

int main()
{
  cin >> N >> M;
  for (int i = 0; i < M; i++)
  {
    cin >> P[i] >> Y[i];
    yd[P[i]].push_back(Y[i]);
  }
  for (int i = 0; i < N; i++)
    sort(yd[i + 1].begin(), yd[i + 1].end());
  for (int i = 0; i < M; i++)
  {
    printf("%06d", P[i]);
    printf("%06d\n", int(lower_bound(yd[P[i]].begin(), yd[P[i]].end(), Y[i]) - yd[P[i]].begin()) + 1);
  }
  return 0;
}


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

int main(){
  int k,n;
  cin >> k >> n;
  vector<int> a(n);
  vector<int> b(n);
  for(int i=0;i<n;++i){
    cin >> a[i];
    if(a[i]>=k){
      a[i]=(a[i]/k)*k;
    }
  }
  sort(a.begin(),a.end());
  int ans=a[n-1]-a[0];
  int start=0;
  for(int i=0;i<n;++i){
    if(i==0){
      ans=abs(a[n-1]-a[0]);
      start=a[0];
    }else{
      ans=min(ans,k-a[i]+start);
      start=a[i];
    }
  }
  cout << ans << endl;
  return 0;

}


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

int main() {
  int A,B,C,K;
  cin >> A >> B >> C >> K ;
  if(K<=A){
    cout << K <<endl;
  }
  else if(A < K && K <= A+B){
    cout << A << endl;
  }
  else if(A+B < K && K <=A+B+C){
    cout << A*2-K+B << endl;
  }
}






Measured memory_bytes: 3628
n,w=map(int,input().split())
wv=[list(map(int,input().split())) for i in range(n)]
wv.sort(key=lambda x:-x[1])
wv.sort(key=lambda x:x[0])
#print(wv)
w0=wv[0][0]
x=[[0],[0],[0],[0]]
for i in range(n):
    if wv[i][0]==w0:
        k=wv[i][1]+x[0][-1]
        l=len(x[0])
        if l*w0<=w:x[0].append(k)
    elif wv[i][0]==w0+1:
        k=wv[i][1]+x[1][-1]
        l=len(x[1])
        if l*(w0+1)<=w:x[1].append(k)
    elif wv[i][0]==w0+2:
        k=wv[i][1]+x[2][-1]
        l=len(x[2])
        if l*(w0+2)<=w:x[2].append(k)
    else:
        k=wv[i][1]+x[3][-1]
        l=len(x[3])
        if l*(w0+3)<=w:x[3].append(k)
#print(x)
ma=0
for i in range(len(x[3])):
    for j in range(len(x[2])):
        for k in range(len(x[1])):
            for l in range(len(x[0])):
                if i*(w0+3)+j*(w0+2)+k*(w0+1)+l*w0<=w:
                    ma_sub=x[3][i]+x[2][j]+x[1][k]+x[0][l]
                    ma=max(ma,ma_sub)
                else:
                    break
print(ma)


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

// 型定義
typedef long long ll;
typedef pair<ll, ll> P;

// forループ
#define REP(i,n) for(ll i=0; i<(ll)(n); ++i)

// 定数宣言
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

// グラフ表現
using Graph = vector<vector<int>>;

// グラフの辺表現
using Edge = map<pair<int,int>,int>;

// n次元配列の初期化。第２引数の型のサイズごとに初期化していく。
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

// 最大公約数
ll gcd(ll a,ll b){
   if (a%b == 0) return(b);
   else return(gcd(b, a%b));
}

// 最小公倍数
ll lcm(ll a, ll b){
    return a*b/gcd(a, b);
}

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

int main()
{
    cout << fixed << setprecision(15);
    ll H, W;
    cin >> H >> W;

    vector<vector<char>> A(H, vector<char>(W));

    // キューを準備
    queue<P> que;

    vector<vector<ll>> v(H, vector<ll>(W, -1));
    REP(i, H){
        REP(j, W){
            cin >> A[i][j];
            if(A[i][j] == '#'){
                v[i][j] = 0;
                que.push(P(i, j));
            }
        }
    }

    while(true) {
        //　もしも探索地点がゴールならば現在の歩数を探索終了
        if(que.empty()) {
            // cout << "empty" << endl;
            // return 0;
            break;
        }
        // キューの中身を取り出す
        P p = que.front(); que.pop();
        int x = p.first;
        int y = p.second;
        int s = v[x][y];

        // 4方向へ繰り返す
        REP(i, 4) {
            int nx = x+dx[i];
            int ny = y+dy[i];
            // 移動すると範囲外になったり、#だったり、探索済みだったら終了する
            if(nx < 0 || nx >= H || ny < 0 || ny >= W
                || v[nx][ny] != -1) continue;
            // 未探索だったら、キューに入れて現在の距離を記録
            que.push(P(nx, ny));
            v[nx][ny] = s+1;
        }
    }

    ll ans = 0;
    REP(i, H){
        REP(j, W){
            ans = max(ans, v[i][j]);
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 25524
def num2alpha(num):
    if num<=26:
        return chr(64+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(90)
    else:
        return num2alpha(num//26)+chr(64+num%26)

from decimal import *
N=(input())
d=Decimal(N)
aaa="0abcdefghijklmnopqrstuvwxyz"
# 1 000 000 000 000 001

print(num2alpha(d).lower())

Measured memory_bytes: 10012
#include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <bitset>
#include <ctime>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <sstream>
#include <fstream>

using namespace std;
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--)
#define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--)
#define DEBUG(C) cerr << #C << " = " << C << endl;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
template<typename T> using VT = vector<T>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) rbegin((a)), rend((a))
#define SORT(a) sort(ALL((a)))
#define RSORT(a) sort(RALL((a)))
#define REVERSE(a) reverse(ALL((a)))
#define MP make_pair
#define FORE(a, b) for (auto &&a : (b))
#define FIND(s, e) ((s).find(e) != (s).end())
#define EB emplace_back
template<typename T> inline bool chmax(T &a, T b){if (a < b){a = b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if (a > b){a = b;return true;}return false;}

const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;

const int MAX = 111;
int h, w;
string a[MAX];
int cnt[26];
bool vis[MAX][MAX];
int need[MAX * MAX];

bool inside(int nh, int nw) {
    return 0 <= nh && nh < h && 0 <= nw && nw < w;
}

bool inside(int nn, bool f) {
    if (f) return 0 <= nn && nn < h;
    else return 0 <= nn && nn < w;
}

int dfs(int nowH, int nowW) {
    //cerr << "now : " << nowH << " " << nowW << endl << endl;;
    if (vis[nowH][nowW]) return 0;
    vis[nowH][nowW] = true;
    int revH = nowH - (h - 1);
    if (!inside(revH, true)) revH = h - 1 - nowH;
    int revW = nowW - (w - 1);
    if (!inside(revW, false)) revW = w - 1 - nowW;
    //cerr <<"rev : " << revH << " " << revW << endl;
    assert(inside(revH, revW));
    return dfs(nowH, revW) + dfs(revH, nowW) + 1;
}

int main(void) {
    cin >> h >> w;
    REP(i, h) {
        cin >> a[i];
        REP(j, w) cnt[a[i][j] - 'a']++;
    }
    REP(i, h) {
        REP(j, w) {
            if (!vis[i][j]) {
                need[dfs(i, j)]++;
            }
        }
    }
    //REP(i, MAX * MAX) if (need[i]) cerr << i << " : " << need[i] << endl;
    RREP(i, MAX * MAX) {
        sort(cnt, cnt + 26);
        RREP(j, 26) {
            while (cnt[j] >= i && need[i]) {
                cnt[j] -= i;
                need[i]--;
            }
        }
        if (need[i] != 0) {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
}


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

int main(){
  int64_t n;
  string alf,ans;
  alf = "abcdefghijklmnopqrstuvwxyz";
  cin >> n;
  while(n>0){
    ans = alf.at((n-1)%26) + ans;
    n = (n-1)/26;
  }
  cout << ans << endl;
}

Measured memory_bytes: 3632
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<iterator>//集合演算(積集合,和集合,差集合など)
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//イテレータあるけど順序保持しないmap
#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列

using namespace std;
typedef long long ll;

//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
//xにはvectorなどのコンテナ
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値を求める
#define MIN(x) *min_element(ALL(x)) //最小値を求める
//定数
#define INF 9000000000000000000 //9e18:極めて大きい値
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
#define LOGMAXR 18 // floor(log2(10^5)) + 1: 配列の最大のrangeのlog
//略記
//#define PB push_back //vectorヘの挿入
//#define MP make_pair //pairのコンストラクタ
//#define F first //pairの一つ目の要素
//#define S second //pairの二つ目の要素

int main(){
  ll A;
  double B;
  cin >> A >> B;
  ll C = floor(B * 100 + 0.5);
  cout << (A * C / 100) << endl;
  return 0;
}


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

flag = True
Place = [-1] * n
for i in range(m):
    s, c = map(int, input().split())
    #指定桁を決定
    if Place[s-1] == c or Place[s-1]== -1: 
        Place[s-1] = c
    else:   #異なる数字が同一の桁で指定されている
        flag = False

ans = 0
for i in range(n):
    if n == 1 and Place[i] <= 0:   #1桁で未指定or最上位桁0
        Place[i] = 0
    else:
        if i == 0:  #最上位桁
            if Place[i] == 0:
                flag = False
            elif Place[i] == -1:    #未指定
                
                Place[i] = 1
            else:
                pass
        else:
            if Place[i] == -1:  #未指定
                Place[i] = 0
            else:
                pass
    ans += Place[i] * (10 ** (n-1-i))

if flag == True:
    print(ans)
else:
    print(-1)


        



Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
int main(){
	int a,b;
	cin >> a >> b;
	int c = a - b;
	int d = a + b;
	int e = a * b;
	int f = max(c,d);
	f = max(f,e);
	cout << f << endl;
	return 0;
} 

Measured memory_bytes: 256
import java.io.PrintWriter;
        import java.util.*;
        import java.io.*;
        import java.util.stream.IntStream;
        import java.util.stream.Stream;

public class Main {

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

    final IO io = new IO();
    final PrintWriter out = new PrintWriter(System.out);

    void stream() {
        solve();
        out.flush();
    }

    void solve() {
        int A = io.Int();
        int B = io.Int();
        System.out.println(Math.max(0, A - 2 * B));
    }
}

class IO {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1 << 12];
    private int ptr = 0, buffLen = 0;

    private boolean hasNextByte() {
        if (ptr < buffLen) return true;
        ptr = 0;
        try {
            buffLen = in.read(buffer);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return buffLen > 0;
    }

    private int readByte() {
        return hasNextByte() ? buffer[ptr++] : -1;
    }

    private boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    } //ASCII

    private void skipUnprintable() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;
    }

    private boolean hasNext() {
        skipUnprintable();
        return hasNextByte();
    }

    private String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    public String String() {
        return next();
    }

    public char Char() {
        return next().charAt(0);
    }

    public int Int() {
        return Integer.parseInt(next());
    }

    public long Long() {
        return Long.parseLong(next());
    }

    public double Double() {
        return Double.parseDouble(next());
    }

    public String[] StringArr(final int n) {
        final String[] arr = new String[n];
        for (int i = 0; i < n; ++i) arr[i] = String();
        return arr;
    }

    public char[] CharArr(final int n) {
        final char[] arr = new char[n];
        for (int i = 0; i < n; ++i) arr[i] = Char();
        return arr;
    }

    public int[] IntArr(final int n) {
        final int[] arr = new int[n];
        for (int i = 0; i < n; ++i) arr[i] = Int();
        return arr;
    }

    public long[] LongArr(final int n) {
        final long[] arr = new long[n];
        for (int i = 0; i < n; ++i) arr[i] = Long();
        return arr;
    }

    public double[] DoubleArr(final int n) {
        final double[] arr = new double[n];
        for (int i = 0; i < n; ++i) arr[i] = Double();
        return arr;
    }
}

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

int main(){
	int n, l; cin >> n >> l;
	int a[n]; cin >> a[0];
	for(int i = 1; i < n; ++i){
		cin >> a[i];
		if(a[i - 1] + a[i] >= l){
			cout << "Possible\n";
			for(int j = 1; j < i; ++j) cout << j << endl;
			for(int j = n - 1; j > i; --j) cout << j << endl;
			cout << i << endl;
			return 0;
		}
	}
	cout << "Impossible\n";
	return 0;
}

Measured memory_bytes: 1152
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = (n); i >= 0; i--)
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define ALL(obj) begin(obj), end(obj)
using namespace std;
using ll = long long;
using ull = unsigned long long;

const int INF = 2100100100;
const int MOD = 1e9 + 7;

// 多次元 vector 生成
template <class T> vector<T> make_vec(size_t a) { return vector<T>(a); }
template <class T, class... Ts> auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
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;
}
using ld = long double;
using P = std::complex<ld>;
using G = std::vector<P>;
const ld pi = std::acos(-1);
const ld eps = 1e-10;
const ld inf = 1e12;

ld cross(const P &a, const P &b) { return a.real() * b.imag() - a.imag() * b.real(); }
ld dot(const P &a, const P &b) { return a.real() * b.real() + a.imag() * b.imag(); }
template <class iter> std::pair<P, ld> min_ball(iter left, iter right, int seed = 1333) {
    const int n = right - left;

    assert(n >= 1);
    if (n == 1) {
        return {*left, ld(0)};
    }

    std::mt19937 mt(seed);
    std::shuffle(left, right, mt);
    // std::random_shuffle(left, right); // simple but deprecated

    iter ps = left;
    using circle = std::pair<P, ld>;

    auto make_circle_3 = [](const P &a, const P &b, const P &c) -> circle {
        ld A = std::norm(b - c), B = std::norm(c - a), C = std::norm(a - b), S = cross(b - a, c - a);
        P p = (A * (B + C - A) * a + B * (C + A - B) * b + C * (A + B - C) * c) / (4 * S * S);
        ld r2 = std::norm(p - a);
        return {p, r2};
    };

    auto make_circle_2 = [](const P &a, const P &b) -> circle {
        P c = (a + b) / (ld)2;
        ld r2 = std::norm(a - c);
        return {c, r2};
    };

    auto in_circle = [](const P &a, const circle &c) -> bool { return std::norm(a - c.first) <= c.second + eps; };

    circle c = make_circle_2(ps[0], ps[1]);

    // MiniDisc
    for (int i = 2; i < n; ++i) {
        if (!in_circle(ps[i], c)) {
            // MiniDiscWithPoint
            c = make_circle_2(ps[0], ps[i]);
            for (int j = 1; j < i; ++j) {
                if (!in_circle(ps[j], c)) {
                    // MiniDiscWith2Points
                    c = make_circle_2(ps[i], ps[j]);
                    for (int k = 0; k < j; ++k) {
                        if (!in_circle(ps[k], c)) {
                            c = make_circle_3(ps[i], ps[j], ps[k]);
                        }
                    }
                }
            }
        }
    }
    return c;
}

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

    int N;
    cin >> N;
    vector<P> xy(N);
    REP(i, N) {
        ld x, y;
        cin >> x >> y;
        P tmp(x, y);
        xy[i] = tmp;
    }
    auto ans = min_ball(xy.begin(), xy.end());
    cout << setprecision(10) << sqrt(ans.second) << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
long long n,i,j,k,f[100005];
string ans;
long long s(long long x)
{
	long long sum=0;
	while (x)
	{
		sum+=(x%10);
		x/=10;
	}
	return sum;
}
long long len(long long x)
{
	long long sum=0;
	while (x)
	{
		sum++;
		x/=10;
	}
	//if (sum>=12) sum--;
	return sum;
}
int main()
{
	cin>>n;
	int m=0,m2;
	for (i=1;i<=1e15;i*=10)
	{
		f[++m]=i-1;
	}
	m2=m;
	for (i=1;i<=m;i++)
	{
		long long x=1;
		while (x<f[i]) x*=10;
		for (j=1;j<=1000&&j*x+f[i]<=1e15;j++)
		{
			f[++m2]=j*x+f[i];
		}
	}
	sort(f+1,f+m2+1);
	m2=unique(f+1,f+m2+1)-f-1;
	for (i=1;i<=m2;i++)
	{
		for (j=i+1;j<=m2;j++)
		{
			if (f[i]*s(f[j])>f[j]*s(f[i])) f[i]=0;
			if (f[i]==0) break;
		}
	}
	for (i=2;i<=m2;i++) if (f[i]&&(n--)>0) cout<<f[i]<<endl;
	return 0;
}


Measured memory_bytes: 384
#include <float.h>
#include <inttypes.h>
#include <limits.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <math.h>
#ifdef __cplusplus
#include <bits/stdc++.h>
#endif

#define getchar getchar
#define putchar putchar
int32_t nextint(void){ char c=getchar(); while(c!='-'&&(c<'0'||'9'<c)) c=getchar(); bool s=false; if(c=='-'){s=true;c=getchar();} uint32_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar(); } return s?-x:x; }
int64_t nextlong(void){ char c=getchar(); while(c!='-'&&(c<'0'||'9'<c)) c=getchar(); int s=0; if(c=='-'){s=1;c=getchar();} uint64_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar(); } return s?-x:x; }
uint32_t nextstr(char *s){ char c=getchar(); while(c==' '||c=='\n') c=getchar(); uint32_t len=0; while(c!=' '&&c!='\n'){ *s++=c; len++; c=getchar(); } *s='\0'; return len; }

int a[100001];
int main(void){
	int n=nextint();
	long sum=0;
	for(int i=0; i<n; i++){
		int A=nextint();
		sum+=A;
		a[A]++;
	}
	int q=nextint();
	while(q-->0){
		int B=nextint();
		int C=nextint();
		int k=a[B];
		sum += (long)(C-B)*k;
		printf("%ld\n", sum);
		a[C]+=a[B];
		a[B]=0;
	}
}


Measured memory_bytes: 1920
#include <string>
#include <vector>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<functional>
#include<list>
#include<deque>
#include<bitset>
#include<set>
#include<map>
#include<unordered_map>
#include<unordered_set>
#include<cstring>
#include<sstream>
#include<complex>
#include<iomanip>
#include<numeric>
#include<cassert>
#define X first
#define Y second
#define pb push_back
#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#define reps(X,S,Y) for (int (X) = S;(X) < (Y);++(X))
#define rrep(X,Y) for (int (X) = (Y)-1;(X) >=0;--(X))
#define rreps(X,S,Y) for (int (X) = (Y)-1;(X) >= (S);--(X))
#define repe(X,Y) for ((X) = 0;(X) < (Y);++(X))
#define peat(X,Y) for (;(X) < (Y);++(X))
#define all(X) (X).begin(),(X).end()
#define rall(X) (X).rbegin(),(X).rend()
#define eb emplace_back
#define UNIQUE(X) (X).erase(unique(all(X)),(X).end())
#define Endl endl

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
template<class T> using vv=vector<vector<T>>;
template<class T> ostream& operator<<(ostream &os, const vector<T> &t) {
os<<"{"; rep(i,t.size()) {os<<t[i]<<",";} os<<"}"<<endl; return os;}
template<class S, class T> ostream& operator<<(ostream &os, const pair<S,T> &t) { return os<<"("<<t.first<<","<<t.second<<")";}
template<class T> inline bool MX(T &l,const T &r){return l<r?l=r,1:0;}
template<class T> inline bool MN(T &l,const T &r){return l>r?l=r,1:0;}
#define out(args...){vector<string> a_r_g_s=s_p_l_i_t(#args, ','); e_r_r(a_r_g_s.begin(), args); }
vector<string> s_p_l_i_t(const string &s, char c){vector<string> v;int d=0,f=0;string t;for(char c:s){if(!d&&c==',')v.pb(t),t="";else t+=c;if(c=='\"'||c=='\'')f^=1;if(!f&&c=='(')++d;if(!f&&c==')')--d;}v.pb(t);return move(v);}
void e_r_r(vector<string>::iterator it) {}
template<typename T, typename... Args> void e_r_r(vector<string>::iterator it, T a, Args... args){ if(*it==" 1"||*it=="1") cerr<<endl; else cerr << it -> substr((*it)[0] == ' ', it -> length()) << " = " << a << ", "; e_r_r(++it, args...);}
const ll MOD=1e9+7;

int main(){
  ios_base::sync_with_stdio(false);
  cout<<fixed<<setprecision(0);
	ll a,b,c,d,n;
	cin>>a>>b>>c>>d>>n;
	MN(b,2*a);
	MN(c,2*b);
	MN(d,2*c);
	cout<< n/2*d + (n%2)*c <<endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
template<typename T>
void fin(T a){
  cout<<a<<endl;
  exit(0);
}
template<typename T>
void chmin(T &a,T b){
  if(a>b)a=b;
}
template<typename T>
void chmax(T &a,T b){
  if(a<b)a=b;
}
using ld=long double;
const int INF=1e9;

signed main(){
  int h,w,K;cin>>h>>w>>K;
  vector<string> s(h);
  for(int i=0;i<h;i++)cin>>s[i];
  int ans=INF;
  for(int a=0;a<(1<<(h-1));a++){
    int res=0;
    vector<int> v;
    for(int j=0;j<h-1;j++)if((a>>j)&1)v.push_back(j);res+=v.size();
    int n=v.size()+1;
    vector<int> cnt(n,0),tmp(n,0);
    for(int k=0;k<w;k++){
      int now=0;
      for(int j=0;j<h;j++){
        tmp[now]+=s[j][k]=='1';
        if(now<v.size()&&v[now]==j)now++;
      }
      for(int j=0;j<n;j++)if(tmp[j]>K)k=res=INF;
      bool f=false;
      for(int j=0;j<n;j++)if(cnt[j]+tmp[j]>K)f=1;
      if(f){
        res++;
        for(int j=0;j<n;j++)cnt[j]=tmp[j];
      }
      else{
        for(int j=0;j<n;j++)cnt[j]+=tmp[j];
      }
      for(int j=0;j<n;j++)tmp[j]=0;
    }
    chmin(ans,res);
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int T;scanf("%d",&T);
	long long A,B,C,D;
	while(T--)
	{
		scanf("%lld%lld%lld%lld",&A,&B,&C,&D);
		if(A<B||D<B||C<A%B||C+__gcd(B,D)<B)puts("No");else puts("Yes");
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <numeric>
#include <cstdint>
#include <cmath>
using namespace std;

void solve() {
	int n;
	cin >> n;
	vector<int> p(n), q(n), a(n);
	for (int i = 0; i < n; ++i) cin >> p[i];
	for (int i = 0; i < n; ++i) cin >> q[i];
	for (int i = 0; i < n; ++i) a[i] = i + 1;
	int pc = 0, qc = 0;
	for (int i = 0; next_permutation(a.begin(), a.end()); ++i) {
		if (p == a) pc = i + 1;
		if (q == a) qc = i + 1;
		if (pc != 0 && qc != 0) break;
	}
	cout << abs(pc - qc) << endl;
}

int main() {
	solve();
	return 0;
}


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

int main()
{
    int n;
    cin>>n;
    ll arr[n];
    for(int i=0;i<n;i++){
        cin>>arr[i];
    }
    ll ans=0;
    int i=0;
    for(i=0;i<n-1;i++){
        if(arr[i]>arr[i+1]){
            ans=ans+arr[i]-arr[i+1];
            arr[i+1]=arr[i];
        }
    }
    cout<<ans;
    return 0;   
}

Measured memory_bytes: 5160
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(long long i=0;i<x;i++)
#define repn(i,x) for(long long i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
vector<pair<string,P> >vec;

map<ll, bool> dpx[8001], dpy[8001];

void solve(string s, long long x, long long y){
	ll state = 0;
	dpx[0].insert(make_pair(0, true));
	dpy[0].insert(make_pair(0, true));
	ll c = 0, idx = 0, idy = 0;
	for (ll i = 0; i < s.length(); i++) {
		if (s[i] == 'F') c++;
		if ((s[i] == 'T' || i == s.length()-1) && state == 0) {
			dpx[idx+1].insert(make_pair(c, true));
			state = 1;
			c = 0;
			idx++;
		} else if ((s[i] == 'T' || i == s.length()-1) && state == 1) {
			for (auto y : dpy[idy]){
				// cout << state << " " << y.first << " " << y.second << " " << c << endl;
				dpy[idy+1].insert(make_pair(y.first-c, true));
				dpy[idy+1].insert(make_pair(y.first+c, true));
			}
			state = 2;
			c = 0;
			idy++;
		} else if ((s[i] == 'T' || i == s.length()-1) && state == 2) {
			for (auto x : dpx[idx]){
				// cout << state << " " << x.first << " " << x.second << " " << c << endl;
				dpx[idx+1].insert(make_pair(x.first-c, true));
				dpx[idx+1].insert(make_pair(x.first+c, true));
			}
			state = 1;
			c = 0;
			idx++;
		}
	}
	// repn(i,idx) {
	// 	for (auto x : dpx[i]){
	// 		cout << i << " " << x.first << " " << x.second << " " << dpx[i][x.first] << endl;
	// 	}
	// }
	// cout << endl;
	// repn(i,idy) {
	// 	for (auto x : dpy[i]){
	// 		cout << i << " " << x.first << " " << x.second << endl;
	// 	}
	// }
	// cout << dpx[idx][x] << " " << dpy[idy][y] << " " << (dpx[idx][x] && dpy[idy][y]) << endl;
	if (dpx[idx][x] && dpy[idy][y]) cout << "Yes" << endl; else cout << "No" << endl;
}

int main(){	
	string s;
	long long x;
	long long y;
	cin >> s;
	scanf("%lld",&x);
	scanf("%lld",&y);
	solve(s, x, y);
	return 0;
}



Measured memory_bytes: 310016
#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<vector>
#include<cmath>
#include<ctime>
#include<queue>
#include<map>
#define LL long long
#define il inline
#define re register
#define db double
#define eps (1e-5)

using namespace std;
const int N=100000+10;
il LL rd()
{
    re LL x=0,w=1;re char ch;
    while(ch<'0'||ch>'9') {if(ch=='-') w=-1;ch=getchar();}
    while(ch>='0'&&ch<='9') {x=(x<<3)+(x<<1)+(ch^48);ch=getchar();}
    return x*w;
}
int n,ans;
char cc[N];

int main()
{
  scanf("%s",cc+1);
  n=strlen(cc+1);
  for(int i=1;i<=(n+1)>>1;i++) ans-=(cc[i]=='p');
  for(int i=(n+1)/2+1;i<=n;i++) ans+=(cc[i]=='g');
  printf("%d\n",ans);
  return 0;
}

Measured memory_bytes: 384
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <float.h>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits>
#include <locale>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <wchar.h>
#include <wctype.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cerrno>
#include <clocale>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <limits>
#include <map>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <istream>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <utility>
#include <vector>
#include <cwchar>
#include <cwctype>
#include <complex.h>
#include <fenv.h>
using namespace std;
int main()
{
	ios_base::sync_with_stdio(false);
	int n,m,i,j,k,f;
	cin>>n>>m;
	string a[n+1],b[m+1];
	for(i=0;i<n;i++) cin>>a[i];
	for(i=0;i<m;i++) cin>>b[i];
	for(i=0;i<n-m+1;i++)
	{
		for(j=0;j<n-m+1;j++)
		{
			bool ok=1;
			for(k=i;k<i+m;k++) for(f=j;f<j+m;f++) if(a[k][f]!=b[k-i][f-j]) ok=0;
			if(ok){
				cout<<"Yes"<<endl;
				return 0;
			}
		}
	}
	cout<<"No"<<endl;
	return 0;
}


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

using namespace std;

//typedef
//------------------------------------------
template<class T> using V = vector<T>;
using VI = V<int>;
using VVI = V<VI>;
using VS = V<string>;
using LL = long long;
using ULL = unsigned long long;
using VLL = V<LL>;
using VVLL = V<VLL>;
template<class T, class U> using P = pair<T, U>;
using PII = P<int, int>;
using PLL = P<LL, LL>;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define MT make_tuple
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define FILL(a, x) memset(a, x, sizeof(a))

//repetition
//------------------------------------------
#define FOR(i,s,n) for(int i=s;i<(int)n;++i)
#define REP(i,n) FOR(i,0,n)

template<class T> inline T updmax(T &a, T b){return a = max(a,b);}
template<class T> inline T updmin(T &a, T b){return a = min(a,b);}

const int N = 100005;
int dist[N][3];

int main(){
    int n,m;
    scanf("%d%d", &n, &m);
    VVI g(n);
    REP(i,m){
        int u,v;
        scanf("%d%d", &u, &v);
        u--, v--;
        g[u].PB(v);
    }
    memset(dist, 0x7f, sizeof(dist));
    int s, t;
    scanf("%d%d", &s, &t);
    s--, t--;
    dist[s][0] = 0;
    using state = tuple<int, int, int>;
    queue<state> q;
    q.push(MT(0, s, 0));
    while(!q.empty()){
        int d, u, r;
        tie(d,u,r) = q.front();
        q.pop();
        for(auto v: g[u]){
            if(dist[v][(r+1)%3] != 0x7f7f7f7f)continue;
            dist[v][(r+1)%3] = d+1;
            if(v == t && ((r+1)%3 == 0))break;
            q.push(MT(d+1, v, (r+1)%3));
        }
    }
    if(dist[t][0] == 0x7f7f7f7f){
        printf("-1\n");
    }else{
        printf("%d\n", dist[t][0]/3);
    }
    return 0;
}

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

using namespace std;

using int64 = long long;
const int INF = 1 << 30;


int main()
{
  int N, C;

  cin >> N >> C;
  vector< pair< int, int > > t[100001];
  for(int i = 0; i < N; i++) {
    int a, b, c;
    cin >> a >> b >> c;
    --c;
    t[a].emplace_back(b, c);
  }

  int ret = 0, rest = 0;
  int lock[30], pv[30] = {};
  memset(lock, -1, sizeof(lock));

  for(int i = 0; i < 100001; i++) {

    for(int j = 0; j < C; j++) {
      if(lock[j] == i) {
        lock[j] = -1;
        pv[j] = true;
      }
    }

    for(auto &p : t[i]) {
      if(lock[p.second] == -1) {
        if(pv[p.second]) {
          lock[p.second] = p.first;
          pv[p.second] = false;
        } else if(rest > 0) {
          lock[p.second] = p.first;
          --rest;
        } else {
          lock[p.second] = p.first;
          ++ret;
        }
      } else {
        lock[p.second] = max(lock[p.second], p.first);
      }
    }

    for(int j = 0; j < C; j++) {
      if(pv[j]) {
        pv[j] = false;
        ++rest;
      }
    }
  }


  cout << ret << endl;
}

Measured memory_bytes: 5760
#include <iostream>
#include <sstream>
#include <string>
#include <cmath>
#include <array>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <utility>
#include <iomanip>
#include <numeric>
#include <climits>
#include <algorithm>
#include <cstdint>
using namespace std;

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

    int ans = 1;
    for (int i = 0; i < n - 1; i++)
    {
        if (str[i] != str[i + 1])
            ans++;
    }
    cout << ans;
}

Measured memory_bytes: 3744
time=Array.new(5)
sa=Array.new(5)
sa_num=Array.new(5)
5.times do|i|
	time[i]=gets.to_i
	sa[i]=(10-time[i]%10)
	sa[i]=0 if sa[i]==10
	sa_num[i]=i
end
sa.sort!
for i in 0..3
	indexmin=i
	for j in i+1..4
		if sa[indexmin]>sa[j] and sa[indexmin]!=0
			indexmin=j
		end
	end
	w=sa[indexmin]
	sa[indexmin]=sa[i]
	sa[i]=w

	w=sa_num[indexmin]
	sa_num[indexmin]=sa_num[i]
	sa_num[i]=w
end
sum=0
4.times do|i|
	sum+=time[sa_num[i]]
	sum+=sa[i]
end
sum+=time[sa_num[4]]
p sum

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

m = int(n/1.08)

while int(m * 1.08) >= n:
    m -= 1

while 1:
    if int(m * 1.08) > n:
        print(':(')
        exit()
    elif int(m * 1.08) == n:
        print(m)
        exit()
    m += 1

Measured memory_bytes: 38384
#include<bits/stdc++.h>
using namespace std;
#define inf 1000000000
#define INF 1000000000000000
#define ll long long
#define ull unsigned long long
#define M (int)(1e9+7)
#define P pair<int,int>
#define PLL pair<ll,ll>
#define FOR(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define RFOR(i,m,n) for(int i=(int)m;i>=(int)n;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,n,0)
#define all(a) a.begin(),a.end()
#define IN(a,n) rep(i,n){ cin>>a[i]; }
const int vx[4] = {0,1,0,-1};
const int vy[4] = {1,0,-1,0};
#define PI 3.14159265
#define F first
#define S second
#define PB push_back
#define EB emplace_back


void init(){
  cin.tie(0);
  ios::sync_with_stdio(false);
}

string s;
string t="ABC";

void replace(const char *u){
  string st;
  bool res=false;
  rep(i,s.size()){
    if(s.substr(i,3)==t){
      st+=u;
      i+=2;
    }
    else{
      st+=s[i];
      res |= s[i] ==*u;
    }
  }

  swap(s,st);
  if(res) s ="";
}
signed main(){
  cin>>s;

  while(true){
   
    if(s.size()<=t.size()||s.find(t)==string::npos) break;

    if(equal(all(t),s.begin()))
      replace("A");
    else if(s.find(t,s.size()-t.size())!=string::npos)
      replace("C");
    else
      replace("B");
  }


  if(s==t)
    cout<<"Yes"<<endl;
  else
    cout<<"No"<<endl;
}



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


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    cin>>s;
    long long n,i,j,cnt=0;
    for(i=0;i<s.size();i++)
    {
        cnt+=s[i]-'0';
    }
    if(cnt%9)
    {
        cout<<"No"<<endl;
    }
    else{
        cout<<"Yes"<<endl;
    }


}


Measured memory_bytes: 3752
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <iomanip>
#include <map>
#include <set>
#include <tuple>
#include <unordered_map>
#include <iterator>
#include <string>
#include <limits>

using namespace std;

using i64 = int64_t;
using P = pair<i64, i64>;
i64 mod = 1000000007;
int int_max = 2147483647;
int max_n = 1e5;


int main(int argc, char **argv) {
    int n, m;
    cin >> n >> m;

    int sum{0};
    priority_queue<int> q;
    for (int i=0; i<n; ++i) {
        int a;
        cin >> a;
        sum += a;
        q.push(a);
    }

    double b = ((double)sum)/(4*m);
    for (int i=0; i<m; ++i) {
        int p = q.top();
        q.pop();
        if ((double)p < b) {
            cout << "No" << endl;
            return 0;
        }
    }

    cout << "Yes" << endl;

    return 0;
}


Measured memory_bytes: 256
// --------------
// Tejas Pandey  |
// 19 - 06 - 20  |
// Atcoder GC #46|
// --------------

#include <bits/stdc++.h>
using namespace std;
     
#define mod 1000000007
#define vi vector<int>
typedef long long int ll;

int gcd(int a,int b){
	return (a%b?gcd(b,a%b):b);
}
     
int main (void){
  //freopen("in.txt","r",stdin);
  //freopen("out.txt","w",stdout);
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int x;
  cin >> x;
  cout << 360/gcd(360,x) << "\n";
  return 0;
}


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

using namespace std;

#define endl '\n'
#define ll long long
#define int long long
const int32_t INFint = 1e9;
const ll INFll = 1e18;
const ll INF = 1LL << 60;
#define MOD 1000000007ll
#define fast                      \
    ios_base::sync_with_stdio(0); \
    cin.tie(0);                   \
    cout.tie(0);

#define vi vector<int>
#define pii pair<int, int>
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define foreach(it, v) for (__typeof((v).begin()) it = (v).begin(); it != (v).end(); it++)

#define deb1(x) cout << #x << ": " << x << endl
#define deb2(x, y) cout << #x << ": " << x << " | " << #y << ": " << y << endl
#define deb3(x, y, z) cout << #x << ":" << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl
#define deb4(a, b, c, d) cout << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl
#define deb5(a, b, c, d, e) cout << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl
#define deb6(a, b, c, d, e, f) cout << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl
#define nl cout << endl
// void bfs(vector<int> & dist , vector< vector<int> > & edges , int index )
// {
//     queue< pair<int,int> > q ;
//     dist[index] = -1 ; 
//     q.push(mp(index,0)) ;
//     while(!q.empty())
//     {
//         pair<int,int> top = q.front() ;
//         // deb2(top.ff,top.ss); 
//         q.pop() ; 
//         if(dist[top.ff] != -1 )
//             continue ;
//         // deb3(top.ff,top.ss,dist[top.ff]) ;
//         dist[top.ff] = top.ss ;
//         for(int i = 0 ; i < edges[top.ff].size(); i++ )
//         {
//             if (dist[edges[top.ff][i]] == -1)
//             {
//                 q.push(mp(edges[top.ff][i],dist[top.ff]+1));
//             }
//         }
//     } 
// }
int32_t main()
{
    fast;
    // #ifndef ONLINE_JUDGE
    //     freopen("input.txt", "r", stdin);
    //     freopen("output.txt", "w", stdout);
    // #endif
    int n ;
    cin >> n;
    vi ar(n+1,0) , ans(n+1,0) ;
    for(int i = 2 ; i <= n ; i++ )
    {
        cin>>ar[i] ;
        ans[ar[i]] ++ ;
    }
    for(int i = 1 ;i<=n ; i++ )    
        cout<<ans[i]<<endl;
}

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

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

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define COUT(x) cout<<(x)<<"\n"

int main(){
    cin.tie(0);
    
    int n,m,r;
    cin >> n >> m >> r;
    
    vector<ll> list(r);
    REP(i,r){
        cin >> list[i];
        --list[i];
    }
    sort(list.begin(),list.end());
    
    vector<vector<ll>>adj(n,vector<ll>(n,INF));
    
    REP(i,n){
        adj[i][i] = 0;
    }
    
    REP(i,m){
        ll a,b,c;
        cin >> a >> b >> c;
        --a;--b;
        adj[a][b] = c;
        adj[b][a] = c;
    }
    //Warshall-Floyd
    REP(k,n){
        REP(i,n){
            REP(j,n){
                if(adj[i][k] != INF && adj[k][j] != INF){
                    adj[i][j] = min(adj[i][j],adj[i][k]+adj[k][j]);
                }
            }
        }
    }
    ll ans=INF;
    do{
        ll tes = 0;
        FOR(i,1,r){
            tes += adj[list[i-1]][list[i]];
        }
        ans = min(ans,tes);
    }while(next_permutation(list.begin(),list.end()));
    COUT(ans);
    return 0;
} 

Measured memory_bytes: 512
#include<bits/stdc++.h>
#define int long long
using namespace std;int n,d,a[220001],b[220001];main(){cin>>n>>d;for(int i=1;i<=n;i++)cin>>a[i],b[i]=a[i];for(int i=2;i<=n;i++)b[i]=min(b[i],b[i-1]+d);for(int i=n-1;i;i--)b[i]=min(b[i],b[i+1]+d);int pos=min_element(a+1,a+1+n)-a,ans=0;for(int i=pos-1;i;i--)ans+=a[i]+b[i+1]+d;for(int i=pos+1;i<=n;i++)ans+=a[i]+b[i-1]+d;cout<<ans<<'\n';}


Measured memory_bytes: 3328
n,m=map(int, input().split())
s=[list(map(int, input().split())) for i in range(m)]
x=max(a for a,b in s)
dp=[0]*(n+x)
for i in range(0,n+x):
  if i>0:
    dp[i]=min(dp[i-a]+b for a,b in s)
print(min(dp[n:]))



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

int main() {
  long H,W;
  cin >> H>>W;

  vector<vector<char>> a(H, vector<char>(W));
  vector<vector<int>> l(H, vector<int>(W));
  vector<vector<int>> r(H, vector<int>(W));
  vector<vector<int>> d(H, vector<int>(W));
  vector<vector<int>> u(H, vector<int>(W));
  vector<vector<int>> sum(H, vector<int>(W));

  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++) cin>>a[i][j];
  }

  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++) {
      if(a[i][j]=='#') l[i][j]=0;
      else if(j==0) l[i][j]=1;
      else if(j>0) l[i][j]=l[i][j-1]+1;

      if(a[i][j]=='#') u[i][j]=0;
      else if(i==0) u[i][j]=1;
      else if(i>0) u[i][j]=u[i-1][j]+1;
    }
  }

  for(int i=H-1;i>=0;i--){
    for(int j=W-1;j>=0;j--) {
      if(a[i][j]=='#') r[i][j]=0;
      else if(j==W-1) r[i][j]=1;
      else if(j<W-1) r[i][j]=r[i][j+1]+1;

      if(a[i][j]=='#') d[i][j]=0;
      else if(i==H-1) d[i][j]=1;
      else if(i<H-1) d[i][j]=d[i+1][j]+1;
    }
  }
  int ans =0;
  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++) {
      sum[i][j]=l[i][j]+r[i][j]+u[i][j]+d[i][j]-3;
      sum[i][j] = max(0,sum[i][j]);
      ans= max(sum[i][j],ans);

      //cout<<sum[i][j]<<" ";
    }
    //cout<<endl;
  }

cout<<ans<<endl;



}


Measured memory_bytes: 82816
import std.algorithm;
import std.array;
import std.container;
import std.conv;
import std.math;
import std.numeric;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void scan(T...)(ref T a) {
    string[] ss = readln.split;
    foreach (i, t; T) a[i] = ss[i].to!t;
}
T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

void main() {
    int k, x; scan(k, x);
    iota(x - k + 1, x + k).map!text.join(' ').writeln;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
const int N = 5e5 + 5;
int n;
char str[N];
int dp[N];
int nxt[N];
int main(){
	scanf("%d" , &n);
	scanf("%s" , str + 1);
	for(int i = n ; i >= 1 ; --i){
		if(str[i] == '0'){
			nxt[i] = 0;
		}
		else{
			nxt[i] = 1 + nxt[i + 1];
		}
	}
	for(int i = n ; i >= 1 ; --i){
		if(str[i] == '0'){
			dp[i] = dp[i + 1];
			continue;
		}
		int r = i + nxt[i] - 1;
		if(r == n){
			dp[i] = 0;
			continue;
		}
		int mid = r + 1;
		if(mid == n){
			dp[i] = 0;
			continue;
		}
		dp[i] = dp[i + 1];
		if(str[mid + 1] == '0'){
			continue;
		}
		int lft = nxt[i];
		int rgt = nxt[mid + 1];
		dp[i] = max(dp[i] , lft + dp[mid + 2]);
		if(str[i + 1] == '0'){
			for(int j = mid + 1 ; j <= mid + rgt ; ++j){
				dp[i] = max(dp[i] , dp[j + 1] + j - mid);
			}
		}
	}
	printf("%d\n" , dp[1]);
}

Measured memory_bytes: 4608
// Graph.cs

using System;

class Graph {
	public static void Main() {

		int n = int.Parse(Console.ReadLine());
		int[,] A = new int[n,n];

		for(int i = 0; i < n; i++) {
			
			string[] str = Console.ReadLine().Split(' ');
			int[] strToInt = new int[str.Length];

//			Console.WriteLine("------------");

			for(int j = 0; j < str.Length; j++) {
				strToInt[j] = int.Parse(str[j]);
			}

//			Console.WriteLine("-------------");

			for(int j = 0; j < strToInt[1]; j++) {
				A[strToInt[0] - 1, strToInt[j + 2] - 1] = 1;
			}

//			Console.WriteLine("-------------");

		}

//		Console.WriteLine("--------");


		for(int i = 0; i < n; i++) {
			for(int j = 0; j < n; j++) {
				Console.Write(A[i,j]);
				if(j != n - 1) Console.Write(" ");
				else Console.WriteLine();
			}
		}

	}
}

Measured memory_bytes: 9384