akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define endl '\n'
#define ll long long
#define double long double
using namespace std;

ll k, tec, tecr;
string pt;
void pereb(string s, ll razm, ll mux)
{
    if (razm == mux)
    {
        tec ++;
        //cout << s << endl;
        if (tec == k)
        {
            cout << s;
            exit(0);
        }
        return;
    }
    char c = s[(ll)s.size() - 1];
    string top = s;
    if (c != '0')
    {
        top += char((c - '0') - 1 + '0');
        pereb(top, razm + 1, mux);
    }
    top = s;
    top += c;
    pereb(top, razm + 1, mux);
    top = s;
    if (c != '9')
    {
        top += char((c - '0') + 1 + '0');
        pereb(top, razm + 1, mux);
    }
}

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> k;
    while (true)
    {
        tecr ++;
        pt = "";
        for (char c = '1'; c <= '9'; c ++)
            pereb(pt + c, 1, tecr);
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define ll long long
using namespace std;
int main(){
    //fast;
    double D, T, S;
    cin >> D >> T >> S;
    cout << (S * T >= D? "Yes\n" : "No\n");
    return 0;
}


Measured memory_bytes: 3724
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <string>
using namespace std;
int main() {
	string a,b,c,d;
	//string s="error";
	cin >> a; cin >> b; cin >> c;
	d.push_back(a[0]-32);
	d.push_back(b[0]-32);
	d.push_back(c[0]-32);
	cout << d << endl;
}

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

int main()
{
  int n, m, x;
  cin >> n >> m >> x;
  
  int cost[n];
  int point[n][m];
  
  REP(i, n)
  {
    cin >> cost[i];
    REP(j, m)
    {
      cin >> point[i][j]; 
    }
  }
  
  unsigned int min = -1;
  int t = pow(2, n);
  REP(i, t)
  {
    unsigned int c = 0;
    int x2[m] = {0};
    int y = 0;
    REP(j, n)
    {
      int z = (1 << j);      
      if(i & z)
      {
        c += cost[j];
        if(c >= min)
        {
          continue;
        }
        REP(k, m)
        {
          x2[k] += point[j][k];
        }
      }
    }
    
    bool ok = true;
    REP(k, m)
    {
      if(x2[k] < x)
      {
        ok = false;
        break;
      }
    }
    if(ok && min >= c)
    {
      min = c;
    }
  }
  
  cout << static_cast<int>(min) << endl;
  
  return 0;
}

Measured memory_bytes: 4084
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using Graph = vector<vector<int>>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define Rep(i, k, n) for (int i = k; i < (int)(n); i++)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;
long long dp[100010];
long long h[100010];

int main()
{
    int n; cin >> n;
    vector<ll> a(n);
    ll pari = 0;
    rep(i, n)
    {
        cin >> a[i];
        pari += a[i];
    }
    if (pari % 2 == 0)
    {
        cout << "YES" << endl;
    }
    else
    {
        cout << "NO" << endl;
    }
}

Measured memory_bytes: 1024
import sys
from fractions import gcd
from itertools import permutations, combinations, accumulate
from collections import deque
from heapq import heappush, heappop, heapify
from collections import deque

input = sys.stdin.readline
sys.setrecursionlimit(10**6)

MOD = 10**9 + 7

def cmbmod(n, r, k):
    #nCr mod kを求める（kは素数）
    p, q = 1, 1
    for i in range(r):
        p = p * (n-i) % k
        q = q * (r-i) % k
    return p * pow(q, k-2, k) % k

def main():
    x, y = tuple(map(int,input().split()))
    ok = 0
    ng = x + 1
    ans = 0

    if 2*y - x >= 0 and 2 * x - y >= 0:
        while abs(ng - ok) > 1:
            mid = (ok + ng) // 2
            if 2*y - x >= 3*mid:
                ok = mid
            else:
                ng = mid

        a = ok
        b = y - 2 * ok
        if a + 2*b == x and 2*a + b == y:
            ans = cmbmod(a + b, a, MOD)


    print(ans)


if __name__ == '__main__':
    main()

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

#include <bits/stdc++.h>
using namespace std; 
using ll = long long;
using ld = long double;
vector<vector<vector<ld>>> memo(3e2+5, vector<vector<ld>>(3e2+5, vector<ld> (3e2+5, -1)));

ld dp(int n, int n1, int n2, int n3){
	if(n1 == 0 && n2 == 0 && n3 == 0)
		return 0;
	if(memo[n1][n2][n3] != -1)
		return memo[n1][n2][n3];

	memo[n1][n2][n3] = 0;
	if(n3)
		memo[n1][n2][n3] += (1+dp(n, n1, n2+1, n3-1))*n3/(ld)n;
	if(n2)
		memo[n1][n2][n3] += (1+dp(n, n1+1, n2-1, n3))*n2/(ld)n;
	if(n1)
		memo[n1][n2][n3] += (1+dp(n, n1-1, n2, n3))*n1/(ld)n;
	memo[n1][n2][n3] += (n-n1-n2-n3)/(ld)n;
	memo[n1][n2][n3]/=(1-(n-n1-n2-n3)/(ld)n);
	return memo[n1][n2][n3];
}



signed main() { 
	cin.tie(0);
	cin.sync_with_stdio();
	int n; 
	cin>>n;
	vector<ld> v(n);
	int n1, n2, n3;

	n1 = n2 = n3 = 0;
	for(int i = 0; i < n; i++){
		int a;
		cin>>a;
		if(a == 1)
			n1++;
		else if(a == 2)
			n2++;
		else 
			n3++;
	}


	cout<<setprecision(20)<<dp(n, n1, n2, n3);
}


Measured memory_bytes: 448896
#include <bits/stdc++.h>
using namespace std;
void Main();

using i8  = int8_t;   /* -128 ~ 127 */
using u8  = uint8_t;  /* 0 ~ 255 */
using i16 = int16_t;  /* -32,768 ~ 32,767 */
using u16 = uint16_t; /* 0 ~ 65,535 */
using i32 = int32_t;  /* -2,147,483,648 ~ 2,147,483,647 */
using u32 = uint32_t; /* 0 ~ 4,294,967,295 */
using i64 = int64_t;  /* -9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807 */
using u64 = uint64_t; /* 0 ~ 18,446,744,073,709,551,615 */
using f32 = float;    /* (-3.4 * 10^38) ~ (3.4 * 10^38) */
using f64 = double;   /* (-1.7 * 10^308) ~ (1.7 * 10^308) */
using f80 = __float80;

template <class T> using Vec = vector<T>;

/* 定数 */
constexpr i64 INF = 1010000000000000017;
constexpr i64 MOD = 1e9 + 7;
constexpr f64 EPS = 1e-12;
constexpr f64 PI = 3.14159265358979323846;

#define ALL(v) v.begin(), v.end()

#define GCD(a, b) __gcd(a, b) /* 最大公約数 */
#define LCM(a, b) a / __gcd(a, b) * b /* 最小公倍数 */

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(15);
    Main();
    return 0;
}

void Main() {
    string S;
    cin >> S;
    u32 p = 700;
    for (int i = 0; i < 3; i++) {
        if (S[i] == 'o') p += 100;
    }
    cout << p << endl;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
    private static final Scanner scn = new Scanner(System.in);
    private static boolean door = false;
    private static ArrayList<String> ids;
    
    public static void main(String[] args) {
        ids = entryId(scn.nextInt());
        useId(scn.nextInt());
    }
    
    public static ArrayList<String> entryId(int n) {
        ArrayList<String> list = new ArrayList<>();
        for(int i = 0; i < n; i++) {
            list.add(scn.next());
        }
        return list;
    }
    
    public static void useId(int m) {
        for(int i = 0; i < m; i++) {
            StringBuilder sb = new StringBuilder();
            String id = scn.next();
            if(ids.contains(id)) {
                if(door) {
                    sb.append("Closed by ");
                } else {
                    sb.append("Opened by ");
                }
                door = !door;
            } else {
                sb.append("Unknown ");
            }
            sb.append(id);
            System.out.println(sb);
        }
    }
}

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

void read(int &x) {
    x=0;int f=1;char ch=getchar();
    for(;!isdigit(ch);ch=getchar()) if(ch=='-') f=-f;
    for(;isdigit(ch);ch=getchar()) x=x*10+ch-'0';x*=f;
}

void print(int x) {
    if(x<0) putchar('-'),x=-x;
    if(!x) return ;print(x/10),putchar(x%10+48);
}
void write(int x) {if(!x) putchar('0');else print(x);putchar('\n');}

#define lf double
#define ll long long 

#define pii pair<int,int >
#define vec vector<int >

#define pb push_back
#define mp make_pair
#define fr first
#define sc second

#define data asd09123jdf02i3h

#define FOR(i,l,r) for(int i=l,i##_r=r;i<=i##_r;i++)

const int maxn = 1e6+10;
const int inf = 1e9;
const lf eps = 1e-8;
const int mod = 1e9+7;

char s[maxn];
int n,a,b,c,d;

int check(int x,int y) {
    int z=0;
    for(int i=x;i<=y;i++) {
        if(s[i]=='.') z=0;
        else z++;
        if(z>1) return 0;
    }return 1;
}

int main() {
    read(n),read(a),read(b),read(c),read(d);
    scanf("%s",s+1);
    if(c==d) puts("No");
    else if(c<d) puts(check(a,c)&&check(b,d)?"Yes":"No");
    else {
        if(!check(a,c)) puts("No");
        else {
            int aa=0,bb=0,bo=0;
            for(int i=b-1;i<=d+1;i++) {
                if(s[i]=='.') aa++,bb=0;
                else bb++,aa=0;
                if(bb>1) break;
                if(aa>2) {bo=1;break;}
            }
            puts(bo?"Yes":"No");
        }
    }
    return 0;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
int read() {
	char ch=getchar();
	int x=0;
	while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
	return x;
}
int n,ans,cnt,a[233];
int main() {
	n=read();
	for(int i=1;i<=n;i++) a[i]=read();
	for(int i=1;i<=n;i++) {
		if(a[i]==a[i-1]) cnt++;
		else{
			ans+=cnt/2;cnt=1;
		}
	}
	ans+=cnt/2;
	printf("%d\n",ans);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, a, n) for (ll i = ((ll) a); i < ((ll) n); i++)
using namespace std;
typedef long long ll;

const ll MOD = 1000000007;

int main(void) {
  ll N, M;
  cin >> N >> M;
  vector<bool> A(N + 1, true);
  REP(i, 0, M) {
    ll x;
    cin >> x;
    A[x] = false;
  }

  vector<ll> dp(N + 1, 0);
  dp[0] = 1;
  REP(i, 0, N) {
    if (i + 1 <= N && A[i] && A[i + 1]) {
      dp[i + 1] += dp[i];
      dp[i + 1] %= MOD;
    }
    if (i + 2 <= N && A[i] && A[i + 2]) {
      dp[i + 2] += dp[i];
      dp[i + 2] %= MOD;
    }
  }

  cout << dp[N] << endl;
}

Measured memory_bytes: 1024
#include <iostream>
#include <iomanip>
#include <cstring>
#include <algorithm> 
#include <math.h>
#include <queue>
#include <functional>
#include <map>
#include <vector>
#include <string>
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef pair<pair<int, int>, int> PP;

const ll INF = 1e15;
int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };




int main(void) {
	ll N;
	ll ans = 0;
	cin >> N;
	ll n = (ll)sqrt(N);
	if (N <= 10000000) {
		for (int i = 1; i <= N; i++) {
			if (N / i == N % i) ans += i;
		}
		cout << ans << endl;
		return 0;
	}
	for (int i = 0; i <= n; i++) {
		if (N % (i + 1) == 0) {
			ll a = N / (i + 1);
			if (a < i) {
				ans += i;
			}
			else if (a > i + 1) {
				ans += a - 1;
			}
		}
	}

	cout << ans << endl;
}


Measured memory_bytes: 256
five = int(input()) +1
one = int(input()) +1
fifty = int(input()) +1
target = int(input())
score = 0

for i in range(five):
    if(i*500 > target):
        break
    for j in range(one):
        if (i*500+j*100 > target):
            break
        for k in range(fifty):
            if(i*500+j*100+k*50 == target):
                score += 1
print(score)

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

int main(){
    int cnt[26]={};
    string s;
    
    while(cin >> s){
        for (int i=0; i<s.size(); i++){
            if (isalpha(s[i])){
                s[i]=tolower(s[i]);
                cnt[s[i]-'a']++;
            }
        }
    }
    
    for (int i=0; i<26; i++){
        printf("%c : %d\n",i+'a',cnt[i]);
    }
    return 0;
}


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

using namespace std;

int main() {
	int n;
	double xa, ya, ra, xb, yb, rb;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		double ab = sqrt(pow(xa - xb, 2) + pow(ya - yb, 2));
		if (ab + ra < rb)
			cout << -2 << endl;
		else if (ab + rb < ra)
			cout << 2 << endl;
		else if (rb - ra <= ab && rb + ra >= ab)
			cout << 1 << endl;
		else if (ra - rb <= ab && ra + rb >= ab)
			cout << 1 << endl;
		else
			cout << 0 << endl;
	}
	return 0;
}

Measured memory_bytes: 1232
# frozen_string_literal: true

mrr = []
frr = []
rrr = []
loop do
  m, f, r = gets.split.map(&:to_i)
  break if m == -1 && f == -1 && r == -1
  mrr.push(m)
  frr.push(f)
  rrr.push(r)
end
0.upto(mrr.size - 1) do |i|
  sum = mrr[i] + frr[i]
  if mrr[i] == -1 || frr[i] == -1
    puts 'F' 
    next
  end
  case sum
  when 80..100
    puts 'A'
  when 65..79
    puts 'B'
  when 50..64
    puts 'C'
  end
  if sum >= 30 && sum < 50 && rrr[i] >= 50
    puts 'C'
  elsif sum >= 30 && sum < 50
    puts 'D'
  elsif sum < 30
    puts 'F'
  end
end



Measured memory_bytes: 6872
// https://atcoder.jp/contests/abcXXX/tasks/abcXXX_x

#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ull = unsigned long long;
using pll = pair<ll, ll>;

static const ll INF = 1001001001;
static const ll LLINF = 1001001001001001001;
static const ll MOD = (ll)1e9 + 7;
static const double EPS = 1e-9;

#define REP(i, n) for(ll i = 0; i < (n); ++i)
#define RANGE(i, m, n) for(ll i = (m); i <= (n); ++i)
#define RRANGE(i, m, n) for(ll i = (m); i >= (n); --i)
#define POSITIVE(x) (x)=((x) < 0) ? 0 : (x)

ll power(ll x, ll y) {
    ll ret = 1;
    while(y-- > 0) ret *= x;
    return ret;
}

ll gcd(ll a, ll b) {
    assert(a >= 0);
    assert(b >= 0);
    if (b == 0) return a;
    return gcd(b, a % b);
}

ll extgcd(ll a, ll b, ll& x, ll& y) {
    x = 1; y = 0;
    assert(a >= 0);
    assert(b >= 0);
    if (b == 0) return a;
    ll X, Y;
    auto d = extgcd(b, a % b, X, Y);
    x = Y;
    y = X - (a / b) * Y;
    return d;
}

int run(istream& in, ostream& out) {
    ll N, K;
    in >> N >> K;
    set<int> sunukes{};
    REP(i, N) {
        sunukes.emplace(i+1);
    }
    REP(i, K) {
        ll d;
        in >> d;
        REP(j, d) {
            ll a;
            in >> a;
            sunukes.erase(a);
        }
    }
    ll ans = sunukes.size();

    // solution here

    out << ans << endl;
    return 0;
}

int main() {
    return run(cin, cout);
}


Measured memory_bytes: 3636
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) {
		try {
			BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
			StringBuilder answer = new StringBuilder();
			String lb = System.getProperty("line.separator");
			
			String str = input.readLine();
			while (!"-".equals(str)) {
				final int m = Integer.parseInt(input.readLine());
				for (int i = 0; i < m; i++) {
					final int h = Integer.parseInt(input.readLine());
					str = str.substring(h) + str.substring(0, h);
				}
				answer.append(str).append(lb);
				str = input.readLine();
			}
			input.close();
			
			System.out.print(answer.toString());
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}

Measured memory_bytes: 17044
n = int(input())
s = list(input())
alpha_dict = {}
num2alpha = lambda c: chr(c+64)
alpha2num = lambda c: ord(c) - ord('A') + 1
ans = []
for item in s:
  k = (alpha2num(item)+n)%26
  if k == 0:
    k = 26
  ans.append(num2alpha(k))
L=''.join(ans)
print(L)

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

int main() {
	string input;
	int ans = 0, last;
	while (cin >> input) {
		last = input.size();
		for (int i = 0; i<last; i++) {
			if (input[i] != input[last - i - 1]) { break; }
			if (i == last - 1) { ans++; }
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3144
#include <bits/stdc++.h>
using namespace std;
// type
#define int long long
typedef long long ll;
typedef long double ld;
// loop
//#define For(i, l, r, x)     for (int i = l; i < r; i+=x)
//#define ForE(i, l, r, x)    for (int i = l; i <= r; i+=x)
//#define Ford(i, r, l)       for (int i = r; i > l; i--)
//#define FordE(i, r, l)      for (int i = r; i >= l; i--)
//#define Fora(i, a)          for (auto i : a)
// I/O 
#define openfile(file)      freopen(file".in", "r", stdin); freopen(file".out", "w", stdout);
#define testinput(file)     freopen(file".txt", "r", stdin); 
#define FAST_IO             std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
//#define PrintV(a)           Fora(ii, a) cout << ii << ' '; cout << rl;
//#define PrintVl(a)          Fora(ii, a) cout << ii << rl;
//#define PrintA(a, l, r)     for (int ii = l; ii <= r; ii++) cout << a[ii] << ' '; cout << rl;
//#define PrintAl(a, l, r)    for (int ii = l; ii <= r; ii++) cout << a[ii] << rl;
//#define Ptest(x)            return cout << x, 0;
#define setpre(n)           fixed << setprecision(n)
// pair
#define F                   first
#define S                   second
#define pii                 pair<int, int>
#define pll                 pair<ll, ll>
#define pdd                 pair<ld, ld>
// vector & !!?(string)
#define eb                  emplace_back
#define pb                  push_back
#define all(a)              a.begin(), a.end()
#define rall(a)             a.rbegin(), a.rend()
#define sz(a)               a.size()
#define len(a)              a.length()
// geometry calc    
#define pi                  acos(-1.0)
#define g_sin(a)            sin(a*pi/180)
#define g_cos(a)            cos(a*pi/180)
#define g_tan(a)            tan(a*pi/180)
// set val
#define ms0(a)              memset(a,        0, sizeof(a));
#define ms1(a)              memset(a,        1, sizeof(a));
#define msn1(a)             memset(a,       -1, sizeof(a));
#define msinf(a)            memset(a, 0x3f3f3f, sizeof(a));
// constant
const int mod1 = 998244353, mod = 1e9+7;
const int MAXN = 1000005, MAXM = 200010;
// code
int n, m, k;
int a[MAXM], b[MAXM];
void Solve() {
  	cin >> n >> m >> k;
  	for (int i = 0; i < n; i++)
      	cin >> a[i];
 	for (int i = 0; i < m; i++)
      	cin >> b[i];
  	int x = 0, y = 0, ans = 0, sum = 0;
  	while (x < n && sum + a[x] <= k)
      	sum += a[x++];
  	while (y < m && sum + b[y] <= k)
      	sum += b[y++];
  	ans = x+y;
  	while (x > 0){
    	sum -= a[--x];
      	while (y < m && sum + b[y] <= k)
          	sum += b[y++];
        ans = max(x+y, ans);
    }
  	cout << ans;
}

signed main(){
    FAST_IO;
    int TC = 1;
	//cin >> TC;
    while(TC--) Solve();
    cerr << "Time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
    return 0;
}

Measured memory_bytes: 6840
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n,sum=0;
    cin>>n;
    for(long long i=1; i<=n; i++)
        if((i%3!=0 && i%5!=0) && (i%3!=0 || i%5!=0))
            sum+=i;

    cout<<sum<<endl;
    return 0;

}


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

using namespace std;

map<int,bool>mp;

bool safe(int n) {
    while(n) {
        if(mp[n % 10]) {
            return false;
        }
        n /= 10;
    }
    return true;
}
int main()
{
    int n,k;
    cin>>n>>k;
    int D[k];
    for(int i=0;i<k;i++) {
        cin>>D[i];
        mp[D[i]] = 1;
    }
    int i = n;
    while(true) {
        if(safe(i)) {
            return cout<<i,0;
        }
        i++;
    }
    return 0;
}


Measured memory_bytes: 3612
/*
*
*Problem Link : https://atcoder.jp/contests/abc136/tasks/abc136_c
*Platform: atcoder
*Status: correct
*Author: Mayukh Chakrabarti
*
*/

#include<bits/stdc++.h>
#define speed ios_base::sync_with_stdio(false)
#define boost cin.tie(NULL)
#define booster cout.tie(NULL)
#define endl "\n"
typedef long long int lld;

#define F(a,n) for(int i=0;i<n;i++){cin>>a[i];}
#define F1(a,n) for(int i=1;i<=n;i++){cin>>a[i];}
#define P(a,n) for(int i=0;i<n;i++){cout<<a[i]<<' ';}cout<<endl;
#define P1(a,n) for(int i=1;i<=n;i++){cout<<a[i]<<' ';}cout<<endl;
#define NF(a,n,m) for(int i=0;i<n;i++){for(int j=0;j<m;j++){cin>>a[i][j];}}
#define NF1(a,n,m) for(int i=1;i<=n;i++){for(int j=1;j<=m;j++){cin>>a[i][j];}}
#define PNF(a,n,m) for(int i=0;i<n;i++){for(int j=0;j<m;j++){cout<<a[i][j]<<' ';}cout<<endl;}cout<<endl;
#define PNF1(a,n,m) for(int i=1;i<=n;i++){for(int j=1;j<=m;j++){cout<<a[i][j]<<' ';}cout<<endl;}cout<<endl;

using namespace std;

int main(){
	
	speed;boost;
	
	lld N;
	cin>>N;
	lld ar[N+1];
	F(ar,N);
	
	ar[N]= INT_MAX;
	for(lld i=N-1; i >= 0; i--){
		if(ar[i] <= ar[i+1])
			continue;
		else if(ar[i]-1  <= ar[i+1])
			ar[i]-=1;
		else {
			cout<<"No";
			return 0;
		}
	}
	
	cout<<"Yes";
	
	return 0;
}




Measured memory_bytes: 1024
n = int(input())
s = list(map(str, input().split()))
f = [False] * 4
for i in range(n):
    if s[i] == 'P':
        f[0] = True

    elif s[i] == 'W':
        f[1] = True
    
    elif s[i] == 'G':
        f[2] = True
    
    else:
        f[3] = True

if sum(f) == 3:
    print('Three')

elif sum(f) == 4:
    print('Four')

Measured memory_bytes: 3064
#!/usr/bin/env python3

import sys
sys.setrecursionlimit(300000)


def solve(a: int):
    ret = a + a ** 2 + a ** 3
    print(ret)
    return

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    a = int(next(tokens))  # type: int
    solve(a)

if __name__ == '__main__':
    main()


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

int main() {
  int sx, sy, tx, ty;
  cin >> sx >> sy >> tx >> ty;
  int W = tx - sx;
  int H = ty - sy;
  string ans = "";
  for (int i = 0; i < H; i++) ans += "U";
  for (int i = 0; i < W; i++) ans += "R";
  for (int i = 0; i < H; i++) ans += "D";
  for (int i = 0; i < W; i++) ans += "L";
  ans += "L";
  for (int i = 0; i < H+1; i++) ans += "U";
  for (int i = 0; i < W+1; i++) ans += "R";
  ans += "DR";
  for (int i = 0; i < H+1; i++) ans += "D";
  for (int i = 0; i < W+1; i++) ans += "L";
  ans += "U";
  cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>

// using namespace __gnu_pbds;
using namespace std;

#define fbo find_by_order
#define ook order_of_key
#define fi first
#define se second
#define long long long
typedef pair<int,int> ii;
typedef pair<int,ii> iii;
typedef vector<int> vi;
typedef vector<ii> vii;
// typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
// mt19937_64 rng(std::chrono::system_clock::now().time_since_epoch().count());

// /mnt/c/Users/vince/Desktop/POST-IOI/  

int n, k;
int tree[1200003];

void update(int pos, int kir, int kan, int idx, int val)
{
	if(idx == kir && kan == idx) tree[pos] = val;
	else if(idx < kir || idx > kan) return;
	else
	{
		int mid = (kir+kan)/2;
		update(pos*2, kir, mid, idx, val);
		update(pos*2+1, mid+1, kan, idx, val);
		tree[pos] = max(tree[pos*2], tree[pos*2+1]);
	}
}
int query(int pos, int kir, int kan, int qkir, int qkan)
{
	if(qkan < kir || kan < qkir) return 0;
	else if(qkir <= kir && kan <= qkan) return tree[pos];

	int mid = (kir+kan)/2;
	int a = query(pos*2, kir, mid, qkir, qkan);
	int b = query(pos*2+1, mid+1, kan, qkir, qkan);
	return max(a,b);
}

int main()
{
	// ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	// freopen("input.in", "r", stdin);

	scanf("%d %d", &n, &k);

	while(n--)
	{
		int x; scanf("%d", &x);
		int num = query(1, 0, 300000, max(0,x-k), min(300000,x+k));
		update(1, 0, 300000, x, num+1);
		// for(int i = 1; i <= 10; i++)
		// 	printf("%d ", query(1, 1, 300000, i, i));
		// printf("\n");
	}
	printf("%d\n", tree[1]);
}






Measured memory_bytes: 7932
import java.util.Scanner;

	public class Main {

		public static void main(String[] args) {

			Scanner sc = new Scanner(System.in);
			
			int s = sc.nextInt();
			int w = sc.nextInt();
			
			if(w>=s) {
				System.out.println("unsafe");
			}else {
				System.out.println("safe");
			}
		
	    }
				
	}


Measured memory_bytes: 35764
void main() {
    long n = readln.chomp.to!long;
    long mod = 10 ^^ 9 + 7;
    long[] factors = new long[n+1];
    foreach (i; 1 .. n+1) {
        long d = i;
        long tmp;
        while (d % 2 == 0) {
            ++tmp;
            d /= 2;
        }
        factors[2] += tmp;
        long ind = 3;
        while (ind * ind <= d) {
            tmp = 0;
            while (d % ind == 0) {
                ++tmp;
                d /= ind;
            }
            factors[ind] += tmp;
            ind += 2;
        }
        if (d > 1) {
            ++factors[d];
        }
    }
    long result = 1;
    foreach (i; 0 .. n+1) {
        if (factors[i] > 0) {
            result = result * (factors[i] + 1) % mod;
        }
    }
    result.writeln;
}

import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.algorithm;
import std.range;
import std.math;
import std.numeric;
import std.container;
import std.typecons;
import std.ascii;
import std.uni;

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

int main(){
  long long int n,i,j,k,base=1,kotae=0,kari;
  cin>>n;
  long long int c0[61],c1[61];
  for(i=0;i<61;i++){
    c0[i]=0;
    c1[i]=0;
  }
  for(i=0;i<n;i++){
    cin>>k;
    for(j=0;k>0;j++){
      if(k%2==1){
        c1[j]++;
      }else{
        c0[j]++;
      }
      k/=2;
    }
    for(;j<61;j++){
      c0[j]++;
    }
  }
  for(i=0;i<61;i++){
    kari=base%1000000007;
    kari*=c0[i];
    kari%=1000000007;
    kari*=c1[i];
    kari%=1000000007;
    kotae+=kari;
    kotae%=1000000007;
    kotae=kotae+1-1;
    base*=2;
  }
  cout<<kotae;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <climits>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <bitset>
#include <utility>
#include <numeric>
#include <queue>
#include <stack>

using ll = long long;
using namespace std;

constexpr int MOD = 1e9 + 7;
constexpr ll MOD_LL = ll(1e9) + 7;

int main(void) {
	int n;
	cin >> n;
	
	vector<int> a(n);
	for(int i = 0; i < n; ++i) {
		cin >> a[i];
	}
	
	a.emplace(a.begin(), 0);
	a.push_back(0);
	
	int cost = 0;
	
	for(int i = 1; i < a.size(); ++i) {
		cost += abs(a[i] - a[i - 1]);
	}
	
	for(int i = 1; i <= n; ++i) {
		int ans = cost + abs(a[i - 1] - a[i + 1]) - (abs(a[i] - a[i + 1]) + abs(a[i] - a[i - 1]));
		cout << ans << endl;
	}
	
	return 0;
}


Measured memory_bytes: 1656
#include <cassert>
#include <iostream>
#include <vector>

static const int INF = 1 << 30;

template <class T> inline void chmax(T &a, const T &b) {
  if (a < b)
    a = b;
}

class DPsolver {

private:
  const int numNode;
  const std::vector<std::vector<int>> parentList;
  std::vector<int> dp;
  std::vector<bool> finished;

public:
  explicit DPsolver(const int numNode_,
                    std::vector<std::vector<int>> &&parentList_)
      : numNode(numNode_), parentList(std::move(parentList_)) {
    assert(static_cast<int>(parentList.size()) == 1 + numNode);
    dp.assign(1 + numNode, -INF);
    finished.assign(1 + numNode, false);
  }

  int operator()() const {
    int result = -1;
    for (auto v : dp)
      chmax(result, v);
    return result;
  }

  void solve() {
    for (int i = 1; i <= numNode; ++i)
      evalDP(i);
  }

private:
  int evalDP(const int i) {
    assert(1 <= i and i <= numNode);
    if (finished[i])
      return dp[i];
    if (parentList[i].empty()) {
      dp[i] = 0;
      finished[i] = true;
      return dp[i];
    }
    for (auto j : parentList[i]) {
      assert(1 <= j and j <= numNode);
      chmax(dp[i], evalDP(j) + 1);
    }
    finished[i] = true;
    return dp[i];
  }
};

int main() {

  // Input
  int numNode;
  int numEdge;
  std::cin >> numNode >> numEdge;
  assert(2 <= numNode and numNode <= 1.0e+5);
  assert(1 <= numEdge and numEdge <= 1.0e+5);
  std::vector<std::vector<int>> parentList(1 + numNode);
  for (int e = 1; e <= numEdge; ++e) {
    int fromNode;
    int toNode;
    std::cin >> fromNode >> toNode;
    assert(1 <= fromNode and fromNode <= numNode);
    assert(1 <= toNode and toNode <= numNode);
    parentList[toNode].push_back(fromNode);
  }

  // DP main
  DPsolver solver(numNode, std::move(parentList));
  solver.solve();

  // Output
  std::cout << solver() << std::endl;
  return 0;
}


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

int main() {
    int a, b, c, x, ans = 0;
    cin >> a >> b >> c >> x;
    for(int i = 0; i <= a; i++)
        for(int j = 0; j <= b; j++)
            for(int k = 0; k <= c; k++)
                if(500 * i + 100 * j + 50 * k == x) ans++;
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef pair<int, int> P;
int main(){
  int N;
  cin >> N;
  set<int> A;
  rep(i, N){
    int a;
    cin >> a;
    if(A.size() == i){
      A.insert(a);
    }else{
      cout << "NO" << endl;
      return 0;
    }
  }
  if(A.size() == N){
    cout << "YES" << endl;
  }else{
    cout << "NO" << endl;
  }

  return 0;
}


Measured memory_bytes: 9600
#include<bits/stdc++.h>
using namespace std;
typedef long long llint;
const llint MOD = 1'000'000'007;


int main() {
    string s;
    cin >> s;
    int N = s.size();
    int rez = 0;
    string prev = "$", pres = "";
    for(int i = 0; i < N; i++) {
        pres += s[i];
        if(prev != pres) {
            prev = pres;
            pres = "";
            rez++;
        }
    }
    cout << rez << endl;
}

Measured memory_bytes: 640
h,w = map(int,input().split())
table = [[0]*(w+2) for i in range(h+2)]
for i in range(h):
    s_list = list(input())
    for k in range(w):
        if s_list[k] == ".":
            s_list[k] = 0
    for j in range(w):
        table[i+1][j+1] = s_list[j]

for i in range(1,h+1):
    for j in range(1,w+1):
        if table[i][j] != "#":
            for k in range(-1,2):
                 for l in range(-1,2):
                     if (k == 0 and l == 0) != 1:
                       if table[i+k][j+l] == "#":
                           table[i][j] +=1

for i in range(1,h+1):
    dum = table[i][1:w+1]
    print("".join(map(str,dum)))

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

int main(){
	int end[35];
	for(int i = 1;i<=30;i++)
		end[i]= i;
	int w;
	int n;
	
	cin >> w;
	cin >> n;
	for(int i = 1; i<=n;i++){
		int a,b;
		char c;
		cin >> a;
		cin >> c;
		cin >> b;
		int temp = end[b];
		end[b]=end[a];
		end[a]=temp;
	
	}
	for(int i = 1;i<=w;i++)
		cout << end[i] << endl;
		
	return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <stdio.h>

int main() {
	int A, B, C, D;
	char number[100];
	std::cin >> number;
	D = atoi(&number[3]);
	number[3] = 0;
	C = atoi(&number[2]);
	number[2] = 0;
	B = atoi(&number[1]);
	number[1] = 0;
	A = atoi(&number[0]);

	int op1, op2, op3;
	for (int i = 0; i < 8; i++) {
		op1 = 1 + ((i >> 2) & 0x01) * -2;
		op2 = 1 + ((i >> 1) & 0x01) * -2;
		op3 = 1 + (i & 0x01) * -2;
		if (A + op1 * B + op2 * C + op3 * D == 7) {
			break;
		}
	}

	char opc1 = (op1 > 0) ? '+' : '-';
	char opc2 = (op2 > 0) ? '+' : '-';
	char opc3 = (op3 > 0) ? '+' : '-';

	printf("%d%c%d%c%d%c%d=7\n", A, opc1, B, opc2, C, opc3, D);


	return 0;

}


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

#define ll long long
#define ull unsigned long long
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(a,b) for(int a=0;a<(b);++a)
#define REP1(i,n) for(int i=1;i<=(n);++i)
#define debug(x) cerr<<#x<<": "<<x<<'\n'
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair
#define INF (1<<29)
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

template<class T=int>
T in(){T x;cin>>x;return (x);}
template<class T>
void print(T& x){cout<<x<<'\n';}

const int MOD =(int)1e9+7;
const int MAX =510000;
ll fac[MAX],finv[MAX],inv[MAX];
void COMint(){
    fac[0]=fac[1]=1;
    finv[0]=finv[1]=1;
    inv[1]=1;
    for(int i=2;i<MAX;i++){
        fac[i]=fac[i-1]*i%MOD;
        inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;
        finv[i]=finv[i-1]*inv[i]%MOD;
    }
}
ll COM(int n,int k){
    if(n<k) return 0;
    if(n<0||k<0)return 0;
    return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;
}
ll gcd(ll a,ll b){
    if(b==0)return a;
    if(a>b){
        swap(a,b);
    }
    return gcd(a,b%a);
}
ll lcm(ll a,ll b){
    ll g;g=gcd(a,b);
    return a*b/g;
}
bool compare_by_b(pair<int, int> a, pair<int, int> b) {
    if(a.second != b.second){
        return a.second < b.second;
    }else{
        return a.first < b.first;
    }
}

bool compare_by_a(pair<int, int> a, pair<int, int> b) {
    if(a.first != b.first){
        return a.first < b.first;
    }else{
        return a.second < b.second;
    }
}

vector<pair<int,ll>> vec[100000];
ll cost[100000];
void dfs(int now,ll COST){
    cost[now]=COST;
    int next;
    REP(i,vec[now].size()){
        next=vec[now][i].first;
        if(cost[next]<0){
            dfs(next,COST+vec[now][i].second);
        }
    }
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N=in();
    int a[N+1];
    REP(i,N){
        cin>>a[i+1];
    }
    int A[N+1]={};
    vector<int> B;
    for(int i=N;i>0;i--){
        int cnt=0;
        REP1(j,N){
            if(i*j>N){
                break;
            }
            cnt+=A[i*j];
        }
        if(a[i]!=(cnt%2)){
            B.pb(i);
            A[i]=1;
        }
    }
    cout<<B.size()<<endl;
    if(B.size()==0)return 0;
    REP(i,B.size()){
        cout<<B[i];
        if(i<B.size()-1)cout<<" ";
    }
    cout<<endl;
    return 0;
}


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

int main() {
    int n;
    cin>>n;
    long double p[n];
    for(int i = 0; i < n; i++){
        cin>>p[i];
    }
    long double dp[n+1][n+1];
    for(int i = 0 ;i <= n; i++){
        for(int j = 0; j <= n; j++){
            if(i == 0 && j == 0){
                dp[i][j] = 1; 
            }
            else if(j > i){
                dp[i][j] = 0;
            }
            else if(j == 0){
                dp[i][j] = dp[i-1][j] * (1-p[i-1]);
            }
            else{
                dp[i][j] =(double) (dp[i-1][j] * ((double)1-p[i-1])) + (double)(dp[i-1][j-1] * p[i-1]);
            }
            // cout<<dp[i][j]<<" ";
        }
        // cout<<endl;
    }
    long double ans = (long double) 0.00;
    for(int j = n; j > n/2; j--){
        ans += dp[n][j];
    }
    printf("%.10Lf\n", ans);
}

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

int main()
{
  #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
  int n;
  cin>>n;

  int count = 0;
  for(int i = 0;i<n;i++)
  {
    int d_i, d_j;
    cin>>d_i>>d_j;
    if(d_i == d_j)
      count++;
    else
      count = 0;
    if(count >= 3)
    {
      cout<<"Yes"<<endl;
      return 0;
    }
  }

  cout<<"No"<<endl;
  return 0;


}


Measured memory_bytes: 3628
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class Program
{
    static void Main(string[] args)
    {
            // 入力
            string[] sS = System.Console.ReadLine().Trim().Split(' ');
            int iX = int.Parse(sS[0]);
            int iY = int.Parse(sS[1]);

            System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
            sw.Start();

            // 解析 出力
            System.Console.WriteLine("{0}", (iX + iY / 2).ToString().Trim());

            sw.Stop();
#if DEBUG
            Console.WriteLine();
            Console.WriteLine("{0}", sw.Elapsed.ToString());
            Console.WriteLine("続行するには何かキーを押してください．．．");
            Console.ReadKey();
#endif
    }

}


Measured memory_bytes: 13268
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n, k;
    cin >> n >> k;
    string s;
    cin >> s;
    string t = "";
    int left = 0;
    vector<int> v;
    if (s[0] == '0')
        v.push_back(0);
    while (left < n)
    {
        int right = left;
        while (left < n && s[left] == s[right])
        {
            left++;
        }
        t += s[right];
        v.push_back(left - right);
    }
    if (s.back() == '0')
        v.push_back(0);
    n = v.size();
    vector<int> S(n + 1, 0);
    int ans = -1;
    for (int i = 0; i < n; i++)
    {
        S[i + 1] = S[i] + v[i];
    }
    for (int i = 0; i < n; i += 2)
    {
        int j = i + k * 2 + 1;
        if (j >= n)
            j = j = n;
        ans = max(ans, S[j] - S[i]);
    }
    cout << ans << endl;
}

Measured memory_bytes: 1400
#include <bits/stdc++.h>
 
using namespace std;
typedef long long int lli;
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
typedef pair <lli,lli> pii;
#define ff first
#define ss second
#define MOD 1000000007
#define pb push_back
 
int main(){
	fast;
	lli n, k;
	cin>>n>>k;
	vector<lli> m(n);
	for(int i=0; i<n; i++){
	    cin>>m[i];
	}
	sort(m.begin(), m.end());
	lli sum=0;
    for(int i=0; i<n-k; i++){
	    sum+=m[i];
	}
	cout<<sum<<"\n";
	return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#include <iomanip>
#include <cmath>
#include <functional>
#include <algorithm>
#include <numeric>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <deque>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <boost/range/irange.hpp>
#include <boost/container/static_vector.hpp>
#include <boost/utility/string_ref.hpp>

class input
{
    std::istream& cin;

public:
    input() : cin(std::cin)
    {
        std::cin.tie(nullptr);
        std::ios::sync_with_stdio(false);
    }

    template <class T>
    inline input& operator>>(T& var)
    {
        cin >> var;
        return *this;
    }
    template <class T>
    inline input& operator,(T& var)
    {
        cin >> var;
        return *this;
    }

    template <class T>
    inline T read()
    {
        T var;
        cin >> var;
        return var;
    }

    template <class InputIterator>
    inline void read(InputIterator head, std::size_t n)
    {
        for (std::size_t i = 0; i < n; ++i) {
            cin >> *head;
            ++head;
        }
    }

    template <class T>
    inline std::vector<T> read(std::size_t n)
    {
        std::vector<T> res;
        res.reserve(n);

        for (std::size_t i = 0; i < n; ++i) {
            T tmp;
            cin >> tmp;
            res.emplace_back(tmp);
        }
        return res;
    }

    template <class T, class F>
    inline void online(std::size_t n, F&& f)
    {
        T var;
        for (std::size_t i = 0; i < n; ++i) {
            cin >> var;
            f(var);
        }
    }
};
template <class T, std::size_t n>
std::istream& operator>>(std::istream& in, std::array<T, n>& var)
{
    for (std::size_t i = 0; i < n; ++i) {
        in >> var[i];
    }
    return in;
}

class output
{
    std::ostream& cout;

public:
    class proxy
    {
        std::ostream& cout;

    public:
        proxy() : cout(std::cout) {}
        ~proxy() { cout << '\n'; }
        template <class T>
        proxy& operator,(T&& val)
        {
            cout << ' ' << val;
            return *this;
        }
    };

public:
    output() : cout(std::cout)
    {
        cout << std::fixed << std::setprecision(15);
    }

    template <class T>
    proxy operator<<(T&& val)
    {
        cout << val;
        return {};
    }

    template <class T>
    void print(const T& container)
    {
        bool first = true;
        for (auto&& x : container) {
            if (!first) {
                cout << ' ';
                first = false;
            }
            cout << x;
        }
    }
};

int main()
{
    input in;
    output out;

    int r = in.read<int>();
    out << r * r;

    return 0;
}


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

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

    int l = pow(2, s.size() - 1);

    long long ans = 0;
    for (int i = 0; i < l; i++)
    {
        string buff = s.substr(0, 1);
        for (int j = 1; j < s.size(); j++)
        {
            if (i >> (j - 1) & 1)
            {
                ans += stoll(buff);
                buff = s.substr(j, 1);
            }
            else
            {
                buff += s.substr(j, 1);
            }
        }
        ans += stoll(buff);
    }

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

Measured memory_bytes: 384
#include<iostream>
#include<string>
#include<algorithm>
#include<math.h>
#include<queue>
#include<vector>
#include<map>
#include<cstdlib>



using namespace std;

int n[100005];
int x;
int inf=1<<21;
int ans=inf;
int main(){
    cin >> x;
    int flag=1;
    while(ans==inf){
        for(int i=2;i<=x;i++){
            if(i*i > x ) ans = x;
            else if(x%i==0) break; 
        }
        x++;
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 384
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
using namespace std;


int main() {
    double T, X;
    cin >> T >> X;

    cout << T / X << endl;
}

Measured memory_bytes: 3772
#include<iostream>
#include<cstring>
#include<algorithm>
#include<vector>
#include<queue>
#define PB push_back
using namespace std;
struct Cup{
    vector<vector<int> >A;
    int cnt,b;
    Cup(vector<vector<int> >A_,int cnt_,int b_){
        A=A_;cnt=cnt_;b=b_;
    }
    Cup(){}
};
int main(){
    int n,m;
    while(cin>>n>>m,n||m){
        queue<Cup>Q;
        int mn=m+5;
        int cnttt=0;
        vector<vector<int> >V(3);
        V[0].PB(0);V[1].PB(0);V[2].PB(0);
        for(int i=0;i<3;i++){
            int s;
            cin>>s;
            for(int j=0;j<s;j++){
                int d;
                cin>>d;
                V[i].PB(d);
            }
        }
        if(V[0].back()<V[1].back()){
            V[0].PB(V[1].back());
            V[1].pop_back();
            Q.push(Cup(V,1,1));
            V[1].PB(V[0].back());
            V[0].pop_back();
        }
        else if(V[0].back()!=0){
            V[1].PB(V[0].back());
            V[0].pop_back();
            Q.push(Cup(V,1,0));
            V[0].PB(V[1].back());
            V[1].pop_back();
        }


        if(V[2].back()<V[1].back()){
            V[2].PB(V[1].back());
            V[1].pop_back();
            Q.push(Cup(V,1,3));
            V[1].PB(V[2].back());
            V[2].pop_back();
        }
        else if(V[2].back()!=0){
            V[1].PB(V[2].back());
            V[2].pop_back();
            Q.push(Cup(V,1,2));
            V[2].PB(V[1].back());
            V[1].pop_back();
        }
        if(V[0].size()==n+1||V[2].size()==0){
            cout<<0<<endl;
            continue;
        }

        while(Q.size()){
            Cup x=Q.front();Q.pop();
            if(x.cnt>m)continue;



            if(x.A[0].size()==n+1||x.A[2].size()==n+1){
                mn=min(mn,x.cnt);
                break;
            }

            if(x.b==2||x.b==3){
                if(x.A[0].back()<x.A[1].back()){
                    x.A[0].PB(x.A[1].back());
                    x.A[1].pop_back();
                    Q.push(Cup(x.A,x.cnt+1,1));
                    x.A[1].PB(x.A[0].back());
                    x.A[0].pop_back();
                }
                else if(x.A[0].back()!=0){
                    x.A[1].PB(x.A[0].back());
                    x.A[0].pop_back();
                    Q.push(Cup(x.A,x.cnt+1,0));
                    x.A[0].PB(x.A[1].back());
                    x.A[1].pop_back();
                }
            }
            else{
                if(x.A[2].back()<x.A[1].back()){
                    x.A[2].PB(x.A[1].back());
                    x.A[1].pop_back();
                    Q.push(Cup(x.A,x.cnt+1,3));
                    x.A[1].PB(x.A[2].back());
                    x.A[2].pop_back();
                }
                else if(x.A[2].back()!=0){
                    x.A[1].PB(x.A[2].back());
                    x.A[2].pop_back();
                    Q.push(Cup(x.A,x.cnt+1,2));
                    x.A[2].PB(x.A[1].back());
                    x.A[1].pop_back();
                }
            }

        }

        if(mn==m+5)mn=-1;
        cout<<mn<<endl;

    }
}

Measured memory_bytes: 1236
'''
1枚抜いてDPをN枚についてやれば良い, がこれでは間に合わない
そこで必要不要の境界を二分探索で探す
するとO(N^2K)→O(NKlogN)となって間に合う

もう1つの方法は分からない
'''

def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations
    #from itertools import accumulate, product
    from bisect import bisect_left,bisect_right
    from math import floor, ceil
    #from operator import itemgetter

    #mod = 1000000007

    N,K = map(int, input().split())
    a = list(map(int, input().split()))
    a = sorted(a)
    a = a[:bisect_left(a, K)]
    n = len(a)


    import numpy as np
    def dp(omit):
        dp = np.zeros((n+1, K), dtype=np.bool)
        dp[0,0] = 1
        for i in range(n):
            # まとめて遷移
            dp[i+1] |= dp[i]
            if i != omit and a[i] < K:
                dp[i+1,a[i]:] |= dp[i,:K-a[i]]
        # 今回の値A[omit]を足してKに到達できるような部分和があれば、これは必要
        for j in range(max(0, K-a[omit]), K):
            if dp[n,j]:
                return True
        # なければ不要
        return False


    # def dp(num):
    #     dp = [[0]*(K) for _ in range(n)]
    #     dp[0][0] = 1
    #     b = a[:num]+a[num+1:] #N-1個
    #     for i in range(n-1):
    #         for j in range(K):
    #             if b[i]<=j:
    #                 dp[i+1][j] = dp[i][j-b[i]] or dp[i][j]
    #             else:
    #                 dp[i+1][j]=dp[i][j]
    #     return any(dp[n-1][K-a[num]:])

    left = 0
    right = n-1
    while left<=right:
        mid = (left+right)//2
        if dp(mid):
            right = mid-1
        else:
            left = mid+1
    print(right+1)

if __name__ == '__main__':
    main()


Measured memory_bytes: 36884
n, x = gets.chomp.split(" ").map(&:to_i)
if x == 1 || x == 2*n-1 then
  puts "No"
elsif n == 2 then
  puts "Yes"
  puts [1,2,3]
else
  if x == 2 then
    a2 = [x+1, x, x-1, x+2]
  else
    a2 = [x-1, x, x+1, x-2]
  end
  puts "Yes"
  a1 = (1..(2*n-1)).to_a
  a1 -= a2
  puts a1[0..(n-3)] + a2 + a1[(n-2)..(2*n-2-4)]
end

Measured memory_bytes: 9340