akhauriyash/Code-Regression huggingface dataset:
#define _USE_MATH_DEFINES
#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;

//tree<key,null_type,less<key>,rb_tree_tag,tree_order_statistics_node_update> var_name;
tree<pair<int, int>, null_type, less<pair<int, int>>, rb_tree_tag, tree_order_statistics_node_update> s;
// find_by_order() 
// returns an iterator to the k-th largest element (counting from zero)
// order_of_key()
// returns the number of items in a set that are strictly smaller than our item

signed main() { 
  ios::sync_with_stdio(false); cin.tie(0);
  //f
  int n, q;
  cin >> n >> q;
  vector<int> col(n);
  for (auto& x : col) {
    cin >> x;
    x--;
  }
  vector<vector<int>> segs;
  for (int i = 0; i < q; i++) {
    int l, r;
    cin >> l >> r;
    l--;
    r--;
    segs.push_back({r, l, i});
  }
  sort(segs.begin(), segs.end());
  for (int i = 0; i < q; i++) swap(segs[i][0], segs[i][1]);
  vector<vector<int>> en(n);
  for (int i = 0; i < q; i++) en[segs[i][1]].push_back(i);
  set<pair<int, int>> st;
  vector<int> pos(n, -1);
  vector<int> ans(q);
  for (int i = 0; i < n; i++) {
    if (pos[col[i]] == -1) {
      st.insert(make_pair(i, col[i]));
      s.insert(make_pair(i, col[i]));
      pos[col[i]] = i;
    } else {
      st.erase(make_pair(pos[col[i]], col[i]));
      s.erase(make_pair(pos[col[i]], col[i]));
      pos[col[i]] = i;
      st.insert(make_pair(i, col[i]));
      s.insert(make_pair(i, col[i]));
    }
    for (auto& it : en[i]) {
      int l = segs[it][0];
      pair<int, int> p = *st.lower_bound(make_pair(l, 0));
      ans[segs[it][2]] = (int) st.size() - s.order_of_key(p);
    }
  }
  for (auto& i : ans) {
    cout << i << '\n';
  }
  return 0;
}

Measured memory_bytes: 112524
n = int(input())
memo = [[0 for i in range(10)] for j in range(10)]
for i in range(1,n+1):
    i_first = int(str(i)[0])
    i_last = int(str(i)[-1])
    memo[i_first][i_last] += 1
ans = 0
for i in range(1,n+1):
    i_first = int(str(i)[0])
    i_last = int(str(i)[-1])
    ans += memo[i_last][i_first]
print(ans)

Measured memory_bytes: 40428
s=list(input())
#print(s)
#print(len(s))
Ans =[0]
ans = 0
for i in range(len(s)):
    if s[i]=='A'or s[i]=='T'or s[i]=='G'or s[i]=='C':
        ans += 1
    else:
        Ans.append(ans)
        ans = 0
Ans.append(ans)
#print(Ans)
print(max(Ans))


Measured memory_bytes: 2940
// https://atcoder.jp/contests/abc047/tasks/abc047_a

#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
  /* Magic word */
  cin.tie(0);
  ios::sync_with_stdio(false);
  /* ---------- */

  int a, b, c;

  cin >> a >> b >> c;

  int maximum = max({a, b, c});
  string result = maximum == a + b + c - maximum ? "Yes" : "No";

  cout << result << "\n";

  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;
public class Main{
	public static void main(String[] args) {
		Scanner n = new Scanner(System.in);
        boolean[] X = new boolean[30];
		for(int i = 0; i < 28; i++){
			X[n.nextInt()-1] = true;
		}
		
		for(int i = 0; i < 30; i++){
			if(!X[i]){
				System.out.println(i+1);
			}
		}

	}

}


Measured memory_bytes: 26184
#include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;
#define rep1(i,n) for(int i=1;i<=n;i++)
struct rec{int di,h;};
vector<rec> vc;
bool comp(rec const &l,rec const &r){
	return l.di!=r.di ? l.di<r.di : l.h<r.h;
}
int main(){
	rep1(i,150) rep1(j,i-1) vc.push_back({i*i+j*j,j});
	sort(vc.begin(),vc.end(),comp);
	while(true){
		int n,m;
		scanf("%d%d",&n,&m);
		if(n==0) break;
		rec e={n*n+m*m,n};
		rec rc=*upper_bound(vc.begin(),vc.end(),e,comp);
		printf("%d %d\n",rc.h,(int)((1e-9)+sqrt(rc.di-rc.h*rc.h)));
	}
	return 0;
}

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

int main() {
    int n;
    cin>>n;
    int a[n];
    int b[n+1];
    int ans=0;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
       b[a[i]]=i;
    }
    for(int i=1;i<=n;i++)
    {
        cout<<b[i]+1<<" ";
    }
	return 0;
}


Measured memory_bytes: 1536
a = list(map(int,input().split()))

c = [[0 for i in range(a[0]+1)] for j in range(a[0]+1)]

for i in range(a[1]):
    n,m = map(int,input().split())
    c[n][m] += 1

d = [[0 for i in range(a[0]+4)] for j in range(a[0]+4)]

for i in range(a[0]+1):
    for j in range(a[0]+1):
        d[i][j+1] = d[i][j] + c[i][j]

for i in range(a[2]):
    n,m = map(int,input().split())
    s = 0
    for j in range(n,m+1):
        s += d[j][m+1] - d[j][j]
    print(s)

Measured memory_bytes: 56276
#include <iostream>
using namespace std;
int main(void){
    int N,X,m[110],count = N,min = 1001;
    
    cin >> N >> X;
    
    for(int i = 0;i < N;i++){
     cin >> m[i];
     X -= m[i];
     if(m[i] < min) min = m[i];
    }
    
    X = (X-(X % min))/min;
    count = N + X;
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <climits>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <numeric>
using namespace std;

#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
#define FOR(i, a, b) for (int i = (a); i < (int)(b); ++i)
#define FOREQ(i, a, b) for (int i = (a); i <= (int)(b); ++i)
#define FOREACH(i, c) for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define ALL(c) (c).begin(), (c).end()

inline int sq(int x) { return x*x; }

vector<int> ships[10000];

int main()
{
  int an, bn, r;
  while (scanf("%d%d%d", &an, &bn, &r), an | bn) {
    REP(x, 10000) { ships[x].clear(); }
    REP(i, an) {
      int x, y; scanf("%d%d", &x, &y);
      ships[x].push_back(y);
    }
    REP(x, 10000) { sort(ALL(ships[x])); }
    int ans = 0;
    REP(i, bn) {
      int x, y; scanf("%d%d", &x, &y);
      FOREQ(xx, max(0, x-4*r), min(x+4*r, 9999)) {
        vector<int>::iterator first = lower_bound(ALL(ships[xx]), y-4*r);
        vector<int>::iterator last = upper_bound(ALL(ships[xx]), y+4*r);
        for (vector<int>::iterator it = first; it != last; ++it) {
          int yy = *it;
          if (sq(x - xx) + sq(y - yy) <= sq(4*r)) { ++ans; }
        }
      }
    }
    printf("%d\n", ans);
  }
}

Measured memory_bytes: 2292
N = int(input())

strList = list([])

for i in range(N):
  strList.append(str(input()))

strDict = {}

for item in strList:
  if item not in strDict.keys():
    strDict[item] = 1
  else:
    strDict[item] += 1

maxList = list([])
maxNum = max(strDict.values())

for strKeys in strDict.keys():
  if strDict[strKeys] == maxNum:
    maxList.append(strKeys)

for srtedItem in sorted(maxList):
  print(srtedItem)

Measured memory_bytes: 35220
'use strict'
const num = 5
function main(o) {
  o = o.split('\n').map(v => ~~v)
  let foods = o.slice(0, num)

  let foods1 = []
  let foods2 = []
  for (let i = 0; i < num; i++) {
    if (foods[i] % 10 > 0) {
      foods1.push(foods[i])
    } else {
      foods2.push(foods[i])
    }
  }
  foods1.sort((a, b) => {
    return a % 10 < b % 10
  })

  let time = 0
  if (foods1.length) {
    for (let i = 0; i < foods1.length - 1; i++) {
      time += foods1[i] + (10 - (foods1[i] % 10))
    }
  }
  for (let i = 0; i < foods2.length; i++) {
    time += foods2[i]
  }
  if (foods1.length) {
    for (let i = foods1.length - 1; i < foods1.length; i++) {
      time += foods1[i]
    }
  }
  console.log(time)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'))


Measured memory_bytes: 11468
#include<iostream>
#include<algorithm>
#include<string>
#include<cstdlib>
#include<map>
#include<iomanip>
#include<sstream>
#include<vector>
#include<stack>
#include<math.h>
#include<queue>
#include<complex>
using namespace std;

const long long int INF=99999999999999,inf=199999;
const long long int mod=1000000007;


long long int dp[150000][15]={};
long long int n,m,k,a[200005],b[200005],c,d,count=0,res=0,tmp,kiyo[200000]={1};
int main() {
    int count=0;
    string str,str2;
    map<long long int,long long int>mp;
	cout << fixed << setprecision(10);
    cin>>str2;
    n=str2.length();
    str=str2;
    for(int i=0;i<n;i++){
        str[i]=str2[n-i-1];
    }
    for(int i=1;i<100050;i++){
        kiyo[i]=(10*kiyo[i-1])%13;
        //cout<<i<<" "<<kiyo[i]<<endl;
    }
    dp[n][0]=1;
    for(int i=n-1;i>=0;i--){
        for(int j=0;j<=12;j++){
            if(str[i]!='?'){
                dp[i][(j+(str[i]-'0')*kiyo[i])%13]+=dp[i+1][j];
                dp[i][(j+(str[i]-'0')*kiyo[i])%13]%=mod;
                //cout<<i<<" "<<str[i]-'0'<<" "<<kiyo[i]<<" "<<(j+(str[i]-'0')*kiyo[i])<<" "<<dp[i][(j+(str[i]-'0')*kiyo[i])%13]<<endl;
            }else{
                for(int k=0;k<=9;k++){
                    dp[i][(j+k*kiyo[i])%13]+=dp[i+1][j];
                    dp[i][(j+k*kiyo[i])%13]%=mod;
                }
            }
            
        }
    }
    
    
    cout<<dp[0][5]<<endl;
    
} 


Measured memory_bytes: 15616
/*
 * FileName:     A
 * CreatedDate:  2020-03-01 21:01:07 +0900
 * LastModified: 2020-03-01 21:04:20 +0900
 */

#include <stdio.h>

int main(void){
    int N;
    scanf("%d",&N);
    if(N%2){
        printf("%d\n",(int)N/2+1);
    }
    else{
        printf("%d\n",(int)N/2);
    }
    return 0;
}


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

#define NDEBUG
#ifdef DEBUG
#include "../cout11.h"
#undef NDEBUG
#endif
#include <cassert>

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> ii;
typedef pair<ll,ll> llll;
typedef pair<double,double> dd;

typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<ii> vii;
typedef vector<vector<ii>> vvii;
typedef vector<ll> vll;

#define sz(a)  int((a).size())
#define pb  push_back
#define FOR(var,from,to) for(int var=(from);var<=(to);++var)
#define rep(var,n)  for(int var=0;var<(n);++var)
#define rep1(var,n)  for(int var=1;var<=(n);++var)
#define repC2(vari,varj,n)  for(int vari=0;vari<(n)-1;++vari)for(int varj=vari+1;varj<(n);++varj)
#define ALL(c)  (c).begin(),(c).end()
#define RALL(c)  (c).rbegin(),(c).rend()
#define tr(i,c)  for(auto i=(c).begin(); i!=(c).end(); ++i)
#define found(s,e)  ((s).find(e)!=(s).end())
#define mset(arr,val)  memset(arr,val,sizeof(arr))
#define mid(x,y) ((x)+((y)-(x))/2)
#define IN(x,a,b) ((a)<=(x)&&(x)<=(b))

ll gcd(ll a, ll b) { while(a) swap(a, b%=a); return b; }

const ll MOD=1000000007LL;

ll ADD(ll x, ll y) { return (x+y) % MOD; }
ll SUB(ll x, ll y) { return (x-y+MOD) % MOD; }
ll MUL(ll x, ll y) { return x*y % MOD; }
ll POW(ll x, ll e) { ll v=1; for(; e; x=MUL(x,x), e>>=1) if (e&1) v = MUL(v,x); return v; }
ll DIV(ll x, ll y) { /*assert(y%MOD!=0);*/ return MUL(x, POW(y, MOD-2)); }
// ll comb(ll n, ll k) { ll v=1; for(ll i=1; i<=k; i++) v = DIV(MUL(v, n-i+1),i); return v; }
//

#define INFTY 12345678901LL;

ll solve(int x, int y) {
    vector<int> a { x, y, 0, -x, -y };
    int N = 5;
    vector<vector<ll>> d(5, vector<ll>(5));
    rep(i,N) d[i][i] = 0;
    repC2(i,j,N){
        if (a[i] == a[j]) d[i][j] = d[j][i] = 0;
        else if (a[i] == -a[j]) d[i][j] = d[j][i] = 1;
        else if (a[i] < a[j]) {
            d[i][j] = a[j] - a[i];
            d[j][i] = INFTY;
        }
        else {
            d[i][j] = INFTY;
            d[j][i] = a[i] - a[j];
        }
    }
    rep(k,N) rep(i,N) rep(j,N) d[i][j] = min(d[i][j], d[i][k]+d[k][j]);

    return d[0][1];
}

int main() {
    int x,y; cin >> x >> y;
    cout << solve(x,y) << endl;
    // cout << (solve(N,a) ? "Yes":"No") << endl;
    return 0;
}


Measured memory_bytes: 764
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <cmath>
#include <tuple>
#include <cstdio>
#include <bitset>
#include <sstream>
#include <iterator>
#include <numeric>
#include <map>
#include <cstring>
#include <set>
#include <functional>
#include <iomanip>

using namespace std;

//#define DEBUG_ //!!提出時にコメントアウト!!
#ifdef DEBUG_
	#define dump(x)  cerr << #x << " = " << (x) << endl;
#else
	#define dump(x)  ;
#endif

#define EPS (1e-10)
#define equals(a,b) (fabs((a)-(b)) < EPS)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define SZ(x) ((int)(x).size())
#define pb push_back
#define eb emplace_back

//#define int long long

typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;

template <typename T>
std::string printVector(const std::vector<T> &data)
{
    std::stringstream ss;
    std::ostream_iterator<T> out_it(ss, ", ");
    ss << "[";
    std::copy(data.begin(), data.end() - 1, out_it);
    ss << data.back() << "]";
    return ss.str();
}

const int MOD = 1e9+7;
const LL LINF = 1001002003004005006ll;
const int INF = 1001001001;

signed main(int argc, char const *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N; cin >> N;
    string ok = "Possible";
    string ng = "Impossible";

    VI a(N);
    int cnt[200] = {};
    REP(i,N){
        cin >> a[i];
        cnt[a[i]]++;
    }
    sort(a.begin(),a.end(),greater<int>());
    dump(a[0])

    if(a[0]%2 == 0){
        for(int i = a[0]; i >= a[0]/2 + 1; i--){
            if(cnt[i] < 2){
                cout << ng << endl;
                return 0;
            }else{
                cnt[i] -= 2;
            }
        }
        if(cnt[a[0]/2] == 0){
            cout << ng << endl;
            return 0;
        }else{
            cnt[a[0]/2]--;
        }
    }else{
        for(int i = a[0]; i >= (a[0]+1)/2; i--){
            dump(i)
            if(cnt[i] < 2){
                cout << ng << endl;
                return 0;
            }else{
                cnt[i] -= 2;
            }
        }
    }
    dump("check")

    for(auto i : a){
        if(cnt[i] == 0) continue;

        dump(i)
        dump(cnt[i])

        if(a[0]%2 == 0){
            if((i-1) > a[0] || (i-1) < a[0]/2){
                cout << ng << endl;
                return 0;
            }
        }else{
            if((i-1) > a[0] || (i-1) < (a[0]+1)/2){
                cout << ng << endl;
                return 0;
            }

        }
    }
    cout << ok << endl;


}


Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<vector>
#include<queue>
#include<map>
#include<iomanip>
#include<set>
#include "bits/stdc++.h"
#define rep(index,num) for(int index=0;index<num;index++)
#define rep1(index,num) for(int index=1;index<=num;index++)
#define scan(argument) cin>>argument
#define prin(argument) cout<<argument<<endl
#define kaigyo cout<<endl
#define eps 1e-7
#define mp(a1,a2) make_pair(a1,a2)
typedef long long ll;
typedef long double ld;
using namespace std;
typedef pair<ll,ll> pll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<pint> vpint;
typedef vector<pll> vpll;
ll INFl=1e+18+1;
int INF=1e+9+1;
int main(){
	int N,M;
	scan(N>>M);
	int L[100001],R[100001];
	int rui[100001]={};
	rep(i,M){
		scan(L[i]>>R[i]);
		rui[L[i]-1]++;
		rui[R[i]]--;
	}
	rep(i,N){
		rui[i+1]+=rui[i];
	}
	int ans=0;
	rep(i,N){
		if(rui[i]==M) ans++;
	}
	prin(ans);
	return 0;
}


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

int main() {
  string s;
  cin>>s;
  int dp[1000005][2];
  rep(i,1000005){
    rep(j,2){
      dp[i][j]=INF;
    }
  }
  reverse(s.begin(),s.end());
  s+='0';
  dp[0][0]=0;
  rep(i,s.size()){
    rep(j,2){
      rep(k,10){
        int a=s[i]-'0';
        int b=k;
        if(j==1) a++;
        int c=b-a; 
        if(c>=0){
          dp[i+1][0]=min(dp[i][j]+b+c,dp[i+1][0]);
        }else{ 
          c+=10;
          dp[i+1][1]=min(dp[i][j]+b+c,dp[i+1][1]);
        }
      }
      
    }
  }
  cout<<dp[s.size()][0]<<endl;
}


Measured memory_bytes: 9220
#include <bits/stdc++.h>
using namespace std;
 
int main(){
	int A,B,N;
  	cin >> A >> B;
  	N= (B-1)/(A-1);
  	
  	if((B-1)%(A-1)==0){
  		cout << N << endl;
    }
  
  	else{
    	cout << N+1 << endl;
    }
  	
}

Measured memory_bytes: 3600
#include "bits/stdc++.h"
#define rep(i,b) for(ll i=0;i<b;i++)
#define ll long long
using namespace std;
/*--Input//////////////////////////////////////////////////*/
inline void IN(void){return;}
template <typename First, typename... Rest>
void IN(First& first, Rest&... rest){cin >> first;IN(rest...);return;}
#define SS(T, ...)      T __VA_ARGS__; IN(__VA_ARGS__);
#define SV(type,c,n) vector<type> c(n);for(auto& i:c)cin >> i;
/*--Output/////////////////////////////////////////////////*/
inline int p(void){cout << endl; return 0;}
template<class Head> int p(Head&& head){cout << head;p();return 0;} template<class Head,class... Tail> int p(Head&& head,Tail&&... tail){cout<<head<<" ";p(forward<Tail>(tail)...);return 0;}
struct ProconInit {
    static constexpr bool AUTOFLUSH = false;
    ProconInit() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(15);
        if(AUTOFLUSH)
            cout << unitbuf;
    }
} PROCON_INIT;

#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vvvl vector<vector<vector<ll>>>
#define debug(x) cerr<<#x<<" "<<x<<'\n';
#define all(x) (x).begin(),(x).end()
#define bit(n) (1LL<<(n))
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
bool cmp(pair<ll,ll> a, pair<ll,ll> b) { return a.first+a.second > b.first+b.second; }
                         
int main() {
    SS(int,a,b);
    a*b%2==0?p("Even"):p("Odd");
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define N 998244353
 
ll digi(ll n){
	ll count = 0;
	while(n){
		n/=10;
		count++;
	}
	return count;
}
int main() {
 
	ll n;

	cin>>n;
	ll count=0;
	for(int i=1;i<=n;i++){
		if(digi(i)%2)
			count++;
	}
	cout<<count<<endl;
 
	return 0;
} 

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
#include <string.h>
#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))

int n;
vector<i64> a;
int zero;
int one;

int main(){
    cin >> n;
    rep(i,0,n - 1){
        i64 t;
        cin >> t;
        if(t == 0) zero++;
        else if(t == 1) one++;
        else a.push_back(t);
    }
    sort(a.begin(),a.end());

    vector<i64> r;

    if(zero % 2 == 1 && one == 0){
        for(int i = 0; i < zero - 1;i++){
            r.push_back(0);
        }
        if(a.size() > 0)
        {
            r.push_back(a.front());
            a.erase(a.begin());
        }
        r.push_back(0);
    }
    else{
        for(int i = 0;i < zero - (zero % 2);i++){
            r.push_back(0);
        }
        if(zero % 2 ==1){
            r.push_back(1);
            one--;
            r.push_back(0);
            zero--;
        }
        for(int i = 0;i < one;i++){
            r.push_back(1);
        }
    }

    if(a.size() >= 2 && a[a.size() - 2] == 2 && a[a.size() - 1] == 3){
        swap(a[a.size() - 2] , a[a.size() - 1]);
   }

    for(i64 an : a){
        cout << an << endl;
    }
    for(i64 an : r){
        cout << an << endl;
    }
}





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

using ll=long long;

using vi=vector<int>;
using vll=vector<ll>;
using vvi=vector<vi>;

int main() {
  string s; cin >>s;
  string ans="No";
  char c='C';
  rep(i,0,s.size()) {
    if (s[i]==c) {
      if (c=='C') {
        c='F';
      } else {
        ans="Yes";
        break;
      }
    }
  }
  cout <<ans <<endl;
  return 0;
}


Measured memory_bytes: 3596
def main():
    n = int(input())
    C, S, F = [], [], []
    for _ in range(n - 1):
        c, s, f = list(map(int, input().split()))
        C.append(c)
        S.append(s)
        F.append(f)
    for i in range(n):
        t = 0
        for j in range(i, n - 1):
            if t <= S[j]:
                t = S[j]
            elif t % F[j] != 0:
                t += F[j] - t % F[j]
            t += C[j]
        print(t)



if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
/* be name khoda */

// #define stream_enable
#define long_enable
#include <iostream>
#include <algorithm>
#include <cstring>
#include <numeric>
#include <iomanip>
#include <sstream>
#include <vector>
#include <queue>
#include <set>
#include <map>
using namespace std;

#ifdef stream_enable
#define cin sss
#endif
#ifdef long_enable
typedef long long int ll;
#else
typedef int ll;
#endif

typedef pair<ll, ll> pii;
typedef pair<pii, ll> ppi;
typedef pair<ll, pii> pip;
typedef vector<ll> vi;
typedef vector<pii> vpii;

const ll MOD = 1000000007;
const long long BIG = 1446803456761533460;
const int Big = 336860180;

#define F first
#define S second
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(), (x).end()

#define debug(x) cout << #x << " -> " << (x) << endl;
#define debug2(x, y) cout << #x << ' ' << #y << " -> " << (x) << ' ' << (y) << endl;
#define debug3(x, y, z) cout << #x << ' ' << #y << ' ' << #z << " -> " << (x) << ' ' << (y) << ' ' << (z) << endl;
#define debug4(x, y, z, t) cout << #x << ' ' << #y << ' ' << #z << ' ' << #t << " -> " << (x) << ' ' << (y) << ' ' << (z) << ' ' << (t) << endl;
#define debugp(x) cout << #x << " -> " << "(" << (x).F << ", " << (x).S << ")" << endl;
#define debuga(x, n) cout << #x << " -> "; fori (i1_da, n) { cout << (x)[i1_da] << ' '; } cout << endl
#define debugap(x, n) cout << #x << " ->\n"; fori (i1_dap, n) { cout << "(" << (x)[i1_dap].F << ", " << (x)[i1_dap].S << ")\n"; } cout << endl
#define debugaa(x, n, m) cout << #x << " ->\n"; fori (i1_daa, n) { fori (i2_daa, m) { cout << (x)[i1_daa][i2_daa] << ' '; } cout << '\n'; } cout << endl
#define debugav(x, n) cout << #x << " ->\n"; fori (i1_dav, n) { fori (i2_dav, (x)[i1_da].size()) { cout << (x)[i1_dav][i2_dav] << ' '; } cout << '\n'; } cout << endl
#define debugia(x, n) cout << #x << " ->\n"; fori (i1_dia, n) { cout << i1_dia << " : " << (x)[i1_dia] << '\n'; } cout << endl

#define forifrom(i, s, n) for(ll i = (s); i < (n); ++i)
#define forirto(i, n, e) for(ll i = (n) - 1; i >= (e); --i)
#define fori(i, n) forifrom (i, 0, n)
#define forir(i, n) forirto (i, n, 0)

#define smin(a, b) a = min(a, (b))
#define smax(a, b) a = max(a, (b))

#define Add(a, b) a = (a + (b)) % MOD
#define Mul(a, b) a = (a * (b)) % MOD

stringstream sss;

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

const ll maxn = 200010;

ll n;
ll ar[maxn];

void MAIN() {

    ll n;
    cin >> n;
    fori (i, n) cin >> ar[i];
    ll ptr = 1;
    fori (i, n) {
        if (ar[i] == ptr) ++ptr;
    }
    cout << (ptr == 1 ? -1 : n + 1 - ptr) << '\n';

}

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

int main() {
    ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    cout << fixed << setprecision(10);
    sss << R"(

    )";
    MAIN();
    return 0;
}


Measured memory_bytes: 1792
import java.util.*;
public class Main {
  public static void main(String args[]) {
    Scanner sc=new Scanner(System.in);
    int L=sc.nextInt();
    int R=sc.nextInt();
    int d=sc.nextInt();
    int ans=(int)Math.floor(R*1.0/d)-(int)Math.ceil(L*1.0/d)+1;
    System.out.println(ans);
  }
}

Measured memory_bytes: 35712
import Data.List
main = interact $ unwords . map show . sol . map read . words
sol [a,b,c,d,e,f] = snd $ minimum 
  [(fromIntegral (w+s)/fromIntegral s,[w+s,s]) |
  n <- [0..f`div`(100*a)+1], m <- [0..f`div`(100*b)+1], 
  let w = 100*(n*a+m*b), w>0, w<=f,
  let g = min (f-w) (e*w`div`100+1), 
  p <- [0..g`div`c+1], q <- [0..g`div`d], 
  let s = p*c+q*d, 100*s<=w*e, s+w<=f]

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

#define range(i, l, r) for (int i = (int)l; i < (int)(r); ++(i))
#define rrange(i, l, r) for (int i = ((int)(r) - 1); i >= (int)l; --(i))

#define whole(f,x,...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x)
#define rwhole(f,x,...) ([&](decltype((x)) whole) { return (f)(rbegin(whole), rend(whole), ## __VA_ARGS__); })(x)

#define debug(x) cerr << "(" << __LINE__ << ")" << #x << ": " << (x) << endl

using int32 = int;
using int64 = long long;

const int mod     = 1e9 + 7;
const int32 inf   = 1001001001;
const int64 infll = 1001001001001001001ll;

const int dx[] = {0, -1, 1, 0, -1, 1, -1, 1}, dy[] = {-1, 0, 0, 1, -1, -1, 1, 1};
const string YES = "YES", NO = "NO", Yes = "Yes", No = "No", yes = "yes", no = "no";

struct IoSetup { IoSetup(){ cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(16); cerr << fixed << setprecision(16); } } iosetup;

template <typename T = int64> T input() { T x; cin >> x; return x; }

template <typename T> ostream &operator<<(ostream &os, vector<T> &v) { range(i, 0, v.size()) { os << v[i] << (i + 1 != v.size() ? " " : ""); } return os; } 
template <typename T> istream &operator>>(istream &is, vector<T> &v) { for (T &in : v) is >> in; return is; }
template <typename T1, typename T2> ostream &operator<<(ostream &os, pair<T1, T2> p) { os << p.fs << " " << p.sc; return os; }
template <typename T1, typename T2> istream &operator>>(istream &is, pair<T1, T2> &p) { is >> p.fs >> p.sc; return is; }

template <typename T> vector<T> make_v(size_t a, T b) { return vector<T>(a, b); }
template <typename... Ts> auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v(ts...))>(a, make_v(ts...)); }

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

void solver() {
  int N = input(), M = input();
  vector< pair< int, int > > vp(N);
  for (auto &p : vp) {
    cin >> p.first >> p.second;
  }

  whole(sort, vp);

  priority_queue< int > pq;
  int idx = 0;

  int ans = 0;
  range(day, 1, M + 1) {
    while (idx < N && vp[idx].first <= day) {
      pq.push(vp[idx].second);
      idx++;
    }

    if (!pq.empty()) {
      ans += pq.top();
      pq.pop();
    }
  }
  
  cout << ans << endl;
}

signed main(int argc, char *argv[]) {
  solver();
}


Measured memory_bytes: 1660
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>   
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
using namespace std;
#define i64  long long
#define int  long long
 
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
#define MEM_SIZE 10000

// int DP[MEM_SIZE][MEM_SIZE] = {0};
// int GMEM[MEM_SIZE][MEM_SIZE] = {0};
template<typename T> void DEBUG(T e){std::cout << e << std::endl;}
template<class T> void DEBUG(string str, T e){std::cout <<str << ">>" << e << std::endl;}
template<typename T> void DEBUG(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ DEBUG(v); } }
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
template<typename T> void SORT_(std::vector<T>& v,bool GREATER = 0){if(GREATER == 0)sort(v.begin(),v.end());else{sort(v.begin(),v.end(),std::greater<T>());}}

bool check (string S, string T, int k)
{
   corner(T.size() + k > S.size(),"Out of Size");
   bool check = 1;
   for (int i = 0; i < T.size(); i++)
   {
    if((S[k+i] == T[i] || S[k+i] == '?')^(true)) check = 0;
   }

   return check;
}

string fill(string S,string T,int k)
{
  string filled = S;
  for (int i = 0; i < T.size(); i++)
  {
    filled[k+i] = T[i];
  }
  for (int i = 0; i < S.size(); i++)
  {
    if(filled[i] == '?')filled[i] = 'a';
  }
  
  return filled;
}
void solve(void)
{

  string S,T;
  cin>>S;
  cin>>T;
  if(T.size() > S.size())
  {
    cout<<"UNRESTORABLE"<<endl;
    return;
  }
  
  vector<string> ANS;

  for (int i = 0; i < - T.size() + S.size() + 1; i++)
  {
    if(check(S,T,i))
    {
      string Q = fill(S,T,i);
      ANS.push_back(Q);
    }
  }
  SORT_(ANS);
  if(ANS.size()!= 0)
  {
    cout<<ANS[0]<<endl;
  }
  else
  {
    cout<<"UNRESTORABLE"<<endl;
  }
  
  
  
  return;

   
}


int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(9);
  solve();

 
  return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
#include <iostream>
#include <queue>
#include <unordered_map>
#include <cmath>
#include <queue>
#include <string>
#include <random>
#include <stack>
#include <set>
#include <unordered_set>

#define bug(x) cout<<"zdongdebug: "<<x<<endl;
#define bug2(x, y) cout<<"zdongdebug: "<<x<<" "<<y<<endl;
using namespace std;
typedef long long ll;
const int maxn = 305;
const int mod = 1000000007;

string s[maxn];
int ret[maxn][maxn];
int main() {
#ifdef suiyuan2009
  freopen("/Users/suiyuan2009/CLionProjects/icpc/input.txt", "r", stdin);
  //freopen("/Users/suiyuan2009/CLionProjects/icpc/output.txt", "w", stdout);
#endif
  int n,m,K;
  cin>>n>>m>>K;
  for(int i=0;i<n;i++)cin>>s[i];
  int cur = 0;
  int pre = -1;
  for(int i=0;i<n;i++){
    bool sign = 0;
    int pos = -1;
    for(int j=0;j<m;j++){
      if(s[i][j]=='#'){
        sign = 1;
        int rpos = j;
        while(rpos+1<m&&s[i][rpos+1]!='#')rpos++;
        cur++;
        for(int k=pos+1;k<=rpos;k++)
          for(int p=pre+1;p<=i;p++)ret[p][k]=cur;
        pos = rpos;
      }
    }
    if(sign){
      pre = i;
    }
  }
  for(int i=pre+1;i<n;i++)
    for(int j=0;j<m;j++)ret[i][j]=ret[i-1][j];
  for(int i=0;i<n;i++){
    for(int j=0;j+1<m;j++)cout<<ret[i][j]<<" ";
    cout<<ret[i][m-1]<<endl;
  }
  return 0;
}

Measured memory_bytes: 1280
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int k = scanner.nextInt();

		scanner.nextLine();
		scanner.nextLine();

		int m = (int)Math.ceil(((double)(n-1))/(k-1));
		System.out.println(m);
	}
}

Measured memory_bytes: 35604
import sys
for line in sys.stdin:
    p = list(map(int, line.split()))
    car = [4, 1, 4, 1, 2, 1, 2, 1, 4, 1, 4, 1, 2, 1, 2, 1]
    ans_d = 10**9
    ans = -1
    for i in range(8):
        now_d = 0
        for j in range(8):
            now_d += abs(p[j] - car[i+j])
        if ans_d > now_d:
            ans_d = now_d
            ans = car[i:i+8]
        elif ans_d == now_d:
            ans_s, now_s = '', ''
            for k in ans:
                ans_s += str(k)
            for k in car[i:i+8]:
                now_s += str(k)
            if int(ans_s) > int(now_s):
                ans_d = now_d
                ans = car[i:i+8]
    t = ''
    for i in ans:
        t += str(i) + ' '
    print(t[:-1])


Measured memory_bytes: 5608
#include<stdio.h>
#include<string.h>
int main(void){
  char str[1];
  scanf("%s",str);
  if(strcmp(str,"SUN")==0){
    printf("%d",7);
  }
  if(strcmp(str,"MON")==0){
    printf("%d",6);
  }
  if(strcmp(str,"TUE")==0){
    printf("%d",5);
  }
  if(strcmp(str,"WED")==0){
    printf("%d",4);
  }
  if(strcmp(str,"THU")==0){
    printf("%d",3);
  }
  if(strcmp(str,"FRI")==0){
    printf("%d",2);
  }
  if(strcmp(str,"SAT")==0){
    printf("%d",1);
  }
}

Measured memory_bytes: 128
// 6/22 解き直し
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (n); ++i)

int main() {
    int N, K;
    cin >> N >> K;
    vector<int> p(N);
    rep(i, N) cin >> p[i];

    vector<double> exp(N);
    rep(i, N) exp[i] = (double)(1 + p[i]) / 2.0;

    // rep(i, N) cout << exp[i] << endl;

    double sum = 0;
    for (int i = 0; i < K; i++) sum += exp[i];
    double ans = sum;

    // iは右端
    for (int i = K; i < N; i++) {
        sum -= exp[i-K];
        sum += exp[i];
        ans = max(ans, sum);
    }

    cout << std::fixed << std::setprecision(15);
    cout << ans << endl;
}

Measured memory_bytes: 5624
package main

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

var sc = bufio.NewScanner(os.Stdin)

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

func readFloat64() float64 {
	sc.Scan()
	f, err := strconv.ParseFloat(sc.Text(), 64)
	if err != nil {
		panic(err)
	}
	return f
}

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

func main() {
	sc.Split(bufio.ScanWords)
	n := readString()

	ok := false
	for _, v := range n {
		if int(v-'0') == 7 {
			ok = true
		}
	}
	if ok {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


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

using namespace std;

int main(int argc, char const *argv[]) {
	unsigned long long n;
	std::cin >> n;
	unsigned long long mmax = 0;

	// 1桁の処理
	if (n < 10) {
		std::cout << n << '\n';
		return 0;
	}
	// 上位1桁以外が9の時の処理
	// 3999とかのときは、そのまま足した方が良い
	string nn = to_string(n);
	int x = nn.size() - 1;
	bool flag = true;
	for (size_t i = 1; i < nn.size(); i++) {
		if (nn[i] != '9') {
			flag = false;
			break;
		}
	}
	if (flag) {
		std::cout << (nn[0]-'0') + 9 * x << '\n';
		return 0;
	}
	// それ以外
	// 上位1桁を1減らして、上位1桁以外を9にする
	std::cout << (nn[0] - '0') + 9 * x - 1 << '\n';
	return 0;
}


Measured memory_bytes: 256
from collections import deque

H, W = map(int, input().split())
c = [input() for i in range(H)]

INF = -1

def bfs():
    dist = [[INF for i in range(W)] for j in range(H)]
    dx = [1, 0, -1, 0]
    dy = [0, 1, 0, -1]
    q = deque()
    q.append([sx, sy])
    dist[sx][sy] = 0
    while q:
        p = q.popleft()
        # if p[0] == gx and p[1] == gy:
        #     break
        for i in range(4):
            nx = p[0] + dx[i]
            ny = p[1] + dy[i]
            if 0 <= nx and nx < H and 0 <= ny and ny < W:
                if c[nx][ny] != '#' and dist[nx][ny] == INF:
                    q.append([nx, ny])
                    dist[nx][ny] = dist[p[0]][p[1]] + 1
    ret = -1
    for i in range(H):
        ret = max(ret, max(dist[i]))
    return ret

ans = -1
for i in range(H):
    for j in range(W):
            sx, sy = i, j
            if c[sx][sy] == '#':
                continue
            ans = max(ans, bfs())
print(ans)

Measured memory_bytes: 46428
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ll a,b,c;
    cin>>a>>b>>c;
    if((a==b && b!=c) || (a==c && b!=c) || (b==c && a!=c))
        cout<<"Yes"<<endl;
    else cout<<"No"<<endl;

}


Measured memory_bytes: 256
<?php
  
fscanf(STDIN,"%d",$N);
$S=[];

$arr = array("M" => 0, "A" => 0, "R" => 0, "C" => 0, "H" => 0);

for($i=0;$i<$N;$i++){
  fscanf(STDIN,"%s",$S[$i]);
  if(preg_match("/[MARCH]/",$S[$i][0])){
    $arr[$S[$i][0]] ++ ;
  }
}

$S = array_unique($S);

$arr = array_filter($arr,"not_zero");
$arr = array_values($arr);

echo getSum($arr);

function getSum($arr){
  $sum = 0;
  for($i=0; $i<count($arr)-2;$i++){
    for($j=$i+1; $j < count($arr)-1; $j++){
      for($k=$j+1; $k < count($arr); $k++){
        $sum += $arr[$i] * $arr[$j] * $arr[$k];
      }
    }
  }
  return $sum;
}

function product($carry,$item){
  $carry *= $item;
  return $carry;
}

function combination($n, $r){
  if($n == $r){
    return 1;
  }
  else if($r == 0){
    return 1;
  }
  else if($r == 1){
    return $n;
  }
  else{
    return combination($n-1,$r-1)+combination($n-1,$r);
  }
}


function not_zero($var){
  return $var != 0;
}


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

#define eb emplace_back
#define ld long double
#define ll long long

using namespace std;

int main() {
#ifdef LOCAL
	freopen("input.txt", "r", stdin);
#endif
	ios::sync_with_stdio(0);
	cin.tie(0);
	ll d, t, s;
	cin >> d >> t >> s;
	cout << (t * s >= d ? "Yes\n" : "No\n");
}


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

int main()
{
    int S, s, m, h;
    
    cin >> S;
    h = S / 3600;
    m = (S - (3600 * h)) / 60;
    s = S - ((3600 * h) + (60 * m));
    cout << h << ":" << m << ":" << s << endl;
}


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

//'P''D'
void solve(std::string T)
{
    long long size = T.size();
    for (int i = 0; i < size; i++)
    {
        if (T[i] == '?' && T[i - 1] == 'P')
        {
            T.replace(i,1,"D");
        }
        else if (T[i] == '?' && T[i + 1] == 'D')
        {
            T.replace(i,1,"P");
        }
        else if (T[i] == '?' && T[i + 1] == '?')
        {
            T.replace(i, 2, "PD");
            i++;
        }
        else if (T[i] == '?')
        {
            T.replace(i,1,"D");
        }
    }
    cout << T << endl;
}

// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main()
{
    std::string T;
    std::cin >> T;
    solve(T);
    return 0;
}


Measured memory_bytes: 3860
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
     
#include "bits/stdc++.h"
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)
#define rep2(i,a,b) for(int i=(a);i<(b);++i)
#define rrep(i,n) for(int i=(n)-1;i>=0;--i)
#define rrep2(i,a,b) for(int i=(a)-1;i>=b;--i)
#define range(i,a,b,c) for(int i=a;							\
												 c>0?i<b:							\
												 i>b;								\
												 i+=c)
#define chmax(a, b) (a = (a) < (b) ? (b) : (a))
#define chmin(a, b) (a = (a) > (b) ? (b) : (a))
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define all(a) begin(a),end(a)
#define ifnot(a) if(not (a))
#define dump(x)  cerr << #x << " = " << (x) << endl
#define int long long
#ifdef _MSC_VER
const bool test = true;
#else 
const bool test = false;
#endif
     
int dx[] = { 1,0,-1,0 };
int dy[] = { 0,1,0,-1 };
const int INF = 1 << 28;
const ll INFL = (ll)1 << 58;
ll mod_n = (int)1e9 + 7;
const double eps = 1e-10;
typedef long double Real;
// return -1, 0, 1
int sgn(const Real& r) { return (r > eps) - (r < -eps); }
int sgn(const Real& a, const Real &b) { return sgn(a - b); }
     
//.....................
const int MAX = (int)2e5 + 5;
     
vector<string> split(const string &str, char sep) {
	vector<string> v;
	stringstream ss(str);
	string buffer;
	while (getline(ss, buffer, sep)) {
		v.push_back(buffer);
	}
	return v;
}
     
template<class InputIterator>
int sum(InputIterator begin, InputIterator end) {
	return accumulate(begin, end, 0ll);
}

void solve();

signed main() {
	cout << fixed << setprecision(20);
	solve();
	while(true) {
		char s[MAX];
		if (scanf("%s", s) == EOF) break;
		int n = strlen(s);
		for (int i = n - 1; i > -1; i--) {
			ungetc(s[i], stdin);
		}
		solve();
	}
	return 0;
}

string O, E;

void solve() {
	cin >> O >> E;
	rep(i, (int)O.size()) {
		cout << O[i];
		if (i < (int)E.size()) {
			cout << E[i];
		}
	}
	cout << endl;			
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define SZ(X) ((int)(X).size())
#define endl "\n";
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	// freopen("input.txt", "r", stdin);
	// freopen("output.txt", "w", stdout);
   int a,b,c,d;
   cin>>a>>b>>c>>d;
    int x = (a+d-1)/d ;//floor
    int y = (b+c-1)/b;
    if(x>=y) cout<<"Yes"; else cout<<"No";
   return 0;
}


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

// nest is never needed.
int main(){
  int x[3];
  string a,b;
  cin>>a>>b;
  for(int i=0;i<=2;i++){
    (a[i]==b[2-i])?x[i]=1:x[i]=0;
  }
  (x[0]==1&&x[1]==1&&x[2]==1)?cout<<"YES":cout<<"NO";
  return 0;
}


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


int main()
{
	long long n;
	cin>>n;
	long long ar[n];
	for(long long i=0;i<n;i++)
		cin>>ar[i];
	long long dp[n+1];
	
	dp[1]=0;
	dp[2]=abs(ar[1]-ar[0]);
	
	for(long long i=3;i<=n;i++)
		dp[i]=min(dp[i-2]+abs(ar[i-1]-ar[i-3]),dp[i-1]+abs(ar[i-1]-ar[i-2]));
	cout<<dp[n];
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ll a,b;
    while(1)
    {
        cin>>a>>b;
        if(a==0 && b==0) break;
        else
        {
                for(ll i=1; i<=a; i++)
            {
                  for(ll j=1; j<=b; j++)
                  {
                      if(i%2)
                      {
                          if(j%2) cout<<'#';
                          else    cout<<'.';
                      }
                      else
                      {
                          if(j%2) cout<<'.';
                          else    cout<<'#';
                      }
                  }
                  cout<<endl;
            }
            cout<<endl;
        }
    }
    return 0;
}



Measured memory_bytes: 3036
#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
#define what(x) cerr << #x << " is " << x << endl;
const int INF = 1 << 28;

// greatest common divisor
ll gcd(ll a, ll b) {
    if (a < b)
        return gcd(b, a);
    ll r;
    while ((r = a % b)) {
        a = b;
        b = r;
    }
    return b;
}

void divisors(ll n, set<ll> &m) {
    set<ll> div;
    for (ll i = 1; i <= sqrt(n); ++i) {
        if (n % i == 0) {
            m.insert(i);
            m.insert(n / i);
        }
    }
}

void divisors2(ll n, map<ll, ll> &m) {
    set<ll> div;
    for (ll i = 1; i <= sqrt(n); ++i) {
        if (n % i == 0) {
            m[i]++;
            if (i != n / i)
                m[n / i]++;
        }
    }
}

void divisors3(ll n, map<ll, ll> &m) {
    set<ll> div;
    for (auto it = m.begin(); it != m.end(); it = next(it)) {
        if (n % it->first == 0) {
            it->second++;
        }
    }
}

int main() {
    ll N;
    cin >> N;
    vl A(N);
    for (int i = 0; i < N; ++i) {
        cin >> A[i];
    }
    sort(A.begin(), A.end());
    map<ll, ll> m;
    divisors2(A[0], m);
    divisors2(A[1], m);
    for (int i = 2; i < N; ++i) {
        divisors3(A[i], m);
    }
    ll ret = 1;
    for (auto it = m.rbegin(); it != m.rend(); it++) {
        if (it->second >= N - 1) {
            ret = it->first;
            break;
        }
    }
    cout << ret << endl;
    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i = a; i < b; ++i)
#define all(c) c.begin(), c.end()
#define gmax(x,y) x=max(x,y)
#define gmin(x,y) x=min(x,y)
#define gadd(x,y) x=add(x,y)
#define gmul(x,y) x=mul(x,y)
using namespace std;

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

int main(){
	cin.tie(0);
	cout.tie(0);
	ios_base::sync_with_stdio(0);
	int ans = 100;
	int n;
	cin >> n;
	rep(i,0,n){
		int cnt = 0;
		int x;
		cin >> x;
		while(x%2 == 0){
			++cnt;
			x/=2;
		}
		gmin(ans,cnt);
	}
	cout << ans << '\n';
}


Measured memory_bytes: 256
h,w=map(int,input().split())
s=['.'*(w+2)]+['.'+input()+'.' for _ in [0]*h]+['.'*(w+2)]
a='Yes'
for i in range(1,h+1):
    for j in range(1,w+1):
        if s[i][j]=='#':
            if s[i-1][j]=='.' and s[i+1][j]=='.' and s[i][j-1]=='.' and s[i][j+1]=='.':a='No'
print(a)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i < (n); i++)
#define ALL(a) a.begin(), a.end()
#define RALL(a) a.rbegin(), a.rend()
using namespace std;
using ll = long long;
const ll MOD = 1000000007;
const ll INF = MOD * MOD;

int main() {

    string s;
    cin >> s;

    if(s[0] != s[1] && s[1] != s[2] && s[2] != s[0])
        cout << "Yes" << endl;
    else
        cout << "No" << endl;

    return 0;

}

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

int main(){
  string name1, name2;
  cin >> name1 >> name2;
  int cnt= 0;
  for(int i = 0; i < name1.size(); i++){
    if(name1[i]!=name2[i])cnt++;
  }
  cout << cnt << endl;
}

Measured memory_bytes: 3896
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <numeric>
#include <tuple>
#include <stack>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define print(s) cout << s << endl
typedef long long ll;
using namespace std;
ll mod = pow(10,9) + 7;
int ctoi(char c) {
	if (c >= '0' && c <= '9') {
		return c - '0';
	}
	return 0;
}
char upper(char c){
	return c-0x20;
}
char lower(char c){
	return c+0x20;
}
int main() {
	int k,s; cin >> k >> s;
	int count = 0;
	rep(i,k+1){
		rep(j,k+1){
			if (i+j <= s && s-(i+j) <= k){
				count++;
			}
		}
	}
	cout << count << endl;
}

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

int main(){

long double a,b,c,d=0,e=0;
cin>>a>>b>>c;

d=sqrt(a)+ sqrt(b);
e=sqrt(c);
if(c-a-b>0)
{

if(4*a*b< (c-a-b)*(c-a-b)) cout<<"Yes\n";

else cout<<"No\n";
}
else cout<<"No\n";
    return 0;
}
 

Measured memory_bytes: 3732