akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>

int main(void) {
	int n, b, f, r, v;
	int i, j, k;
	char hall[4][3][10];
	
	//配列を初期化する
	for(i = 0; i< 4; i++) {
	    for(j = 0; j < 3; j++) {
	        for(k = 0; k < 10; k++) {
	            hall[i][j][k] = 0;
	        }
	    }
	}
	
	//情報の数を入力する
	scanf("%d", &n);
	//情報の数ぶん、値を入力する
	for(i = 0; i < n; i++) {
	    scanf("%d%d%d%d", &b, &f, &r, &v);
	    
	    //該当する部屋に人数を加える(vがマイナスだったら減らす)
	    hall[b-1][f-1][r-1] += v;
	    
	    if(hall[b-1][f-1][r-1] > 9) {
	        hall[b-1][f-1][r-1] = 9;
	    }
	    if(hall[b-1][f-1][r-1] < 0) {
	        hall[b-1][f-1][r-1] = 0;
	    }
	    
	}
	
	//入居者数を出力する
	for(i = 0; i< 4; i++) {
	    for(j = 0; j < 3; j++) {
	        for(k = 0; k < 10; k++) {
	            printf(" %d", hall[i][j][k]);
	        }
	        printf("\n");
	    }
	    //#を出力する。最後は出力しない
	    if(i < 3) {
	        printf("####################\n");
	    }
	}
	
	return 0;
}


Measured memory_bytes: 2144
// コンテスト後に実装
//
// http://drken1215.hatenablog.com/entry/2020/01/26/234000 
// の方法(3) スライド最小値の考えを使う


#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>


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

#define REP(i,n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i,a,b) for(int i = (a); i < (int)(b); ++i)
#define ALL(c) (c).begin(), (c).end()
#define SIZE(v) ((int)v.size())

#define pb push_back
#define mp make_pair
#define mt make_tuple

int main(void)
{
    cin.sync_with_stdio(false);

    ll N, D, A;
    cin >> N >> D >> A;

    // 爆弾の終端と、モンスターの位置を両方扱うqueue
    // 爆弾より先にモンスターが取り出されるようにするため、
    // モンスターの値に-1をかけておく
    using P = pair<ll, ll>;
    priority_queue<P, vector<P>, greater<P>> q;

    REP(n, N) {
        ll x, h;
        cin >> x >> h;
        q.push({x, -h});
    }

    ll damage = 0;
    ll ans = 0;
    while(!q.empty()) {
        auto p = q.top(); q.pop();

        // 爆弾の終端
        if (p.second > 0) {
            damage -= p.second;
        }
        // モンスター
        else {
            ll hp = -p.second;
            hp -= damage;
            if (hp > 0) {
                ll need_num = (hp + A - 1) / A;
                damage += need_num * A;
                ans += need_num;
                q.push({p.first + 2 * D, need_num * A});
            }
        }
    }
    cout << ans << endl;

    return 0;
}


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

using namespace std;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define sz(x) ll(x.size())
typedef long long ll;

const ll INF = 1001001001;


int main() {

    string s;
    cin >> s;

    int n = s.size();
    vector<int> ans(n);

    rep(r1, 2) {
        {
            int count = 0;
            rep(i, n) {
                if (s[i] == 'R') count++;
                else {
                    ans[i] += count / 2;
                    ans[i - 1] += (count + 1) / 2;
                    count = 0;
                }
            }
        }

        reverse(ans.begin(), ans.end());
        reverse(s.begin(), s.end());
        rep(i, n) {
            if (s[i] == 'L')s[i] = 'R';
            else s[i] = 'L';
        }

    }

    rep(i, n) {
        cout << ans[i] << ' ';
    }
    cout << endl;
}


Measured memory_bytes: 1024
#include <iostream>
#include <array>
#include <algorithm>
#include <vector>
#include <bitset>
#include <set>
#include <unordered_set>
#include <cmath>
#include <complex>
#include <deque>
#include <iterator>
#include <numeric>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <limits>
#include <iomanip>
#include <functional>
#include <cassert>
using namespace std;

using ll=long long;
template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;
using vll = V<ll>;
using vvll = V<vll>;
#define ALL(v) v.begin(),v.end()
template < class T > inline bool chmax(T& a, T b) {if (a < b) { a=b; return true; } return false; }
template < class T > inline bool chmin(T& a, T b) {if (a > b) { a=b; return true; } return false; }
#define DEBUG_VLL(vec) for(int sz=0;sz<int(vec.size());sz++) std::cerr<<vec[sz]<<(sz==vec.size()-1?'\n':' ');

const long long MOD = 1000000007;
const long long HIGHINF = (long long)1e18;
const int INF = (int)1e9;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    vll a(n);
    for (int i = 0; i < n; i++) cin >> a[i];
    vll dp1(n + 1, -HIGHINF), dp2(n + 1, -HIGHINF);
    dp1[0] = 0;
    for (int i = 0; i < n; i++) {
        chmax(dp1[i + 1], max(dp1[i] + a[i], dp2[i] - a[i]));
        chmax(dp2[i + 1], max(dp1[i] - a[i], dp2[i] + a[i]));
    }
    // DEBUG_VLL(dp1)
    // DEBUG_VLL(dp2)

    cout << dp1.back() << '\n';
    return 0;
}


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

int main(){
	string s; cin>>s;
	int n=s.size();
  bool flg=false;
	for(int i=0; i<n-1; i++){
		if(s[i]=='C'){
			for(int j=i+1; j<n; j++){
				if(s[j]=='F') {flg=true; break;}
			}
		}
	}
	if(flg) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
}

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

#define int        long long
// #define mp      make_pair
#define eb         emplace_back
#define pb         push_back
#define ss         second
#define ff         first
#define IOS        ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define mod        998244353
#define MOD        (1000*1000*1000+7)
#define MN         LLONG_MIN
#define MX         LLONG_MAX
#define v1d        vector<int>
#define v2d        vector<vector<int>>
#define vip        vector<pair<int,int> >
#define v1s        vector<string>
#define pa         pair<int,int>
#define mxpq(T)    priority_queue <T>
#define mnpq(T)    priority_queue<T,vector<T>,greater<T>>
#define print(v)   for(auto i:v)cout<<i<<" ";cout<<"\n";
#define p2d(v)     for(auto a:v){for(auto b:a)cout<<b<<" ";cout<<endl;}
#define p1d(v)     for(auto a:v)cout<<a<<" ";cout<<endl;
#define ppd(v)     for(auto a:v)cout<<a.ff<<" "<<a.ss<<endl;
#define endl       "\n"
#define input(b,n) for(int i=0;i<n;i++)cin>>b[i];
#define Sort(v)    sort(v.begin(),v.end())
#define RSort(v)   sort(v.rbegin(),v.rend())
#define all(v)     v.begin(),v.end()
int gcd(int a,int b){return b?gcd(b,a%b):a;}
//string s = bitset<64>(a).to_string();

void azmuth(int n=12){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cout<<setprecision(n)<<fixed;
    
}
int lb = 10000000;

//____________________________________________________________________________________

int n,m;
v2d v;
v1d vis;

void dfs(int s){
    // cout<<s<<"\n";
    vis[s] = 1;
    int t = 0;
    for(auto i:v[s]){
        if(!vis[i])dfs(i);
        t = max(t,vis[i]);
    }
    vis[s] = t+1;
}

void solve(){
    cin>>n>>m;
    v.resize(n+1);
    for(int i=0;i<m;i++){
        int a,b;cin>>a>>b;
        v[a].pb(b);
    }
    vis.resize(n+1);
    for(int i=1;i<=n;i++){
        if(!vis[i]){
            dfs(i);
        }
    }
    // p1d(vis);
    int ans = 0;
    for(int i=1;i<=n;i++)ans = max(ans,vis[i]-1);
    cout<<ans;
}

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


    return 0;
}

Measured memory_bytes: 9216
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
map<string, int> mp;
struct node
{
    int num;
    string str;

} ans[500010];
bool cmp(const node &a, const node &b)
{
    if (a.num != b.num)
        return a.num > b.num;
    return a.str < b.str;
}
int main()
{
    int n;
    ios::sync_with_stdio(0);
    cin >> n;
    int fg = 0;
    int x;

    string str;
    int cnt = 0;
    for (int i = 1; i <= n; i++)
    {
        cin >> str;
        if (!mp[str])
        {
            mp[str] = ++cnt;
            ans[cnt].str = str;
            ans[cnt].num = 0;
        }
        ans[mp[str]].num++;
    }
    sort(ans + 1, ans + 1 + cnt, cmp);
    cout << ans[1].str << endl;
    for (int i = 2; i <= cnt && ans[i].num == ans[i - 1].num; i++)
    {
        cout << ans[i].str << endl;
    }
    return 0;
}

Measured memory_bytes: 31616
#include <iostream>
#include <vector>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;

int main() {
	int n;
	cin >> n;
	vector<int> arr;
	int pre = 0;
	for(int i = 0; i < n; i++) {
		int c;
		cin >> c;
		if(pre!=c) {
			arr.push_back(c);
			pre = c;
		}
	}
	n = arr.size();
	vector<int> next(n,0);
	vector<int> last(200001,-1);
	for(int i = 0; i < n; i++) {
		if(last[arr[i]]!=-1) {
			next[last[arr[i]]] = i;
		}
		last[arr[i]] = i;
	}
	vector<ll> dp(n);
	dp[0] = 1;
	for(int i = 0; i < n-1; i++) {
		dp[i+1] = (dp[i+1]+dp[i])%MOD;
		if(next[i]>0) dp[next[i]] = (dp[next[i]]+dp[i])%MOD;
	}
	cout << dp[n-1] << endl;
}


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

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

  int D;
  cin >> D;

  vector<int> C(26);
  for (int i = 0; i < 26; ++i) cin >> C[i];

  vector<vector<int>> S(D, vector<int>(26));
  for (int i = 0; i < D; ++i) {
    for (int j = 0; j < 26; ++j) {
      cin >> S[i][j];
    }
  }

  vector<int> T(D);
  for (int i = 0; i < D; ++i) {
    cin >> T[i];
    --T[i];
  }

  int64_t res = 0;
  vector<int> last(26);
  for (int i = 0; i < D; ++i) {
    res += S[i][T[i]];
    last[T[i]] = i + 1;
    for (int j = 0; j < 26; ++j) {
      res -= C[j] * (i + 1 - last[j]);
    }
    cout << res << endl;
  }

  return 0;
}



Measured memory_bytes: 3576
#![allow(dead_code)]
#![allow(unused_imports)]
use std::cmp::{min, max};
use std::io::{BufWriter, stdin, stdout, Write};
const BITS: usize = 19;

#[derive(Default)]
struct Scanner {
    buffer: Vec<String>
}
impl Scanner {
    fn next<T: std::str::FromStr>(&mut self) -> T {
        loop {
            if let Some(token) = self.buffer.pop() {
                return token.parse().ok().expect("Failed parse");
            }
            let mut input = String::new();
            stdin().read_line(&mut input).expect("Failed read");
            self.buffer = input.split_whitespace().rev().map(String::from).collect();
        }
    }
}

fn main() {
    let mut scan = Scanner::default();
    let out = &mut BufWriter::new(stdout());

    let s = scan.next::<String>();
    let s = s.as_bytes();
    let t = scan.next::<String>();
    let t = t.as_bytes();

    let mut i: usize = 0;
    let mut count: i32 = 0;
    loop {
        if i == s.len() {
            break;
        }
        let a: u8 = s[i];
        let b: u8 = t[i];

        if a != b {
            count += 1;
        }
        i += 1;
    }

    writeln!(out, "{}", count);
}

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

vector<int>E[100000];
int ord[100000],low[100000],k;
bool used[100000];
vector<int>V;

void dfs(int v,int p){
	used[v]=true;
	ord[v]=low[v]=k++;
	bool flag=false;
	int cnt=0;
	for(auto u:E[v]){
		if(!used[u]){
			cnt++;
			dfs(u,v);
			low[v]=min(low[v],low[u]);
			if(low[u]>=ord[v])flag=true;
		}
		else if(u!=p){
			low[v]=min(low[v],ord[u]);
		}
	}
	if(p==-1){
		if(cnt>1)V.push_back(v);
	}
	else if(flag)V.push_back(v);
}
int main(){
	int v,e;scanf("%d%d",&v,&e);
	rep(i,e){
		int s,t;scanf("%d%d",&s,&t);
		E[s].push_back(t);
		E[t].push_back(s);
	}
	dfs(0,-1);
	sort(V.begin(),V.end());
	for(auto i:V)cout<<i<<endl;
}

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


const int mod = (int)1e+9 + 7;

int solve(vector<int>&a, int n, long long k){
    
    long long res1 = 0;
    vector<long long>original(n, 0);
    for(int i = 0; i < n; i++){
        for(int j = i+1; j < n; j++){
            if(a[i] > a[j]){
                res1 += 1;
            }
        }
    }
    
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            if(a[i] > a[j]){
                original[i] += 1;
            }
        }
    }
    
    long long final_result = ((k%mod)*(res1%mod))%mod;;
    for(int i = 0; i < n; i++){
        long long mul;
        if(k&1){
            mul = (long long)(k%mod)*(((k-1)/2)%mod);
        }else{
            mul = (long long)((k/2)%mod)*((k-1)%mod);
        }
        final_result += ((mul%mod)*original[i]%mod)%mod;
        //final_result %= mod;
    }
    
    
    return final_result%mod;
    
    
}





int main(){
    
    int n, k;
    cin >> n >> k;
    vector<int>a(n);
    for(int i = 0; i < n; i++){
        cin >> a[i];
    }
    
    cout << solve(a, n, (long long)k) << endl;
    
    
    
}


Measured memory_bytes: 3644
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep1(i, n) for(int i = 1; i < n+1; i++)
#define sort(A) sort(A.begin(),A.end())
#define reverse(A) reverse(A.begin(),A.end());

int main(){
  int a,b,k;
  cin >> a >> b >> k;
  map<int,int> mp;
  k = min(b-a+1,k);
  for(int i=a;i<=a+k-1;i++) mp[i]++;
  for(int i=b-k+1;i<=b;i++) mp[i]++;
  for(auto p : mp) cout << p.first << endl;
}

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

typedef long long ll;
const int N = 5005;
const ll mod = (ll)1e9 + 7;

int n, m;
string str;
ll dp[N][N];

ll fp(ll x, ll k){
    if(k == 0) return 1;
    ll hf = fp(x, k/2);
    return k % 2 ? hf * hf % mod * x % mod: hf * hf % mod;
}

int main(){
    cin >> n >> str;
    m = str.length();
    dp[0][0] = 1;
    for(int i = 1; i <= n; i++) {
        for(int j = 0; j <= n; j++) {
            if(j >= 1) dp[i][j] += 2 * dp[i-1][j-1];
            if(j == 0) dp[i][j] += dp[i-1][j];
            dp[i][j] += dp[i-1][j+1];
            dp[i][j] %= mod;
        }
    }
    cout << dp[n][m] * fp(fp(2, m), mod - 2) % mod << endl;

}


Measured memory_bytes: 195712
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <unordered_map>
#include <vector>
#include <string.h>
#include <set>

using namespace std;

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

template<class T> void printvec(const vector<T>& v) {
  for (auto x : v) { cout << x << " "; }
  cout << endl;
}
template<class T> void printtree(const vector< vector<T> >& tree) {
  for (long long i = 0; i < tree.size(); ++i) {
    cout << i + 1 << ": "; printvec(tree[i]);
  }
}
template<class T, class U> void printmap(const map<T, U>& mp) {
  for (auto x : mp) { cout << x.first << "=>" << x.second << endl; }
}

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

#define rep(i, n) for(ll i = 0; i < n; ++i)
#define all(s) s.begin(), s.end()
#define fr first
#define sc second
#define mp make_pair
#define pb push_back

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> triple;
typedef double D;

const ll INF = 1e9;
const ll MOD = 1000000007;  // 1e9 + 7

vector< vector<double >> dist; // Tree which contains the distance of i-j.

int main(int argc, char** argv) {
  cin.tie(NULL);
  cout.tie(NULL);
  ios_base::sync_with_stdio(false);
  cout << setprecision(10) << fixed;

  ll n;
  cin >> n;
  vector<double> x(n);
  vector<double> y(n);
  rep(i, n) {
    cin >> x[i];
    cin >> y[i];
  }
  // printvec(x);
  // printvec(y);

  dist.assign(n, vector<double>(n)); // Tree which contains the distance of i-j.
  rep(i, n) {
    for (int j = i + 1; j < n; ++j) {
      double d = sqrt(pow(x[i] - x[j], 2) + pow(y[i] - y[j], 2));
      dist[i][j] = d;
      dist[j][i] = d;
    }
  }

  vector<ll> a(n);
  rep(i, n) { a[i] = i; }

  double ans = 0;
  do {
    rep(i, n-1) {
      ans += dist[a[i]][a[i+1]];
    }
  } while (next_permutation(all(a)));

  ll divisor = 1;
  rep(i, n) {
    divisor *= i + 1;
  }

  cout << (ans / (double)divisor) << endl;
}


Measured memory_bytes: 256
N,K = map(int, input().split())
A_list = [int(e) for e in input().split()]

MOD_BY = 7 + 10**9
ans = 0

for i in range(N):
    for j in range(N):
        Bi = A_list[i]
        Bj = A_list[j]
        #print(Bi,Bj,end="")
        if Bi > Bj:
            if K > 1:
                if i < j:
                    ans += (K+1)*K//2
                else:
                    ans += K*(K-1)//2
            else:
                if i > j:
                    ans += 1
                    
        ans %= MOD_BY
        #print(ans)
print(ans)

Measured memory_bytes: 3188
s = input()
n = len(s)

sub_1 = s[0:int((n-1)/2)]
sub_1 == sub_1[::-1]

sub_2 = s[int(n+3/2):]
sub_2 == sub_2[::-1]

if(s==s[::-1] and sub_1 == sub_1[::-1] and sub_2 == sub_2[::-1]):
    print('Yes')
else:
    print('No')

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

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

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  string s;
  while (cin >> s, s != "0") {
    int a = 0, b = 0;
    for (int i = 1; i < int(s.size()); i++) {
      if (s[i] == 'A') a++;
      else b++;
    }
    if (a > b) cout << a + 1 << " " << b << endl;
    else cout << a << " " << b + 1 << endl;
  }

  return 0;
}


Measured memory_bytes: 3104
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF (INT_MAX / 4)
#define REP(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i)
#define ALL(a) (a).begin(), (a).end()
/* clang-format off */
#define TIMER_S(start) chrono::system_clock::time_point start = chrono::system_clock::now();
#define TIMER_E(end) chrono::system_clock::time_point end = chrono::system_clock::now();
#define TIME(start, end) cout << static_cast<double>(chrono::duration_cast<chrono::microseconds>(end - start).count()) << "ms" << "\n";
/* clang-format on */

int main() {
  int n, q, sum = 0;
  string s;
  cin >> n >> q >> s;
  vector<int> cnt(n, 0);
  REP(i, n - 1) {
    if (s.at(i) == 'A' && s.at(i + 1) == 'C') sum++;
    cnt.at(i+1) = sum;
  }
  REP(i, q) {
    int l, r;
    cin >> l >> r;
    cout << cnt.at(r - 1) - cnt.at(l - 1) << "\n";
  }
  return 0;
}


Measured memory_bytes: 1408
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  reverse(a.begin(), a.end());
  int ans = 1;
  vector<int> p;
  p.push_back(a[0]);
  for (int i = 1; i < n; i++) {
    int x = upper_bound(p.begin(), p.end(), a[i]) - p.begin();
    if (x >= p.size()) {
      p.push_back(a[i]);
      ans++;
    }
    else {
      p[x] = a[i];
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 1276
//PseudoName

    #pragma GCC optimize("O3")
    #include <bits/stdc++.h>
/*
	#include <ext/pb_ds/assoc_container.hpp>
	#include <ext/pb_ds/tree_policy.hpp>
	using namespace __gnu_pbds;
	template<class T> using oset=tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
*/
    #define FOR(i,n) for(i=0;i<n;i++)
    #define FOR1(i,n) for(i=1;i<=n;i++)
    #define FOR2(I, A, B) for (int I = (A); I <= (B); ++I)
    #define pb push_back
    #define unique_sort(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
    #define print(v) for(auto it:v)cout<<it<<" ";cout<<endl
    #define fast() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
    #define endl "\n"
    #define min3(a,b,c) min(a,min(b,c))
    #define forr(n) for(int i=0;i<n;i++)
    #define frr(n) for(int i=1;i<=n;i++)
    #define MAX 200005
    #define inf 200008

    using namespace std;

    typedef long long ll;
    typedef long li;
    typedef vector<int> vi;
    typedef vector<ll> vli;
    typedef vector<vi> vvi;
    typedef vector<vli> vvli;
    typedef pair<int,int> pi;
    typedef pair<ll,ll> pli;
    typedef vector<pi> vpi;
    typedef vector<pli> vpli;




    int main() {
        fast();
        int n,m;
        cin>>n>>m;
        ll a[n];
        forr(n)cin>>a[i];
        ll sum=0;

        forr(n)sum+=a[i];
        double k=((double)sum/(4*m));
        ll j=0;
        forr(n)
        {
            if(a[i]>=k)j++;
        }
        if(j<m)cout<<"No\n";
        else
            cout<<"Yes\n";
    }


Measured memory_bytes: 256
#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
#pragma GCC optimize("O3")
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define EPS (1e-9)
#define INF (1e17)
#define PI (acos(-1))
//const double PI = acos(-1);
//const double EPS = 1e-15;
//long long INF=(long long)1E17;
#define i_7 (long long)(1e9+7)
//#define i_7 998'244'353
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
long long po(long a, long b){
    if(b==0){
        return 1;
    }
    
    long long z = po(a,b/2);
    z = mod(z*z);
    if(b%2!=0){
        z = mod(a*z);
    }
    return z;
}
using namespace std;
//using namespace boost::multiprecision;

bool prime_(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd_(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd_(b,a%b);
  }
}
 
long long lcm_(long long x, long long y){
  return (x/gcd_(x,y))*y;
}



int main(){
  
  int h,w,k;
  cin>>h>>w>>k;
  k--;
  //0から出発した人がjにいるような、高さiまでの棒の配置の仕方の数
  long long dp[h+1][w] = {};
  dp[0][0] = 1;
  REP(i,h){
    REP(j,w){
      for(int b = 0; b < (1<<(w-1)); b++){
        bool flag = true;
        for(int a = 0; a<w; a++){
          if( (b & (1<<a)) && (b & (1<<(a+1))) ){
            flag = false;
            break;
          }
        }
        if(!flag)continue;
        int nj;
        if(b & (1<<j)){
          nj = j + 1;
        }else if(j > 0 && (b & (1<<(j-1)))){
          nj = j - 1;
        }else{
          nj = j;
        }
        dp[i+1][nj] += dp[i][j];
        dp[i+1][nj] = mod(dp[i+1][nj]);
      }
    }
  }
  long long ans = dp[h][k];
  cout<<ans<<endl;         
  return 0; 
}


Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
#include<vector>
#include<math.h>
#include<queue>
#include<map>
#include<algorithm>
#include<string.h>
#include<functional>
#include<limits.h>
#include<stdlib.h>
#include<string>
#include<unordered_map>
using namespace std;
 
#define intmax INT_MAX
#define lmax LONG_MAX
#define uintmax UINT_MAX
#define ulmax ULONG_MAX
#define llmax LLONG_MAX
#define ll long long
#define rep(i,a,N) for((i)=(a);(i)<(N);(i)++)
#define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--)
#define llfor ll i,j,k
#define sc(a) cin>>a
#define pr(a) cout<<a<<endl
#define pY puts("YES")
#define pN puts("NO")
#define py puts("Yes")
#define pn puts("No")
#define pnn printf("\n")
#define sort(a) sort(a.begin(),a.end())
#define push(a,b) (a).push_back(b)
#define llvec vector<vector<ll>>
#define charvec vector<vector<char>>
#define sizeoof(a,b) (a,vector<ll>(b))
#define llpvec vector<pair<ll,ll>>
/*繰り上げ除算*/ll cei(ll x,ll y){ll ans=x/y;if(x%y!=0)ans++;return ans;}
/*最大公約数*/ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
/*最小公倍数*/ll lcm(ll x,ll y){return x/gcd(x,y)*y;}
/*n乗*/ll llpow(ll x,ll n){ll i,ans=1;rep(i,0,n)ans*=x;return ans;}
/*階乗*/ll fact(ll x){ll i,ans=1;rep(i,0,x)ans*=(x-i);return ans;}
/*nCr*/ll ncr(ll n,ll r){return fact(n)/fact(r)/fact(n-r);}
/*nPr*/ll npr(ll n,ll r){return fact(n)/fact(n-r);}
/*primejudge*/bool prime(ll a){if(a<=1)return false;ll i;for(i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}
ll ans=0;llfor;///////////////////////////////////////////////////////////
int main(){
  int N;
  cin>>N;
  cout<<1-N;
return 0;}


Measured memory_bytes: 3536
import math

N = int(input())
q = math.floor(N / 1.08)
if math.floor(q * 1.08) == N:
    print(q)
elif math.floor((q + 1) * 1.08) == N:
    print(q + 1)
elif math.floor((q - 1) * 1.08) == N:
    print(q - 1)
else:
    print(":(")

Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <numeric>
#include <algorithm>
#include <queue>

using namespace std;

int main(){
    int n, m;
    cin >> n >> m;
    long long tmp = 0;
    priority_queue<long long> pq;
    for(int i = 0; i < n; i++){
        cin >> tmp;
        pq.push(tmp);
    }

    for(int i = 0; i < m; i++){
        tmp = pq.top();
        pq.pop();
        pq.push(tmp/2);
    }

    long long ans = 0;
    while(!pq.empty()){
        ans += pq.top();
        pq.pop();
        
    }

    cout << ans << endl;

}

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


int main() {
	int n, W;
	cin>>n>>W;
	vector<int>val(n);
	vector<int>wt(n);
	
	for(int i=0;i<n;i++)
		cin>>wt[i]>>val[i];
	
	int i, w; 
	long long int K[2][W+1]; 
  
   // Build table K[][] in bottom up manner 
	memset(K, 0, sizeof(K));
   for (i = 1; i <= n; i++) 
   { 
       for (w = 1; w <= W; w++) 
       { 
           
           if (wt[i-1] <= w) 
                 K[i%2][w] = max((val[i-1] + K[(i-1)%2][w-wt[i-1]]),  K[(i-1)%2][w]); 
           else
                 K[i%2][w] = K[(i-1)%2][w]; 
       } 
   } 
	if(n%2 == 0)
	   cout<<K[0][W]<<endl;
	else
		cout<<K[1][W]<<endl;
	  
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef pair<int,int> pi;
typedef pair<ll,ll> pll;
#define Max 1000001
#define inf INT_MAX
#define llinf LONG_LONG_MAX
#define rep(i,a,b) for(i=a;i<=b;i++)
#define rrep(i,a,b) for(i=a;i>=b;i--)
#define fast ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define pb push_back
#define pf push_front
#define F first
#define S second
#define ub upper_bound
#define lb lower_bound
#define all(v) v.begin(),v.end()
#define PI 3.14159265358979311599796346854418516159057617187500
#define endl '\n'
const ll N=51,mod=1000000007;
signed main()
{
    fast;
    ll pro=1,temp,t,m,n,k,i,j,l,r,mid,x,y,z,rem,carry=0,ind,ans=0,mx=-llinf,mn=llinf,cnt=0,curr=0,prev,sum=0,flag=1,i1=-1,i2=-1;
	cin>>n;
	string s;
	unordered_map<string,ll> mp;
	rep(i,0,n-1)
	{
		cin>>s;
		sort(all(s));
		mp[s]++;
	}
	for(auto it:mp)
	{
		temp=it.S;
		ans+=(temp*(temp-1))/2;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 10660
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <climits>
using namespace std;

bool comp(pair<int, string> a, pair<int, string> b){
    if(a.first != b.first) return a.first > b.first;
    else return a.second < b.second;
}

long int jou(long int x, long int y){
    long int f = 1;
    for(int i = 0; i < y; ++i){
        f = f * x % int(powl(10,9) + 7);
    }

    return f;
}

int main(){
    int max = 0,n,x = 0;

    string s;
    cin >> n >> s;

    for(int i = 0; i < n; ++i){
        x += (s[i] == 'I'? 1 : -1);
        if(x > max)
            max = x;
    }
    cout << max << endl;

    return 0;
}

Measured memory_bytes: 256
a,b,m=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
ans=min(a)+min(b)
for i in range(m):
  x,y,c=map(int,input().split())
  ans=min(a[x-1]+b[y-1]-c,ans)
print(ans)

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

int main() {
  ll n;
  cin >> n;
  vector<ll> dp(n+1,0);
  ll cnt=0;
  for(ll i=1;i<n+1;i++){
    dp[i] = ceil((-1+sqrt(8*i+1))/2.0);
  } 
  
  ll now = n;
  while(now > 0){
    cout << dp[now] << endl;
    now -= dp[now];
  }

  return(0);
}

Measured memory_bytes: 81432
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace AtCoder
{
	public class ABC
	{
		static public void Main(string[] args)
		{
			Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
			Solve(args);
			Console.Out.Flush();
		}

		private const int mod = 1000000007;  // 10^9+7

		static public void Solve(string[] args)
		{
			//string s = Console.ReadLine();
			//int n = int.Parse(Console.ReadLine());
			//long x = long.Parse(Console.ReadLine());
			//int[] vs = Console.ReadLine().Split().Select(int.Parse).ToArray();
			long[] vs = Console.ReadLine().Split().Select(long.Parse).ToArray();
			long n = vs[0];
			long k = vs[1];
			int[][] town = new int[2][];
			town[0] = Console.ReadLine().Split().Select(int.Parse).ToArray();
			town[1] = new int[town[0].Length];
			for (int i = 0; i < n; i++) {
				town[1][i] = -1;

			}

			int index = 0, last = 0;
			int cnt = 0;
			while (town[1][index] == -1) {
				town[1][index] = cnt;
				last = index;
				index = town[0][index] - 1;
				cnt++;
			}
			int a = town[1][index];
			int b = town[1][last] - town[1][index] + 1;
			if (k > a) {
				k = a + (k - a) % b;
			}
			//System.Diagnostics.Debug.WriteLine(string.Join(",", town[0]));
			//System.Diagnostics.Debug.WriteLine(string.Join(",", town[1]));
			//System.Diagnostics.Debug.WriteLine($"{a} {b}");
			//System.Diagnostics.Debug.WriteLine(k);

			index = 0;
			for (int i = 0; i < k; i++) {
				index = town[0][index] - 1;
			}
			Console.WriteLine(index+1);

		}
	}
}


Measured memory_bytes: 43824
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder
{
    class Program
    {
        static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }
        
        static long[] ReadLongs()
        {
            return Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
        }

        static double ReadDouble()
        {
            return double.Parse(Console.ReadLine());
        }

        static double[] ReadDoubles()
        {
            return Console.ReadLine().Split(' ').Select(double.Parse).ToArray();
        }

        static string ReadString()
        {
            return Console.ReadLine();
        }

        static string[] ReadStringSplit()
        {
            return Console.ReadLine().Split(' ');
        }

        static void A()
        {
            long N = ReadLong();
            Console.WriteLine(N * N * N);
        }

        static void B()
        {
            long N = ReadLong();
            long[] A = ReadLongs();
            long[] B = ReadLongs();
            long[] C = ReadLongs();
            long ans = 0;
            long prev = -100;
            for (int i = 0; i < N; i++)
            {
                ans += B[A[i] - 1];
                if (prev == A[i] - 1)
                {
                    ans += C[prev - 1];
                }
                prev = A[i];
            }
            Console.WriteLine(ans);
        }

        static void C()
        {

        }

        static void D()
        {

        }

        static void Main(string[] args)
        {
            //A();
            B();
            //C();
            //D();
        }
    }
}


Measured memory_bytes: 13268
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
const int M = 1e7;
int si[] = {-1, 0, 1, 0};
int sj[] = {0, -1, 0, 1};

int main(){
  int k;
  cin >> k;
  string s = "ACL";
  rep(i,k) cout << s;
  cout << endl;

  return 0;
}


Measured memory_bytes: 3512
#include <bits/stdc++.h>
using namespace std;
#define ref(i,x,y)for(int i=x;i<=y;++i)
#define def(i,x,y)for(int i=x;i>=y;--i)
#define fi first
#define se second
#define int long long
#define pb push_back
typedef long long LL;
const int N=421;
int n,m;
int lx[2][N],ly[2][N];
struct dot{int x,y,v,id;}p[N],px[N],py[N];
bool cmpx(dot a,dot b){return a.x<b.x;}
bool cmpy(dot a,dot b){return a.y<b.y;}
void smin(int&a,int b){if(b<a)a=b;}
void smax(int&a,int b){if(b>a)a=b;}
namespace eden{
	int w[N][N],c[N][N],op,ed;
	void init(){
		memset(w,0,sizeof w);
		memset(c,0,sizeof c);
	}
	void add(int x,int y,int ww,int cc){
		w[x][y]=ww;w[y][x]=0;
		c[x][y]=cc;c[y][x]=-cc;
	}
	queue<int> q;bool vis[N];int dis[N],pre[N];
	bool spfa(){
		memset(vis,0,sizeof vis);
		memset(pre,0,sizeof pre);
		while(!q.empty())q.pop();
		ref(i,1,ed)dis[i]=(LL)1e18;
		dis[op]=0;q.push(op);vis[op]=1;
		while(!q.empty()){
			int u=q.front();q.pop();vis[u]=0;
			ref(v,1,ed)if(w[u][v]&&dis[u]+c[u][v]<dis[v]){
				dis[v]=dis[u]+c[u][v];pre[v]=u;
				if(!vis[v])vis[v]=1,q.push(v);
			}
		}
		return (dis[ed]<(LL)1e18);
	}
	pair<int,int> run(){
		int fw=0,res=0;
		while(spfa()){
			fw++;res+=dis[ed];
			for(int i=ed;i!=op;i=pre[i])
				w[pre[i]][i]--,w[i][pre[i]]++;
		}
		return make_pair(fw,res);
	}
}
signed main(){
	cin>>n;
	ref(i,1,n)cin>>p[i].x>>p[i].y>>p[i].v;
	ref(i,1,n)p[i].id=i;
	ref(i,1,n)px[i]=p[i];
	ref(i,1,n)py[i]=p[i];
	sort(px+1,px+n+1,cmpx);
	sort(py+1,py+n+1,cmpy);
	cin>>m;
	ref(i,1,n)lx[0][i]=ly[0][i]=n+1;
	ref(i,1,n)lx[1][i]=ly[1][i]=0;
	ref(i,1,m){
		char c;int a,b;cin>>c>>a>>b;
		if(c=='L'){
			int pos=0;
			ref(j,1,n)if(px[j].x<=a)pos=j;
			if(pos>b)smin(lx[0][pos-b],pos);
		}
		if(c=='R'){
			int pos=n+1;
			def(j,n,1)if(px[j].x>=a)pos=j;
			if(n+1-pos>b)smax(lx[1][n+1-pos-b],pos);
		}
		if(c=='D'){
			int pos=0;
			ref(j,1,n)if(py[j].y<=a)pos=j;
			if(pos>b)smin(ly[0][pos-b],pos);
		}
		if(c=='U'){
			int pos=n+1;
			def(j,n,1)if(py[j].y>=a)pos=j;
			if(n+1-pos>b)smax(ly[1][n+1-pos-b],pos);
		}
	}
	def(i,n-1,1)smin(lx[0][i],lx[0][i+1]);
	def(i,n-1,1)smin(ly[0][i],ly[0][i+1]);
	def(i,n-1,1)smax(lx[1][i],lx[1][i+1]);
	def(i,n-1,1)smax(ly[1][i],ly[1][i+1]);
	int ans=0,sum=0;
	ref(i,1,n)ans+=p[i].v,sum+=p[i].v;
	ref(S,0,n){
		if(S<n){
			if(lx[0][S+1]<=n||ly[0][S+1]<=n)continue;
			if(lx[1][S+1]>=1||ly[1][S+1]>=1)continue;
		}
		bool fg=1;
		ref(i,1,S)if(lx[1][S+1-i]>lx[0][i]){fg=0;break;}
		ref(i,1,S)if(ly[1][S+1-i]>ly[0][i]){fg=0;break;}
		if(!fg)continue;
		eden::init();
		eden::op=n+n+n+n+1;eden::ed=eden::op+1;
		ref(i,1,S)ref(j,max(1LL,lx[1][S+1-i]),min(n,lx[0][i]))
			eden::add(i,n+px[j].id,1,0);
		ref(i,1,n)eden::add(n+i,n+n+i,1,p[i].v);
		ref(i,1,S)ref(j,max(1LL,ly[1][S+1-i]),min(n,ly[0][i]))
			eden::add(n+n+py[j].id,n+n+n+i,1,0);
		ref(i,1,S)eden::add(eden::op,i,1,0);
		ref(i,1,S)eden::add(n+n+n+i,eden::ed,1,0);
		pair<int,int> pp=eden::run();
		if(pp.fi==S)ans=min(ans,pp.se);
	}
	cout<<sum-ans<<endl;
}

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

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

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; }

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

const int MAX = 200005;
const int INF = 1001001001;
const int MOD = 1000000007;

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

    vector<int> d(M);
    vector<ll> c(M);
    rep(i, M) cin >> d[i] >> c[i];

    ll D = accumulate(c.begin(), c.end(), 0L);
    ll sum = 0;
    rep(i, M) sum += d[i] * c[i];

    ll ans = (D - 1) + (sum - 1) / 9;
    cout << ans << endl;
}

Measured memory_bytes: 2560
N = int( input())
T, A = map( int, input().split())
H = list( map( int, input().split()))
ans = 1
now = abs(T - 0.006*H[0] - A)
for i in range(1,N):
    if abs(T - H[i]*0.006 -A) < now:
        ans = i+1
        now = abs(T - H[i]*0.006 - A)
print(ans)

Measured memory_bytes: 3064
import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Cube test = new Cube();
		test.num();

	}
}
	

class Cube{
	public void num(){

		String	i = new Scanner(System.in).nextLine();
		int number = Integer.parseInt(i);
		System.out.println((int)Math.pow(number,3));

	}
}

Measured memory_bytes: 26100
#include <iostream>
#include <string>
#include <array>
#include <vector>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <iterator>
#include <limits>
#include <set>
#include <map>

long long k{};
long long total = 9;
std::vector<int> nums(100, -1);

void count(int num, int keta, int keta_max)
{
    if (total >= k) return;
    nums[keta - 1] = num;
    if (keta + 1 < keta_max) {
        for (int i = std::max(0, num - 1); i < std::min(9, num + 1) + 1; i++) {
            count(i, keta + 1, keta_max);
        }
    } else {
        nums[keta] = num;
        int n = 3;
        if (num == 0 || num == 9) n--;
        total += n;
    }
}

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

    if (k < 10) {
        std::cout << k << std::endl;
        return 0;
    }

    int keta = 1;
    while (total < k) {
        keta++;
        for (int i = 1; i < 10; i++) {
            count(i, 1, keta);
            if (total >= k) break;
        }
    }
    nums[keta - 1] = std::min(9, nums[keta - 1] + 1) - (total - k);
    for (auto x : nums) {
        if (x == -1) break;
        std::cout << x;
    }
    std::cout << std::endl;
    return 0;
}


Measured memory_bytes: 256
using System;
using System.Linq;

namespace Welcome_to_AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            var r = int.Parse(input);
            var result = 3 * Math.Pow(r, 2);

            Console.WriteLine(result);
        }
    }
}


Measured memory_bytes: 13140
#include <iostream>
#include <numeric>

using namespace std;

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

signed main() {
  int n, m;
  cin >> n >> m;
  int a[n];
  rep(i,n) cin >> a[i];
  
  int p = 1;
  rep(i,n) p = lcm(p, a[i]);
  rep(i,n) if(p / 2 % a[i] != a[i] / 2) p = 2 * m + 2;
  
  cout << (m - p / 2) / p + (m >= p / 2) << endl;
  return 0;
}

Measured memory_bytes: 4332
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <malloc.h>
#include <stack>
#include <cstring>
#include <string>
#include <set>
#include <unordered_map>
#define INT long long int
#define MOD 1000000007
#define oo 987654321
using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    int a, b;
    cin>>a>>b;
    if( a == 1 or b == 1 )
    {
        if( a == 1 and b == 1 ) cout<<"Draw"<<endl;
        else if( a == 1 ) cout<<"Alice"<<endl;
        else cout<<"Bob"<<endl;
    }
    else
    {
        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>
using namespace std;

#define ll long long
#define rep(i, n) for(int i = 0; i < n; i++)
#define all(v) v.begin(), v.end()

int main(){
    long long n, k;
    cin >> n >> k;
    vector<long long> a(n);
    for(long long i = 0; i < n; i++){
        cin >> a[i];
    }

    vector<bool> arrived(n, false);
    vector<long long> lastArrivedTime(n);
    // tuple<long long, bool, long long> arrived;
    long long ans = 0;
    arrived[0] = true;
    lastArrivedTime[0] = 0;
    for(long long i = 0; i < k; i++){
        long long dep, arr;
        dep = ans;
        arr = a[dep] - 1;
        ans = arr;
        if(arrived[arr] == true){
            long long diffTime; //前回の到着回数と今回の到着回数の差を求める
            diffTime = i - lastArrivedTime[arr] + 1;
            long long remain = k - i - 1;
            long long times = remain / diffTime;
            i += diffTime * times;
        }
        else{
            arrived[arr] = true;
            lastArrivedTime[arr] = i + 1;
        }
    }

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

Measured memory_bytes: 6424
using System;

public class Hello{
    public static void Main(){
        decimal CurrentDebt = Consts.DEBT;
        int Weeks = int.Parse(Console.ReadLine());
        for(int i = 0; i < Weeks; i++){
            CurrentDebt = Math.Ceiling(CurrentDebt * Consts.INTEREST);
        }
        Console.WriteLine(CurrentDebt * Consts.BASE);
    }
}

public static class Consts{
    public const decimal BASE = 1000m;
    public const decimal DEBT = 100m;
    public const decimal INTEREST = 1.05m;
}

Measured memory_bytes: 8960
import java.util.Scanner;

/**
 * Created by suzuki on 17/06/24.
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int count = 1;
        int N = sc.nextInt();
        int[] a = new int[N];
        int[] check = new int[N];
        for(int i=0;i<a.length;i++){
            a[i] = sc.nextInt();
        }
        int index = 0;
        boolean loopFlag = false;
        while (a[index] != 2){
            index = a[index] - 1;
            if(check[index] == 1){
                loopFlag = true;
                break;
            }
            check[index] = 1;
            count++;
        }
        if(loopFlag){
            System.out.println(-1);
        }else {
            System.out.println(count);
        }
    }
}

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

int main()
{
  string a, b;
  cin >> a >> b;
  bool flag = true;
  for (int i = 0; i < a.size(); i++)
  {
    if (a[i] != b[i])
    {
      flag = false;
      break;
    }
  }
  if (flag)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < b; i++)
#define all(v) v.begin(), v.end()
const int MOD = 1e9 + 7;
const int INF = 2e9;
//'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122

int main() {
    int n;
    cin >> n;
    cout << 180 * (n - 2) << endl;
    return 0;
}


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

const int N = 21;

// 最高位代表其长度 1 << i -> 长度为 i 

int *dp[1 << N], tp[2][1 << N], fir[1 << N]; char s[1 << N];

int main() {
    int n, k; scanf("%d%d", &n, &k);
    dp[1] = new int[1 << n + 1], dp[1][0] = 0;
    for (int i = 1; i < 1 << n + 1; i++) fir[i] = fir[i >> 1] + 1;
    for (int i = 0; i <= n; i++) {
        scanf("%s", s); int base = 1 << i;
        for (int j = 0; j < base; j++) 
            dp[1][base | j] = s[j] - '0';
        int all = base - 1;
        for (int j = 0; j < base; j++) 
            tp[1][base | j] = j;
        tp[0][base * 2 - 1] = 0;
        for (int j = 0; j + 1 < base; j++) {
            int t = all ^ j, pos = fir[t]; 
            tp[0][base | j] = (1 << pos - 1) | (j & ((1 << pos - 1) - 1));
        }
    }
    int res = 0;
    for (int i = 1; i <= n; i++) {
        int base = 1 << i;
        for (int s = base - 1; s >= 0; s--) {
            dp[base + s] = new int[1 << n + 1 - i];
            for (int j = 0; j < (1 << n + 1 - i); j++) dp[base + s][j] = 0;
            for (int j = 1; j < 1 << (n + 1 - (i - 1)); j++) if (tp[s & 1][j])
                dp[base + s][tp[s & 1][j]] += dp[(base + s) >> 1][j];
            int tot = 0;
            for (int j = 1; j < (1 << n + 1 - i); j++) tot += dp[base + s][j];
            if (tot >= k) res = base + s;
        }
    }
    int len = fir[res];
    for (int i = len - 1; i >= 1; i--) {
        if (res & (1 << i - 1)) putchar('1');
        else putchar('0');
    }
    return 0;
}


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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define mt make_tuple
#define eb emplace_back
#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)

#define LB(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define UB(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef unsigned long long ull;
typedef long double ld; 
typedef tuple<int,int,int> State;

ll mod = 1e9 + 7;

#define citc(tc) int tc; cin>>tc; while(tc--){solve();}
#define each(a,x) for( auto &a:(x))
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repr(i, n) for (ll i = (n) - 1; i >= 0; i--)
#define rep2(i, l, r) for (ll i = (l); i < (r); i++)
#define rep2r(i, l, r) for (ll i = (r) - 1; i >= (l); i--)
#define range(a) a.begin(), a.end()
#define deb(x) cout<<#x<<" "<<x<<endl;
#define cini(i) int i; cin>>i;
#define cinll(l) ll l; cin>>l;
#define cinai(a, n) vi a(n); rep(i, n) { cin>>a[i]; }
#define cinal(a, n) vl a(n); rep(i, n) { cin>>a[i]; }
#define coutai(a, n) rep(i, n) { cout<<a[i]<<" "; } ent;
#define coutal(a, n) rep(i, n) { cout<<a[i]<<" "; } ent;
#define ent cout<<endl;

void solve()
{
	long double a, b, c, r = 2;
	cin>>a>>b>>c;
	cout<<fixed<<setprecision(18);
	// cout<<sqrt(a)<<" "<<sqrt(b)<<" "<<sqrt(c)<<endl;
	if(c > ((a+b)+2*sqrt((a*b))))
		cout<<"Yes\n";
	else
		cout<<"No\n";
}
int main()
{
	fastio();
	// citc(tc);
	solve();
}

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

int main(){
  int N;
  cin >> N;
  
  if (N==1) cout << "Hello World" << endl;
  else {
    int A, B;
    cin >> A >> B;
    
    cout << A + B << endl;
  }
  
  return 0;
}

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

int main(void){
    int n,l;
    cin >> n>>l;
    vector<int> app(n);
    int mn = 1000, log = 0;
    for (int i = 0; i < n; i++){
        app.at(i) = l + i;
        if (mn > abs(app.at(i))){
            mn = abs(app.at(i));
            log = i;
        }
    }
    int sum = 0;
    for (int i = 0; i < n; i++){
        if(i!=log)
            sum += app.at(i);
    }
    cout << sum << endl;
    return 0;
}

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

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

#define rep(i, n) for (int i = 0; i < (n); i++)
#define repp(i, s, e) for (int i = (s); i < (e); i++)
#define all(x) x.begin(), x.end()

#define endl "\n"

void use_cio() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
}

template <class L, class R>
ostream &operator<<(ostream &os, pair<L, R> P) {
  return os << "(" << P.first << "," << P.second << ")";
}
template <class T>
ostream &operator<<(ostream &os, vector<T> V) {
  os << "[";
  for (auto x : V) os << x << ", ";
  return os << "]";
}

//--------------------------------------------------//

int main() {
  use_cio();
  int n;
  cin >> n;
  vector<pii> va(n);
  rep(i, n) cin >> va[i].first >> va[i].second;
  sort(all(va), [](pii a, pii b) {
    return (a.second == b.second) ? a.first < b.first : a.second < b.second;
  });
  ll cur = 0;
  for (auto elm : va) {
    cur += elm.first;
    if (cur > elm.second) return !(cout << "No\n");
  }
  cout << "Yes" << endl;
}


Measured memory_bytes: 1792
#include<stdio.h>
int main()
{
    int n,i,x,y;
    char a[10];
scanf("%s",&a);
for(i=0;i<3;i++)
{

printf("%c",a[i]);
}
printf("8/");
for(i=5;i<10;i++)
{

printf("%c",a[i]);
}
}


Measured memory_bytes: 128