akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
#include <array>
#include <vector>
#include <deque>
#include <list>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <queue>
#include <bitset>
#include <tuple>
#include <cmath>
#include <complex>
#include <algorithm>
#include <utility>
#include <regex>
#include <cstdint>
#include <numeric>
#include <functional>
#include <cassert>

using namespace std;
using ll = int64_t;
using ull = uint64_t;

constexpr ll INF = 1000000000;/* 1e+9a */

void solve(istream &cin) {
    string s;
    cin >> s;
    if(!cin) return;
    ll x, y;
    cin >> x >> y;
    x += 8000; y += 8000;
    vector<bool> v_x(16001, false), v_y(16001, false);
    v_y[8000] = true;
    int k = 0;
    ll move = 0;
    while(k < s.size() and s[k] == 'F') { move++, k++; }
    bool to_x = true;
    v_x[move + 8000] = true;
    while(k < s.size() and s[k] == 'T'){ to_x = !to_x; k++; }

    while(k < s.size()){
        move = 0;
        while(k < s.size() and s[k] == 'F') { move++, k++; }
        if(move != 0) {
            if (to_x) {
                vector<bool> n(16001, false);
                for (int i = 0; i < v_x.size(); ++i) {
                    if (v_x[i]) {
                        if (i + move < v_x.size()) n[i + move] = true;
                        else{ throw;}
                        if (i - move >= 0) n[i - move] = true;
                        else {throw;}
                    }
                } // end i
                v_x = n;
            } else {
                vector<bool> n(16001, false);
                for (int i = 0; i < v_y.size(); ++i) {
                    if (v_y[i]) {
                        if (i + move < v_y.size()) n[i + move] = true;
                        else {throw;}
                        if (i - move >= 0) n[i - move] = true;
                        else {throw;}
                    }
                } // end i
                v_y = n;
            }
        }
        while(k < s.size() and s[k] == 'T'){ to_x = !to_x; k++; }
    }

    cout << (v_x[x] and v_y[y] ? "Yes" : "No") << endl;

}

int main(int argc, char *argv[]) {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << setprecision(16) << scientific;
#ifdef DEBUG
    cerr << "DEBUG MODE" << endl;
    string test_cases = "test.txt";
    auto fs = fstream(test_cases, fstream::in);
    while(fs) {
        solve(fs);
    }
#else
    solve(cin);
#endif
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define MAX ((ll)(1e15))
#define pi (2*acos(0))
#define mp make_pair
#define M ((int)(998244353))
#define xx first
#define yy second
#define NN ((int)(305))
#define N ((int)(1e5 + 5))
#define pq priority_queue
///#define Q queue
#define eps 0
#define log 20
#define pb push_back
#define MOD 998244353


using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef unsigned long long lu;


typedef tree < pair < int,int >,  null_type,  less < pair < int,int > >,  rb_tree_tag,  tree_order_statistics_node_update > o_set;

int a[200];

int main()
{
    int n;
    scanf("%d",&n);
    for(int i = 0; i<n; i++) scanf("%d",&a[i]);
    sort(a,a+n);
    int sum = 0;
    for(int i = 0; i<n-1; i++) sum += a[i];
    if(sum>a[n-1]) printf("Yes\n");
    else printf("No\n");
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <climits>
using namespace std;
int main(void){
    
    int N, X;
    cin >> N >> X;
    
    int min_gram = INT_MAX;
    for(int i = 0; i < N; i++){
        int m;
        cin >> m;
        min_gram = min(min_gram, m);
        X -= m;
    }
    
    int ans = N + (X / min_gram);
    
    cout << ans << endl;

}


Measured memory_bytes: 3152
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, n) for (int i = (int)(n); i >= 0; i--)
#define REP(i, m, n) for (int i = (int)(m); i <= (int)(n); i++)
#define all(v) v.begin(), v.end()
typedef long long ll;

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

const long long INF = 1LL << 60;

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

  if(m - 2*n < 0){
    cout << m/2 << endl;
  }
  else{
    cout << n + (m - 2*n)/4 << endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

int main()
{
    int n; cin>>n;
    map<string, ll> mp;
    for(int i=0; i<n; i++){
        string s; cin>>s;
        sort(s.begin(), s.end());
        mp[s]++;
    }
    ll ans=0;
    for(auto p:mp){
        ans+=p.second*(p.second-1)/2;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 11136
#include <bits/stdc++.h>
using namespace std;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ll long long
#define ld long double
#define all(a) (a).begin(),(a).end()
#define mk make_pair
ll MOD=1000000007;
int inf=1000001000;
ll INF=100000000000000000;

int main() {
    vector<pair<double,pair<int,int>>> a(0);
    for (int i=1;i<152;i++){
        for (int j=i+1;j<152;j++){
            double e=sqrt(i*i+j*j);
            a.push_back(mk(e,mk(i,j)));
        }
    }
    sort(all(a));
    while(true){
        int f,g;
        cin >> f >> g;
        if (f==0) break;
        for (int i=0;i<40000;i++){
            if (a[i].second.first==f && a[i].second.second==g){
                cout << a[i+1].second.first << " " << a[i+1].second.second << endl;
                break;
            }
        }
    }
}



Measured memory_bytes: 3216
#include<bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int) n; i++)
using ll = long long;
template <class T>
using vt = std::vector<T>;
using vvi = std::vector<vt<int>>;

int main(){
  int n;
  std::cin >> n;
  vt<int> a(n);
  rep(i,n)
    std::cin >> a[i];

  ll cnt = 0;
  rep(i,n) {
    while (a[i]%2 == 0) {
      ++cnt;
      a[i]/=2;
    }
  }

  std::cout << cnt << '\n';
  return 0;
}


Measured memory_bytes: 256
import math
#import numpy as np
import queue
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)

def main():
    d = int(ipt())
    c = [int(i) for i in ipt().split()]
    s = [[int(i) for i in ipt().split()] for _ in range(d)]
    ld = [-1]*26
    edval = [0]*26

    for i in range(d):
        edval = s[i]*1
        for j in range(26):
            edval[j] += c[j]*(i-ld[j])
        v = edval.index(max(edval))
        ld[v] = i
        print(v+1)

    return

if __name__ == '__main__':
    main()


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

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

	std::string ans;
	ans.reserve(200);

	int count = 0;
	for (int i = 0; i < n; ++i) {
		char c;
		std::cin >> c;
		ans += c;

		count += (c == '(' ? 1 : -1);

		if (count < 0) {
			ans.insert(ans.begin(), '(');
			count = 0;
		}
	}
	ans += std::string(count, ')');

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
        using namespace std;
         
        int main() {
          int a,b;
          cin >> a;
          cin >> b;
          
          int x;
          x = (a+b)/2;
          if((a+b) % 2 == 1)
            x += 1;
          cout << x << endl;
        }

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

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

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

using ll=long long;
using R=long double;
const R EPS=1e-9L; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r){return(r > EPS)-(r < -EPS);}
inline R sq(R x){return sqrt(max(x,0.0L));}

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

// Problem Specific Parameter:

int n,k;
ll a[100010];

int main(void){
	cin >> n >> k;
	rep(i,n) cin >> a[i];

	ll best=0LL;
	rep(i,k,n) if(a[i]>0) best+=a[i];

	ll cur=0LL;
	rep(i,k) cur+=a[i];

	ll ans=0LL;

	rep(s,n-k+1){
		chmax(ans,cur+best);
		chmax(ans,best);
		cur-=a[s];
		cur+=a[s+k];
		if(a[s]>0) best+=a[s];
		if(a[s+k]>0) best-=a[s+k];
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 1024
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;

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

const long double pi = 3.141592653589793;

#define debug(x) cout << #x << " = " << (x) << endl;
#define rep(i, n) for(int i = 0;i < n;i++)
#define pb push_back
#define mp make_pair
#define mod 1000000007

int main() {
	ios::sync_with_stdio(false);
    //freopen("input.in","r",stdin);
 	//freopen("output.out","w",stdout);
	int n, p, x;cin>>n>>p;
	int o = 0, e = 0;
	rep(i, n) {
		cin>>x;
		if(x%2 == 0) e++;
		else o++;
	}

	if(p == 0) {
		if(o == 0)
			cout<<(1LL<<(n))<<endl;
		else
			cout<<(1LL<<(n-1))<<endl;

		return 0;
	}

	ll ans = (1LL<<(n-1));
	if(o == 0) ans = 0;

	cout<<ans<<endl;

	return 0;
}


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

typedef long long readtype;
typedef long long var;
typedef long double let;

readtype read() {
  readtype a = 0, c = getchar(), s = 0;
  while (!isdigit(c)) s |= c == '-', c = getchar();
  while (isdigit(c)) a = a * 10 + c - 48, c = getchar();
  return s ? -a : a;
}
/* }}} */

const int N = 304;
const int MOD = 1e9 + 7;

int a[N << 1];
bool v[N << 1], mark[N << 1];
int f[N << 1][N][N];

int main() {
  int n = read() * 2;
  for (int i = 1; i <= n; ++i) a[i] = read();
  for (int i = 1; i <= n; ++i) {
    if (a[i] != -1) v[a[i]] = true;
  }

  int have = 0;
  for (int i = 1; i <= n; i += 2) {
    if (a[i] == -1 && a[i + 1] == -1) ++have;
    if (a[i] != -1 && a[i + 1] != -1)
      mark[a[i]] = mark[a[i + 1]] = true;
  }

  f[n + 1][0][0] = 1;
  for (int i = n; i >= 1; --i) {
    if (mark[i]) {
      for (int j = 0; j <= n; ++j)
        for (int k = 0; k <= n; ++k) f[i][j][k] = f[i + 1][j][k];
      continue;
    }

    for (int j = 0; j <= n / 2; ++j) {
      for (int k = 0; k <= n / 2; ++k) {
        if (!f[i + 1][j][k]) continue;
        if (v[i]) {
          if (j) (f[i][j - 1][k] += f[i + 1][j][k]) %= MOD;
          (f[i][j][k + 1] += f[i + 1][j][k]) %= MOD;
        } else {
          if (j) (f[i][j - 1][k] += f[i + 1][j][k]) %= MOD;
          if (k) (f[i][j][k - 1] += (1ll * k * f[i + 1][j][k]) % MOD) %= MOD;
          (f[i][j + 1][k] += f[i + 1][j][k]) %= MOD;
        }
      }
    }
  }

  var res = f[1][0][0];
  for (int i = 1; i <= have; ++i) (res *= i) %= MOD;
  printf("%lld\n", res);
  return 0;
}


Measured memory_bytes: 219008
#include <bits/stdc++.h>
#define INF (1<<30)
#define MOD 1000000007
#define l_ength size
using ll = long long;
using namespace std;

int main(){
	int n, h, w; cin >> n >> h >> w;
	int cnt = 0;
	while( n-- ){
		int x, y; cin >> x >> y;
		if( x >= h && y >= w ) cnt++;
	}
	cout << cnt << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h> 
using namespace std;
typedef long long ll;
template<typename T1,typename T2> bool chmin(T1 &a,T2 b){if(a<=b)return 0; a=b; return 1;}
template<typename T1,typename T2> bool chmax(T1 &a,T2 b){if(a>=b)return 0; a=b; return 1;}

template < typename Monoid >
struct Segtree{
    using FM = function < Monoid(Monoid, Monoid) >;
    using FA = function < void(Monoid&, Monoid) >;
    int N;
    vector<Monoid> dat;
    
    const FM fm;
    const FA fa;
    const Monoid M1;

    Segtree(int n,const FM fm, const FA fa, const Monoid &M1): fm(fm), fa(fa), M1(M1){
        N = 1;
        while(N < n) N *= 2;
        dat.assign(2*N,M1);
    }

    void set(int idx, const Monoid &x){
        dat[idx+N-1] = x;
    }

    void build(){
        for(int i=N-2; i>=0; i--){
            dat[i] = fm(dat[2*i+1], dat[2*i+2]);
        }
    }

    void update(int idx, const Monoid &x){
        idx += N-1;
        fa(dat[idx],x);
        while(idx > 0){
            idx = (idx-1)/2;
            dat[idx] = fm(dat[idx*2 + 1], dat[idx*2+2]);
        }
    }

    Monoid get(int a, int b, int k, int l, int r){
        if(r<=a || b<=l) return M1;
        if(a<=l && r<=b) return dat[k];
        else{
            Monoid vl = get(a,b,k*2+1,l,(l+r)/2);
            Monoid vr = get(a,b,k*2+2,(l+r)/2,r);
            return fm(vl,vr);
        }
    }
    Monoid get(int a,int b){ return get(a,b,0,0,N); }

    Monoid at(int k) {return dat[k+N-1];}

    void debug(){
        for(int i=N-1;i<dat.size();i++){
            cerr << dat[i] << ", ";
        }
        cerr << "\n";
    }
};

// RMQ
// auto fm = [](ll a,ll b){ return min(a,b); };
// auto fa = [](ll& a, ll b){ a=b; };
// Segtree<ll> seg(n, fm, fa, INF);

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

    ll n,q;
    cin>>n>>q;
    auto fm = [](ll a,ll b){ return a+b; };
    auto fa = [](ll& a, ll b){ a+=b; };
    Segtree<ll> seg(n, fm, fa, 0);

    while(q--){
        int c;
        cin>>c;
        if(c == 0){
            ll i,a;
            cin>>i>>a;
            seg.update(--i,a);
        }
        else{
            int l,r; cin>>l>>r;
            cout << seg.get(l-1,r) << "\n";
        }
    }
    

}


Measured memory_bytes: 4868
#include <iostream>
//#include <iomanip>
//#include <string>
#include <vector>
//#include <algorithm>
//#include <utility>
//#include <set>
//#include <map>
//#include <queue>
//#include <deque>
//#include <bitset>
//#include <math.h>
using namespace std ;
using ll = long long ;
//using ld = long double ;
using vll = vector<ll> ;
//using vvll = vector<vll> ;
//using vc = vector<char> ;
//using vvc = vector<vc> ;
//using vb = vector<bool> ;
//using vvb = vector<vb> ;
//using pll = pair<ll,ll> ;
//#define all(v) v.begin(),v.end()
//ll mod = 1e9+7 ;
//long double pie = acos(-1) ;
//ll INF = 1000000000000 ;

//void yorn(bool a){if(a) cout << "Yes" << endl ; else cout << "No" << endl ;}
//void YorN(bool a){if(a) cout << "YES" << endl ; else cout << "NO" << endl ;}
//ll gcd(long long a,long long b){if(b==0) return a ; return gcd(b,a%b) ;}
//ll lcm(long long a,long long b){return a/gcd(a,b)*b ;}
//ll sa(long long a,long long b){if(a>b) return a-b ; return b-a ;}
//void fix_cout(){cout << fixed << setprecision(20) ;}

int main(){
	ll m,k ;
	cin >> m >> k ;
	if((1<<m)-1<k){
		cout << -1 << endl ;
		return 0 ;
	}
	if(k==0){
		for(int i=0;i<(1<<m);i++) cout << i << " " << i << (i+1==(1<<m)?"\n":" ") ;
		return 0 ;
	}
	vll ans(1<<(m+1),0) ;
	ans.at(0) = k ;
	for(int i=1;i<(1<<m);i++){
		ans.at(i) = i-1+(i-1>=k) ;
	}
	ans.at(1<<m) = k ;
	for(int i=0;i<(1<<m)-1;i++){
		ans.at((1<<(m+1))-1-i) = i+(i>=k) ;
	}
	ll sum = 0 ;
	for(int i=1;i<(1<<m);i++) sum ^= ans.at(i) ;
	if(sum==k) for(int i=0;i<(1<<(m+1));i++) cout << ans.at(i) << (i+1==(1<<(m+1))?"\n":" ") ;
	else cout << -1 << endl ;
//	for(auto i:ans) cout << i << " " ; cout << endl ;
}


Measured memory_bytes: 5288
import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long A = Long.parseLong(sc.next());
        long B = Long.parseLong(sc.next());
        long C = Long.parseLong(sc.next());
        long D = Long.parseLong(sc.next());
        long bcac;
        long bdac;
        long bacd;
        if(A % C == 0) {
            bcac = B/C - A/C + 1;
        }else {
            bcac = B/C - A/C;
        }
        if(A % D == 0) {
            bdac = B/D - A/D + 1;
        }else {
            bdac = B/D - A/D;
        }
        if(A % (C*D/saiyaku(C,D)) == 0) {
            bacd = B/(C*D/saiyaku(C,D)) - A/(C*D/saiyaku(C,D)) + 1;
        }else {
            bacd = B/(C*D/saiyaku(C,D)) - A/(C*D/saiyaku(C,D));
        }
        long count = bcac + bdac - bacd;
        System.out.println(B-A-count+1);

    }
    
    public static long max(long x, long y) {
        if(x <= y) {
            return y;
        }else {
            return x;
        }
    }
    
    public static long saiyaku(long x, long y) {
        long w = 0;
        if(x < y) {
            w = x;
            x = y;
            y = w;
            return saiyaku(x, y);
        }
        w = y;
        y = x % y;
        x = w;
        if(y == 0) {
            return x;
        }else {
            
            return saiyaku(x, y);
        }
    }
    
    
}

Measured memory_bytes: 23124
fn read<T: std::str::FromStr>() -> T {
  let mut s = String::new();
  std::io::stdin().read_line(&mut s).ok();
  s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
  let mut s = String::new();
  std::io::stdin().read_line(&mut s).ok();
  s.trim().split_whitespace()
    .map(|e| e.parse().ok().unwrap()).collect()
}
 
fn main() {
  let _: String = read();
  let vs: Vec<i32> = read_vec();
  let cs: Vec<i32> = read_vec();

  let ans: i32 = vs.iter().zip(cs.iter())
    .map(|(x, y)| x - y)
    .fold(0, |a, c| if c > 0 { a + c } else { a });
  
  println!("{}", ans);
}


Measured memory_bytes: 4352
#include<cstdio>
#include<vector>
#define l(x) id[x]
#define r(x) id[x]+sz[x]-1
std::vector<int> a[2000005];
int n,q,cnt,fa[2000005],id[2000005],sz[2000005];
long long ans[2000005],s[2000005];
void add(int x,int y){a[x].push_back(y);a[y].push_back(x);}
void dfs(int v)
{
	id[v]=++cnt;sz[v]=1;
	for (int i=0;i<a[v].size();i++)
	{
	    int u=a[v][i];
	    if (u==fa[v]) continue;
	    fa[u]=v;
	    dfs(u);
	    sz[v]=sz[v]+sz[u];
	}
}
void tag(int x,long long v){s[l(x)]=s[l(x)]+v;s[r(x)+1]=s[r(x)+1]-v;}
int main()
{
	scanf("%d%d",&n,&q);
	for (int i=1;i<n;i++)
	{
		int x,y;
		scanf("%d%d",&x,&y);
		add(x,y);
	}
	dfs(1);
	while (q--)
	{
		int x;long long v;
		scanf("%d%lld",&x,&v);
		tag(x,v);
	}
	for (int i=1;i<=n;i++) ans[i]=ans[i-1]+s[i];
	for (int i=1;i<=n;i++) printf("%d ",ans[id[i]]);
	return 0;
}

Measured memory_bytes: 80000
#include<stdio.h>
int main()
{
	unsigned long long a, b, n,x;
	scanf("%lld%lld%lld", &a, &b, &n);
	if (n < b - 1) printf("%lld", (a*n)/b-a * (n / b));
	else
	{
		x = b - 1;
		printf("%lld", (a * x) / b - a * (x / b));
	}
	return 0;
}

Measured memory_bytes: 1732
#include<bits/stdc++.h>
using namespace std;
int main() {
	int a, b, k, c = 0;
	cin >> a >> b >> k;
	for (int i = a; i <= b; i++) {
		c++;
		if (c <= k || c >= b - a + 2 - k)
			cout << i << endl;
	}
}

Measured memory_bytes: 256
#include<set>
#include<iostream>
using namespace std;
int main(){
int i=2,N,h,m;set<pair<int, int>> t;
while(i--&&cin>>N)while(N--&&cin>>h>>m)t.insert(make_pair(h,m));
for(auto i=t.begin();i!=t.end();)printf("%d:%02d",i->first,i->second),cout<<(++i!=t.end()?" ":"");
cout<<endl;
}

Measured memory_bytes: 1228
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
using namespace std;
char s[100];
int a[110];
int main() {
	scanf("%s",s);
	int len=strlen(s);
	for(int i=0;i<len;i++) a[i]=s[i]-'0';
	int x=a[0]*100+a[1]*10+a[2];
	int ans=abs(x-753);
	for(int i=3;i<len;i++) {
		x*=10;
		x-=a[i-3]*1000;
		x+=a[i];
		ans=min(ans,abs(x-753));
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
#include<stdio.h>
#include<string>
#include<numeric>
using namespace std;
#define pb push_back
#define pf push_front

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
#define mp make_pair
#define fi first
#define se second
typedef pair<int,int> pint;
#define All(s) s.begin(),s.end()
#define rAll(s) s.rbegin(),s.rend()
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
#define sz(x) int(x.size())
#define INF 1e5
#define MOD 1000000007
int main(){
	int n;
	cin>>n;
	vi a(n),b(n);

	rep(i,n){
		cin>>a[i];
		b[a[i]-1]=i+1;
	}
	rep(i,n) cout<<b[i]<<endl;
}


Measured memory_bytes: 1536
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const ll MOD = 998244353LL;
vector<int> gcd(vector<int> A, vector<int> B) {
	if (B[0] == 0) {
		return A;
	}
	int N = A.size(), M = B.size();
	for (int i = 0; i <= N - M; i++) {
		if (A[i] == 1) {
			for (int j = 0; j < M; j++) {
				A[i + j] ^= B[j];
			}
		}
	}
	vector<int> R;
	bool zero = 1;
	for (int i = 0; i < N; i++) {
		if (A[i]) zero = 0;
		if (!zero) R.push_back(A[i]);
	}
	if (zero) R.push_back(0);
	return gcd(B, R);
}
int main() {
	int N;
	cin >> N;
	string X;
	cin >> X;
	vector<int> x;
	for (int i = 0; i < X.size(); i++) x.push_back(X[i] - '0');
	vector<int> g(1, 0);
	for (int i = 0; i < N; i++) {
		string A;
		cin >> A;
		vector<int> a;
		for (int i = 0; i < A.size(); i++) a.push_back(A[i] - '0');
		g = gcd(g, a);
	}
	if (g.size() > x.size()) {
		cout << 0 << endl;
		return 0;
	}
	ll ans = 0;
	for (int i = 0; i <= x.size() - g.size(); i++) {
		(ans *= 2) %= MOD;
		(ans += x[i]) %= MOD;
	}
	vector<int> y(x.size(), 0);
	for (int i = 0; i <= x.size() - g.size(); i++) {
		if (y[i] != x[i]) {
			for (int j = 0; j < g.size(); j++) y[i + j] ^= g[j];
		}
	}
	bool ok = 1;
	for (int i = x.size() - g.size() + 1; i < x.size(); i++) {
		if (y[i] < x[i]) break;
		if (y[i] > x[i]) {
			ok = 0;
			break;
		}
	}
	if (ok) (ans += 1) %= MOD;
	cout << ans << endl;
}

Measured memory_bytes: 53632
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		var l = new List<char>();
		l.Add(S[0]);
		for(int i=1;i<N;i++){
			if(l[l.Count -1] != S[i]) l.Add(S[i]);
		}
		Console.WriteLine(l.Count);
	}
	int N;
	String S;
	public Sol(){
		N = ri();
		S = rs();
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}


Measured memory_bytes: 11872
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(i,n) for (int i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define MOD 1000000007
int main(){
    int a;
    string s;
    cin>>s;
    if(s.compare("SUN")==0) a=0;
    else if(s.compare("MON")==0) a=1;
    else if(s.compare("TUE")==0) a=2;
    else if(s.compare("WED")==0) a=3;
    else if(s.compare("THU")==0) a=4;
    else if(s.compare("FRI")==0) a=5;
    else if(s.compare("SAT")==0) a=6;
    cout<<7-a<<endl;
}

Measured memory_bytes: 256
using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            string p = Console.ReadLine();

            string Circle = s+s;

            if (Circle.Contains(p))
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }
        }
    }
}
  

Measured memory_bytes: 9788
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ll long long 
#define REP(i, a, b) for (ll i = a; i < b; i++)
#define REPI(i, a, b) for (ll i = b - 1; i >= a; i--)
#define i_os ios::sync_with_stdio(0);  cin.tie(0);  cout.tie(0);
#define INF (ll)1e18 + 100
#define endl "\n"
#define p0(a) cout << a << " "
#define p1(a) cout << a << endl
#define p2(a, b) cout << a << " " << b << endl
#define p3(a, b, c) cout << a << " " << b << " " << c << endl
#define p4(a, b, c, d) cout << a << " " << b << " " << c << " " << d << endl
#define MAX 1e6
/*SOME BITMASK KNOWLEDGE
1)x & (x - 1):sets the last one bit of x to zero
power of two exactly when x & (x − 1) = 0.
2)x & -x:sets all the one bits to zero, except last one bit
3)x | (x - 1):inverts all the bits after the last one bit*/
#define o_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
#define o_setll tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update>
typedef tree<pair<ll, ll>,null_type,less<pair<ll, ll>>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;
//1. order_of_key(k) : number of elements strictly lesser than k
//2. find_by_order(k) : k-th element in the set

int main() 
{
	ll s,w;
	cin>>s>>w;
	if(w >= s) cout<<"unsafe"<<endl;
	else cout<<"safe"<<endl;
	return 0;
}  


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

int main(){
    ll N,K;
    cin >> N >> K;
    string S;
    cin >> S;
    vector<ll> v;
    ll now = 1;
    ll cnt = 0;
    rep(i,S.size()){
        if(S[i] == char('0'+now)){
            cnt++;
        }else{
            v.push_back(cnt);
            now = 1-now;
            cnt = 1;
        }
    }
    //if(cnt != 0)
    v.push_back(cnt);
    if(v.size()%2 == 0){
        v.push_back(0);
    }
    
    if(v[0] == N){
        cout << N << endl;
        return 0;
    }
    vector<ll> memo;
    ll size = v.size();
    /*
    rep(i,size-(2*K+1) + 1){
        ll sum = 0;
        rep(j,2*K+1){
            //if(i+j >= v.size())break;
            sum += v[i+j];
            //sum += v[0];
        }
        memo.push_back(sum);// i = (v.size() -2*K -1)     j=(2*K)
        i++;
    }*/
    ll lim = min(2*K+1, size);
    ll tmp = 0;
    ll M = 0;
    rep(i,lim){
        tmp += v[i];
    }
    M = tmp;
    for(ll i = 0; i<size - (2*K+1)-1; i+=2){
        tmp -= v[i];
        tmp -= v[i+1];
        tmp += v[i + 2*K + 1];
        tmp += v[i + 2*K + 2];     //size - 2*K -1 -1 2*K + 2   
        M = max(M,tmp);
    }
    
    //ll M = 0;
    //rep(i,memo.size()){
      //  M = max(M,memo[i]);
    //}
    //cout << (1^0) << endl;
    
    /*rep(i,v.size()){
        cout << v[i] << " ";
    }
    cout << endl;*/
    cout << M << endl;
}

Measured memory_bytes: 1528
int = int(input()) #iを取得し、intに値を入れる

if 400<=int and int<=599:
  print("8")

elif 600<=int and int<=799:
  print("7")

elif 800<=int and int<=999:
  print("6")


elif 1000<=int and int<=1199:
  print("5")


elif 1200<=int and int<=1399:
  print("4")


elif 1400<=int and int<=1599:
  print("3")


elif 1600<=int and int<=1799:
  print("2")

else:
  print("1")

Measured memory_bytes: 9120
#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)break;
		a-=d;
	}
	if(a<=0)cout<<"No";
	else cout<<"Yes";
	getchar();getchar();
}

Measured memory_bytes: 3592
package main

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

var sc *bufio.Scanner

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

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	sc = bufio.NewScanner(os.Stdin)
	sc.Buffer(make([]byte, 0), 1000000001*3)
	sc.Split(bufio.ScanWords)
	n := nextInt()
	div := make([]int, 13)
	div[0]++
	for i := 0; i < n; i++ {
		d := nextInt()
		div[d]++
	}

	if div[0] >= 2 || div[12] >= 2 {
		fmt.Println(0)
		return
	}
	for j := 1; j <= 11; j++ {
		if div[j] >= 3 {
			fmt.Println(0)
			return
		}
	}

	pattern := make(map[int]int, 0)
	bits := 1 << 12
	for p := 0; p < bits; p++ {
		contestants := 1
		if div[12] == 1 {
			contestants = contestants | 1<<12
		}
		for d := 1; d < 12; d++ {
			if div[d] == 2 {
				contestants = contestants | 1<<uint(d)
				contestants = contestants | 1<<uint(24-d)
				continue
			}
			if div[d] == 0 {
				continue
			}
			switch {
			case p>>uint(d)&1 == 1:
				contestants = contestants | 1<<uint(d)
			default:
				contestants = contestants | 1<<uint(24-d)
			}
		}
		pattern[contestants] = 12
	}

	for c := range pattern {
		cArray := make([]int, 0)
		for d := 0; d < 24; d++ {
			if c>>uint(d)&1 == 1 {
				cArray = append(cArray, d)
			}
		}
		for i := 0; i < len(cArray); i++ {
			for j := i + 1; j < len(cArray); j++ {
				switch {
				case cArray[j]-cArray[i] > 12:
					if 24-(cArray[j]-cArray[i]) < pattern[c] {
						pattern[c] = 24 - (cArray[j] - cArray[i])
					}
				default:
					if cArray[j]-cArray[i] < pattern[c] {
						pattern[c] = cArray[j] - cArray[i]
					}
				}
			}
		}
	}

	ans := 0
	for _, v := range pattern {
		if v > ans {
			ans = v
		}
	}
	fmt.Println(ans)
}


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

int main() {
  string s,t,u;
  int a,b;
  cin >> s >> t >> a >> b >> u;
  if(t == u) cout << a << " " << b-1 << endl;
  else cout << a-1 << " " << b << endl;
}


Measured memory_bytes: 256
typedef long long L;L n,a,b,m=1e9+7;L p(L c,L e){L x=1;for(c%=m;e;e/=2)e&1?x=x*c%m:0,c=c*c%m;return x;}L r(L s,L t){L y=1;for(L i=0;i<t;i++)y=y*(s-i)%m;return y;}main(){scanf("%ld%ld%ld",&n,&a,&b);printf("%ld",(m*m*2+p(2,n)-1-r(n,a)*p(r(a,a),m-2)-r(n,b)*p(r(b,b),m-2))%m);}

Measured memory_bytes: 1692
N = int(input())
S = [input() for _ in range(N)]
d = {}

for i in S:
    if i in d:
        d[i] += 1
    else:
        d[i] = 1

M = max(d.values())

for s in sorted(k for k in d if d[k] == M):
    print(s)

Measured memory_bytes: 35220
#include <iostream>

using namespace std;

int nextInt() { int d; cin >> d; return d; }

int solve(int n) {
  int ret = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      if ((i + j) * (j - i + 1) / 2 == n) {
        ret++;
      }
    }
  }
  return ret;
}

int main() {
  while (true) {
    int n = nextInt();
    if (n == 0) break;
    cout << solve(n) << endl;
  }
  return 0;
}

Measured memory_bytes: 1160
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
// #define int long long

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

#define REP(i, n) for (int i = 0; i < (n); ++i)
#define RREP(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define RFOR(i, a, b) for (int i = (a); i >= (b); --i)
#define ALL(v) (v).begin(), (v).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \
                      << " " << __FILE__ << endl;

typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vi> vvi;
typedef pair<int, int> pii;

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

    string s, t;
    cin >> s >> t;

    assert(s.size() < t.size());
    int i = 0;
    bool ok = true;
    for(char c : s) {
        if (c != t[i]) ok = false;
        i++;
    }

    if (ok) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}


Measured memory_bytes: 3660
#include <iostream>
#include <string>
#include <cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
#include <functional>
#include<complex>
using namespace std;

#define rep(i,x) for(ll i=0;i<x;i++)
#define repn(i,x) for(ll i=1;i<=x;i++)

typedef long long ll;
const ll INF = 1e17;
const ll MOD = 1000000007;
const ll MAX = 4000001;
const double eps = 1E-18;

ll max(ll a, ll b) {
	if (a > b) { return a; }
	return b;
}

ll min(ll a, ll b) {
	if (a > b) { return b; }
	return a;
}

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

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

struct edge {
	ll ind;
	ll fr;
	ll to;
	ll d;
};

class mint {
	long long x;
public:
	mint(long long x = 0) : x((x% MOD + MOD) % MOD) {}
	mint operator-() const {
		return mint(-x);
	}
	mint& operator+=(const mint& a) {
		if ((x += a.x) >= MOD) x -= MOD;
		return *this;
	}
	mint& operator-=(const mint& a) {
		if ((x += MOD - a.x) >= MOD) x -= MOD;
		return *this;
	}
	mint& operator*=(const  mint& a) {
		(x *= a.x) %= MOD;
		return *this;
	}
	mint operator+(const mint& a) const {
		mint res(*this);
		return res += a;
	}
	mint operator-(const mint& a) const {
		mint res(*this);
		return res -= a;
	}
	mint operator*(const mint& a) const {
		mint res(*this);
		return res *= a;
	}

	mint operator^(const ll& t)const {
		if (!t) return 1;
		mint a = pow(t >> 1);
		a *= a;
		if (t & 1) a *= *this;
		return a;
	}

	mint pow(ll t) const {
		if (!t) return 1;
		mint a = pow(t >> 1);
		a *= a;
		if (t & 1) a *= *this;
		return a;
	}
	// for prime MOD
	mint inv() const {
		return pow(MOD - 2);
	}
	mint& operator/=(const mint& a) {
		return (*this) *= a.inv();
	}
	mint operator/(const mint& a) const {
		mint res(*this);
		return res /= a;
	}

	friend ostream& operator<<(ostream& os, const mint& m) {
		os << m.x;
		return os;
	}
};

///////////////////////////



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

	vector<ll> a(N + 1);
	repn(i, N) cin >> a[i];

	vector<ll> c(1,0);
	ll mx = 0;
	repn(i, N) {
		if (a[i] > mx) { c.push_back(i); mx = a[i]; }
	}

	vector<ll> b(N + 1,0);
	repn(i, N) b[i] = a[i];
	sort(b.begin(), b.end(),greater<ll>());

	map<ll, ll> sum;
	sum[b[0]] = 0;
	repn(i,N){
		sum[b[i]] = sum[b[i - 1]] + i * (b[i - 1] - b[i]);
	}

	vector<ll> ans(N + 1);

	repn(i, c.size()-1) {
		ans[c[i]] = sum[a[c[i - 1]]] - sum[a[c[i]]];
	}

	repn(i, N) cout << ans[i] << endl;

	

	system("PAUSE");
}


Measured memory_bytes: 10612
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
typedef vector <ll> vll;
typedef pair <ll, ll> pll;
#define pb push_back
#define mp make_pair
#define MAX 1000000
#define mod 1000000007
#define all(_) _.begin(), _.end()
#define F first
#define S second

int main()
{
    ios_base :: sync_with_stdio(false);
    cin.tie(NULL), cout.tie(NULL);
    ll n, i;
    cin >> n;
    vll a(n), dp(n);
    for(i = 0; i < n; i++)
        cin >> a[i];
    dp[0] = 0; dp[1] = abs(a[0] - a[1]);
    for(i = 2; i < n; i++)
        dp[i] = min(dp[i - 1] + abs(a[i] - a[i - 1]), dp[i - 2] + abs(a[i] - a[i - 2]));
    cout << dp[n - 1] << endl;
    return 0;
}

Measured memory_bytes: 1792
a,b,c,d,e=[int(input()) for i in range(5)]

if a%10 == 0:
  a2 = a
else:
  a2 = ((a//10)+1)*10

if b%10 == 0:
  b2 = b
else:
  b2 = ((b//10)+1)*10

if c%10 == 0:
  c2 = c
else:
  c2 = ((c//10)+1)*10

if d%10 == 0:
  d2 = d
else:
  d2 = ((d//10)+1)*10

if e%10 == 0:
  e2 = e
else:
  e2 = ((e//10)+1)*10

lis = [a%10,b%10,c%10,d%10,e%10]

lis3 = [a,b,c,d,e]

listmp = [-1,-1,-1,-1,-1]
for i in range(5):
  if lis[i]==0:
    listmp[i] = 10
  else:
    listmp[i] = lis[i]
    
min_index = 0
for i in range(5):
  if listmp[i]<listmp[min_index]:
    min_index = i

lis2 = [a2,b2,c2,d2,e2]

out = sum(lis2) - lis2[min_index] + lis3[min_index]

print(out)

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

using namespace std;

int main(){
  int N;
  
  cin >> N;
  
  int t[N+1], x[N+1], y[N+1]; 
  
  t[0] = 0; x[0] = 0; y[0] = 0;
  
  for (int i = 0; i < N; i++)
    cin >> t[i+1] >> x[i+1] >> y[i+1];
  
  int dst, dt;
  bool judge = true;
  for (int i = 0; i < N; i++){
  	dst = abs(x[i+1] -  x[i]) + abs(y[i+1] - y[i]);
    dt = t[i+1] - t[i];
    if (dt < dst)
      judge = false; 
    if (dst % 2 != dt %  2)
      judge = false;
  }
  
  if (judge) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
  


Measured memory_bytes: 1408
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static System.Console;
using static System.Math;

namespace AtTest.ABC_141
{
    class A
    {
        static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(OpenStandardOutput()) { AutoFlush = false };
            SetOut(sw);

            Method(args);

            Out.Flush();
        }

        static void Method(string[] args)
        {
            string s = Read();
            if (s.Equals("Sunny")) WriteLine("Cloudy");
            if (s.Equals("Cloudy")) WriteLine("Rainy");
            if (s.Equals("Rainy")) WriteLine("Sunny");
        }

        private static string Read() { return ReadLine(); }
        private static char[] ReadChars() { return Array.ConvertAll(Read().Split(), a => a[0]); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }
    }
}


Measured memory_bytes: 11092
from bisect import bisect_left
n = int(input())
l = list(map(int, input().split()))
l.sort()
ans = 0
for a in range(n-2):
    for b in range(a+1, n-1):
        ans += bisect_left(l, l[a]+l[b]) - b - 1
print(ans)

Measured memory_bytes: 3316
#include <algorithm>
#include <cstdio>
#include <unordered_map>
typedef long long lld;
const int MAXS = 10;
std::unordered_map<std::string, int> cnt;
char S[MAXS + 5];
int N;

int main() {
  scanf("%d", &N);
  cnt.reserve(N);
  lld ret = 0;
  for (int i = 0; i < N; ++i) {
    scanf("%s", S);
    std::sort(S, S + MAXS);
    ret += cnt[S]++;
  }
  printf("%lld\n", ret);
  return 0;
}

Measured memory_bytes: 10496
//include,using,define等
#pragma region header
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <math.h>
#include <cstring>

// ===============================================================
//using系
#pragma region header
using namespace std;
using ll = long long;
using lint = long long;
using vl = vector<long long>;
using vvl = vector<vector<long long>>;
using vvi = vector<vector<int>>;
using vs = vector<string>;
using vc = vector<char>;
using vcc = vector<vector<char>>;
using vm = vector<short>;
using vmm = vector<vector<short>>;
using pii = pair<int, int>;
using psi = pair<string, int>;
using ld = long double;
using ull = unsigned long long;
using ui = unsigned int;
using qul = queue<ll>;
using pql = priority_queue<ll>;
const int dx[] = { 1,0,-1,0 };
const int dy[] = { 0,1,0,-1 };
constexpr ll mod = 1e9 + 7;
constexpr long double pi = 3.141592653589793238462643383279;
#pragma endregion
// ========================================================================
//define
#pragma region header
//#define int long long
#define rep(i, n) for(ll i = 0; i < n; i++)
#define REP(i, n) for(ll i = 1; i <= n; i++)
#define INF (ll)10000000000000000
#define mod (ll)1000000007
#define P pair<lint,lint>
template <class T>
bool chmax(T& a, const T& b) {
	if (a < b) {
		a = b;  // aをbで更新
		return true;
	}
	return false;
}
template <class T>
bool chmin(T& a, const T& b) {
	if (a > b) {
		a = b;  // aをbで更新
		return true;
	}
	return false;
}
#pragma endregion
#pragma endregion


int main(void) {
	ld a, b, c; cin >> a >> b >> c;
	ld x = a / c;
	if (x <= b) cout << "Yes" << endl;
	else cout << "No" << endl;

    return 0;
}

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

int main(){
    long N,n_candidate=0,answer=0;
    long buy[100002],sell[100002];
    long candidate[100002][2];
    long long int T;
    long long int A[100002],B[100002];
    long long int minA=1000000002,maxB=0;
    cin >> N >> T;
    for(long i=1;i<=N;i++){
        cin >> A[i];
        if(A[i]<minA){
            minA=A[i];
            buy[i]=i;
        }
        else{
            buy[i]=buy[i-1];
        }
        sell[i]=i;
        B[i]=A[i]-minA;
        if(B[i]>maxB){
            maxB=B[i];
        }
    }
    
    for(long i=1;i<=N;i++){
        if(B[i]==maxB){
            candidate[n_candidate][0]=buy[i];
            candidate[n_candidate][1]=sell[i];
            n_candidate++;
        }
    }
/*
    for(long i=0;i<n_candidate;i++){
        cout << "candidate : " << candidate[i][0] << " " << candidate[i][1] << "\n";
    }
*/
    cout << n_candidate << "\n";;

    return 0;
}

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

using namespace std;
char matrix[1003][1003];
int dist[1003][1003];
int h,w,ch,cw,dh,dw;
deque<pair<int,int>>dq;

int pomak_x[4]={0,1,-1,0};
int pomak_y[4]={-1,0,0,1};

void init(){
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++)
            dist[i][j]=INT_MAX;
    }
}

bool in_range(int x,int y){
    if(x>=0 && x<h && y>=0 && y<w)
        return true;
    return false;

}

int bfs(int sx,int sy){
    init();
    dq.push_front(make_pair(sx,sy));
    dist[sx][sy]=0;
    while(!dq.empty()){
        int tx=dq.front().first;
        int ty=dq.front().second;
        dq.pop_front();
        if(tx==dh && ty==dw){
            return dist[tx][ty];
        }

        //walk
        for(int i=0;i<4;i++){
            int nx=tx+pomak_x[i];
            int ny=ty+pomak_y[i];
            if(in_range(nx,ny)&&matrix[nx][ny]=='.' && dist[tx][ty]<dist[nx][ny]){
                dist[nx][ny]=dist[tx][ty];
                dq.push_front(make_pair(nx,ny));
            }
        }

        //magic
        for(int i=-2;i<=2;i++){
            for(int j=-2;j<=2;j++){
                int nx=tx+i;
                int ny=ty+j;
                if(in_range(nx,ny)&&matrix[nx][ny]=='.' && dist[tx][ty]+1<dist[nx][ny]){
                    dist[nx][ny]=dist[tx][ty]+1;
                    dq.push_back(make_pair(nx,ny));
                }
            }
        }
    }
    return -1;
}

int main(){
    cin>>h>>w>>ch>>cw>>dh>>dw;
    ch--,cw--,dh--,dw--;
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            cin >> matrix[i][j];
        }
    }
    cout << bfs(ch,cw)<<endl;;
   /* for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            if(dist[i][j]==INT_MAX)
                cout << "#"<<" ";
            else
            cout << dist[i][j]<<" ";
        }
        cout <<endl;
    }*/
}


Measured memory_bytes: 8480
#include<stdio.h>
#include <iostream>
#include <math.h>
#include <numeric>
#include <vector>
#include <map>
#include <functional>
#include <stdio.h>
#include <array>
#include <algorithm>
#include <string>
#include <string.h>
#include <assert.h>
#include <stdio.h>
#include <queue>
#include<iomanip>
#include<bitset>
#include<stack>
#include<set>
#include<limits>
#include <complex>
#include<cstdlib>
using namespace std;

int h, w, n;

void fall(vector<vector<int>>&f) {
	for (int k = 0; k < 30; ++k) {
		for (int y = h - 2; y >= 0; --y) {
			for (int x = 0; x < w; ++x) {
				if (!f[y + 1][x] && f[y][x]) {
					swap(f[y + 1][x], f[y][x]);
				}
			}
		}
	}
}

bool del(vector<vector<int>> f) {
	fall(f);
	bool flag = false;
	do {
		flag = false;
		vector<vector<bool>>check(h, vector<bool>(w, false));
		for (int y = 0; y < h; ++y) {
			int nowcolor = -1;
			int nownum = 0;
			for (int x = 0; x < w; ++x) {
				if (f[y][x]) {
					if (nowcolor == f[y][x]) {
						nownum++;
					}
					else {
						nownum = 1;
					}
					nowcolor = f[y][x];
					if (nownum == n) {
						for (int i = x - n + 1; i <= x; ++i) {
							check[y][i] = true;
						}
					}
					else if (nownum > n) {
						check[y][x] = true;
					}
				}
				else {
					nownum = 0;
					nowcolor = -1;
				}
			}
		}

		for (int x = 0; x < w; ++x) {
			int nowcolor = -1;
			int nownum = 0;
			for (int y = 0; y < h; ++y) {
				if (f[y][x]) {
					if (nowcolor == f[y][x]) {
						nownum++;
					}
					else {
						nownum = 1;
					}
					nowcolor = f[y][x];
					if (nownum == n) {
						for (int i = y - n + 1; i <= y; ++i) {
							check[i][x] = true;
						}
					}
					else if (nownum > n) {
						check[y][x] = true;
					}
				}
				else {
					nownum = 0;
					nowcolor = -1;
				}
			}
		}

		for (int x = 0; x < w; ++x) {
			for (int y = 0; y < h; ++y) {
				if (check[y][x]) {
					flag = true;
					f[y][x] = 0;
				}
			}
		}
		fall(f);

	} while (flag);
	for (int i = 0; i < w; ++i) {
		for (int j = 0; j < h; ++j) {
			if (f[j][i]) {
				return false;
			}
		}
	}
	return true;
}

int main() {
	cin >> h >> w >> n;
	vector<vector<int>>field(h,vector<int>(w,0));
	for (int i = 0; i < h; ++i) {
		string st; cin >> st;
		for (int j = 0; j < w; ++j) {
			if (st[j] == '.') {

			}
			else {
				field[i][j] = st[j] - 'A'+1;
			}
		}
	}
	for (int i = 0; i < w - 1; ++i) {
		for (int j = 0; j < h; ++j) {
			swap(field[j][i], field[j][i + 1]);
			if (del(field)) {
				cout << "YES" << endl;
				return 0;
			}
			swap(field[j][i], field[j][i + 1]);
		}
	}
	cout << "NO" << endl;
	return 0;
}

Measured memory_bytes: 3240
#include <algorithm>
#include <cstdlib>
#define REP(i,n) for(int i=0; i<(int)(n); i++)

#include <cstdio>
inline int getInt(){ int s; scanf("%d", &s); return s; }

#include <queue>
typedef long long ll;

#include <set>

using namespace std;

const ll mod = 1000000007;
const int MAX = 1024;
ll fact[MAX];
ll rfact[MAX];
ll rt[MAX];

ll mpow(ll b, ll e) {
  ll r = 1;
  while (e) {
    if(e % 2 == 1) r = (r * b) % mod;
    e /= 2;
    b = (b * b) % mod;
  }
  return r;
}

int main(){
  const int n = getInt();
  const int a = getInt();
  const int b = getInt();
  const int c = getInt();
  const int d = getInt();

  fact[0] = 1; REP(i,MAX - 1) fact[i + 1] = (fact[i] * (i + 1)) % mod;
  REP(i,MAX) rfact[i] = mpow(fact[i], mod - 2);
  REP(i,MAX) rt[i] = mpow(i, mod - 2);

  vector<ll> dp(n + 1);
  dp[n] = 1;

  for(int i = a; i <= b; i++) {
    vector<ll> next(n + 1);

    for(int j = 0; j <= n; j++) {
      next[j] = (next[j] + dp[j]) % mod;

      if(c * i > j || dp[j] == 0) continue;

      ll div = mpow(rfact[i], c);
      for(int k = c; k <= d && k * i <= j; k++) {
        const ll m = (((fact[j] * rfact[j - k * i]) % mod * div) % mod) * rfact[k] % mod;
        next[j - k * i] = (next[j - k * i] + dp[j] * m) % mod;
        div = (div * rfact[i]) % mod;
      }
    }

    dp.swap(next);
  }

  printf("%lld\n", dp[0]);
  return 0;
}


Measured memory_bytes: 256