akhauriyash/Code-Regression huggingface dataset:
//xtwakioi! xtwddYnoi(双重含义)!
#include <bits/stdc++.h>
#define ri register
#define int long long
#define E (n+1)
using namespace std; const int N=400010;
inline int read()
{
    int s=0, w=1; ri char ch=getchar();
    while(ch<'0'||ch>'9') { if(ch=='-') w=-1; ch=getchar(); }
    while(ch>='0'&&ch<='9') s=(s<<3)+(s<<1)+(ch^48), ch=getchar();
    return s*w;
}
int n,a[N],b[N];
int ta[N],tb[N];
inline int S1(int x) { return ta[x]+tb[x]; }
int f[N],g[N],tot,qwq,pp;
signed main()
{
    n=read();
    for(ri int i=1;i<=n;i++) a[i]=read();
    for(ri int i=1;i<=n;i++) b[i]=read();
    for(ri int i=1;i<=n;i++) ta[a[i]]++;
    for(ri int i=1;i<=n;i++) tb[b[i]]++;
    for(ri int i=1;i<=n;i++) if(S1(i)>n) { puts("No"); return 0; }
    puts("Yes");
    for(ri int i=1;i<=n/2;i++) swap(b[i],b[n-i+1]);
    for(ri int i=1;i<=n;i++)
    {
        if(a[i]^b[i]) continue;
        qwq=b[i];
        f[++tot]=i, pp++;
    }
    for(ri int i=1;i<=n;i++)
    {
        if(a[i]==b[i]) continue;
        if(!tot) break;
        if((a[i]^qwq) && (b[i]^qwq))
        {
            g[tot]=i, tot--;
        }
    }
    for(ri int i=1;i<=pp;i++) swap(b[g[i]],b[f[pp-i+1]]);
    for(ri int i=1;i<=n;i++) printf("%lld ",b[i]);
    puts("");
    return 0;
}

Measured memory_bytes: 10952
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = s; i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << endl;
#define CFYN(n) cout << ( (n) ? "YES":"NO") << endl;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;

int main(void)
{
    IOS
    const double PI=3.14159265358979323846;
    double a,b,x;
    cin >> a >> b >> x;
    double s = x / a;
    //cerr << s << endl;
    double ans = 0;
    double la = 0;
    if ( s == a * b) {
        ans = 0;
    } else {
        if (s >= b * a / 2) {
            double ub = 2 * s / a - b;
            //cerr << "ub:" <<ub << endl;
            s -= a * ub;
            b -= ub;
            la = 2 * s / b;
        } else {
            la = 2 * s / b;
        }
        //cerr<<la << endl;
        auto r = atan(b/la);
        //cerr << r << endl;
        ans = r * (180.0 / PI); 
    }
    cout << fixed << setprecision(10) << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
int main(void){
  int N,M,c;
  cin >> N >> M >> c;
  
  vector<int>keisuu(M);
  for(int i=0;i<M;i++){
    cin >> keisuu[i];
  }
  
  vector<vector<int>>code(N,vector<int>(M));
  for(int i=0;i<N;i++){
    for(int j=0;j<M;j++){
      cin >> code[i][j];
    }
  }
  int calc;
  int ans = 0;
  for(int i=0;i<N;i++){
    calc = 0;
    for(int j=0;j<M;j++){
      calc = calc + code[i][j] * keisuu[j];
    }
    if(calc + c > 0)
      ans++;
  }
  
  cout << ans << endl;
  
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
int main()
{
	int N;
	scanf("%d", &N);
	if (N % 2 == 0)
	{
		N /= 2;
		printf("%d", N);
	}
	else {
		N = (N + 1) / 2;
		printf("%d", N);
	}
	return 0;
}

Measured memory_bytes: 3188
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
inf = 10**17
mod = 10**9 + 7


a=I()
b=I()
h=I()
ans=(a+b)*h//2
print(ans)

Measured memory_bytes: 3316
s = input()

if len(s)<3:
    print(0)
    exit()

i = 0
while True:
    if s[i:i+2]=='BC':
        s=s[:i]+'D'+s[i+2:]
    i+=1
    if i>=len(s):
        break


s1 = s.split('B')
s2 = []
for i in range(len(s1)):
    s2+= s1[i].split('C')


ans = 0

for i in range(len(s2)):
    d = s2[i].count('D')
    for j in range(len(s2[i])):
        if s2[i][j]=='A':
            ans += d
        else:
            d-=1
            if d == 0:
                break

print(ans)

Measured memory_bytes: 6988
fn main(){
    let r: Vec<f64> = read_vec();
    println!("{:.10}", r[0] * r[1] / (r[0] + r[1]));
}

#[allow(dead_code)]
fn read_vec<T>() -> Vec<T>
where T: std::str::FromStr,
      T::Err: std::fmt::Debug
{
    let mut buf = String::new();
    std::io::stdin().read_line(&mut buf).expect("failed to read");
    buf.split_whitespace().map(|e| e.parse().unwrap()).collect()
}


Measured memory_bytes: 2172
#include <bits/stdc++.h>
#define For(i, a, b) for(int (i)=(a); (i)<(b); ++(i))
#define rFor(i, a, b) for(int (i)=(a)-1; (i)>=(b); --(i))
#define rep(i, n) For((i), 0, (n))
#define rrep(i, n) rFor((i), (n), 0)
#define fi first
#define se second
using namespace std;
typedef long long lint;
typedef unsigned long long ulint;
typedef pair<int, int> pii;
typedef pair<int, lint> pil;
typedef pair<pii, lint> ppl;
typedef complex<double> xy_t;
typedef pair<xy_t, int> pci;
typedef vector<lint> poly;
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;}

constexpr lint mod = 1e9+7;
constexpr lint INF = mod*mod;
constexpr int MAX = 100010;

int main(){
    lint a, b, K;
    cin>>a>>b>>K;
    if(a>=K) cout<<a-K<<" "<<b<<endl;
    else if(a+b>=K) cout<<0<<" "<<b-(K-a)<<endl;
    else cout<<0<<" "<<0<<endl;
}

Measured memory_bytes: 256
n = int(input())
G = []
for i in range(n):
    G.append(input().split())
    for j in range(len(G[i])):
        G[i][j] = int(G[i][j])

ans = 0
mincost = [2001] * n
flag = [0] * n
mincost[0] = 0
while True:
    v = -1
    for j in range(n):
        if flag[j] != 1 and (v == -1 or mincost[j] < mincost[v]):
            v = j
    if v == -1:
        break
    flag[v] = 1
    ans += mincost[v]
    for j in range(n):
        if G[v][j] == -1: continue
        mincost[j] = min(mincost[j], G[v][j])

print(ans)

Measured memory_bytes: 7856
#include<iostream>
#include<algorithm>
#include<string>
#include<map>
#include<cmath>
#include<vector>
#include<queue>
#include<set>
#include<stdio.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define INF 1e9
int ma[502][502];
int main()
{
	int n, m ,q;
	cin >> n >> m >> q;
	rep(i, m) {
		int x, y;
		cin >> x >> y;
		ma[x][y] += 1;
	}
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= n; j++) {
			ma[i][j] += ma[i][j - 1];
		}
	}
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= n; j++) {
			ma[i][j] += ma[i - 1][j];
		}
	}
	rep(i, q) {
		int x, y;
		cin >> x >> y;
		printf("%d\n", ma[y][y] + ma[x - 1][x - 1] - ma[x - 1][y] - ma[y][x - 1]);
	}
	return 0;
}

Measured memory_bytes: 1920
# -*- coding: utf-8 -*-

while True:
    n, x = map(int, raw_input().split())
    if n == x == 0:
        break
    count = 0
    for a in range(1, n+1):
        for b in range(a+1, n+1):
            for c in range(b+1, n+1):
                if a+b+c == x:
                    count += 1
                    break
    print count

Measured memory_bytes: 6440
n = gets.to_i
s = gets.chomp
left = 0
right = 0
n.times do |i|
  if s[i] == ')'
    if right == 0
      left += 1
    else
      right -= 1
    end
  else
    right += 1
  end
end
puts ''.concat('(' * left).concat(s).concat(')' * right)

Measured memory_bytes: 1788
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<numeric>
#include<map>
#include<iostream>
using namespace std;
#define rep(i,n) for(int i = 0;i<((int)(n));i++)
#define reg(i,a,b) for(int i = ((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i = ((int)(n)-1);i>=0;i--)
#define ireg(i,a,b) for(int i = ((int)(b));i>=((int)(a));i--)
typedef long long ll;
typedef pair<ll, ll> mp;

int sukunai(int a,int b){
	if(a>b)return b;
	return a;
}


int main(void){
	ll N,Ma,Mb,a[42],b[42],c[42];
	int dp[42][410][410]; // dp[i][Ma][Mb]
	scanf("%lld%lld%lld",&N,&Ma,&Mb);
	rep(i,N)scanf("%lld%lld%lld",&a[i],&b[i],&c[i]);
	reg(i,0,N)reg(j,0,400)reg(k,0,400)dp[i][j][k]=1e9;
	dp[0][0][0]=0;
	rep(i,N){
		rep(j,400){
			if(j+a[i]>400)break;
			rep(k,400){
				if(k+b[i]>400)break;
				dp[i+1][j+a[i]][k+b[i]] = sukunai(dp[i][j+a[i]][k+b[i]], dp[i][j][k]+c[i]);//加える
				dp[i+1][j][k] = sukunai(dp[i][j][k], dp[i+1][j][k]);//加えない
			}
		}
	}
	ll small=1e9;
	reg(i,1,400){
		if(i*Ma>400 || i*Mb>400)break;
		small = sukunai(small, dp[N][i*Ma][i*Mb]);
	}
	if(small==1e9)small=-1;
	printf("%lld\n",small);
	return 0;
}

Measured memory_bytes: 27392
#include <iostream>

using namespace std;

int main(){
  int a, b, c;
  std::cin >> a >> b >> c;
  if(a == b && b != c){
    std::cout << "Yes" << '\n';
  }else if(b == c && a != c){
    std::cout << "Yes" << '\n';
  }else if(a == c && a != b){
    std::cout << "Yes" << '\n';
  }else{
    std::cout << "No" << '\n';
  }
  return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
int main()
{
    long long int sum,s[10],n;
    scanf("%lld",&n);
    for(int i=0;i<5;i++)
        scanf("%lld",&s[i]);
    sort(s,s+5);
    if(n%s[0]==0)
        sum=4+n/s[0];
    else
        sum=5+n/s[0];
    printf("%lld\n",sum);
    return 0;
}


Measured memory_bytes: 256
# coding: utf-8
# Your code here!
N=int(input())
word=""
wordb=""
flag=0
lis=[]
for i in range(N):
    word=input()
    lis.append(word)
    if i!=0:
        if word[0]!=wordb[len(wordb)-1]:
            flag=1
            break
    wordb=word
for j in range(len(lis)):
    if lis.count(lis[j])>1:
        flag=1
        break
if flag==0:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3064
n = int(input())
arr = [[0]*n,[0]*n]
arr[0] = list(map(int,input().split()))
arr[1] = list(map(int,input().split()))

s = 0
for i in range(n):
    s = max(s,sum(arr[0][:i+1]) + sum(arr[1][i:]))
print(s)

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

def main():
    n,k = map(int,ipt().split())
    a = [int(i) for i in ipt().split()]
    sa = sum(a)
    for i in range(k):
        mov = [0]*n
        for i,ai in enumerate(a):
            if i-ai >= 0:
                mov[i-ai] += 1
            else:
                mov[0] += 1
            if i+ai+1 < n:
                mov[i+ai+1] -= 1
        na = a*1
        sna = sa
        a[0] = mov[0]
        sa = mov[0]
        for i in range(1,n):
            a[i] = a[i-1]+mov[i]
            sa += a[i]
        if sna == sa:
            break
    print(" ".join(map(str,a)))

    return

if __name__ == '__main__':
    main()


Measured memory_bytes: 173540
#include <iostream>
#include <stdio.h>       // printf,scanf
#include <stdlib.h>
#include <math.h>
#include <string>
#include <vector>
#include <algorithm>  //sort,binarySearch
#include <functional> 
#include <iomanip> // setprecision
#include <utility>    // c+11 Array
#include <set>
#include <sstream>
#include <bits/stdc++.h>
#define PI 3.141592653589793238462643383279
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define pb(x) push_back(x)
#define debug(x) cout << #x << " = " << x << endl;
#define debret(x) debug(x) ; return 0;

using namespace std;

int main(void) {
    
	int n, k;
	int hate[10];
	bool flag;
    string str;
 
	cin >> n >> k;

    REP(i,k) cin >> hate[i];

    for (int i = n; ; i++) {
		str = to_string(i);
        //debug(str);
		flag = true;
        REP(j,k){
            //debug(to_string(hate[j]))
			if (str.find(to_string(hate[j])) != -1) {
				flag = false;
				break;
			}
		}
		if (flag) {
			cout << i << endl;
			break;
		}
	}
 
	return 0;
}


Measured memory_bytes: 256
N, K = gets.split.map{|i|i.to_i}
A = Array.new(10 ** 5 + 1){0}
N.times{
    a, b = gets.split.map{|i|i.to_i}
    A[a] += b
}
i = 0
k = 0
loop{
    i += 1
    k += A[i]
    if k >= K
        break
    end
}
puts i


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

int main() {
	ll n, s;
	scanf("%lld%lld", &n, &s);
	int w = sqrt(n) + 1;
	f(i, 2, w + 1) {
		ll x = n, sum = 0;
		while (x) {
			sum += x%i;
			x /= i;
		}
		if (sum == s) { printf("%d", i); return 0; }
	}
	ll bg = w;
	for (; w > 0; --w) {
		ll r = n / w, l = n / (w + 1);
		l = max(l, bg);
		if (l > r)continue;
		ll d = n%r;
		ll x = s - w - d;
		if (x >= 0 && x%w == 0) { 
			ll an = r - x / w;
			if (an > l) { printf("%lld", an); return 0; }
		}
	}
	if (n == s)printf("%lld", n + 1);
	else printf("-1");
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define full(a) a.begin(),a.end()
#define rfull(a) a.rbegin(),a.rend()

using namespace std;
const double pi=acos(-1.0);
const double pii=2*pi;
const double eps=1e-6;
const long long MOD=1e9+7;

void solve(){
    int n;
    cin>>n;
    vector<int> a(n,0);
    for(int i=0;i<n;i++) cin>>a[i];
    int si=0;
    for(int i=0;i<n;i++) si^=a[i];
    for(int i=0;i<n;i++) cout<<(si^a[i])<<(i+1<n?" ":"\n");
}

int main(){
    std::ios::sync_with_stdio(false);
    std::cin.tie(NULL);
    std::cout.tie(NULL);

    solve();
    return 0;
}

Measured memory_bytes: 3980
#include<vector>
#include<cmath>
#include<map>
#include<cstdlib>
#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<set>
#include<stack>
#include<bitset>
#include<functional>
#include<ctime>
#include<queue>
#include<deque>
#include<complex>
#include<cassert>
using namespace std;
#define pb push_back
#define pf push_front
typedef long long lint;
typedef complex<double> P;
#define mp make_pair
#define fi first
#define se second
typedef pair<int,int> pint;
#define All(s) s.begin(),s.end()
#define rAll(s) s.rbegin(),s.rend()
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
lint a[200100],s[100100];
map<lint,lint> me;
int main()
{
	int n;lint ze=1,out=0,sum=0;me[0]++;
	cin>>n;s[0]=0;
	rep(i,n){
		cin>>a[i];sum+=a[i];
		out+=me[sum];me[sum]++;
	}
	cout<<out<<endl;
}


Measured memory_bytes: 14336
N, Y = map(int, input().split())

for sen in range(N+1):
    for gosen in range(N-sen+1):
        man = N - sen - gosen
        if man < 0:
            continue
        if sen*1000 + gosen*5000 + man * 10000 == Y:
            print(man, gosen, sen)
            exit()

print(-1, -1, -1)


Measured memory_bytes: 2940
import fractions

N,X = map(int, input().split())
x = list(map(int, input().split()))
x.append(X)
x = sorted(x)


gcd = abs(x[0] - x[1]) 
for i in range(1, N):
    gcd = fractions.gcd(gcd, abs(x[i] - x[i+1])) 

print(gcd)
    



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

int main(){
  int n;
  cin >> n;
  vector<tuple<string,int,int>> vec;

  for (int i = 0; i < n; i++)
  {
    string s;
    int p;
    cin >> s >> p;    
    vec.push_back(make_tuple(s,-p,i+1));
  }

  sort(vec.begin(),vec.end());

  for(auto v:vec){
    cout << get<2>(v) << endl;
  }
}

Measured memory_bytes: 256
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
    int[] ans = new int[m+1];
    for(int i=1; i<n+1; i++) {
      int k = sc.nextInt();
      for(int j=0; j<k; j++) {
        ans[sc.nextInt()] += 1;
      }
    }
    int cnt = 0;
    for(int i : ans) {
      if(n == i) cnt++;
    }
    System.out.println(cnt);
  }
}


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

using namespace std;
typedef long long LL;
typedef pair<int,int> pii;

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second

template<class T, class... Args>
auto create(size_t n, Args&&... args) {
	if constexpr(sizeof...(args) == 1)
		return vector<T>(n, args...);
	else
		return vector(n, create<T>(args...));
}

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}

#ifdef OJ
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
#define all(x) (x).begin(), (x).end()
#define rsort(x) sort((x).rbegin(), (x).rend())
#define sz(x) ((int)x.size())
#define fori(i, n) for (int i = 0; i < (int)(n); ++i)
#define ford(i, n, e) for (int i = (int)(n); i >= (int)(e); --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)
template<typename T> bool mmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool mmin(T &m, const T q) { if (m > q) {m = q; return true;} else return false; }
#define RETURN(x) do{cout << (x) << '\n'; return 0;}while(0)

const char en = '\n';
const int MOD = 0;
const int MAXN = 1e9+7;
const int INF = 1e9+1;

int solve() {
    string s,t; cin >> s >> t;
    int ans = INF;
    fori(i,sz(s)) {
        if(i+sz(t) > sz(s)) break;
        int tmp = 0;
        for(int j = i, k = 0; k < sz(t); j++,k++) 
            tmp += s[j] != t[k];
        mmin(ans,tmp);
    }

    cout << ans << en;

    return 0;
} 

int main(int argc, char **argv) {
#ifdef OJ
    freopen("input.txt", "rt", stdin);
    //freopen("output.txt", "wt", stdout);
#endif
    ios::sync_with_stdio(false);
    cin.tie(0);

    int ntest = 1;
    //cin >> ntest;
    fori(test, ntest) {
        //cout << "Case #" << test+1 << ": ";
        solve();
    }

    return 0;
}


Measured memory_bytes: 3644
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        Set<String> set = new HashSet<>();
        for (int i=0; i<num; i++) {
            set.add(sc.next());
        }

        System.out.println(set.size());
    }
}


Measured memory_bytes: 77260
#include <bits/stdc++.h>
#define ll long long int

#define mx 100007
using namespace std;
vector <int> prime; // Stores generated primes
int  sieve[1299827]; // 0 means prime
void primeSieve (  ) {
    sieve[0] = sieve[1] = 1; // 0 and 1 are not prime

    prime.push_back(2); // Only Even Prime
    for ( int i = 4; i <= 1299827; i += 2 ) sieve[i] = 1; // Remove multiples of 2

    int sqrtn = sqrt ( 1299827 );
    for ( int i = 3; i <= sqrt(1299827); i += 2 ) {
        if ( sieve[i] == 0 ) {
            for ( int j = i * i; j <=1299827; j += 2 * i ) sieve[j] = 1;
        }
    }

    for ( int i = 3; i <= 1299827; i += 2 ) if ( sieve[i] == 0 ) prime.push_back(i);
}
int main()
{
    ll t,n,item,temp,a,b,c,d,x,y,z,sum,flag,k,m;
    string s,s1,s2;
    vector<ll>v;
    vector<string>vs;
    map<ll,ll>mp;
    map<ll,ll>::iterator it;
    map<ll,ll>check;
    vector<ll>v1;
    vector<ll>v2;
    vector<pair<ll,ll> >vp;
    ll flag1,flag2,flag3,flag4;
    map<ll,ll>mp1;
    map<ll,ll>mp2;
    map<ll,ll>mp3;

    ///ll arr[mx];
    ll sum1=0,sum2=0;
    sum1=1000000007;
    sum2=1;

    ///primeSieve();
    ///cout<<prime.size()<<endl;
    map<pair<ll,ll>,ll>mpp;

    double D,T,S;
    cin>>D>>T>>S;
    if(D/S<=T)
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;



    return 0;
}


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

using namespace std;

int main(void) {
  int a, b;
  cin >> a >> b;

  string s;
  cin >> s;

  int i;
  for(i = 0; i < a; i++) {
    if(s[i] == '-') {
      cout << "No" << endl;
      return 0;
    }
  }

  if(s[i] != '-') {
    cout << "No" << endl;
    return 0;
  }
  i++;

  for(;i < a + b + 1; i++) {
    if(s[i] == '-') {
      cout << "No" << endl;
      return 0;
    }
  }

  cout << "Yes" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define vi vector<int>
#define e "\n"
#define MaRiaMa { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); }
#define fix(n) cout << fixed << setprecision(n);
using namespace std;
int main()
{
	MaRiaMa;
	int n, d;
	ll sum = 0;
	cin >> n >> d;
	int ar[100];
	for (int i = 0; i < n; i++)
	{
		cin >> ar[i];
		sum += ar[i];
	}
	d -= sum;
	int k = d / *min_element(ar, ar + n);
	cout << n + k;
}





Measured memory_bytes: 3644
import java.util.*;
 
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int digit = String.valueOf(n).length();

        int sum = 0;
        for (int i = 1; i <= n; i++) {
            if (String.valueOf(i).length() % 2 == 1) {
                sum++;
            }
        }

        System.out.println(sum);
	}
}


Measured memory_bytes: 28628
//In the name of allah// Bismillahir rahmanir rahim 
#include<bits/stdc++.h>
using namespace std;
int main()
{
long long int n,k,sum=0;
cin>>n>>k;
long long int a[n];
for(int i=0;i<n;i++) cin>>a[i];
sort(a,a+n);
for(int i=0;i<k;i++)
sum=sum+a[i];

cout<<sum<<endl;

return 0;
}

Measured memory_bytes: 3632
#include <iostream>
#include <fstream>
#include <string> 
#include <cmath>  
#include <cstdlib>
#include <ctime>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <functional>

using namespace std;
using ll = long long;

#define FOR(i, m, n) for(int i = (m);i < (n);i++)
#define REP(i,n) for(int i = 0; i < int(n); i++)
#define VI vector<int>
#define VVI vector<vector<int>>
#define VVVI vector<vector<vector<int>>>
#define VL vector<ll>
#define VB vector<bool>
#define VVB vector<vector<bool>>
#define PAIR pair<int,int>
#define MP make_pair
#define VP vector<pair<int,int>>
#define VS vector<string>
#define QUE queue<int>
#define DEQ deque<int>
#define PQUE priority_queue<int> //5,5,4,3,3,2,...
#define REPQUE priority_queue<int, vector<int>, greater<int>> //1,1,2,3,4,4,5,...
#define SUM(obj) accumulate((obj).begin(), (obj).end(), 0)
#define SORT(obj) sort((obj).begin(), (obj).end()) // 1,2,3,4,5...
#define RESORT(obj) sort((obj).begin(), (obj).end(), greater<int>()) // 5,4,3,2,1...
#define UB(obj,n) upper_bound((obj).begin(), (obj).end(), n) //itr > n
#define LB(obj,n) lower_bound((obj).begin(), (obj).end(), n) //itr>= n

const ll MOD = (ll)1e9 + 7;

int main() {
	string S;
	cin >> S;
	int N = S.size();
	VI c;
	c.push_back(N);
	REP(i, N-1) if (S[i] != S[i+1]) c.push_back(max(i + 1, N - (i + 1)));
	cout << *min_element(c.begin(), c.end()) << endl;
		
	return 0;
}

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

int main() {
    string s;
    cin >> s;

    string s1;

    int q;
    cin >> q;
    rep(i,q) {
        int t,f;
        char c;
        cin >> t;

        if (t == 1) {
            swap(s,s1);
        }
        else {
            cin >> f >> c;
            if (f == 1) {
                s1 += c;
            }
            else {
                s += c;
            }

        }
    }

    reverse(s1.begin(), s1.end());
    s1 += s;
    cout << s1 << endl;
    return 0;
}

Measured memory_bytes: 4004
#include <iostream>
#include <ccomplex>
#include <vector>
#include <cassert>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <numeric>
#include <list>
#include <assert.h>
#include <math.h>
#include <valarray>
#include <stdio.h>
#include <algorithm>
#include <set>
#include <complex>
#include <list>
#include <time.h>
#include <stack>
#include <locale>
#include <clocale>
#include <ctype.h>
#include <wchar.h>

using namespace std;
typedef long long int LL;
typedef pair<long long int, long long int> pii;
typedef pair<double, double> pdd;

#define SORT(c) sort((c).begin(),(c).end())
#define BACKSORT(c) sort((c).begin(),(c).end(),std::greater<LL>())
#define FOR(i,a,b) for(LL i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

int xcomp(vector<LL>& a, vector<LL>& b) {
	return a[0] < b[0];
}

#define XSORT(c) sort((c).begin(),(c).end(),xcomp)

#define ALL(x) (x).begin(),(x).end()
LL mod = 1000000007;

int main() {
	LL N;
	cin >> N;
	vector<vector<bool>> v(N, vector<bool>(N, false));
	bool flag = false;
	REP(i, N) {
		string s;
		cin >> s;
		REP(j, N) {
			if (s[j] == '#') {
				v[i][j] = true;
				flag = true;
			}
		}
	}
	LL count = 0;
	if (flag) {
		REP(j, N) {
			bool flag2 = true;
			REP(i, N) {
				if (!v[i][j]) {
					flag2 =false;
					break;
				}
			}
			if (flag2) {
				count++;
			}
		}

		LL min = 10000000;
		REP(i, N) {
			LL cost = 1;
			REP(j, N) {
				if (v[j][i]) {
					cost = 0;
					break;
				}
			}
			REP(j, N) {
				if (!v[i][j]) {
					cost++;
				}
			}
			if (min > cost) {
				min = cost;
			}
		}
		cout << min + N - count << endl;
	}
	else {
		cout << "-1" << endl;
	}
}


Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
char s[200010];
long long ans,b;
int main(){
	scanf("%s",s);int n=strlen(s);
	for(int i=0;i<n;i++)
		if(s[i]=='B')b++;
		else ans+=b;
	printf("%lld\n",ans);
	return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
ll GetDigit(ll num){ return log10(num)+1; } //numの桁数を求める

int main()
{
    int a, b;
    cin >> a >> b;
    if(a < 9 && b < 9) cout << "Yay!" << endl;
    else cout << ":(" << endl;
    return 0;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll, ll> Pll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repn(i, n) for (int i = 0; i <= (int)(n); i++)
#define srep(i, l, n) for (int i = l; i < (int)(n); i++)
#define srepn(i, l, n) for (int i = l; i <= (int)(n); i++)
#define pb push_back 
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

const int MOD = 1000000007;
const int INF = 1e9;
#define PI 3.14159265369;
int dx[4] = {1,-1,0,0};
int dy[4] = {0,0,1,-1};
int ddx[8] = {1,1,1,-1,-1,-1,0,0};
int ddy[8] = {0,1,-1,0,1,-1,1,-1};

int main(){
	string s;
	cin >> s;
	int k;
	cin >> k;
	rep(i,s.length()) {
		if(s[i]=='a') continue;
		int c = 'z' - s[i] + 1;
		if(c<=k) s[i]='a', k-=c;
		else continue;
	}
	for(int i = s.length()-1; i >= 0; i--) {
		if(s[i]=='a') continue;
		else {
			s[i] = s[i]+k;
          	k = 0;
			break;
		}
	}
	if(k>0) s[s.length()-1] += k%26;
	cout << s << endl;
}

Measured memory_bytes: 512
//
/*==========================================================*/
/*    Template ver 2017-0720    |    Created by JollyBee    */
/* DOMINUS pascit me, et nihil mihi deerit (Psalmorum 23:1) */
/*==========================================================*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vii;
const double EPS=(double)1e-9;
const double PI=(double)acos(-1.0);
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pob pop_back
#define pf push_front
#define pof pop_front
#define FOR(i,n) for(int i=0;i<n;i++)
#define REPP(i,l,r,c) for(int i=l;i<=r;i+=c)
#define REP(i,l,r) REPP(i,l,r,1)
#define FORD(i,n) for(int i=n-1;i>=0;i--)
#define REVV(i,l,r,c) for(int i=l;i>=r;i-=c)
#define REV(i,l,r) REVV(i,l,r,1)
//random
int irand(int lo, int hi){
    return (((double)rand())/(RAND_MAX+1.0)) * (hi-lo+1) + lo;
}
//ll to string
string toString(ll x) {
    stringstream ss;
    ss << x;
    return ss.str();
}
//string to ll
ll toNumber(string S) {
    ll ret;
    sscanf(S.c_str(),"%lld",&ret);
    return ret;
}
// std::fill(start, end, value);
// for(auto it: DS){}

const int INF=(int)2e9;
const ll MOD=(ll)1e9+7;
/*==========================================================*/
/*                     END OF TEMPLATE                      */
/* DOMINUS pascit me, et nihil mihi deerit (Psalmorum 23:1) */
/*==========================================================*/

int main(){
    int w,h,n; scanf("%d %d %d", &w, &h, &n);
    pii bats_x = mp(0,w), bats_y = mp(0,h);
    REP(i,1,n){
        int x,y,a; scanf("%d %d %d", &x, &y, &a);
        //
        if(a == 1) bats_x.fi = max(bats_x.fi, x);
        if(a == 2) bats_x.se = min(bats_x.se, x);
        if(a == 3) bats_y.fi = max(bats_y.fi, y);
        if(a == 4) bats_y.se = min(bats_y.se, y);
    }
    ll res_x = (ll)max(0, bats_x.se - bats_x.fi);
    ll res_y = (ll)max(0, bats_y.se - bats_y.fi);
    printf("%lld\n", res_x * res_y);
    return 0;
}


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

int main(){
	int n,k;
	string s;
	cin>>n>>k>>s;

	int i = 0;
	int j = 0;
	int res=0;

	while(j<n){
		while(j<n && s[j]=='1') 
			++j;
		res=max(res,j-i);
		while(j<n && s[j]=='0') 
			++j;
		--k;
		if(k<0){
			while(i<n && s[i]=='1') 
				++i;
			while(i<n && s[i]=='0') 
				++i; 	
		}
		res = max(res,j-i);
	}
	cout<<res;
}


Measured memory_bytes: 512
#include <cstdio>
#include <cctype>
#include <cstring>
#include <algorithm>
using namespace std;
const int N = 1e6+5;
int n, ans, flg; char a[N];
int main()
{
    scanf("%d%s", &n, a); for(int i = 0; i < n; ++i) if((a[i] -= '1') == 1) flg = 1;
    if(!flg) for(int i = 0; i < n; ++i) a[i] >>= 1;
    for(int i = 0; i < n; ++i) if(((n-1)&i) == i) ans ^= a[i]&1;
    printf("%d\n", ans<<!flg);
    return 0;
}

Measured memory_bytes: 4180
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;

public class Main {

    public static void main(String[] args) throws Exception {
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            int n = Integer.parseInt(br.readLine());

            List<Long> list = Arrays.stream(br.readLine().split(" "))
                    .map(Long::parseLong)
                    .sorted(Comparator.naturalOrder())
                    .collect(Collectors.toList());

            long min = list.get(0);
            long max = list.get(list.size() - 1);
            long sum = list.stream().mapToLong(Long::longValue).sum();

            System.out.println(min + " " + max + " " + sum);
        }
    }
}

Measured memory_bytes: 33676
//
// main.cpp
//

#include <algorithm>
#include <array>
#include <assert.h>
#include <complex>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <math.h>
#include <memory>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

using ll = int64_t;
using ull = uint64_t;
constexpr ll LL_MAX = numeric_limits<ll>::max();
constexpr ull ULL_MAX = numeric_limits<ull>::max();

template<typename T>
vector<T> make_vec_nd(T init, ll size) {
    return vector<T>(size, init);
}
template<typename T, typename... Args>
auto make_vec_nd(T init, ll size, Args... rest) {
    auto inner = make_vec_nd(init, rest...);
    return vector<decltype(inner)>(size, inner);
}

#define rep(i, a, b) for (ll i = (a); i < (b); i++)
#define rrep(i, a, b) for (ll i = (a)-1; i >= (b); i--)

int main() {
	ll N, M;
	cin >> N >> M;
	vector<ll> As(N);
	rep(i,0,N) {
		cin >> As[i];
	}
	sort(As.begin(), As.end());
	auto count_geq = [&As, N](ll k){
		ll ans = 0;
		rep(i,0,N) {
			auto it = lower_bound(As.begin(), As.end(), k - As[i]);
			ans += distance(it, As.end());
		}
		return ans;
	};
	ll max_hs = 2 * As.back();
	ll right = max_hs + 1;
	ll left = 0;
	while (right - left >= 2) {
		ll mid = (left + right) / 2;
		if (count_geq(mid) >= M) {
			left = mid;
		} else {
			right = mid;
		}
	}
	assert(count_geq(right) < M);
	assert(count_geq(left) >= M);
	vector<ll> sums(N+1);
	rep(i,1,N+1) {
		sums[i] = sums[i-1] + As[i-1];
	}
	ll ans = 0;
	ll cnt = 0;
	rep(i,0,N) {
		auto it = lower_bound(As.begin(), As.end(), right - As[i]);
		ll idx = distance(As.begin(), it);
		ans += sums[N] - sums[idx] + As[i] * distance(it, As.end());
		cnt += distance(it, As.end());
	}
	ans += left * (M - cnt);
	cout << ans << endl;
}


Measured memory_bytes: 1792
#include<stdio.h>

int main(void)
{
        char line[100];
        int H,W;
        int i,j;

        while (1) {
                fgets(line, sizeof(line), stdin);
                sscanf(line, "%d %d", &H, &W);
                if ( ( H == 0 ) && ( W == 0 ) )
                        break;
                for ( i = 0; i < H; i ++ ) {
                        for ( j = 0; j < W; j++ ) {
                                printf("#");
                        }
                        printf("\n");
                }
                printf("\n");
        }

        return 0;
}

Measured memory_bytes: 588
#include<iostream>
#include<vector>
#include <unordered_map>  
#include <algorithm>
#include <functional>
#include <map>
#include <string>
#include <sstream>
#include <cmath>
using namespace std;


int main() {
	unsigned long long int n, m, count = 0;
	cin >> n >> m;
	if (n >= 2) {
		if (m >= 2) {
			count = (n - 2)*(m - 2);
		}
		else if (m == 1) {
			count = n - 2;
		}
	}
	else if (n == 1) {
		count = m - 2;
		if (m == 1) {
			count = 1;
		}
	}
	cout << count << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  if (a == b && a != c) {
    cout << "Yes" << endl;
  } else if (a == c && a != b) {
    cout << "Yes" << endl;
  } else if (c == b && a != c) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}


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

struct item {
	int v;
	int w;
};

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

	item *items = new item[N + 1];
	int **C = new int*[N + 1];
	for (int i = 0; i < N + 1; i++) {
		C[i] = new int[W + 1];
	}

	for (int i = 0; i < N + 1; i++) {
		items[i].v = 0;
		items[i].w = 0;
		for (int j = 0; j < W + 1; j++) {
			C[i][j] = 0;
		}
	}

	for (int i = 1; i < N + 1; i++) {
		cin >> items[i].v;
		cin >> items[i].w;
	}

	for (int i = 1; i < N + 1; i++) {
		for (int j = 1; j < W + 1; j++) {
			// chose item No.i
			int cand1;
			if (j - items[i].w >= 0) {
				cand1 = C[i - 1][j - items[i].w] + items[i].v;
			}
			else {
				cand1 = 0;
			}

			// NOT chose item No.i
			int cand2 = C[i - 1][j];

			C[i][j] = max(cand1, cand2);
		}
	}

	cout << C[N][W] << endl;

	return 0;
}


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

S_dic = {}
maximum = 0
for n in range(N):
    S = input()
    if S not in S_dic:
        S_dic[S] = 1
    else:
        S_dic[S] += 1
    if maximum < S_dic[S]:
        maximum = S_dic[S]


for key, value in sorted(S_dic.items(), key=lambda x: x[0]):
    if value == maximum:
        print(key)


Measured memory_bytes: 46556
/*
    Author : Simanta Deb Turja
*/
#include <bits/stdc++.h>
using namespace std;

#define Professor

using ll = long long;
using i64 = unsigned long long;

template <typename T> inline T Min (T a, T b, T c) { return min(a, min(b, c)); }
template <typename T> inline T Min (T a, T b, T c, T d) { return min(a, min(b, min(c, d))); }
template <typename T> inline T Max (T a, T b, T c) { return max(a, max(b, c)); }
template <typename T> inline T Max (T a, T b, T c, T d) { return max(a, max(b, max(c, d))); }

template <typename T> inline T Ceil(T a, T b) { return ((a % b == 0) ? (a / b) : (a / b + 1)); } 
template <typename T> inline T Floor(T a, T b) { return a / b; }

template <typename T> inline T Power (T a, T p) { T res = 1, x = a; while ( p ) { if ( p & 1 ) res = ( res * x ); x = ( x * x ); p >>= 1;}return res; }
template <typename T> inline T BigMod (T a,T p,T M) { a %= M;T ret = 1; while (p) { if (p & 1) ret = (ret * a) % M; a = (a * a) % M; p = p >> 1; } return ret; }
template <typename T> inline T InverseMod (T a,T M) { return BigMod (a, M - 2, M); }

template <typename T> inline T gcd ( T a, T b ) { a = abs(a); b = abs(b); while ( b ) { a = a % b; swap ( a, b ); } return a; }
template <typename T> inline T lcm(T x,T y) { return (((x)/gcd((x),(y)))*(y)); }


#define endl '\n'
#define eb emplace_back

const int N = (int)4e5 + 10;
const double EPS = 1e-7;
const double PI = acos(-1.0);
const ll LLINF = numeric_limits<ll>::max();
const int INF = (int)1e9+1;
const ll MOD = (ll)1e9 + 7;

template <typename T> bool cmp (const pair <T, T> &a, const pair <T, T> &b) { return a.first < b.first; }


int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
    auto Solve = [&]() {
        #ifdef __APPLE__
            cout << "Running\n";
        #endif
        int n, k; 
        cin >> n >> k;
        vector <int> h(n + 1, 0LL), dp(n + 1, INF); 
        for (int i = 1; i <= n; ++i) {
            cin >> h[i];
        }
        dp[1] = 0;
        for (int i = 2; i <= n; ++i) {
            for (int j = 1; j <= min(i, k); ++j) {
                dp[i] = min(dp[i], dp[i - j] + abs(h[i - j] - h[i]));
            }
        }
        cout << dp[n] << endl;
    };
    Solve();
    
    return 0;
}



Measured memory_bytes: 1024
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll          long long
#define pb          push_back
#define	endl		'\n'
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define hell        200001
#define rep(i,a,b)	for(int i=a;i<b;i++)
#define repr(i,a,b) for(int i=a;i>b;i--) 
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define MAXN		200001
#define ordered_set tree<ll int, null_type,less<ll int>, rb_tree_tag,tree1_order_statistics_node_update> 
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	ll int n;
	cin >> n;
	ll int a[n+1];
	rep(i,0,n) cin >> a[i];
	rep(i,0,n-1)
	{
		if (a[i]<a[i+1])
			a[i]=i;
		else
			a[i]=-1;
	}
	a[n-1]=n-1;
	ll int ans=0;
	repr(i,n-1,-1)
	{
		if (a[i]==i) {ans=max((ll int)1,ans);continue;}
		else
		{
			a[i]=a[i+1];
			ans=max(ans,a[i]-i+1);
		}
	}
	cout << ans-1 << endl;
}

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

using Lint=long long;

int main()
{
   int N; cin>>N;
   vector<int> dp(N+1);
   dp[0]=1; dp[1]=1;
   for(int i=2;i<=N;i++) dp[i]=dp[i-1]+dp[i-2];
   cout<<dp[N]<<endl;
   return 0;
}



Measured memory_bytes: 3124
def main():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    for _ in range(k):
        imos = [0] * (n + 1)
        for i in range(n):
            imos[max(0, i - a[i])] += 1
            imos[min(n, i + a[i] + 1)] -= 1
        for i in range(1, n):
            imos[i] += imos[i-1]
        imos.pop()
        a = imos
        if min(a) == n:
            break 
    print(*a)
main()


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

int main()
{
	//int s, w;
	//cin >> s >> w;
	//if (w >= s)
	//	cout << "unsafe";
	//else
	//	cout << "safe";

	int a, b, c, d;
	cin >> a >> b >> c >> d;
	while (1)
	{
		c -= b;
		if (c <= 0)
		{
			cout << "Yes";
			exit(0);
		}
		a -= d;
		if (a <= 0)
		{
			cout << "No";
			exit(0);
		}
	}

    return 0;
}



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

int main() {
    string s, t;
    int n = 0;
    cin >> s >> t;
    for(int i = 0; i < 3; ++i) {
        if(s[i] == t[i]) n++;
    }
  	cout << n << '\n';
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define dunk(a) cout << (a) << endl
using namespace std;
typedef long long ll;


int main(){
    ll n, k, r, s, p;
    cin >> n >> k >> r >> s >> p;

    ll ans=0;

    string t;
    cin >> t;

    string output = "";

    for(ll i=0; i<k; i++){

        if(t[i] == 'r'){
            ans += p;
        }
        if(t[i] == 's'){
            ans += r;
        }
        if(t[i] == 'p'){
            ans += s;
        }

    }

    for(ll i=k; i<n; i++){

        if(t[i] == t[i-k]){
            t[i] = '!';
        }

        else{

            if(t[i] == 'r'){
            ans += p;
            }
            if(t[i] == 's'){
            ans += r;
            }
            if(t[i] == 'p'){
            ans += s;
            }

        }

    }

    cout << ans << endl;
}

Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
  vector<int> a;
  int n,num;

  cin >> n;

  for (int i = 0; i < n; i++) {
    cin >> num;
    a.push_back(num);
    //cout << num << endl;
  }
  a.erase(unique(a.begin(), a.end()), a.end());
  auto itr = a.begin();
  for (itr = a.begin(); itr!=a.end(); ++itr) {
    if (itr!=--a.end()){
      printf("%d ",*itr);
    }else{
      printf("%d\n",*itr);
    }
  }
  return 0;
}



Measured memory_bytes: 3560
import java.io.*;
import java.util.*;
class Main{
	static final long MOD = 1_000_000_007; // 10^9+7
    static final int MAX = 2_147_483_646; // intMax 
    static final int INF = 1_000_000_000; // 10^9  
    public static void main(String[] args) throws Exception {
		hayami saori = new hayami();
		String s = saori.nextHayami();

		s = s.replaceAll("\\?", "D");
		System.out.println(s);

		saori.close();
    }
}

class hayami implements Closeable {
	private final InputStream in = System.in;
	private final byte[] hayami = new byte[1024];
	private int Hayami = 0;
	private int saori = 0;
	private boolean HayamiSaori() {
		if (Hayami < saori) {
			return true;
		}else{
			Hayami = 0;
			try {
				saori = in.read(hayami);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (saori <= 0) {
				return false;
			}
		}
		return true;
	}
	private int SaoriHayami() { 
		if (HayamiSaori()) {
            return hayami[Hayami++];
         }else{
             return -1;
         }
	}
	private static boolean hayami_saori(int hayami) { 
		return 33 <= hayami && hayami <= 126;
	}
	public boolean hayamisaori() { 
		while(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();
	}
	public String nextHayami() {
		if (!hayamisaori()) throw new NoSuchElementException();
		StringBuilder hayamin = new StringBuilder();
		int saori = SaoriHayami();
		while(hayami_saori(saori)) {
			hayamin.appendCodePoint(saori);
			saori = SaoriHayami();
		}
		return hayamin.toString();
	}
	public long saorihayami() {//nextLong
		if (!hayamisaori()) throw new NoSuchElementException();
		long hayami = 0;
		boolean misao = false;
		int saori = SaoriHayami();
		if (saori == '-') {
			misao = true;
			saori = SaoriHayami();
		}
		if (saori < '0' || '9' < saori) {
			throw new NumberFormatException();
		}
		while(true){
			if ('0' <= saori && saori <= '9') {
				hayami *= 10;
				hayami += saori - '0';
			}else if(saori == -1 || !hayami_saori(saori)){
				return misao ? -hayami : hayami;
			}else{
				throw new NumberFormatException();
			}
			saori = SaoriHayami();
		}
	}
	public int saori_hayami() {//nextInt
		long hayami = saorihayami();
		if (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();
		return (int) hayami;
	}
	public double Hayamin() { //nextDouble
		return Double.parseDouble(nextHayami());
	}
	public void close() {
		try {
			in.close();
		} catch (IOException e) {
		}
    }
    
}

Measured memory_bytes: 49256
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
 
int n;
int y;
int flag = 0;
int hoge;
int huga;
int piyo;
 
int main(void) {
	scanf("%d %d", &n, &y);
	for(int i = 0; i <= n; i++) {
		for(int j = 0; j <= n - i; j++) {
				if(10000 * i + 5000 * j + 1000 * (n - i - j) == y) {
					flag = 1;
					hoge = i;
					huga = j;
					piyo = n - i -j;
					goto FINISH;
			}
		}
	}
	FINISH:
	if(flag == 0) {
		hoge = -1;
		huga = -1;
		piyo = -1;
	}
	printf("%d %d %d\n", hoge, huga, piyo);
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
template<class T> using vc = vector<T>;
template<class T> using vvc = vector<vector<T>>;

const ll MOD = 1e9 + 7;
// const ll MOD = 998244353;
const ll INF = 1e16;
const ld EPS = 1e-11;
const ld PI = acos(-1.0L);
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repr(i, n) for (ll i = (n)-1; i >= 0; i--)
#define repe(i, l, r) for (ll i = (l); i < (r); i++)
#define reper(i, l, r) for (ll i = (r)-1; i >= (l); i--)

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

void init() {cin.tie(0);ios::sync_with_stdio(false);cout << fixed << setprecision(15);}
//--------------------------------------------------------------------------------//

int main() {
    init();
    rep(i,3000){
        ll x, y;
        cin >> x >> y;
        if (x == 0 and y == 0) break;
        if (x > y) swap(x, y);
        cout << x << " " << y << endl;
    }
}


Measured memory_bytes: 3096
#include<stdio.h>
int a = 0;
int b = 0;
int d = 0;
int d10 = 1;
int main(){
    while(scanf("%d %d", &a, &b)!=EOF){
      if(a )
      d = 0;
      int d10 = 1;
      while(1){
          d++;
          d10 = d10 * 10;
          if(d10 > a + b){
              break;
          }
      }
      printf("%d\n", d);
   }
   return 0;
}



Measured memory_bytes: 2040
#include  <iostream>
#include  <stdio.h>
#include <algorithm>
using namespace std;
#include <vector>
#define rep(i,n) for (int i = 0; i < (n) ; i++)
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define ll long long
#define ull unsigned long long
#define vint vector<int>
#define vll vector<ll>

//#include <stack>
//#include <queue>

/*
#include <math.h>
int standerd = int(pow(10.0,9.0)) + 7;
*/
string ans_Yes = "Yes"; 
string ans_No = "No"; 
string ans_yes = "yes"; 
string ans_no = "no"; 
 

int main(){

    int A;
    int B;
    int C;
    int D;
    
    cin >> A;
    cin >> B;
    cin >> C;
    cin >> D;

    while(A>0 && C>0){
        C = C - B;
        A = A - D;
        if(C<=0) cout << "Yes" << endl;
        else if(A<=0) cout << "No" << endl;
    }
    

}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll M=1e9+7;
 
 
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	float r;cin>>r;
	float pi=3.141592;
	pi=2.0*pi*r;
	cout<<pi<<endl;
 
	
	return 0;
} 

Measured memory_bytes: 3800