akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ProcessInfo = pair<string, int>;

class TinyRingBuffer {
private:
  ProcessInfo Q[100000];
  // int Q[100000];
  int head; // 先頭ポインタ
  int tail; // 末尾ポインタ
  int MAX;  // リングバッファの容量

public:
  TinyRingBuffer(int max) {
    // isEmpty が true の状態
    head = 0;
    tail = 0;
    // キューが空のときと満杯のときを区別するために tail -> head の間に1つ以上の空きを設ける
    MAX = max+1;
  }

  bool isEmpty() {
    return head == tail;
  }

  // ### 例
  // * n=5
  // * time=[150, 80, 200, 350, 20]
  // * MAX = n+1 = 6
  //
  // step0.
  //   head=0, tail=0
  // step1. enqueue(150)
  //   0 = (0+1)%6 --> 0 = 1 --> isFull() false
  //   head=0, tail=1, |150|
  // step2. enqueue(80)
  //   0 = (1+1)%6 --> 0 = 2 --> isFull() false
  //   head=0, tail=2, |150|80|
  // step3. enqueue(200)
  //   0 = (2+1)%6 --> 0 = 3 --> isFull() false
  //   head=0, tail=3, |150|80|200|
  // step4. enqueue(350)
  //   0 = (3+1)%6 --> 0 = 4 --> isFull() false
  //   head=0, tail=4, |150|80|200|350|
  // step5. enqueue(20)
  //   0 = (4+1)%6 --> 0 = 5 --> isFull() false
  //   head=0, tail=5, |150|80|200|350|20|
  // step6. enqueue(110)
  //   0 = (5+1)%6 --> 0 = 0 --> isFull() true となるため、オーバーフローする
  //
  bool isFull() {
    return head == (tail + 1) % MAX;
  }

  void enqueue(ProcessInfo p) {
    if (isFull()) { exit_failure("enqueue", "overflow"); }
    Q[tail] = p;
    if (tail+1 == MAX) { tail = 0; } else { tail++; }
  }

  ProcessInfo dequeue() {
    if (isEmpty()) { exit_failure("dequeue", "underflow"); }
    ProcessInfo p = Q[head];
    if (head+1 == MAX) { head = 0; } else { head++; }
    return p;
  }

private:
  void exit_failure(string method, string error) {
      cout << "TinyRingBuffer::" << method << ": " << error << " error" << endl;
      exit(EXIT_FAILURE);
  }
};

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

  TinyRingBuffer rb(n);
  for (int i = 0; i < n; i++)
  {
    string process;
    int time;
    cin >> process >> time;
    rb.enqueue(make_pair(process, time));
  }

  int total_time = 0;
  while (!rb.isEmpty()) {
    ProcessInfo process = rb.dequeue();

    int processed_time = min(q, process.second);
    process.second = process.second - processed_time;
    total_time += processed_time;

    if (process.second == 0) {
      cout << process.first << " " << total_time << endl;
    } else {
      rb.enqueue(process);
    }
  }
  return 0;
}



Measured memory_bytes: 7140
local n = io.read("*n")
local x, y = {}, {}
local xidx, yidx = {}, {}
for i = 1, n do
  x[i], y[i] = io.read("*n", "*n")
  xidx[i], yidx[i] = i, i
end
table.sort(xidx, function(a, b) return x[a] < x[b] end)
table.sort(yidx, function(a, b) return y[a] < y[b] end)
local edge = {}
for i = 1, n - 1 do
  local v1, v2 = xidx[i], xidx[i + 1]
  edge[i] = {v1, v2, x[v2] - x[v1]}
end
for i = 1, n - 1 do
  local v1, v2 = yidx[i], yidx[i + 1]
  edge[n - 1 + i] = {v1, v2, y[v2] - y[v1]}
end

local function uf_initialize(n)
  local parent = {}
  for i = 1, n do parent[i] = i end
  return parent
end

local function uf_findroot(idx, parent)
  local idx_update = idx
  while parent[idx] ~= idx do
    idx = parent[idx]
  end
  while parent[idx_update] ~= idx do
    parent[idx_update], idx_update = idx, parent[idx_update]
  end
  return idx
end

local function kruskal(n, line)
  table.sort(line, function(a, b) return a[3] < b[3] end)
  local parent = uf_initialize(n)
  local totalcost = 0
  local used = 0
  local linenum = #line
  for i = 1, linenum do
    local c, i1, i2 = line[i][3], line[i][1], line[i][2]
    local r1, r2 = uf_findroot(i1, parent), uf_findroot(i2, parent)
    parent[i1], parent[i2] = r1, r2
    if r1 ~= r2 then
      parent[r2] = r1
      parent[i2] = r1
      totalcost = totalcost + c
      used = used + 1
      if used == n - 1 then break end
    end
  end
  return totalcost
end

print(kruskal(n, edge))


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

int n;
string s;
int res;

int main()
{
    cin >> n;
    cin >> s;
    for (int i = 0; i + 3 <= n; i++)
        if (s[i] == 'A' && s[i + 1] == 'B' && s[i + 2] == 'C')
            res++;
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		String[] c = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
		String cc = sc.next();
		for(int i = 0;i < c.length-1;i++) {
			if(cc.equals(c[i])) {
				System.out.println(c[i+1]);
				break;
			}
		}
	}

}

Measured memory_bytes: 23252
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] a = new int[n];   //a_max = 10^9なのでぎりぎり入る
        for(int i=0;i<n;i++){
            a[i] = sc.nextInt();
        }
        int[][] count = new int[200001][2];
        for(int i=0;i<n;i++){
            if(i + 1 + a[i] < 200001) {
                count[i + 1 + a[i]][0]++;
            }
            if(i + 1 - a[i] >= 0){
                count[i + 1 - a[i]][1]++;
            }
        }

        long ans = 0;
        for (int[] ints : count) {
            ans += (long)ints[0] * (long)ints[1];
        }
        System.out.println(ans);
    }
}


Measured memory_bytes: 52136
//
#define _USE_MATH_DEFINES
#include <vector>
#include <set>
#include <array>
#include <iostream>
#include <cstdio>
#include <cstdint>
#include <algorithm>
#include <numeric>
#include <bitset>
//
using ll = long long;
using ld = long double;
using namespace std;
#define rep(i,n) for(ll i=0;i<(n);++i)
inline void yes(bool cond) { cond ? puts("Yes") : puts("No"); }
template<typename Type> inline void chmin(Type& a, Type b) { if (a > b) a = b; }
template<typename Type> inline void chmax(Type& a, Type b) { if (a < b) a = b; }
template<typename Type> inline void sort(Type& arr) { std::sort(arr.begin(), arr.end()); }
template<typename Type> inline Type nth(vector<Type>& arr, size_t pos) { std::nth_element(arr.begin(), arr.begin() + pos, arr.end()); return arr[pos]; }
#define BIGP   1000000007
#define INF_I  std::numeric_limits<ll>::max()
#define INF_F  std::numeric_limits<float>::infinity()
#define PI  3.1415926535
//
#include <iomanip>
int main()
{
    cin.tie(0); ios::sync_with_stdio(false);
    ll iA, iB, iH, iM;
    cin >> iA >> iB >> iH >> iM;
    ld A = ld(iA);
    ld B = ld(iB);
    ld H = ld(iH);
    ld M = ld(iM);

    
#if 0
    ld hd = ld(H / ld(12.0) + ld(M) / (ld(60.0)* ld(12.0))) *ld(2.0) * ld(M_PI);
    ld md = ld(M / ld(60.0)) * ld(2.0) * ld(M_PI);
    ld ax = ld(A) * cos(hd);
    ld ay = ld(A) * sin(hd);
    ld bx = ld(B) * cos(md);
    ld by = ld(B) * sin(md);
    ld dx = ax - bx;
    ld dy = ay - by;
    ld len = sqrtl(dx * dx + dy * dy);
    cout << std::setprecision(16) << len;
#else
    ld dt = (H / 12.0 + M / (60.0 * 12.0) - M / 60.0) * 2.0 * M_PI;
    ld R2 = A * A + B * B - 2.0 * A * B * cosl(dt);
    ld R = sqrtl(R2);
    cout << std::setprecision(16) << R;

#endif
    return 0;
}

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

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

    int r = (A+B) % 2;
    int h = (A+B-r) / 2;

    if (r) {
        cout << "IMPOSSIBLE";
    } else {
        cout << h;
    }
    cout << endl;

    return 0;
}



Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// ここにコードを挿入
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		String S = sc.next();
		String a = S.substring(K - 1);
		String b = a.toLowerCase();
		char c = b.charAt(0);
		String d = S.substring(K);
		String e = S.substring(0, K - 1);
		System.out.println(e + c + d);

	}

}

Measured memory_bytes: 20948
#include <iostream>
#include <fstream>
#include <typeinfo>
#include <vector>
#include <stack>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#include <random>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<57;
const double pi=acos(-1);
const double eps=1e-6;
const ll mod=1e9+7;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,-0};
const int DX[8]={-1,-1,-1,0,1,1,1,0},DY[8]={1,0,-1,-1,-1,0,1,1};

int n;
vl a;

ll f(int b){
	ll S=a[0],res=0;
	if(!b){
		if(S<=0){
			S=1;
			res=1-a[0];
		}
	}
	else{
		if(S>=0){
			S=-1;
			res=1+a[0];
		}
	}
	for(int i=1;i<n;i++){
		ll tmp=S+a[i];
		if(i%2==b){
			if(tmp>0) S=tmp;
			else{
				res+=1-tmp;
				S=1;
			}
		}
		else{
			if(tmp<0) S=tmp;
			else{
				res+=1+tmp;
				S=-1;
			}
		}
	}
	return res;
}

int main(){
	cin>>n;
	a=vl(n);
	for(int i=0;i<n;i++) cin>>a[i];
	cout<<min(f(0),f(1))<<endl;
}

Measured memory_bytes: 1024
#include <iostream>
#include <set>
#define rep(i, n) for(int i = 0; i < n; i++)
#define reps(i, s, n) for(int i = s; i < n; i++)

using namespace std;

int main(void) {
    int n;
    cin >> n;
    string w[n+1];
    rep(i, n) cin >> w[i+1];
    w[0] = string(1, w[1][0]);

    set<string> s;

    bool p = true;
    reps(i, 1, n+1) {
        if (s.count(w[i])) p = false;
        if (w[i][0] != w[i-1][w[i-1].size()-1]) p = false;
        s.insert(w[i]);
    }

    if (p) 
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}


Measured memory_bytes: 256
n,a,b,k=[int(i) for i in input().split()]
c=a+b
mod=998244353
ans=0

g1 = [1, 1]  # 元テーブル
g2 = [1, 1]  #逆元テーブル
inverse = [0, 1]  #逆元テーブル計算用テーブル

for i in range(2,300003):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

#以下のcom関数を用いて組み合わせを計算
def com(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

for i in range(n+1):
    if (k-b*i)%a==0 and k-b*i>=0:
        n_a=(k-b*i)//a
        n_b=i
        if  max(n_a, n_b) <=n:
            ans+=com(n, n_a, mod) * com(n, n_b, mod)  %mod

print(ans%mod)


Measured memory_bytes: 100336
#include<bits/stdc++.h>
// #include <boost/lexical_cast.hpp>
using namespace std;
#define ll long long int
#define vll vector<ll>
#define vllv vector<vector<ll>> 
#define sz size()
#define pb push_back
#define ff first
#define ss second
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

ll ceil1(ll n,ll m){if(n%m==0){return n/m;}return n/m +1;}
vll factor(ll n){
    vll ans;
    if(n>0)ans.pb(1);if(n==2)ans.pb(2);
    for(ll i=2;i*i<=n;i++){if(n%i==0){ans.pb(i);if(n/i!=i)ans.pb(n/i);}}if(n>2)ans.pb(n);
    return ans;
}
ll fact(ll n){
	
    ll res = 1; 
    for (ll i = 2; i <= n; i++) 
        res = res * i; 
    return res; 
} 
  
int nCr(ll n, ll r) 
{ 
    return fact(n) / (fact(r) * fact(n - r)); 
} 
  
void dfs(vllv &v,ll k,vll &par,vll &dis,ll p)
{
 
    par[k]=p;
    dis[k]=dis[p]+1;
    for(ll i=0;i<v[k].sz;i++){
        if(v[k][i]!=p){
            dfs(v,v[k][i],par,dis,k);
        }
    }
}
bool sortbysec(const pair<int,int> &a,const pair<int,int> &b){return (a.second<b.second);} 


ll ston(string s) 
{ 
    stringstream geek(s); 
    ll x = 0; 
    geek >> x; 
    
  
    return x; 
}
ll pow2(ll n,ll k){ll ans=1;
    while(k>0){
        if(k%2==1)ans=ans*n;n=n*n;k/=2;
    }return ans;}

void solve()
{
	ll n,k;
	cin>>n>>k;
	vll a(n+1,0);
	for(ll i=0;i<k;i++)
	{
		ll x;
		cin>>x;
		for(ll j=0;j<x;j++)
		{
			ll t;
			cin>>t;
			a[t]++;
		}
		
	}
	ll ans=0;
	for(ll i=1;i<=n;i++)
	{
		if(a[i]==0)
			ans++;
	}
	cout<<ans;
	return;
}

int main()
{
	fast;
    ll q;
    q=1;
    // cin>>q;
    while(q--)
    {
        solve();
    }
    return 0;
}

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

int main() {
  int a,b;
  cin >> a>>b;
  
  if(a==1){
    a=100;
  }
  if(b==1){
    b=100;
  }

  if(a>b){
    cout<<"Alice"<<endl;
  }
  if(a==b){
    cout<<"Draw"<<endl;
  }
  if(a<b){
    cout<<"Bob"<<endl;
  }
}


Measured memory_bytes: 256
import heapq
def dijkstra_heap(s,g):
    used = [True] * n #True:未確定
    used[s] = False
    edgelist = []
    for e in edge[s]:
        heapq.heappush(edgelist,[e[0],e[1]])
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        #まだ使われてない頂点の中から最小の距離のものを探す
        if not used[minedge[1]]:
            continue
        v = minedge[1]
        if v==g:
            return minedge[0]
        kai=minedge[0]
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,[kai+e[0],e[1]])                   
    return -1

################################
n,m = map(int,input().split()) #n:頂点数　w:辺の数

edge = [[] for i in range(n)]
#edge[i] : iから出る道の[重み,行先]の配列
l=[]
for i in range(m):
    x,y,z = map(int,input().split())
    edge[x-1].append([z,y-1])
    edge[y-1].append([z,x-1])
    l.append([x-1,y-1])
zeroedge=[0]*n
l.sort()
l.append([10**10,10**10+1])
i=0
nl=l[i][0]
r=l[i][1]
while i<m+1:
    if l[i][0]>r:
        for j in range(nl,r):
            edge[j+1].append([0,j])
        nl=l[i][0]
        r=l[i][1]
        i+=1
    else:
        r=max(r,l[i][1])
        i+=1       
print(dijkstra_heap(0,n-1))


Measured memory_bytes: 117152
#include <iostream>
#include <string>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <numeric>
#include <math.h>
#define MOD 1000000007

typedef long long ll;
using namespace std;

int main(void) {
    int N;
    cin >> N;
    int count = 0;
    int i=0;
    int j=0;
    int a[N];
    for(i=0;i<N;i++){
        a[i]=0;
    }
    for(i=19;i<=55555;i+=10){
        int c=0;
        for(j=2;j<=pow(i,0.5)+1.0;j++){
            if(i%j==0){
                c=1;//合成
                break;
            }
        }
        if(c){
            
        }else{
            a[count]=i;
            count++;
        }
        if(count==N){
            break;
        }
    }
    for(i=0;i<N;i++){
        printf("%d ",a[i]);
    }
    printf("\n");
    return 0;
}


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

int main(){
    long long Q, H, S, D;
    long long N;
    cin >> Q >> H >> S >> D;
    cin >> N;
    long long min2l = min({Q*8, H*4, S*2, D});
    long long min1l = min({Q*4, H*2, S});
    long long ans = 0;
    ans += min2l * (N / 2);
    if(N % 2 == 1) ans += min1l;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main() {
  int n;
  cin >> n;
  int t[100];
  for (int i = 0; i < n; i++)
    cin >> t[i];
  int m;
  cin >> m;
  int p[100], after_drink[100];
  for (int i = 0; i < m; i++) {
    cin >> p[i] >> after_drink[i];
    int tmp = t[p[i] - 1];
    t[p[i] - 1] = after_drink[i];
    int s = 0;
    for (int j = 0; j < n; j++)
      s += t[j];
    t[p[i] - 1] = tmp;
    cout << s << '\n';
  }
  return 0;
}


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

using namespace std;

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

    int n;
    cin >> n;
    vector<int> a(n);
    int mx = 0, mx2 = 0;
    for(auto&& i : a){
        cin >> i;
        if(mx < i){
            mx2 = mx;
            mx = i;
        }else if(mx2 < i){
            mx2 = i;
        }
    }
    for(auto&& i : a){
        if(mx == i){
            cout << mx2 << "\n";
        }else{
            cout << mx << "\n";
            
        }
    }
}

Measured memory_bytes: 2432
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main(void) {

	long long int X=0;

	int n500,n5;

	scanf("%lld",&X);

	n500 = X / 500;
	n5 = (X - n500 * 500) / 5;

	printf("%d", n500*1000+n5*5);

	return 0;
}



Measured memory_bytes: 128
#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
int main( void )
{
	map < string, vector <int> > index;
	string word;
	int page;
	while ( cin >> word >> page )
	{
		index[word].push_back( page );
	}

	for( map < string, vector <int> >::iterator it = index.begin(); it != index.end(); it++ )
	{
		cout << (*it).first << endl;
		vector <int>& pages = (*it).second;
		sort( pages.begin(), pages.end() );
		for ( vector <int>::iterator it_p = pages.begin(); it_p != pages.end(); it_p++ )
		{
			cout << *it_p;
			if ( it_p+1 != pages.end() )
				cout << " ";
		}
		cout << endl;
	}

	return 0;
}

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

const int MAXN = 212345;
const long long MOD = 1e9 + 7;

long long fat[MAXN];
long long ifat[MAXN];
long long inv[MAXN];

long long fexp (long long b, long long e) {
	long long ans = 1;
	while (e) {
		if (e & 1) ans = (ans * b) % MOD;
		b = (b * b) % MOD;
		e >>= 1LL;
	}

	return ans;
}

long long perm (long long x, long long y) {
	if (x < 0 || y < 0) return 0;
	long long ans = (ifat[x] * ifat[y]) % MOD;
	ans = (ans * fat[x + y]) % MOD;
	return ans;
}

int main () {

	fat[0] = 1; ifat[0] = 1;
	for (long long i = 1; i < MAXN; ++i) {
		fat[i] = (fat[i - 1] * i) % MOD;
		ifat[i] = fexp (fat[i], MOD - 2);
	}

	long long h, w, a, b;
	cin >> h >> w >> a >> b;

	long long ans = 0;
	for (int i = 0; i < h - a; ++i)
		ans += (perm (b, i) * perm (w - b - ((i == h - a - 1) ? 1 : 2), h - i - 1)) % MOD;

	cout << ans % MOD << endl;

	return 0;
}

Measured memory_bytes: 3584
import java.util.*;

class Main {
    static int findSumOfigits(int n) {
        int sum = 0;
        while (n > 0) {
            sum += n % 10;
            n /= 10;
        }
        return sum;
    }

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

        int N = stdin.nextInt();
        int A = stdin.nextInt();
        int B = stdin.nextInt();
        int sumAB = 0;
        int lShift = 0;
        int sumD = 0;

        for (int n = 1; n <= N; n++) {
            sumD = findSumOfigits(n);
            if (sumD >= A && sumD <= B) {
                sumAB += n;
            }
        }
        System.out.println(sumAB);
    }
}


Measured memory_bytes: 23764
// freopen("input.txt", "rt", stdin);
// freopen("output.txt", "wt", stdout);
//#define _GLIBCXX_DEBUG//only for debugging
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include <ext/rope>
#define VALHALLA cin.tie(0)->ios_base::sync_with_stdio(false);cout<<fixed<<setprecision(13);
#define endl "\n"
#define pb push_back
#define all(v) v.begin(),v.end()
#define debug(x) std::cerr << #x << ": " << (x) << '\n';
#define sz(x) (int)x.size()
#define fast(map_name) map_name.reserve(1024);map_name.max_load_factor(0.25);
using namespace std;
using namespace __gnu_cxx;
typedef long long int ll;
typedef pair<int,int> ii;
typedef complex<double> point;
const double epsilon=1e-9;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int mod=1e9+7;
/* VARIABLE DECLARATION START */
ll dp[3000][51][51];
int arr[100];
/*  FUCNTION TEMPLATE STARTS  HERE */

double dot(point a,point b){ return (conj(a)*b).real() ; }
double cross(point a,point b){ return (conj(a)*b).imag() ; }
double dist(point a, point b){ return abs(a-b); }
struct neal {
static uint64_t splitmix64(uint64_t x)
 {
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
}
size_t operator()(uint64_t x) const
 {
    static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
}
};
struct HASH{
  size_t operator()(const pair<int,int>&x)const{
    return (size_t) x.first * 37U + (size_t) x.second;
  }
};
bool isprime(ll n) {
    if (n == 2 || n == 3) return true;
    if (n < 2 || n % 2 == 0 || n % 3 == 0) return false;
    for (ll i = 6; (i - 1) * (i - 1) <= n; i += 6) {
        if (n % (i - 1) == 0 || n % (i + 1) == 0) {
            return false;
        }
    }
    return true;
}
inline ll exp(ll a, ll b, ll mod) {
    ll n = 1;
    ll p = a;
    while (b > 0) {
        if (b % 2 == 1) {
            n *= p;
            n %= mod;
        }
        p *= p;
        p %= mod;
        b /= 2;
    }
    return n;
}

inline bool comp(double a,double b)
{
  return (fabs(a-b)<epsilon);
}
ll gcd(ll u, ll v) {
  ll r;
  while (0 != v) {
    r = u % v; u = v; v = r;
  }
  return u;
}
ll solve(int sum,int index,int cnt)
{
  if(sum<0||cnt<0)return 0;
  if(index<0)
  {
    if(sum==0&&cnt==0)return 1;
    else
      return 0;
  }
  if(dp[sum][index][cnt]!=-1)return dp[sum][index][cnt];
  ll ans=0;
  ans=solve(sum-arr[index],index-1,cnt-1)+solve(sum,index-1,cnt);
  return dp[sum][index][cnt]=ans;
}

/*  FUCNTION TEMPLATE ENDS HERE */
int main()
{
   VALHALLA
   int n,a;
   cin>>n>>a;
   for(int i=0;i<n;++i)cin>>arr[i];
    ll ans=0;
   for(int i=1;i<=n;++i)
   {
    memset(dp,-1,sizeof(dp));
    ans+=(solve(i*a,n-1,i));
   }
   cout<<ans<<endl;
}

Measured memory_bytes: 61184
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <queue>
#include <stack>
#include <cstring>
#include <string>
#include <list>
#include <bitset>

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;

const LL mod=1e9+7;
const double PI=acos(-1);
const double EPS=1e-6;
const int INF=0x3f3f3f3f;
inline int readint(){int sum=0;char c=getchar();bool f=0;while(c<'0'||c>'9'){if(c=='-') f=1;c=getchar();}while(c>='0'&&c<='9'){sum=sum*10+c-'0';c=getchar();}if(f) return -sum;return sum;}
inline LL readLL(){LL sum=0;char c=getchar();bool f=0;while(c<'0'||c>'9'){if(c=='-') f=1;c=getchar();}while(c>='0'&&c<='9'){sum=sum*10+c-'0';c=getchar();}if(f) return -sum;return sum;}

const int maxn=3005;
LL inv[maxn],p[maxn];
void CNumberInit(int MAXNUM,LL mod){
    inv[0]=inv[1]=p[0]=p[1]=1;
    for(int i=2;i<=MAXNUM;i++){
        inv[i]=(mod-mod/i)*inv[mod%i]%mod;
    	p[i]=p[i-1]*i%mod;
    }
    for(int i=2;i<=MAXNUM;i++) inv[i]=inv[i-1]*inv[i]%mod;
}


LL qmod(LL a,LL b,LL c){
    LL ret=1;
    for(;b;b>>=1){
        if(b&1) ret=ret*a%c;
        a=a*a%c;
    }
    return ret;
}

char s[2][1005];

int main(){//ios_base::sync_with_stdio(0);cin.tie(0);
    int n=readint();
    scanf("%s%s",s[0],s[1]);

    if(n==1){
        printf("3\n");return 0;
    }
    int type=(s[0][0]==s[0][1]? 2:1);
    LL ans=(s[0][0]==s[0][1]? 6:3);
    for(int i=1;i<n;i++){
        if(s[0][i]==s[0][i-1]){
            type=2;
            continue;
        }
        if(s[0][i]!=s[0][i+1]){
            if(type==1){
                ans=ans*2%mod;
            }
            type=1;
        }else{
            if(type==1){
                ans=ans*2%mod;
            }else{
                ans=ans*3%mod;
            }
            type=2;
        }
    }
    printf("%lld\n",ans);
    return 0;
}

//cout.setf(ios::fixed);
//cout<<fixed<<setprecision(10)<<s<<endl;


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

int main() {
    int N, Q;
    string S;
    cin >> N >> Q >> S;
    vector<char> t(Q), d(Q);
    rep(i, 0, Q) cin >> t[i] >> d[i];
    auto side = [&](int x) {
        rep(i, 0, Q) if(S[x] == t[i]) {
            if(d[i] == 'L') x--;
            else x++;
            if(x == -1) return -1;
            else if(x == N) return 1;
        }
        return 0;
    };
    int l = -1, r = N;
    while(r - l > 1) {
        int mid = (l + r) / 2;
        if(side(mid) == -1) l = mid;
        else r = mid;
    }
    int left = l;
    l = -1, r = N;
    while(r - l > 1) {
        int mid = (l + r) / 2;
        if(side(mid) == 1) r = mid;
        else l = mid;
    }
    int right = r;
    cout << right - left - 1 << endl;
    return 0;
}


Measured memory_bytes: 900
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define se second
#define fi first
#define ll long long
#define INF INT_MAX
#define mod 1000000007
#define chutiyaap ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
int main()
{
	char x;cin>>x;
	if(x>='a'&&x<='z')cout<<'a';
	else cout<<'A';
}


Measured memory_bytes: 3588
def bills(n, y):
    for bills_10k in range(n + 1):
        for bills_5k in range(n - bills_10k + 1):
            bills_1k = n - bills_10k - bills_5k
            if y == bills_10k * 10000 + bills_5k * 5000 + bills_1k * 1000:
                return [bills_10k, bills_5k, bills_1k]
    return [-1, -1, -1]

if __name__ == '__main__':
    n, y = map(int, input().split())
    print(' '.join(map(str, bills(n, y))))

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

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

int main()
{
  int N;
  cin >> N;
  vector<int> s;
  int ans = 0;
  rep(i, N)
    {
      int tmp;
      cin >> tmp;
      s.push_back(tmp);
      ans+=tmp;
    }
  sort(s.begin(), s.end());
  if(ans % 10 != 0)
    {
      cout << ans << endl;
      return 0;
    }
  rep(i, N)
    {
      if((ans - s[i])%10 != 0)
	{
	  cout << ans-s[i] << endl;
	  return 0;
	}
    }
  cout << "0" << endl;
  
  return 0;
}


Measured memory_bytes: 256
x = int(input())
ans = 0
#for i in range(1,x+1):
#    for j in range(1,x+1):
#        if i % j == 0:
#            ans += i
for i in range(1,x+1):
    num = x // i
    ans += num*(num+1)/2*i
print(int(ans))

Measured memory_bytes: 9140
#include <iostream>
using namespace std;
int main(int argc, char** argv) {
	string a;
	cin >> a;
	int n=a.size();
	a='0'+a;
	for(int i=0;i<=n;i++)
	{
		if(a[i]^a[n-i])
		{
			puts("-1");
			return 0;
		}
	}
	if(a[1]=='0')
	{
		puts("-1");
		return 0;
	}
	int cnt=1,rt=1;
	for(int i=1;i<=n/2;i++)
	{
		if(a[i]=='0') cout << rt << " " << cnt+1 << "\n";
		else
		{
			cout << rt << ' ' << cnt+1 << "\n";
			rt=cnt+1;
		}
		++cnt;
	}
	for(int i=n/2+1;i<n;i++)
	{ 
		++cnt;
		cout << rt << " " << cnt << "\n";
	}
	return 0;
}

Measured memory_bytes: 1536
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <utility>
#include <algorithm>
#include <functional>
#include <numeric>
#include <list> 

using namespace std;
using ll = long long;
#define FOR(i,a,b) for(int i=int(a);i<int(b);i++)
#define REP(i,b) FOR(i,0,b)
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define ALL(x) x.begin(),x.end()
#define INF (1e9)

#define CAPITAL
void Yes(bool ex=true){
	#ifdef CAPITAL
	cout<<"YES"<<endl;
	#else
	cout<<"Yes"<<endl;
	#endif
	if(ex)exit(0);
}
void No(bool ex=true){
	#ifdef CAPITAL
	cout<<"NO"<<endl;
	#else
	cout<<"No"<<endl;
	#endif
	if(ex)exit(0);
}

long long dp(int l ,ll x, vector<ll> vi,  vector<ll> ci) {
    if (x <= 0) return 0;
    if (l == 0) return 1;
    if (vi[l - 1] + 1 >= x) {
        return dp(l - 1, x - 1, vi, ci);
    } else {
        return 1 + ci[l - 1] + dp(l - 1, x - 2 - vi[l-1], vi, ci);
    }
    return 0;
}
int main() {
	int x, y;
	cin >> x >> y;
    printf("%d", x + y / 2);
}

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

int main(void){
    int N;
    cin >> N;
    if(N>=400 && N<=599)
        cout << 8 << endl;
    else if(N>=600 && N<=799)
        cout << 7 << endl;
    else if(N>=800 && N<=999)
        cout << 6 << endl;
    else if(N>=1000 && N<=1199)
        cout << 5 << endl;
    else if(N>=1200 && N<=1399)
        cout << 4 << endl;
    else if(N>=1400 && N<=1599)
        cout << 3 << endl;
    else if(N>=1600 && N<=1799)
        cout << 2 << endl;
    else if(N>=1800 && N<=1999)
        cout << 1 << endl;
    return 0;
}

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

#define ll long long
#define fornum(A,B,C) for(A=B;A<C;A++)
#define mp make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>

using namespace std;

/////////////////////////////////////////////////////
ll N,D[101010];
ll i,j,ans;
int main(){
    scanf("%lld", &N);
    fornum(i,0,N){
        scanf("%lld", &D[i]);
    }
    sort(D, D + N);

    printf("%lld", D[N / 2] - D[N / 2-1]);
    return 0;
}

Measured memory_bytes: 1024
#include "bits/stdc++.h"
using namespace std;
const int MOD = 1e9 + 7;
typedef long long lint;
const int INF =1e7;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define trep(i, k, n) for (int i = (k); i < (int)(n); ++i)
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
int main(){
    int n;
    int a,b;
    cin >> n >> a >> b;
    int cc = b - a;
    if (cc%2==0){
        cout << "Alice" << endl;
    }else{
        cout<<"Borys"<<endl;
    }
        return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include<math.h>
#include <vector>
using namespace std;


int main(void){

	
	int n,count;
	

	while (cin >> n){
		vector <int> list(n+1, 0);

		for (int i = 2; i < n+1; i++){
			list[i] = i;
		}//???????????????????????°???????????????

		//??????????????§?¨???????????????????????????\??£???????????????????´???°?¢????
		for (int i = 2; i < sqrt(n)+1; i++){
			//??????????????\??£??????????´???°???????????????????????????
			if (list[i] == i){//0???????????¢?????§?????°???????????°????????§??????
				//?????????????????????????????§????????°????´???°??§??????
				//????????°????????°???0?????£??\??????
				for (int j = i * 2; j < n+1; j += i){
					list[j] = 0;
				}					
			}
			
				
			}

		count = 0;
		for (int i = 2; i < n+1; i++){
		
			if (list[i] == i){ count++; }

		}cout << count << endl;
		
		
		}//while?????????



	return 0;
}

Measured memory_bytes: 5356
#include <iostream>
#include <algorithm>
#include <array>
#include <cstdint>
#include <functional>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string>
#include <utility>
#include <vector>
 
#define INF 1000000000
#define MOD 1000000007
#define rep(i,a,b) for(uint32 i = (a); i < (b); ++i)
#define bitget(a,b) (((a) >> (b)) & 1)
#define ALL(x) (x).begin(),(x).end()
#define C(x) std::cout << #x << " : " << x << std::endl
#define scanf scanf_s
 
using int32 = std::int_fast32_t;
using int64 = std::int_fast64_t;
using uint32 = std::uint_fast32_t;
using uint64 = std::uint_fast64_t;
 
 
 
int main(void) {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	std::string s;
	std::cin >> s;
	uint32 f = 0;
	rep(i, 0, s.length()) {
		if (f) {
			if (s[i] == 'F') {
				std::cout << "Yes\n";
				return 0;
			}
		}
		else {
			if (s[i] == 'C') {
				f = 1;
			}
		}
	}
	std::cout << "No\n";
	return 0;
}

Measured memory_bytes: 256
s = gets.chomp.split("")
cs = Hash.new(0)
cnt = 0
flag = 1

s.each do |c|
  cs[c] += 1
end

cs.each do |k,v|
  if v != 2
    flag = 0
    break
  end
  cnt += 1
end

if cnt == 2 && flag == 1
  puts "Yes"
else
  puts "No"
end

Measured memory_bytes: 1788
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;
struct A
{
	int x, y;
	uint32_t h;
};

int main()
{
	uint32_t n;
	vector<A> data;
	cin >> n;
	for (uint32_t i = 0; i < n; i++)
	{
		A tmp;
		cin >> tmp.x >> tmp.y >> tmp.h;
		data.push_back(tmp);
	}
	bool found = false;
	A ans = {};
	for (int x = 0; x <= 100; x++)
	{
		for (int y = 0; y <= 100; y++)
		{
			uint32_t h = 0;
			for (uint32_t i = 0; i < n; i++)
			{
				if (data[i].h == 0) continue;
				h = abs(x - data[i].x) + abs(y - data[i].y) + data[i].h;
				break;
			}
			found = true;
			for (uint32_t i = 0; i < n; i++)
			{
				if (max((int64_t)h - abs(x - data[i].x) - abs(y - data[i].y), (int64_t)0) != data[i].h)
				{
					found = false;
					break;
				}
			}
			if (found)
			{
				ans.x = x;
				ans.y = y;
				ans.h = h;
				break;
			}
		}
		if (found) break;
	}
	cout << ans.x << " " << ans.y << " " << ans.h << endl;
	return 0;
}

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

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

  ll ans=0;

  for (ll i=1; i*i<n; i++) {
    if ((n-i)%i==0 && i<(n-i)/i) {
      ans+=(n-i)/i;
    }
  }
  
  cout <<ans<< endl;
  return 0;
}

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

public class Log
{
    public int id { get; set; }
    public int ts { get; set; }
    public int te { get; set; }
}
public class Hello
{
    public static void Main()
    {
        while (true)
        {
            var logs = new List<Log>();
            string[] line = Console.ReadLine().Trim().Split(' ');
            var n = int.Parse(line[0]);  //pc
            var m = int.Parse(line[1]);  //student
            var a = new int[m + 1, n + 1];
            if (n == 0 && m == 0) break;
            var r = int.Parse(Console.ReadLine().Trim());
            for (int i = 0; i < r; i++)
            {
                string[] line2 = Console.ReadLine().Trim().Split(' ');
                var t1 = int.Parse(line2[0]);  //time
                var t2 = int.Parse(line2[1]);  // pc
                var t3 = int.Parse(line2[2]);  // student
                var t4 = int.Parse(line2[3]);  // 1:login  0:logout
                if (t4 == 1) a[t3, t2] = t1;
                else logs.Add(new Log { id = t3, ts = a[t3, t2], te = t1 });
            }
            var q = int.Parse(Console.ReadLine().Trim());
            for (int i = 0; i < q; i++)
            {
                string[] line3 = Console.ReadLine().Trim().Split(' ');
                var t5 = int.Parse(line3[0]);
                var t6 = int.Parse(line3[1]);
                var t7 = int.Parse(line3[2]);
                var ret = getTime(logs, t5, t6, t7);
                Console.WriteLine(ret);
            }
        }
    }
    public static int getTime(List<Log> a, int ts, int te, int m)
    {
        var t = new int[te - ts + 1];
        var tL = t.Length;
        var b = a.Where(x => x.id == m).Where(x => x.ts <= te && x.te >= ts);
        foreach (var x in b)
        {
            var nts = x.ts - ts;
            var nte = x.te - ts;
            if (nts < 0) t[0] += 1;
            else t[nts] += 1;
            if (nte <= tL - 2) t[nte] -= 1;
        }
        var wk = new int[tL];
        var count = 0;
        for (int i = 0; i < tL - 1; i++)
        {
            wk[i + 1] = wk[i] + t[i];
            if (wk[i + 1] > 0) count++;
        }
        return count;
    }
}

Measured memory_bytes: 62128
import sys
from collections import Counter

N = int(input())
A = list(map(int, sys.stdin.readline().rsplit()))
C = Counter(A)
s = []
dp = [True] * (10 ** 6 + 1)

for a, b in C.items():
    if b == 1:
        s.append(a) 

a = set(A)
for ss in a:
    for m in range(2 * ss, 10 ** 6 + 1, ss):
        dp[m] = False

res = 0
for ss in s:
    if dp[ss] is True:
        res += 1

print(res)


Measured memory_bytes: 54768
n, a, b = map(int, input().split())
extra_damage = a - b
h = [int(input()) for i in range(n)]
# h.sort()
INF = sum(h)
l = 0
r = INF


def widespread(bomb):
    base = b * bomb
    for hi in h:
        if hi - base > 0:
            bomb -= (hi - base + extra_damage - 1) // extra_damage
    return bomb >= 0

while l+1 < r:
    m = (l+r)//2
    if widespread(m):
        r = m
    else:
        l = m
print(r)


Measured memory_bytes: 7076
#include <bits/stdc++.h>
#include <string>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
using Graph = vector<vector<int>>;
const int INF = 1001001001;


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

    vector<int> A(N);
    REP(i,N) cin >> A[i];

    int Fl = 0;

    REP(i, N){
        if(A[i] % 2 == 0) {
            if (A[i] % 3 == 0 || A[i] % 5 == 0) {
                continue;
            } else {
                Fl++;
            }
        }
    }

    if(Fl == 0) {
        cout << "APPROVED" << endl;
    } else {
        cout << "DENIED" << endl;
    }

    return 0;
  
}


Measured memory_bytes: 256
def add(a, w, d)
  while a <= d.size - 1
    d[a] += w
    a += a & -a
  end
end

def sum(i, d)
  ret = 0
  x = i
  while x > 0
    ret += d[x]
    x -= x & -x
  end
  return ret
end


def calc_area(p, x, y)
  i, j = p.split.map(&:to_i)
  return (x[i+1] - x[i])*(y[j+1] - y[j])
end

n = gets.to_i

r = []
x = {}
y = {}
n.times{|i|
  r[i] = gets.split.map(&:to_i)
  x[r[i][0]]=1
  y[r[i][1]]=1
  x[r[i][2]]=1
  y[r[i][3]]=1
}

sx = x.keys.sort
xi = {}
sx.each_with_index{|v, i|
  xi[v] = i
}
sy = y.keys.sort
yi = {}
sy.each_with_index{|v, i|
  yi[v] = i
}

d = Array.new(sx.size){Array.new(sy.size+1){0}}

n.times{|i|
  xi[r[i][0]].upto(xi[r[i][2]]-1){|j|
    add(yi[r[i][1]]+1,  1, d[j])
    add(yi[r[i][3]]+1, -1, d[j])
  }
}

sum = 0
(sx.size-1).times{|i|
  (sy.size-1).times{|j|
    sum += (sx[i+1]-sx[i])*(sy[j+1]-sy[j]) if sum(j+1,d[i]) > 0
  }
}
p sum

Measured memory_bytes: 135156
import sys
from collections import Counter,defaultdict

N=input()
A=map(int, sys.stdin.readline().split())
C=defaultdict(lambda: 0)
for x in A:
    C[x]+=1
total=0

for x in C.values():
    total+=x*(x-1)/2

for a in A:
    n=C[a]
    print total-n*(n-1)/2+(n-1)*(n-2)/2


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

#A1 ~ Aiまでの和 O(logN)
def BIT_query(idx):
    res_sum = 0
    while idx > 0:
        res_sum += BIT[idx]
        idx -= idx&(-idx)
    return res_sum

#Ai += x O(logN)
def BIT_update(idx,x):
    while idx <= n:
        BIT[idx] += x
        idx += (idx&(-idx))
    return


BIT = [0]*(n+1)
for i,e in enumerate(a):
   BIT_update(i+1,e)
ans1=0
for i in range(1,n+1):
    SUM=BIT_query(i)
    if i%2==1:
        if SUM<=0:
            ans1+=1-SUM
            BIT_update(i,1-SUM)
    else:
        if SUM>=0:
            ans1+=1+SUM
            BIT_update(i,-1-SUM)


BIT = [0]*(n+1)
for i,e in enumerate(a):
    BIT_update(i+1,e)
ans2=0
for i in range(1,n+1):
    SUM=BIT_query(i)
    if i%2==0:
        if SUM<=0:
            ans2+=1-SUM
            BIT_update(i,1-SUM)
    else:
        if SUM>=0:
            ans2+=1+SUM
            BIT_update(i,-1-SUM)

print(min(ans1,ans2))

Measured memory_bytes: 64724
#include <bits/stdc++.h>
#pragma GCC optimize(3, "Ofast")
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
inline int read() {
    int s = 0, w = 1;
    char ch = getchar();
    while (ch < '0' || ch>'9') { if (ch == '-')w = -1; ch = getchar(); }
    while (ch >= '0' && ch <= '9') s = s * 10 + ch - '0', ch = getchar();
    return s * w;
}
#define f(i, l, r) for (int i = l; i <= r; ++i)
#define rf(i, r, l) for (int i = r; i >= l; --i)
#define all(x) (x).begin(), (x).end()
#define l l
#define r r
#define lch (o << 1)
#define rch (o << 1 | 1)
#define mid ((l + r) >> 1)
#define mem(x, y) memset(x, y, sizeof(x))
#define mod1(x) ((x >= mod) && (x -= mod))
#define mod2(x) ((x < 0) && (x += mod))

const int inf = 2e9 + 7;
//const ll INF = INT64_MAX;
double eps = 1e-6;
const int mod = 998244353;
const int N = 2e5 + 10;
const double pi = acos(-1.0);
ll power(ll a, ll b) { ll res = 1; while (b) { if (b & 1)res = res * a % mod; a = a * a % mod; b >>= 1; }return res; }
ll gcd(ll a, ll b) { return !b ? a : gcd(b, a % b); }
void add(ll& a, ll b) { a += b; mod1(a); mod2(a); }
/*int len, C[N], clen;
int id(int v) { return lower_bound(C + 1, C + len, v) - C; }
void initC() { sort(C + 1, C + clen); len = unique(C + 1, C + 1 + clen) - C - 1; }*/



int main() {
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#ifdef local
    freopen("in.txt", "r", stdin);
    int start = clock();
#endif
    ll d, t, s; cin >> d >> t >> s;
    if (d <= t * s)cout << "Yes"; else cout << "No";


#ifdef local
    int end = clock();
    //cout << '\n' << end - start << "ms";
#endif* /
}

Measured memory_bytes: 3648
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <iomanip>

using namespace std;

int main(){
   int N;
   cin >> N;
   int A[N];
   map<int,int> cnt;
   long long ans =0;
   for(int i=1;i<=N;i++){
      cin >> A[i];
      ans += cnt[i-A[i]];
      cnt[A[i]+i]++;
   }
   cout << ans << endl;
   return 0;
}


Measured memory_bytes: 21440
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n, k, ans = 0;
  cin >> n >> k;
  while(n--)
  {
    int v;
    cin >> v;
    if(v >= k) ans++;
  }
  cout << ans << endl;
  return 0;
}

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

#define int long long

const int INF = 0x7f7f7f7f;

int n,m;
char a[105][105];
int ans,f[105][105];

void bfs()
{
	memset(f,INF,sizeof(f));
	f[1][1] = (a[1][1]=='#');
	queue<pair<int,int> > q;
	q.push(make_pair(1,1));
	while(!q.empty())
	{
		int x=q.front().first,y=q.front().second;
		q.pop();
		int tx,ty;
		tx = x+1, ty = y;
		if(tx<=n && f[x][y]+(a[tx][ty]=='#' && a[x][y]=='.')<f[tx][ty])
		{
			f[tx][ty] = f[x][y]+(a[tx][ty]=='#' && a[x][y]=='.');
			q.push(make_pair(tx,ty));
		}
		tx = x, ty = y+1;
		if(ty<=m && f[x][y]+(a[tx][ty]=='#' && a[x][y]=='.')<f[tx][ty])
		{
			f[tx][ty] = f[x][y]+(a[tx][ty]=='#' && a[x][y]=='.');
			q.push(make_pair(tx,ty));
		}
	}
}

signed main()
{
	cin>>n>>m;
	for(int i=1;i<=n;i++)
		for(int j=1;j<=m;j++)
			cin>>a[i][j];
	bfs();
	cout<<f[n][m]<<endl;
	
	return 0;
}

Measured memory_bytes: 384
// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools

#include <bits/stdc++.h>

using namespace std;

using i64 = long long;

const i64 MOD = 1e9 + 7;
const i64 INF = i64(1e18) + 7;


template <typename T>
bool chmin(T& x, T y){
    if(x > y){
        x = y;
        return true;
    }
    return false;
}

template <typename T>
bool chmax(T& x, T y){
    if(x < y){
        x = y;
        return true;
    }
    return false;
}


void solve(long long n, long long x, long long y){
    --x, --y;
    vector<vector<int>> dist(n, vector<int>(n, MOD));
    int ori = 0;
    queue<int> que;
    function<void(int)> f = [&](int xx){
        if(xx == x && chmin(dist[ori][y], dist[ori][x] + 1))
            que.emplace(y);
        if(xx && chmin(dist[ori][xx - 1], dist[ori][xx] + 1))
            que.emplace(xx - 1);
        if(xx != n - 1 && chmin(dist[ori][xx + 1], dist[ori][xx] + 1))
            que.emplace(xx + 1);
    };
    for(int i = 0; i < n; ++i){
        ori = i;
        dist[i][i] = 0;
        que.emplace(i);
        while(!que.empty()){
            int p = que.front();
            f(p);
            que.pop();
        }
    }
    vector<int> c(n + 1, 0);
    for(int i = 0; i < n; ++i)
        for(int j = i + 1; j < n; ++j)
            ++c[dist[i][j]];

    for(int i = 1; i < n; ++i)
        cout << c[i] << endl;
}


signed main(){
    long long N;
    scanf("%lld",&N);
    long long X;
    scanf("%lld",&X);
    long long Y;
    scanf("%lld",&Y);
    solve(N, X, Y);
    return 0;
}


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

int n,s;
int dp[350][1024];

int rec(int k,int sum,int u){
  int res = 0;
  if(k==0 && sum==0)return 1;
  if(dp[sum][u] >= 0)return dp[sum][u];
  if(k==0)return 0; 

  for(int i=0;i<10;i++){
    if(u>>i &1){
      if(sum-k*i>=0)res += rec(k-1,sum - k*i,u - (1<<i));
    }
  }
  dp[sum][u] = res;
  return res;
}


int main(){
  for(int i=0;i<350;i++){
    for(int j=0;j<1024;j++)dp[i][j] = -1;
  }
  while(cin >> n >> s){
    if(s>330)cout << 0 << endl;
    else{
      int up = 0;
      for(int i=0;i<n;i++)up += i*(i+1);
      for(int i=0;i<350;i++){
	for(int j=0;j<1024;j++)dp[i][j] = -1;
      }
      cout << rec(n,s,1023) << endl;
    }
  }
}

Measured memory_bytes: 0
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;

int zahyo[16][16];

int main(){
  int x,y,a,b,c;
  while(1){
    memset(zahyo,-1,sizeof(int)*16*16);
    for(int i=0;i<16;i++){ zahyo[i][0]=1; zahyo[0][i]=1;}
  scanf("%d%d",&x,&y);
  if(x==0&&y==0) return 0;
  scanf("%d",&c);
  for(int i=0;i<c;i++){
    scanf("%d%d",&a,&b);
    zahyo[a-1][b-1]=0;
   if(b==1){for(int j=a-1;j<16;j++) zahyo[j][0]=0;}
   if(a==1){for(int j=b-1;j<16;j++) zahyo[0][j]=0;}
  }
  for(int i=0;i<x;i++){
    for(int j=0;j<y;j++){
      if(zahyo[i][j]==-1) zahyo[i][j]=zahyo[i-1][j]+zahyo[i][j-1];
    }
  }
  printf("%d\n",zahyo[x-1][y-1]);
  }
}

Measured memory_bytes: 0
#include <stdio.h>

int main(void){
    int r, g, b; 
    scanf("%d %d %d", &r, &g, &b);

    int v = 100*r + 10*g + b;

    if(v%4 == 0){
        printf("YES\n");
    }
    else{
        printf("NO");
    }
    
    return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define pb push_back
const int maxn=2e5+10;
const int mod=1e9+7;

ll k;

ll power(ll base,ll n)
{
    ll r=1;
    while(n)
    {
        if(n%2) r=r*base%k;
        base=base*base%k;
        n/=2;
    }
    return r;
}



int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin>>k;
    ll sum=0;
    int len=1;
    while(1)
    {
        sum+=power(10,len-1)*7;
        sum%=k;
        if(sum%k==0)
        {
            cout<<len<<'\n';
            return 0;
        }
        len++;
        if(len>1e6)
        {
            cout<<-1<<'\n';
            return 0;
        }
    }



}

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

struct mat{
  int row, col;
};

int m[101][101];
mat p[101];

int main(){
  int n;
  cin >> n;
  for(int i = 1; i <= n; i++) cin >> p[i].row >> p[i].col;
  for(int l = 2; l <= n; l++){
    for(int i = 1; i <= n - l + 1; i++){
      int j = i + l - 1;
      if(i == j) m[i][j] = 0;
      else{
	int minc = 1e9;
	for(int k = i; k < j; k++){
	  int x = m[i][k] + m[k+1][j] + p[i].row * p[k].col * p[j].col;
	  minc = minc < x ? minc : x;
	}
	m[i][j] = minc;
      }
    }
  }
  cout << m[1][n] << endl;
  return 0;
}



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

const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll 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 { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= 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 { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}
// combination mod prime
struct combination {
  vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
};

int main() {
  ll k;
  string s;
  cin >> k;
  cin >> s;
  ll length = s.size();
  combination c(length + k);
  mint ans = 0;
  rep(i, k+1) {
    mint cur = c(length+i-1, i);
    cur *= mint(25).pow(i);
    cur *= mint(26).pow(k-i);
    ans += cur;
  }
  cout << ans << '\n';
  return 0;
}

Measured memory_bytes: 35484
#include <iostream>
#include <map>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
int n ;
int cnt = 0;
void dfs(long long tmp,int f357)
{
    if(tmp > n)
        return;
    if(f357 == 07)
        cnt++;
    dfs(tmp * 10 + 3,f357 | 01);
    dfs(tmp * 10 + 5,f357 | 02);
    dfs(tmp * 10 + 7,f357 | 04);
}
int main()
{
    cin >> n;
    dfs(0,0);
    cout << cnt;
}


Measured memory_bytes: 256