akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i, a, b) for(ll i = ll(a); i < ll(b); i++)
#define rer(i, a, b) for(ll i = ll(a) - 1; i >= ll(b); i--)
#define sz(v) (int)(v).size()
#define pb push_back
#define sc second
#define fr first
#define sor(v) sort(v.begin(),v.end())
#define rev(s) reverse(s.begin(),s.end())
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a)
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a)
#define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end())
using namespace std;
typedef long long int ll;
typedef pair <int, int> P;

const ll MOD=1000000007;
int n,d;
int x[10][10];
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin>>n>>d;
    rep(i,0,n){
        rep(j,0,d){
            cin>>x[i][j];
        }
    }
    int ans=0;
    rep(i,0,n){
        rep(j,i+1,n){
            int D=0;
            rep(k,0,d){
                D+=(x[i][k]-x[j][k])*(x[i][k]-x[j][k]);
            }
            int s=sqrt(D);
            if(s*s==D) ans++;
        }
    }
    cout <<ans<<"\n";
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*b)/gcd(a,b)
#define ff first
#define ss second
#define p pair<ll,ll>
#define pb push_back
#define endl '\n'
#define w(t) ll test;cin>>test;while(test--)
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(0);
#define iof  freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define pi acos(-1)
const ll mxn=3e5;
int main()
{
    fast;
    ll h,m,w;
    cin>>h>>w>>m;
    map<p,ll>mp;
    map<ll,ll>row,col;
    ll rmax=0,cmax=0;
    ll r=0,c=0;
    for(ll i=0;i<m;i++)
    {
        ll a,b;
        cin>>a>>b;
        mp[{a,b}]=1;
        row[a]++;
        if(row[a]>rmax)
        {
            rmax=row[a];
            r=a;
        }
        col[b]++;
        if(col[b]>cmax)
        {
            cmax=col[b];
            c=b;
        }
    }
    ll ans=0;
    for(ll i=1;i<=w;i++)
    {
        if(mp[{r,i}])ans=max(ans,(rmax+col[i]-1));
        else ans=max(ans,rmax+col[i]);
    }
    for(ll i=1;i<=h;i++)
    {
        if(mp[{i,c}])ans=max(ans,(cmax+row[i]-1));
        else ans=max(ans,cmax+row[i]);
    }
    cout<<ans<<endl;
}



Measured memory_bytes: 97320
#include <algorithm>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
using ll = long long;
const ll MOD = 1e9 + 7;

ll dp[310][310][310];

int main() {
  int N, M;
  while (cin >> N >> M) {
    vector<vector<pair<int, int>>> conditions(N);
    for (int i = 0; i < M; i++) {
      int s, t, x;
      cin >> s >> t >> x;
      --s;
      --t;
      conditions[t].emplace_back(s, x);
    }
    memset(dp, -1, sizeof(dp));
    auto solve = [&](auto f, int r, int g, int b) -> ll {
      ll& res = dp[r + 1][g + 1][b + 1];
      if (res != -1) {
        return res;
      }
      int k = max({r, g, b});
      if (k >= 0) {
        for (auto cond : conditions[k]) {
          int s = cond.first, x = cond.second;
          int y = (s <= r) + (s <= g) + (s <= b);
          if (y != x) {
            return res = 0;
          }
        }
      }
      if (k >= N - 1) {
        return res = 1;
      }
      res = 0;
      res = (res + f(f, k + 1, g, b)) % MOD;
      res = (res + f(f, r, k + 1, b)) % MOD;
      res = (res + f(f, r, g, k + 1)) % MOD;
      return res;
    };
    cout << solve(solve, -1, -1, -1) << endl;
  }
  return 0;
}


Measured memory_bytes: 233088
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for(ll i = 0; i < (ll)(n); ++i)
#define FOR(i, a, b) for(ll i=(a); i < (ll)(b); ++i)
template<class T> inline bool chmax(T& a, T b) { if(a < b){ a=b; return 1; } return 0;}
template<class T> inline bool chmin(T& a, T b) { if(a > b){ a=b; return 1; } return 0;}

int dp[101][2][4]={};
// 桁数(0-based)..n未満か..0以外の数字の数

int main(){
	string n;
	int k;
	cin >> n >> k;
	
	dp[0][0][0] = 1;
	FOR(i,1,4) dp[0][0][i] = 0;
	FOR(i,0,4) dp[0][1][i] = 0;
	
	REP(i,n.size()){
		REP(t,k){
			REP(j,10){
				if(j==0){
					if((int)(n[i]-'0') == 0){
						dp[i+1][1][t] += dp[i][1][t];
						dp[i+1][0][t] += dp[i][0][t];
					}else{
						dp[i+1][1][t] += dp[i][1][t] + dp[i][0][t];
					}
				}else if(j < (int)(n[i]-'0')){
					dp[i+1][1][t+1] += dp[i][1][t] + dp[i][0][t];
				}else if(j == (int)(n[i]-'0')){
					dp[i+1][0][t+1] += dp[i][0][t];
					dp[i+1][1][t+1] += dp[i][1][t];
				}else{
					dp[i+1][1][t+1] += dp[i][1][t];
				}
			}
		}
		if((int)(n[i]-'0') == 0){
			dp[i+1][1][k] += dp[i][1][k];
			dp[i+1][0][k] += dp[i][0][k];
		}else{
			dp[i+1][1][k] += dp[i][1][k] + dp[i][0][k];
		}
	}
	
	/*
	REP(i,n.size()+1){
		REP(j, k+1){
			cout << dp[i][0][j]<<"&"<<dp[i][1][j] << " ";
		}
		cout << endl;
	}
	
	int ans=0;
	FOR(i,1,n.size()+1){
		ans += dp[i][0][k];
		ans += dp[i][1][k];
	}*/
	
	cout << dp[n.size()][1][k]+dp[n.size()][0][k] << endl;
	
	return 0;
}

Measured memory_bytes: 3544
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
const int MOD=(int)1e9+7;
using namespace std;
int main(){
    vector<int> a(3);
    REP(i,3)cin>>a.at(i);
    sort(a.begin(),a.end());
    cout<<abs(a.at(0)-a.at(1))+abs(a.at(1)-a.at(2))<<endl;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner scan =  new Scanner(System.in);
		int N = scan.nextInt();
		ArrayList<Integer> num = new ArrayList<Integer>();
		long money =1000;
		num.add(scan.nextInt());
		for(int i=0;i<N-1;i++){
			int p = scan.nextInt();
			if(num.get(num.size()-1)!=p){
				num.add(p);
			}
		}

		for(int i=0;i<num.size();i++){
			int p = -1;
			int min = num.get(i);
			for(int l=i+1;l<num.size();l++){
				if(min<num.get(l)){
					p=l;
					break;
				}else if(min>num.get(l)){
					min=num.get(l);
				}
			}
			if(p!=-1){
				money+=(num.get(p)-min)*(money/min);
			}else{
				break;
			}
			i=p-1;
		}
		System.out.println(money);
	}
}


Measured memory_bytes: 27212
/*
I just got lost in thought. It was unfamiliar territory.
- Steven Wright
*/

#include <algorithm>
#include <bitset>
#include <complex>
#include <cstring>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <vector>
//#include <boost/math/common_factor.hpp>
using namespace std;

#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define RFOR(i, b, a) for(int i = (b) - 1; i >= (a); --i)
#define REP(i, N) FOR(i, 0, N)
#define RREP(i, N) RFOR(i, N, 0)
#define FILL(A,value) memset(A,value,sizeof(A))

#define ALL(V) V.begin(), V.end()
#define SZ(V) (int)V.size()
#define pb push_back
#define mp make_pair
#define Pi 3.14159265358979
#define A first
#define B second

typedef long long ll;
typedef vector <int> vi;
typedef vector<ll> vl;
typedef pair <int, int> pi;
typedef pair <ll, int> pl;
typedef pair <double, double> pd;

//change these according to prob constraints
const int INF = 1000000000;
const int MAX = 100005;
const int MAX1 = 2007;
const int MAX2 = 4007;
const int LEN = 21;
const int BASE = 1000000000;
const double EPS = 1e-7;
const int MOD = 1234567891;
//g++ -std=c++11 your_file.cpp -o your_program

int main(void){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ifstream in("");
    ofstream out("");
    int n, ct = 0;
    cin >> n;
    FOR (i, 1, n + 1){
        if (i & 1){
            int tmp = 1;
            FOR(j, 1, i / 2 + 1){
                if (i % j == 0) ++tmp;
            }
            if (tmp == 8) ++ct;
        }
    }
    cout << ct << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <functional>
using namespace std;

#define Rep(b, e, i) for(int i = b; i <= e; i++)
#define Repr(e, b, i) for(int i = e; i >= b; i--)
#define rep(n, i) Rep(0, n-1, i)
#define repr(n, i) Repr(n-1, 0, i)
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define uniq(x) (x).erase(unique(all(x)),(x).end())

typedef long long ll;
typedef pair<int, int> P;
typedef std::priority_queue<int> IntPrioQueue; //Z->A
typedef std::priority_queue<int, std::vector<int>, std::greater<int> > IntReversePrioQueue; //A->Z

const int MAX = 200000;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = 1<<29;
const int MOD = 1000000007;

int dx4[4]={1,0,-1,0};
int dy4[4]={0,1,0,-1};
int dx8[8]={1,0,-1,1,-1,1,0,-1};
int dy8[8]={1,1,1,0,0,-1,-1,-1};

vector <P> xs;

void solve(void){
    int N;
    cin >> N;
    rep(N, i) {
        double A; cin >> A;
        xs.pb(P(A, i));
    }
    sort(all(xs));
    double mid = (xs[N/2].first + xs[N/2-1].first)/2.;
    vector <int> ans(N);
    rep(N, i) {
        P p = xs[i];
        if (p.first < mid) {
            ans[p.second] = xs[N/2].first;
        }
        else ans[p.second] = xs[N/2-1].first;
    }
    rep(N, i) printf("%d\n", ans[i]);
}

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


Measured memory_bytes: 4592
import heapq

N = int(input())
A = [[]for i in range(N)]

for i in range(N):
    u, k, *nums = list(map(int,input().split()))
    for j in range(k):
        t = nums[j*2]
        c = nums[j*2+1]
        A[u].append([t, c])

memo = [1E18] * N
memo[0] = 0
qu = []
heapq.heappush(qu,(0,0))
while len(qu) != 0:
    atop = heapq.heappop(qu)
    for ne in A[atop[1]]:
        next_cost = atop[0] + ne[1]
        if(memo[ne[0]] > next_cost):
            memo[ne[0]] = next_cost
            heapq.heappush(qu, (next_cost,ne[0]))
for i in range(N):
    print(i, memo[i])


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

#define each(i, c) for (auto& i : c)
#define mkp(a, b) make_pair(a, b)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> Pll;
const ll MOD = 1e9+7;

template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << ": " << p.second << ")"; return os; }
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; each (i, v) os << i << ", "; os << ")"; return os; }
template<typename K, typename V> ostream& operator << (ostream& os, map<K, V> m) { os << "{"; each (i, m) os << i << ", "; os << "}"; return os; }

void solve2(vector<ll> &ans, string x) {
  if (x.size() > 10) return;
  ll n = atoll(x.c_str());
  if (x[0] != '0') ans.push_back(n);

  ll next = x[0]-'0';
  for (ll i = next-1; i <= (next+1); ++i) {
    if (i < 0) continue;
    if (i >= 10) continue;
    auto next_x = x;
    next_x.insert(0, to_string(i));
    solve2(ans, next_x);
  }
}

int main() {
  ll k;
  cin >> k;

  vector<ll> ans;
  for (ll i = 0; i <= 9; ++i) {
    solve2(ans, to_string(i));
  }
  sort(ans.begin(), ans.end());

  cout << ans[k-1] << endl;

  return 0;
}

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

int main() {
  	int j=0;
	string S;
  	string T;
  	cin >> S;
  	cin >> T;
  for (int i = 0; i < 3; i++) {
    if ( S.at(i)==T.at(i) ){
      j++;
     }
}
  cout << j << endl;
}

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

int main(void) {
    ll N,Y;
    cin >> N;
    cin >> Y;
    ll a,b,c;
    a = min(N, Y / 10000 );
    b = min(N, Y / 5000 );
    c = min(N, Y / 1000 );

    // ijk
    for(int i = 0; i <= a; i++) {
        for(int j = 0; j <= b-i; j++) {
            ll k = N - i - j;
            if(i*10000 + j*5000 + k*1000 == Y) {
                cout << i << ' ' << j << ' ' << k << endl;
                return 0;
            }
        }
    }
    cout << -1 << ' ' << -1 << ' ' << -1 << endl;
    return 0;
}


Measured memory_bytes: 256
process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = []
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

reader.on('line', (line) => {
  lines.push(line);
});

reader.on('close', () => {
 var a = Number(lines[0]);
 var b = Number(lines[1]);
 var c = Number(lines[2]);
 var x = Number(lines[3]);
 var count= 0;

 for(i=0; i<=a; i++){
   for(j=0; j<=b; j++){
     for(k=0; k<=c; k++){
       if(i*500 + j*100 + k*50 == x){
         count++;
       }
     }
   }
 }

 console.log(count);
});

Measured memory_bytes: 7628
import java.util.Arrays;
import java.util.Scanner;

public class Main {

    void run() {
        Scanner sc = new Scanner(System.in);
        String s1 = sc.next();
        String s2 = sc.next();
        int n1 = s1.length();
        int n2 = s2.length();

        int[][] dp = new int[n1 + 1][n2 + 1];
        for (int[] x : dp) {
            Arrays.fill(x, Integer.MAX_VALUE);
        }
        for (int i = 0; i <= n1; i++) {
            dp[i][0] = i;
        }
        for (int j = 0; j <= n2; j++) {
            dp[0][j] = j;
        }
//        debug(dp);
        for (int i = 0; i < n1; i++) {
            for (int j = 0; j < n2; j++) {
                dp[i + 1][j + 1] =
                        Math.min(
                                Math.min(dp[i + 1][j] + 1, dp[i][j + 1] + 1),
                                dp[i][j] + (s1.charAt(i) == s2.charAt(j) ? 0 : 1)
                        );
            }
        }
//        debug(dp);

        System.out.println(dp[n1][n2]);
    }

    void debug(Object... os) {
        System.err.println(Arrays.deepToString(os));
    }

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



Measured memory_bytes: 31264
#include "bits/stdc++.h"
    #define LF '\n'
    #define ALL(x) x.begin(), x.end()
    #define iostreamBooster() do{cin.tie(nullptr);ios::sync_with_stdio(false);}while(0)
    using namespace std;
    typedef int64_t i64;
    typedef pair<int,int> pii;
    template<class A, class B>inline bool chmax(A &a, const B &b){return b>a ? a=b,1 : 0;}
    template<class A, class B>inline bool chmin(A &a, const B &b){return b<a ? a=b,1 : 0;}
    constexpr int INF = 0x3f3f3f3f;
    constexpr i64 LINF = 0x3f3f3f3f'3f3f3f3fLL;
     
     
    signed main()
    {
    string s;
    cin >> s;
    int len = s.length();
     
    int ans = INF;
     
    for (int i = 0; i < len; ++i) {
    string t = s.substr(i, 3);
     
    //cout << t << endl;
    if ((int)t.length() != 3) continue;
     
    chmin(ans, abs(stoi(t) - 753));
    }
     
    cout << ans << endl;
     
    return 0;
    }
     

Measured memory_bytes: 256
function Main(input){
	input = input.split(" ");
  var A = ~~input.shift();
  var B = ~~input.shift();
  return A%B && 1;
}

// If you are interested in the algorithms I used, 
// there is no need to read down from this line.

((b,c,d)=>"undefined"!=typeof require?console.log(Main(require("fs").readFileSync("/dev/stdin","utf8"))):[b=b.split("\n").slice(1,-1).join("\n"),c=function(){try{return Main(b)}catch(f){return f.stack||f.message}}(),d=typeof c,"string"==d||(c=JSON.stringify(c)),$("<form>").append([[10,b],0,[1,d],0,[10,c]].map(f=>$(f?"<textarea>":"<br>",f&&{rows:f[0],cols:40,text:f[1]}))).appendTo("body")])(`
8 4
`);

Measured memory_bytes: 7372
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    B = [int(b) for b in input().split()]

    A = [B[0]]
    A += [min(B[i],B[i+1]) for i in range(N-2)]
    A += [B[-1]]

    print(sum(A))





if __name__ == "__main__":
    main()

Measured memory_bytes: 38640
import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = {
    val sc: Scanner = new Scanner(System.in)
    val Array(a, b, c) = sc.nextLine.split(" ")
    if (a.last == b.head & b.last == c.head) println("YES")
    else println("NO")
  }
}


Measured memory_bytes: 25540
import itertools
n = int(input())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = sorted(p)
i = 0
for v in itertools.permutations(r):
  i+=1
  if list(v) == p:
    a = i
  if list(v) == q:
    b = i
print(abs(a-b))

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define inf 10e17
#define rep(i,n) for(long long i=0; i<n; i++)
#define repr(i,n,m) for(long long i=m; i<n; i++)
#define mod 1000000007
#define sorti(x) sort(x.begin(), x.end())
#define sortd(x) sort(x.begin(), x.end(), std::greater<long long>())
#define debug(x) std::cerr << (x) << std::endl;
#define roll(x) for (auto&& itr : x) { cerr << (itr) << " "; }

template <class T> inline void chmax(T &ans, T t) { if (t > ans) ans = t;}
template <class T> inline void chmin(T &ans, T t) { if (t < ans) ans = t;}

long long modpow(long long a, long long n, long long m) {
  long long res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }

  return res;
}

int main() {
  ll n,k;
  cin >> n >> k;

  unordered_map<ll, ll> hashMap;
  vector<ll> cnt(k+1);
  for (ll i = k; i > 0; --i) {
    ll cp = i, total = 0;
    ll tmp = 0;
    do {
      total += 1;
      cp += i;
      if (cp > k) break;
      tmp += cnt[cp];
      tmp %= mod;
    } while (cp <= k);

    cnt[i] += modpow(total, n, mod) + (mod - tmp);
    cnt[i] %= mod;
  }

  ll ans = 0;
  for (int i = 1; i <= k; ++i) {
    ans += cnt[i] * i;
    ans %= mod;
  }
  cout << ans << endl;
}

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

bool all_char_same(string s) {
  if ( s.size() < 1 ) { return true; }
  for ( int i = 1; i < s.size(); i++ ) {
    if ( s[0] != s[i] ) { return false; }
  }
  return true;
}

int main() {
  string s;
  cin >> s;
  string ans = ( all_char_same(s) ) ? "No" : "Yes";
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3584
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <cstring>
#include <cctype>
#include <ctime>
#include <climits>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <tuple>
#include <cmath>
#include <algorithm>
#include <unordered_set>
#include <unordered_map>

using namespace std;

#ifndef M_PI
    #define M_PI 3.14159265358979323846
#endif

#define mp make_pair
#define mt make_tuple
#define fr first
#define sc second
#define pb push_back
#define pp pop_back
#define all(x) x.begin(), x.end()

typedef long long ll;
typedef long double ld;
typedef tuple<long long, long long, long long> tlll;
typedef tuple<int, int, int> tiii;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;

const int INF = 1000000007;
const double eps = 0.000001;

const int SZ = 3e5;

int a[SZ];
bool used[SZ];
int n, m;

void dfs(int v, int pr, vector<vector<int>> &g)
{
    if (pr != -1)
        a[v] = !a[pr];
    used[v] = 1;
    for (int u : g[v])
    {
        if (!used[u])
            dfs(u, v, g);
        else if (a[v] == a[u])
        {
            cout << (ll)n * (n - 1) / 2 - m << endl;
            exit(EXIT_SUCCESS);
        }
    }
}

int32_t main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int v1, v2;
    cin >> n >>  m;
    vector<vector<int>> g(n);
    for (int i = 0; i < m;i++)
    {
        cin >> v1 >> v2; v1--; v2--;
        g[v1].push_back(v2);
        g[v2].push_back(v1);
    }


    a[0] = 0;
    dfs(0, -1, g);
    ll sm = 0;

    for (int i = 0; i < n; i++)
        sm += a[i];

    cout << sm * (n - sm) - m << endl;
    return 0;
}

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

#define FOR(i,a,b) for(int i = (a); i < (b); ++i)
#define REP(i,a) for(int i = 0; i < (a); ++i)

typedef long long LL;
typedef unsigned long long ULL;
typedef unsigned int UI;

using namespace std;


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

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

	for (size_t i = 1; i < s.size(); ++i)
	{
		if (s[i] == s[i - 1])
		{
			cout << "no" << endl;
			return 0;
		}
	}

	cout << "yes" << endl;

    return 0;
}

Measured memory_bytes: 256
/**
 *  winners never quit
**/

#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define pp pop_back
#define mp make_pair
#define IO cin.tie(0),cout.tie(0)
#define ISWS ios::sync_with_stdio(0)
typedef long long Long;
void FastIO(){ISWS;IO;}

const int N = 1e5;

int main()
{
  FastIO();
  int tc, ca = 0;
  int n;
  cin >> n;
  if (n < 30)cout << "No" << '\n';
  else cout << "Yes" << '\n';
  return 0;
}


Measured memory_bytes: 3616
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
#include <cmath>
using namespace std;
typedef long long i64;
typedef long double ld;
typedef pair<i64,i64> P;
#define rep(i,s,e) for(int i = (s);i <= (e);i++)

i64 a,b;
i64 x;

int main()
{
    cin >> a >> b >> x;

    i64 l = a + (x - a % x) % x;
    i64 r = b - b % x;
    i64 cou = (r - l) / x;
    cout << cou + 1 << endl;

}

Measured memory_bytes: 256
#include<cstdio>

using namespace std;

int main(void){
	double a;
	
	while(scanf("%lf", &a) != EOF){
		double n[11];
		n[1] = (double)a;
		
		for(int i = 2; i < 11; i++){
			if(i%2){
				n[i] = n[i-1]/3;
			}else{
				n[i] = n[i-1]*2;
			}
		}
		
		double ans = 0;
		for(int i = 1; i < 11; i++){
			ans += n[i];
		}
		
		printf("%lf\n", ans);
	}
	return 0;
}

Measured memory_bytes: 0
s = input()
odd = ["R","U","D"]
even = ["L","U","D"]

for i in range(len(s))[0::2]:
    if not s[i] in odd:
        print('No')
        exit(0)

for i in range(len(s))[1::2]:
    if not s[i] in even:
        print('No')
        exit(0)

print('Yes')

Measured memory_bytes: 3064
from itertools import permutations
from math import sqrt
n=int(input())
p_l=list(permutations(range(n)))
#print(p_l)
x=[]
for _ in range(n):
  x.append(list(map(int,input().split())))
n_fact=1
for i in range(n):
  n_fact*=(i+1)
ans=0
def dist(a,b):
  return sqrt((a[0]-b[0])*(a[0]-b[0]) + (a[1]-b[1])*(a[1]-b[1]))
for i in p_l:
  su=0
 # print(i)
  for j in range(1,len(i)):
    su+=dist(x[i[j-1]],x[i[j]])
#  print(su)
  ans+=su
print(ans/n_fact)


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

#define MAX_N 100

// string S = "?tc????";
// string T = "coder";
// string S = "??p??d??";
// string T = "abc";
string S;
string T;

int main() {
    cin >> S;
    cin >> T;
    int target_index = -1;

    int tmp = S.find(T);
    if (tmp >= 0) {
        for (int i = 0; i < S.length(); i++) {
            if (S[i] == '?') {
                cout << 'a';
            } else {
                cout << S[i];
            }
        }
        printf("\n");
        return 0;
    }

    for (int i = 0; i < S.length() - T.length() + 1; i++) {
         // 作成できるか
        bool is_enable = true;

        for (int j = 0; j < T.length(); j++) {
            if (S[i + j] != T[j] && S[i + j] != '?') {
                is_enable = false;
                break;
            }
        }
        if (is_enable) {
            target_index = i;
            // if (T[0] <= 'a') {
            //     break;
            // }
        }
    }

    if (target_index == -1) {
        cout << "UNRESTORABLE" << endl;
        return 0;
    }
    
    // 置き換え
    for (int i = 0; i < S.length(); i++) {
        if (i < target_index || target_index + T.length() - 1 < i) {
            if (S[i] == '?') {
                cout << 'a';
            } else {
                cout << S[i];
            }
        } else {
            cout << T[i - target_index];
        }
    }
    printf("\n");
}

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

using namespace std;

// stringをintに
// string a = "123";
// stoi(a)
//
// intをstringに
// int a = 123;
// to_string(a)
//
// charをintに
// char a = '1';
// (int)a - 48 // asciiコードを値にする

// stringのソート
// string str = "abccba";
// sort(str.begin(), str.end());
//
// ハッシュテーブル
// unordered_map<string, int> mp;
// mp["aabbcc"] = 0;

// 配列Aにcinする
//int main() {
//  int N;
//  cin >> N;
//  vector<int> A(N);
//  for (int i = 0; i < N; i++) {
//    cin >> A.at(i);
//  }
//  return 0;
//}

// 標準入出力
int main() {
	int N, Y;
	cin >> N >> Y;
  bool stopFlag = false;
  for (int i = 0; i <= N && stopFlag == false; i++) {
    for (int j = 0; j <= N && stopFlag == false; j++) {
      int z = N - i - j;
      if (z >= 0 && i + j + z <= N && Y - 10000 * i - 5000 * j - 1000 * z == 0) {
        cout << i << " " << j << " " << (Y - 10000 * i - 5000 * j) / 1000 << endl;
        stopFlag = true;
      }
    }
  }
  if (stopFlag == false) {
    cout << "-1 -1 -1" << endl;
  }
  return 0;
}

// 文字列を1文字ずつループ
//int main() {
//  string str;
//  cin >> str;
//  int sum = 0;
//  for(int i = 0; i < (int)str.size(); ++i){
//    char ch = str[i];
//
//    if (ch == '1') {
//      sum++;
//    }
//  }
//  cout << sum << endl;
//  return 0;
//}

// ビット全探索
// int main() {
// 	int K, S;
// 	cin >> K >> S;
//   int counter = 0;
//   for (int bit = 0; bit < (1<<K); bit++) {
//     vector<int> combination;
//     for (int i = 0; i < K; i++) {
//       if (bit & (1<<i)) {
//         combination.push_back(i);
//       }
//     }
//
//     int sum = accumulate(combination.begin(), combination.end(), 0);
//     if (sum == S) {
//       counter++;
//     }
//
//     cout << bit << ": {";
//     for (int i = 0; i < (int)combination.size(); ++i) {
//         cout << combination[i] << " ";
//     }
//     cout << "}" << endl;
//
//   }
//   cout << counter << endl;
//   return 0;
// }



Measured memory_bytes: 256
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <bitset>
#include <deque>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <iterator>
#include <string>
#include <chrono>
#include <random>
#include <tuple>
#include <utility>
#include <fstream>
#include <complex>
#define _USE_CMATH_DEFINES

const long INF = (1l << 30);
const long LINF = (1l << 60); //1.15*10^18

std::string s;

int main(){
    std::cin >> s;
    long ans = LINF;
    for(int i = 0; i < s.length()-2; i++){
        long x = (s[i] - '0')*100 + (s[i+1] - '0') * 10 + (s[i+2] - '0');
        ans = std::min(ans, std::abs(x-753));
    }
    printf("%ld\n", ans);
}


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


int main()
{
	ll n, k, sub, min = INT_MAX, small, large;
	cin>>n>>k;
	
	if(n<k && n<k/2)
		cout<<n<<endl;
	else if(n<k && n>= k/2)
		cout<<k-n<<endl;
	else if(n==k)
		cout<<"0"<<endl;
	else
	{
		large = n;
		small = k;
		
		ll div = n%k;
		min = div;
		
		while(1)
		{
			div = abs(div-k);
			if(div<min)
				min = div;
			else
				break;
		}
		
		cout<<min<<endl;
	}
} 

Measured memory_bytes: 256
def palindrome(string):
    return string.find(string[::-1])

s = input()
s_sum = 0
s_list1 = []
s_list2 = []

for i in range(len(s)):
    s_list1.append(s[i])

s_list2 = s_list1[::-1]

for i in range(len(s)):
    if s_list1[i] != s_list2[i]:
        s_sum += 1

print(s_sum // 2)


Measured memory_bytes: 3060
#include <stdio.h>
int main(void){
    int A,B,C;
    char a,b;
    scanf("%4d%c%2d%c%2d",&A,&a,&B,&b,&C);
    if(A>2019){
        printf("TBD\n");
    }
    else if(A<2019){
        printf("Heisei\n");
    }
    else{
        if(B>4){
            printf("TBD\n");
        }
        else if(B<=4){
            printf("Heisei\n");
        }
    }
    return 0;
}


Measured memory_bytes: 128
#define _GLIBCXX_DEBUG
#include <iostream>
#include <string>
using namespace std;

int main(void){
    int k;
    cin >> k;
    string s;
    cin >> s;
    if(s.size() > k) s = s.substr(0, k) + "...";
    cout << s << '\n';
    return 0;
}

Measured memory_bytes: 3636
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;

#define inf 1013161010
#define ninf -1013161010
#define mod 1000000007
#define ll long long
#define lf long double
#define in(x) scanf("%d",&x);
#define sz(x) ((int)x.size())
#define lld l64d
#define rep(i,n) for(i=0;i<n;i++)
#define rrep(i,n) for(i=n-1;i>=0;i--)
#define rep1(i,a,b) for(i=a;i<=b;i++)
#define rrep1(i,a,b) for(i=a;i>=b;i--)
#define stlfor(i,t) for(auto i =t.begin();i!=t.end();i++)
#define fr freopen("x.txt","r",stdin)
#define frc freopen("y.txt","w",stdout)
#define all(x) x.begin(),x.end()
#define set0(x) memset(x,0,sizeof(x))
#define dbg cout<<"yo "<<endl;
#define pset(n) fixed<<showpoint<<setprecision(n)

#define pii pair<int,int>
#define pll pair<ll,ll>
#define vpii vector<pair<int,int> >
#define si set<int>
#define mii map<int,int>
#define umii unordered_map<int,int>
#define vi vector<int>
#define pb push_back
#define ff first
#define ss second
#define mp make_pair

typedef tree<pii,null_type,less<pii>,rb_tree_tag,tree_order_statistics_node_update> OST;

ll toint(const string &s) { stringstream ss; ss << s; ll x; ss >> x; return x; }
string tostring ( ll number ){  stringstream ss; ss<< number; return ss.str();}

const lf pi = 2*acos(0);
const int nn = 2000006;

ll gcd(ll a,ll b){return (b==0)? a:gcd(b,a%b); }
void nope(int num = 0){ if(num==0) cout<<"NO"; else cout<<"-1"; exit(0); }

int a[nn],b[nn];
void solve()
{
    ll i,j,n;
    cin>>n;
    rep(i,n)
        cin>>a[i];

    i=0;
    j=n-1;
    while(j>=0)
    {
        b[i]=a[j];
        j-=2;
        i++;
    }
    if(j==-1)
        j=0;
    else if(j==-2)
        j=1;
    while(j<n)
    {
        b[i]=a[j];
        j+=2;
        i++;
    }

    rep(i,n)
        cout<<b[i]<<" ";
    cout<<endl;

}

int main()
{
    ios_base::sync_with_stdio(false); cin.tie(0);
    ll i,j,n,tt;
    tt=1;
    //cin>>tt;
    while(tt--)
    {
        solve();
    }
    return 0;
}



Measured memory_bytes: 7040
loop do
  n = gets.chomp.to_i
  break if n == 0
  a_score = 0
  b_score = 0
  n.times do
    a, b = gets.chomp.split.map(&:to_i)
    if a > b
      a_score += a + b
    elsif a < b
      b_score += a + b
    else
      a_score += a
      b_score += b
    end
  end
  puts "#{a_score} #{b_score}"
end


Measured memory_bytes: 6876
#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  long long sa = 0;
  long long sb = 0;
  vector<pair<int, int>> c(2 * n);
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    sa += x;
    sb += y;
    c[2 * i] = {x, i};
    c[2 * i + 1] = {y, i};
  }
  sort(c.begin(), c.end());
  long long ret = 0;
  vector<bool> ckd(n, false);
  for (int i = 0; i < n; i++) {
    ret += c[i].first;
    ckd[c[i].second] = true;
  }
  bool flag = true;
  for (int i = 0; i < n; i++) {
    if (!ckd[i]) {
      flag = false;
    }
  }
  if (flag) {
    if (c[n - 1].second != c[n].second) {
      ret = ret - c[n - 1].first + c[n].first;
    } else {
      ret = ret - max(c[n - 1].first - c[n + 1].first, c[n - 2].first - c[n].first);
    }
  }
  ret = min(ret, sa);
  ret = min(ret, sb);
  cout << ret << '\n';
  return 0;
}

Measured memory_bytes: 1792
from collections import defaultdict, deque
import sys
import heapq
import bisect
import itertools
import queue
import copy
import time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))

def inpl_str(): return list(sys.stdin.readline().split())

n, a, b = inpl()
s = list(input())
ans = []
t = 0
f_s = 0
for v in s:
    if v == 'a':
        if t < (a + b):
            ans.append('Yes')
            t += 1
        else:
            ans.append('No')
    if v == 'b':
        f_s += 1
        if t < (a + b) and f_s <= b:
            ans.append('Yes')
            t += 1
        else:
            ans.append('No')
    if v == 'c':
        ans.append('No')
for i in ans:
    print(i)

Measured memory_bytes: 6500
import java.util.*;
public class Main{

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        String[] s = new String[n];

        for(int i =0;i<n;i++){
            s[i]=sc.next();
        }

        Arrays.sort(s);

        for(int j =0;j<n;j++){
            System.out.print(s[j]);
        }
        
            

    }
}






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

using namespace std;

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

const char sp = ' ';
const char cmm = ',';
const int MOD = 1000000007;

using ll = long long;

ll mod(ll a, ll b){return (a%b+b)%b;}
ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b){return a*b/gcd(a,b);}
void Yes(){cout << "Yes" << endl;}
void No(){cout << "No" << endl;}
void Judge(bool b){b?Yes():No();}
void YES(){cout << "YES" << endl;}
void NO(){cout << "NO" << endl;}
void JUDGE(bool b){b?YES():NO();}
ll powMod(ll b, ll e, ll m){ll r=1;while(e>0){if(e&1)r=(r%m)*(b%m)%m;b=(b%m)*(b%m)%m;e>>=1;}return r;}
double distance(ll x1, ll y1, ll x2, ll y2){return sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));}

template<typename T>
void ppp(T n){cout << n << endl;}

int main(){

    cin.tie(0);
    ios::sync_with_stdio(false);

    int n;
    cin >> n;
    vector<int> p(n);
    rep(i, n){
        cin >> p[i];
    }

    vector<int> q(n);

    rep(i, n){
        q[p[i]-1] = i;
    }
    int ans = 0;
    int tmp = 1;
    rep(i, n-1){
        if(q[i] >= q[i+1]){
            ans = max(ans, tmp);
            tmp = 1;
        }
        else{
            ++tmp;
        }
    }
    if(ans == 0)
        ppp(0);
    else
        ppp(n-ans);




    return 0;
}


Measured memory_bytes: 1792
#pragma GCC optimize("O3")
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

using ll = long long;
using P = pair<int, int>;
using T = tuple<int, int, int>;

template <class T> inline T chmax(T &a, const T b) {return a = (a < b) ? b : a;}
template <class T> inline T chmin(T &a, const T b) {return a = (a > b) ? b : a;}

constexpr int MOD = 1e9 + 7;
constexpr int inf = 1e9;
constexpr long long INF = 1e18;

#define all(a) (a).begin(), (a).end()

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

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

    int n; cin>>n;
    vector<string> s(n);
    for(int i=0; i<n; i++) cin>>s[i];

    vector<P> l, r;
    for(int i=0; i<n; i++){
        int mi = 0, sum = 0;
        for(auto j:s[i]){
            if(j == '(') sum++;
            else sum--;
            chmin(mi, sum);
        }
        
        if(0 <= sum){
            l.emplace_back(mi, sum);
        }
        else{
            reverse(all(s[i]));
            mi = 0, sum = 0;
            for(auto j:s[i]){
                if(j == ')') sum++;
                else sum--;
                chmin(mi, sum);
            }
            r.emplace_back(mi, sum);
        }
    }

    sort(all(l), greater<P>());
    sort(all(r), greater<P>());

    int curl = 0;
    bool valid = true;
    for(auto i:l){
        int mi, sum;
        tie(mi, sum) = i;

        if(curl + mi < 0) valid = false;
        curl += sum;
    }

    int curr = 0;
    for(auto i:r){
        int mi, sum;
        tie(mi, sum) = i;
        
        if(curr + mi < 0) valid = false;
        curr += sum;
    }

    if(curl != curr) valid = false;

    cout << (valid ? "Yes" : "No") << endl;

    return 0;
}

Measured memory_bytes: 42468
#include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
#include<algorithm>
#include<queue>
#include<set>
#include<ctime>
#include<vector>
#include<stack>
#include<map>
using namespace std;
typedef long long ll;

int main(){
    ll a, b, c, k;
    cin >> a >> b >> c >> k;
    if(k%2) cout << b-a;
    else cout << a-b;
}


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

#define INF 1010101010

using namespace std;
int dp[41][401][401];
int main()
{
	int n, ma, mb;
	cin >> n >> ma >> mb;
	vector<int> a(n), b(n), c(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i] >> b[i] >> c[i];
	}

	
	for (int i = 0; i < 41; i++) {
		for (int j = 0; j < 401; j++) {
			for (int k = 0; k < 401; k++) {
				dp[i][j][k] = INF;
			}
		}
	}
	dp[0][0][0] = 0;
	
	for (int i = 1; i <= n; i++) {
		for (int j = 0; j <= 400; j++) {
			for (int k = 0; k <= 400; k++) {
				if (j - a[i - 1] >= 0 && k - b[i - 1] >= 0) {
					dp[i][j][k] = min(dp[i - 1][j][k], dp[i - 1][j - a[i - 1]][k - b[i - 1]] + c[i - 1]);
				}
				else {
					dp[i][j][k] = dp[i - 1][j][k];
				}
			}
		}
	}

	int mn = INF;
	int s = ma, t = mb;
	while (s <= 400 && t <= 400) {
		mn = min(mn, dp[n][s][t]);
		s += ma;
		t += mb;
	}
	cout << (mn == INF ? -1 : mn) << endl;

	return 0;
}

Measured memory_bytes: 29348
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1000000000000;

ll N;
vector<ll> h;
vector<ll> dp;

void solve() {
  dp.resize(N);
  dp[0] = 0;
  dp[1] = abs(h[1] - h[0]);
  for (int i = 2; i < N; i++) {
    ll tmp1 = dp[i - 1] + abs(h[i - 1] - h[i]);
    ll tmp2 = dp[i - 2] + abs(h[i - 2] - h[i]);
    dp[i] = min(tmp1, tmp2);
  }
  cout << dp[N - 1] << "\n";
}

int main() {
  cin >> N;
  h.resize(N);
  for (int i = 0; i < N; i++) {
    cin >> h[i];
  }
  solve();
  return 0;
}

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

int main()
{
	int i = 0;
	long long N,M;
	cin >> N >> M;
	if(N % 2 == 1)
	{
		cout << 1 << ' ' << 2 << endl;
		while(i < M-1)
		{
			cout << 3+i << ' ' << N-i << endl;
			i++;
		}
	}
	i = 0;
	int count = 0;
	if(N % 2 == 0)
	{
		while(1+i < (N/2-i))
		{
			cout << 1 + i << ' ' << N/2 - i << endl;
			i++;
			count++;
			if(count == M) break;
		}
		i =0;
		if(count != M)
		{
		while(N/2+2+i < N-i)
		{
			cout << N/2+2+i << ' ' << N-i << endl;
			i++;
			count++;
			if(count == M) break;
		}
		}
	}
	return 0;
}

Measured memory_bytes: 3596
#include<bits/stdc++.h>
#define inf 0x3f3f3f3f
#define N 20005
#define M 4000005
using namespace std;
int head[N],nxt[M],ver[M],tot,f[M];
void add(int a,int b,int c)
{
    tot++;nxt[tot]=head[a];head[a]=tot;ver[tot]=b;f[tot]=c;
    tot++;nxt[tot]=head[b];head[b]=tot;ver[tot]=a;f[tot]=0;
}
int S,T;
int ch[N];
int zeng(int a,int b)
{
    if(a==T)return b;
    int r=0;
    for(int i=head[a];i&&b>r;i=nxt[i])
    {
        if(ch[ver[i]]==ch[a]+1&&f[i])
        {
            int t=zeng(ver[i],min(b-r,f[i]));
            r+=t;f[i]-=t;f[i^1]+=t;
        }
    }
    if(!r)ch[a]=-1;
    return r;
}
bool tell()
{
    memset(ch,-1,sizeof(ch));
    ch[S]=0;
    queue<int>q;
    q.push(S);
    while(!q.empty())
    {

        int tmp=q.front();q.pop();
        //cout<<tmp<<endl;
        for(int i=head[tmp];i;i=nxt[i])
        {
            if(f[i]&&ch[ver[i]]==-1)
            {
                ch[ver[i]]=ch[tmp]+1;
                q.push(ver[i]);
            }
        }
    }
    return ch[T]!=-1;
}
int dinic()
{
    int r=0,t;
    while(tell())while(t=zeng(S,inf))r+=t;
    return r;
}
int h,w,sm;
char s[105][105];
int Q(int x,int y)
{
    return (x-1)*w+y;
}
int main()
{
    tot=1;scanf("%d%d",&h,&w);sm=h*w;
    for(int i=1;i<=h;i++)scanf("%s",s[i]+1);
    for(int i=1;i<=h;i++)
    {
        for(int j=1;j<=w;j++)
        {
            if(s[i][j]=='.')continue;
            if(s[i][j]=='S')S=Q(i,j);
            if(s[i][j]=='T')T=Q(i,j)+sm;
            for(int l=1;l<=h;l++)
            {
                if(l==i)continue;
                add(Q(i,j)+sm,Q(l,j),inf);
            }
            for(int l=1;l<=w;l++)
            {
                if(l==j)continue;
                add(Q(i,j)+sm,Q(i,l),inf);
            }
        }
    }
    for(int i=1;i<=sm;i++)
    {
        if(i==S||i+sm==T)add(i,i+sm,inf);
        else add(i,i+sm,1);
    }
    int ans=dinic();
    if(ans>=inf)puts("-1");
    else printf("%d\n",ans);
    return 0;
}


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

using namespace std;

#define SZ(x) (int)(x.size())
#define REP(i, n) for(int i=0;i<(n);++i)
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define RREP(i, n) for(int i=(int)(n);i>=0;--i)
#define RFOR(i, a, b) for(int i=(int)(a);i>=(int)(b);--i)
#define ALL(a) (a).begin(),(a).end()
#define DUMP(x) cerr<<#x<<" = "<<(x)<<endl
#define DEBUG(x) cerr<<#x<<" = "<<(x)<<" (L"<<__LINE__<<")"<< endl;

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using P = pair<int, int>;

const double eps = 1e-8;
const ll MOD = 1000000007;
const int INF = INT_MAX / 2;
const ll LINF = LLONG_MAX / 2;

template <typename T1, typename T2>
bool chmax(T1 &a, const T2 &b) {
  if(a < b) {a = b; return true;}
  return false;
}

template <typename T1, typename T2>
bool chmin(T1 &a, const T2 &b) {
  if(a > b) {a = b; return true;}
  return false;
}

template<typename T1, typename T2>
ostream& operator<<(ostream &os, const pair<T1, T2> p) {
  os << p.first << ":" << p.second;
  return os;
}

template<class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  REP(i, SZ(v)) {
    if(i) os << " ";
    os << v[i];
  }
  return os;
}

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

  ll a, v, b, w, t; cin >> a >> v >> b >> w >> t;

  if(w >= v) {
    cout << "NO" << endl;
  } else if(abs(v - w) * t >= abs(a - b)) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }

}
























Measured memory_bytes: 3652
let () =
    let main () =
        let n, l = Scanf.sscanf (read_line ()) "%d %d" (fun n l -> n, l) in
        let min_taste = l in
        let max_taste = l + n - 1 in
        let s =
            if min_taste > 0 then (n + 2 * l) * (n - 1) / 2 else
            if max_taste < 0 then (n + 2 * l - 2) * (n - 1) / 2 else
                                  n * (2 * l - 1 + n) / 2
        in
        Printf.printf "%d\n" s
    in
    main ()

Measured memory_bytes: 384
#include "bits/stdc++.h"
using namespace std;

int main() {
	string S;
	string D[4] = { "maerd", "remaerd", "esare", "resare" };
	bool check = true;
	cin >> S;
	reverse(S.begin(), S.end());
	while (S != "") {
		bool check2 = false;
		for (int i = 0; i < 4; i++) {
			if (S.substr(0, D[i].size()) == D[i]) {
				check2 = true;
				S.erase(0, D[i].size());
			}
		}
		if (!check2) {
			check = false;
			break;
		}
	}
	if (check) cout << "YES";
	else cout << "NO";
}

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

#ifdef ONLINE_JUDGE
#define freopen \
  if (0) freopen
#define cerr \
  if (0) cerr
#endif

#define fi first
#define se second

#define pb push_back
#define pp pop_back
#define mp make_pair

#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)

#define sqr(a) ((a)*1ll * (a))
#define sz(a) (int)a.size()
#define len(a) (int)a.length()
#define all(a) a.begin(), a.end()
#define nl '\n'

using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef pair<int, int> pi;

const int inf = (int)1e9 + 7;
const int mod = (int)1e9 + 7;
const ll linf = (ll)1e18 + 7;

ll n, s;

ll sum(ll b) {
  ll k = n;
  ll ans = 0;
  while (k > 0) {
    ans += k % b;
    k /= b;
  }
  return ans;
}

void solve() {
  cin >> n >> s;

  for (ll b = 2; b <= sqrt(n); b++) {
    if (sum(b) == s) {
      cout << b;
      return;
    }
  }

  ll ans = -1;
  for (ll p = 1; p <= sqrt(n - s); p++) {
    if ((n - s) % p != 0) continue;
    ll b = (n - s) / p + 1;
    if (b > 1 && sum(b) == s) {
      ans = ans == -1 ? b : min(ans, b);
    }
  }
  if (ans != -1) {
    cout << ans;
    return;
  }

  if (sum(n + 1) == s) {
    cout << n + 1;
    return;
  }

  cout << -1;
}

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

  freopen(".in", "r", stdin);

  solve();

  return 0;
}


Measured memory_bytes: 3704
/* SANDEEP YADAv*/
#include<bits/stdc++.h>
using namespace std;
#define lld long long int
#define pb push_back
#define mkp make_pair
#define fi first
#define se second
#define mod 1000000007
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
lld gcd(lld a,lld b){ if(a<b) { a=a+b; b=a-b; a=a-b;}while(b!=0){lld r=a%b; a=b; b=r;} return a;}
long long power(long long a, long long b, long long m) {a %= m;long long res = 1;while (b > 0) {if (b & 1)res = res * a % m;a = a * a % m;b >>= 1;}return res;}
void judge()
{
      #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    freopen("error.txt","w",stderr);
    #endif
}

int main()
{
    fastio;
  //  judge();
    
    long double a;
    long double b;
    cin>>a>>b;
    
    long double x=a*b;
    cout<<(lld)x;
    return 0;
}

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

int main(){
    int k, s, ans = 0;
    cin >> k >> s;

    rep(x,k+1)
        rep(y,k+1){
            int z = s - x - y;
            if(0 <= z && z <= k)  ans++;
        }

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

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N,count=0;
  cin >> N;
  map<string,int> S;
  for(int i=0;i<N;i++){
    string A;
    cin >> A;
    if(!S.count(A)){
      S[A]=1;
      count++;
    }
  }
  cout << count << endl;
}
  
  

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

typedef long long ll;
const ll MOD = 1e9+7;

bool ok(int x){
    int c=0;
    while(x){
        c++;
        x/=10;
    }
    return c%2==1;
}

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int n;
    cin>>n;

    int ans=0;

    for(int i=1;i<=n;i++){
        ans+=ok(i);
    }

    cout<<ans;

    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <set>
#include <utility>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <deque>
#include <unordered_map>
#include <map>
#include <bitset>
#include <string>
#include <cstring>

#define pb push_back
#define mp make_pair
#define l(x) x << 1
#define r(x) x << 1 | 1
#define scan(x) do {while((x=getchar())<'0') ; for(x-='0'; '0'<=(_=getchar()); x=(x<<3)+(x<<1)+_-'0') ; } while(0)
char _;
#define x first
#define y second

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<float, float> pff;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef map<int, int> mii;
typedef unordered_map<int, int> umii;

string s;
set<char> ss;
    
int main() {
    cin >> s;
    for (int i = 0; i < s.length(); i++) {
        ss.insert(s[i]);
    }
    for (char i = 0; i < 26; i++) {
        if (ss.find('a' + i) == ss.end()) {
            cout << (char)('a' + i) << endl;
            return 0;
        }
    }
    cout << "None" << endl;
}


Measured memory_bytes: 512
package main

import (
	"fmt"
	"io"
	"os"
	"sort"
)

func main() {
	B(os.Stdin, os.Stdout)
}

func B(stdin io.Reader, stdout io.Writer) {
	var n int
	var l int
	var s []string

	fmt.Fscan(stdin, &n, &l)

	s = make([]string, n)

	for i := 0; i < n; i++ {
		fmt.Fscan(stdin, &s[i])
	}

	sort.Strings(s)

	for _, x := range s {
		fmt.Fprintf(stdout, x)
	}

	fmt.Fprintf(stdout, "\n")

}


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

int main(){
    int a, b, c;
    cin >> a >> b >> c;

    if (a + b + c > 21) {
        cout << "bust" << endl;
    } else {
        cout << "win" << endl;
    }
    return 0;
}


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

int main()
{
  i64 a1, a2, a3;
  cin >> a1 >> a2 >> a3;
  if (22 <= a1 + a2 + a3)
    cout << "bust" << endl;
  else
    cout << "win" << endl;
  return 0;
}


Measured memory_bytes: 256