akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = double;
using ld = long double;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define all(v) (v).begin(), (v).end()
#define siz(v) (ll)(v).size()
#define rep(i, a, n) for (ll i = a; i < (ll)(n); i++)
#define repr(i, a, n) for (ll i = n - 1; (ll)a <= i; i--)
#define lb lower_bound
#define ub upper_bound
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
const ll mod = 1000000007;
const ll INF = 1000000099;
const ll LINF = (ll)(1e18 + 99);
vector<ll> dx = {-1, 1, 0, 0}, dy = {0, 0, -1, 1};
template <typename T, typename U>
void chmin(T &t, const U &u)
{
  if (t > u)
    t = u;
}
template <typename T, typename U>
void chmax(T &t, const U &u)
{
  if (t < u)
    t = u;
}
template <typename T>
T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
template <typename T>
T mpow(T a, T n)
{
  T res = 1;
  for (; n; n >>= 1)
  {
    if (n & 1)
      res = res * a;
    a = a * a;
  }
  return res;
}

//cin.tie(0);ios::sync_with_stdio(false);
//cout<<fixed<<setprecision(20);

signed main()
{
  ll n;
  cin >> n;
  vector<int> v(n, 1);
  if(n==3){
    cout<<2<<" "<<5<<" "<<63<<endl;
    return 0;
  }

  ll ind=0,cnt=1,b;//終わる位置
  repr(i,0,n-2){
    if(i<=15000 && i%3!=0){
      b=i;
      break;
    }
    i--;
  }

  rep(i,0,b+1){
    v[i]=2*(i+1);
  }
  
  //cout<<v[b]<<endl;
  
  rep(i,b+1,n){
    v[i]=3*cnt;
    cnt+=2;
  }

  rep(i, 0, n)
  {
    cout << v[i] << " ";
  }
  cout << endl;
}

//( ・ __ ・ ) KEEP BEING ORGANIZED
//CHECK overflow,vector_size,output_format?

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
#define mrep(i,j,n) for(int i = j; i < n; i++)
#define reps(i,n) for(int i = 1; i <= n; i++)
#define rrep(i,n) for(int i = n-1; i >= 0; i--)
#define rreps(i,n) for(int i = n; i >= 1; i--)
#define co(x) cout << x <<endl
#define cs(x) cout << x <<" "
#define el cout<<endl
#define cer(x) cerr << x <<endl
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define ERASE(x,val) x.erase(remove(ALL(x), val), x.end())
#define vi vector<int> 
#define vvi vector<vector<int>> 
#define vl vector<ll> 
#define vvl vector<vector<ll>> 
#define vb vector<bool> 
#define vvb vector<vector<bool>>
#define vs vector<string> 
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
ll mod = 1e9 + 7;
template<class T>inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; }return false; }
template<class T>inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; }return false; }
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { ll g = gcd(a, b); return a * b / g;}
bool is_prime(ll x) { for (ll i = 2; i * i <= x; i++) { if (x % i == 0)return false; } return true; }

int main()
{
	int n;
	cin >> n;
	vi dp(n + 1, n);
	dp[0] = 0;
	reps(i, n)
	{
		for (int pow6 = 1; pow6 <= i; pow6 *= 6)dp[i] = min(dp[i], dp[i - pow6] + 1);
		for (int pow9 = 1; pow9 <= i; pow9 *= 9)dp[i] = min(dp[i], dp[i - pow9] + 1);
	}
	co(dp[n]);
	return 0;
}


Measured memory_bytes: 640
S = input()
S = list(S)

ans = "Yes"
N = len(S)

i = 0
while i < N:
  k = N - i
#  print(S[i]),
# print(S[k-1])
  if S[i] != S[k -1]:
    ans = ' No'
  i += 1

i = 0
l = (N - 1) // 2

while i < l:
  k = l -i

  if S[i] != S[k - 1]:
    ans = 'No'
  i += 1

i = (N + 3) // 2
while i < N:
  m = N - i
  if S[i] != S[m -1]:
    ans = 'No'
  i += 1

print(ans)


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

// #define int long long
#define rep(i, n) for (long long i = (long long)(0); i < (long long)(n); ++i)
#define reps(i, n) for (long long i = (long long)(1); i <= (long long)(n); ++i)
#define rrep(i, n) for (long long i = ((long long)(n)-1); i >= 0; i--)
#define rreps(i, n) for (long long i = ((long long)(n)); i > 0; i--)
#define irep(i, m, n) for (long long i = (long long)(m); i < (long long)(n); ++i)
#define ireps(i, m, n) for (long long i = (long long)(m); i <= (long long)(n); ++i)
#define SORT(v, n) sort(v, v + n);
#define REVERSE(v, n) reverse(v, v+n);
#define vsort(v) sort(v.begin(), v.end());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
#define PI (acos(-1))
#define FILL(v, n, x) fill(v, v + n, x);
#define sz(x) long long(x.size())

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vs = vector<string>;
using vpll = vector<pair<ll, ll>>;
using vtp = vector<tuple<ll,ll,ll>>;
using vb = vector<bool>;

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 ll INF = 1e9;
const ll MOD = 1e9+7;
const ll LINF = 1e18;


ll modpow(ll a, ll n) {
  ll res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % MOD;
    (a *= a) %= MOD;
    n >>= 1;
  }
  return res;
}

const ll maxf = 10000000;
ll fact[maxf+5];
ll ifact[maxf+5];

void fact_init(){
  fact[0] = 1;
  for(ll i=1; i<=maxf; i++) fact[i] = (fact[i-1] * i) % MOD;
  ifact[maxf]=modpow(fact[maxf],MOD-2);
  for(ll i=maxf; i>=1; i--) ifact[i-1] = (ifact[i] * i) % MOD;
}

ll comb(ll n, ll r){
  if(n<r || n<0 || r<0) return 0;
  if(fact[0] == 0) fact_init();
  return ((fact[n] * ifact[n-r]) % MOD * ifact[r]) % MOD;
}

ll naive_comb(ll n, ll r){
  ll res = 1;
  for (ll i = n; i > n - r; i--) res = res * i % MOD;
  for (ll i = 1; i <= r; i++) res = (res * modpow(i, MOD-2)) % MOD;
  return res;
}


ll g(ll r, ll c){
  return comb(r+1+c+1,r+1)-1;
}

signed main()
{
  cin.tie( 0 ); ios::sync_with_stdio( false );
  
  ll r1,c1,r2,c2; cin>>r1>>c1>>r2>>c2;
  r1--,c1--;
  
  ll ans=g(r2,c2)-g(r2,c1)-g(r1,c2)+g(r1,c1);
  while(ans<0) ans+=MOD;
  ans%=MOD;
  cout<<ans<<endl;
  
}

Measured memory_bytes: 156544
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <complex>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <bitset>
#include <chrono>
#include <random>
#include <unordered_map>
#include <cassert>
#pragma GCC optimize("O3")
#pragma comment(linker, "STACK:36777216")
using namespace std;
using i64 = int64_t;
constexpr i64 MOD = 1e9 + 7;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
using vi = vector<i64>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using ii = pair<i64, i64>;

int main() {
    i64 n, a, b;
    cin >> n >> a >> b;
    
    if (n == 1) {
        if (a != b) {
            cout << 0 << endl;
            return 0;
        }
    }
    if (a > b) {
        cout << 0 << endl;
        return 0;
    }
    
    cout << 1 + (b - a) * (n - 2) << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<fstream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<vector>
#include<map>
using namespace std;
int main()
{
    int n;
    cin>>n;
    if (n%2==0)
    cout<<n/2<<endl;
    else
    cout<<n/2+1<<endl;
    return 0;     
}

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

using namespace std;
using ll = long long;
#define int ll

void init();
void solve();

#define rep(i, a) for (int i = 0; i < (int) (a); i++)
#define reps(i, a, b) for (int i = (int) (a); i < (int) (b); i++)
#define rrep(i, a) for (int i = (int) a-1; i >= 0; i--)
#define rreps(i, a, b) for (int i = (int) (a)-1; i >= (int) (b); i--)
#define MP(a, b) make_pair((a), (b))
#define PB(a) push_back((a))
#define all(v) (v).begin(), (v).end()
#define PRINT(f) if((f)){cout << (TRUE__) << endl;}else{cout << FALSE__ << endl;}
#define TRUE__  "Yes"
#define FALSE__ "No"
#define PERM(v) next_permutation(all(v))
#define UNIQUE(v) sort(all(v));(v).erase(unique(all(v)), v.end())
#define CIN(type, x) type x;cin >> x

#ifdef LOCAL
#define lcout(a) cout << a
#define lcoutln(a) cout << a << endl
#define lcerr(a) cerr << a
#define lcerrln(a) cerr << a << endl
#else
#define lcout(a) 
#define lcoutln(a) 
#define lcerr(a) 
#define lcerrln(a) 
#endif
#define MOD 1000000007
#define PI 3.141592653589793238462643383

signed main()
{
	init();
	solve();
}

int N;
int X;
vector<int> v;

void init()
{
	cin >> N >> X;
	rep(i, N) {
		CIN(int, t);
		v.PB(abs(t-X));
	}
}

int mgcd(int x, int y)
{
	if (x < y) swap(x, y);
	return y ? mgcd(y, x%y) : x;
}

void solve()
{
	int res = v[0];
	reps(i, 1, N) {
		res = mgcd(res, v[i]);
	}
	cout << res << endl;
}



Measured memory_bytes: 1400
#include <stdio.h>

int sum_digits(int n, int base)
{
    int count = 0;

    while(n) {
        count++;
        n /= base;
    }

    return count;
}

int main(void)
{
    int a, b;

    while(~scanf("%d%d", &a, &b))
        printf("%d\n", sum_digits(a + b, 10));

    return 0;
}


Measured memory_bytes: 1980
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();

		if ("AAA".equals(S) || "BBB".equals(S)) {
			System.out.println("No");
		} else {
			System.out.println("Yes");
		}
	}
}

Measured memory_bytes: 21844
s = input()
n = len(s)
s_r = s[::-1]
s1 = s[0:int((n-1)/2)]
s1_r = s1[::-1]
s2 = s[int((n+3)/2)-1:]
s2_r = s2[::-1]
isok = 'No'
if s==s_r:
    if s1==s1_r:
        if s2==s2_r:
            isok='Yes'
print(isok)

Measured memory_bytes: 3064
#include <iostream>
using namespace std;
int main(void){
    int n;
    cin >> n;
    if(n==0)return 0;
    long sum,min,max;
    sum=0;
    min=0;
    max=0;
    for(int i=0;i<n;i++){
        int x ;
        cin >> x;
        if(sum==0){
            sum=x;
            min=x;
            max=x;
        }else{
            sum+=x;
            if(min>x)min=x;
            if(max<x)max=x;
        }
    }
    cout << min << " " << max << " " << sum << endl;
}

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

int main() {
  int N; cin >> N;
  vector<float> A(N);
  rep( i, 0, N ) cin >> A.at(i);

  float Ans = 0.0;
  rep( i, 0, N ) {
    Ans += 1.0 / A.at(i);
  }

  Ans =  1.0 / Ans;
  cout << Ans << endl;
}


Measured memory_bytes: 384
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        q_1();
    }

    private static void q_1() {
        try(Scanner scan = new Scanner(System.in)) {
            String b = scan.next();

            switch (b) {
                case "A":
                    System.out.println("T");
                    break;
                case "T":
                    System.out.println("A");
                    break;
                case "C":
                    System.out.println("G");
                    break;
                case "G":
                    System.out.println("C");
                    break;
            }
        }
    }
}


Measured memory_bytes: 21588
using System;
using System.Linq;

class Problem
{
  public static void Main(string[] args)
  {
    var s = string.Join("", Console.ReadLine().OrderBy(c => c).ToArray());
    var t = string.Join("", Console.ReadLine().OrderByDescending(c => c).ToArray());
    if (s.CompareTo(t) < 0) Console.WriteLine("Yes");
    else Console.WriteLine("No");
  }
}


Measured memory_bytes: 13536
n,m = map(int,input().split())
a = [list(map(int,input().split())) for i in range(n)]
count = [0]*(m+1)
for i in a:
    count[i[0]] += 1
l = [0]*n
ans = max(count)
s = set()
for i in range(m-1):
    M = max(count)
    ind = count.index(M)
    s.add(ind)

    for j in range(n):
        if a[j][l[j]] == ind:

            count[ind] -= 1
            while a[j][l[j]] in s:
                l[j] += 1
            count[a[j][l[j]]] += 1
    ans = min(ans,max(count))

print(ans)

Measured memory_bytes: 10184
#include<iostream>
#include<iomanip>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<string>
#include<utility>
#include<numeric>
#include<algorithm>
#include<cmath>
#include<climits>
using namespace std;

using ll = long long;

class Stream{
public:
    Stream(){

    }
    //配列以外の入力を受け取る
    void read(){

    }
    template<typename First, typename... Rest>
    void read(First& first, Rest&... rest){
        cin >> first;
        read(rest...);
    }
    template<typename T>
    vector<T> read_vec(size_t n){
        vector<T> tmp(n);
        for(size_t i = 0; i < n; i++){
            cin >> tmp[i];
        }
        return tmp;
    }
    //配列を区切って出力する
    template<typename T>
    void write_vec(vector<T>& v, char divider){
        for(size_t i = 0; i < v.size(); i++){
            cout << v[i] << divider;
        }
    }
};

int main(){
    Stream io;
    
    int N;
    io.read(N);
    auto A = io.read_vec<int>(N);
    int Q;
    io.read(Q);
    vector<int> B(Q);
    vector<int> C(Q);
    for(int i = 0; i < Q; i++){
        io.read(B[i], C[i]);
    }
    vector<int> v(100001, 0);
    ll ans = 0;
    for(int i = 0; i < N; i++){
        v[A[i]]++;
        ans += A[i];
    }
    for(int i = 0; i < Q; i++){
        ans += v[B[i]] * (C[i] - B[i]);
        cout << ans << '\n';
        v[C[i]] += v[B[i]];
        v[B[i]] = 0;
    }

    return 0;
}

Measured memory_bytes: 4840
#include <bits/stdc++.h>
using namespace std;
struct Fast { Fast() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20);} } fast;

long long modpow(long long m, long long n) {
    if (n == 0) return 1;
    if (n % 2 == 0) {
        long long t = modpow(m, n / 2);
        return t / 2;
    } else {
        return modpow(m, n - 1) * m;
    }
}

int main() {
    int n, ans = 0, even = 0;
    cin >> n;
    map<int, int> pair;
    vector<int> as(n);
    for (int i = 0; i < n; i++){
        cin >> as[i];
    }
    for (int i = 0; i < n; i++){
        if (as[i] % 2 == 0){
            even += 1;
        }
    }
    cout << int(pow(3,n) - pow(2,even)) << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<utility>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<functional>
#include<math.h>
using namespace std;
#define N (1000000000+7)
#define M (998244353)
#define INF 1e16
typedef long long ll;
typedef pair<int,int> P;

int g[20][20];

int main(void){
    int n;
    cin>>n;
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            g[i][j]=-1;
        }
    }
    for(int i=0;i<n;i++){
        int a;
        cin>>a;
        for(int j=0;j<a;j++){
            int x,y;
            cin>>x>>y;
            x--;
            g[i][x]=y;
        }
    }
    ll ans =0;
    for(int i=0;i<(1<<n);i++){
        ll tmp = 0;
        bool flag = false;
        vector<int>decide;
        decide.resize(n,-1);
        for(int j=0;j<n;j++){
            if(i&(1<<j)){
                tmp++;
                if(decide[j]==0){
                    flag = true;
                    continue;
                }
                decide[j]=1;
                for(int k=0;k<n;k++){
                    if(g[j][k]!=-1){
                        if(decide[k]==-1)decide[k]=g[j][k];
                        else{
                            if(decide[k]!=g[j][k]){
                                flag = true;
                            }
                        }
                    }
                }
            }
            else{
                if(decide[j]==-1)decide[j]=0;
                else{
                    if(decide[j]!=0){
                        flag = true;
                        break;
                    }
                }
            }
        }
        if(flag)continue;
        //cout<<i<<endl;
        flag = false;
        for(int j=0;j<n;j++){
            int digit = (i>>j)&1;
            if(digit!=decide[j])flag = true;
        }
        if(flag)continue;
        ans = max(ans,tmp);
    }
    cout<<ans<<endl;
    return 0;
}

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

int main() {
    string S,T;cin>>S>>T;
    int ans=10000;
    for (int i = 0; i < S.size()-T.size()+1; i++){
        int tmp=0;
        for (int j = 0; j < T.size(); j++){
            if(S[i+j]!=T[j])tmp++;
        }
        ans=min(ans,tmp);
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 3632
#include <iostream>
#include <string>

using namespace std;

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

	long long ans = 0;
	int p = s.length() - 1;
	for (int i = s.length() - 1; i >= 0; i--) {
		if (s[i] == 'B') {
			ans += p - i;
			p--;
		}
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 640
//#include <bits/stdc++.h>
 
#include <iostream>
#include <algorithm>
 
#include <bitset>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <stack>
#include <queue>
#include <deque>
#include <cstring>
#include <string>
#include <utility>
#include <array>
#include <complex>
#include <valarray>
 
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <chrono>
#include <random>
#include <numeric>
 
 
using namespace std;
#define int long long
 
typedef long long ll;
typedef unsigned long long ull;
//typedef unsigned __int128 HASH;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pullull;
typedef pair<ll,int> plli;
typedef pair<double, int> pdbi;
typedef pair<int,pii> pipii;
typedef pair<ll,pll> plpll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<pii> vpii;
typedef vector<vector<int>> mat;
 
#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n);i>0;i--)
#define rrep2(i,a,b) for (int i=(a);i>b;i--)
#define pb push_back
#define fi first
#define se second
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
 
const ll hmod1 = 999999937;
const ll hmod2 = 1000000000 + 9;
const int INF = 1<<30;
const ll INFLL = 1LL<<62;
const double EPS = 1e-12;
const ll mod = 1000000000 + 7;
const int dx4[4] = {1, 0, -1, 0};
const int dy4[4] = {0, 1, 0, -1};
const int dx8[8] = {1, 1, 1, 0, 0, -1, -1, -1};
const int dy8[8] = {0, 1, -1, 1, -1, 0, 1, -1};
const double pi = 3.141592653589793;
 
#define addm(X, Y) (X) = ((X) + ((Y) % mod) + mod) % mod
#define inside(y, x, h, w) (0 <= (y) && (y) < (h) && 0 <= (x) && (x) < (w)) ? true : false

int n, m;
vector<vector<int>> g(100000 + 5);

struct UnionFind {
    int cnt;                          //uniteの回数
    vector<int> par, rank, e, tree_w;

    UnionFind() {}
    
    UnionFind(int n) : par(n), rank(n, 0), e(n, 0), tree_w(n, 1), cnt(0) {
        for (int i = 0; i < n; i++) {
            par[i] = i;
        }
	}

    int find_set(int now) {
        if (now == par[now]) return now;
        return par[now] = find_set(par[now]);
    }

    void unite(int u, int v) {
        cnt++;  
        int x = find_set(u);
        int y = find_set(v);
        if (x == y) {
			e[x]++;
			return ;
		}
        if (x > y) swap(x, y);
		e[x] += e[y] + 1;
        par[y] = x;
		tree_w[x] += tree_w[y];
    }

    bool same(int u, int v) {
        return find_set(u) == find_set(v);
    }

    int tree_weight(int x){
        return tree_w[find_set(x)];
    }
};

signed main() {	
    cin.tie(0);
    ios::sync_with_stdio(false);
	cin >> n >> m;
	UnionFind uf(n);
	rep(i, m) {
		int a, b;
		cin >> a >> b;
		a--; b--;
		uf.unite(a, b);
	}
	int num1 = n - uf.tree_w[1];
	int num2 = n - uf.tree_w[0];
	int ans1 = num1 * (num1 - 1) / 2 - (m - uf.e[1]) + (uf.tree_w[1] * (uf.tree_w[1] - 1) / 2 - uf.e[1]);
	int ans2 = num2 * (num2 - 1) / 2 - (m - uf.e[0]) + (uf.tree_w[0] * (uf.tree_w[0] - 1) / 2 - uf.e[0]);
	cout << max(ans1, ans2) << endl;
}


Measured memory_bytes: 5760
#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
int main(){
  ll n;
  cin>>n;
  vll a(n);
  rep(i,n) cin>>a[i];
  sort(all(a));
  vll b(100001);
  rep(i,n){
    b[a[i]]++;
  }
  ll cu=0;
  rep(i,sz(b)){
    if(b[i]>1){
      cu+=b[i]-1;
    }
  }
  if(cu%2==0) COUT(n-cu);
  else COUT(n-cu-1);
}

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

using namespace std;

typedef pair<int, int> range;


int main(int argc, const char * argv[]) {
    
    int n, k = 0;
    cin >> n >> k;
    
    string s;
    cin >> s;
    
    
    vector<int> ls;
    for(int i=0;i<n;i++)
    {
        if(s[i] != s[i+1])
        {
            ls.push_back(i+1);
        }
    }
    
    vector<int> rs;
    for(int j=n-1;j>=0;j--)
    {
        if(s[j] != s[j-1])
        {
            rs.push_back(j-1);
        }
    }

    
    if(k>ls.size())
    {
        cout << n-1 << endl;
        return 0;
    }
    
    int llast = ls[k-1];
    int rlast = rs[k-1];
    if(llast > rlast)
    {
        cout << n-1 << endl;
        return 0;
    }
    
    int current = k-1;
    for(int j = ls[current];j<=rs[current];j++)
    {
        if(s[j] == 'L')
        {
            s[j] = 'R';
        }
        else
        {
            s[j] = 'L';
        }
    }
    
    int count = 0;
    for(int i=0;i<s.length();i++)
    {
        if(s[i] == 'L')
        {
            if(i >= 1 && s[i - 1] == 'L')
            {
                count++;
            }
        }
        else
        {
            if(i <= s.length() - 2 && s[i + 1] == 'R')
            {
                count++;
            }
        }
    }
    
    count += 2 * current;
    
    cout << count << endl;
    
    return 0;
}


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

static const int MAX = 200000;

int main() {
	int R[MAX], n;
	cin >> n;
	for ( int i = 0; i < n; i++) cin >> R[i];
	
	int maxv = R[1] - R[0];
	int minv = R[0];
	for ( int i = 1; i < n; i++) {
		maxv = max(maxv, R[i] - minv);
		minv = min(minv, R[i]);
	}
	
	cout << maxv << endl;
	return 0;
}



Measured memory_bytes: 3868
#include<cstdio>
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<cmath>
#include<complex>

using namespace std;

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

int main(){
	int n,q;
	cin>>n>>q;
	
	string name = "kogakubu10gokan" ;
	bool ans = false;
	rep(i,n){
		int s;
		cin>>s;
		if(s>q && !ans){
			cout<<name<<endl;;
			ans = true;
		}
		cin>>name;
	}
	
	if(!ans)cout<<name<<endl;
}

Measured memory_bytes: 1204
#pragma GCC optimize("O3")
#pragma GCC target("avx")
#include <bits/stdc++.h>
#define rep(i ,n) for(int i=0;i<(int)(n);++i)
#define repr(i ,n) for(int i=n;i>(int)(n);--i)
#define rep1(i ,n) for(int i=1;i<=(int)(n);++i)
#define ALL(a) a.begin(), a.end()
#define RSORT(a) sort(ALL(a),greater<>())
#define SORT(a) sort(ALL(a))
#define bit_check(bit, i) ((bit>>(i)) & 1)
#define PRINT(x) cout << (x) << endl;
#define ENDL cout << endl;
using namespace std;
typedef long long int i64;
typedef unsigned long long u64;
template<class T> using V = vector<T>;
using VI = V<int>;
const int INF = 2e9;
const i64 MOD = 1e9 + 7;

template <class T> inline bool chmin(T& a, T b){if(a>b){a=b; return true;} return false;}
template <class T> inline bool chmax(T& a, T b){if(a<b){a=b; return true;} return false;}
struct Init_On{
    Init_On(){
        cin.tie(nullptr);
        ios_base::sync_with_stdio(false);
        cout << fixed << setprecision(16);
    }
};

signed main(){
    Init_On s;
    u64 n , a , b , c , d , e;
    cin >> n >> a >> b >> c >> d >> e;
    u64 min_section = min({a , b ,c , d , e});
    u64 ans = ( (n + min_section -1 ) / min_section) + 4;
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
char str[105][105];

int main() {
  int n,m;
  scanf("%d%d",&n,&m);
  for (int i = 1; i <= n; ++i) {
    scanf("%s",str[i] + 1);
    str[i][0] = str[i][m + 1] = '#';
    str[i][m + 2] = '\n';
  }
  for (int i = 0; i <= m + 1; ++i) i == m + 1 ? printf("#\n") : printf("#");
  for (int i = 1; i <= n; ++i) printf("%s",str[i]);
  for (int i = 0; i <= m + 1; ++i) i == m + 1 ? printf("#\n") : printf("#");
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

int top ,S[1000];

void push(int x){
	S[++top]=x;
} 

int pop(){
	top--;
	return S[top+1];
}

int main(){
	int a,b;
	top = 0;
	char s[100];
	while(scanf("%s",&s) != EOF){
		if(s[0] == '+'){
			a = pop();
			b = pop();
			push(a+b);
		}
		else if(s[0] == '-'){
			b = pop();
			a = pop();
			push(a-b);
		}
		else if(s[0] == '*'){
			a = pop();
			b = pop();
			push(a*b);
		}
		else{
			push(atoi(s));
		}
	}
	
	printf("%d\n",pop());

	return 0;
}


Measured memory_bytes: 2104
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<bool> vb;
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define in insert
#define FOR(i,a,b) for (int i = a; i < b; i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const int INF = 1e9 + 5;
int main(){
    int a, b, c;
    cin >> a >> b >> c;
    int x = b / a;
    cout << min(x, c);
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define fast ios::sync_with_stdio(false), cin.tie(0);
#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define endl '\n'

using namespace std;

main()
{
    fast;
    int n,m,x,y,i;
    cin>>n>>m>>x>>y;
    int xi,yi,a;
    cin>>xi;
    for (i=0;i<n-1;i++)
    {
        cin>>a;
        xi=max(xi,a);
    }
    cin>>yi;
    for (i=0;i<m-1;i++)
    {
        cin>>a;
        yi=min(yi,a);
    }
    int st=xi+1,en=yi;
    if (st>en)
        cout<<"War\n";
    else if (en<=x || st>y)
        cout<<"War\n";
    else
        cout<<"No War\n";
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
constexpr ll mod=1e9+7;

int main()
{
  deque<char> deq;

  string s;
  cin>>s;
  for (int i = 0; i < s.size(); ++i)
  {
    deq.push_back(s[i]);
  }
  int q,t,f;
  char c;
  cin>>q;
  bool flag=false;
  for (int i = 0; i < q; ++i)
  {
    cin>>t;
    if(t==1)
    {
      flag=(!flag);
      continue;
    }
    cin>>f>>c;
    if(flag) f=(f==1)?2:1;
    if(f==1) deq.push_front(c);
    else deq.push_back(c);
  }

  if(flag)
  {
    while(!deq.empty())
    {
      cout<<deq.back();
      deq.pop_back();
    }
  }
  else
  {
    while(!deq.empty())
    {
      cout<<deq.front();
      deq.pop_front();
    }
  }
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define f(i,n) for(int i=0;i<(n);i++)
#define P pair<int,int>
#define int long long
#define S stack<int>
#define Q queue<int>
#define V vector<int>
using namespace std;
signed main(){
	int a,b,c;
	cin>>a;
	if(a-1){
		cin>>b>>c;
		cout<<b+c<<endl;
	}
	else puts("Hello World");
	return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[]args){
		
		Scanner scan = new Scanner(System.in);
		StringBuffer sb = new StringBuffer();
		
		String S = scan.next();
		
		
		if(S.length()%2==0){//文字列の長さが奇数か偶数で場合わけ
			for(int i = 0;i<S.length()-1;i=i+2){//偶数
				sb.append(S.substring(i, i+1));
				
			}
			
		}else{//奇数の時
			for(int i = 0;i<S.length();i=i+2){
				sb.append(S.substring(i, i+1));
			}
			
		}
		
		
		
		
		System.out.println(sb.toString());
		
	}

}


Measured memory_bytes: 28048
#include <bits/stdc++.h>
using namespace std;
#define FOR(I,X,Y) for(long long (I)=(X);(I)<(Y);(I)++)
#define REP(I,X,Y) for(long long (I)=(Y)-1;(I)>=(X);(I)--)
#define ALL(X) (X).begin(),(X).end()
#define pb push_back
#define COUNT(V,X) upper_bound((V).begin(),(V).end(),X)-lower_bound((V).begin(),(V).end(),X)
#define debug(x) cerr<<#x<<':'<<x<<endl;
#define DEBUG(v) cerr<<#v<<':';for(auto x:v)cerr<<x<<' ';cerr<<endl;
#define INF 1000000007
#define LINF 1000000000000000007
#define EPS 1e-9
typedef long long ll;

struct RangeUpdateQuery{
  vector<long long> data;
  long long sq;
  vector<long long> lazy;
  void boot(long long n){
    data.resize(n);
    sq = round(sqrt((double)n));
    lazy.resize(n/sq+1);
    for(long long i = 0;i < lazy.size();i++)lazy[i] = -1000000000000000007;
  }
  void update(long long s,long long t,long long num){
    if(lazy[s/sq] != -1000000000000000007){
      for(long long i = s/sq*sq;i < min((s/sq+1)*sq,(long long)data.size());i++)data[i] = lazy[s/sq];
      lazy[s/sq] = -1000000000000000007;
    }
    if(lazy[t/sq] != -1000000000000000007){
      for(long long i = t/sq*sq;i < min((t/sq+1)*sq,(long long)data.size());i++)data[i] = lazy[t/sq];
      lazy[t/sq] = -1000000000000000007;
    }
    while(s%sq && s<=t){
      data[s] = num;
      s++;
    }
    while((t-s+1)/sq){
      lazy[s/sq] = num;
      s += sq;
    }
    while(s <= t){
      data[s] = num;
      s++;
    }
    return;
  }
  long long find(long long s){
    if(lazy[s/sq] != -1000000000000000007){
      for(long long i = s/sq*sq;i < min((s/sq+1)*sq,(long long)data.size());i++)data[i] = lazy[s/sq];
      lazy[s/sq] = -1000000000000000007;
    }
    return data[s];
  }
};

signed main(){
  RangeUpdateQuery RUQ;
  int n,q;
  cin >> n >> q;
  int query,s,t,x;
  RUQ.boot(n);
  RUQ.update(0,n-1,(ll)2147483647);
  vector<long long> ans;
  FOR(i,0,q){
    cin >> query;
    if(query == 0){
      cin >> s >> t >> x;
      RUQ.update(s,t,x);
    }
    else{
      cin >> s;
      ans.pb(RUQ.find(s));
    }
  }
  for(auto x:ans)cout << x << endl;
}


Measured memory_bytes: 4688
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>


using namespace std;

// vector<vector<int>> mat(N, vector<int>(M, 0));

int main(int argc, const char *argv[])
{
    //
    int A,B,C;
    cin>>A>>B>>C;
    cout<<max(0,C-A+B);
    return 0;
}

Measured memory_bytes: 256
if __name__ == "__main__":
    k = int(input())
    a, b = map(int, input().split())
    ans = ""

    if a % k == 0:
        ans = "OK"
    else:
        x = a // k
        if k * (x + 1) <= b:
            ans = "OK"
        else:
            ans = "NG"
    
    print(ans)

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

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned __int128 HASH;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pullull;
typedef pair<ll,int> plli;
typedef pair<double, int> pdbi;
typedef pair<int,pii> pipii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<pii> vpii;

#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n);i>0;i--)
#define rrep2(i,a,b) for (int i=(a);i>b;i--)
#define pb push_back
#define fi first
#define se second
#define all(a) (a).begin(),(a).end()

const ll mod = 1000000000 + 7;
const ll hmod1 = 999999937;
const ll hmod2 = 1000000000 + 9;
const ll INF = 1<<30;
const int dx4[4] = {1, 0, -1, 0};
const int dy4[4] = {0, 1, 0, -1};
const int dx8[8] = {1, 1, 1, 0, 0, -1, -1, -1};
const int dy8[8] = {0, 1, -1, 1, -1, 0, 1, -1};
const double pi = 3.141592653589793;

string a;
int dp[200000 + 5];
pair<int, char> nx[200000 + 5];
vector<vector<int>> pos(26);


signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> a;
    int n = a.size();
    rep(i, n) pos[a[i] - 'a'].push_back(i);
    rep(i, 26) {
        pos[i].push_back(n);
        sort(all(pos[i]));
    }
    fill(dp, dp + n + 2, 1e9);
    dp[n + 1] = 0;
    dp[n] = 1;
    rrep2(i, n - 1, -1) {
        rep(j, 26) {
            int idx = *lower_bound(all(pos[j]), i);
            if (dp[i] > dp[idx + 1] + 1) {
                dp[i] = dp[idx + 1] + 1;
                nx[i] = make_pair(idx + 1, char('a' + j));
            }
        }
    }
    string ans;
    int now = 0;
    while (now < n) {
        ans += nx[now].se;
        now = nx[now].fi;
    }
    cout << ans << endl;
}


Measured memory_bytes: 3732
#include <bits/stdc++.h>
using namespace std;
const auto start_time = std::chrono::high_resolution_clock::now();
void timecalculater(){
    #ifndef ONLINE_JUDGE
    auto end_time = std::chrono::high_resolution_clock::now();
    std::chrono::duration<double> diff = end_time-start_time;
    cerr<<"Time Taken : "<<diff.count()<<"\n";
    #endif
}
void __print(int x) {cout << x;}
void __print(long x) {cout << x;}
void __print(long long x) {cout << x;}
void __print(unsigned x) {cout << x;}
void __print(unsigned long x) {cout << x;}
void __print(unsigned long long x) {cout << x;}
void __print(float x) {cout << x;}
void __print(double x) {cout << x;}
void __print(long double x) {cout << x;}
void __print(char x) {cout << '\'' << x << '\'';}
void __print(const char *x) {cout << '\"' << x << '\"';}
void __print(const string &x) {cout << '\"' << x << '\"';}
void __print(bool x) {cout << (x ? "true" : "false");}
template<typename T, typename V>
void __print(const pair<T, V> &x) {cout << '{'; __print(x.first); cout << ','; __print(x.second); cout << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cout << '{'; for (auto &i: x) cout << (f++ ? "," : ""), __print(i); cout << "}";}
void _print() {cout << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cout << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cout << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
#define rep(i, n) for(ll i = 0; i < (n); ++i)
#define repA(i, a, n) for(int  i = a; i <= (n); ++i)
#define all(x) x.begin(), x.end()
#define sz(x) (int) (x).size()
#define fill(a) memset(a, 0, sizeof(a))
#define fst first
#define snd second
#define mp make_pair
#define pb push_back
#define endl '\n'
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long long int> vll;
typedef vector<pii> vii;
int main() {
  
    cin.sync_with_stdio(0); cin.tie(0);
    cin.exceptions(cin.failbit);
    int T=1;
    // cin>>T;
    while(T--){
        int x,y,z;cin>>x>>y>>z;
        cout<<z<<" "<<x<<" "<<y;
    }   
    timecalculater();
    return 0;   
}   

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

using namespace std;

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

    int n;
    cin >> n;
    while (n > 0)
    {
        if (n % 10 == 7)
        {
            cout << "Yes";
            return 0;
        }
        n = n / 10;
    }
    cout << "No";

}


Measured memory_bytes: 3648
import math
N =int(input())
M = int(math.sqrt(N))
ans = [0 for _ in range(10050)]
for j in range(M):
  for k in range(M):
    for l in range(M):
      v = (j+1)**2 + (k+1)**2 + (l+1)**2 + (j+1)*(k+1) + (k+1)*(l+1) + (l+1)*(j+1)
      if (v<=N):
        ans[v] += 1
for i in range(N):
  print(ans[i+1])

Measured memory_bytes: 74296
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    def calc():
        n = int(readline())
        a = list(map(int, readline().split()))
        s = input()
        b = [-1] * 61

        for i in range(n - 1, -1, -1):
            x = a[i]
            if s[i] == "0":
                l = x.bit_length()
                if b[l - 1] == -1:
                    b[l - 1] = x
                else:
                    while b[l - 1] != -1 and x > 0:
                        x ^= b[l - 1]
                        l = x.bit_length()
                    if x != 0:
                        b[l - 1] = x
            else:
                xb = format(x, "b")[::-1]
                l = len(xb)
                cur = 0
                for j in range(l - 1, -1, -1):
                    bit = int(xb[j])
                    cur_bit = int(format(cur,"b").zfill(l)[::-1][j])
                    if bit ^ cur_bit == 1:
                        if b[j] != -1:
                            cur ^= b[j]
                        else:
                            return print(1)
        return print(0)

    t = int(readline())
    for _ in range(t):
        calc()


if __name__ == '__main__':
    main()


Measured memory_bytes: 74516
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
string a[8]={"0","1","2","3","5","7","8","9"};
string func(int in){
  if(!in)return "0";
  else {
    string out="";
    while(in){
      out=a[in%8]+out;
      in/=8;
    }
    return out;
  }
}  
int main(){
  int in;
  while(cin>>in,in){
    cout<<func(in)<<endl;
  }
}

Measured memory_bytes: 1204
// reference: https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

use std::cmp::Ordering;
#[derive(Eq, PartialEq, Clone, Debug)]
pub struct Rev<T>(pub T);

impl<T: PartialOrd> PartialOrd for Rev<T> {
    fn partial_cmp(&self, other: &Rev<T>) -> Option<Ordering> {
        other.0.partial_cmp(&self.0)
    }
}

impl<T: Ord> Ord for Rev<T> {
    fn cmp(&self, other: &Rev<T>) -> Ordering {
        other.0.cmp(&self.0)
    }
}

impl<T: Copy> Copy for Rev<T> {}

fn main() {
    input! {
        n: usize,
        a: [usize1; n],
        b: [usize; n],
        c: [usize; n-1],
    }
    let mut ans = b[a[0]];
    for i in 1..n {
        let p = a[i - 1];
        let ai = a[i];
        ans += b[ai];
        if p + 1 == ai {
            ans += c[p];
        }
    }

    println!("{}", ans);
}


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

int main()
{
    char c;
    cin >> c;
    
    if(c=='a'||c=='i'||c=='u'||c=='e'||c=='o')
    {
        cout << "vowel" << endl;
    }
    else
    {
        cout << "consonant" << endl;
    }
}

Measured memory_bytes: 256
//的場梨沙★担当
//結城晴★副担当
//日野茜★副担当
#include <vector>
#include <list>
#include <map>
#include <climits>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string.h>
#include <string>
#include <cstring>
#include <ctime>
#include <queue>
#include <random>
#include <cctype>
#include <complex>
#include <regex>
#include <unordered_map>
#include <string>
#include <algorithm>
#include <cctype>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <iomanip>
#include <iostream>

using namespace std;

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

    C=A;
    int i=1;

    while(C>0){
        C=A-(i*B);
        i++;

    }
    cout<<i-1<<endl;



}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int[] d = new int[11];
        d[scan.nextInt()] += 1;
        d[scan.nextInt()] += 1;
        d[scan.nextInt()] += 1;
        boolean answer = false;
        if (d[5] == 2 && d[7] == 1) {
            answer = true;
        }
        System.out.println(answer ? "YES" : "NO");
    }
}


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

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

	vector<int>A(N), B(N), C(N - 1);
	for (int i = 0; i < N; ++i) {
		cin >> A[i];
		--A[i];
	}
	for (int j = 0; j < N; ++j) {
		cin >> B[j];
	}
	for (int k = 0; k < N; ++k) {
		cin >> C[k];
	}

	int answer = 0;

	for (int i = 0; i < N; ++i) {
		answer += B[A[i]];

		if (i > 0 && A[i] == A[i-1]+ 1) {
			answer += C[A[i - 1]];
		}
	}

	cout << answer << endl;

}

Measured memory_bytes: 3636
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <queue>
#include <tuple>
#include <cstring>

#define INF 100000000

using namespace std;

int main()
{
    int a, b;
    cin >> a >> b;
    string s;
    cin >> s;
    for (int i = 0; i <= a + b; i++)
    {
        if (i == a && s[a] == '-')
            continue;
        else if (s[i] != '-' && i != a)
            continue;
        else
        {
            //cout << i << endl;
            cout << "No\n";
            return 0;
        }
    }
    cout << "Yes\n";

    return 0;
}


Measured memory_bytes: 256
N,K = map(int,input().split())
ans = 1
res = 0
aro = 0
for i in range(N,0,-1):
    ans = i*(2**aro)
    while ans < K:
        ans *= 2
        aro += 1
#     print(aro)
    res += 0.5**(aro)
print(res/N)



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

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

const int N = 100005;
int perm[N], p[N];

int find(int v){
	return (p[v] < 0)?v:(p[v] = find(p[v]));
}

void combine(int u, int v){
	u = find(u); v = find(v);
	if(u == v)return;
	if(p[u] > p[v])swap(u, v);
	p[u] += p[v];
	p[v] = u;
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	cout<<setprecision(32);

	int n, m;
	cin>>n>>m;
	for(int i = 1; i <= n; i++){
		cin>>perm[i];
	}
	memset(p, -1, sizeof(p));
	for(int i = 0; i < m; i++){
		int u, v;
		cin>>u>>v;
		combine(u, v);
	}
	int ans = 0;
	for(int i = 1; i <= n; i++){
		if(find(i) == find(perm[i]))ans++;
	}
	cout<<ans<<'\n';

	return 0;
}

Measured memory_bytes: 1024
/*
 * Remember a 7.0 student can know more than a 10.0 student.
 * Grades don't determine intelligence, they test obedience. 
 * I Never Give Up.
 */
import java.util.*;
import java.util.Map.Entry;
import java.io.*;

import static java.lang.System.out;
import static java.util.Arrays.*;
import static java.lang.Math.*;
class Main {
	private static Reader in=new Reader();
	private static StringBuilder ans=new StringBuilder();
	private static long MOD=1000000007;//10^9+7 
	private static final int N=1000000;//10^6
	private static final int LIM=26;
//	private static final double PI=3.1415;
//	private static ArrayList<Integer> v[]=new ArrayList[N];
//	private static int color[]=new int[N]; //For Graph Coloring
//	private static boolean mark[]=new boolean[N];
//	private static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
//	private static void dfs(int node){mark[node]=true;for(int x:v[node]){if(!mark[x]){dfs(x);}}}
	private static long powmod(long x,long n,long m){
		if(n==0)return 1;
		else if(n%2==0)return(powmod((x*x)%m,n/2,m));
		else return (x*(powmod((x*x)%m,(n-1)/2,m)))%m;
	}
//	private static void shuffle(String[] arr) {
//		for (int i = arr.length - 1; i >= 2; i--) {
//			int x = new Random().nextInt(i - 1);
//	        String temp = arr[x];
//	        arr[x] = arr[i];
//	        arr[i] = temp;
//	    }
//	 }
	//OJ Doing = Codeforces
	//Double check the code
	public static void main(String[] args) throws IOException{
		long n=in.nextLong();
		long sum=0;
		for(long i=n;i!=0;i=i/10){
			sum+=i%10;
		}
		if(n%sum==0)out.println("Yes");
		else out.println("No");
	}
	static class Pair implements Comparable<Pair>{
		long l;
		long r;
		Pair(){
			l=0;
			r=0;
		}
		Pair(long k,long v){
			l=k;
			r=v;
		}
		@Override
		public int compareTo(Pair o) {
			if(l!=o.l)return (int) (l-o.l);
			else return (int) -(r-o.r);  //changed
		}
		
	}
	static class Reader{
        BufferedReader br;
        StringTokenizer st;
        public Reader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }
 
        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
 
        int nextInt()
        {
            return Integer.parseInt(next());
        }
 
        long nextLong()
        {
            return Long.parseLong(next());
        }
 
        double nextDouble()
        {
            return Double.parseDouble(next());
        }
 
        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
}         

Measured memory_bytes: 23124
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
signed main(){
  ll n,p,ans=1,tmp,cnt=0;
  vector<pair<ll,ll>> num;
  cin >> n >> p;
  tmp=p;
  for(ll i=2;i*i<=tmp;i++){
    cnt=0;
    while(tmp%i==0){
      cnt++;
      tmp/=i;
    }
    if(cnt!=0){
      num.push_back(make_pair(i,cnt));
    }
  }
  if(tmp!=1){
    num.push_back(make_pair(tmp,1));
  }
  for(int i=0;i<num.size();i++){
    while(num[i].second>=n){
      ans*=num[i].first;
      num[i].second-=n;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
n,m,c=map(int,input().split())
b=[]
b+=list(map(int,input().split()))
a=[]
count=0
for i in range(0,n):
  temp=0
  a.append(list(map(int,input().split())))
  for j in range(0,m):
    temp=temp+a[i][j]*b[j]
  if temp+c>0:
    count=count+1
print(count)

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

int main() {
  int K;
  cin >> K;
  vector<int> A = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
  
  cout << A.at(K-1) << endl;
  return 0;
}




Measured memory_bytes: 3628