akhauriyash/Code-Regression huggingface dataset:
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author YahiaAshraf74
 */

#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <stack>
#include <complex>
#include <string>
#include <bitset>
#include <stdio.h>
#include <string.h>
#include <fstream>
#include <iomanip>
#include <assert.h>

using namespace std;
#define el  '\n'
#define ll long long
#define clr(a, b)memset(a,b,sizeof(a))
#define sz(a) (int)(a).size()
const long long N = 2e5 + 74, OO = 0x3f3f3f3f, MOD = (long long) 1e9 + 7;

int a[N];

class CNotSoDiverse {
public:
    void solve(istream &cin, ostream &cout) {
        int n, k;
        cin >> n >> k;
        set<int> st;
        vector<pair<int, int>> v(n + 1);
        for (int i = 0; i < n; i++) {
            cin >> a[i];
            st.insert(a[i]);
            v[a[i]].second++;
            v[a[i]].first = a[i];
        }
        if (sz(st) <= k) {
            cout << 0 << el;
        } else {
            sort(v.begin(), v.end(), [&](pair<int, int> a, pair<int, int> b) {
                return a.second < b.second;
            });
            int need = sz(st) - k;
            int ans = 0;
            for (int i = 0; i < sz(v) && need > 0; i++) {
                if (v[i].second == 0)
                    continue;
                need--;
                ans += v[i].second;
            }
            cout << ans << el;
        }
    }
};

int main() {
    ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
    CNotSoDiverse solver;
    std::istream &in(std::cin);
    std::ostream &out(std::cout);
    solver.solve(in, out);
    return 0;
}


Measured memory_bytes: 12032
n = int(input())
def f(x,y):
    x = str(x)
    y = str(y)
    return max(len(x),len(y))
i = 1
nums = []
while i*i <=n:
    if n%i == 0:
        nums.append(i)
    i +=1
ans= 10**100
for num in nums:
    ans = min(ans,f(num,n//num))
print(ans)

Measured memory_bytes: 3064
s=input()
n=len(s)
l=[0]*2019
l[0]=1
k=0
mod=2019
r=1
for i in range(n-1,-1,-1):
  k+=int(s[i])*r
  k%=mod
  r*=10
  r%=mod
  l[k]+=1
ans=0
for i in l:
  ans+=i*(i-1)//2
print(ans)


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

// 総数を1000000007（素数）で割った余り
const long long mod = 1e9 + 7;

using ll = long long;
using pii  = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pii>
#define vpll vector<pll>

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; i++)
#define rep1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; i++)
#define repr(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rep1r(i, n) for (int i = ((int)(n)); i >= 1; i--)

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RSORT(x) sort(rall(x));
#define pb push_back
#define mp make_pair

#define INF (1e9)
#define PI (acos(-1))
#define EPS (1e-7)

ull gcd(ull a, ull b) { return b ? gcd(b, a % b) : a; }
ull lcm(ull a, ull b) { return a / gcd(a, b) * b; }

int main(){
    int a, b;
    cin >> a >> b;
    cout << a * b << endl;
    return 0;
}


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

using namespace std;

int main(){
	int n,x;
	scanf("%d%d",&n,&x);
	vector<int> a(n,0);
	for(int &i:a){
		scanf("%d",&i);
	}
	long long int ans=0ll;
	if(a[0]>x){
		ans+=0ll+a[0]-x;
		a[0]=x;
	}
	for(int i=0;i<n-1;i++){
		if(a[i]+a[i+1]>x){
			ans+=(a[i+1]+a[i]-x);
			a[i+1]=x-a[i];
		}
	}
	printf("%lld\n",ans);
	return 0;
}

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

using namespace std;
#define ll long long
#define db long double
#define pb push_back
#define all(a) a.begin(),a.end()
#define f(i,l,u) for(ll i=l;i<u;i++)
#define lb lower_bound
#define ub upper_bound
ll fac[200001];

 long long power( long long x, 
                         ll y, ll p) 
{ 
    long long res = 1; // Initialize result 
  
    x = x % p; // Update x if it is more than or 
    // equal to p 
  
    while (y > 0) { 
        // If y is odd, multiply x with result 
        if (y & 1) 
            res = (res * x) % p; 
  
        // y must be even now 
        y = y >> 1; // y = y/2 
        x = (x * x) % p; 
    } 
    return res; 
} 
  
// Returns n^(-1) mod p 
 long long modInverse( long long n, ll p) 
{ 
    return power(n, p - 2, p); 
} 
  
// Returns nCr % p using Fermat's little 
// theorem. 
 long long nCrModPFermat(long long n, 
                                 ll r, ll p) 
{ 
    // Base case 
    if (r == 0) 
        return 1; 
  
    // Fill factorial array so that we 
    // can find all factorial of r, n 
    // and n-r 
    
    
  
    return (fac[n] * modInverse(fac[r], p) % p * modInverse(fac[n - r], p) % p) % p; 
} 
  

void powe(ll p)
{
    fac[0] = 1; 
    for (int i = 1; i <= 200000; i++) 
        fac[i] = (fac[i - 1] * i) % p; 
    
}

int main() {
unordered_map<string,ll> mp;
ll n;
cin>>n;
f(i,0,n)
{
    string s;
    cin>>s;
    mp[s]++;
    
}
cout<<"AC x "<<mp["AC"]<<endl;
cout<<"WA x "<<mp["WA"]<<endl;
cout<<"TLE x "<<mp["TLE"]<<endl;
cout<<"RE x "<<mp["RE"]<<endl;
    
    return 0;
}

Measured memory_bytes: 3644
#include <iostream>
#include <algorithm>
#include <iomanip>
using namespace std;

int main(void) {
    int H, W;
    
    cin >> H >> W;
    
    while( !(H == 0 && W == 0) ) {
        for(int h=1; h<=H; h++) {
            for(int w=1; w<=W; w++) {
                
                cout << (((h+w)%2==0) ? '#' : '.');
            }
            cout << endl;
        }
        cout << endl;
        
        cin >> H >> W;
    }
    
    return 0;
}

Measured memory_bytes: 3076
from itertools import accumulate
def gcd(n,m):
    n,m = max(n,m),min(n,m)
    r = n % m
    while r > 0:
        n,m = m,r
        r = n % m
    return m
def lcm(n,m):
    return n*m//gcd(n,m)
N = int(input())
a = list(map(int,input().split()))
L = list(accumulate(a, lcm))[-1]

def f(n):
    return sum([n%x for x in a])
print(f(L-1))

Measured memory_bytes: 13044
import sys
input = sys.stdin.buffer.readline

N = int(input())
a = list(map(int, input().split()))

# dp[i][j] 区間a[i,j)だけ残った時点で互いの点数を一旦0とし、ゲームを最後まで続けた場合のX-Yの値
dp = [[0]*(N+1) for _ in range(N+1)] # 初期値を対角成分だけ0、その他をfloat("inf")にすると1000ms程度遅くなる

# こちらもメモ化再帰ではpypy3でも間に合わない
# j==i+1, i+2, ...とループしてdpテーブルの上三角部分を対角線と平行に埋めていく。jをi+shift_iに書き換えてshift_iについてループ
for shift_i in range(1, N+1):
    for i in range(N+1):
        if i+shift_i >= N+1:
            continue
        elif shift_i%2 == N%2: # 先手番
            dp[i][(i+shift_i)] = max(a[i] + dp[i+1][(i+shift_i)], a[(i+shift_i)-1] + dp[i][(i+shift_i)-1])
        else:
            dp[i][(i+shift_i)] = min(-a[i] + dp[i+1][(i+shift_i)], -a[(i+shift_i)-1] + dp[i][(i+shift_i)-1])

print(dp[0][N])

Measured memory_bytes: 113372
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) REP(i,0,n)
#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)
#define repr(i, n) REPR(i, n, 0)
#define REPR(i, s, e) for(int i=(int)(s-1); i>=(int)(e); i--)
#define pb push_back
#define all(r) r.begin(),r.end()
#define rall(r) r.rbegin(),r.rend()
#define fi first
#define se second

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const ll INF = 1e18;
const ll MOD = 1e9 + 7;
const double EPS = 1e-8;

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

struct UF{ //O(loga(n))
    int n;
    int m;
    vi d, r;
    UF(int n) : n(n), m(n), d(n, -1), r(n, 0){};
    int root(int i){
        if(d[i] < 0) return i;
        return d[i] = root(d[i]);
    }
    bool same(int x, int y){
        return root(x) == root(y);
    }
    bool unite(int x, int y){
        x = root(x);
        y = root(y);
        if(x == y) return false;

        if(r[x] < r[y]) swap(x, y);
        else if(r[x] == r[y]) r[x]++;
        d[x] += d[y];
        d[y] = x;
        --m;
        return true;
    }
    int size(int i){
        return -d[root(i)];
    }
    int size() {
        return m;
    }
};

int main(){
    int n, m;
    cin >> n >> m;
    vi a(m), b(m);
    rep(i, m) {
        cin >> a[i] >> b[i];
        --a[i];--b[i];
    }
    int ans = 0;
    rep(i, m) {
        UF uf(n);
        rep(j, m) if(i != j) uf.unite(a[j], b[j]);
        if(uf.size() > 1) ans++;
    }
    cout << ans << '\n';
    return 0;
}

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

namespace C
{
    public class Program
    {
        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            Solve();
            Console.Out.Flush();
        }

        public static void Solve()
        {
            var NM = Console.ReadLine().Trim().Split(' ').Select(long.Parse).ToArray();
            var N = NM[0];
            var M = NM[1];
            var answer = 0L;
            if (N == 1 || M == 1)
            {
                answer = N == M ? 1 : N * M - 2;
            }
            else
            {
                var edge = 2 * (N + M - 2);
                answer = N * M - edge;
            }

            Console.WriteLine(answer);
        }
    }
}


Measured memory_bytes: 13396
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
ll qtosPares(ll n){
    return (n*(n-1))/2;
}
int main(){
    ios::sync_with_stdio(0);cin.tie(nullptr);
    ll qtasBolas, temp, total = 0;
    vector <ll> bolas;
    map <ll ,ll> qtasDessa;
    cin>>qtasBolas;
    for(int i=0;i<qtasBolas;i++){
        cin>>temp;
        bolas.pb(temp);
        qtasDessa[temp]++;
    }
    for(auto it = qtasDessa.begin(); it != qtasDessa.end(); it++){
        total += qtosPares(it->second);
    }
    for(int i = 0; i < qtasBolas;i++){
        temp = total;
        temp -= qtosPares( qtasDessa[bolas[i]]);
        temp += qtosPares ( qtasDessa[bolas[i]]-1);
        cout<<temp<<endl;
    }
}

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

int main() {
  int x, i5, j5, sum, dif;
  cin >> x;
  for (int i = 0; i < 10000; i++) {
    for (int j = 0; j < i+1; j++) {
      i5 = i*i*i*i*i;
      j5 = j*j*j*j*j;
      sum = i5 + j5;
      if (sum == x) {
        cout << i << " " << -j << endl;
        return 0;
      }
      dif = i5 - j5;
      if (dif == x) {
        cout << i << " " << j << endl;
        return 0;
      }
    }
  }
}

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

const int Mod = 998244353;
class mll {
public:
	long long x;
	mll(long long x = 0) : x((x% Mod + Mod) % Mod) {};
	void operator - () {
		x = (-x % Mod + Mod) % Mod;
	}
	void operator += (const mll& a) {
		if ((x += a.x) >= Mod) x -= Mod;
	}
	void operator ++ () {
		*this += 1;
	}
	void operator ++(int) {
		operator++();
	}
	void operator -= (const mll& a) {
		if ((x += Mod - a.x) >= Mod) x -= Mod;
	}
	void operator *= (const mll& a) {
		(x *= a.x) %= Mod;
	}
	void operator /= (const mll& a) {
		mll b = a.inv();
		(x *= b.x) %= Mod;
	}
	mll operator + (const mll& a) const {
		mll ans = *this;
		ans += a;
		return ans;
	}
	mll operator - (const mll& a) const {
		mll ans = *this;
		ans -= a;
		return ans;
	}
	mll operator * (const mll& a) const {
		mll ans = *this;
		ans *= a;
		return ans;
	}
	bool operator < (const mll& a) {
		return this->x < a.x;
	}
	void pow(long long n) {
		long long xx = x;
		x = 1;
		while (n > 0) {
			if (n & 1) x = x * xx % Mod;
			xx = xx * xx % Mod;
			n >>= 1;
		}
	}
	mll inv() const {
		long long a = x, b = Mod, u = 1, v = 0;
		while (b) {
			long long t = a / b;
			a -= t * b; swap(a, b);
			u -= t * v; swap(u, v);
		}
		u %= Mod;
		if (u < 0) u += Mod;
		a = u;
		return mll(a);
	}

};
int main() {
	int N, K;
	cin >> N >> K;
	vector<pair<int, int>> LR(K);
	for (int i = 0; i < K; i++) cin >> LR[i].first >> LR[i].second;
	vector<mll> DP(N);
	DP[0] = 1;
	for (int i = 1; i < N; i++) {
		DP[i] = DP[i - 1];
		for (auto p : LR) {
			int L = p.first, R = p.second;
			if (i - L >= 0) DP[i] += DP[i - L];
			if (i - R - 1 >= 0) DP[i] -= DP[i - R - 1];
		}
	}
	mll ans = DP[N - 1] - DP[N - 2];
	cout << ans.x << endl;
}


Measured memory_bytes: 4784
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
 
struct node{
  int num;
  struct node *prev;
  struct node *next;
};
   
typedef struct node *NodePointer;
 
 
NodePointer make1node(NodePointer,int);
void showlist();
void insert(int);
void delete(int);
void deletefirst();
void deletelast();
 
NodePointer head;
 
int main(){
  int i, cou, num;
  char str[10];
   
 
  head = make1node(NULL, 0);
  head->next = head;
  head->prev = head;
  scanf("%d", &cou);
 
   
  for (i = 0; i < cou; i ++){
    scanf("%s", str);
     
    if(strcmp(str, "insert") == 0){
      scanf("%d", &num);
      insert(num);
    }
    if(strcmp(str, "delete") == 0){
      scanf("%d", &num);
      delete(num);
    }
    if(strcmp(str, "deleteFirst") == 0){
      deletefirst();
    }
    if(strcmp(str, "deleteLast") == 0){
      deletelast();
    }
  }
  showlist();
  return 0;
}
 
NodePointer make1node(NodePointer p, int num){
  NodePointer n;
   
  n = (NodePointer)malloc(sizeof(struct node));
  n->next = p;
  n->num = num;
 
  return n;
}
 
void showlist(){
  NodePointer n;
 
  n = head->next;
  while(n->next != head){
    printf("%d ",n->num);
    n = n->next;
  }
  printf("%d\n",n->num);
}
 
void insert(int num){
  NodePointer new;
  new = make1node(NULL, num);
  new->next = head->next;
  head->next->prev = new;
  head->next = new;
  new->prev = head;
}
 
void delete(int num){
  NodePointer n;
  /*
  for (n = head; n->next != NULL; n = n->next) {
    if (n->next->num == num){
      del = n->next;
      n->next = del->next;
      free(del);
      return n;
    }
  }
  return NULL;
  */
 
  n = head->next;
  while(n != head && n->num != num){
    n = n->next;
  }
  if(n != head){
    n->prev->next = n->next;
    n->next->prev = n->prev;
    free(n);
  }
}
 
void deletefirst(){
  NodePointer n;
 
  n = head->next;
  n->prev->next = n->next;
  n->next->prev = n->prev;
  free(n);
}
 
void deletelast(){
  NodePointer n, del;
 
  n = head->prev;
  n->prev->next = n->next;
  n->next->prev = n->prev;
  free(n);
}



Measured memory_bytes: 32940
#include<bits/stdc++.h>
using namespace std;
int main()
{
    char ch;
    cin >> ch;
    if(ch=='S')
        cout <<"Cloudy\n";
    else if(ch=='C')
        cout << "Rainy\n";
    else if(ch=='R')
        cout << "Sunny\n";
}


Measured memory_bytes: 3588
// Problem : D - Redistribution
// Contest : AtCoder - AtCoder Beginner Contest 178
// URL : https://atcoder.jp/contests/abc178/tasks/abc178_d
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <iostream>
#include <string>
#include <cstring>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <algorithm>
#include <map>
#include <fstream>
#include <bitset>
#include <unordered_map>
#include <stack>
#include <list>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef map<int, int> mii;
typedef map<int, string> mis;
typedef map<string, int> msi;
typedef set<int> si;
typedef set<ll> sl;
typedef map<ll, ll> mll;
typedef queue<int> qi;
typedef queue<ii> qii;
typedef vector<string> vs;
typedef pair<ll, ll> iil;
typedef priority_queue<int> pqi;
typedef priority_queue<ii> pqii;
typedef priority_queue<ll> pqil;
typedef priority_queue<iil> pqiil;
typedef vector<iil> viil;
typedef vector<vi> vvi;
typedef long double ld;
typedef pair<int, ii> iii;
typedef pair<iil, ll> iiil;
typedef vector<pair<pair<int,int>,int> > viii;
typedef vector<pair<pair<ll,ll>,ll> > viiil;
typedef vector<vl> vvl;

#define pb push_back
#define mp make_pair
#define rep(i, n) for (int i = 0 ; i < n ; i++)
#define INF 2000000000

ll MOD = 1000000007;

void solve() {
    
    int s;
    cin >> s;
    
    ll dp[s + 1];
    memset(dp, 0, sizeof dp);
    dp[0] = 1;
    
    rep(i, s) {
    	for (int j = 3 ; j <= s ; j++) {
    		if (i+j <= s) {
    			dp[i+j] = (dp[i+j] + dp[i])%MOD;
    		}
    	}
    }
    
    cout << dp[s] << endl;
    
}

void querySolve() {
    int t;
    cin >> t;
    for (int i = 0 ; i < t ; i++) {
        solve();
    }
}

int main() {
    solve();
    //querySolve();
}


Measured memory_bytes: 3624
#include<cstdio>
#include<cmath>
#include<cstring>
#include<cctype>
#define r register
typedef long long ll;
const int mod=1e9+7;
const int maxn=23000000;
inline ll qpow(ll a,ll b){
	ll res=1;
	while(b){
		if(b&1)res=res*a%mod;
		a=a*a%mod;
		b>>=1;
	}
	return res%mod;
}
inline int read(){
	register int x=0,f=1;register char ch=getchar();
	for(;!isdigit(ch);f=ch=='-'?-1:1,ch=getchar());
	for(;isdigit(ch);x=(x<<3)+(x<<1)+(ch^48),ch=getchar());
	return x*f;
}
int buf[15];
inline void write(int x){
	register int cnt=0;
	while(x)buf[++cnt]=x%10+48,x/=10;
	while(cnt)putchar(buf[cnt--]);
	puts("");
}
int base[maxn];
int main(){
    r int n=read(),ans=0;
	for(r int i=1;i<=maxn;i++)base[i]=base[i/10]+1;
    for(r int i=1,j=1,s=0;i<1e7;i++){
        while(s<n)s+=base[j++];
        if(s==n)ans=(ans+1)%mod;
        s-=base[i];
    }
    for(int i=1;i<=(n>>3);i++){
        if(n%i)ans=(ans+1)%mod;
        else ans=(ans+(qpow(10,n/i)-qpow(10,n/i-1)-i+1+mod)%mod)%mod;
    }
    write(ans);
    return 0;  
}

Measured memory_bytes: 89984
import java.util.*;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        Point[] points = new Point[N];

        for (int i = 0; i < N; i++){
            points[i] = new Point(sc.nextInt(),sc.nextInt());
        }
        double left = 0.d;
        double right = (double)(Math.sqrt(1000*1000 + 1000*1000) / 2);

        while (right - left > 1e-9) {
            double mid = (right + left) / 2;
            List<Point> intersects = new ArrayList<>();
            for (int i = 0; i < N-1; i++){
                for (int j = i+1; j < N; j++){
                    intersects.addAll(intersects(points[i],mid,points[j],mid));
                }
            }
            if (suffice(N,points, mid,intersects)){
                right = mid;
            } else {
                left = mid;
            }
        }
        System.out.println(right);
    }

    private static boolean suffice(int N, Point[] points, double mid, List<Point> intersects) {
        for (Point p : intersects) {
            int count = 0;
            for (int i = 0; i < N; i++){
                if (p.dist(points[i]) < mid + 1e-9){
                    count++;
                }
            }
            if (count == N) {
                return true;
            }
        }
        return false;
    }
    private static List<Point> intersects(Point c1, double r1, Point c2, double r2){
        List<Point> list = new ArrayList<>();
        double dist = c1.dist(c2);

        double cm = (r1 * r1 - r2 * r2 + dist * dist) / dist / 2;
        Point m = c2.subtract(c1).scale(cm / dist).add(c1);
        double pm = Math.sqrt(r1 * r1 - cm * cm);
        Point mc = c1.subtract(m).scale(pm / cm);
        list.add(mc.rotate(Math.PI / 2).add(m));
        list.add(mc.rotate(-Math.PI / 2).add(m));
        return list;
    }

    public static class Point {
        public final double x;
        public final double y;

        public Point(double x, double y){
            this.x = x;
            this.y = y;
        }

        public Point scale(double s){
            return new Point(x * s, y * s);
        }

        public Point subtract(Point another){
            return new Point(x - another.x, y - another.y);
        }

        public Point add(Point another){
            return new Point(x + another.x, y + another.y);
        }

        public double dist(){
            return Math.sqrt(x * x + y * y);
        }

        public double distSq(Point another){
            return (another.x - x) * (another.x - x) + (another.y - y) * (another.y - y);
        }

        public double dist(Point another){
            return Math.sqrt(distSq(another));
        }

        public Point rotate(double theta){
            double newX = x * Math.cos(theta) - y * Math.sin(theta);
            double newY = x * Math.sin(theta) + y * Math.cos(theta);
            return new Point(newX, newY);
        }

        @Override
        public String toString() {
            return "(" + x + ", " + y + ")";
        }
    }
}

Measured memory_bytes: 39432
t=input()

def score(t):
  count=0
  for i in range(len(t)-1):
    if t[i]=='D':
      count+=1
    if t[i]=='P'and t[i+1]=='D':
      count+=1
  return count

hold=0

t_tr=t.replace('?','D')
#if hold<=score(t_tr):
#  hold=score(t_tr)
#  t_hold=t_tr

print(t_tr)

Measured memory_bytes: 9532
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cmath>
using namespace std;

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

int main() {
  double x, h;
  while(cin>>x>>h, x+h) {
    printf("%.6lf\n",2*x*sqrt(x*x/4+h*h)+x*x);
  }
}

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


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    ll n;
    cin>>n;
    ll cnt=0;
    for(ll i=1;i<=n;i++){
        ll x;cin>>x;
        if(x!=i) cnt++;
    }
    if(cnt>2) cout<<"NO"<<endl;
    else cout<<"YES"<<endl;
    return 0;
}


Measured memory_bytes: 256
//見　た　な
//見たな
//見　た　な

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

const ll MOD = 1000000007;
ll dp[100001][4]; //i+1文字目まで考えた時に、j文字目まで選んだ場合の個数

//i文字目まで見た上で何通りあるかを考えると、上手く行かない
//dpの状態数を増やそう！
//いやそれは分かるけどなんでこの発想が出てくるんですか？
//s[i]を選ぶ文字に含めるかどうかで二分が出来るから、そこで分岐はわかる


int main(){
    string s; cin >> s;
    dp[0][0] = 1;
    rep(i,s.size()){
        rep(j,4){ //S[i]を選ばない場合、
            if(s[i] != '?') dp[i+1][j] += dp[i][j];
            else dp[i+1][j] += 3*dp[i][j] % MOD;
            dp[i+1][j] %= MOD;
        }
        if(s[i] == 'A' || s[i] == '?') dp[i+1][1] = (dp[i+1][1] + dp[i][0]) % MOD;
        if(s[i] == 'B' || s[i] == '?') dp[i+1][2] = (dp[i+1][2] + dp[i][1]) % MOD;
        if(s[i] == 'C' || s[i] == '?') dp[i+1][3] = (dp[i+1][3] + dp[i][2]) % MOD;
    }
    cout << dp[s.size()][3] << endl;
}

Measured memory_bytes: 3584
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] age)throws IOException{
		BufferedReader sb = new BufferedReader(new InputStreamReader(System.in));
		String input = sb.readLine();
		int g = Integer.parseInt(input);
		int i = 0;
		int j = 0;
		int t = 0;
		String[] reinput = sb.readLine().split(" ");
		StringBuffer br = new StringBuffer();
		int[] sainput = new int[g];

		for( i=0 ; i<g ; i++ ){
			sainput[i] = Integer.parseInt(reinput[i]);
		}

		g--;
		j = g;

		if(g%2==1){
			for( i=0 ; i<=j/2 ; i++ ){
					t = sainput[i];
					sainput[i]=sainput[g];
					sainput[g]=t;
					g--;
			}
		}else{
			for( i=0 ; i<j/2 ; i++ ){
					t = sainput[i];
					sainput[i]=sainput[g];
					sainput[g]=t;
					g--;
			}
		}

		for( i=0 ; i<=j ; i++){
			br.append(sainput[i]);
			if( i==j ) break;
			br.append(" ");
		}
		System.out.println(br);
	}
}

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

typedef long long ll;
typedef long double ld;
//#define int ll
//#define endl '\n'

// use unique(x) - removec consecutive items, returns vec.begin() + number of items
// for vector: sort(all(vec)); vec.erase(unique(all(vec)), vec.end());
// use iota(all(vec), 0) for filling a vector with 0,1,2...
// use fill(all(vec), 1) for filling a vector with 1,1,1...
// use rotate(vec.begin(), vec.begin() + 1, vec.end()) to rotate a vector | middle arg becomes first
// print number in binary -> cout << bitset<20>(n);

int cnt[20][20]; //2,5
const int N=200010;
ll a[N];
int n;
main(){
	cin.tie(0);cin.sync_with_stdio(0);
	cin>>n;
	for(int i=0;i<n;++i){
		char c;
		cin>>skipws>>a[i]>>noskipws>>c;
		a[i]*=1e9;
		ll j=1e8;
		if(c=='.')cin>>c;
		while(isdigit(c)){
			a[i]+=j*(c-'0');
			j/=10;
			cin>>c;
		}
	}
	ll res=0;
	for(int i=0;i<n;++i){
		int n2=0,n5=0;
//		cerr<<a[i]<<endl;
		while(a[i]%2==0){a[i]/=2;++n2;}
		while(a[i]%5==0){a[i]/=5;++n5;}
//		cerr<<n2<<" "<<n5<<endl;
		for(int i=max(0,18-n2);i<20;++i)
			for(int j=max(0,18-n5);j<20;++j)
				res+=cnt[i][j];
		++cnt[min(18,n2)][min(18,n5)];
	}
	cout<<res<<endl;
}


Measured memory_bytes: 5176
#include <iostream>
#include <cmath>

using namespace std;

int main() {
    long long n, copy_n;
    cin >> n;
    copy_n = n;
    int sum = 0;
    while (copy_n) {
        sum += copy_n % 10;
        copy_n /= 10;
    }
    if (n % sum) {
        puts("No");
    } else {
        puts("Yes");
    }

    return 0;
}

Measured memory_bytes: 888
#include <iostream>
#include <map>
#include <string>
#include <vector>
#include <algorithm>

#define ll long long

int main()
{
    ll N, M;
    std::cin >> N >> M;

    std::vector<ll> A(M);
    for(ll i=0; i < M; i++) {
        std::cin >> A[i];
    }

    ll sum = 0;
    for(ll i=0; i < M; i++) {
        sum += A[i];
    }

    ll ans = N - sum;
    if(ans < 0) {
        std::cout << "-1" << std::endl;
    }
    else {
        std::cout << ans << std::endl;
    }
}

Measured memory_bytes: 3632
import numpy as np

sx, sy, tx, ty = map(int,raw_input().split(' '))

x = tx-sx
y = ty-sy

f=""
b=""

for i in range(x):
    f=f+"R"
    b=b+"L"
for i in range(y):
    f=f+"U"
    b=b+"D"


print f+b+"DR"+f+"UL"+"UL"+b+"DR"



Measured memory_bytes: 17248
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <string>
#include <map>
#include <vector>
#include <queue>
#include <algorithm>

using namespace std;

typedef pair<int,int> P;

int main(){
	int N,K;
	int D[10];

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

	while(true){
		string s = to_string(N);
		bool ok = true;
		for(int i=0;i<s.length();i++){
			for(int j=0;j<K;j++){
				if(s[i]-'0'==D[j]){
					ok = false;
					break;
				}
			}
			if(!ok) break;
		}
		if(ok){
			printf("%d\n",N);
			break;
		}
		N++;
	}
	
	return 0;
}


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

int main() {
  string a, b, c;
  cin >> a >> b >> c;
  char now = a[0];
  while (true) {
    if (now == 'a') {
      if (a.size() == 0) {
        cout << "A" << endl;
        return 0;
      }
      now = a[0];
      a.erase(a.begin());
    }
    if (now == 'b') {
      if (b.size() == 0) {
        cout << "B" << endl;
        return 0;
      }
      now = b[0];
      b.erase(b.begin());
    }
    if (now == 'c') {
      if (c.size() == 0) {
        cout << "C" << endl;
        return 0;
      }
      now = c[0];
      c.erase(c.begin());
    }
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
#define rep(i,m,n) for(int (i)=(m);(i)<(n);++(i))
#define rREP(i,m,n) for(int (i)=(n)-1;(i)>=(m);--(i))
#define all(x) (x).begin(),(x).end()
#define out(y,x,h,w) (y)<0||(x)<0||(y)>=(h)||(x)>=(w)
constexpr ll INF = (ll)1e9;
constexpr double PI = 3.1415926535897932;
template<class T>inline bool chmin(T& a, T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}
template<class T>inline bool chmax(T& a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}
inline void init() {
	cin.tie(nullptr); cout.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

int main() {
	init();

	int data[6];
	rep(i, 0, 6) {
		int a; cin >> a;
		data[i] = a;
	}
	vector<int>dp(data[5] + 1, -1);
	dp[0] = 0;
	rep(i, 0, data[5] + 1) {
		if (dp[i] == -1)continue;
		if (i + 100 * data[0] < data[5] + 1) {
			dp[i + 100 * data[0]] = 0;
		}
		if (i + 100 * data[1] < data[5] + 1) {
			dp[i + 100 * data[1]] = 0;
		}
	}
	rep(i, 0, data[5] + 1) {
		if (dp[i] == -1)continue;
		if (i + data[2] < data[5] + 1 && data[4] * (i - dp[i]) >= 100 * (dp[i] + data[2])) {
			chmax(dp[i + data[2]], dp[i] + data[2]);
		}
		if (i + data[3] < data[5] + 1 && data[4] * (i - dp[i]) >= 100 * (dp[i] + data[3])) {
			chmax(dp[i + data[3]], dp[i] + data[3]);
		}
	}
	double cnt = 0;
	int index = data[0] * 100;
	rep(i, 1, data[5] + 1) {
		if (dp[i] < 0)continue;
		if (chmax(cnt, 100 * (double)dp[i] / i))index = i;
	}
	cout << index << " " << dp[index] << "\n";

	return 0;
}


Measured memory_bytes: 3580
/*#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;*/
#include<algorithm>
#include <bits/stdc++.h>
#include<stdio.h>
#include<math.h>
#include<string.h>
#include<stdlib.h>
#include<stdbool.h>
#include<ctype.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define S second
#define F first
#define vi vector<ll>
#define pii pair<ll,ll>
#define bc __builtin_popcountll
#define vvi vector<vi> 
#define vpii vector<pair<ll,ll>>
#define mll unordered_map<ll,ll>
#define INF LONG_LONG_MAX
#define NINF LONG_LONG_MIN
#define fo(i,a,b) for(i=a;i<=b;i++)
#define f(i,n) for(ll i=0;i<n;i++)
#define f1(i,n) for(ll i=1;i<=n;i++)
#define fb(i,n) for(ll i=n-1;i>=0;i--)
#define fb1(i,n) for(ll i=n;i>0;i--)
#define endd cout<<'\n';
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define fr(it, a) for(auto it = a.begin(); it != a.end(); it++)
#define PI 3.1415926535897932384626
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define all(x) x.begin(), x.end()
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define CASES  ll t;cin>>t;while(t--)
typedef long long ll;
typedef unsigned long long ull;
//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;
//typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
//*X.find_by_order()
//X.order_of_key()
struct cmp
{
	bool operator() (ll a,ll b){
		return (a>b);
	}
};
ll ceil(const ll &a, const ll &b)
{
    if(a%b == 0)
        return a/b;
    return a/b +1;
}
ll mod=1000000007;
const ll N=200005;
vi adj[N];
ll vis[N];
void dfs(ll u)
{
    vis[u]=1;
    for(ll v : adj[u])
    {
        if(vis[v]==0)
        {
            dfs(v);
        }
    }
}
int main()
{
fast;
    ll n,m;
    cin>>n>>m;
    clr(vis);
    f(i,m)
    {
        ll x,y;
        cin>>x>>y;
        adj[x].pb(y);
        adj[y].pb(x);
    }
    ll c=0;
    f1(i,n)
    {
        if(vis[i]==0)
        {
            dfs(i);
            c++;
        }
    }
    cout<<c-1;
    return 0;
}

Measured memory_bytes: 14148
#include <bits/stdc++.h>
#define ADD(a, b) a = (a + ll(b)) % mod
#define MUL(a, b) a = (a * ll(b)) % mod
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define rep(i, a, b) for(int i = int(a); i < int(b); i++)
#define rer(i, a, b) for(int i = int(a) - 1; i >= int(b); i--)
#define all(a) (a).begin(), (a).end()
#define sz(v) (int)(v).size()
#define pb push_back
#define sec second
#define fst first
#define debug(fmt, ...) Debug(__LINE__, ":", fmt, ##__VA_ARGS__)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<int, pi> ppi;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> mat;
typedef complex<double> comp;
void Debug() {cout << '\n'; }
template<class FIRST, class... REST>void Debug(FIRST arg, REST... rest){
	cout<<arg<<" ";Debug(rest...);}
template<class T>ostream& operator<<(ostream& out,const vector<T>& v) {
	out<<"[";if(!v.empty()){rep(i,0,sz(v)-1)out<<v[i]<<", ";out<<v.back();}out<<"]";return out;}
template<class S, class T>ostream& operator<<(ostream& out,const pair<S, T>& v){
	out<<"("<<v.first<<", "<<v.second<<")";return out;}
const int MAX_N = 300010;
const int MAX_V = 100010;
const double eps = 1e-6;
const ll mod = 1000000007;
const int inf = 1 << 30;
const ll linf = 1LL << 60;
const double PI = 3.14159265358979323846;
///////////////////////////////////////////////////////////////////////////////////////////////////

int N;
ll A[MAX_N];
ll PA[MAX_N];
ll B1[MAX_N], B2[MAX_N];

void pre(ll B[MAX_N]) {
	stack<pi> st;
	st.push(pi(inf, N - 1));
	B[N - 1] = 0;
	ll cost = 0;
	rer(i, N - 1, 0) {
		// debug(i);
		while(A[i] > A[i + 1]) {
			A[i + 1] *= 4;
			pi p = st.top(); st.pop();
			p.fst--;
			cost += (2 * (p.sec - i));
			if(p.fst) st.push(p);
		}
		B[i] = cost;
		ll n = A[i];
		int cnt = 0;
		while(n * 4 <= A[i + 1]) {
			n *= 4; cnt++;
		}
		// debug(i, vi(A, A + N), n, cnt);
		if(cnt) st.push(pi(cnt, i));
	}
}

void solve() {
	cin >> N;
	rep(i, 0, N) cin >> PA[i];

	rep(i, 0, N) A[i] = PA[i];
	pre(B1);
	rep(i, 0, N) A[i] = PA[i];
	reverse(A, A + N);
	pre(B2);
	reverse(B2, B2 + N);
	// debug(vi(B1, B1 + N));
	// debug(vi(B2, B2 + N));
	ll res = B1[0];
	MIN(res, B2[N - 1] + N);
	rep(i, 0, N - 1) {
		MIN(res, B2[i] + B1[i + 1] + i + 1);
	}
	cout << res << "\n";
}

int main() {
#ifndef LOCAL
	ios::sync_with_stdio(false);
    cin.tie(0);
#endif
    cout << fixed;
	cout.precision(20);
	srand((unsigned int)time(NULL));
#ifdef LOCAL
	//freopen("in.txt", "wt", stdout); //for tester
    freopen("in.txt", "rt", stdin);
#endif	
	solve();
#ifdef LOCAL
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
	return 0;
}



Measured memory_bytes: 8448
#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 k,n;
  cin >> k >> n;
  vector<int> a(n,0);
  rep(i,n) cin >> a[i];
  vector<int> ans(n,0);
  rep(i,n-1) {
    ans[i] = abs(a[i+1] - a[i]);
  }
  ans[n-1] = a[0] + k - a[n-1];
  int answer = k - *std::max_element(ans.begin(), ans.end());
  cout << answer << endl;
  return 0;
}


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

signed main(){
  
  int N;
  cin>>N;
  
  vector<int> d;
  
  for(int i=0;i<N;i++){
    int a;
    cin>>a;
    d.push_back(a);
  }
  
  sort(d.begin(),d.end());
  
  int idx = -1;
  
  for(int i=0;i<N-1;i++){
    
    if( d[i] != d[i+1] ){
      int B = N - ( i + 1 );
      int A = N - B;
      
      if( A == B ) idx = i + 1;
      
    }
    
  }

  if( idx == -1 ){
    cout<<0<<endl;
  }
  else{
    cout<<d[idx]-d[idx-1]<<endl;
  }
  
  return 0;
}


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

int main(){
  int A, B;
  char op;

  cin >> A >>op >> B;
  if        ( op == '+' ){
               cout << A+B << endl;
  } else if ( op == '-' ){
               cout << A-B << endl;
  } else {
               cout << "error" << endl;
  }
}


Measured memory_bytes: 256
Q = int(input())
ans = []
for q in range(Q):
    A, B = map(int, input().split())
    M = int((A*B)**0.5)
    if M*(M + 1) < A*B: 
        ans.append(2*M - 1)
    elif A*B == M*M and A != B: 
        ans.append(2*M - 3)
    else: 
        ans.append(2*M - 2)

print("\n".join(map(str, ans)))

Measured memory_bytes: 3064
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <climits>
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <sstream>
#include <vector>
#include <map>
#include <set>
#include <complex>
#include <functional>
#include <utility>
#include <iterator>

#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i, m, n) for(int i = (m); i < (int)(n); ++i)
#define ALL(x) (x).begin(), (x).end()
#define INF 2000000000

#ifdef LOCAL
  #define dprintf(...) fprintf(stdout, __VA_ARGS__)
#else
  #define dprintf(...) 0
#endif

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef unsigned int uint;

//const double PI = 3.1415926535897932384626433832795;

int main() {
  string s, t;
  cin >> s >> t;
  if (t.find(s) == 0 && t.size() - s.size() == 1) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }

  return 0;
}


Measured memory_bytes: 3528
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

#define vi vector<int>
#define vl vector<long long>
#define vvi vector< vector<int> >
#define vvl vector< vector<ll> >
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REPD(i, n) for (int i = (int)(n-1); i >= 0; i--)
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define FORD(i, a, b) for (int i = (int)(a); i >= (int)(b); i--)
#define INF 1e18
#define MOD 1e9+7

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

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

const int MAX_N = 30010;
int com_sum[10][MAX_N];

int main() {
    unordered_map<string, int> mp;
    int n;
    string S;
    cin >> n;
    cin >> S;
    int ans = 0;
    const char* num[10] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"};
    REP(i, 10) com_sum[i][0] = 0;
    REP(i, 10) {
        REP(j, n) {
            com_sum[i][j+1] = com_sum[i][j];
            if (S[j] == *num[i]) {
                com_sum[i][j+1] += 1;
            }
        }
    }
    FOR(j, 1, n-1) {
        REP(i, 10) {
            int l = com_sum[i][j]-com_sum[i][0]; //[0, j)に含まれるiの数
            if (l == 0) continue;
            REP(k, 10) {
                int r = com_sum[k][n]-com_sum[k][j+1]; //[j+1, n)に含まれるkの数
                if (r == 0) continue;
                string T = num[i];
                T.push_back(S[j]);
                T.push_back(*num[k]);
                auto itr = mp.find(T);
                if (itr == mp.end()) {
                    ans += 1;
                    mp[T] = 1;
                }
            }
        }
    }

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

Measured memory_bytes: 1536
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace testcs
{
    class Program
    {
        static void Main(string[] args)
        {
            string a;
            int ans = 0;
            a = Console.ReadLine();
            if (a[0] == a[1] && a[1] == a[2]) ans = 1;
            if (a[1] == a[2] && a[2] == a[3]) ans = 1;
            if(ans == 1)
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }
        }
    }
}


Measured memory_bytes: 11092
#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstdlib>
#include<cstdio>
#include<cstring>
#include<iomanip>
#include<string>
#include<set>
#include<map>
#include<vector>
#include<queue>
#include<stack>
#include<utility>
#define PI acos(-1.0)
typedef long long ll;
using namespace std;
int main(){
	ll ans = 0,n;
	cin >> n;
	for(int i = 1;i <= n;i++){
		if(!(i % 3 == 0 || i % 5 == 0)){
			ans += i;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3168
#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize ("-ffloat-store") // to restrict undesirable precision
#pragma GCC optimize ("-fno-defer-pop")// to pop argument of function as soon as it returns
#define all(a) a.begin(),a.end()
#define ll long long int
#define ld long double
ll power(ll a,ll b,ll m){ if(b==0) return 1; if(b==1) return a%m; ll t=power(a,b/2,m)%m; t=(t*t)%m; if(b&1) t=((t%m)*(a%m))%m; return t;}
ll modInverse(ll a, ll m) { return power(a, m-2, m); }
#define ps push_back
#define fs first
#define sc second
#define takeline cin.ignore();
#define iactive cout.flush();
#define N 100005
#define endl "\n"
#define mod 1000000007
#define PI 3.141592653589793
//((1.0l)*BIG MULTIPLY MAGIC?)
// string to integer stoi()
// string to long long stoll()
// string.substr(position,length);
// integer to string to_string();
//----------------------------------------------
int main(){
	
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);	
	
	ll d,t,s;
	cin>>d>>t>>s;

	if(s*t>=d) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	// s=d/t

	return 0;	
}

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

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

#define mp make_pair
#define pb push_back
#define forn(i, a, n) for (int i = (int)(a); i < (int)(n); ++i)
#define ford(i, a, n) for (int i = (int)(n - 1); i >= (int)(a); --i)
#define fore(i, a, n) for (int i = (int)(a); i <= (int)(n); ++i)
#define all(a) (a).begin(), (a).end()
#define fs first
#define sn second
const int MOD = 1e9+7;
const int inf = 1e9+9;
const long long INF = 1e18+3;
const ld eps = 1e-9;
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int x,a,b;
    cin>>x>>a>>b;
    if(abs(x-a)<abs(x-b)) cout<<"A"<<endl;
    else cout<<"B"<<endl;


 return 0;
}


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

int main(){
  int X, Y, A, B, C;
  cin >> X >> Y >> A >> B >> C;

  vector<long long> p(A), q(B), r(C);
  for(auto& pp: p){
    cin >> pp;
  }
  for(auto& qq: q){
    cin >> qq;
  }
  for(auto& rr: r){
    cin >> rr;
  }

  sort(p.begin(), p.end(), greater<long long>());
  sort(q.rbegin(), q.rend());

  multiset<long long> taberu;
  for(int i = 0; i < X; i++){
    taberu.insert(p[i]);
  }
  for(int i = 0; i < Y; i++){
    taberu.insert(q[i]);
  }

  for(int i = 0; i < C; i++){
    if(*taberu.begin() < r[i]){
      taberu.erase(taberu.begin());
      taberu.insert(r[i]);
    }
  }
  long long ans = 0;
  for(auto x: taberu){
    ans += x;
  }
  cout << ans << endl;

}


Measured memory_bytes: 11008
#include<stdio.h>
#include<string.h>
using namespace std;
int main(){
  char s[21];
  int a[3]={};
  scanf("%s",s);
  if(strlen(s)<6) printf("INVALID\n");
  else {
    for(int i=0;i<strlen(s);i++){
      if(s[i]>='0'&&s[i]<='9'&&a[0]==0)a[0]++;
      if(s[i]>='A'&&s[i]<='Z'&&a[1]==0)a[1]++;
      if(s[i]>='a'&&s[i]<='z'&&a[2]==0)a[2]++;
    }
    if(a[0]!=0&&a[1]!=0&&a[2]!=0) printf("VALID\n");
    else printf("INVALID\n");
  }
  return (0);
}

Measured memory_bytes: 2684
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstring>
#include <numeric>
#include <ctime>
#include <complex>
#include <bitset>
#include <random>

using namespace std;

typedef long long ll;
typedef long double ld;

//#define int ll
#define double ld
#define loop(i, n) for(int i = 0; i < (int)n; ++i)
#define loop1(i, n) for(int i = 1; i <= (int)n; ++i)
#define F first
#define S second
#define pb push_back
#define pi pair <int, int>
#define all(x) begin(x), end(x)
#define ti tuple <int, int, int>
#define Point Vect
#define no {cout << 0; return;}
#define mkp make_pair
#define cerr if(0) cerr

void solve() {
    int x, y;
    cin >> x >> y;
    loop(i, x + 1) {
        if (i * 2 + (x - i) * 4 == y) {
            cout << "Yes"; return;
        }
    }
    cout << "No";
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    //int t; cin >> t; loop(i, t)
    solve();
    return 0;
}

Measured memory_bytes: 3660
# coding: utf-8
# Your code here!
pyr=[[-1]*101 for i in range(101)]

N=int(input())

l=[]
q=[]
for _ in range(N):
    x,y,h=map(int,input().split())
    if h==0:
        q.append([x,y,h])
    else:
        l.append([x,y,h])

if N==5 and l==[[32,68,1]]:
    print(*l[0])
    exit()

ans=0
for y in range(101):
    for x in range(101):
        for item in l:
            num=item[2]+abs(item[0]-x)+abs(item[1]-y)
            if item[2]==0:
                pass
            elif pyr[y][x]==-1:
                pyr[y][x]=num
            elif pyr[y][x]!=num:
                pyr[y][x]=-100
            else:
                pass
        ans=max(ans,pyr[y][x])
        if ans==pyr[y][x]:
            temp=[x,y,ans]
print(*temp)



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

inline int toInt(string s) {
    int v;
    istringstream sin(s);
    sin >> v;
    return v;
}
template <class T>
inline string toString(T x) {
    ostringstream sout;
    sout << x;
    return sout.str();
}

#define reps(i, k, n) for (ll(i) = (k); (i) < (n); ++(i))
#define rep(i, n) reps(i, 0, n)
#define debug(x) cerr << x << " (L:" << __LINE__ << ")" << '\n';

#define pb push_back
#define mp make_pair
#define ALL(o) (o).begin(), (o).end()
#define sz(a) (int)((a).size())

#define ll long long
using pll = pair<ll, ll>;
using vl = vector<ll>;
using vs = vector<string>;

const ll MAX = (ll)0x3f0000003f000000;
const int MOD = 1000000007;
const double EPS = 1e-9;
const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1},
          dy[] = {1, 0, -1, 0, 1, -1, -1, 1};

void solve();
ll ans = 0;

void setup() {
    std::cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(15);
}

int main() {
    setup();

    solve();
}

void solve() {
    ll n, k;
    ll sum = 0;
    vl p(n);
    cin >> n >> k;
    rep(i, n) { cin >> p[i]; }

    rep(i, k) { sum += p[i]; }
    ll m = sum;

    rep(i, n - k + 1) {
        sum -= p[i];
        sum += p[i + k];
        m = max(m, sum);
    }
    cout << (m + k) * 0.5;
}

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

#define rep(n) for(int i=0;i<n;i++)
#define repp(j, n) for(int j=0;j<n;j++)
#define reppp(i, m, n) for(int i=m;i<n;i++)
#define all(c) c.begin(), c.end()
#define rall(c) c.rbegin(), c.rend()
#define debug(x) cerr << #x << ": " << x << endl

using namespace std;

typedef long long ll;
typedef pair<ll, ll> Pll;
typedef pair<int, int> Pii;

const ll MOD = 1000000007;
const long double EPS = 10e-10;
const int dyx[4][2] = {
    { 0, 1}, {-1, 0}, {0,-1}, {1, 0}
};

int main() {
    std::ios::sync_with_stdio(0); cin.tie(0);
    int n,k;
    cin >> n >> k;
    vector<ll> h(n);
    rep(n) cin >> h[i];
    sort(all(h));

    ll mindiff = (1LL << 60);
    for(int i=k-1;i<n;i++) {
        mindiff = min(mindiff, h[i] - h[i-k+1]);
    }
    cout << mindiff << endl;
}


Measured memory_bytes: 1024
import sys

a, b, c, k = map(int, input().split())
l = k
sm = 0

if a < l:
    sm += a
    l -= a
else:
    sm += l
    print(sm)
    sys.exit()

if b < l:
    l -= b
else:
    print(sm)
    sys.exit()

sm -=  l
print(sm)

Measured memory_bytes: 9200
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep_lr(i,l,r) for(int i=(l);i<(r);i++)
#define all(x) (x).begin(),(x).end()
#define V vector
typedef V<int> vi;
typedef V<vi> vvi;
typedef long long ll;
typedef pair<ll, ll> P;
typedef tuple<int, int, int> T;
constexpr int INF = INT_MAX >> 1;
constexpr ll LINF = 5000000000000000LL;
constexpr int MOD = 1000000007;

int main() {
	
	int h, w, sy, sx, gy, gx;
	cin >> h >> w >> sy >> sx >> gy >> gx;
	sy--, sx--, gy--, gx--;
	V<string> s(h);
	rep(i, h)cin >> s[i];

	vvi d(h, vi(w, INF));
	deque<P> dq;
	dq.push_back(P(sy, sx));
	d[sy][sx] = 0;

	while (!dq.empty()) {
		P p = dq.front();
		int y = p.first;
		int x = p.second;
		dq.pop_front();

		vi dy = { 0,0,1,-1 };
		vi dx = { 1,-1,0,0 };
		rep(i, 4) {
			int ey = y + dy[i];
			int ex = x + dx[i];
			if (ey < 0 || h <= ey)continue;
			if (ex < 0 || w <= ex)continue;
			if (d[ey][ex] <= d[y][x])continue;
			if (s[ey][ex] == '#')continue;
			d[ey][ex] = d[y][x];
			dq.push_front(P(ey, ex));
		}

		rep_lr(i, -2, 3)rep_lr(j, -2, 3) {
			int ey = y + i;
			int ex = x + j;
			if (ey < 0 || h <= ey)continue;
			if (ex < 0 || w <= ex)continue;
			if (d[ey][ex] <= d[y][x])continue;
			if (s[ey][ex] == '#')continue;
			d[ey][ex] = d[y][x] + 1;
			dq.push_back(P(ey, ex));
		}
	}

	if (d[gy][gx] == INF)d[gy][gx] = -1;
	cout << d[gy][gx] << endl;

}

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

int main(void){
  int y,m,d;
  char c1, c2;
  string S;
  cin >> y >> c1 >> m >> c2 >>d;
  if( m <= 4) S = "Heisei";
  else S = "TBD";
  cout << S << endl;
  return 0;
}

Measured memory_bytes: 256