akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
ll llmax = LLONG_MAX;
string ALP = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
string alp = "abcdefghijklmnopqrstuvwxyz";
vi d1 = {1, 0, -1, 0}, d2 = {0, 1, 0, -1};
void Yes() {cout << "Yes" << endl;}
void No() {cout << "No" << endl;}
void YES() {cout << "YES" << endl;}
void NO() {cout << "NO" << endl;}
void neg() {cout << -1 << endl;}

int main() {
  ll n;
  cin >> n;
  vs s(n);
  ll mm = 0, aa = 0, rr = 0, cc = 0, hh = 0;
  for (ll i = 0; i < n; i++) {
    cin >> s[i];
    if (s[i][0] == 'M') mm++;
    else if (s[i][0] == 'A') aa++;
    else if (s[i][0] == 'R') rr++;
    else if (s[i][0] == 'C') cc++;
    else if (s[i][0] == 'H') hh++;
  }
  vll march(0);
  if (mm > 0) march.push_back(mm);
  if (aa > 0) march.push_back(aa);
  if (rr > 0) march.push_back(rr);
  if (cc > 0) march.push_back(cc);
  if (hh > 0) march.push_back(hh);
  if (march.size() < 3) cout << 0 << endl;
  else {
    ll ans = 0;
    for (ll i = 0; i < march.size(); i++) {
      for (ll j = i + 1; j < march.size(); j++) {
        for (ll k = j + 1; k < march.size(); k++) {
          ans += march[i] * march[j] * march[k];
        }
      }
    }
    cout << ans << endl;
  }
}

Measured memory_bytes: 6144
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define R cin>>
#define Z class
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
template<Z A>void pr(A a){cout<<a;ln;}
template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);}
template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);}
template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);}
template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}
const ll MAX=1e9+7,MAXL=1LL<<61,dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};
typedef pair<int,int> P;

ll n,a[444],d[444],dp[444][444];

ll dfs(ll l,ll r) {
  if(r<=l) return 0;
  if(dp[l][r]!=-1) return dp[l][r];
  dp[l][r]=MAXL;
  REP(i,l,r) {
    dp[l][r]=min(dp[l][r],dfs(l,i)+dfs(i+1,r)+d[r+1]-d[l]);
  }
  return dp[l][r];
}
void Main() {
  memset(dp,-1,sizeof(dp));
  R n;
  rep(i,n) R a[i];
  rep(i,n) d[i+1]=d[i]+a[i];
  pr(dfs(0,n-1));
}

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


Measured memory_bytes: 1792
MOD = 10**9+7
H, W = map(int, input().split())
a = [input() for _ in range(H)]

dp = [[0] * W for _ in range(H)]
dp[0][0] = 1
for i in range(H):
    for j in range(W):
        if j+1 < W:
            if a[i][j+1] != '#':
                dp[i][j+1] += dp[i][j] % MOD
        if i+1 < H:
            if a[i+1][j] != '#':
                dp[i+1][j] += dp[i][j] % MOD
            
print(dp[H-1][W-1] % MOD)

Measured memory_bytes: 49236
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <atcoder/math>

using std::cin;
using std::cout;
using std::endl;
using std::terminate;
using atcoder::floor_sum;

void solve() {
    long long N, M, A, B; cin >> N >> M >> A >> B;
    cout << floor_sum(N, M, A, B) << endl;
}

int main() {

#ifdef DEV
    std::ifstream in("input");
    cin.rdbuf(in.rdbuf());

    int t; cin >> t;
    for (int x = 1; x <= t; ++x) {
        solve();
    }
#else
    int t; cin >> t;
    for (int x = 1; x <= t; ++x) {
        solve();
    }
#endif

    return 0;
}


Measured memory_bytes: 3596
#!/usr/bin/env python3
import bisect
import heapq
import itertools
import math
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from math import gcd
from operator import add, itemgetter, mul, xor
def cmb(n,r,mod):
  bunshi=1
  bunbo=1
  for i in range(r):
    bunbo = bunbo*(i+1)%mod
    bunshi = bunshi*(n-i)%mod
  return (bunshi*pow(bunbo,mod-2,mod))%mod
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def I(): return int(input())
def LI(): return list(map(int,input().split()))
def MI(): return map(int,input().split())
def LLI(n): return  [list(map(int, input().split())) for _ in range(n)]

x = I()
m = 100
ans = 0
while m < x:
    m = (m*0.01)//1 + m
    ans += 1
print(ans)


Measured memory_bytes: 10120
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	int a, b, c, k;
	cin >> a >> b >> c >> k;
	int ans = 0;
	if(k >= a) {
		ans = a;
		k -= a;
	}
	else{
		cout << k << endl;
		return 0;
	}
	if(k >= b){
		k -= b;
	}
	else{
		cout << ans << endl;
		return 0;
	}
	cout << ans - k ;
	return 0;
}

Measured memory_bytes: 3652
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define Graph vector<vector<int>>
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1000000007;

// #include <boost/multiprecision/cpp_dec_float.hpp>
// #include <boost/multiprecision/cpp_int.hpp>
// namespace mp = boost::multiprecision;
// using Bint = mp::cpp_int;
// using Real = mp::number<mp::cpp_dec_float<1024>>;

vector<int> A(200);
int top;

void initialize(){
    top = 0;
}

bool isEmpty(){
    return top == 0;
}

bool isFull(){
    return top >= 200 - 1;
}

void push(int x){
    top++;
    A[top] = x;
}

int pop(){
    top--;
    return A[top + 1];
}

int main(){
    initialize();
    string tmp;
    int count = 0;
    while(cin >> tmp){
        if(tmp == "+"){
            int ope2 = pop(), ope1 = pop();
            push(ope1 + ope2);
        } else if(tmp == "-"){
            int ope2 = pop(), ope1 = pop();
            push(ope1 - ope2);
        } else if(tmp == "*"){
            int ope2 = pop(), ope1 = pop();
            push(ope1 * ope2);
        } else {
            // int s = 0;
            // rep(i, tmp.size()){
            //     s *= 10;
            //     s += tmp[i] - '0';
            // }
            // push(s);
            push(atoi(tmp.c_str()));
        }
    }
    cout << pop() << endl;
}


Measured memory_bytes: 3184
#include<iostream>
#include<cstring>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
using namespace std;
#define rep(i,s,n);for(int i = s;i<n;i++)
#define repe(i,s,n);for(int i = s;i<=n;i++)
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
static const ll maxLL = (ll)1 << 62;
const int INF = 1<<29;
const int MOD = 1000000009;

int main(){
    int n;
    cin>>n;
    int a[100010];
    a[0]=0;
    a[n+1]=0;
    rep(i,1,n+1)cin>>a[i];
    int s=0;
    rep(i,1,n+2){
        s+=abs(a[i]-a[i-1]);
    }
    rep(i,1,n+1){
        int x=abs(a[i-1]-a[i+1]);
        int y=abs(a[i-1]-a[i]);
        int z=abs(a[i]-a[i+1]);
        cout<<s+x-y-z<<endl;
    }
    return 0;
}

Measured memory_bytes: 1664
// In the name of Allah
// #Isart
// yedoone bashe, mashti bashe ...

#include<bits/stdc++.h>

#define int long long
#define pii pair<int, int>
#define pb push_back
#define F first
#define S second
#define ll long long
#define ld long double

using namespace std;

const int MAXN = 1e5 + 10;
int a[MAXN], cnt[MAXN];

int32_t main(){
	ios::sync_with_stdio(false); cin.tie(0);
	int n, sum = 0, s = 0, x;
	cin >> n;	
	for(int i = 0; i < n; i ++)
		cin >> a[i], sum += a[i];
	s = n * (n + 1) / 2;
	if(sum % s != 0) return cout << "NO", 0;
	x = sum / s;
	for(int i = 0; i < n; i ++){
		int j = (i - 1 + n) % n;
		if((x + a[j] - a[i]) % n != 0) return cout << "NO", 0;
		cnt[j] = (x - a[i] + a[j]) / n;
	}
	for(int i = 0; i < n; i ++)
		if(cnt[i] < 0) return cout << "NO", 0;
	cout << "YES" << endl;
	return 0;	
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i) 
#define PI acos(-1)

using namespace std;
using ll = long long;
using P = pair<int, int>;
using LP = pair<ll, ll>;

int dfs(int v, vector<vector<int>>& to, vector<bool>& visited, vector<int>& day) {
    if (visited[v]) return day[v];
    visited[v] = true;
    
    int ret = 1;
    for (auto e : to[v]) {
        int res = dfs(e, to, visited, day);
        if (res == -1) return -1;
        ret = max(ret, res + 1);
    }
    day[v] = ret;
    return ret;
}

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

    int N;
    cin>>N;
    int max_n = N * (N - 1) / 2;
    vector<vector<int>> as(N, vector<int>(N));
    rep(i, N) {
        rep(j, N - 1) {
            int a;
            cin>>a; a--;
            as[i][j] = a;
        }
    }
    vector<vector<int>> id(N, vector<int>(N));
    int d = 0;
    rep(i, N) rep(j, N) {
        if (i < j) id[i][j] = d++;
    }

    vector<vector<int>> to(max_n);
    rep(i, N) {
        rep(j, N - 1) {
            if (i > as[i][j]) as[i][j] = id[as[i][j]][i];
            else as[i][j] = id[i][as[i][j]];
        }
        rep(j, N - 2) {
            to[as[i][j + 1]].push_back(as[i][j]);
        }
    }

    int ans = 0;
    vector<bool> visited(max_n);
    vector<int> day(max_n, -1);
    rep(i, max_n) {
        int res = dfs(i, to, visited, day);
        if (res == -1) {
            cout<<-1<<endl;
            return 0;
        }
        ans = max(ans, res);
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 37632
#include <iostream>
#include <fstream>
#include <unistd.h>
#include <sys/stat.h>
#include <stdio.h>
#include <vector>
#include <cmath>
#include <random>
#include <string.h>      //文字列の代入に使う
#include <bits/stdc++.h> //piの利用で必要(M_PI)
#include <algorithm>
#include <climits>
#include <map>
#define rep(i, c) for (int i = 0; i < (int)c; i++) //atcoderの解説コードに利用されていたので，ある程度一般生があるかと思われる．

int main()
{
    int N;
    std::cin >> N;

    std::map<std::string, int> S;
    rep(i, N)
    {
        std::string temp;
        std::cin >> temp;
        S[temp]++;
    }

    int maxnum = 0;
    for (const auto &x : S)
    {
        int num = x.second;
        maxnum = std::max(maxnum, num);
    }
    for (auto it = S.begin(); it != S.end(); it++)
    {
        if (it->second == maxnum)
        {
            std::cout << it->first << std::endl;
        }
    }
    return 0;
}


Measured memory_bytes: 25216
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()
#define dbg(x) cerr << #x << ": " << x << endl
int main() {
  string s, t;
  int a, b;
  string u;
  cin >> s >> t >> a >> b >> u;
  if(s == u) a--;
  if(t == u) b--;
  cout << a << ' ' << b << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
using namespace std;

int main(){
    string s, ans;
    cin >> s;
    if((s[0] == s[1] || s[2] == s[3]) && s[1] == s[2]) ans = "Yes";
    else ans = "No";
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  os << "(" << p.first << "," << p.second << ")";
  return os;
}
#ifdef __LOCAL
#define debug(x) cerr << __LINE__ << ": " << #x << " = " << x << endl
#define debugArray(x, n)                           \
  cerr << __LINE__ << ": " << #x << " = {";        \
  for (long long hoge = 0; (hoge) < (n); ++(hoge)) \
    cerr << ((hoge) ? "," : "") << x[hoge];        \
  cerr << "}" << endl
#else
#define debug(x) (void(0))
#define debugArray(x, n) (void(0))
#endif

template <int mod>
struct ModInt {
  int x;
  ModInt() : x(0) {}
  ModInt(int64_t y) : x(y >= 0 ? y % mod : (mod - (-y) % mod)) {}
  ModInt &operator+=(const ModInt &p) {
    if ((x += p.x) >= mod) x -= mod;
    return *this;
  }
  ModInt &operator-=(const ModInt &p) {
    if ((x += mod - p.x) >= mod) x -= mod;
    return *this;
  }
  ModInt &operator*=(const ModInt &p) {
    x = (int)(1LL * x * p.x % mod);
    return *this;
  }
  ModInt &operator/=(const ModInt &p) { return *this *= p.inverse(); }
  ModInt operator-() const { return ModInt() - *this; }
  ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }
  ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }
  ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }
  ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }
  bool operator==(const ModInt &p) const { return x == p.x; }
  bool operator!=(const ModInt &p) const { return x != p.x; }
  ModInt inverse() const {
    int a = x, b = mod, u = 1, v = 0, t;
    while (b) t = a / b, swap(a -= t * b, b), swap(u -= t * v, v);
    return ModInt(u);
  }
  ModInt pow(int64_t e) const {
    ModInt ret(1);
    for (ModInt b = *this; e; e >>= 1, b *= b)
      if (e & 1) ret *= b;
    return ret;
  }
  friend ostream &operator<<(ostream &os, const ModInt &p) { return os << p.x; }
  friend istream &operator>>(istream &is, ModInt &a) {
    int64_t t;
    is >> t;
    a = ModInt<mod>(t);
    return (is);
  }
  static int modulo() { return mod; }
};

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  using Mint = ModInt<int(1e9 + 7)>;
  int N;
  cin >> N;
  vector<vector<int>> tree(N);
  for (int i = 0; i < N - 1; i++) {
    int A, B;
    cin >> A >> B;
    A--, B--;
    tree[A].push_back(B);
    tree[B].push_back(A);
  }
  int sz[N];
  vector<int> subsz[N];
  function<void(int, int)> dfs = [&](int v, int p) {
    sz[v] = 1;
    for (int u : tree[v])
      if (u != p) {
        dfs(u, v);
        sz[v] += sz[u];
        subsz[v].push_back(sz[u]);
      }
    subsz[v].push_back(N - sz[v]);
  };
  dfs(0, -1);
  Mint ans = 0, inv2 = Mint(2).inverse();
  for (int v = 0; v < N; v++) {
    Mint tmp = inv2 - inv2.pow(N);
    for (int x : subsz[v]) tmp -= inv2.pow(N - x) * (Mint(1) - inv2.pow(x));
    ans += tmp;
  }
  cout << ans << '\n';
  return 0;
}


Measured memory_bytes: 41364
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
/*辺をデカイ順にソートし、前から最大辺を選び、残り二辺をその和
が最大辺より大きくなるように選ぶ
*/

int main() {
  int N;
  cin >> N;
  vector<int> L(N);
  rep(i,N){
      cin >> L[i];
  }
  sort(L.begin(),L.end());
  reverse(L.begin(),L.end());

  ll ans = 0;
  for(int i = 0;i<=N-3;i++){
      for(int j = i+1;j<=N-2;j++){
          int lb = j;
          int ub = N;
          while(ub -lb > 1){
              int mid = (lb +ub)/2;
              if(L[mid] <= L[i] - L[j]){
                  ub = mid;
              }
              else lb = mid;
          }
          ans += ub - j  -1;
          //初めてL[i] - L[j] >= L[k]となるKを二部探索 
          
      }
  }
  cout << ans << endl;
}


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

// #define int long long
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define SORT(v, n) sort(v, v + n);
#define REVERSE(v, n) reverse(v, v+n);
#define vsort(v) sort(v.begin(), v.end());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
#define PI (acos(-1))
#define FILL(v, n, x) fill(v, v + n, x);
#define sz(x) int(x.size())

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vs = vector<string>;
using vpll = vector<pair<ll, ll>>;
using vtp = vector<tuple<ll,ll,ll>>;
using vb = vector<bool>;

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

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



signed main()
{
  cin.tie( 0 ); ios::sync_with_stdio( false );
  ll n; cin>>n;
  ll ans=0;
  
  ll cnt=1;
  while(cnt<=n){
    if(cnt%3==0&&cnt%5==0){
    }else if(cnt%3==0){
      
    }else if(cnt%5==0){
      
    }else{
      ans+=cnt;
    }
    cnt++;
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 3652
#include<iostream>
#include<algorithm>
#include<stdio.h>
using namespace std;
int main(){
 int a,b;
cin >> a >> b;
if(a==1) a+=13;
if(b==1) b+=13;
if(a>b)cout<<"Alice"<< endl;
else if(a<b)cout<<"Bob"<< endl;
else cout<<"Draw"<< endl;
return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define endl '\n'
#define ll long long
#define double long double
using namespace std;
const ll inf = 1000000000000000000;

typedef pair<ll, ll> para;
map<para, bool> m1;
unordered_map<ll, ll> col, row;
set<ll> cols, rows;
set<para> myset;
set<para>::iterator it;
ll n, m, q, x, y, ans;

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n >> m >> q;
    for (ll i = 1; i <= q; ++i) {
        cin >> x >> y;
        m1[make_pair(x, y)] = true;
        ++col[y];
        cols.insert(y);
        rows.insert(x);
        ++row[x];
    }
    ans = -inf;
    for (auto iter:cols)
        myset.insert(make_pair(col[iter], iter));
    for (auto iter:rows) {
        it = prev(myset.end());
        ans = max(ans, row[iter] + col[it->second] - m1[make_pair(iter, it->second)]);
        while (it != myset.begin() && m1[make_pair(iter, it->second)])
            --it;
        ans = max(ans, row[iter] + col[it->second] - m1[make_pair(iter, it->second)]);
    }
    cout << ans;
    return 0;
}


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

int main(void)
{
    int h, n, a , sum = 0;

    scanf("%d %d",&h,&n);
    while(n--)
    {
        scanf("%d",&a);
        sum+=a;
    }
    if(sum>=h)
        printf("Yes");
    else
        printf("No");

    return 0;
}


Measured memory_bytes: 128
import sys
input = sys.stdin.readline
from collections import defaultdict
from heapq import heappop, heappush

class Graph(object):

    def __init__(self):
        self.graph = defaultdict(list)

    def add_edge(self, a, b, w):
        self.graph[a].append((b, w))


class Dijkstra(object):
    def __init__(self, graph, s):
        self.g = graph.graph
        self.dist = defaultdict(lambda: float('inf'))
        self.dist[s] = 0

        self.Q = []
        heappush(self.Q, (self.dist[s], s))
        while self.Q:
            dist_u, u = heappop(self.Q)
            if self.dist[u] < dist_u:
                continue
            for v, w in self.g[u]:
                alt = dist_u + w
                if self.dist[v] > alt:
                    self.dist[v] = alt
                    heappush(self.Q, (alt, v))

    def s_d(self, goal):
        return self.dist[goal]


xs, ys, xg, yg = list(map(int, input().split()))
xyr = []
xyr.append([xs, ys, 0])
N = int(input())

for i in range(N):
    xyr.append(list(map(int, input().split())))
xyr.append([xg, yg, 0])

g_a = Graph()
for i in range(N + 1):
    for j in range(i + 1, N + 2):
        R = ((xyr[i][0] - xyr[j][0]) * (xyr[i][0] - xyr[j][0]) + (xyr[i][1] - xyr[j][1]) * (xyr[i][1] - xyr[j][1]))
        R = R ** 0.5
        if R > xyr[i][2] + xyr[j][2]:
            r = R - xyr[i][2] - xyr[j][2]
        else:
            r = 0
        g_a.add_edge(i, j, r)
        g_a.add_edge(j, i, r)

d_a = Dijkstra(g_a, 0)
print(d_a.s_d(N + 1))

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

using namespace std;
using LL = long long;
using P = pair<int, int>;
using Tapris = tuple<int, int, int>;

#define REP(i, n) for(LL i = 0; i < n; ++i)
#define FOR(i, a, n) for(LL i = a; i < n; ++i)
#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()

const int INF = (int)1e9;
const LL INFL = (LL)1e15;
const int MOD = 1e9 + 7;

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

//#define int long long

/*************** using variables ***************/
int n, m;
vector<int> a, b, c;
bool used[105][105];
/**********************************************/

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

    cin >> n >> m;
    a.resize(m);
    b.resize(m);
    c.resize(m);

    int dp[105][105];
    REP(i, n) REP(j, n) if(i == j) dp[i][j] = 0; else dp[i][j] = INF;
    
    REP(i, m) {
        cin >> a[i] >> b[i] >> c[i];
        a[i]--; b[i]--;
        dp[a[i]][b[i]] = c[i];
        dp[b[i]][a[i]] = c[i];
    } 
    
    REP(k, n) REP(i, n) REP(j, n){
        dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j]);
    }
    
    int ans = 0;
    REP(k, m){
        bool flag = false;
        REP(i, n){
            REP(j, n){
                if(dp[i][a[k]] + c[k] + dp[b[k]][j] == dp[i][j]) flag = true;
            }
        }
        if(!flag) ans++;
    }
    
    cout << ans << endl;

}


Measured memory_bytes: 384
require("fs").readFileSync("/dev/stdin","utf8").split('\n').map(function(i){z=i.split(' '),a=z[0]-z[3],b=z[1]-z[4],c=+z[2],f=+z[5],r=Math.sqrt(a*a+b*b);c?console.log(r>c+f?0:r<c-f?2:r<f-c?-2:1):0})

Measured memory_bytes: 7644
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#define rep(i,e)for(int i=0;i<e;i++)
using namespace std;

int main(){
    int n, m;
    int i, j;
    cin >> n >> m;
    int A[n][m];
    int b[m];
    rep(i,n){
        rep(j,m) cin >> A[i][j];
    }
    rep(i,m) cin >> b[i];
    rep(i,n){
    int s=0;
        rep(j,m)s += A[i][j] * b[j];
        cout << s <<endl;
    }
    return 0;
}


Measured memory_bytes: 3128
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef long double ld;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  vector<int> a(n);
  vector<pair<int, int>> xy[n];
  REP(i, n) {
    cin >> a[i];
    REP(j, a[i]) {
      int x, y;
      cin >> x >> y;
      xy[i].push_back(make_pair(x - 1, y));
    }
  }
  int ans = 0;
  REP(i, (1 << n)) {
    int sub = 0;
    bool flag = false;
    REP(j, n) {
      int p = 0;
      if(i & (1 << j)) {
        sub++;
        p = 1;
      }
      REP(k, a[j]) {
        int h = (p == 1 ? xy[j][k].second : 1 - xy[j][k].second);
        if(p == 1) {
          if((h == 1 && !(i & (1 << xy[j][k].first))) ||
             (h == 0 && (i & (1 << xy[j][k].first)))) {
            flag = true;
            break;
          }
        }
      }
      if(flag) break;
    }
    if(flag) continue;
    ans = max(ans, sub);
  }
  cout << ans << '\n';
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define start_routine cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(false); int begtime = clock();
#define end_routine int endtime = clock(); cerr << endl << "Time elapsed: " << (endtime - begtime)*1000/CLOCKS_PER_SEC << " ms"; return 0
#define contests_de_diya_kar 0
#define PB push_back
#define MP make_pair
#define int long long
#define MOD ((long long) (1000*1000*1000 + 7))
#define inf (int) 2e15
#define exit(a, b) return cout << a, b;
#define eps (double)1e-8
#define forn(a, b, i) for (int i = a; i < b; i += 1)
#define vi vector<int>
#define vb vector<bool>
#define all(v) v.begin(), v.end()
#define ll long long 
#define pii pair<int, int>
#define mii map<int, int> 
#define print(stuff) cout << stuff << endl
#define len(stuff) stuff.size()

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

	int a[n];
	int prod = 1;
	int sum = 0;
	forn(0, n, i) cin >> a[i];
	forn(0, n, i) a[i]--;
	forn(0, n, i) sum += a[i];
	print(sum);
	end_routine;
}


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

int main() {
  int H, W; cin >> H >> W;
  vector<vector<char> > grid(H, vector<char>(W));
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      cin >> grid[i][j];
    }
  }
  vector<bool> yoko(H, false);
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      if (grid[i][j] == '#') {
        yoko[i] = true;
        break;
      }
    }
  }
  vector<bool> tate(W, false);
  for (int i = 0; i < W; i++) {
    for (int j = 0; j < H; j++) {
      if (grid[j][i] == '#') {
        tate[i] = true;
        break;
      }
    }
  }
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      if (yoko[i] && tate[j]) {
        cout << grid[i][j];
      }
    }
    if (yoko[i]) {
      cout << endl;
    }
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <time.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll MOD = 1e9 + 7/*998244353*/;
const ll INF = 1LL << 60;
ll mod_pow(ll, ll, ll); ll mod_fact(ll, ll); ll mod_inv(ll, ll); ll gcd(ll, ll); ll lcm(ll, ll);
//
int main(){
    int n;
    cin >> n;
    vector<int> a(n + 1);
    for(int i = 1; i <= n; i++) cin >> a[i];
    int ans = 0;
    for(int i = 1; i <= n; i++){
        if((i % 2) & (a[i] % 2)) ans++;
    }
    cout << ans << "\n";
}

Measured memory_bytes: 3596
fun main(args: Array<String>) {
    val map = mutableMapOf<Char, String>()
    map['a'] = readLine()!!
    map['b'] = readLine()!!
    map['c'] = readLine()!!

    var turn = map['a']!![0]
    map['a'] = map['a']!!.substring(1)

    while (true) {
        if (map[turn]!!.isEmpty()) {
            break
        }
        val oldTurn = turn
        turn = map[turn]!![0]
        map[oldTurn] = map[oldTurn]!!.substring(1)
    }

    println(turn.toUpperCase())
}

Measured memory_bytes: 33692
#include <cstdio>
#include <vector>
#define repi(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)

int N, Y;
const int C[3] = { 10, 5, 1 };
bool fl = false;
std::vector<int> v;

bool dfs( int i, int amount, int cnt )
{
  if( i == 3 )
    return amount == 0 && cnt == N;

  for( int j = 0; j <= amount/C[i]; ++j )
  {
    if( cnt+j > N || (i+1 == 2 && cnt+j+amount-j*C[i] != N) )
      continue;

    v.push_back( j );
    if( dfs( i+1, amount-j*C[i], cnt+j ) )
      return true;
    v.pop_back();
  }

  return false;
}

int main()
{
  scanf( "%d%d", &N, &Y );
  
  bool fl = dfs( 0, Y/1000, 0 );

  if( !fl )
    puts("-1 -1 -1");
  else rep( i, 3 )
    printf( "%d%c", v[i], i==2?'\n':' ' );

  return 0;
}

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

using namespace std;

using int64 = long long;

constexpr int DEBUG = 0;

vector<int> FindMatchAllByRollingHash(const string& s, const string& key) {
  if (s.length() < key.length()) return {};

  constexpr int64 P1 = 1000000007;
  constexpr int64 P2 = 999999937;
  constexpr int64 B = 257;

  int m = key.length();
  int64 bm1 = 1;
  int64 bm2 = 1;
  for (int i = 0; i < m; i++) {
    bm1 = bm1 * B % P1;
    bm2 = bm2 * B % P2;
  }
  int64 kh1 = 0;
  int64 kh2 = 0;
  for (int i = 0; i < m; i++) {
    kh1 = (kh1 * B + key[i]) % P1;
    kh2 = (kh2 * B + key[i]) % P2;
  }

  vector<int> positions;
  int64 h1 = 0;
  int64 h2 = 0;
  for (int i = 0; i < m; i++) {
    h1 = (h1 * B + s[i]) % P1;
    h2 = (h2 * B + s[i]) % P2;
  }

  if (h1 == kh1 && h2 == kh2) {
    positions.push_back(0);
  }

  for (int i = 1; i + m <= s.length(); i++) {
    h1 = (h1 * B + s[i + m - 1]) % P1;
    h1 = (h1 + P1 - (bm1 * s[i - 1] % P1)) % P1;
    h2 = (h2 * B + s[i + m - 1]) % P2;
    h2 = (h2 + P2 - (bm2 * s[i - 1] % P2)) % P2;
    if (h1 == kh1 && h2 == kh2) {
      positions.push_back(i);
    }
  }
  return positions;
}

int Max(const vector<int>& xs) {
  int value = INT32_MIN;
  for (int x : xs) value = max(x, value);
  return value;
}

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

  string s, t;
  cin >> s >> t;
  string extended_s(s);
  while (extended_s.length() < s.length() + t.length()) {
    extended_s.append(s);
  }

  vector<int> matches = FindMatchAllByRollingHash(extended_s, t);
  vector<int> is_match(s.length());
  for (int match : matches) {
    if (match < s.length()) {
      is_match[match] = 1;
    }
  }

  vector<int> visited(s.length(), -1);
  vector<int> dp(s.length(), -1);
  function<void(int)> dfs = [&](int v) {
    if (visited[v] == 1) return;

    if (visited[v] == 0) {
      visited[v] = 1;
      dp[v] = INT32_MAX;
      return;
    }

    if (is_match[v] == 0) {
      visited[v] = 1;
      dp[v] = 0;
      return;
    }

    visited[v] = 0;
    int next_v = (v + t.length()) % s.length();
    dfs(next_v);
    if (dp[next_v] == INT32_MAX) dp[v] = INT32_MAX;
    else dp[v] = dp[next_v] + 1;
    visited[v] = 1;
  };

  for (int i = 0; i < s.length(); i++) dfs(i);

  int max = Max(dp);
  cout << ((max == INT32_MAX) ? -1 : max) << endl;
}


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

int main(){
	long long n,t,Min=-1;
	cin>>n;
	for(int i=0;i<5;i++){
		cin>>t;
		if(Min==-1) Min=t;
		Min=min(Min,t);
	}
	cout<<(n-1)/Min+5;
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void) {

  int seq[5];
  int i,j,temp;

  scanf("%d %d %d %d %d",&seq[0],&seq[1],&seq[2],&seq[3],&seq[4]);

  for(i=0;i<4;i++) {
    for(j=0;j<4-i;j++) {
      if(seq[j]<seq[j+1]) {
	temp=seq[j];
	seq[j]=seq[j+1];
	seq[j+1]=temp;
      }
    }
  }

  for(i=0;i<5;i++) {
    if(i==0) printf("%d",seq[i]);
    else printf(" %d",seq[i]);
  }

  puts("");
  
  return 0;
}

Measured memory_bytes: 0
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#define REP(i, n) for(int i = 0; i < (int)(n); ++i)

using namespace std;

int vs[30];

int main(void) {
  int n;
  cin >> n;
  int res = 0;
  REP(i, n) {
    cin >> vs[i];
    bool isOK = true;
    REP(j, i) {
      if(vs[j] > vs[i]) {
        isOK = false;
        break;
      }
    }
    if(isOK) {
      ++res;
    }
  }
  cout << res << endl;
  
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w",stdout);
    #endif
    
    ll a,b,c,d;
    cin>>a>>b>>c>>d;
    int sum = 0;

    while(d>0){


        if(a>0){
            sum += min(a,d);
            d -= min(a,d);
            a = 0;
        }else{

            
            if(b>0){
                d -= min(b,d);
                b = 0;
            }else{
                sum -= min(c,d);
                d-= min(c,d);
                c= 0;
            }

        }

    }

    cout<<sum<<endl;
}

Measured memory_bytes: 3652
N = input()
cnt = 0
for i in range(1, len(N)):
  if i % 2 == 1:
    cnt += 9 * 10**(i-1)
if len(N) % 2 == 1:
  cnt += (int(N) - 10**(len(N)-1)) + 1
print(cnt)

Measured memory_bytes: 2940
#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>
#include<queue>
#include<map>
#define all(x) (x).begin(),(x).end()
#define print(x) cout << (x) << endl
typedef long long ll;
const ll MOD = 1000000007;
const ll MOD2 = 998244353;
 
using namespace std;

int main(){
    int N, H;   cin >> N >> H;
    vector<int> a(N), b(N);
    for(int i=0; i<N; i++)  cin >> a[i] >> b[i];
    sort(all(a),greater<int>());
    sort(all(b),greater<int>());
    int maxa = a[0], cnt = 0;
    for(int i=0; i<N; i++){
        if(b[i] > maxa){
            cnt++;
            H -= b[i];
        }
        if(H <= 0){print(cnt);return 0;}
    }
    cnt += (H - 1) / maxa;
    cnt++;
    print(cnt);
}

Measured memory_bytes: 4064
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
template<class T> using vc = vector<T>;
template<class T> using vvc = vector<vector<T>>;

#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repr(i, n) for (ll i = (n)-1; i >= 0; i--)
#define repe(i, l, r) for (ll i = (l); i < (r); i++)
#define reper(i, l, r) for (ll i = (r)-1; i >= (l); i--)
#define repa(i,n) for (auto& i: n)

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;}
struct init{init(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}}init_;

#ifdef DEBUG
template <class T, class N> void verr(const T& a, const N& n) { rep(i, n) cerr << a[i] << " "; cerr << "\n" << flush; }
ll dbgt = 1; void err() { cerr << "passed " << dbgt++ << "\n" << flush; }
template<class H, class... T> void err(H&& h,T&&... t){ cerr<< h << (sizeof...(t)?" ":"\n") << flush; if(sizeof...(t)>0) err(forward<T>(t)...); }
#endif

const ll INF = 4e18;
const ld EPS = 1e-11;
const ld PI = acos(-1.0L);
const ll MOD = 1e9 + 7;
// const ll MOD = 998244353;
//--------------------------------------------------------------------------------//
ll dp[3004][3004];

int main() {
    string S, T;
    cin >> S >> T;
    ll sn = S.size(), tn = T.size();

    rep(i, sn){
        rep(j, tn){
            if (S[i] == T[j]) chmax(dp[i + 1][j + 1], dp[i][j] + 1);
            chmax(dp[i + 1][j + 1], max(dp[i + 1][j], dp[i][j + 1]));
        }
    }

    string ans;

    ll ti = tn - 1, si = sn - 1;
    while(ti >= 0 and si >= 0){
        while (ti >= 0 and dp[si + 1][ti + 1] == dp[si + 1][ti]) ti--;
        if (ti < 0) break;
        while (si >= 0 and dp[si + 1][ti + 1] == dp[si][ti + 1]) si--;
        if (si < 0) break;

        ans += S[si];
        ti--, si--;
    }

    reverse(all(ans));
    cout << ans << endl;
}

Measured memory_bytes: 73936
#define _CRT_SECURE_NO_WARNINGS
#define _SCL_SECURE_NO_WARNINGS
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#include <algorithm>
#include <functional>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <limits>
#include <numeric>
#include <valarray>
#include <fstream>
#include <array>
#include <random>
#include <unordered_set>
#include <unordered_map>

using namespace std;
using uint = uint32_t;
using LL = int64_t;
using ULL = uint64_t;
using PP = pair<LL, LL>;
template <typename T> using PriorityQ = priority_queue<T, vector<T>, greater<T> >;
#define REP(i, a, n) for(LL i = (a), i##_max_ = (n); i < i##_max_; ++i)
#define REM(i, a, n) for(LL i = (LL)(n) - 1, i##_min_ = (a); i >= i##_min_; --i)
#define FLOAT fixed << setprecision(16)
#define SPEEDUP { cin.tie(NULL); ios::sync_with_stdio(false); }
const int INF = 0x3FFFFFFF;
const LL INFLL = 0x3FFFFFFF3FFFFFFF;
const double INFD = 1.0e+308;
const double EPS = 1.0e-9;

void YesNo(bool b) { cout << (b ? "Yes" : "No") << endl; }
void YESNO(bool b) { cout << (b ? "YES" : "NO") << endl; }
template <class T, class U> istream& operator>>(istream& ist, pair<T, U>& right) { return ist >> right.first >> right.second; }
template <class T, class U> ostream& operator<<(ostream& ost, const pair<T, U>& right) { return ost << right.first << ' ' << right.second; }
template <class T, class TCompatible, size_t N> void Fill(T(&dest)[N], const TCompatible& val) { fill(dest, dest + N, val); }
template <class T, class TCompatible, size_t M, size_t N> void Fill(T(&dest)[M][N], const TCompatible& val) { for (int i = 0; i < M; ++i) Fill(dest[i], val); }
template <class T> T Next() { T buf; cin >> buf; return buf; }
istream& Ignore(istream& ist) { string s; ist >> s; return ist; }
bool Inside(int i, int j, int h, int w) { return i >= 0 && i < h && j >= 0 && j < w; }

#ifdef ONLY_MY_ENVIR
#include "IntMod.h"
#include "Algebraic.h"
#include "BinaryMatrix.h"
#include "BinaryTree.h"
#include "Bipartite.h"
#include "BIT.h"
#include "DynamicMod.h"
#include "Factorization.h"
#include "FFT.h"
#include "FlowSolver.h"
#include "Graph.h"
#include "LazySegmentTree.h"
#include "Math.h"
#include "Matrix.h"
#include "MinCostFlowSolver.h"
#include "MinMax.h"
#include "Numbers.h"
#include "Polynomial.h"
#include "Position.h"
#include "Range.h"
#include "Rational.h"
#include "SegmentTree.h"
#include "SegmentTree2D.h"
#include "SlidingWindow.h"
#include "SuffixArray.h"
#include "Tree.h"
#include "UnionFind.h"
#endif

#ifdef __GNUC__
typedef __int128 LLL;
istream& operator>>(istream& ist, __int128& val) { LL tmp; ist >> tmp; val = tmp; return ist; }
ostream& operator<<(ostream& ost, __int128 val) { LL tmp = val; ost << tmp; return ost; }
#endif

int main() {
	int n;
	cin >> n;
	
	REP(i, 0, 60000) {
		int s = i * 108 / 100;
		if (s == n) {
			cout << i << endl;
			return 0;
		}
	}
	cout << ":(" << endl;
	return 0;
}


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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
const int maxn = 2e6 + 10;
const double eps = 1e-8;
const ll mod = 1e9 + 7;
const ull base = 131;
const ull mod1 = 1e9 + 9;
const ull mod2 = 1610612741;

inline int read()
{
    int x = 0, f = 1;
    char ch = getchar();
    while(ch < '0' || ch > '9'){
        if (ch == '-')
            f = -1;
        ch = getchar();
    }
    while(ch >= '0' && ch <= '9'){
        x = (x<<1) + (x<<3) + (ch^48);
        ch = getchar();
    }
    return x * f;
}

char s[maxn];
bool t[4];

int main()
{
    scanf("%s", s+1);
    for (int i = 1; s[i]; ++i)
        if (s[i] == 'W') t[0] = 1;
        else if (s[i] == 'S') t[1] = 1;
        else if (s[i] == 'E') t[2] = 1;
        else t[3] = 1;
    if (t[0]^t[2] || t[1]^t[3]) printf("No\n");
    else printf("Yes\n"); 
    return 0;
}



Measured memory_bytes: 3164
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, L;
  cin >> N >> L;
  vector<string> S(N);
  for (int i = 0; i < N; i++) {
    cin >> S[i];
    //sort(S[i].begin(), S[i].end());
  }
  sort(S.begin(), S.end());
  for (int i = 0; i < N; i++) {
    cout << S[i] << flush;
  }
  cout << endl;
  return 0;
}

Measured memory_bytes: 3572
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <string>
#include <utility>

using namespace std;

int main() {
  int a[3];
  for (int i = 0; i < 3; i++) {
    cin >> a[i];
  }
  if (a[0] == a[1] + a[2]) {
    cout << "Yes" << endl;
  } else if (a[1] == a[0] + a[2]) {
    cout << "Yes" << endl;
  } else if (a[2] == a[0] + a[1]) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }

  return 0;
}


Measured memory_bytes: 256
#if __has_include("../library/Basic/Debug.hpp")

#include "../library/Basic/Debug.hpp"

#else

/* ----- Header Files ----- */
// IO
#include <cstdio>
#include <iomanip>
#include <ios>
#include <iostream>

// algorithm
#include <algorithm>
#include <cmath>
#include <numeric>

// container
#include <vector>
#include <string>
#include <tuple>
#include <complex>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>

// others
#include <random>
#include <limits>
#include <functional>
#include <ctime>
#include <cassert>
#include <cstdint>


/* ----- Type Alias ----- */
using Bool = bool;
using Int = long long int;
using Real = long double;
using Char = char;
using String = std::string;
template <class T, class U>
using Pair = std::pair<T, U>;
template <class... Ts>
using Tuple = std::tuple<Ts...>;

template <class T>
using Vector = std::vector<T>;
template <size_t N>
using Bits = std::bitset<N>;
template <class T>
using Queue = std::queue<T>;
template <class T>
using Stack = std::stack<T>;
template <class T>
using Deque = std::deque<T>;

template <class T>
using MaxHeap = std::priority_queue<T>;
template <class T>
using MinHeap = std::priority_queue<T, std::vector<T>, std::greater<T>>;
template <class T>
using Set = std::set<T>;
template <class T, class U>
using Map = std::map<T, U>;

template <class T, class... Us>
using Func = std::function<T(Us...)>;

template <class T>
T genv(T v) { return v; }

template <class T, class... Ts>
auto genv(size_t l, Ts... ts) {
    return Vector<decltype(genv<T>(ts...))>(l, genv<T>(ts...));
}

template <class Cost = Int>
struct Edge {
    Int src, dst;
    Cost cost;
    Edge(Int src = -1, Int dst = -1, Cost cost = 1)
        : src(src), dst(dst), cost(cost){};

    bool operator<(const Edge<Cost>& e) const { return this->cost < e.cost; }
    bool operator>(const Edge<Cost>& e) const { return this->cost > e.cost; }
};

template <class Cost = Int>
using Edges = Vector<Edge<Cost>>;
template <class Cost = Int>
using Graph = Vector<Vector<Edge<Cost>>>;

#endif

/* ----- Misc ----- */
void fastio() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
}

struct Fout {
    Int precision;
    Fout(Int precision) : precision(precision) {}
};
std::ostream& operator<<(std::ostream& os, const Fout& fio) {
    os << std::fixed << std::setprecision(fio.precision);
    return os;
}


/* ----- Constants ----- */
// constexpr Int INF = std::numeric_limits<Int>::max() / 3;
// constexpr Int MOD = 1000000007;
// constexpr Real PI = acos(-1);
// constexpr Real EPS = 1e-10;
// std::mt19937 mt(int(std::time(nullptr)));

int main() {
    Int n;
    std::cin >> n;
    Vector<Int> h(n);
    for (auto& x : h) std::cin >> x;

    Int ans = 0, cnt = 0;
    for (Int i = 0; i + 1 < n; ++i) {
        if (h[i] >= h[i + 1]) {
            ++cnt;
            ans = std::max(ans, cnt);
        } else {
            cnt = 0;
        }
    }

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


Measured memory_bytes: 1024
S = input()
A = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
ans = "None"
for a in A:
    if a not in S:
        ans = a
        break
print(ans)


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

#define all(x)        (x).begin(),(x).end()
#define eb            emplace_back
#define mp            make_pair
#define pb            push_back
#define fi            first
#define se            second
#define sz(x)         ((int)(x).size())
#define rep(x,y,z)    for(int x=y;x<z;x++)
#define per(x,z,y)    for(int x=z-1;x>=y;x--)
#define trav(y,x)     for(auto& y:x)
#define pii           pair<int, int>
#define pll           pair<ll, ll>
#define vi            vector<int>
#define vpi           vector<pii>

int dbg = 0;
#define cri           if(0)
#define shame         cri cerr<<(++dbg)<<"\n\n";

// aaaaaaaaaaaaaaaa
void solve() {
  int N, M;
  scanf("%d%d", &N, &M);
  
  vi H(N);
  rep(i, 0, N) 
    scanf("%d", &H[i]);
  
  int a, b;
  vi mx(N, 0);
  rep(i, 0, M) {
    scanf("%d%d", &a, &b);
    --a, --b;
    mx[a] = max(mx[a], H[b]);
    mx[b] = max(mx[b], H[a]);
  }

  int ans = 0;
  rep(i, 0, N)
    if (H[i] > mx[i])
      ans++;
  printf("%d\n", ans);
}

int main() {
  // int _; scanf("%d", &_); while (_--)
  // ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  // int _; cin >> _; while(_--)
  solve();
	return 0;
}


Measured memory_bytes: 4028
package main

import (
	"fmt"
	"strings"
)

func main() {
	var h, w int
	template := strings.Repeat("#.", 151)

	for {
		fmt.Scan(&h, &w)
		if h == 0 && w == 0 {
			break
		}
		for i := 0; i < h; i++ {
			if i%2 == 0 {
				fmt.Println(template[0:w])
			} else {
				fmt.Println(template[1 : w+1])
			}
		}
		fmt.Println()
	}
}



Measured memory_bytes: 1132
#include <iostream>
using namespace std;
int main(){
  int inc = 1;
  int a, b, c;
  int ret = 0;
  cin >> a >> b >> c;
  for(; b >= a; a++){
    if(c % a == 0){
      ret++;
    }
  }

  cout <<  ret << endl;
}


Measured memory_bytes: 3092
#include <bits/stdc++.h>
const long long MOD = 1000000007;
const int INF = INT_MAX / 2;
const long double PI = 3.1415926;
#define FOR(i, r, n) for(int i=(ll)(r); i<(ll)(n); i++) 
#define REP(i, n) FOR(i, (0), n)
#define ALL(r) r.begin(), r.end()
#define ll long long int
#define vci vector<ll>
#define vcs vector<string>
#define vcp vector<pair<ll, ll>>
#define vct vector<tuple<ll, ll, ll>>
using namespace std;
//vector<vector<ll>> vv(n, vector<ll>(n));

typedef int Weight;
struct Edge
{
	int from, to; Weight cost;
	bool operator < (const Edge& e) const { return cost < e.cost; }
	bool operator > (const Edge& e) const { return cost > e.cost; }
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;
void add_edge(Graph &g, int from, int to, Weight cost)
{
	g[from].push_back(Edge{ from, to, cost });
}

int main()
{
	ll n, m;
	cin >> n >> m;
	Graph g(n);
	REP(i, m)
	{
		ll a, b;
		cin >> a >> b;
		add_edge(g, a - 1, b - 1, 1);
		add_edge(g, b - 1, a - 1, 1);
	}
	if (m == 1)
	{
		cout << "IMPOSSIBLE" << endl;
		return 0;
	}
	for (auto e : g[0])
	{
		if (e.cost)
		{
			ll dest = e.to;
			for (auto tmp : g[dest]) {
				if (tmp.cost&&tmp.to == n - 1) {
					cout << "POSSIBLE" << endl;
					return 0;
				}
			}
		}
	}
	cout << "IMPOSSIBLE" << endl;
}

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

int main()
{
    int n,k;
    string s;
    cin>>n>>k>>s;
    int change=0,twoplus=0;
    int len=s.length();
    for(int i=1;i<len;i++){
        if(s[i]!=s[i-1]){
            change++;
        }
        else{
            twoplus++;
        }
    }
    if(change==1||change==0||(change>1&&2*k>=change)) cout<<n-1;
    if(change>1&&2*k<change) cout<<2*k+twoplus;
}


Measured memory_bytes: 512
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int r = sc.nextInt();
        
        if(n >= 10){
            System.out.println(r);
        }
        else{
            System.out.println(r+100*(10-n));
        }
    }
}

Measured memory_bytes: 21844
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<tuple>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define Per(i,sta,n) for(int i=n-1;i>=sta;i--)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef long double ld;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ll, ll> LP;
int dx[4]={1,-1,0,0};
int dy[4]={0,0,1,-1};

int n;
ll k;
ll num=0;
int a[200010];
int dub[200010][64];



void solve(){
    cin >> n >> k;
    rep(i,n){
        cin >> dub[i][0];dub[i][0]--;
    }
    // for(int c:cycle){
    //     cout << c << endl;
    // }
    rep(j,63){
        rep(i,n){
            dub[i][j+1]=dub[dub[i][j]][j];
        }
    }
    int pos=0;
    rep(j,63){
        if(k&(1ll << j)){
            pos=dub[pos][j];
        }
    }
    cout << pos+1 << endl;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(50);
    solve();
}

Measured memory_bytes: 53624