akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
 
#define fi first
#define se second
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define INF  (1<<30)
#define INFL (1LL<<60)
#define EPS ((ld)(1e-9))
 
#define sz(x) ((int)(x).size())
#define setz(x) memset(x, 0, sizeof(x))
#define all(x) (x).begin(), (x).end()
#define rep(i, e) for (int i = 0, _##i = (e); i < _##i; i++)
#define repp(i, s, e) for (int i = (s), _##i = (e); i < _##i; i++)
#define repr(i, s, e) for (int i = (s)-1, _##i = (e); i >= _##i; i--)
#define repi(i, x) for (auto &i : (x))
#define ARR(...) vector<int>({__VA_ARGS__})
#define ARS(...) vector<string>({__VA_ARGS__})
 
 
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef complex<double> base;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
 
template<typename T, typename V>
ostream &operator<<(ostream &os, const pair<T, V> pai) { 
    return os << '(' << pai.first << ' ' << pai.second << ')';
}
 
template<typename T>
ostream &operator<<(ostream &os, const vector<T> v) {
    cout << '[';
    for (auto p : v) cout << p << ",";
    cout << "]";
    return os;
}
 
template<typename T, typename V>
ostream &operator<<(ostream &os, const set<T, V> v) {
    cout << "{";
    for (auto p : v) cout << p << ",";
    cout << "}";
    return os;
}
 
template<typename T, typename V>
ostream &operator<<(ostream &os, const map<T, V> v) {
    cout << "{";
    for (auto p : v) cout << p << ",";
    cout << "}";
    return os;
}
 
#ifndef __SOULTCH
#define debug(...) 0
#define endl '\n'
#else
#define debug(...) cout << " [-] ", _dbg(#__VA_ARGS__, __VA_ARGS__)
template<class TH> void _dbg(const char *sdbg, TH h){ cout << sdbg << '=' << h << endl; }
template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) {
    while(*sdbg != ',') cout << *sdbg++;
    cout << '=' << (h) << ','; 
    _dbg(sdbg+1, a...);
}
#endif
 
template<typename T> void get_max(T &a, T b) {a = max(a, b);}
template<typename T> void get_min(T &a, T b) {a = min(a, b);}

const ll MOD = 1e9+7;

int N;
ll K;
struct matrix {
    const static int N = 50;
    ll A[N][N];

    matrix() {setz(A);}
};

matrix operator*(matrix a, matrix b) {
    matrix r;
    rep(i, a.N) rep(k, a.N) rep(j, a.N) {
        r.A[i][j] = (r.A[i][j]+a.A[i][k]*b.A[k][j])%MOD;
    }
    return r;
}

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

    matrix A, res;

    cin >> N >> K;
    rep(i, N) rep(j, N) cin >> A.A[i][j];
    rep(i, res.N) res.A[i][i] = 1;

    for (; K; K >>= 1) {
        if (K&1) res = res*A;
        A = A*A;
    }

    ll rrr = 0;
    rep(i, N) rep(j, N) rrr += res.A[i][j];
    cout << rrr%MOD << endl;
}

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

int main(){
 int n; cin >> n;
 vector<int> a(n);
 rep(i, n) cin >> a[i];
 int s = 0;
 rep(i, n) s = s ^ a[i];
 
 rep(i, n){
   int ans;
   ans = s ^ a[i];
   cout << ans << endl;
 }
  
  return 0;
}


Measured memory_bytes: 3992
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define iiii tuple<int, int, int, int>
#define iii tuple<int, int, int>
#define ii pair<int, int>
#define fi first
#define vi vector<int>
#define vvi vector<vector<int>>
#define se second

using namespace std;
using namespace __gnu_pbds;

template <typename T>
using ordered_set =
    tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

const int M = 1e9 + 7;

int fpow(int x, int n) {
    int res = 1;
    while (n) {
        if (n & 1) res = (1LL * res * x) % M;
        n >>= 1;
        x = (1LL * x * x) % M;
    }
    return res;
}
int gcdex(int x, int m) { return fpow(x, m - 2); }

void solve() {
    int n, k;
    cin >> n >> k;
    vi a(n);
    for (int i = 0; i < n; ++i) cin >> a[i];
    sort(a.begin(), a.end());

    if (k == 1) {
        cout << "0\n";
        return;
    }

    for (auto& i : a) i = (i + M) % M;
    // for (int i = 0; i < n; ++i) cout << a[i] << " \n"[i == n - 1];
    vi nCk(n + 1, 1);
    vi fac(n + 1, 1);
    for (int i = 2; i <= n; ++i) fac[i] = (1LL * fac[i - 1] * i) % M;
    // for (int i = 0; i <= n; ++i) cout << fac[i] << " \n"[i == n];
    for (int i = k; i <= n; ++i) {
        ll tmp = fac[i - 2];
        tmp = (tmp * gcdex(fac[k - 2], M)) % M;
        nCk[i] = (tmp * gcdex(fac[i - k], M)) % M;
        if (nCk[i] == 0) nCk[i] = 1;
    }
    for (int i = k + 1; i <= n; ++i) nCk[i] = (nCk[i - 1] + nCk[i]) % M;

    ll max_sum = 0, min_sum = 0;
    int j = k;
    for (int i = k - 1; i < n; ++i)
        max_sum = (max_sum + 1LL * a[i] * nCk[j++]) % M;

    j = k;
    for (int i = n - k; i >= 0; --i)
        min_sum = (min_sum + 1LL * a[i] * nCk[j++]) % M;

    cout << (max_sum - min_sum + M) % M << '\n';
    // cout << max_sum << ' ' << min_sum << '\n';
    // for (int i = k; i <= n; ++i) cout << nCk[i] << " \n"[i == n];
}

int main() {
    ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
    // freopen("in", "r", stdin);

    int t = 1;
    // cin >> t;
    while (t--) solve();

    return 0;
}

Measured memory_bytes: 1408
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		scan.close();
		
		for(int i = 3; i <= n; i++){
			
			if(i % 3 == 0){
				System.out.print(" " + i);
			}else{
				//String??????????????????1????????\??????char'3'????????????
				String strNum = String.valueOf(i);
				//???????????????boolean??§??????
				boolean isMatch = false;
				for(int j = 0; j < strNum.length(); j++){
					//for?????§??¨?????????????????????boolean??§??????					
					char x = strNum.charAt(j);
					if(x == '3'){
						isMatch = true;
					}
				}
				if(isMatch){
					//ture?????´???????????????????????§??¨?????????
					System.out.print(" " + i);					
				}
			}
		} 
		System.out.println();
	}
}

Measured memory_bytes: 24292
#include <bits/stdc++.h> 
using namespace std;
#define rep(i, N) for(int i=0; i<N; i++)
typedef long long ll;
#define dump(x) cerr<<#x<<"="<<x<<endl
using P = pair<int, int>;


int main() {
    ll x; cin >> x;
    vector<ll> sum(10000001, 0);

    for(int i=1; i<10000000; i++){
        sum.at(i) = sum.at(i-1) + i;
        if(sum.at(i)==x){
            cout << i << endl;
            return 0;
        }
    }
    
    ll idx = lower_bound(sum.begin(), sum.end(), x) - sum.begin();
    ll ans;
    ans = idx;

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


Measured memory_bytes: 78336
using System;


public class hello
{
    public static void Main()
    {
        var r = double.Parse(Console.ReadLine().Trim());
        var s = Math.Pow(r, 2) * Math.PI;
        var el = 2 * r * Math.PI;

        Console.WriteLine("{0} {1}", s, el);

    }
}

Measured memory_bytes: 9416
import java.util.Scanner;

public class Main {

    static Scanner sc = new Scanner(System.in);


    public static void main(String[] args) {
        int a = sc.nextInt();
        int b = sc.nextInt();
        int n = b - a;

        System.out.println(Math.round(n * (n + 1) / 2) - b);
    }
}


Measured memory_bytes: 21844
fn solve() -> String {
    let (n, m) = readln();
    let mut g = vec![Vec::new(); n];
    for _ in 0..m {
        let (a, b, c): (usize, usize, i64) = readln();
        g[a-1].push((b-1, -c));
    }
    let mut cost = vec![None; n];
    cost[0] = Some(0);
    for i in 0..n {
        for u in 0..n {
            if let Some(cur) = cost[u] {
                for &(v, c) in &g[u] {
                    let next = cur + c;
                    if cost[v].unwrap_or(i64::max_value()) > next && i == n-1 && v == n-1 {
                        return "inf".to_string();
                    }
                    cost[v] = Some(cost[v].map_or(next, |x| min(x, next)));
                }
            }
        }
    }
    (-(cost[n-1].unwrap())).to_string()
}
fn main() {
    println!("{}", solve());
}

// --- template ---
#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::HashSet;

pub trait FromLn {
    fn fromln(s: &str) -> Self;
}
pub fn readln<T: FromLn>() -> T {
    let mut buf = String::new();
    let _ = ::std::io::stdin().read_line(&mut buf).unwrap();
    T::fromln(buf.trim())
}
pub fn readlns<T: FromLn>(n: usize) -> Vec<T> {
    let mut vs = vec![];
    for _ in 0..n { vs.push(readln()); }
    vs
}
macro_rules! fromln_primitives {
    ($($t:ty),*) => { $(
        impl FromLn for $t {
            fn fromln(s: &str) -> $t {
                s.parse().unwrap()
            }
        }
    )* }
}
fromln_primitives!(String, bool, f32, f64, isize, i8, i16, i32, i64, usize, u8, u16, u32, u64);
impl<T> FromLn for Vec<T> where T: FromLn {
    fn fromln(s: &str) -> Vec<T> {
        s.split_whitespace().map(T::fromln).collect()
    }
}
impl FromLn for Vec<char> {
    fn fromln(s: &str) -> Vec<char> {
        s.chars().collect()
    }
}
macro_rules! fromln_tuple {
    ($($t:ident),*) => {
        impl<$($t),*> FromLn for ($($t),*) where $($t: FromLn),* {
            fn fromln(s: &str) -> ($($t),*) {
                let mut it = s.split_whitespace();
                let t = ($($t::fromln(it.next().unwrap())),*);
                assert_eq!(it.next(), None);
                t
            }
        }
    }
}
fromln_tuple!(A, B);
fromln_tuple!(A, B, C);
fromln_tuple!(A, B, C, D);
fromln_tuple!(A, B, C, D, E);
fromln_tuple!(A, B, C, D, E, F);

Measured memory_bytes: 4352
#include <iostream>
#include <limits.h>
#include <algorithm>
#include <math.h>
#include <vector>
#include <map>
#include <string>
using namespace std;
typedef long long ll;

ll inf = 1000000007;
vector<pair<ll, int>> fs;

ll extgcd(ll a, ll b, ll& x, ll& y) {
	if (b == 0) {
		x = (a >= 0) ? 1 : -1;
		y = 0;
		return abs(a);
	}
	else {
		ll res = extgcd(b, a % b, y, x);
		y -= (a / b) * x;
		return res;
	}
}

ll mod_inverse(ll a, ll m) {
	ll x, y;
	extgcd(a, m, x, y);
	return (m + x % m) % m;
}

ll comb(ll n, ll k) {
    ll res = 1;
	for (int i = 0; i < k; i++)
		res = (res * ((n - i) % inf)) % inf;
	for (int i = 1; i <= k; i++)
		res = (res * mod_inverse(i, inf)) % inf;
	return res;
}
 
 
void PF(ll n) {
    ll base = n;
    for (ll i = 2; i * i <= base; i++) {
        if (base % i == 0) {
            int cnt = 0;
            while (base % i == 0) {
                base /= i;
                cnt++;
            }
            fs.emplace_back(i, cnt);
        }
    }
    
    if (base > 1) {
        fs.emplace_back(base, 1);
    }
    
    /*
    for (int i = 0; i < fs.size(); i++) {
        cout << fs[i].first << " " << fs[i].second << endl;
    }
    */
}
 
ll pw(ll x, ll y) {
    ll rt = 1;
    for (int i = 0; i < y; i++) {
        rt *= x;
        rt %= inf;
    }
    return rt;
}
 
int main(void){
    ll n, m;
    cin >> n >> m;
    
    PF(m);
    
    ll ans = 1;
    for (int i = 0; i < fs.size(); i++) {
        ans *= comb(n + fs[i].second - 1, fs[i].second);
        ans %= inf;
    }
    
    cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll MOD = (1e9)+7;
void fastIO(){
  ios_base::sync_with_stdio(0); cin.tie(0);
}


int main(){
  fastIO();
  int a,b;
  cin>>a>>b;
  if(a>=1&&a<=9&&b>=1&&b<=9){
  	cout<<a*b<<endl;
  }else{
  	cout<<-1<<endl;
  }
}  




  

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
 
import bisect
 
n = int(input())
 
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
 
A.sort()
B.sort()
C.sort()
 
Ac, Cc = [0]*n, [0]*n
# Ap, Cp = 0, 0
 
for i in range(n):
    Ac[i] = bisect.bisect_left(A, B[i])#[Ap:], B[i])
    # Ac[i], Ap = index + Ap, index + Ap
    Cc[i] = n - bisect.bisect_right(C, B[i])#[Cp:], B[i])
    # Cc[i], Cp = n - index - Cp, index + Cp
 
 
count = 0
for i in range(n):
    count += Ac[i]*Cc[i]
 
print(count)

Measured memory_bytes: 23488
#include <atcoder/segtree>
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double

ll op(ll a, ll b) {
    return max(a, b);
}

ll e() {
    return -1LL;
}

ll M;

bool f(ll x) {
    return x < M;
}

int main() {
    int N, Q;
    scanf("%d %d", &N, &Q);
    atcoder::segtree<ll, op, e> sgt(N);
    for (int i = 0; i < N; i++) {
        ll A;
        scanf("%lld", &A);
        sgt.set(i, A);
    }

    for (int q = 0; q < Q; q++) {
        int T;
        scanf("%d", &T);
        if (T == 1) {
            int X;
            ll V;
            scanf("%d %lld", &X, &V);
            sgt.set(X-1, V);
        }
        if (T == 2) {
            int L, R;
            scanf("%d %d", &L, &R);
            printf("%lld\n", sgt.prod(L-1, R));
        }
        if (T == 3) {
            int X;
            scanf("%d %lld", &X, &M);
            printf("%d\n", sgt.max_right<f>(X-1)+1);
        }
    }
}

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

// {U}{INT,LONG,LLONG}_{MAX,MIN}
#define INF         INT_MAX/3
#define LLINF       LLONG_MAX/3
#define MOD         (1000000007LL)
#define MODA(a, b)  a=((a)+(b))%MOD
#define MODP(a, b)  a=((a)*(b))%MOD
#define inc(i, l, r)   for(int i=(l);i<(r);i++)
#define dec(i, l, r)   for(int i=(r)-1;i>=(l);i--)
#define pb          push_back
#define se          second
#define fi          first
#define mset(a, b)  memset(a, b, sizeof(a))

using LL  = long long;
using G   = vector<vector<int>>;

int di[] = {0, -1, 0, 1};
int dj[] = {1, 0, -1, 0};
// }}}

int main() {
    cin.tie(0);ios::sync_with_stdio(false);
    int m, k;cin >> m >> k;
    //if(m == 0 && k == 0){
        //cout << 0 << " " << 0 << endl;
        //return 0;
    //}
    if(k >= (1<<m) || (m == 1 && k > 0)){
        cout << -1 << endl;
        return 0;
    }

    vector<int> ans;
    if(k == 0){
        inc(i, 0, (1<<m)){
            ans.pb(i);
            ans.pb(i);
        }
    }else{
        ans.pb(0);
        ans.pb(k);
        ans.pb(0);
        inc(i, 1, (1<<m)){
            if(i == k) continue;
            ans.pb(i);
        }
        ans.pb(k);
        dec(i, 1, (1<<m)){
            if(i == k) continue;
            ans.pb(i);
        }
    }

    int n = ans.size();
    inc(i, 0, n){
        cout << ans[i];
        if(i != n-1){
            cout << " ";
        }
    }
    cout << endl;
    return 0;
}


Measured memory_bytes: 2932
def f_engines():
    import math
    N = int(input())
    # 2πをまたぐようなベクトルの選び方を楽にするため、要素数を2倍
    Engines = sorted([[int(i) for i in input().split()] for j in range(N)],
                     key=lambda x: math.atan2(x[1], x[0])) * 2

    ans = 0
    for head in range(N):
        # 他の人の提出には1重ループのものもあるが、それでいい理屈がわからない
        for tail in range(head, head + N):
            x, y = 0, 0
            for i in range(head, tail + 1):
                dx, dy = Engines[i]
                x += dx
                y += dy
            ans = max(ans, x * x + y * y)
    return math.sqrt(ans)

print(f_engines())

Measured memory_bytes: 3316
#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <functional>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <deque>
#include <ctime>

using namespace std;

#define rep(i,n) REP(i,0,n)
#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)
#define pb push_back
#define mp make_pair
#define all(r) (r).begin(),(r).end()
#define rall(r) (r).rbegin(),(r).rend()
#define fi first
#define se second
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))


typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int INF = 1e9;
const ll LINF = 1e18;
const ll MOD = 1e9 + 7;
double EPS = 1e-8;
const double PI = acos(-1);

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

int a[int(1e5)+10];

int main(){
    string s;
    cin >> s;

    int cnt=0;
    for(int i=0; i<s.size()-1; i++){
        if(s[i] != s[i+1]) cnt++;
    }

    cout << cnt << endl;


}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define all(c) (c).begin(),(c).end()
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define iter(c) __typeof((c).begin())
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
#define mem(a) memset(a,0,sizeof(a))
#define pd(a) printf("%.10f\n",a)
#define pb(a) push_back(a)
#define in(a) insert(a)
#define pi M_PI
#define R cin>>
#define F first
#define S second
#define C class
#define ll long long
#define ln cout<<'\n'
#define _(_1,_2,_3,N,...)N
#define pr(...) _(__VA_ARGS__,pr3,pr2,pr1)(__VA_ARGS__)
template<C T>void pr1(T a){cout<<a;ln;}
template<C T,C T2>void pr2(T a,T2 b){cout<<a<<' '<<b;ln;}
template<C T,C T2,C T3>void pr3(T a,T2 b,T3 c){cout<<a<<' '<<b<<' '<<c;ln;}
template<C T>void PR(T a,int n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}
bool check(int n,int m,int x,int y){return x>=0&&x<n&&y>=0&&y<m;}
const ll MAX=1000000007,MAXL=1LL<<60,dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};
typedef pair<int,int> P;

void Main() {
  int n;
  while(R n && n) {
    P a[n];
    rep(i,n) cin >> a[i].F >> a[i].S;
    int d[1001];
    mem(d);
    d[0]=1;
    rep(i,n) {
      rrep(k,1000) {
        REP(j,1,a[i].S+1) {
          if(k+a[i].F*j<=1000) d[k+a[i].F*j]+=d[k];
        }
      }
    }
    int m;
    R m;
    while(m--) {
      int x;
      R x;
      pr(d[x]);
    }
  }
}

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


Measured memory_bytes: 1196
#include<stdio.h>
int main()
{
    int a,b,i,j;
    scanf("%d %d",&a,&b);
    while(a!=0 || b!=0)
    {
        for(i=0;i<1;i++)
        {
            for(j=0;j<b;j++)
            {
                printf("#");
            }
            printf("\n");
        }
        for(i=1;i<a-1;i++)
        {
            for(j=0;j<b;j++)
            {
                if(j==0 || j==b-1)
                {
                    printf("#");
                }
                else
                {
                    printf(".");
                }
            }
            printf("\n");
        }
        for(i=a-1;i<a;i++)
        {
            for(j=0;j<b;j++)
            {
                printf("#");
            }
            printf("\n");
        }
        printf("\n");
        scanf("%d %d",&a,&b);
    }
    return 0;
}


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

int main() {
    string T;
    cin >> T;

    // for (int i = 0; i < T.size() - 1; i++) {
    //     if (T[i] == '?')
    // }

    for (int i = 0; i < T.size(); i++) {
        if (T[i] == '?') {
            T[i] = 'D';
        }
    }

    cout << T << endl;
}


Measured memory_bytes: 3720
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using pll = pair<ll, ll>;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define Rep(i, m, n) for(ll i = m; i < n; i++)
#define all(vec) vec.begin(), vec.end()
#define tmax(x, y, z) max((x), max((y), (z)))
#define tmin(x, y, z) min((x), min((y), (z)))
#define MINUS(a) memset(a, 0xff, sizeof(a))
#define ZERO(a) memset(a, 0, sizeof(a))
const ll INF = 1LL << 60;
const ll MM = 1000000000; const ll MOD = MM + 7; const ll MMM=9223372036854775807;//2^63 -1
#define ADD(a,b) a = (a + ll(b)) % MOD
#define MUL(a,b) a = (a * ll(b)) % MOD
ll GCD(ll x, ll y){ if(y == 0) return x; else return GCD(y, x % y);}
ll LCM(ll x, ll y){ return x / GCD(x, y) * y;}
template<class T> inline bool chmin(T& a, T b){ if(a > b){ a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b){ if(a < b){ a = b; return true;} return false;}
template<typename A, size_t N, typename T> void FILL(A (&array)[N], const T &val){ fill( (T*)array, (T*)(array+N), val );}
// struct edge{ ll from, to, cost; edge(ll f, ll t, ll c) : from(f), to(t), cost(c) { } };
// struct edge{ ll to, cost; edge(ll t, ll c) : to(t), cost(c) { } };
// using Graph = vector<vector<ll>>;  // 重み無し
// using Graph = vector<vector<edge>>;  // 重み付き
ll dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
ll ddx[8] = {1, 1, 0, -1, -1, -1, 0, 1}, ddy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
//cout << fixed << setprecision(10);

const ll MAX_V = 200;  // 最大頂点数(制約に従う)
ll d[MAX_V][MAX_V];  // 全体をINF、d[i][i]を0に初期化
// 初期化
// FILL(d, INF);
// rep(i, V) d[i][i] = 0;  // V: 実際の頂点数


// 0-basedに注意
void warshall_floyd(ll V){  // 実際の頂点数
    // 経由頂点, 始点, 終点
    rep(k, V) rep(i, V) rep(j, V) chmin(d[i][j], d[i][k] + d[k][j]);
}


int main(){
    ll n, m, r; cin >> n >> m >> r;
    vector<ll> vec(r);
    rep(i, r){
        ll ri; cin >> ri; ri--;  // 0-based
        vec[i] = ri;
    }

    // 初期化
    FILL(d, INF);
    rep(i, n) d[i][i] = 0;

    rep(i, m){
        ll a, b, c; cin >> a >> b >> c; a--, b--;  // 0-based
        // 無向
        d[a][b] = d[b][a] = c;
    }

    warshall_floyd(n);

    ll ans = INF;
    // next_permutationのため初期化
    sort(all(vec));
    do{
        ll sum = 0;
        rep(i, vec.size()-1) sum += d[vec[i]][vec[i+1]];
        chmin(ans, sum);
    }while(next_permutation(all(vec)));

    cout << ans << endl;
}


Measured memory_bytes: 3916
using System;

namespace D___Blue_and_Red_Balls
{
    class Program
    {
        static long MOD = 1000000007;
        static void Main(string[] args)
        {
            var NK = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
            var N = NK[0];
            var K = NK[1];
            combInit(2000, MOD);

            for (int i = 1; i <= K; i++)
            {
                var space = N - K + 1;
                var parts = combination(K - 1, i - 1);
                Console.WriteLine((combination(space, i) * parts) % MOD);
            }

        }

        static long combMax;
        static long combMOD;

        static long[] factorial;
        static long[] inverse;
        static long[] factInv;

        static void combInit(long _max, long _mod)
        {
            combMax = _max;
            combMOD = _mod;
            factorial = new long[combMax];
            inverse = new long[combMax];
            factInv = new long[combMax];

            factorial[0] = factorial[1] = 1;
            factInv[0] = factInv[1] = 1;
            inverse[1] = 1;

            for (int i = 2; i < combMax; i++)
            {
                factorial[i] = factorial[i - 1] * i % combMOD;
                inverse[i] = combMOD - inverse[combMOD % i] * (combMOD / i) % combMOD;
                factInv[i] = factInv[i - 1] * inverse[i] % combMOD;
            }
        }

        static long combination(int n, int k)
        {
            if (n < k) return 0;
            if (n < 0 || k < 0) return 0;
            return factorial[n] * (factInv[k] * factInv[n - k] % combMOD) % combMOD;
        }
    }
}


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



int main() {
    int n;
    cin >> n;
    
    set<int> s;
    rep(i,n) {
        int a;
        cin >> a;
        s.insert(a);
    }
    
    if(s.size() == n)
        cout << "YES" << endl;
    else
        cout << "NO" << endl;
    
    
    return 0;
}


Measured memory_bytes: 12988
H,W = map(int,input().split())
#N = int(input())
#B = list(map(int,input().split()))
c=0

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

if H%2==0:
    c+=(H/2)*W
else:
    h = int(H/2)
    w = int(W/2)
    if W%2==0:
        c += (h+1) * w + h * w
    else:
        c += (h+1) * (w+1) + h * w
print(int(c))


Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>
#include <string>
#include <iomanip>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <complex>
#include <ctime>


using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef int itn;
const ll LINF = 1e18;
const int INF = 1e9;

//マクロ定義
#define vvint(vec,n,m,l) vector<vector<int>> vec(n, vector<int>(m,l));	// lで初期化
#define vvll(vec,n,m,l) vector<vector<ll>> vec(n,vector<ll>(m,l));
#define vint vector<int>
#define pint pair<int,int>
#define rep(i,a) for(int i=0;i<(a);i++)
#define all(x) (x).begin(),(x).end()
#define debug system("pause")				//デバッグ用
#define ret return 0

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 Graph = vector<vector<ll>>;

#define ketasitei setprecision(15) //15桁表示

const ll MOD = 1000000007;
const double PI = 3.1415926535897932;


int main(void)

{
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << ketasitei;

	int a, b, c, d;
	cin >> a >> b >> c >> d;

	for (int i = 0; i <= 100; i++)
	{
		c -= b;
		if (c <= 0)
		{
			cout << "Yes" << endl;
			ret;
		}
		a -= d;
		if (a <= 0)
		{
			cout << "No" << endl;
			ret;
		}
	}

	return 0;
}

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


int main()
{
	int n,m;
	cin >> n >> m;
	vector<bool> red(n);
	red[0]=true;
	vector<int> in(n,1);
	for(int i =0;i<m;i++)
	{
		int x,y;
		cin >> x >> y;
		x--;y--;
		if(red[x])red[y] = red[x];
		in[x]--;
		in[y]++;
		if(in[x]==0)red[x]=false;
	}
	int ans = 0;
	for(int i = 0;i<n;i++)
	{
		ans += red[i];
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#include <cmath>
#include <numeric>
using namespace std;
#define rep(i,a,b) for(int64_t i=(a);i<(b);++i) // a ≦ i < b 
#define Rrep(i,a,b) for(int64_t i=(a);i>=(b);--i) // reverse repeat. a から b まで減少．
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend() //逆イテレータ
#define RANGE(a,b,c) (a).begin()+(b),(a).begin()+(c) // [b,c) イテレータ
#define INF 1000000000000000
#define MOD 1000000007
using PII = pair<int64_t, int64_t>;
using VI = vector<int64_t>;
using VVI = vector<VI>;
using VS = vector<string>;
using VP = vector<PII>;
using i64 = int64_t;
template<typename T> void invec(vector<T> &A){for(T& a : A) cin >> a;} 


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

int N; cin >> N;
VVI T(N+1);
rep(_, 0, N-1){
    int a, b; cin >> a >> b;
    T[a].push_back(b);
    T[b].push_back(a);
}
vector<int> dist1(N+1, -1), distN(N+1, -1); 
dist1[1] = 0;
queue<int> que;
que.push(1); 
while (!que.empty()) {
    int v = que.front(); 
    que.pop();
    for (int nv : T[v]) {
        if (dist1[nv] != -1) continue;
        dist1[nv] = dist1[v] + 1;
        que.push(nv);
    }
}
distN[N] = 0;
que.push(N); 
while (!que.empty()) {
    int v = que.front(); 
    que.pop();
    for (int nv : T[v]) {
        if (distN[nv] != -1) continue;
        distN[nv] = distN[v] + 1;
        que.push(nv);
    }
}
int c1= 0, cN = 0;
rep(v, 1, N+1){
    if (dist1[v] <= distN[v]) ++c1;
    else ++cN;
}
if (c1 > cN) cout << "Fennec\n";
else cout << "Snuke\n";

return 0;
}
// 書いて考える．場合分け．情報整理．
// 単純に分かる量から．愚直解を実装して研究．
// 境界，出力文字列 チェック．行末にスペース入れない．
// 可読性優先．高速化次点．
// まずは全探索，分割，次にDP
// 制限を見る．境界に注意．求めたい量の変域．動かせる量．
// 偶奇，逆から，ソート，出現回数，出現位置，DP， 余事象，包除
// データ構造． 問題の特徴量．単調性，二分探索
// 存在判定：構成方法，入力の特徴
// gcd, lcm ,素因数分解．
// 例外を十分に含む一般化．想像力の限界
// 小さい系から例示
// 代数的処理．前処理によるクエリ高速化．
// 始めは過剰に例示・場合分けしてもいい．各場合を確実に対処．
// 自明な例から処理，除外．
// 小数のときは，精度の設定する．doubel 変数に数値を入力するときは 123. とする．
// テストケース作成は数表あり
// 実行エラー：vector添え字超え．0割り．



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

int main() {
int a, b;
cin >> a >> b;
bool ans = true;
for (int i = 0; i <= 10000; ++i)
{
	if (i*2/25 == a && i/10 == b)
	{
		cout << i << endl;
		ans = false;
		break;
	}
}
if (ans)
{
	cout << -1 << endl;
}
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[] val = new int[3];
        for (int x = 0; x < 3; x++) val[x] = scanner.nextInt();
        int sum = 0;
        Arrays.sort(val);
        for(int y = 1; y<3; y++){
            sum = sum+ Math.abs(val[y]-val[y-1]);
        }
        System.out.println(sum);

    }

}


Measured memory_bytes: 22100
package main

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

func main() {
	sc := NewScanner()
	_, _, K := sc.NextInt(), sc.NextInt(), sc.NextInt()
	A := sc.NextIntArray()
	B := sc.NextIntArray()
	S1 := comb(A)
	S2 := comb(B)

	max := 0
	for i := 0; i < len(S1); i++ {
		q := K - S1[i]
		if q < 0 {
			continue
		}
		l := i + binarySearch(S2, q)
		if max < l {
			max = l
		}
	}

	fmt.Println(max)
}
func binarySearch(A []int, p int) int {
	l := 0
	r := len(A)
	for r-l > 1 {
		c := (r + l) / 2
		if p >= A[c] {
			l = c
		} else {
			r = c
		}
		//fmt.Println(p, A[c], c)
	}
	return l
}

func comb(A []int) []int {
	S := make([]int, len(A)+1)
	S[0] = 0
	for i := 0; i < len(A); i++ {
		S[i+1] = S[i] + A[i]
	}
	return S
}

type Scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewScanner() *Scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1000)
	return &Scanner{r: rdr}
}
func (s *Scanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *Scanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *Scanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}
func (s *Scanner) NextInt64() int64 {
	v, _ := strconv.ParseInt(s.Next(), 10, 64)
	return v
}

func (s *Scanner) NextFloat() float64 {
	v, _ := strconv.ParseFloat(s.Next(), 64)
	return v
}

func (s *Scanner) NextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)
			result = append(result, int(v))
			start = s.p + 1
		}
	}

	return result
}
func (s *Scanner) NextInt64Array() []int64 {
	s.pre()
	start := s.p
	result := []int64{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)
			result = append(result, v)
			start = s.p + 1
		}
	}
	return result
}

func (s *Scanner) NextMap() map[int]bool {
	s.pre()
	start := s.p
	mp := map[int]bool{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			mp[v] = true
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	mp[v] = true

	return mp
}

func (s *Scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *Scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}


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

using namespace std;

using ll = long long;
using ld = long double;
using P = pair<int, int>;
constexpr ld EPS = 1e-12;
constexpr int INF = numeric_limits<int>::max() / 2;
constexpr int MOD = 1e9 + 7;

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

    string a, b, c;
    while (cin >> a, a != "0")
    {
        cin >> b >> c;
        int n = a.length();
        vector<vector<ll>> dp(n + 1, vector<ll>(2, 0));
        dp[0][0] = 1;
        reverse(a.begin(), a.end());
        reverse(b.begin(), b.end());
        reverse(c.begin(), c.end());
        a = "$" + a;
        b = "$" + b;
        c = "$" + c;
        for (int i = 1; i <= n; i++)
        {
            int st = 0;
            if (i == n)
                st++;
            int a1, a2, b1, b2, c1, c2;
            if (a[i] == '?')
            {
                a1 = st;
                a2 = 9;
            }
            else
            {
                a1 = a[i] - '0';
                a2 = a[i] - '0';
            }
            if (b[i] == '?')
            {
                b1 = st;
                b2 = 9;
            }
            else
            {
                b1 = b[i] - '0';
                b2 = b[i] - '0';
            }
            if (c[i] == '?')
            {
                c1 = st;
                c2 = 9;
            }
            else
            {
                c1 = c[i] - '0';
                c2 = c[i] - '0';
            }
            for (int j = a1; j <= a2; j++)
            {
                for (int k = b1; k <= b2; k++)
                {
                    int gt = (j + k) % 10;
                    if (j + k >= 10)
                    {
                        if (c1 <= gt && gt <= c2)
                        {
                            dp[i][1] += dp[i - 1][0];
                            dp[i][1] %= MOD;
                        }
                    }
                    else
                    {
                        if (c1 <= gt && gt <= c2)
                        {
                            dp[i][0] += dp[i - 1][0];
                            dp[i][0] %= MOD;
                        }
                    }

                    gt = (j + k + 1) % 10;
                    if (j + k + 1 >= 10)
                    {
                        if (c1 <= gt && gt <= c2)
                        {
                            dp[i][1] += dp[i - 1][1];
                            dp[i][1] %= MOD;
                        }
                    }
                    else
                    {
                        if (c1 <= gt && gt <= c2)
                        {
                            dp[i][0] += dp[i - 1][1];
                            dp[i][0] %= MOD;
                        }
                    }
                }
            }
        }
        cout << dp[n][0] << endl;
    }
}



Measured memory_bytes: 3244
package main

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

func main() {
	sc := NewScanner()

	x := sc.ReadInt()

	money := 100
	for i := 1; ; i++ {
		money += money / 100
		if money >= x {
			fmt.Println(i)
			break
		}
	}
}

// util
// *   math/simple

func Abs(x int) int {
	if x >= 0 {
		return x
	}
	return -x
}

func Min(values ...int) int {
	if len(values) == 0 {
		panic("no values")
	}
	min := values[0]
	for _, v := range values {
		if v < min {
			min = v
		}
	}
	return min
}

func Max(values ...int) int {
	if len(values) == 0 {
		panic("no values")
	}
	max := values[0]
	for _, v := range values {
		if v > max {
			max = v
		}
	}
	return max
}

func Pow(base int, exponent uint) int {
	answer := 1
	for i := uint(0); i < exponent; i++ {
		answer *= base
	}
	return answer
}

// *   io

type Scanner struct {
	bufScanner *bufio.Scanner
}

func NewScanner() *Scanner {
	bufSc := bufio.NewScanner(os.Stdin)
	bufSc.Split(bufio.ScanWords)
	bufSc.Buffer(nil, 100000000)
	return &Scanner{bufSc}
}

func (sc *Scanner) ReadString() string {
	bufSc := sc.bufScanner
	bufSc.Scan()
	return bufSc.Text()
}

func (sc *Scanner) ReadInt() int {
	bufSc := sc.bufScanner
	bufSc.Scan()
	text := bufSc.Text()

	num, err := strconv.Atoi(text)
	if err != nil {
		panic(err)
	}
	return num
}


Measured memory_bytes: 1756
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define vi vector<int>
#define vl vaector<long>
#define vll vector<long long int>
#define vC  vector<char>
#define F first
#define S second
#define FastIO ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define db(...) ZZ(#__VA_ARGS__, __VA_ARGS__)
ll pow(ll x, ll y,ll m) { ll res = 1;x=x%m; while (y > 0) { if (y & 1) res = ((res%m) * (x%m))%m; y = y >> 1; x = ((x%m) * (x%m))%m; } return res%m; }
template <typename Arg1> void ZZ(const char* name, Arg1&& arg1){std::cerr << name << " = " << arg1 << endl;}
template <typename Arg1, typename... Args>void ZZ(const char* names, Arg1&& arg1, Args&&... args)
{
	const char* comma = strchr(names + 1, ',');
	std::cerr.write(names, comma - names) << " = " << arg1;
	ZZ(comma, args...);
}
const ll INF = 0xFFFFFFFFFFFFFFFL;
clock_t time_p=clock();
void abhigyan10()
{time_p=clock()-time_p;cerr<<"Time Taken : "<<(float)(time_p)/CLOCKS_PER_SEC<<"\n";}
ll seed;
mt19937 rng(seed=chrono::steady_clock::now().time_since_epoch().count());
inline ll rnd(ll l=0,ll r=INF){return uniform_int_distribution<ll>(l,r)(rng);}
#define clrbuf cin.ignore(numeric_limits<streamsize>::max(),'\n');
#define preciset(x) cout<<setprecision(x)<<fixed;
const ll mod =1000000007;
ll f[200005];
int main()
{
        FastIO

        ll n,d,a,ans=0,temp,mul,i,j;

        cin>>n>>d>>a;
        vector<pair<int,int>> x(n);
        for(i=0;i<n;i++) cin>>x[i].F>>x[i].S;

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

        j=1;
    	for(i=0;i<n;i++)
    	{
            if(i-1>=0)
            f[i]+=f[i-1];

    		  while(j<n)
              {
                if(x[j].F-x[i].F<=2*d)
                    j++;
                
                    else
                        break;
              }
              j--;

            //db(ans,j,i,f[i],x[i].S);
            if(x[i].S> f[i]*a)
            {

                temp=x[i].S-f[i]*a;
                mul = temp/ a;
                if(temp%a!=0)
                    mul++;
                ans+=mul;
                f[i]+=mul;
                f[j+1]-=mul;

            }
            
    	}

        cout<<ans;
        return 0;
    }



Measured memory_bytes: 3584
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((ll)(x).size())
#define len(x) ((ll)(x).length())

long long mod_pow(long long x, long long n, long long mod = 1e9 + 7) {
    long long ans = 1;
    while(n > 0) {
        if ((n % 2) == 0) {
            x = (x * x) % mod;
            n >>= 1;
        }
        else {
            ans = (ans * x) % mod;
            n--;
        }
    }
    return ans;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());
    ll m, n;
    cin >> m >> n;
    cout << mod_pow(m, n) << endl;
    return 0;
}



Measured memory_bytes: 3212
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <list>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <array>
#include <cassert>
#include <bitset>
using namespace std;
using LL = long long;

//????????????????????????????´?????????´?????????????????§???????????°??¨
template<typename T, typename Comp>
class RMQ_modify {
private:
	const T DEF;//??????????????????
	vector<T> seg;//????????????
	int width;//?????°??¨??????(???????????§????????§????????????)
	vector<T>lazy;//?????¶?????????
	vector<T>flag;//?????¶??????????????????

	//k??????????????????[l,r)????????¶???????????????
	void eval(int k, int l, int r) {
		if (flag[k]) {
			seg[k] = lazy[k];
			if (r - l > 1) {
				lazy[2 * k + 1] = lazy[k]; flag[2 * k + 1] = true;
				lazy[2 * k + 2] = lazy[k]; flag[2 * k + 2] = true;
			}
			lazy[k] = T();
			flag[k] = false;
		}
	}
	T query_raw(int a, int b, int l, int r, int k) {
		eval(k, l, r);
		if (b <= l || r <= a)return DEF;
		if (a <= l && r <= b)return seg[k];
		T vl = query_raw(a, b, l, (l + r) / 2, 2 * k + 1);
		T vr = query_raw(a, b, (l + r) / 2, r, 2 * k + 2);
		return min(vl, vr, Comp());
	}
	void update_raw(int a, int b, T x, int l, int r, int k) {
		eval(k, l, r);
		if (b <= l || r <= a)return;
		if (a <= l && r <= b) {
			lazy[k] = x;
			flag[k] = true;
			eval(k, l, r);
		}
		else {
			update_raw(a, b, x, l, (l + r) / 2, 2 * k + 1);
			update_raw(a, b, x, (l + r) / 2, r, 2 * k + 2);
			seg[k] = min(seg[2 * k + 1], seg[2 * k + 2], Comp());
		}
	}
public:
	//?????????n?????????????????????def????????°??¨?????????
	RMQ_modify(int n, T def) :DEF(def) {
		width = 1;
		while (width < n)width *= 2;
		seg.assign(width * 2 - 1, DEF);
		lazy.assign(seg.size(), T());
		flag.assign(seg.size(), false);
	}
	//??????[a,b)????????????????????????
	T query(int a, int b) { return query_raw(a, b, 0, width, 0); }
	//??????[a,b)???????§???????x???????????????
	void update(int a, int b, T x) { update_raw(a, b, x, 0, width, 0); }
	//???????????¨???????????????
	void init(const vector<T>&vec) {
		for (int i = 0; i < min(width, (int)vec.size()); i++)
			seg[i + width - 1] = vec[i];
		for (int i = width - 2; i >= 0; i--)
			seg[i] = min(seg[i * 2 + 1], seg[i * 2 + 2], Comp());
		fill(lazy.begin(), lazy.end(), T());
		fill(flag.begin(), flag.end(), false);
	}
};

int main() {
	int N, Q;
	cin >> N >> Q;
	RMQ_modify<int, less<int>>tree(N, INT_MAX);
	for (int i = 0; i < Q; ++i) {
		int com;
		cin >> com;
		if (com) {
			int s, t; cin >> s >> t;
			cout << tree.query(s, t + 1) << endl;
		}
		else {
			int s, t, x; cin >> s >> t >> x;
			tree.update(s, t + 1, x);
		}
	}
	return 0;
}

Measured memory_bytes: 5992
#include <iostream> // {{{
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <algorithm>
#include <cstdio> // }}}

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

using ll = long long;

using namespace std;


int main() {
    int h,w;
    int c[10][10];
    int a[200][200];
    cin >> h >> w;
    rep(i,10)rep(j,10)cin >> c[i][j];
    rep(i,h)rep(j,w)cin >> a[i][j];

    for (int k=0; k<10; k++){
        for (int i=0; i<10; i++) {
            for (int j=0; j<10; j++) {
                c[i][j] = min(c[i][j], c[i][k]+c[k][j]);
            }
        }
    }

    int sum = 0;
    rep(i,h) {
        rep(j,w) {
            if (a[i][j] != -1) sum += c[a[i][j]][1];
        }
    }
    cout << sum << endl;
    return 0;
}


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

using namespace std;



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

    vector<int> vec(3);
    cin>>vec[0]>>vec[1]>>vec[2];
    sort(vec.begin(), vec.end());

    cout<<vec[0]+vec[1]<<endl;


    return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<cstring>
#include<iostream>
using namespace std;

main()
{
	char x,y;
	scanf(" %c %c",&x,&y);
	if(x<y) printf("<\n");
	if(x>y) printf(">\n");
	if(x==y) printf("=\n");
		
	
}


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

int main(){
    string s;
    int k;
    cin>>s>>k;

    for(int i=0; i<(int)s.size(); i++){
        if(k >= ('z' - s[i] + 1) && s[i] != 'a'){
            k -= ('z' - s[i] + 1);
            s[i] = 'a';
        }
    }

    k %= 26;
    int ende = (int)s.size()-1;
    for(int i=0; i<k; i++){
        if(s[i] == 'z') s[i] = 'a';
        s[ende]++;
    }

    cout<<s<<endl;
}


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

int main()
{
  int n, m;
  cin >> n >> m;
  ll success = (n - m) * 100;

  ll p = pow(2, m);

  ll ans = (1900 * m + success) * p;

  cout << ans << endl;
}


Measured memory_bytes: 4044
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<map>
#include <algorithm>
#include<cstdlib>
#include<cmath>
#include<deque>
#include <numeric>
#include<valarray>
typedef unsigned long long ull;
typedef  long long ll;

int main() {
	std::vector<ll>  a(5);
	ll sumk= 0;

	ll minmod = 10;
	ll indexmod = 0;
	for (int i = 0; i < 5; i++) {
		std::cin >> a[i];
		ll tmpk = a[i] % 10;
		if ((tmpk > 0) && (tmpk < minmod)) {
			minmod = tmpk;
			indexmod= i;
		}
	}
	for (int i = 0; i < 5; i++) {

		if (i != indexmod) a[i] = ((a[i] + 9) / 10) * 10;
		sumk += a[i];
	}
	std::cout << sumk << std::endl;

	return 0;
}

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

using namespace std;

int main()
{
	int N;
	int L[201];
	int result = 0;
	cin >> N;
	for(int i=0;i<2*N;i++) cin >> L[i];
	sort(L, L + 2 * N);
	for(int i=0;i<2*N;i+=2) result += L[i];
	cout << result << endl;
	
	return 0;	
}

Measured memory_bytes: 256
n, y = gets.chomp.split.map(&:to_i)

(0..n).each do |i|
  (0..n-i).each do |j|
    k = n-i-j
    if y == 10000 * i + 5000 * j + 1000 * k
      puts [i, j, k] * " "
      exit
    end
  end
end
puts [-1, -1, -1] * " "

Measured memory_bytes: 1788
#include <cstdio>
#define ll long long
#define MAXN 105
ll a[MAXN];

ll gcd(ll x, ll y) {	
	return x % y ? gcd(y, x % y) : y;
}
ll lcm(ll x, ll y) {
	return x / gcd(x, y) * y; 
}
int main() {
	ll n, ans = 1ll, num;
	scanf("%lld", &n);
	for(int i = 1; i <= n; i++) {
		scanf("%lld", &num);
		ans = lcm(ans, num);
	}
	printf("%lld\n", ans);
	return 0;
}

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


void solve(long long S, long long W){
    if(W >= S){
        cout << "unsafe" << endl;
    }else{
        cout << "safe" << endl;
    }
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long S;
    scanf("%lld",&S);
    long long W;
    scanf("%lld",&W);
    solve(S, W);
    return 0;
}


Measured memory_bytes: 3652
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<map>
#include<vector>
#include<set>
#include<queue>
#include<algorithm>
#include<stack>
#include<cstdlib>
#include<deque>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int>P;
const int len=1e3+5;
const ll mod=998244353;
const ull seed=131;
int dx[4]={1,-1,0,0};
int dy[4]={0,0,-1,1};
char dd[len][len];
int n,m;
int x,y;
void dfs(int i,int j)
{
	if(dd[i][j]=='.')y++;
	else if(dd[i][j]=='#')x++;
	char ch=dd[i][j];
	dd[i][j]='!';
	for(int u=0;u<4;++u)
	{
		int xx=i+dx[u];
		int yy=j+dy[u];
		if(dd[xx][yy]!='!'&&xx>=1&&xx<=n&&yy>=1&&yy<=m&&ch!=dd[xx][yy])
		{
			dfs(xx,yy);
		}
	}
}
int main()
{	
	cin>>n>>m;
	for(int i=1;i<=n;++i)scanf("%s",dd[i]+1);
	ll ans=0;
	for(int i=1;i<=n;++i)
	{
		for(int j=1;j<=m;++j)
		{
			if(dd[i][j]!='!')
			{
				x=0;
				y=0;
				dfs(i,j);
				ans+=(ll)x*y;
			}
		}
	}
	cout<<ans<<endl;
}




Measured memory_bytes: 8192
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 998244353;

ll n, k, ans, fi[500005] = {1}, fac[500005] = {1};

ll calc (ll A, ll B) {
	if(B == 0) return 1;
	ll R = calc(A, B/2);
	R = R * R % mod;
	if(B&1) R = R * A % mod;
	return R;
}

ll comb (ll A, ll B) {
	if(B < 0 || A < B) return 0;
	return fac[A] * fi[B] % mod * fi[A-B] % mod;
}

ll solve (ll A, ll B) {
	if(A == B) return solve(A, B-1);
	ll C = max(0ll, n - A + B);
	if(C > B) return 0;
	return comb(A+B, B) - comb(A+B, C-1);
}

int main()
{
	scanf("%lld%lld",&n,&k);
	for(ll i=1;i<=k;i++) {
		fac[i] = fac[i-1] * i % mod;
		fi[i] = fi[i-1] * calc(i, mod-2) % mod;
	}
	for(ll i=(k+1)/2;i<=k;i++) {
		ans = (ans + solve(i, k-i)) % mod;
	}
	printf("%lld\n",ans);
}


Measured memory_bytes: 8064
from sys import stdin
N = int(input())
A = [{'value': int(x[1]), 'type': x[0]} for x in stdin.readline().split(' ')]
S = 'Stable'
NS = 'Not stable'


def bubble_sort(arr):
    for i in range(N):
        for j in range(N - 1, i, -1):
            if arr[j]['value'] < arr[j - 1]['value']:
                arr[j], arr[j - 1] = (arr[j - 1], arr[j])
    return arr


def selection_sort(arr):
    for i in range(0, N):
        minj = i
        for j in range(i, N):
            if arr[j]['value'] < arr[minj]['value']:
                minj = j
        arr[i], arr[minj] = (arr[minj], arr[i])
    return arr


A_bubble = bubble_sort(A.copy())
A_selection = selection_sort(A.copy())


def is_stable(origin, arr):
    for i in range(N):
        for j in range(i+1, N):
            for a in range(0, N):
                for b in range(a+1, N):
                    if (arr[i]['value'] == arr[j]['value']) & \
                            (arr[i] == origin[b]) & (arr[j] == origin[a]):
                        return False

    return True


print(' '.join(map(lambda x: x['type'] + str(x['value']), A_bubble)))
print(S)

print(' '.join(map(lambda x: x['type'] + str(x['value']), A_selection)))
if (is_stable(A_bubble, A_selection)):
    print(S)
else:
    print(NS)



Measured memory_bytes: 5620