akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<vector>
#include<map>
#include<set>
#include<unordered_map>
#include<algorithm>
#include<bitset>
#include<queue>
#include <math.h>
#define ll long long
#define ld long double
#define ull unsigned long long
#define boost ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);cout.precision(10);cout << fixed;
#define dbset(x) for(int i=0 ; i<x.size(); i++) cerr << x[i] << " "; cerr << endl;
#define inf 1000000007
#define INF 1000000000000000000LL
#define PI 3.14159265358979323846
#define mod 1000000007
#define mod1 1000696969
#define flusz fflush(stdout);
#define VI vector<int>
#define VPI vector < pair<int,int> >
#define PII pair<int, int>
#define PIII pair<pair<int,int>,int>
#define BIT bitset<N>
#define st first
#define nd second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define M (L+R)/2
#define endl '\n'
#define REP(x, y) for(int x = 0; x < (y); ++x)
#define FOR(x, y, z) for(int x = y; x <= (z); ++x)
#define FORR(x, y, z) for(int x = y; x >= (z); --x)
using namespace std;

template<class TH> void _dbg(const char *sdbg, TH h){cerr<<sdbg<<"="<<h<<"\n";}
template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) {
  while(*sdbg!=',')cerr<<*sdbg++;cerr<<"="<<h<<","; _dbg(sdbg+1, a...);
}
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)

#define int long long
const int N = 1000*1000 + 7;

int test;

int n,a,b,c,d;

string s;

int dp[N][3];

int dpRev[N][3];

void solve()
{
	cin >> n >> a >> b >> c >> d;

	cin >> s;

	s = '#' + s;

	dp[a][1] = 1;
	dp[b][2] = 1;

	FOR(i,a,n){
		if (s[i] == '#')
			continue;

		if (dp[i - 1][1] || dp[i - 2][1]){
			dp[i][1] = 1;
		}
	} 

	FOR(i,b,n){
		if (s[i] == '#')
			continue;

		if (dp[i - 1][2] || dp[i - 2][2]){
			dp[i][2] = 1;
		}
	} 

	dpRev[c][1] = 1;
	dpRev[d][2] = 1;

	FORR(i,n,1){
		if (s[i] == '#')
			continue;

		FOR(j,1,2){
			if (dpRev[i+1][j] || dpRev[i+2][j]){
				dpRev[i][j] = 1;
			}
		}
	}

	if (d > c){
		if (dp[d][2] && dp[c][1]){
			cout << "Yes";
			return;
		}
	}

	FOR(i,b,c){
		if (dp[i][2] && dpRev[i][2]){
			if (dp[i-1][1] && dpRev[i-1][1]){
				if (dp[i+1][1] && dpRev[i+1][1]){
					cout << "Yes";
					return;
				}
			}
		}
	}

	cout << "No";

    return;
}

int32_t main()
{
    boost

    test=1;

	for(int i=1; i <= test; i++){
        solve();
	}

    return 0;
}


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

#include <atcoder/all>

#ifdef LOCAL
#include <debug.hpp>
#else
#define debug(...) void()
#endif

using namespace std;
using namespace atcoder;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<int> a(n), b(m);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> b[i];
  }
  vector<int> c = convolution(a, b);
  for (int i = 0; i < n + m - 1; i++) {
    cout << c[i] << ' ';
  }
  cout << '\n';
  return 0;
}

Measured memory_bytes: 19016
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i=0; i<(int)n; i++)
#define REPR(i, n) for(int i=(int)n-1; i>=0; i--)
#define FOR(i, m, n) for(int i=(int)m; i<(int)n; i++)
#define FORR(i, m, n) for(int i=(int)m-1; i>=(int)n; i--)
#define ALL(x) (x).begin(), (x).end()
#define ASC(v) sort(ALL(v));
#define DESC(v) sort(ALL(v), greater<int>());
#define UNIQ(a) sort(ALL(a));(a).resize(unique(ALL(a)) - a.begin());
#define DEBUG(x) cout<<#x<<": "<<x<<"\n"
typedef long long ll;
const double PI = acos(-1);
ll lcm(ll a, ll b) { return a / __gcd(a, b) * b; }
bool isprime(int x){ int i; if(x<2)return 0; else if(x==2) return 1; if(x%2==0) return 0; for(i=3; i*i<=x; i+=2) if(x%i==0) return 0; return 1; }
int digsum(int n) { int r=0; while(n>0) { r+=n%10; n/=10; } return r; }
struct nya{ nya(){ cin.tie(0); ios::sync_with_stdio(false); } }nyan;

void solve() {
	int N, M;
	int WA[105000];
	bool AC[105000];
    cin >> N >> M;
    int WAnum = 0;
    int ACnum = 0;
    for(int i = 1; i <= N; i++) {
        WA[i] = 0;
        AC[i] = false;
    }
    while(M--) {
        int p;
        string S;
        cin >> p >> S;
        if(AC[p]) continue;
        if(S == "AC") {
            AC[p] = true;
            ACnum++;
            WAnum += WA[p];
        } else if(S == "WA") {
            WA[p]++;
        }
    }
    cout << ACnum << " " << WAnum << endl;
    return;
}
 
int main() {
    solve();
    return 0;
}


Measured memory_bytes: 768
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#define Max(a, b) ((a) > (b) ? (a) : (b))
#define Min(a, b) ((a) > (b) ? (b) : (a))
#define abs(x) ((x) > 0 ? (x) : -(x))
#define MOD 1000000007 //10^9 + 7
#define endl printf("\n")
typedef long long ll;
#define MAX_N (1 << 17)

bool sdp[5010][5010], gdp[5010][5010];

int
main(int argc, const char *argv[])
{
  int n, k, a[5010];
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);

  sdp[0][0] = true;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j <= k; j++) {
      sdp[i + 1][j] = sdp[i][j];
      if (j - a[i] >= 0) sdp[i + 1][j] |= sdp[i][j - a[i]];
    }
  }

  gdp[n + 1][0] = true;
  for (int i = n - 1; i >= 0; i--) {
    for (int j = 0; j <= k; j++) {
      gdp[i + 1][j] = gdp[i + 2][j];
      if (j - a[i] >= 0) gdp[i + 1][j] |= gdp[i + 2][j - a[i]];
    }
  }

  int ans = 0;
  for (int i = 1; i <= n; i++) {
    int x = 0; int d[5001];
    for (int j = 0; j <= k; j++) {
      if (gdp[i + 1][j]) d[x++] = (ll)j;
    }
    for (int j = 0; j <= k; j++) {
      if (sdp[i - 1][j]) {
	ll mi = (ll)k - (ll)a[i - 1] - (ll)j, ma = (ll)(k - 1 - j);
	int l1 = -1, r1 = x - 1, med;
	if (mi <= 0) r1 = 0;
	if (mi > (ll)d[x - 1]) continue;
	if (mi > 0) {
	  while (r1 - l1 > 1) {
	    med = (r1 + l1) / 2;
	    if ((ll)d[med] >= mi) r1 = med;
	    else l1 = med;
	  }
	}
	int l2 = 0, r2 = x;
	if (ma < 0) continue;
	else if (ma >= d[x - 1]) l2 = x - 1;
	else {
	  while (r2 - l2 > 1) {
	    med = (r2 + l2) / 2;
	    if ((ll)d[med] <= ma) l2 = med;
	    else r2 = med;
	  }
	}
   
	if (l2 - r1 >= 0) {
	  ans++; break;
	}
      }
    }
  }

  printf("%d\n", n - ans);

  return 0;
}

	
	  
  


Measured memory_bytes: 49152
#include<cstdio>
const int N=400002;
int n,a,b,i,j,k;
int h[N],t[N],v[N],sg[N];
void add(int a,int b){
	t[++k]=h[a];
	h[a]=k;
	v[k]=b;
}
void init(){
	scanf("%d",&n);
	for(i=1;i<n;i++){
		scanf("%d%d",&a,&b);
		add(a,b);
		add(b,a);
	}
}
void dfs(int i,int fa){
	for(int j=h[i];j;j=t[j])
		if(v[j]!=fa){
			dfs(v[j],i);
			sg[i]^=sg[v[j]]+1;
		}
}
int main(){
	init();
	dfs(1,0);
	printf("%s",sg[1]?"Alice":"Bob");
}

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

using namespace std;

typedef long long LL;

#define N 300000
#define INF 0x3f3f3f3f3f3f3f3fLL

LL n,m,tot,a[N],b[N],s[N],ll[N],rr[N],seg[N<<5],mn[N<<5];
int ls[N<<5],rs[N<<5],rt;
bool tag[N<<5];

void newnode(int &x,LL k){x=++tot; seg[x]=-k; mn[x]=0;}

void psd(LL x,LL mid,LL r){
	if (!ls[x]) newnode(ls[x],mid);
	if (!rs[x]) newnode(rs[x],r);
	if (tag[x]){
		seg[ls[x]]=seg[rs[x]]=mn[ls[x]]=mn[rs[x]]=INF;
		tag[ls[x]]=tag[rs[x]]=1;
		tag[x]=0;
	}
}

void mdf(int &x,LL l,LL r,LL t,LL k){
	if (!x) newnode(x,r);
	if (l==r){seg[x]=min(seg[x],k-t); mn[x]=min(mn[x],k); return;}
	LL mid=(l+r)>>1;
	psd(x,mid,r);
	if (t<=mid) mdf(ls[x],l,mid,t,k);
	else mdf(rs[x],mid+1,r,t,k);
	seg[x]=min(seg[ls[x]],seg[rs[x]]);
	mn[x]=min(mn[ls[x]],mn[rs[x]]);
}

void ers(int &x,LL l,LL r,LL L,LL R){
	if (L>R) return;
	if (!x) newnode(x,r);
	if (l>=L&&r<=R){seg[x]=mn[x]=INF; tag[x]=1; return;}
	LL mid=(l+r)>>1;
	psd(x,mid,r);
	if (L<=mid) ers(ls[x],l,mid,L,R);
	if (R>mid) ers(rs[x],mid+1,r,L,R);
	seg[x]=min(seg[ls[x]],seg[rs[x]]);
	mn[x]=min(mn[ls[x]],mn[rs[x]]);
}

LL qry(LL x,LL l,LL r,LL L,LL R){
	if (!x) return -R;
	if (l>=L&&r<=R) return seg[x];
	LL mid=(l+r)>>1,ret=INF;
	psd(x,mid,r);
	if (L<=mid) ret=min(ret,qry(ls[x],l,mid,L,R));
	if (R>mid) ret=min(ret,qry(rs[x],mid+1,r,L,R));
	return ret;
}

int main(){
	scanf("%lld%lld",&n,&m);
	for (LL i=1;i<=n;++i){
		scanf("%lld%lld",a+i,b+i); a[i]*=2;
		s[i]=s[i-1]+a[i];
		if (b[i]==1){
			if (a[i]>m){puts("-1"); return 0;}
			ll[i]=(m-s[i-1]%m)%m;
			rr[i]=(m-s[i]%m)%m;
		}
	}
	for (LL i=1;i<=n;++i)
		if (b[i]==1){
			LL x=min(qry(rt,0,m-1,0,ll[i])+ll[i],qry(rt,0,m-1,ll[i],m-1)+ll[i]+m);
			mdf(rt,0,m-1,ll[i],x);
			if (ll[i]<=rr[i]){
				ers(rt,0,m-1,0,ll[i]-1);
				ers(rt,0,m-1,rr[i]+1,m-1);
			}
			else{
				ers(rt,0,m-1,rr[i]+1,ll[i]-1);
			}
		}
	printf("%lld\n",mn[rt]+s[n]);
	
	return 0;
}
			

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

#define REP(i, x, n) for (int i = x; i < (int)(n); i++)
#define rep(i, n) REP (i, 0, n)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x.size())
#define popcount(x) __builtin_popcount(x)
#define popcountll(x) __builtin_popcountll(x)
#define uniq(x) x.erase(unique(x.begin(), x.end()), x.end())
#define F first
#define S second
#define mp make_pair
#define eb emplace_back

using namespace std;

typedef long long ll;

// const int INF = 1 << 30;
// const ll INF = 1LL << 60;
// const int MOD = 1000000007;

int main() {
  bool isPrime[100000 + 1];
  memset(isPrime, false, sizeof(isPrime));
  REP (i, 2, 100000 + 1) {
    bool flg = true;
    for (int j = 2; j * j <= i; j++) if (i % j == 0) {
      flg = false;
      break;
    }
    if (flg) isPrime[i] = true;
  }

  int sum[100000 + 1];
  memset(sum, 0, sizeof(sum));
  REP (i, 1, 100000 + 1) {
    sum[i] = sum[i - 1] + ((isPrime[i] && isPrime[(i + 1) / 2]) ? 1 : 0);
  }

  int Q;
  cin >> Q;

  rep (i, Q) {
    int l, r;
    cin >> l >> r;
    cout << sum[r] - sum[l - 1] << endl;
  }
}


Measured memory_bytes: 1152
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

x,y,a,b,c=nii()
p=sorted(lnii(),reverse=True)
q=sorted(lnii(),reverse=True)
r=sorted(lnii(),reverse=True)

l=p[:x]+q[:y]
l.sort()

ans=0
for i in range(x+y):
  if i<c:
    ans+=max(l[i],r[i])
  else:
    ans+=l[i]

print(ans)

Measured memory_bytes: 29232
#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define endl "\n"
const int MOD=1e9+7;
#ifndef HOME
#define cerr if(0)cerr
#endif
const int MaxW = 1e5+5;
int n,weight;
int dp[105][MaxW];
int w[105];
int v[105];
int solve(int i,int can){
    
    if(can>weight){
        return -1e18;
    }
    if(i==n){
        return 0;
    }
    
    int &ans = dp[i][can];
    if(ans!=-1){
        return ans;
    }
    //don't take current item or take current item
    return ans = max(solve(i+1,can),v[i] + solve(i+1,can+w[i]));
}
int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin>>n>>weight;
    for(int i=0;i<n;i++){
        cin>>w[i]>>v[i];
    }
    memset(dp,-1,sizeof(dp));
    cout<<solve(0,0)<<endl;
    
    return 0;
    
}



Measured memory_bytes: 82304
m, d = map(int, input().split())
ans = 0
for m in range(1, m + 1):
    for d in range(22, d + 1):
        d1 = d % 10
        d10 = d // 10
        if d1 < 2:
            continue
        if m == d1 * d10:
            ans += 1
print(ans)


Measured memory_bytes: 2940
#include<stdio.h>

int main(void){
	int n;
	scanf("%d",&n);
	
	int v[n+1];
	for(int i = 0;i < n;i ++){
		scanf("%d",&v[i]);
	}
	v[n+1] = 1000000001;
	int count = 0 , ans = 0;

	for(int i = 0;i < n;i ++){
		if(v[i] >= v[i+1] && i < n-1){
			count ++;
		}
		else{
			if(count > ans){
				ans = count;
				}
			count = 0;
        }
	}
	printf("%d\n",ans);

	return 0;
}

Measured memory_bytes: 512
import java.util.ArrayList;
import java.util.Arrays;
import java.util.PriorityQueue;
import java.util.Scanner;

//suppose that every capacity is in the domaion of integer.
public class Main{
	public static void main(String[] args) {
		new Main().solver();
	}

	@SuppressWarnings("unchecked")
	void solver() {
		Scanner sc = new Scanner(System.in);
		int V = sc.nextInt();
		int E = sc.nextInt();
		ArrayList<Edge>[] g = new ArrayList[V];
		for (int i = 0; i < V; i++) {
			g[i] = new ArrayList<>();
		}
		for (int i = 0; i < E; i++) {
			int u = sc.nextInt();
			int v = sc.nextInt();
			int c = sc.nextInt();
			g[u].add(new Edge(u, v, c));
		}
		Preflow_Relabel pr = new Preflow_Relabel(0, V - 1, g);
		System.out.println(pr.calc());
	}

	class Preflow_Relabel {
		int n;
		int s;
		int t;
		ArrayList<Edge>[] g;
		int[][] flow;
		int[][] capacity;
		int[] excess;
		int[] height;
		PriorityQueue<Vertice> que = new PriorityQueue<>();

		public Preflow_Relabel(int s, int t, ArrayList<Edge>[] g) {
			this.g = g;
			this.s = s;
			this.t = t;
			n = g.length;
			flow = new int[n][n];
			capacity = new int[n][n];
			height = new int[n];
			height[s] = n;
			excess = new int[n];

			for (int i = 0; i < n; i++) {
				for (Edge e : g[i]) {
					if (e.weight > 0) {
						g[e.dst].add(new Edge(e.dst, e.src, 0));
						capacity[e.src][e.dst] += e.weight;
					} else if (e.weight == 0) {
						continue;
					}
				}
			}
		}

		int calc() {
			for (Edge e : g[s]) {
				excess[s] += e.weight;
				push(s, e.dst);
			}
			while (!que.isEmpty()) {
				Vertice v = que.poll();
				if (excess[v.id] == 0 || v.id == t || height[v.id] != v.height) {
					continue;
				}
				for (Edge e : g[v.id]) {
					if (height[e.src] == height[e.dst] + 1) {
						if (residue(e.src, e.dst) > 0) {
							push(e.src, e.dst);
							if (excess[v.id] == 0)
								break;
						}
					}
				}
				if (excess[v.id] > 0) {
					int min = 1 << 30;
					for (Edge e : g[v.id]) {
						if (residue(e.src, e.dst) > 0) {
							min = Math.min(min, height[e.dst]);
						}
					}
					height[v.id] = min + 1;
					que.add(new Vertice(v.id, height[v.id]));
				}
			}
			return excess[t];
		}

		int residue(int s, int t) {
			return capacity[s][t] - flow[s][t];
		}

		void push(int u, int v) {
			int delta = Math.min(excess[u], residue(u, v));
			flow[u][v] += delta;
			flow[v][u] -= delta;
			excess[v] += delta;
			excess[u] -= delta;
			if (v != t && v != s) {
				que.add(new Vertice(v, height[v]));
			}
		}

		class Vertice implements Comparable<Vertice> {
			int id;
			int height;

			public Vertice(int id, int height) {
				this.id = id;
				this.height = height;
			}

			@Override
			public int compareTo(Vertice o) {
				return -Integer.compare(this.height, o.height);
			}
		}
	}

	class Edge {
		int src;
		int dst;
		int weight;

		Edge(int src, int dst, int weight) {
			this.src = src;
			this.dst = dst;
			this.weight = weight;
		}
	}

	void tr(Object... o) {
		System.out.println(Arrays.deepToString(o));
	}
}

Measured memory_bytes: 38096
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int H, W;
  cin >> H >> W;
  string S;
  
  for(int i = 0; i < W + 1; i++)
   cout << '#';

  cout << '#' << endl;
  
  for(int i = 0; i < H; i++){
    cin >> S;
    cout << '#' << S << '#' << endl;
  }
  for(int i = 0; i < W + 2; i++)
   cout << '#';
}

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

#ifdef LOCAL
    #define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
    #define eprintf(...)
#endif

#define fast_io ios_base::sync_with_stdio(false); cin.tie(nullptr)
#define rep(i, x, y) for(decltype(y) i = (x) - ((x) > (y)); i != (y) - ((x) > (y)); i += 1 - 2 * ((x) > (y)))
#define trav(i,a) for(auto& (i) : (a))
#define all(a) (a).begin(),(a).end()
#define sz(a) int((a).size())
#define clr(a,x) memset((a),(x),sizeof(a)) // array (0,-1)
#define dbg(x) cerr << "STDERR => " << __LINE__ << ": " << #x << " = " << (x) << "  :(\n";
#define eb emplace_back
#define mp make_pair
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
inline void cpuTime() { cerr << "CPU time: " << double(clock())/CLOCKS_PER_SEC << "\n"; return; }
using ll = long long;
using ull = unsigned long long;
using F = float;
using D = double;
using vi = vector<int>;
using pii = pair<int,int>;
/*}}}*/


void solve(){

    int n;
    cin >> n;

    vi a(n);
    rep(i,0,n) cin >> a[i];

    int ans = INT_MAX, cost = 0;
    rep(i,1,101){
        cost = 0;
        rep(j,0,n){
            cost += (a[j]-i)*(a[j]-i);
        }
        ans = min(ans, cost);
    }

    cout << ans << "\n";
    return;
}

/*
 read the question carefully ( what're the exact constraints? )
 look out for SPECIAL CASES (n=1?) and OVERFLOW (ll vs int?) ARRAY OUT OF BOUNDS
 Check datatypes
*/
int main(){

    fast_io;
    int t=1;
    // cin >> t;

    while(t--){
        solve();
    }

    cpuTime();
return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
	long long n,m,k;
	cin>>n>>m>>k;
	
	long long i,j;
	if(k>=n+m){
		i=j=0;
	}else if(k>=n && k<m+n){
		i=0;
		j=m+n-k;
	}else if(k>=0 && k<n){
		i=n-k;
		j=m;
	}
	cout<<i<<" "<<j<<endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        System.out.println(lcm(sc.nextInt(),sc.nextInt()));
    }
    static long gcd(long x,long y){
        if (y==0)return x;
        else return gcd(y,x%y);
    }
    static long lcm(long x,long y){
        return x/gcd(x,y)*y;
    }
}


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

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

int main(){
	int N;
	cin >> N;
	vector<LL> x(N), y(N);
	rep(i,N) cin >> x[i] >> y[i];
	vector<LL> sum(N), dif(N);
	rep(i,N) sum[i]=x[i]+y[i], dif[i]=x[i]-y[i];
	LL ans=0;
	sort(sum.begin(),sum.end());
	sort(dif.begin(),dif.end());
	ans=max(abs(sum[N-1]-sum[0]),abs(dif[N-1]-dif[0]));
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 9492
#include <stdio.h>
typedef long long ll;

int main(void) {
  ll i, j, k, n, q, c, x, y;
  scanf("%lld%lld", &n, &q);
  ll seg[n * 4], f = 1;
  while(f < n) f *= 2;
  for(i = 0; i < f * 2; ++i) seg[i] = 2147483647;
  for(i = 0; i < q; ++i) {
    scanf("%lld%lld%lld", &c, &x, &y);
    if(c) {
      ll ans = 2147483647;
      ll r = x + f;
      while(1) {
        ll las, ra = 1;
        while(!(r % 2)) r /= 2;
        while(ra <= r) ra *= 2;
        ra /= 2;
        las = f / ra * (r + 1 - ra) - 1;
        //printf("f%lld r%lld ra%ld l%lld\n", f, r, ra, l);
        while(las > y) {
          r *= 2;
          ra *= 2;
          las = f / ra * (r + 1 - ra) - 1;
          //printf("f%lld r%lld ra%ld l%lld\n", f, r, ra, l);
        }
        if(ans > seg[r]) ans = seg[r];
        if(las == y) break;
        r++;
        //printf("f%lld r%lld ra%ld l%lld\n", f, r, ra, l);
      }
      printf("%lld\n", ans);
    } else {
      int now = (x + f) / 2;
      seg[x + f] = y;
      while(now) {
         seg[now] = seg[now * 2] > seg[now * 2 + 1] ? seg[now * 2 + 1] : seg[now * 2];
         now /= 2;
      }
    }
  }
  return 0;
}


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

int main(){
    int h,w,m;cin>>h>>w>>m;
    vector<int> kaburi[w];
    int A[h],B[w];
    rep(i,h)A[i]=0;
    rep(i,w)B[i]=0;
    rep(i,m){
        int a,b;
        cin>>a>>b;
        a--;b--;
        A[a]++;B[b]++;
        kaburi[b].emplace_back(a);
    }
    rep(i,w)sort(kaburi[i].begin(),kaburi[i].end());
    int max1,max2;
    max1=0;max2=0;
    rep(i,h){
        if(max1<A[i]){
            max1=A[i];
        }
    }
    vector<int> candidate;
    rep(i,h){
        if(A[i]==max1)candidate.emplace_back(i);
    }
    rep(i,w){
        if(max2<B[i])max2=B[i];
    }
    int dou=1;
    rep(i,w){
        if(B[i]==max2){
            rep(j,candidate.size()){
                int sj=candidate[j];
                int l=kaburi[i].size();
                int left=0,right=l,mid;
                int ans=0;
                while(left<right){
                    mid=(left+right)/2;
                    if(kaburi[i][mid]==sj){ans=1;break;}
                    else if(kaburi[i][mid]>sj)right=mid;
                    else left=mid+1;
                }
                if(ans==0){dou=0;break;}
            }
            if(dou==0)break;
        }
    }
    if(dou==1)max1--;
    cout<<max1+max2<<endl;
    return 0;
}

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

int main(){
	int n;
	cin >> n;
	vector<int> ar(n),br(n);
	for(int i=0;i<n;i++){
		int x,y;
		cin >> x >> y;
		ar[i] = x+y;
		br[i] = (1e9+x)-y;
	}
	sort(ar.begin(),ar.end());
	sort(br.begin(),br.end());
	cout << max(ar[n-1]-ar[0],br[n-1]-br[0]) << '\n';
}

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

struct P
{
    int x,y;

    bool operator<(const P &a)const{
        if(x!=a.x)
              return x>a.x;
        return y>a.y;
    }

};

vector<int> v[1],v1;

//bitset<4001000> b;
int i,n,d,m,k,a,b,c,h;

int o[113111];
int l[111311];
int j[1];
int e;


//int dx[10]={2,2,-2,-2,1,1,-1,-1},dy[10]={1,-1,1,-1,2,-2,2,-2};

int dx[10]={0,1,0,-1,1,1,-1,-1},dy[10]={1,0,-1,0,1,-1,1,-1},dz[10]={0,0,0,0,1,-1};
long long mod=1000000007,mod2=1000000009,mod3=2017;
long long x,z,y;
double pi=3.14159265;
P u[1];
stack<int> s;
//set<int> s[222][22];
//priority_queue<P> q;
queue<int> q;
//2147483647
//'1'==49;
//'A'==65;
//'a'==97;
//unordered_
//map<int,int> p;
/*
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        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);
    }
};
unordered_map<long long, int, custom_hash> safe_map;
*/
//list<int> l;

//string r,r1;
char r[2222][1111];
//deque<int> de;
//srand((int)time(NULL));
/*bool as(P a,P b)
{
    if(a.x!=b.x)
    return a.x<b.x;
    return a.y<b.y;
}*/



bool as(P a,P b)
{
    if(a.x!=b.x)
        return a.x<b.x;
    return a.y<b.y;

}


int f(int m)
{
    //if(m<0) return 1;
    if(l[m]>=0) return l[m];
    int n=0;
    for(int h=1;h<=a;h++)
        if(m>=o[h])
        n=max(n,1-f(m-o[h]));
    return l[m]=n;
}

int main()
{
    memset(l,-1,sizeof(l));
    scanf("%d %d",&a,&b);
    for(int t=1;t<=a;t++)
        scanf("%d",&o[t]);
    if(f(b)) puts("First");
    else puts("Second");
}





Measured memory_bytes: 5376
s=list(map(str,input().split()))

m={}
l={}

for i in range(len(s)):
    t=s[i].lower()
    if t in m:
        m[t]+=1
    else:
        m.setdefault(t,1)
    
    if t in l:
        pass
    else:
        l.setdefault(t,len(t))


print(max(m,key=m.get),max(l,key=l.get))


Measured memory_bytes: 5564
use std::vec::Vec;

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

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>().split_whitespace().map(|e| e.parse().ok().unwrap()).collect()
}

fn main() {
    let (x, a, b) = {
        let v: Vec<usize> = read_vec();
        (v[0], v[1], v[2])
    };

    if a >= b {
        println!("delicious");
    } else if b - a <= x {
        println!("safe");
    } else {
        println!("dangerous");
    }
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repm(i, m, n) for (int i = m; i < (n); i++)
#define eps (1e-7)
#define inf (1e9)
#define pi (acos(-1))
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<double> vd;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
ll a, b, c, m, n, ans;

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

    cin >> n >> a;
    vl c(n);
    rep(i, n) cin >> c[i];
    sort(c.begin(), c.end());
    int count = 0;
    rep(i, n - 1)
    {
        if (a - c[i] < 0)
            break;
        a -= c[i];
        count++;
    }
    if (a == c[n - 1])
        count++;

    cout << count << endl;

    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <memory.h>
#include <cstring>
#include <vector>
#include <deque>
#include <cstdlib>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cassert>
#include <functional>
#include <iostream>
#include <set>
#include <list>
#include <map>
#include <time.h>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
using namespace std;

typedef long long ll;
typedef unsigned long long llu;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<int, ll> pil;
typedef pair<string, int> psi;
typedef pair<char, int> pci;
typedef pair<int, char> pic;
const ll MOD = (ll)1e9 + 7;
const long double PI = 3.141592653589793238462643383279502884197;

priority_queue<int, vector<int>, greater<int> > pq;
vector<int> v;

char s[3005];
int dp[3005][3005];
int n;

int go(int o, int dd) {
	if (o == n) return 1;
	if (dp[o][dd] != -1) return dp[o][dd];

	ll ret = 0;
	int nn = n - o; 

	if (s[o] == '<') {
		if (dd < nn - 1) ret += go(o, dd + 1);
		if (dd < nn) ret += go(o + 1, dd);
	}
	else {
		if (dd > 1) ret += go(o, dd - 1);
		if (dd > 0) ret += go(o + 1, dd - 1);
		
	}

	return dp[o][dd] = ret % MOD;
}

int main() {
	memset(dp, -1, sizeof(dp));

	scanf("%d", &n);
	scanf("%s", s + 1);

	ll ret = 0;
	for (int i = n - 1; i >= 1; i--)
		for (int j = 0; j < n - i + 1; j++)
			go(i, j);

	for (int i = 0; i < n; i++)
		ret += go(1, i);

	printf("%lld", ret % MOD);
}

Measured memory_bytes: 35840
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author HossamDoma
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, InputReader in, PrintWriter out) {

            char[] a = in.next().toCharArray();

            boolean[] f = new boolean[26];

            for (int i = 0; i < a.length; ++i) {
                f[a[i] - 'a'] = true;
            }

            for (int i = 0; i < 26; ++i) {
                if (!f[i]) {
                    out.println((char) ('a' + i));
                    return;
                }
            }

            out.println("None");
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

    }
}



Measured memory_bytes: 25300
#include<bits/stdc++.h>
#define ll long long
#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define dump(a) (cerr << #a << "=" << (a) << endl)
#define DUMP(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }


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

    int K, S;
    ll ans = 0;
    cin >> K >> S;
    rep(i, K+1){
        rep(j, K+1){
            if (S - i - j >= 0 && S - i - j <= K) {
                ans++;
            }
        }
    }

    cout << ans << endl;
}

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

using namespace std;
using lint = long long;
//typedef long long lint;

lint gcd(lint a, lint b)
{
    lint tmp, r;
    /* 自然数 a > b を確認・入替 */
  if(a<b){
    tmp = a;
    a = b;
    b = tmp;
  }
 
  /* ユークリッドの互除法 */
  r = a % b;
  while(r!=0){
    a = b;
    b = r;
    r = a % b;
  }

    return b;
}

lint gcd_all(vector<lint> A){
    lint z = A[0];
    for(int i = 1; i < A.size(); i++){
        z = gcd(A[i], z);
    }
    return z;
}

int main(void)
{
    int N;
    cin >> N;
    vector<lint> A(N);
    vector<lint> B(N-1);
    for(int i = 0; i < N; i++){
        cin >> A[i];
    }

    if(N == 2){
        cout << max(A[0], A[1]) << endl;
        return 0;
    }
    sort(A.begin(), A.end());
    for(int i = 1; i < N; i++){
        B[i-1] = A[i];
    }
    lint x = A[0];
    lint r = A[0];
    int index = 0;
    for(int i = 1; i < N; i++){
        if(gcd(x, A[i]) < r){
            r = gcd(x, A[i]);
            index = i;
        }
    }
    
    if(index == 0){
        A[0] = A[1];
    }else{
        A[index] = A[0];
    }
    
    cout << max(gcd_all(A), gcd_all(B)) << endl;
    return 0;
}

Measured memory_bytes: 3328
#include<bits/stdc++.h>
#define ull unsigned long long
# define ll long long
# define mod 1000000007LL 
using namespace std;
int main()
{
     ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;
    cin>>n;
    ll arr[n];
    for(int i=0;i<n;i++)
    cin>>arr[i];
    ll sum[n]={0};
    sum[n-1]=arr[n-1];
    for(int i=n-2;i>=0;i--)
    {
        sum[i]=sum[i+1]%mod+arr[i]%mod;
        sum[i]=sum[i]%mod;
    }
    ll ans=0;
    for(int i=1;i<n;i++)
    {
        ans=(ans+(arr[i-1]*sum[i])%mod)%mod;
        ans=ans%mod;
    }
    cout<<ans;

    
    
    return 0;
}

Measured memory_bytes: 6768
#include <bits/stdc++.h>
using namespace std;
using LL = long long; using PII = pair<LL, LL>; using VI = vector<LL>; using VVI = vector<VI>;
using VB = vector<bool>; using VS = vector<string>; using VP = vector<PII>;
#define VV(T)        vector<vector<T>>
#define PB           push_back
#define MP           make_pair
#define SZ(a)        LL((a).size())
#define EACH(x, c)   for (auto x : (c))
#define ALL(c)       (c).begin(), (c).end()
#define REVERSE(c)   reverse(ALL(c))
#define SORT(c)      stable_sort(ALL(c))
#define RSORT(c)     stable_sort((c).rbegin(), (c).rend())
#define FOR(i, a, b) for (LL i = (a); i < (b); ++i)
#define REP(i, n)    FOR(i, 0, n)
#define $(x)         {cout << #x << " = " << (x) << endl;}

void solve(LL N, vector<LL> a){
    LL X = N;
    VI v(N);
    LL M = 0;
    while (N > 0) {
        LL L = N / 2 + 1;
        FOR(i, L, N + 1) {
            //$(i);
            LL sum = 0;
            for (LL j = i + i; j < X + 1; j += i) {
                //$(j);
                sum += v[j - 1];
            }
            //$(sum);
            if (a[i - 1] == sum % 2) {
                v[i - 1] = 0;
            } else {
                v[i - 1] = 1;
                M++;
            }
            //$(v[i - 1]);
        }
        N = L - 1;
    }
    cout << M << endl;
    REP(i, X) {
        if (v[i] == 1) {
            cout << i + 1 << " ";
        }
    }
    cout << endl;
}

int main(){
    LL N;
    scanf("%lld",&N);
    vector<LL> a(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&a[i]);
    }
    solve(N, move(a));
    return 0;
}


Measured memory_bytes: 3968
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<queue>
#include<vector>
#include<functional>
#include<cmath>
#include<map>
#include<stack>
#include<set>
#include<numeric>
#include<limits>
#include<iomanip>
#include<iterator>

#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define rep(i,n) for(int i=0; i<n; i++)
#define FOR(i,a,n) for(int i=a; i<n; i++)

using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ll, char> plc;

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

int main()
{
	int x, y;
	cin >> x >> y;
	int g = gcd(x, y);

	if (x == y)cout << x + 1 << endl;
	else cout << x + y - g + 1 << endl;
	return 0;
}

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

#define ll long long
#define fw(p) for(int w=0;w<(p);w++)
#define fx(p) for(int x=0;x<(p);x++)
#define fy(p) for(int y=0;y<(p);y++)
#define fz(p) for(int z=0;z<(p);z++)
#define fyg(p,g) for(int y=(g);y<(p);y++)
#define fzg(p,g) for(int z=(g);z<(p);z++)
#define ce(d) cout<<d<<endl;
#define vecp(p) int aa;cin>>aa;(p).push_back(aa);
#define vecpl(p) long long aa;cin>>aa;(p).push_back(aa);
#define vecps(p) string aa;cin>>aa;(p).push_back(aa);
#define vecp2(p) cin>>aa;(p).push_back(aa);
#define vecpl2(p) long long a	b;cin>>ab;(p).push_back(ab);
#define vecps2(p) string ab;cin>>ab;(p).push_back(ab);
#define sorts(c) sort((c).begin(),(c).end());
#define reverses(c) reverse((c).begin(),(c).end());
#define vec(b) vector<int> (b);
#define vecl(b) vector<long long> (b);
#define vecs(b) vector<string> (b);
#define pb(b,a) (b).push_back((a));
#define doublece(a,b) cout<<(a)<<' '<<(b)<<endl;
#define pairs(s) vector<pair<int,int>> (s);
#define pairsp(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define MOD 1000000007
#define cey ce("Yes")
#define cen ce("No")
#define ceY ce("YES")
#define ceN ce("NO")

int main()
{

	ll X, K, D;
	cin >> X >> K >> D;

	X = abs(X);
	if (X/D>K) {
		ce(X-D*K)
	}
	else {
		int k = X / D;
		if ((K-k)%2==0) {
			ce(X - X / D * D)
		}
		else {
			ce(abs(X - X / D * D - D))
		}
	}

    return 0;
}



Measured memory_bytes: 3632
#include "bits/stdc++.h"
#include <set>

using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define all(i) (i).begin(), (i).end()
#define rall(i) (i).begin(), (i).end(), greater<int>()
#define int long long
#define elif else if
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define fst first
#define sec second
#define mod 1000000007
#define INF 10e10
template <typename T>

void print(T x)
{
	std::cout << x << " ";
}
template <typename T>

void println(T x)
{
	std::cout << x << "\n";
}

signed main(void) {
	int a, b;
	cin >> a >> b;
	int neg = 0;
	if (a <= 0 && 0 <= b) {
		println("Zero");
	}
	else if (b<0 && (a - b) % 2 == 0)print("Negative");
	else print("Positive");
}

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

using namespace std;

typedef long long ll;

const int INF = 1000000000;

bool is_positive(vector<int>& v)
{
  for (int i = 0; i < (int)v.size(); ++i) {
    if (v[i] < 0) { return false; }
  }
  return true;
}

int main()
{
  int N;
  scanf("%d", &N);
  vector<int> A(N);
  int min_val = INF, min_ix = -1;
  int max_val = -INF, max_ix = -1;
  for (int i = 0; i < N; ++i) {
    scanf("%d", &A[i]);
    if (A[i] < min_val){
      min_ix = i;
      min_val = A[i];
    }
    if (A[i] > max_val) {
      max_ix = i;
      max_val = A[i];
    }
  }

  vector<pair<int, int> > ans;
  if (min_val < 0 and max_val > 0) {
    if (max_val >= abs(min_val)) {
      // make all elements >= 0
      for (int i = 0; i < N; ++i) {
        if (A[i] < 0) {
          A[i] += max_val;
          ans.push_back(make_pair(max_ix, i));
        }
      }
    }
    else {
      // make all elements < 0
      for (int i = 0; i < N; ++i) {
        if (A[i] > 0) {
          A[i] += min_val;
          ans.push_back(make_pair(min_ix, i));
        }
      }
    }
  }
  if (is_positive(A)) {
    for (int i = 1; i < N; ++i) {
      A[i] += A[i - 1];
      ans.push_back(make_pair(i - 1, i));
    }
  }
  else {
    for (int i = N - 1; i > 0; --i) {
      ans.push_back(make_pair(i, i - 1));
      A[i - 1] += A[i];
    }
  }
  // fprintf(stderr, "DEBUG: A=");
  // copy(A.begin(), A.end(), ostream_iterator<int>(cerr, ", "));
  // fprintf(stderr, "\n");
  int m = ans.size();
  printf("%d\n", m);
  for (int i = 0; i < m; ++i) {
    printf("%d %d\n", ans[i].first + 1, ans[i].second + 1);
  }
  return 0;
}


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

#define REP(i, n) for(int (i)=0;(i)<(n);++(i))
#define REPV(iter, v) for(auto (iter)=(v).begin(); (iter)!=(v).end();++(iter))
#define ALL(v) (v).begin(),(v).end()

#define MOD 1000000007

using namespace std;

typedef long long ll;

int main()
{
    string S;
    cin >> S;
    ll Q;
    cin >> Q;
    string head = "", tail = "";
    ll countReverse = 0;
    REP(i, Q)
    {
        ll T;
        cin >> T;
        if (T == 1)
        {
            countReverse++;
            string tempS;
            tempS = head;
            head = tail;
            tail = tempS;
        }
        else if (T == 2)
        {
            ll F;
            string C;
            cin >> F >> C;
            if (F == 1)
            {
                if (countReverse % 2 == 0) head = C + head;
                else if (countReverse % 2 == 1) head = head + C;
            }
            else if (F == 2)
            {
                if (countReverse % 2 == 0) tail = tail + C;
                else if (countReverse % 2 == 1) tail = C + tail;
            }
        }
    }
    if (countReverse % 2 == 1)
    {
        reverse(ALL(S));
        reverse(ALL(head));
        reverse(ALL(tail));
    }
    string ans = head + S + tail;

    cout << ans << endl;
}


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

using lint = long long;
template <typename T> using V = vector<T>;
template <typename T> using VV = vector<vector<T>>;
template <typename T> using VVV = vector<vector<vector<T>>>;
#define rep(i, n) for(int i = 0; i < int(n); i++)
#define repu(i, a, b, s) for(int i = int(a); i < int(b); i += int(s))
#define repd(i, a, b, s) for(int i = int(a); i > int(b); i += int(s))
#define endl "\n"
constexpr lint INF = 2e18;
constexpr lint MOD = 2019;

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

    lint N = s.size();

    V<lint> d(2019, 0);
    d[0] = 1;

    lint t = 0;
    lint m = 1;

    repd(i, N - 1, -1, -1) {
        t += (s[i] - '0') * m;
        t %= MOD;
        d[t] += 1;
        m *= 10;
        m %= MOD;
    }

    lint ans = 0;
    rep(i, 2019) { ans += d[i] * (d[i] - 1) / 2; }

    cout << ans << endl;
}

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

Measured memory_bytes: 3776
using System;

class Program
{
  static void Main(string[] args)
  {
    string[] items = Console.ReadLine().Split(' ');

    uint d = uint.Parse(items[0]);
    uint t = uint.Parse(items[1]);
    uint s = uint.Parse(items[2]);

    if((double)d / t <= s)
    {
      Console.WriteLine("Yes");
    }
    else
    {
      Console.WriteLine("No");
    }
    return;
  }
}

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

int main() {
    int n;
    long long sum=0;
    cin >> n;
    int arr[1000001] = {};
    for(int i=0;i<n;i++)
    {
        int x;
        cin >> x;
        sum += x;
        arr[x]++;
    }
    int k;
    cin >> k;
    for(int i=0;i<k;i++)
    {
        int b,c;
        cin >> b >> c;
        sum += arr[b]*(c-b);
        arr[c] += arr[b];
        arr[b]=0;
        cout << sum << "\n";
    }
	return 0;
}


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

using namespace std;

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

	vector<int> arr(n);
	for (int i = 0; i < n; i++)
	{
		cin >> arr[i];
	}

	int ans = arr[0];

	for (int i = 1; i < n; i++)
	{
		if (arr[i] > arr[i - 1])
		{
			ans += arr[i] - arr[i - 1];
		}
	}

	cout << ans << endl;
}

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

using namespace std;

typedef struct{
int val;
int node;
}sd;

int sdsortfnc(const void *a,const void *b){
if(((sd*)a)->val < ((sd*)b)->val){return -1;}
if(((sd*)a)->val > ((sd*)b)->val){return 1;}
return 0;
}

#define lk 32

typedef struct{
  int lp;
  int par;
  int bkw;
  int chi[lk];
  int cnt[lk];
}trn;

int trc=0;
trn *trie;
long long res=0;

void trinit(){
  int i;
  trie[0].lp=0;
  trie[0].par=-1;
  trie[0].bkw=-1;
  for(i=0;i<lk;i++){
    trie[0].chi[i]=-1;
    trie[0].cnt[i]=0;
  }
  trc=1;
}

void crn(int x,int pt){
  int i;
  trie[x].chi[pt]=trc;
  trie[trc].par=x;
  trie[trc].bkw=pt;
  trie[trc].lp=trie[x].lp+1;
  for(i=0;i<lk;i++){
    trie[trc].chi[i]=-1;
    trie[trc].cnt[i]=0;
  }
  trc++;
}

int run(string &s,int l){
  int i,j,v=0,c;
  int rem[32]={0};
  for(i=0;i<l;i++){rem[s[i]-'`']++;}
  for(i=0;i<l;i++){
    c=s[i]-'`';
    for(j=1;j<32;j++){
      if(rem[j]!=0){res+=trie[v].cnt[j];}
    }
    if(i==l-1){trie[v].cnt[s[i]-'`']++;}
    rem[c]--;
    if(trie[v].chi[c]==-1){crn(v,c);}
    v=trie[v].chi[c];
  }
  return v;
}

int main(void){
  trie=((trn*)malloc(sizeof(trn)*1048576));
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  trinit();
  
  long long i,j,n,p,l;
  sd dat[262144];
  
  cin >> n;
  vector<string> str(n);
  for(i=0;i<n;i++){
    cin >> str[i];
    reverse(str[i].begin(),str[i].end());
    dat[i].val=str[i].size();
    dat[i].node=i;
  }
  qsort(dat,n,sizeof(dat[0]),sdsortfnc);
  for(i=0;i<n;i++){
    p=dat[i].node;
    l=dat[i].val;
    run(str[p],l);
  }
  cout << res << '\n';
  return 0;
}


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

using namespace std;

int main() {
    int n,m;
    cin>>n>>m;
    int a[m];
    for(int i=0;i<m;i++)
    {
        cin>>a[i];
    n-=a[i];
    }
    if(n<0)
    cout<<"-1";
    else
    cout<<n;
}

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


void solve(long long N){
  cout << ((N*(N+1))/2) << 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(){
    long long N;
  scanf("%lld",&N);
    solve(N);
    return 0;
}


Measured memory_bytes: 3728
#include<iostream>
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
int main()
{
    fastio;
    int a,b;
    cin>>a>>b;
    if(a<=9 && b<=9)
        cout<<a*b;
    else if(a>9 || b>9)
        cout<<"-1";
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please


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


	ll A, B, C;
	cin >> A >> B >> C;

	ll saishou = 1e18;
	if (A % 2) saishou = min(saishou, B * C);
	else saishou = 0;
	if (B % 2) saishou = min(saishou, C * A);
	else saishou = 0;
	if (C % 2) saishou = min(saishou, A * B);
	else saishou = 0;

	co(saishou);


	Would you please return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
#define rer(i,l,n) for(int i=l;i<=n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define pb(a) push_back(a)
#define mk(a,b) make_pair(a,b)
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

int main(){
	int y,m,d;
	while(cin>>y>>m>>d){
		if(y>1989 || (y==1989 && (m>1 || (m==1 && d>=8)))){
			o("heisei "<<y-1988<<" "<<m<<" "<<d);
		}else if(y>1926 || (y==1926 && m==12 && d>=25)){
			o("showa "<<y-1925<<" "<<m<<" "<<d);
		}else if(y>1912 || (y==1912 && (m>7 ||(m==7 && d>=30)))){
			o("taisho "<<y-1911<<" "<<m<<" "<<d);
		}else if(y>1868 || (y==1868 && (m>9 || (m==9 && d>=8)))){
			o("meiji "<<y-1867<<" "<<m<<" "<<d);
		}else{
			o("pre-meiji");
		}
	}
}

Measured memory_bytes: 1164
#include <stdio.h>

int main()
{
  int N,A[1000],i,j,key;

  scanf("%d",&N);
  for(i=0;i<N;i++) {
    scanf("%d",&A[i]);
      }

  for(j=0;j<N;j++) {
    if(j>0) { printf(" ");
    }
    
    printf("%d",A[j]);
  }
  printf("\n");

  for(i=1;i<N;i++) {
    key=A[i];
    j=i-1;

  while(j>=0 && A[j]>key){
    A[j+1] = A[j];
    j--;
  }
  A[j+1] = key;
  
  for(j=0;j<N;j++) {
    if(j>0) { printf(" ");
    }
    
    printf("%d",A[j]);
  }
  printf("\n");

  }

  return 0;
}

Measured memory_bytes: 1032
#include<bits/stdc++.h>
using namespace std;
int a[100001],p[100001];
int main()
{
    int n,m,q;
    cin>>n>>m>>q;
    for(int i=0;i<n;i++)
    	a[i]=m;
    for(int i=0;i<q;i++)
    	{
		cin>>p[i];
		a[p[i]-1]++;
		}
	for(int i=0;i<n;i++)
	{
		a[i]-=q;
		if(a[i]>0)
			cout<<"Yes\n";
		else
			cout<<"No\n";
	}
	return 0;
} 

Measured memory_bytes: 1408
s = input().strip()
t = input().strip()

fir = -1
for i in range(len(s) - len(t) + 1):
    tmp = i
    flg = True
    for j in range(len(t)):
        if s[i + j] == "?" or s[i + j] == t[j]:
            continue
        else:
            flg = False
            break
    if flg:
        fir = tmp
if fir == -1:
    print("UNRESTORABLE")
else:
    ans = s[:fir] + t + s[fir + len(t):]
    print(ans.replace("?", "a"))


Measured memory_bytes: 38384
BALL_NUM = 10


def main():
    n = int(input())
    while n > 0:
        balls = list(map(int, input().split()))
        if dfs(balls, 0, 0):
            print("YES")
        else:
            print("NO")

        n -= 1


def dfs(balls, b, c):
    if len(balls) == 1:
        if balls[0] > b or balls[0] > c:
            return True
        else:
            return False

    # ????????????b?????\????????´???
    if balls[0] > b and dfs(balls[1:], balls[0], c):
        return True
    # ????????????c?????\????????´???
    if balls[0] > c and dfs(balls[1:], b, balls[0]):
        return True

    return False


if __name__ == '__main__':
    main()

Measured memory_bytes: 7628
n, d = gets.split.map(&:to_i)
X = []
n.times do
    line = gets.split.map(&:to_f)
    X << line
end
#print(X, "\n")
result = 0
for i in 0..(n-1)
    for j in (i+1)..(n-1)
        pre = 0
        for k in 0..(d-1)
          #print("i=",i,"j=",j,"k=",k,"\n")
          pre += ((X[i][k] - X[j][k]).abs)**2
        end
        #puts Math.sqrt(pre)
        if Math.sqrt(pre) == Math.sqrt(pre).to_i
            result += 1
        end
    end
end

puts result

Measured memory_bytes: 1788
#include "bits/stdc++.h"
using namespace std;
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define hell        1000000007
#define N	    100001
#define rep(i,a,b)  for(int i=a;i<b;i++)

typedef long long ll;
ll dp[3005][3005][2];
void print(int i, int j) {	
	cout<<"DEG : "<<i<<" "<<j<<" "<<dp[i][j][0]<<" "<<dp[i][j][1]<<endl;
}
int main() {
	int n;
	cin>>n;
	vector<int> v(n);
	for(int &i : v)
		cin>>i;
	for(int j = 0; j < n; j++) {
		for(int i = j; i >= 0; i--) {
			if(i == j) {
				dp[i][j][0] = v[i];
				dp[i][j][1] = 0;
			}
			else { 
				ll first = v[i] + dp[i + 1][j][1];
				ll second = v[j] + dp[i][j - 1][1];
				if(first > second) {
						dp[i][j][0] = first;
						dp[i][j][1] = dp[i + 1][j][0];
				}
				else if(first == second) {
						dp[i][j][0] = first;
						dp[i][j][1] = min(dp[i + 1][j][0], dp[i][j - 1][0]);
				}
				else {
					dp[i][j][0] = second;
					dp[i][j][1] = dp[i][j  - 1][0];
				}
			}
		}
	}
	cout<<dp[0][n - 1][0] - dp[0][n - 1][1]<<endl;
	return 0;
}


Measured memory_bytes: 139648