akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<algorithm>
#include<math.h>
#include<vector>
#include<map>
#include<set>
#include<iomanip>

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

const int MOD = 1e9 + 7;
const int MAX = 1e9;
const ll LLMAX = 1e18;
const int INF = numeric_limits<int>::max();
const ll LLINF = numeric_limits<ll>::max();
const double PI = acos(-1.0);

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

int main() {
    int A, B, C; cin >> A >> B >> C;

    if (B - A == C - B) cout << "YES" << endl;
    else cout << "NO" << endl;
    return 0;
}


Measured memory_bytes: 3608
main(){
  int n,a=100000,i;
  scanf("%d",&n);
  for(i=0;i<n;i++)
    {
      a*=1.05;
      if(a%1000!=0)
	a+=1000;
      a/=1000;
      a*=1000;
    }
  printf("%d\n",a);
  return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define MOD 1000000007
#define print(A,n) for(ll i=0;i<n;++i)cout<<A[i]<<' ';cout<<endl;
#define take(A,n) for(ll i=0;i<n;++i)cin>>A[i];
ll mulmod(ll a,ll b,ll c) 
{ 
    if (b==0) 
        return 0; 
    ll s = mulmod(a, b/2, c); 
    if (b%2==1) 
        return (a%c+2*(s%c)) % c; 
 
    else
        return (2*(s%c)) % c; 
} 

  
void fastio(){ios_base::sync_with_stdio(false);cin.tie(NULL);}
int main()
{ll int t;
t=1;
//cin>>t;

while(t--)
{ll int h,a,i,n;
cin>>h>>n;
;;ll int sum = 0;
for(i=0;i<n;i++)
{cin>>a;
sum+=a;}
if(sum>=h)
cout<<"Yes"<<endl;
else
cout<<"No"<<endl;


    
}
 
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <cstring>
#include <climits>
#include <algorithm>
#include <map>
#include <sstream>

using namespace std;

int main() {
    int n;
    while (cin >> n, n) {
        cin.ignore();
        vector<string> words;
        for (int i=0; i<n; ++i) {
            string input;
            getline(cin, input);
            stringstream ss(input);

            string s;
            while (ss >> s) {
                words.push_back(s);
            }
        }
        char c;
        cin >> c;

        map<string, int> m;
        for (int i=0; i<(int)words.size(); ++i) {
            if (words[i][0] == c) {
                m[words[i]] ++;
            }
        }

        if (m.empty()) {
            cout << "NA" << endl;
        } else {
            vector<pair<int,string>> v;
            for (auto it=m.begin(); it!=m.end(); ++it) {
                v.push_back(make_pair(it->second * (-1), it->first));
            }
            sort(v.begin(), v.end());

            for (int i=0; i<(int)v.size(); ++i) {
                cout << (i==0 ? "" : " ") << v[i].second;
            }
            cout << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 3208
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  vector<int64_t> vec(N);
  for(int i=0; i<N; i++){
    cin >> vec.at(i);
  }
  int64_t M = 10000000000000;
  int ans = 0;
  for(int i=0; i<N; i++){
    if(vec.at(i) <= M){
      ans++;
      M = vec.at(i);
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#include <string>
#include <cstring>
#include <algorithm>
#include <math.h>
#include <map>
#include <bitset>
#include <cmath>
#include <set>
#include <utility>

#define INF 1000000000000
#define MOD 1000000007 //10^9+7:合同式の法

using namespace std;
typedef long long ll;

//マクロ
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)

int main(){
    int N;
    cin >> N;
    vector<int> v(N);

    for(int i = 0;i < N;i++)
        cin >> v.at(i);

    double goukei = 0;

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

    for(int i = 0;i < N - 1;i++){
        if(i == 0){
            goukei = v.at(i) + v.at(i+1);
            goukei /= 2.0;
        }else{
            goukei += v.at(i+1);
            goukei /= 2.0;
        }
    }

    printf("%.12f\n",goukei);


}

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

int main()
{
  int n;
  cin >> n;
  string s,t;
  cin >> s >> t;
  
  string ans = "";
  for(int i = 0; i < n; i++){
     ans += s[i];
     ans += t[i];
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 3604
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <climits>
#include <sstream>

using namespace std;

int main(){
  int N;
  string S;

  cin >> N >> S;

  int ans = 0;
  for(int i = 1; i < N; i++){
    int count = 0;

    for(char c ='a'; c <= 'z'; c++){
      bool left = false, right = false;

      for(int j = 0; j < i; j++)
        if(S[j] == c)
          left = true;

      for(int j = i; j < N; j++)
        if(S[j] == c)
          right = true;

      if(left && right)
      count++;
    }

    if(ans < count) ans = count;
  }

  cout << ans << endl;

	return 0;
}


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

int main() {
    int n, k; cin >> n >> k;
    vector<int> ints;
    int count = 0;
    int now = 0;
    char init = 'x';
    for (int i = 0; i < n; i++) {
        char c; cin >> c;
        if (init == 'x') {
            init = c;
            if (c == '1') now = 1;
            if (c == '0') now = -1;
        }
        if ((c == '1' && now == 1) || (c == '0' && now == -1)) {
            count++;
        } else if (c == '1') {
            ints.push_back(count);
            count = 1;
            now = 1;
        } else if (c == '0') {
            ints.push_back(count);
            count = 1;
            now = -1;
        }
    }
    ints.push_back(count);
    int max_stand = 0;
    int current = 0;
    // for (int i = 1; i <= ints.size(); i++) {
    //     cout << ints[i-1] << endl;
    // }
    // cout << "hoge" << endl;
    if (init == '0') {
        ints.insert(ints.begin() + 0, 0);
    }
    // for (int i = 1; i <= ints.size(); i++) {
    //     cout << ints[i-1] << endl;
    // }
    for (int i = 1; i <= ints.size(); i++) {
        current += ints[i-1];
        if (i > k * 2 && i % 2 == 0) {
            current -= ints[i - k * 2 - 1];
            current -= ints[i - k * 2 - 2];
        }
        // cout << i << " " << current << endl;
        if (max_stand < current) {
            max_stand = current;
        }
    }
    cout << max_stand << endl;
    return 0;
}


Measured memory_bytes: 892
/*
█████████───███─────────███───███─────────████████████───███████████████───████████████───████████████───█████████───────
█████████───███─────────███───███─────────████████████───███████████████───████████████───████████████───█████████───────
█████████───███─────────███───███─────────████████████───███████████████───████████████───████████████───█████████───────
███─────────███─────────███───███─────────███──────███───███───███───███───███──────███───███──────███───███─────────────
███─────────███─────────███───███─────────███──────███───███───███───███───███──────███───███──────███───███─────────────
███─────────███─────────███───███─────────███──────███───███───███───███───███──────███───███──────███───███─────────────
█████████──────███───███──────███─────────████████████───███───███───███───████████████───███──────███───█████████───────
█████████──────███───███──────███─────────████████████───███───███───███───████████████───███──────███───█████████───────
█████████──────███───███──────███─────────████████████───███───███───███───████████████───███──────███───█████████───────
███────────────███───███──────███─────────███──────███───███───███───███───███────────────███──────███─────────███───────
███────────────███───███──────███─────────███──────███───███───███───███───███────────────███──────███─────────███───────
███────────────███───███──────███─────────███──────███───███───███───███───███────────────███──────███─────────███───────
█████████─────────███─────────█████████───███──────███───███───███───███───███────────────████████████───█████████───────
█████████─────────███─────────█████████───███──────███───███───███───███───███────────────████████████───█████████───────
█████████─────────███─────────█████████───███──────███───███───███───███───███────────────████████████───█████████───────
*/
/**

**/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define fori(n) for ( int i = 0; i < (n);i++)
#define forj(n) for ( int j = 0; j < (n);j++)
#define fork(n) for ( int k = 0; k < (n);k++)
#define forghj(n) for ( int ghj = 0; ghj < (n);ghj++)
#define fori1(n) for ( int i = (n)-1; i >= 0;i--)
#define all(vector) (vector).begin(),(vector).end()
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define INF 1e9+7
#define EPS 1e-6
#define _FORTIFY_SOURCE 0
#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native")
#pragma GCC optimize("fast-math")
#pragma GCC optimize "-O3"

int main() {
    int n;
    cin >> n;
    vector < int > a;
    a.resize(n);
    fori(n) cin >> a[i];
    for (int i = n - 1; i >= 1; i--) {
        if (a[i - 1] > a[i]) {
            a[i - 1]--;
        }
        if (a[i - 1] > a[i]) {
            cout << "No";
            return 0;
        }
    }
    cout << "Yes";
}
/*
1
4
2 4 3 5
*/





Measured memory_bytes: 640
#include<iostream>
#include<map>
using namespace std;
typedef long long ll;
int main(){
  ll n,cnt=0;
  map<ll,ll> mp;
  cin >> n;
  ll a;
  for(int i=0;i<n;i++){
    cin >> a;
    mp[a]++;
  }
  for(auto it=mp.begin();it!=mp.end();it++){
    if(it->second%2==1){
      cnt++;
    }
  }
  cout << cnt << endl;
}


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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, n) for (int i = 1; i <= (int)(n); i++)
using namespace std;
using ll = long long;
using pi = pair<int, int>;
const ll INF = 1LL << 60;


int main() {
    int n,ans;
    cin >> n;
    ans = (n % 2 == 0) ? (n / 2) - 1 : n / 2;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
      
#define FOR(i,a,b) for( ll i = (a); i < (ll)(b); i++ )
#define REP(i,n) FOR(i,0,n)
#define YYS(x,arr) for(auto& x:arr)
#define ALL(x) (x).begin(),(x).end()
#define SORT(x) sort( (x).begin(),(x).end() )
#define REVERSE(x) reverse( (x).begin(),(x).end() )
#define UNIQUE(x) (x).erase( unique( ALL( (x) ) ) , (x).end() )
#define PW(x) (1LL<<(x))
#define SZ(x) ((ll)(x).size())
#define SHOW(x) cout << #x << " = " << x << endl
#define SHOWA(x,n) for( int yui = 0; yui < n; yui++ ){ cout << x[yui] << " "; } cout << endl

#define pb emplace_back
#define fi first
#define se second

using namespace std;

typedef long double ld;
typedef long long int ll;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<bool> vb;
typedef vector<ld> vd;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<vpl> gr;
typedef vector<vl> ml;
typedef vector<vd> md;
typedef vector<vi> mi;
     
const ll INF = (ll)1e9 + 10;
const ll INFLL = (ll)1e18 + 10;
const ld EPS = 1e-12;
const ll MOD = 1e9+7;
     
template<class T> T &chmin( T &a , const T &b ){ return a = min(a,b); }
template<class T> T &chmax( T &a , const T &b ){ return a = max(a,b); }
template<class T> inline T sq( T a ){ return a * a; }

ll in(){ long long int x; scanf( "%lld" , &x ); return x; }
char yuyushiki[1000010]; string stin(){ scanf( "%s" , yuyushiki ); return yuyushiki; }

// head

ll x, y;
vl v;

ll G[72][72];

int main(){

  x = in();
  y = in();
  v.pb( x );
  v.pb( -x );
  v.pb( y );
  v.pb( -y );
  SORT( v );
  UNIQUE( v );
  int n = SZ(v);

  REP( i , n ){
    REP( j , n ){
      G[i][j] = INFLL;
    }
  }
  REP( i , n ){
    G[i][i] = 0;
  }
  REP( i , n-1 ){
    G[i][i+1] = v[i+1] - v[i];
  }
  REP( i , n ){
    REP( j , n ){
      if( v[i] == -v[j] ){
        G[i][j] = 1;
      }
    }
  }
  REP( k , n ){
    REP( i , n ){
      REP( j , n ){
        chmin( G[i][j], G[i][k] + G[k][j] );
      }
    }
  }
  REP( i , n ){
    REP( j , n ){
      if( v[i] == x and v[j] == y ){
        assert( G[i][j] != INFLL );
        printf( "%lld\n" , G[i][j] );
        return 0;
      }
    }
  }

  assert( false );
  
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i )
typedef std::pair<int,int> pint;

using namespace std;
typedef long long ll;

double calc(pint a,pint b){
    int diff1,diff2;
    diff1 = a.first - b.first;
    diff2 = a.second - b.second;
    double tmp = pow(diff1,2) + pow(diff2,2); 
    return sqrt(tmp);
}

int main(){

    int N; cin >> N;
    vector<int> v(N);
    vector<pint> z(N+5);
    double sum = 0;
    rep (i,N){
        int tmp1;
        int tmp2;
        cin >> tmp1 >> tmp2;
        z[i+1].first = tmp1;
        z[i+1].second = tmp2;
    }
    vector<vector<int>> list;
    iota(v.begin(), v.end(), 1);       // v に 1, 2, ... N を設定
    do {
        rep (i,N-1){
            sum += calc(z[v[i]],z[v[i+1]]);
        }
    } while( next_permutation(v.begin(), v.end()) );     // 次の順列を生成
    rep (i,N){
        sum /= (double)(i+1);
    }
    cout << fixed <<setprecision(12) << sum << endl;
    return 0;
}

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

int a, b;
string s1 = "Sunny";
string s2 = "Cloudy";
string s3 = "Rainy";

int main() {
	string t; cin >> t;
	if(t == s1) cout << s2;
	else if(t == s2) cout << s3;
	else if(t == s3) cout << s1;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
  
int main(int argc, const char * argv[]) {
      
    int i,j;
      
    char str[202];
    char fstr[101];
      
    scanf("%s",str);
      
    scanf("%s",fstr);
      
    int len = strlen(str);
    int flen = strlen(fstr);
      
    for (i = len; i < len+len; i++) {
        str[i] = str[i-len];
    }
      
    for (i = 0; i < len+len; i++) {
        if (str[i] == fstr[0]) {
            for (j = 0; j < flen; j++) {
                if (str[i+j] != fstr[j]) {
                    break;
                }
            }
              
            if (j == flen) {
                printf("Yes\n");
                return 0;
            }
        }
    }
      
    printf("No\n");
      
    return 0;
}


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

int main()
{
    ll n;
    cin>>n;
    ll a[n];
    ll b[n];
    for(int i=0;i<n;i++)
    {
        cin>>a[i] >>b[i];
    }
    ll sum =0;
    ll ans=0;
    for(int i = n-1 ; i>=0 ; i--)
    {
        a[i] = a[i] +  sum;
        ll temp =   b[i] -  ( a[i] % b[i] );
        if( temp == b[i] )
            temp =0;
        ans += temp;
        sum += temp;
    }
    cout<<ans;
}

Measured memory_bytes: 5140
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long n = sc.nextLong();
    long s = sc.nextLong();
    long ans = (long)Math.pow(10, 15);
    for(long b = 2; (b * b) <= n; b++) {
      long t = 0;
      long u = n;
      while(u > 0) {
        t += (u % b);
        u /= b;
      }
      if(t == s) {
        ans = Math.min(ans, b);
        break;
      }
    }
    if(ans == (long)Math.pow(10, 15)) {
      // pb + q = n, p + q = s
      for(long p = 0; (p * p) <= n; p++) {
        long q = s - p;
        if(q >= 0) {
          if(p == 0) {
            if(n == s) {
              ans = Math.min(ans, n + 1);
            }
          } else {
            if(p == 0) {
              if(n == s) {
                ans = Math.min(ans, n + 1);
              }
            } else { 
              long d = n - q;
              long b = d / p;
              long t = 0;
              long y = n;
              if(b > 1) {
              while(y > 0) {
                t += (y % b);
                y /= b;
              }
              if(t == s) {
                ans = Math.min(ans, b);
              }
              }
            }
          }
        }
      } 
    }
    if(ans == (long)Math.pow(10, 15)) ans = -1;
    System.out.println(ans);
  }
}

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

int n;

int main(){
  cin >> n;
  string res = "APPROVED";
  
  rep(i, n){
    int a;
    cin >> a;
    if(a % 2 != 0){
      continue;
    }
    if(a % 3 != 0 && a % 5 != 0){
      res = "DENIED";
    }
  }
  cout << res << endl;
  return 0;
}


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

typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pll;
typedef vector<bool> vb;
const ll oo = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-9;
#define sz(c) ll((c).size())
#define all(c) begin(c), end(c)
#define FOR(i,a,b) for (ll i = (a); i < (b); i++)
#define FORD(i,a,b) for (ll i = (b)-1; i >= (a); i--)
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define xx first
#define yy second
#define TR(X) ({ if(1) cerr << "TR: " << (#X) << " = " << (X) << endl; })

ll f(ll n) {
	FORD(k,0,30) if (k*(k+1)/2 <= n) return k;
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	ll n; cin >> n;
	vector<pll> pf;

	for (ll p = 2; p*p <= n; p++) if (n%p == 0) {
		ll e = 0;
		while (n%p == 0) n /= p, e++;
		pf.eb(p,e);
	}
	if (n > 1) pf.eb(n,1);

	ll res = 0;
	for (pll pr: pf) {
		ll e = pr.yy;
		res += f(e);
	}
	cout << res << endl;

}



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

int gcd(int a, int b){
    int v0 = a, v1 = b, v2 = a % b;
    while(v2 != 0){
        v0 = v1;
        v1 = v2;
        v2 = v0 % v1;
    }

    return v1;
}

int gcd2(int a, int b, int c){
    int g = gcd(a, b);
    return gcd(g, c);
}

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

    int64_t sum = 0;

    for (int i = 1; i <= n; i++){
        for (int j = 1; j <= n; j++){
            for (int k = 1; k <= n; k++){
                sum += gcd2(i, j, k);
            }
        }
    }

    cout << sum << endl;
}


Measured memory_bytes: 3636
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

N = int(input())
se = set()

x = 0
for i in range(1,N+1):
    se.add(i)
    x += i
    if x >= N:
        break

se.discard(x-N)
print(*se, sep='\n')

Measured memory_bytes: 3700
#include<stdio.h>
#include<string.h>
int main()
{
	char S[11];
	scanf("%s", S);
	if (S[0] != 'A')
	{
		printf("WA");
		return 0;
	}
	int i;
	int counter = 0;
	for ( i = 1; i < strlen(S); i++)
	{
		if (2 <= i&& i <= strlen(S) - 2 && S[i] == 'C')
			counter++;
		else if (S[i] >= 'A'&&S[i] <= 'Z')
		{
			printf("WA");
			return 0;
		}
	}
	if (counter == 1)
		printf("AC");
	else
		printf("WA");
	return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<sstream>
#include<algorithm>
#include<climits>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<ctime>
#include<cfloat>
#include<functional>
#include<map>
#include<string>
#include<cstring>
#include<vector>
#include<queue>
#include<stack>
#include<deque>
#include<set>
#include<bitset>
#include<list>
#include<numeric>
#include<complex>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<long long, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<long long, long long> ll_ll;
typedef pair<double, double> d_d;
typedef vector<int> Vint;

#define PI 3.141592653589793238462643383279
#define mod 1000000007LL
#define rep(i, n) for(i = 0;i < n;++i)
#define rep1(i, n) for(i = 1;i < n;++i)
#define rep2d(i, j, n) for(i = 0;i < n;++i)for(j = i + 1;j < n;++j)
#define per(i, n) for(i = n - 1;i > -1;--i)
#define int(x) int x; scanf("%d",&x)
#define int2(x, y) int x, y; scanf("%d%d",&x, &y)
#define int3(x, y, z) int x, y, z; scanf("%d%d%d",&x, &y, &z)
#define scn(n, a) rep(i, n)cin >> a[i]
#define sc2n(n, a, b) rep(i, n)cin >> a[i] >> b[i]
#define pri(x) cout << x << "\n"
#define pri2(x, y) cout << x << " " << y << "\n"
#define pri3(x, y, z) cout << x << " " << y << " " << z << "\n"
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define endl "\n"
#define kabe puts("---------------------------")
#define kara puts("")
#define debug(x) cout << " --- " << x << "\n"
#define debug2(x, y) cout << " --- " << x << " " << y << "\n"
#define debug3(x, y, z) cout << " --- " << x << " " << y << " " << z << "\n"
#define X first
#define Y second
#define eps 0.0001
#define prid(x) printf("%.15lf\n", x)

struct result{
  int id, ac, time;
  Vint pena;
  void use(int n){ pena.assign(n, 0); return; }
};

bool myc(result a, result b){
  if(a.ac == b.ac && a.time == b.time)return a.id > b.id;
  if(a.ac == b.ac)return a.time < b.time;
  return a.ac > b.ac;
}
bool my(result a, result b){
  return (a.ac == b.ac && a.time == b.time);
}


signed main(void){
  int i, j, k;
  for(int testcase = 0;testcase < 1234567;testcase++){
    int m, t, p, r;
    cin >> m >> t >> p >> r;
    if((m | t | p | r) == 0)break;

    vector<result> team;
    team.resize(t);
    rep(i, t){
      team[i].use(p); team[i].id = i + 1;
    }

    for(;r--;){
      int x, y, z, v;
      cin >> v >> x >> y >> z;
      x--; y--;
      if(z)team[x].pena[y]++;
      else{
        team[x].ac++;
        team[x].time += v + team[x].pena[y] * 20;
      }
    }

    sort(all(team), myc);
    cout << team[0].id;
    rep1(i, t){
      if(my(team[i - 1], team[i]))printf("=%d", team[i].id);
      else printf(",%d", team[i].id);
    }
    kara;

//*/

//*/ break;
  }
  return 0;
}

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

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;

  while (A > 0 && C > 0) {
    C -= B;
    if (C <= 0) {
      cout << "Yes" << endl;
      break;
    }
    A -= D;
    if (A <= 0) {
      cout << "No" << endl;
      break;
    }
  }
}

Measured memory_bytes: 3560
/*input

*/


//assic value of ('0'-'9') is(48 - 57) and (a-z) is (97-122) and (A-Z) is(65-90) and 32 for space
#include<bits/stdc++.h>
using namespace std;
#define ll          long long
#define pb          push_back
#define pii         pair<ll int,ll int>
#define vpii        vector< pii >
#define vi          vector<ll int>
#define vs			vector< string >
#define vvi         vector< vector< ll > >
#define inf			(ll)1e18
#define all(it,a)   for(auto it=(a).begin();it!=(a).end();it++) 
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define rep(i,a,b)	for(ll int i=a;i<b;i++)
#define repr(i,a,b) for(ll int i=a;i>b;i--)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define mp          make_pair
#define whatis(x)   cout << #x << " is " << x << "\n";
#define graph(n)    adj(n,vector< ll > () )
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());


int solve()
{
	ll k,x;cin>>k>>x;
	cout<<(k*500>=x?"Yes\n":"No\n");
	return 0;
}

int main()
{
	auto start = chrono::high_resolution_clock::now();

	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	ll test_cases=1;
	//cin>>test_cases;
	while(test_cases--)
		solve();

	auto stop = chrono::high_resolution_clock::now();
	auto duration = chrono::duration_cast<chrono::milliseconds>(stop-start);
	// cout<<"\nduration: "<<(double)duration.count()<<" milliseconds";
}

Measured memory_bytes: 256
# coding: utf-8
# hello worldと表示する
#dpでできないかな？
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

n,y=MI()
for i in range(n+1):
    for j in range(n+1-i):
        value=1000*i+5000*j+10000*(n-i-j)
        if value==y:
            print(n-i-j,j,i)
            sys.exit()
print("-1 -1 -1")

Measured memory_bytes: 40812
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>

using namespace std;

const int MAXN = 2001;

char f[MAXN][MAXN];
int common[MAXN][MAXN], different[MAXN][MAXN];

int main() {
    int h, w;
    scanf("%d%d", &h, &w);
    for (int i = 0; i < h; i++) {
        scanf("%s", f[i]);
    }

    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            if (i > 0) {
                common[i][j] = common[i - 1][j];
                different[i][j] = different[i - 1][j];
            }

            if (j == 0 || f[i][j] == f[i][j - 1]) {
                common[i][j]++;
            } else {
                common[i][j] = 0;
            }

            if (j == 0 || f[i][j] != f[i][j - 1]) {
                different[i][j]++;
            } else {
                different[i][j] = 0;
            }
        }
    }

    int mx = 0;
    for (int i = 0; i < h; i++) {
        vector<pair<int, int>> st;
        for (int j = 0; j < w; j++) {
            // NOT FLIP J'TH COLUMN
            int curh = max(common[i][j], different[i][j]);
            int width = 0;
            while (!st.empty() && st.back().first >= curh) {
                width += st.back().second;
                mx = max(mx, st.back().first * width);
                st.pop_back();
            }
            if (width > 0) {
                st.push_back({curh, width});
            }
            st.push_back({i + 1, 1});
        }
        int width = 0;
        while (!st.empty()) {
            width += st.back().second;
            mx = max(mx, st.back().first * width);
            st.pop_back();
        }
    }

    cout << mx << endl;

    return 0;
}

Measured memory_bytes: 35584
#include <iostream>

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

using namespace std;
using ll = long long;

ll gcd(ll,ll);
ll lcm(ll,ll);

int main()
{
    ll N,T[110];
    cin>>N;
    rep(i,N){
        cin>>T[i];
    }

    ll ans = 1;
    rep(i,N){
        ans = lcm(T[i],ans);
    }
    cout << ans << endl;

    return 0;
}

ll gcd(ll a, ll b)
{
    if(b==0){
        return a;
    }else{
        return gcd(b,a%b);
    }
}

ll lcm(ll a, ll b)
{
    ll g = gcd(a,b);
    return a/g*b;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  
  int n;
  cin >> n;
  
  vector<int64_t> cont(n);
  for(int i = 0 ; i < n ; i++){
    cin >> cont.at(i);
  }
  
  int64_t ans = 0;
  
  for(int i = 0 ; i < n ; i++){
    for(int j = 0 ; j < 100 ; j++){
      if(cont.at(i) % 2 == 0){
        cont.at(i) /= 2;
        ans ++;
      }
      else{
        break;
      }
    }
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 384
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int t = sc.nextInt();
        int a = sc.nextInt();

        int[] h = new int[n];
        for(int i=0; i<n; i++) {
            h[i] = sc.nextInt();
        }

        double[] tmp = new double[n];
        for(int i=0; i<n; i++) {
            tmp[i] = Math.abs(a-(t-h[i]*0.006));
        }

        double output = tmp[0];
        int place = 0;
        for(int i=0; i<tmp.length; i++) {
            if(output > tmp[i]) {
                output = tmp[i];
                place = i;
            }
        }

        System.out.println(place+1);
        sc.close();
    }
}


Measured memory_bytes: 22996
package main

// Dynamic Programming //
// minv = R[0]
// for j が 1 から n-1 まで
//   maxv = (maxv と R[j]-minv のうち大きい方)
//   minv = (minv と R[j] のうち小さい方)

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

// Scan Standard Input
var sc = bufio.NewScanner(os.Stdin)

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	count, _ := strconv.Atoi(nextLine())

	n0, _ := strconv.Atoi(nextLine())
	minv := n0
	maxv := math.MinInt32

	for i := 1; i < count; i++ {
		n, _ := strconv.Atoi(nextLine())

		if maxv < n-minv {
			maxv = n - minv
		}

		if minv > n {
			minv = n
		}
	}

	fmt.Println(maxv)
}



Measured memory_bytes: 4132
#include <iostream>
using namespace std;
int main() {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a+b > c+d) {
        cout << "Left" << endl;
    } else if (a+b == c+d) {
        cout << "Balanced" << endl;
    } else {
        cout << "Right" << endl;
    }
}

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

int main() {
    int N;
    int sumdiv = 0;
    cin >> N;
    for(int j = 1; j < N; ++j) {
      int divisors_sum = 0;
      for(int i = 1; i < int(sqrt(j))+1; ++i) {
        if (j % i == 0) { 
          divisors_sum++;
          if (i != int(j / i)) {
            divisors_sum++;
          }
        }
      }
      sumdiv += divisors_sum;
    }
    cout << sumdiv << "\n";
    return 0;
}

Measured memory_bytes: 3680
#include <bits/stdc++.h>
using namespace std;
int main()
{
  string a;
  int i=0;
    
  cin >> a;
  while(a[i]){
    i++;
  }
  if(a[i-1] == 's'){
  cout << a << "es";
  }else{
  cout << a << "s";
  }
  return 0;
}

Measured memory_bytes: 3620
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <climits>
#include <cmath>
#include <utility>
#include <string>
#include <cstring>
#include <functional>

using namespace std;

int main() {

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	int n, m, k;
	cin >> n >> k;
	if (n&1)
		m = n/2 + 1;
	else
		m = n/2;

	if (k <= m)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
	

	return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

struct Xorshift{
        unsigned int x, y, z, w, t;

        unsigned int rand(){
                t = x ^ (x << 11);
                x = y; y = z; z = w;
                return w = ( (w ^ (w>>19)) ^ (t ^ (t>>8)));
        }

        Xorshift():x(123456789U), y(362436069U), z(521288629U), w(88675123U){}
};
Xorshift rnd;


int main(){
    int n,k;

    cin >> n >> k;
    int card[k][n];
    for(int i=0;i<k;i++){
        for(int j=0;j<n/2;j++){
            cin >> card[i][j];
        }
    }
    int res[n];
    for(;;){
        for(int i=0;i<n;i++){
            res[i] = rnd.rand()%2;
        }
        int tmp = 0;
        for(int i=0;i<k;i++){
            tmp = 0;
            for(int j=0;j<n/2;j++){
                tmp += res[card[i][j]-1];
            }
            if(!(n <= 8*tmp && 8*tmp <= 3*n)){
                goto nxt;
            }
        }
        break;
      nxt:;
    }
    for(int i=0;i<n;i++){
        cout << res[i];
    }
    cout << endl;
}

Measured memory_bytes: 3116
N,K=map(int,input().split())
A=list(map(int,input().split()))

d={}
for Ai in A:
    if Ai not in d:
        d[Ai]=1
    else:
        d[Ai]+=1

l=sorted(list(d.values()))

print(sum(l[:max(len(l)-K,0)]))

Measured memory_bytes: 96976
//#include <fsociety>
#include <cmath>
#include <deque>
#include <algorithm>
#include <iterator>
#include <list>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <unordered_set>
#include <stack>
#include <string>
#include <vector>
#include <iostream>
//end of libraries ;
#define INF 9999999999
#define N 300003
#define F first
#define S second
#define pb push_back
#define ll long long
#define fcin ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
using namespace std;
ll n ,k , x;
set<ll> st;
int main(){
fcin;	
	cin>>n>>k;
	x = n;
	// if(n%k==0) cout<<0;
	// else{
		// if(k>n) { cout<<n; }
		// else{
			ll r = n % k ;
			for(int i = 0 ; i < 10e5 ; i++){
				if(x > k){ st.insert(x%k); x %= k;}
				else {
					st.insert(abs(x-k));
					x = k - x;
				}
				if(x > k) r = x % k;
				else r = k - x;
			}
			auto it = st.begin();
			cout<<*it<<endl;
		// }
	// }

}


Measured memory_bytes: 256
#include "bits/stdc++.h"
#include <boost/multi_array.hpp>
#include <boost/optional.hpp>
#include <boost/range/irange.hpp>
#include <boost/range/algorithm.hpp>
#include <boost/range/adaptors.hpp>
#include <boost/operators.hpp>
#include <boost/dynamic_bitset.hpp>

namespace adaptor = boost::adaptors;
using index_t = std::size_t;

std::int64_t gcd(std::int64_t a, std::int64_t b)
{
	return b == 0 ? a : gcd(b, a % b);
}

void Main()
{
	int N;
	std::int64_t M;
	std::cin >> N >> M;
	std::int64_t lcm = 1;
	std::vector<std::int64_t> vec(N);
	for (auto& v : vec)
	{
		std::cin >> v;
		v /= 2;
		lcm = lcm * v / gcd(lcm, v);
		if (M < lcm)
		{
			std::cout << 0 << std::endl;
			return;
		}
	}
	for (auto&& v : vec)
	{
		if ((lcm / v) % 2 == 0)
		{
			std::cout << 0 << std::endl;
			return;
		}
	}
	std::cout << (M / lcm + 1) / 2 << std::endl;
}

int main()
{
	std::cin.tie(nullptr);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	Main();
}

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

using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

#define REP(i, l, n) for(int i=(l), i##_len=(n); i<i##_len; ++i)
#define ALL(x) (x).begin(),(x).end()
#define pb push_back

ll gcd(ll a,ll b){return b ? gcd(b,a%b) : a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

char alpha[26] = {'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'};

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

int main(){
    string s; cin >> s;
    vector<int> al(26, 0);
    REP(i, 0, s.size()){
        al[s[i]-'a']++;
    }
    REP(i, 0, 26){
        if(al[i]%2 == 1){
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
}

Measured memory_bytes: 384
#![allow(unused_imports)]

use text_io::*;
use proconio::*;
use std::collections::*;
use std::process::exit;
use std::cmp::*;
use itertools::Itertools;
use num::*;


fn main() {
    input! {
        n:usize,
        m:usize,
        a:[(isize,isize);n],
        b:[(isize,isize);m],
    }
    let mut v=vec![1000000000;m+n];
    let mut x=vec![0;m+n];
    for i in 0..n {
        for j in 0..m {
            if (a[i].0-b[j].0).abs()+(a[i].1-b[j].1).abs()<v[i] {v[i]=(a[i].0-b[j].0).abs()+(a[i].1-b[j].1).abs();x[i]=j+1 }
        }
    }
    for i in 0..n {
        println!("{}",x[i])
    }
}

Measured memory_bytes: 2092
#include<bits/stdc++.h>
#define int long long
using namespace std;
int const MOD=1e9+7;
int n;
inline int power(int x,int n){
	if(!n)return 1;
	int ans=power(x,n/2);
	ans=ans*ans%MOD;
	if(n&1)ans=ans*x%MOD;
	return ans%MOD;
}
signed main(){
	cin>>n;
	cout<<(power(10,n)-power(9,n)*2%MOD+power(8,n)+MOD)%MOD;
}

Measured memory_bytes: 3628
#!/usr/bin/env python3
import sys

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(S: str):
    return YES if S[2] == S[3] and S[4] == S[5] else NO


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    print(solve(S))

if __name__ == '__main__':
    main()


Measured memory_bytes: 2940
package main

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

var INF int32 = math.MaxInt32
var INF64 int64 = math.MaxInt64

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

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

func min64(a, b int64) int64 {
	if a < b {
		return a
	}
	return b
}

func max64(a, b int64) int64 {
	if a < b {
		return b
	}
	return a
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func readLineNums(bf *bufio.Reader) []int {
	line, _ := bf.ReadString('\n')
	line = strings.Trim(line, "\n")
	fields := strings.Split(line, " ")
	nums := []int{}
	for _, field := range fields {
		num, _ := strconv.Atoi(field)
		nums = append(nums, num)
	}
	return nums
}

func readLineNum64s(bf *bufio.Reader) []int64 {
	line, _ := bf.ReadString('\n')
	line = strings.Trim(line, "\n")
	fields := strings.Split(line, " ")
	nums := []int64{}
	for _, field := range fields {
		num, _ := strconv.ParseInt(field, 10, 64)
		nums = append(nums, num)
	}
	return nums
}

func readLineFloats(bf *bufio.Reader) []float64 {
	line, _ := bf.ReadString('\n')
	line = strings.Trim(line, "\n")
	fields := strings.Split(line, " ")
	nums := []float64{}
	for _, field := range fields {
		num, _ := strconv.ParseFloat(field, 64)
		nums = append(nums, num)
	}
	return nums
}

func readLineStrs(bf *bufio.Reader) []string {
	line, _ := bf.ReadString('\n')
	line = strings.Trim(line, "\n")
	return strings.Split(line, " ")
}

func dfs(i int, j int, k int, K string, D int, dp [][][]int) int {
	if i == len(K) {
		if j == 0 {
			return 1
		}
		return 0
	}

	// 已经计算过
	if dp[i][j][k] > -1 {
		return dp[i][j][k]
	}

	M := 1000000007
	ans := 0
	addAns := func(cnt int) {
	    ans += cnt
	    if ans >= M {
	        ans -= M
	    }
	}

	if k == 0 {
		// 前面的值不能保证小于等于K
		// 所以当前的值, 只能取0~Ki
		for jj:=0; jj<int(K[i]-'0'); jj++ {
			// 可以保证小于K
			addAns(dfs(i+1, (j+jj)%D, 1, K, D, dp))
		}
		// 不能保证小于K
		addAns(dfs(i+1, (j+int(K[i]-'0'))%D, 0, K, D, dp))
	} else {
		// 前面的值不能保证小于等于K
		// 所以当前的值, 只能取0~Ki
		for jj:=0; jj<=9; jj++ {
			// 可以保证小于K
			addAns(dfs(i+1, (j+jj)%D, 1, K, D, dp))
		}
	}

	dp[i][j][k] = ans
	return dp[i][j][k]
}

func main() {
	bf := bufio.NewReader(os.Stdin)
	K := readLineStrs(bf)[0]
	D := readLineNums(bf)[0]

	/*
		定义:
			dp[i][j][k]: 第i位, 和模D的值为j, k表示前面的位是否已经小于K, 
						 如果小于, 则当前为可以取值为0~9, 否则当前为只
						 能取值为0~K[i]
		求解见见dfs那里
	*/
	dp := make([][][]int, len(K))
	for i := range dp {
		dp[i] = make([][]int, D)
		for j := range dp[i] {
			dp[i][j] = make([]int, 2)
            dp[i][j][0] = -1
            dp[i][j][1] = -1
		}
	}

	ans := dfs(0, 0, 0, K, D, dp)
	ans--
	if ans < 0 {
		ans += 1000000007
	}
	fmt.Println(ans)
}

Measured memory_bytes: 49280
#include <stdio.h>

#define ROW 3
#define COLUMNS 4

int
main(void)
{
	char c[ROW][COLUMNS];
	int i;

	for (i = 0; i < 3; i++)
		scanf("%s", c[i]);

	printf("%c%c%c\n", c[0][0], c[1][1], c[2][2]);
	return (0);
}

Measured memory_bytes: 128
#include<stdio.h>
int a[1024];
int tp[1024];
int dp[605][305][305];
int main()
{
	int n;
	scanf("%d",&n);
	for(int i=1;i<=(n<<1);i++)
	{
		scanf("%d",&a[i]);
	}
	int num=0;
	for(int i=1;i<=(n<<1);i+=2)
	{
		if(a[i]>0&&a[i+1]>0)
		{
			tp[a[i]]=2;
			tp[a[i+1]]=2;
		}
		else if(a[i]>0&&a[i+1]<0)
		{
			tp[a[i]]=1;
		}
		else if(a[i]<0&&a[i+1]>0)
		{
			tp[a[i+1]]=1;
		}
		else
		{
			num++;
		}
	}
	int num0=0,num1=0;
	dp[n<<1][0][0]=1;
	for(int i=(n<<1);i>0;i--)
	{
		for(int j=0;j<=n;j++)
		{
			for(int k=0;k<=n;k++)
			{
				if(!dp[i][j][k])
				{
					continue;
				}
				if(tp[i]==2)
				{
					dp[i-1][j][k]=dp[i][j][k];
					continue;
				}
				if(tp[i]==1)
				{
					if(j)
					{
						dp[i-1][j-1][k]+=dp[i][j][k];
						if(dp[i-1][j-1][k]>=1000000007)
						{
							dp[i-1][j-1][k]-=1000000007;
						}
					}
					dp[i-1][j][k+1]+=dp[i][j][k];
					if(dp[i-1][j][k+1]>=1000000007)
					{
						dp[i-1][j][k+1]-=1000000007;
					}
					continue;
				}
				dp[i-1][j+1][k]+=dp[i][j][k];
				if(dp[i-1][j+1][k]>=1000000007)
				{
					dp[i-1][j+1][k]-=1000000007;
				}
				if(k)
				{
					dp[i-1][j][k-1]+=(long long)dp[i][j][k]*k%1000000007;
					if(dp[i-1][j][k-1]>=1000000007)
					{
						dp[i-1][j][k-1]-=1000000007;
					}
				}
				if(j)
				{
					dp[i-1][j-1][k]+=(long long)dp[i][j][k]*(num-(((num0+num1-j-k)>>1)-(num1-k)))%1000000007;
					if(dp[i-1][j-1][k]>=1000000007)
					{
						dp[i-1][j-1][k]-=1000000007;
					}
				}
			}
		}
		if(tp[i]==0)
		{
			num0++;
		}
		if(tp[i]==1)
		{
			num1++;
		}
	}
	printf("%d\n",dp[0][0][0]);
	return 0;
}

Measured memory_bytes: 219264
using System;

namespace AtCorder2
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            long a = int.Parse(input[0]);
            long b = int.Parse(input[1]);

            Console.WriteLine(Method(a, b));
        }

        static long Method(long a, long b)
        {
            if (a == 1) return 1;

            if (b == 1) return 1;

            if (a % 2 == 0) return a * b / 2;

            if (b % 2 == 0) return a * b / 2;

            return a * b / 2 + 1;
        }
    }
}


Measured memory_bytes: 11092
#include<iostream>
#include<cstdio>
#include<queue>
using namespace std;
const int N=2002020;
int n,k,a[N];
bool check(int x){
	int res=0;
	for(int i=1;i<=n;i++){
		res+=(a[i]+x-1)/x-1;
		if(res>k)return false;
	} return true;
}
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*10+ch-'0';ch=getchar();}
	return x*f;
}
int main()
{
	n=read(); k=read();
	for(int i=1;i<=n;i++)a[i]=read();
	int l=1,r=2e9,as=2e9;
	while(l<=r){
		int mid=(l+r)/2;
		if(check(mid))r=mid-1,as=mid;
		else l=mid+1;
	} cout<<as<<endl;
	return 0;
}

Measured memory_bytes: 4376
#include <iostream>

using lint = long long;

int main() {
    lint n;
    std::cin >> n;

    if (n % 2 == 1) {
        std::cout << 0 << std::endl;
        return 0;
    }

    n /= 2;
    lint ans = 0;
    while (n > 0) {
        ans += n / 5;
        n /= 5;
    }

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


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

int main() {
	int N, M, a, b, T[100000] = { 0 };
	scanf("%d %d", &N, &M);
	for (int i = 0; i < M; i++) {
		scanf("%d %d", &a, &b);
		T[a - 1]++, T[b - 1]++;
	}
	bool can = true;
	for (int i = 0; i < N; i++)
		can &= T[i] % 2 == 0;
	printf("%s\n", (can ? "YES" : "NO"));
}

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

#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 all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fst first
#define snd second

template<class T> bool ckmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<pii> vii;

int main() {
  cin.tie(0)->sync_with_stdio(0);
  cin.exceptions(cin.failbit);

  string s;
  cin >> s;
  if (s[1] == 'B') s[1] = 'R';
  else s[1] = 'B';
  cout << s << '\n';
}

Measured memory_bytes: 3648
#include <iostream>
using namespace std;
#define int long long
const int INF = 1 << 28;
signed main(){
	int a, b, n;
	while (cin >> a){
		cin >> b >> n;
		if (b == 0) break;
		int s = 0;
		for (int i = 0; i<n; i++) 
			s += (a=(a*10)%(b*100))/b % 10;
		cout << s << endl;
	}
	return 0;
}

Measured memory_bytes: 1156
use std::io::Read;
use itertools::Itertools;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let answer = solve(&buf);

    println!("{}", answer);
}

fn solve(input: &str) -> String {
    let mut iterator = input.split_whitespace();

    let s: String = iterator.next().unwrap().to_string();

    if s.len() <= 2 {
        return s;
    }

    return s.chars().rev().join("");
}


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

int main() {
    int n; cin >> n;
    set<string> s;
    for (int i = 0; i < n; i++) {
        string t; cin >> t;
        s.insert(t);
    }
    int ans = s.size();
    cout << ans << endl;
}

Measured memory_bytes: 19252
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T> V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> > Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T> mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }

/*
 <url:http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1160&lang=jp>
 問題文============================================================
 =================================================================
 解説=============================================================
 ================================================================
 */

int w,h;
int solve(){
    int res = 0;
    vector<vector<int>> grid(h+2,vector<int>(w+2));
    for(int i = 1; i <= h; i++) for(int j = 1; j <= w;j++) cin >> grid[i][j];
    for(int i = 1; i <= h; i++) for(int j = 1; j <= w;j++){
        if(grid[i][j]){
            queue<pii> q; q.push({i,j});
            while(q.size()){
                int y,x;  tie(y,x) = q.front(); q.pop();
                if(grid[y][x] == 0) continue;
                grid[y][x] = 0;
                for(int dy = -1; dy <= 1; dy++){
                    for(int dx = -1; dx <= 1; dx++){
                        q.push({y+dy,x+dx});
                    }
                }
            }
            res++;
        }
    }
    return res;
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    while(cin >> w >> h,w){
        cout << solve() << endl;
    }
    return 0;
}



Measured memory_bytes: 3152
#include <iostream>

#include <stdio.h>

using namespace std;
 
int main(){
 

	double a,b,c,d,e,f;

	while(cin>>a>>b>>c>>d>>e>>f){

		double y=(a*f-c*d)/(a*e-b*d);

		double x=(c-b*y)/a;
	
	printf("%.3f %.3f\n",x,y);

	}

 

	return 0;

}

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

int main()
{
	int n, m[200001];
	
	cin >> n;
	
	for (int i = 0; i < n; i++){
		cin >> m[i];
	}
	int m_max = -1000000000, m_min = m[0];
	
	for (int i = 1; i < n; i++){
		m_max = max(m_max, m[i] - m_min);
		m_min = min(m_min, m[i]);
	}
	
	cout << m_max << endl;
	
	return (0);
	
}

Measured memory_bytes: 1940
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
using namespace std;
const int maxn=110109;
long long a[maxn];
int n;
int main()
{

    while(scanf("%d",&n)!=EOF)
    {

        for(int i=0;i<n;i++)
        scanf("%lld",&a[i]);
        long long cnt=0;
        long long s=0;
        long long ans=0;
        long long an=0;
        for(int i=0;i<n;i++)
        {
            ans=a[i]/2;
            an=a[i]%2;
             a[i]=an;
             cnt+=ans;
             if(a[i]&&a[i+1])
             {cnt++;
              a[i]=0;
              a[i+1]--;
             }

        }
        printf("%lld\n",cnt);
    }
    return 0;
}


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

int fexp(int a, int n)
{
	int res = 1;
	while(n)
	{
		if(n & 1)
		res *= a;
		a *= a;
		n >>= 1;	
	}	
	return res;
}

int main(void)
{
	int x;
	std::cin>>x;
	int maxi = 0;
	for(int i=2;i<10;i++)
	{
		for(int j=1;fexp(j, i)<=x;j++)
		maxi = std::max(maxi, fexp(j, i));
	}	
	std::cout<<maxi<<"\n";
	return 0;
}

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

using namespace std;

#define loop(i,a,b) for(int i = a ; i < b ; i ++)
#define rep(i,a) loop(i,0,a)

int main(void){
  string str;
  cin>>str;
  for(int i = str.size () - 1 ; i >= 0 ; i --)
    cout<<str[i];
  cout<<endl;
}

Measured memory_bytes: 1172