akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#pragma GCC optimize ("Ofast")
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
using namespace std;
#define F first
#define S second
//#define int long long

///My functions
void sread ( string &s ){ cin >> s ; s = '_' + s ; }
void sprint ( string &s ){ cout << s.substr( 1 , s.size() ) ; } 

//Constants
const int mxn = 3*1e5+5, inf = 1e9+7, mod = 1e9+7;
const long long infLL = 1e18+5;
const double EPS = 1e-9 , PI = acos(-1);

//Structs

//Variables
int n,m,Q,k,a,b,c,sum,ans,MAXans,MINans,sc,pos,acc[mxn],racc[mxn],ar[mxn];
vector<int>v,g[mxn];
bitset<mxn>flag;
bool sol ;
string s;

int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    
    cin >> a >> b ;
    cout << a * b ; 






    return 0;
}
























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

ll MOD = 1e9+7;
int main()
{
    cin.tie(0);
   	ios::sync_with_stdio(false);

    int N;
    cin >> N;
    string S, T;
    cin >> S >> T;
    for(int i = 0; i < N; i++)
    {
        cout << S[i];
        cout << T[i];
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <climits>
#include <cmath>
#include <algorithm>
#include <utility>
#include <vector>
#include <string>

#define MAX 200000
#define INFTY 1<<30

using namespace std;

template<typename T>
class Heap
{
private:
  int parent(int i) {return i/2;}
  int left(int i) {return 2*i;}
  int right(int i) {return 2*i+1;}
  void maxHeapfy(int i)
  {
    int l, r, largest;
    l = left(i);
    r = right(i);

    if(l <= H && A[l] > A[i]) largest = l;
    else largest = i;
    if(r <= H && A[r] > A[largest]) largest = r;

    if(largest != i)
    {
      swap(A[i], A[largest]);
      maxHeapfy(largest);
    }
  }
  void increaseKey(int i, T key)
  {
    if(key < A[i]) return;
    A[i] = key;
    while(i>1 && A[parent(i)] < A[i])
    {
      swap(A[i], A[parent(i)]);
      i = parent(i);
    }
  }
public:
  int H; // ??????????????§??????
  vector<T> A;
  Heap(int n = 0)
  {
    H = n;
    A.resize(n+1);
  }
  ~Heap(){}
  T* operator[](int i)
  {
    return &A[i];
  }
  void buildMaxHeap(){for(int i = H/2; i >= 1; i--) maxHeapfy(i);}
  void printInfo(int i)
  {
    cout << "node " << i << ": key = " << A[i] << ", ";
    if(parent(i) >= 1) cout << "parent key = " << A[parent(i)] << ", ";
    if(left(i) <= H) cout << "left key = " << A[left(i)] << ", ";
    if(right(i) <= H) cout << "right key = " << A[right(i)] << ", ";
    cout << endl;
  }
  void insert(T key)
  {
    H++;
    A.resize(H+1);
    A[H] = -INFTY;
    increaseKey(H, key);
  }
  int extract()
  {
    T maxv;
    if(H < 1) return -INFTY;
    maxv = A[1];
    A[1] = A[H--];
    maxHeapfy(1);
    return maxv;
  }
};

int main()
{
  int x;
  string com;
  Heap<int> T;
  while(1)
  {
    cin >> com;
    if(com == "insert")
    {
      cin >> x;
      T.insert(x);
    }
    else if(com == "extract")
      cout << T.extract() << endl;
    else if(com == "end")
      break;
  }
  return 0;
}

Measured memory_bytes: 5712
package main

import "fmt"

func main() {
	var N int
	fmt.Scanf("%d\n", &N)
	if N != 0 {
		str := tonegbin(N)
		fmt.Println(str)
	} else {
		fmt.Println(0)
	}
}

func tonegbin(n int) string {
	result := ""
	for n != 0 {
		remainder := n % -2
		n = n / -2
		if remainder < 0 {
			remainder += 2
			n++
		}
		result = fmt.Sprintf("%d", remainder) + result
	}
	return result
}


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

/* using */
using namespace std;

/* main constructor */
struct Fast
{
    Fast()
    {
        std::cin.tie(0);
        ios::sync_with_stdio(0);
        //cout << fixed << setprecision(12);
    }
} fast;

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

/* define */
#define REP(i, x, n) for (int i = x; i < (int)(n); ++i)
#define RREP(i, x, n) for (int i = x - 1; i >= (int)(n); --i)
#define rep(i, n) REP(i, 0, n)
#define reps(i, n) REP(i, 1, n + 1)
#define rrep(i, n) RREP(i, n, 0)
#define each(i, n) for (auto &i : n)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define eunique(x) \
    sort(all(x));  \
    (x).erase(unique(all(x)), (x).end())
#define int long long
#define mp make_pair

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

/* const */
const int inf = 1e9 + 7;
const int dxl[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dyl[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dxs[4] = {1, 0, -1, 0};
const int dys[4] = {0, 1, 0, -1};

/* main */
signed main(void)
{
    int n, luc1 = 0, luc2 = 0;
    cin >> n;
    int l0 = 2;
    int l1 = 1;
    if (n == 1)
    {
        cout << 1 << endl;
    }
    else
    {
        rep(i, n - 1)
        {
            if (i % 2 == 0)
            {
                l0 += l1;
            }
            else
            {
                l1 += l0;
            }
        }
        if (n % 2 == 0)
        {
            cout << l0 << endl;
        }
        else
        {
            cout << l1 << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
using namespace std;
using ll = long long;

const long double PI = acos(-1.0);
const int MOD = 1e9 + 7;


// https://scrapbox.io/pocala-kyopro/Union-Find
class UnionFind {
public:
    vector<int> Parent;

    UnionFind(int n) {
        Parent = vector<int> (n, -1);
    }

    int root(int a) {
        if (Parent[a] < 0) return a;
        return Parent[a] = root(Parent[a]);
    }

    int size(int a) {
        return -Parent[root(a)];
    }

    bool connect(int a, int b) {
        a = root(a);
        b = root(b);
        if(a == b) return false;
        if(size(a) < size(b)) swap(a, b);
        Parent[a] += Parent[b];
        Parent[b] = a;
        return true;
    }
};



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

    UnionFind uf(n);
    
    for(int i = 0; i < m; i++) {
        int a, b;
        cin >> a >> b;
        --a; --b;

        uf.connect(a, b);
    }

    int ans = -1;

    for(int i = 0; i < n; i++) {
        int us = uf.size(i);
        // cout << us << " ";
        if(ans < us) ans = us;
    }

    // cout << endl;
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3984
n, q = map(int,input().split())
s = input()
ll = len(s)
t = [0]
for i in range(ll-1):
    if s[i:i+2]=="AC":
        t.append(t[i]+1)
    else:
        t.append(t[i])
for i in range(q):
    l, r = map(int,input().split())
    print(t[r-1]-t[l-1])

Measured memory_bytes: 6200
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define rep2(i,x,n) for(int i=x; i<(n); i++)
#define all(n) begin(n),end(n)
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
const long long INF = numeric_limits<long long>::max();
const int MAX = 510000;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
    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;
    }
}
// 二項係数計算
long long 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;
}
int main()
{
    COMinit();
    long long ans=0;
    int H,W,A,B;
    cin >> H>>W>>A>>B;
    ans=COM(H+W-2,H-1);
    rep(i,B+1){
        ans=(ans-(COM(H-A-2+i,i-1)*COM(A+W-i-1,A-1))%MOD);
        if(ans<0)ans+MOD;
    }
    ans%=MOD;
    if(ans<0)ans+=MOD;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 12160
#include <bits/stdc++.h>
using namespace std;
int main() {
	long long int n; cin >> n;
	long long int a[100005];
	for(int i=0;i<n;i++){
		cin >> a[i];
	}
	int cnt = 0;
	int maxcnt = 0;
	for(int i=0;i<n;i++){
		//cnt = 0;
		int c = a[i];
		while(c%2==0){
			//cout << c << endl;
			c = c/2;
			cnt++;
		}
		maxcnt = max(maxcnt, cnt);
	}
	cout << maxcnt << endl;
	return 0;
}

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

using namespace std;

typedef long long int ll;

#define mod (int) (1e9+7)




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


 
 ll ncr(ll x, ll y){
 	ll ans=1;
 	
 	y=(y > x-y? x-y: y);
 	
 	for(ll i=0; i<y; i++){
 		ans=ans*(x-i);
 		ans=ans/(i+1);
 		ans=ans%mod;
 	}
 
 	
 	return ans;
 }

ll power(ll x, ll y){
    ll ans=1;
    while(y){
        if(y&1){
            ans=ans*x;
            ans=ans%mod;
        }
        
        x=x*x;
        x=x%mod;
        y=y>>1;
    }
    
    return ans;
    
}

// void transpose(ll arr[][0],ll b[][0],ll ind){
	
// 	for(int i=0; i<ind; i++){
// 		for(int j=0; j<ind; j++){
// 			b[j][i]=arr[i][j];
// 		}
// 	}
	
// 	for(int i=0; i<ind; i++){
// 		for(int j=0; j<ind; j++){
// 			arr[i][j]=b[i][j];
// 		}
// 	}
	
// 	return;
	
// }


 
void solve(){
	
  ll x; cin>>x;
  
  cout<<(x==0?1:0)<<"\n";


   return ;
	
}




int main(){
    ios_base::sync_with_stdio(0);
    
    cin.tie(0);
    
    int t=1;//cin>>t;
    
   
    
//    clock_t begin, end;
//    
//    double time_spent;
//    
//    begin = clock(); // Time taken till now.
    
    
    while(t--){
    
	  solve();
        
    }
    
 
    
   
//   end= clock(); // Total  Time taken till now.
//   
//   time_spent= (end- begin) / CLOCKS_PER_SEC; 
//   
//   cout<<time_spent<<"\n";
   
   
   
	
	return 0;
}



Measured memory_bytes: 3644
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repm(i, m, n) for (int i = (m); i < (int)(n); i++)
#define repr(i, n) for (int i = (n); i > 0; i--)
#define all(vec) vec.begin(), vec.end()
using namespace std;

int main(){
  int n;
  int p;
  int c;
  cin >> n >> p >> c;
  
  vector<int> pnt(n, p);
  rep(i, c){
    int x;
    cin >> x;
    pnt[x - 1]++;
  }
  
  rep(i, n){
    if (pnt[i] > c) cout << "Yes" << endl;
    else cout << "No" << endl;
  }
}

Measured memory_bytes: 1024
#
# abc042 c
#

import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """1000 8
1 3 4 5 6 7 8 9"""
        output = """2000"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """9999 1
0"""
        output = """9999"""
        self.assertIO(input, output)


def resolve():
    N, K = map(int, input().split())
    D = list(input().split())

    for i in range(N, 10*N+1):
        for d in D:
            if str(i).count(d) != 0:
                break
        else:
            print(i)
            break


if __name__ == "__main__":
    # unittest.main()
    resolve()


Measured memory_bytes: 16200
eval"_,*A="+gets.split*?,
s=*$<
q=[]
f=->i{x,y=s[i]&.bytes
x ? 2.times{A[x-65]>0&&(q<<y.chr;A[x-65]-=1;A[y-65]+=1;f[i+1];A[x-65]+=1;A[y-65]-=1;q.pop);x,y=y,x} : puts(:Yes,q)+exit}
f[0]
puts :No

Measured memory_bytes: 159596
import math
a,b=map(int,input().split())
ans=-1
for i in range(1,5000):
    #print(int(i*0.08))
    if math.floor(i*0.08)==a and math.floor(i*0.1)==b:
        #print(int(i*0.08))
        ans=i
        break
print(ans)

Measured memory_bytes: 3060
Module A
    Sub Main(ByVal args() As String)
      dim arr() as string = split(console.readline())
      dim a,b,c,chk as integer
      a=arr(0):b=arr(1):c=arr(2):chk=0
      if arr(0)=arr(1) then chk+=1
      if arr(1)=arr(2) then chk+=1
      if arr(2)=arr(0) then chk+=1
      Console.writeline(if(chk=1,"Yes","No"))
    End Sub
End Module

Measured memory_bytes: 22224
#include<stdio.h>
#include<string.h>

int main(void){
    char t[1001],w[11],end[]="END_OF_TEXT";
    int len,i,count=0;
    
    scanf("%s",&w);
    while(scanf("%s",&t)){
        if(strcmp(t,end)==0)break;
        len=strlen(t);
        for(i=0;i<len;i++){
            if(t[i]<91 &&t[i]>64)t[i]+=32;
        }
        if(strcmp(t,w)==0)count++;
    }
    
    printf("%d\n",count);
    
    return 0;
}

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

using namespace std;
typedef long long ll;

#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)

/* ------------- ANSWER ------------- */
/* ---------------------------------- */

int main() {
    ll n;
    cin >> n;
    
    vector<ll> a(n);
    rep(i, n) cin >> a[i];
    
    multiset<ll> s;

    for (ll i = 0; i < n; ++i) {
        ll now = a[i];
        auto itr = s.lower_bound(now);
        if (itr != s.begin()) s.erase(--itr);
        s.insert(now);
    }
    cout << s.size() << endl;
    return 0;
}


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

using namespace std;

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

long long kai[200001] = {0};

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

long long comb(long long x, long long y){
	y = min(x - y, y);
	long long resmul = 1, resdiv = 1;
	for(int i = 0; i < y; i++){
		resmul = resmul * (x - i) % MOD;
		resdiv = resdiv * (y - i) % MOD;
	}
	return resmul * modpow(resdiv, MOD - 2) % MOD;
}

int main(){
	long long n, m, ans = 1;
	cin >> n >> m;
	long long t = m;
	for(int i = 2; i <= t; i++){
		if(t % i == 0){
			long long cnt = 0;
			while(t % i == 0){
				t /= i;
				cnt++;
			}
			ans = (ans * comb(n + cnt - 1, cnt)) % MOD;
		}
	}
	cout << ans << endl;
	return 0;
}

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

const int N = 2e3 + 5;
int a[N];

int main(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin>>n;
  double sum=0;
  double arr[n];
  arr[0]=1;
  arr[1]=1;
  if(n>2)
  {
  for(int i=2;i<n;i++){
    arr[i]=2*arr[i-1];
  }
  }
  int brr[n];
  for(int i=0;i<n;i++){
    cin>>brr[i];
  }
  sort(brr,brr+n);
  for(int i=0;i<n;i++){
    sum+=brr[i]*(arr[i]/arr[n-1]);
  }
  cout<<sum/2;
}


Measured memory_bytes: 256
#include <stdio.h>
const int N = 15;
int main ()
{
	int a[N] = {0};
	for(int i = 0; i < 10; i++)
	{
		scanf("%d", &a[i]);
	}
	for(int i = 0; i < 10; i++)
	{
		for(int j = i; j < 10; j++)
		{
			if(a[i] < a[j])
			{
				int box = a[i];
				a[i] = a[j];
				a[j] = box;	
			}	
		} 
	}
	for(int i = 0; i < 3; i++)
	{
		printf("%d\n", a[i]);
	}
	return 0;
	
}


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

using namespace std;

#define ll long long int

int main() {
	
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	
	ll n,m; cin >> n >> m;
	
	ll arr[n];
	
	for(int i = 0; i < n; i++) 
		cin >> arr[i];
	
	ll ans = 0;
	
	for(int i = 1; i < n; i++) {
		ll sum = arr[i] + arr[i-1];
		
		if(sum > m) {
			arr[i] = max((ll)0,arr[i]-(sum-m));
			ans += sum - m;
		}
	}
	
	cout << ans << '\n';
	
	return 0;
}

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

int main() {
  ll n,ans=1000000000;
  cin >> n;
  vector<ll>w(n);
  rep(i,n) cin >> w.at(i);
  rep(t,n-1){
  	ll s1=0,s2=0;
  	rep(i,n){
  		if(i<=t) s1+=w.at(i); else s2+=w.at(i);
  	}
  	ans=min(ans,abs(s1-s2));
  }
  cout << ans << endl;
}


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

#ifdef DEBUG
    #define IFD if(true)
#else
    #define IFD if(false)
#endif

int main()
{
    int a, b;
    int cnt[5];
    memset(cnt, 0, sizeof(cnt));

    for(int i = 1; i <= 3; i++) {
        cin >> a >> b;
        cnt[a]++;
        cnt[b]++;
    }

    int n = 2;
    for(int i = 1; i <= 4; i++) {
        IFD cout << cnt[i] << endl;
        if(cnt[i] != 2) {
            n--;
        }
    }

    if(n >= 0) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }

    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fod(i,a,b) for(int i=a;i>=b;i--)
using namespace std;
typedef long long ll;
const int N=1e5+10,inf=(1<<30);
ll f[N],p[N];int n,e,t;
int main()
{
	scanf("%d%d%d",&n,&e,&t);
	fo(i,1,n) scanf("%lld",&p[i]);
	memset(f,63,sizeof(f));f[0]=0;
	ll mn=inf;
	for(int i=1,j=0;i<=n;i++) {
		for(;t<=(p[i]-p[j+1])<<1;j++)
			mn=min(mn,f[j]-2*p[j+1]);
			if(j<i) f[i]=min(f[i],f[j]+t);
			f[i]=min(f[i],mn+2*p[i]);
	}
	printf("%lld\n",f[n]+e);
	return 0;
}

Measured memory_bytes: 1920
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vs = vector<string>;
using pll = pair<ll, ll>;
using vp = vector<pll>;
template<class T> using V = vector<T>;
template<class T> using VV = vector<vector<T> >;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define repb(i, n) for(ll i = (n)-1; i >= 0; i--)
#define repr(i, a, b) for(ll i = (a); i < (b); i++)
#define reprb(i, a, b) for(ll i = (a)-1; i >= (b); i--)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((ll)(x).size())
const ll MOD = 1000000007;
const ll INF = 100000000000000000LL;
inline ll GCD(ll a, ll b){ return b?GCD(b, a % b):a; }
inline ll LCM(ll a, ll b){ return a/GCD(a, b)*b; }
inline ll powint(unsigned long long x, ll y){ ll r=1; while(y){ if(y&1) r*=x; x*=x; y>>=1; } return r; }
inline ll powmod(ll x, ll y, ll m = MOD){ ll r=1; while(y){ if(y&1) r*=x; x*=x; r%=m; x%=m; y>>=1; } return r; }
template<class T>bool chmax(T &a, const T &b){ if(a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b){ if(b<a) { a=b; return 1; } return 0; }
#ifdef OJ_LOCAL
#include "dump.hpp"
#else
#define dump(...) ((void)0)
#endif

void pr(bool f){
    cout << (f ? "YES" : "NO") << endl;
    exit(0);
}

int main(){
    cin.tie(0); ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    string s;
    cin >> s;
    ll n = SZ(s);
    ll a = 0, b = 0, c = 0;
    rep(i, n){
        if(s[i] == 'a') a++;
        if(s[i] == 'b') b++;
        if(s[i] == 'c') c++;
    }
    pr(max({a, b, c})-min({a, b, c}) <= 1);
    return 0;
}

Measured memory_bytes: 512
n, m = map(int,input().split())
h = list(map(int,input().split()))
h.insert(0, -1)
g = set(range(1, n+1))
for _ in range(m):
    a, b = map(int, input().split())
    if h[a] <= h[b]:
        g.discard(a)

    if h[b] <= h[a]:
        g.discard(b)

print(len(g))

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

int main() {
    string S;
    cin >> S;
    int y = 700;
    if(S[0] == 'o') y += 100;
    if(S[1] == 'o') y += 100;
    if(S[2] == 'o') y += 100;
    cout << y << endl;
}


Measured memory_bytes: 256
a = []
a = gets.split.map(&:to_i)
b=0
c=0
b=a[1]/a[2]
if a[0]<0
  c = 0
else
c=a[0]/a[2]
end
if a[0]%a[2]==0
puts b-c+1
else
  puts b-c
end

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

int main(){
    int N;
    cin >> N;
    vector<int> A(N);
    for(int i=0;i<N;i++) cin >> A[i];
    vector<int> ans;
    for(int i=N-1;i>=0;i-=2){
        ans.push_back(A[i]);
    }
    for(int i=N%2;i<N;i+=2){
        ans.push_back(A[i]);
	}
    for(int i=0;i<ans.size();i++){
        cout << ans[i] << ' ';
    }
    cout << endl;
}

Measured memory_bytes: 3956
#include <iostream>
#include <vector>
#include <deque>
#include <map>
#include <algorithm>
#include <numeric>
#include <string>
#include <cmath>

#define ull unsigned long long
#define ll long long
#define ul unsigned long

using namespace std;

int main()
{
	ul W = 0;
	ul H = 0;
	cin >> W >> H;

	vector< ul > p(W);
	vector< ul > q(H);

	for(ul i = 0; i < W; ++i)
	{
		ul value = 0;
		cin >> value;
		p[i] = value;
	}
	for(ul i = 0; i < H; ++i)
	{
		ul value = 0;
		cin >> value;
		q[i] = value;
	}

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

	vector< ul > p_sum(W + 1);
	partial_sum(p.begin(), p.end(), p_sum.begin() + 1);
	p_sum[0] = 0;

	ul result = 0;
	for(ul i = 0; i < H; ++i)
	{
		auto border = upper_bound(p.begin(), p.end(), q[i]);
		auto test = border - p.begin();
		result += p_sum[border - p.begin()];
		result += (p.end() - border) * q[i];
		result += q[i];
	}

	result += p_sum[W];

	cout << result << endl;
	
	return 0;
}

Measured memory_bytes: 2560
N, Q, *TUV = [int(_) for _ in open(0).read().split()]
T, U, V = TUV[::3], TUV[1::3], TUV[2::3]


class UnionFind():
    def __init__(self, n):
        self.n = n
        self.root = [-1] * (n + 1)
        self.rank = [0] * (n + 1)

    def find(self, x):
        if self.root[x] < 0:
            return x
        else:
            self.root[x] = self.find(self.root[x])
            return self.root[x]

    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return 0
        elif self.rank[x] > self.rank[y]:
            self.root[x] += self.root[y]
            self.root[y] = x
        else:
            self.root[y] += self.root[x]
            self.root[x] = y
            if self.rank[x] == self.rank[y]:
                self.rank[y] += 1

    def is_same(self, x, y):
        return self.find(x) == self.find(y)

    def size(self, x):
        return -self.root[self.find(x)]


uf = UnionFind(N)
for t, u, v in zip(T, U, V):
    if t:
        print(1 if uf.is_same(u, v) else 0)
    else:
        uf.unite(u, v)


Measured memory_bytes: 57904
#include <iostream>
using namespace std;
int main(void){
    int n,k;
    string s;
    cin >> n >> s >> k;
    
    for(int i=0;i<n;i++){
        if(s[i] != s[k-1]){
            s[i] = '*';
        }
    }
    
    std::cout << s << std::endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
 
int main(){
   int H,W,c=0;
     cin >> H >> W;
   int d[H][W];
   int up[H][W];
   int down[H][W];
   int left[H][W];
   int right[H][W];
 
   char s;
    
   for(int i=0;i<H;i++){
      for( int j=0;j<W;j++){
         cin >>s;
         if(s=='#')d[i][j]=0;
         else d[i][j]=1;
      }
   }

for( int i=0;i<H;i++){
      for( int j=0;j<W;j++){
        if(j==0&&d[i][j]==1)right[i][j]=1;
        else if(j==0&&d[i][j]==0) right[i][j]=0;
        else if(d[i][j]==0)right[i][j]=0;
        else right[i][j]=right[i][j-1]+1;
      }
   }

   for( int i=0;i<H;i++){
      for( int j=W-1;j>=0;j--){
        if(j==(W-1)&&d[i][j]==1)left[i][j]=1;
        else if(j==(W-1)&&d[i][j]==0) left[i][j]=0;
        else if(d[i][j]==0)left[i][j]=0;
        else left[i][j]=left[i][j+1]+1;
      }
   }

   for(int i=0;i<W;i++){
      for(int j=0;j<H;j++){
        if(j==0&&d[j][i]==1)down[j][i]=1;
        else if(j==0&&d[j][i]==0) down[j][i]=0;
        else if(d[j][i]==0)down[j][i]=0;
        else down[j][i]=down[j-1][i]+1;
      }
   }

   for(int i=0;i<W;i++){
      for(int j=H-1;j>=0;j--){
        if(j==(H-1)&&d[j][i]==1)up[j][i]=1;
        else if(j==(H-1)&&d[j][i]==0) up[j][i]=0;
        else if(d[j][i]==0)up[j][i]=0;
        else up[j][i]=up[j+1][i]+1;
      }
   }

   for(int i=0;i<H;i++){
      for(int j=0;j<W;j++){
         c=max(c,up[i][j]+down[i][j]+left[i][j]+right[i][j]-3);
         
   }
   }
   cout <<c;
 }



Measured memory_bytes: 78336
def count_mine(m, i, j):
    count = 0
    for k in range(i - 1, i + 2):
        for l in range(j - 1, j + 2):
            if m[k][l] == "#":
                count += 1
    return count

H, W = map(int, input().split())
l = [list(map(str, input().split())) for i in range(H)]
m = []
m.append("*" * (W + 2))
for i in range(len(l)):
    add_colum = "*" + ''.join(l[i]) + "*"
    m.append(add_colum)
m.append("*" * (W + 2))
answer = []
for i in range(1, H + 1):
    answer_column = ""
    for j in range(1, W + 1):
        if m[i][j] == ".":
            answer_column += str(count_mine(m, i, j))
        else:
            answer_column += "#"
    answer.append(answer_column)
for i in range(H):
    print(answer[i])

Measured memory_bytes: 3064
#include <bits/stdc++.h>
 
#define ll long long
#define pb push_back
//#define f first
//#define s second
//#define mp make_pair
#define gg return 0;
#define pii pair < int, int>
 
using namespace std;
 
const int maxn = 132675;
const int INF = (int)1e9 + 7;
 
ll a,b[maxn],c,d,cnt,e[(int)2e3 + 1][(int)2e3 + 1],cost[maxn],tout[maxn],mn = INF,mx = -INF,l,r;
 
ll x[maxn],y[maxn],x2[maxn],y2[maxn];
 
ll kol;

bool u[maxn], m, f;

set <int> s; 

 /*
void forn( int s, int f, int inter){
	for(int i = s; i <= f; i += inter){
		b[i] = i;
	}
}
*/ 
ll ans;

vector <int> primev; 

/*
void dfs(int v){
	lvlc++;
	lvl[v] = lvlc;
	d[lvl[v]].pb(v);
	u[v] = 1;
	for(int i = 0; i < g[v].size(); ++i){
		int to = g[v][i];
		if(!u[to]){
			dfs(to);
		}
	}
	lvlc--;
}*/

bool prime[45001];

char ch;


void find_divs( int n) {
   	int dlim, m = 1;
  	s.insert(1);
  	int op = n;
   	dlim = sqrt( n );
   	for(int d = 2; d <= dlim; ++d){
      if (n % d == 0){
         s.insert(m * d);
         if( m*d != n/d )
            s.insert(n/d);
         n /= d;
         m *= d;
         dlim = sqrt( n );
      }
   }
}

int main()
{	
    cin >> a;
    cout << a / 11 * 2 + (a % 11 + 5) / 6;
    gg
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
using ll = long long;
using vec = vector<ll>;
using vect = vector<double>;
using Graph = vector<vector<ll>>;
#define loop(i, n) for (ll i = 0; i < n; i++)
#define Loop(i, m, n) for (ll i = m; i < n; i++)
#define pool(i, n) for (ll i = n; i >= 0; i--)
#define Pool(i, m, n) for (ll i = n; i >= m; i--)
#define mod 1000000007ll
#define flagcount __builtin_popcount
#define flag(x) (1 << x)
#define flagadd(bit, x) bit |= flag(x)
#define flagpop(bit, x) bit &= ~flag(x)
#define flagon(bit, i) bit &flag(i)
#define flagoff(bit, i) !(bit & (1 << i))
#define all(v) v.begin(), v.end()
#define low2way(v, x) lower_bound(all(v), x)
#define high2way(v, x) upper_bound(all(v), x)
#define idx_lower(v, x) (distance(v.begin(), low2way(v, x)))  //配列vでx未満の要素数を返す
#define idx_upper(v, x) (distance(v.begin(), high2way(v, x))) //配列vでx以下の要素数を返す
#define idx_lower2(v, x) (v.size() - idx_lower(v, x))         //配列vでx以上の要素数を返す
#define idx_upper2(v, x) (v.size() - idx_upper(v, x))         //配列vでxより大きい要素の数を返す
#define putout(a) cout << a << endl
#define Gput(a, b) G[a].push_back(b)
#define Sum(v) accumulate(all(v), 0ll)
#define gcd(x, y) __gcd(x, y)
ll ctoi(char c)
{
    if (c >= '0' && c <= '9')
    {
        return c - '0';
    }
    return 0;
}
template <typename T>
T lcm(T x, T y)
{
    T z = gcd(x, y);
    return x * y / z;
}
template <typename T>
bool primejudge(T n)
{
    if (n < 2)
        return false;
    else if (n == 2)
        return true;
    else if (n % 2 == 0)
        return false;
    double sqrtn = sqrt(n);
    for (T i = 3; i < sqrtn + 1; i++)
    {
        if (n % i == 0)
        {
            return false;
        }
        i++;
    }
    return true;
}
//場合によって使い分ける
//const ll dx[4]={1,0,-1,0};
//const ll dy[4]={0,1,0,-1};
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
//2次元配列の宣言
//vector<vector<ll>> field(h, vector<ll>(w));
ll prime_factor(ll n)
{
    ll ret;
    for (ll i = 2; i * i <= n; i++)
    {
        ll c;
        while (n % i == 0)
        {
            c++;
            n /= i;
        }
        ret *= (c + 1);
    }
    if (n != 1)
        ret *= 2;
    return ret;
}
int main()
{
    cout << fixed << setprecision(30);
    ll N;
    cin >> N;
    ll ans = 0;
    loop(i, N)
    {
        ll now = i + 1;
        ll a = N / now;
        ans += now * (a * (a + 1) / 2);
    }
    putout(ans);
    return 0;
}


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

using namespace std;

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

int main(){
   
   char ans;
   int flag = 0;
   string s;
   cin >> s;
   sort(s.begin(),s.end());
   
   for(char c = 'a'; c <= 'z'; ++c){
      if(s.find(c) == string::npos){
         ans = c;
         flag = 1;
         break;
      }
   }

   if(flag == 0) cout << "None" << endl;
   if(flag == 1) cout << ans << endl;

   return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
#define rrep(i,n) for(int i = 1; i <= (n); i++)
#define drep(i,n) for(int i = (n)-1; i >= 0; i--)
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
const long long mod = 1e9 + 7;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int n;
    cin >> n;
    vector<int> a(n), b(n), c(n - 1);
    rep(i, n){
        cin >> a[i];
        a[i]--;
    }
    rep(i, n) cin >> b[i];
    rep(i, n - 1) cin >> c[i];
    int ans = 0;
    rep(i, n){
        ans += b[a[i]];
        if (i > 0 && a[i] == a[i - 1] + 1) ans += c[a[i - 1]];
    }
    cout << ans << endl;

    return 0;
}

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

int main() {
  int r, g, b;
  cin >> r >> g >> b;
  
  string res ;
  
 
  
  if((100*r+10*g+b) % 4 == 0){
    res = "YES";
  }
  
  else{
    res = "NO";
  }
  
  cout << res << endl;

}

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

int main(){
  string a,b;
  cin>>a>>b;
  if(a.size()==b.size()){
    if(a==b){
      cout<<"EQUAL"<<endl;
    }else{
      for(int i=0;i<a.size();i++){
	if(a[i]<b[i]){
	  cout<<"LESS"<<endl;
	  break;
	}else if(a[i]>b[i]){
	  cout<<"GREATER"<<endl;
	  break;
	}
      }
    }
  }else if(a.size()<b.size()){
    cout<<"LESS"<<endl;
  }else{
    cout<<"GREATER"<<endl;
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;

#define MP make_pair
#define PB push_back
#define ALL(s) (s).begin(),(s).end()
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl


long long K, A, B;


long long solve() {
	if (A >= K) return 1;
	if (A - B <= 0) return -1;

	long long rem = K - A;
	long long con = (rem + A-B - 1) / (A - B);
	return con * 2 + 1;
}

int main() {
	while (cin >> K >> A >> B) {
		cout << solve() << endl;
	}
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <string>
#include <vector>
#include <math.h>
#include <queue>
#include <deque>
#include <stack>
#include <map>
const int MOD = 1e9+7;
#define PI 3.14159265359
typedef long long ll;
using namespace std;

bool p[101];


int main(){
	int x, n;
	cin >> x >> n;
	for (int i = 0; i < n; i++){
		int y;
		cin >> y;
		p[y] = true;
	}

	for (int i = 0; i < 100; i++){
		if (x-i <= 0 || p[x-i] == false){
			cout << x-i << endl;
			return 0;
		}
		if (x+i > 100 || p[x+i] == false){
			cout << x+i << endl;
			return 0;
		}
	}
	return 0;
}


Measured memory_bytes: 3592
#include <bits/stdc++.h>
#define INF 2147483647
#define INF_LL 9223372036854775807
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;

vector<int> prime_n;
bool prime[1001];

vector < pair < ll, ll > > p_f(ll x) { // 素因数分解　エストラテネスのふるいで求めた素数表が必要
	vector < pair<ll, ll> > ans;
	while (x > 1) {
		bool flag = false;
		for (int i = 0; i < prime_n.size(); i++) {
			if (x % prime_n[i] == 0) {
				x /= prime_n[i];
				if (ans.empty() || ans[ans.size() - 1].first != prime_n[i])ans.push_back(pair<ll, ll>(prime_n[i], 1));
				else ans[ans.size() - 1].second++;
				flag = true;
				break;
			}
		}
		if (flag == false) {
			ans.push_back(pair<ll, ll>(x, 1));
			break;
		}
	}
	return ans;
}


vector < pair < ll, ll > > p(vector < pair < ll, ll > > a, vector < pair < ll, ll > > b) {
	vector < pair < ll, ll > > tmp;
	int i = 0, j = 0;
	while (1) {
		if (i != a.size() && j != b.size()) {
			if (a[i].first == b[j].first) {
				tmp.push_back(pair<ll, ll>(a[i].first, a[i].second + b[j].second));
				i++; j++;
			}
			else if (a[i].first < b[j].first) {
				tmp.push_back(pair<ll, ll>(a[i].first, a[i].second));
				i++;
			}
			else if (a[i].first > b[j].first) {
				tmp.push_back(pair<ll, ll>(b[j].first, b[j].second));
				j++;
			}
		}
		else {
			if (i != a.size()) {
				for (int k = i; k < a.size(); k++) {
					tmp.push_back(a[k]);
				}
				i = a.size();
			}
			else if(j != b.size()){
				for (int k = j; k < b.size(); k++) {
					tmp.push_back(b[k]);
				}
				j = b.size();
			}
			else {
				return tmp;
			}
		}
	}
}
int main() {
	fill(prime, prime + 1001, true); //素数
	prime[0] = prime[1] = false;
	for (int i = 2; i < 1001; i++) {
		if (prime[i] == true) {
			prime_n.push_back(i);
			for (int j = 2; i * j < 1001; j++) {
				prime[i * j] = false;
			}
		}
	}

	vector< vector < pair < ll, ll > > > u_100;
	for (int i = 0; i < 101; i++) {
		u_100.push_back(p_f(i));
	}

	int n;
	cin >> n;
	vector < pair < ll, ll > > n_p;
	for (int i = 1; i <= n; i++) {
		n_p = p(n_p, u_100[i]);
	}

	//75
	// 1 * 75 74
	// 3 * 25 2 , 24
	// 5 * 15 4, 14
	// 3 * 5 * 5 2,4,4

	int ans = 0;
	if (n_p.size() >= 3) {
		for (int i = 0; i < n_p.size() - 2; i++)for (int j = i+1; j < n_p.size()-1; j++)for (int k = j+1; k < n_p.size(); k++) {
			if (i == j || j == k || k == i)continue;
			//cout << i << " " << j << " " << k << endl;
			if (n_p[i].second >= 2 && n_p[j].second >= 4 && n_p[k].second >= 4)ans++;
			if (n_p[j].second >= 2 && n_p[i].second >= 4 && n_p[k].second >= 4)ans++;
			if (n_p[k].second >= 2 && n_p[j].second >= 4 && n_p[i].second >= 4)ans++;
		}
	}
	if (n_p.size() >= 2) {
		for (int i = 0; i < n_p.size() - 1; i++)for (int j = i + 1; j < n_p.size(); j++) {
			if (i == j)continue;
			//cout << i << " " << j << endl;
			if (n_p[i].second >= 4 && n_p[j].second >= 14)ans++;
			if (n_p[j].second >= 4 && n_p[i].second >= 14)ans++;
			if (n_p[i].second >= 2 && n_p[j].second >= 24)ans++;
			if (n_p[j].second >= 2 && n_p[i].second >= 24)ans++;

		}
	}
	if (n_p.size() >= 1) {
		for (int i = 0; i < n_p.size(); i++) {
			if (n_p[i].second >= 74)ans++;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
// Problem : C - X: Yet Another Die Game
// Contest : AtCoder - AtCoder Beginner Contest 053
// URL : https://atcoder.jp/contests/abc053/tasks/arc068_a
// Memory Limit : 256 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>

#define spc ' '
#define endl '\n'

using namespace std;


int main(){
	ios_base :: sync_with_stdio(0); cin.tie(0); cout.tie(0);
	long long x, ans = 0;
	cin >> x;
	ans = 2*(x/11);
	x%=11;
	if(x<=6 && x!=0)ans++;
	else if(x<11 && x!=0)ans+=2;
	cout << ans;
	return 0;
}

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

int main() {
  int N;
  cin >> N;
  int M;
  M = N;
  int f = 0;

  while (M > 0) {
    f += M % 10;
    M /= 10;
  }
  int H;
  H = N % f;
  
  if (H == 0) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
char S[10101];
st,sz;
N,n;
main(){
  n=read(0,S,10101);
  if(S[1]==10)st=2,N=S[0]-'0';
  else st=3,N=(S[0]-'0')*10+S[1]-'0';
  sz=st;
  for(;sz<n-1;)
  {
    S[sz]+=N;
    if(S[sz]>90)S[sz]-=26;
    sz++;
  }
  write(1,S+st,sz-st);
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i=0; i<(int)(n); i++)
#define all(x) x.begin(), x.end()
#define mod 1000000007
typedef long long ll;

int main(){
  int x, y, a, b, c;
  cin >> x >> y >> a >> b >> c;
  vector<pair<int, char>> vec;
  rep(i, a){
    int num;
    cin >> num;
    vec.push_back(make_pair(num, 'r'));
  }
  rep(i, b){
    int num;
    cin >> num;
    vec.push_back(make_pair(num, 'g'));
  }
  rep(i, c){
    int num;
    cin >> num;
    vec.push_back(make_pair(num, 'n'));
  }
  sort(all(vec), greater<pair<int, char>>());
  queue<pair<int, char>> que;
  rep(i, vec.size()){
    que.push(vec[i]);
  }
  int r = 0, g = 0, cnt = 0;
  ll sum = 0;
  while(cnt < x+y){
    pair<int, char> apple = que.front();
    que.pop();
    if(apple.second == 'r'){
      if(r<x){
        r++;
        cnt++;
        sum += apple.first;
      }
    }else if(apple.second == 'g'){
      if(g<y){
        g++;
        cnt++;
        sum += apple.first;
      }
    }else{
      cnt++;
      sum += apple.first;
    }
  }
  cout << sum << endl;
  return 0;
}
    

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

#define ll long long
#define ull unsigned long long
#define pb push_back
#define pf push_front
#define pof pop_front
#define pob pop_back
#define mp make_pair
#define pll pair<ll,ll>
#define pii pair<int,int>
#define all(s) s.begin(),s.end()
#define vll vector<ll>
#define vi vector<int>
#define vpii vector<pii>
#define vpll vector<pll>
#define vd vector<double>
#define vull vector<ull>
#define vc vector<char>
#define vs vector<string>
#define fi first
#define se second
#define sz(x) x.size()
#define cinarr(n,a) for(int i = 0; i < n; i++) cin >> a[i];
#define coutarr(n,a) for(int i = 0; i < n; i++) cout << a[i] << (i+1==n?'\n':' ');
#define fori(i,a,b,x) for(int i = a; i <= b; i+=x)
#define ford(i,a,b,x) for(int i = a; i >= b; i-=x)
#define tc int tt; cin >> tt; for(int cs = 1; cs <= tt; cs++)
#define IOS ios_base::sync_with_stdio(0); cin.tie(NULL);
#define ld long double
#define reset(x,y) memset(x,y,sizeof x);
#define sqr(x) 1LL*(x)*(x)
#define cube(x) 1LL*(x)*(x)*(x)
#define ub(v, a) upper_bound(all(v), a)
#define lb(v, a) lower_bound(all(v), a)
#define EPS 1e-10
#define INF 200000
#define mod 1000000007
#define minof(a) min_element(all(a))
#define maxof(a) max_element(all(a))
#define debug(val) cout << "The value of " << #val << " is = " << val << endl;
#define testing cout << "--------------------------\n";

int main() {
	IOS
	int n;
	cin>>n;
	string s;
	cin>>s;
	int cr=0;
	for(int i = 0; i < sz(s); i++) {
		if(s[i]=='R') cr++;
	}
	int res=0;
	for(int i = 0; i < cr; i++) {
		if(s[i]!='R') res++;
	}
	cout<<res<<endl;
}


Measured memory_bytes: 3756
#include <algorithm>
#include <cmath>
#include <climits>
#include <cstdlib>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define DEBUG 1
constexpr int kMod = 1000000007;
typedef long long LL;

int main() {
  LL X; std::cin >> X;
  LL total = 0;
  LL i = 1;
  for (; total + i < X; ++i) {
    total += i;
  }
  std::cout << i << std::endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
string s;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin>>s;
	if (s[0]=='S') cout<<"Cloudy";
	else if (s[0]=='C') cout<<"Rainy";
	else cout<<"Sunny";
	return 0;
}

Measured memory_bytes: 256
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <string>
#include <vector>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#define ll long long
#define PII pair<int, int>
#define debug std::cout << "---debug---" << std::endl;
using namespace std;
const int maxn = 1e5 + 7;
const int mod = 1e9 + 7;

string s, t;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    //freopen("E:\\myprogram\\data.in", "r", stdin);
    //freopen("E:\\myprogram\\data.out", "w", stdout);
    cin >> s >> t;
    s += t[t.size() - 1];
    if(s == t) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 3648
n = int( input() )
l = list( map( int, input().split() ) )

cnt = 0
for i in range( n ):
    li = l[ i ]
    for j in range( i + 1, n ):
        lj = l[ j ]
        for k in range( j + 1, n ):
            lk = l[ k ]
            if ( li - lj ) * ( lj - lk ) * ( lk - li ) == 0:
                continue
            if li + lj > lk and lj + lk > li and lk + li > lj:
                cnt += 1

print( cnt )

Measured memory_bytes: 9196
#include <iostream>
#include <fstream>
#include <vector>
#include <cstring>
#include <string>
#include <cmath>
#include <algorithm> // sort
#include <iomanip>
#include <queue>
#include <map>
#include <bits/stdc++.h>

using namespace std;

#define DEBUG 0
#define REP(i, n) for (long long i = 0; i < (n); i++) 
typedef long long ll;
static const ll INF = 1000000000000000000LL;
typedef pair<int,int> pint;

const int MAX = 1000000007;
const int MOD = 1000000007;

int main(){

#if DEBUG
    std::ifstream in("input.txt");
    std::cin.rdbuf(in.rdbuf());
#endif
    int n;
    cin >> n;
    int iMax = 0;

    vector <ll> a(n);

    REP(i,n)
    {
        cin >> a[i];
    }
    sort(a.begin(), a.end());

    iMax = a[n-1];
    ll t;
    REP(i,n)
    {
        if(a[i] >= a[n-1]/2)
        {
            t = i;
            break;
        }
    }

    //tかt-1

    //a[n-1]/2との差が小さい方

    ll ans;
    if(t == n - 1)
    {
        ans = t-1;
    }
    else if(t == 0 || abs(a[n-1]/2 - a[t]) <= abs(a[n-1]/2 - a[t-1]))
    {
        ans = t;
    }
    else
    {
        ans = t-1;
    }
    


    cout << a[n-1] << " " << a[ans] <<  endl;
    return 0;
}

Measured memory_bytes: 1024
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var input_array =input.trim().split("\n");
var numbers = input_array[1].split(' ').map((n) => Number(n));

var exchange_count = 0;

for (var i = 0; i < numbers.length; i++) {
  for (var j = numbers.length - 1; j > i; j--) {
    if (numbers[j] < numbers[j-1]) {
        var tmp = numbers[j];
        numbers[j] = numbers[j-1];
        numbers[j-1] = tmp;
        exchange_count++;
    }
  }
}

console.log(numbers.join(' '));
console.log(exchange_count);


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

int main() {
  
  int N;
  cin >> N;
  int M=N;
  int p=0;
  int q=1;
  
  for (int i=0; i<N/*ある数の位の数はその数より小さい*/; i++) { 
    q *= 10;
    p += M % q / (q/10);
    M -= M % q;
    if (M==0) break;
  }
  
  if (N % p == 0) cout << "Yes" << endl;
  else cout << "No" << endl;
}

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

using namespace std;

//typedef pair<int,int> P


int main(){
	int N;
	scanf("%d", &N);

	long long A[N];
	int num[N];
	for(int i=0;i<N;i++){
		scanf("%lld", &A[i]);
		num[i] = 0;
	}
	for(int i=0;i<N;i++){
		while(A[i]%2==0){
			A[i]/=2;
			num[i]++;
		}
	}

	sort(num,num+N);
	printf("%d\n", num[0]);

	return 0;
}


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

bool isPrime(int number){

    if(number < 2) return false;
    if(number == 2) return true;
    if(number % 2 == 0) return false;
    for(int i=3; (i*i)<=number; i+=2){
        if(number % i == 0 ) return false;
    }
    return true;
}

int main() 
{
    int x;
    cin >> x;
    for (int i=x; ; i++)
        if (isPrime(i))
            return cout << i, 0;
}

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

int main(){
    long int N,K;
    cin >> N >> K;

    long int total = 0;

    for(long int i=K;i<=N+1;i++) {
        total += (((N+N-i+1)*i/2) - ((i-1)*i/2) + 1);
    }

    cout << total%1000000007 << endl;
}

Measured memory_bytes: 3648
#include"bits/stdc++.h"
using namespace std;

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define eb emplace_back

using ll = long long;
using vll = vector<ll>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using pii = pair<int, int>;

void Main(){
	int n;
	cin >> n;
  ll ans = 0;
	rep3(i,1,n) {
      if(i%3 && i%5) ans += i;
    }
      
      cout << ans << endl;
	return;
}

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

Measured memory_bytes: 3648
#include <stdio.h>
int main(void){
 int a,b;
 char op;
 while(1){
 scanf("%d %c %d",&a,&op,&b);
 if( op =='?')
 break;
 else if( op == '+')
  printf("%d\n",a+b);
 else if( op == '-')
  printf("%d\n",a-b);
 else if( op == '*')
  printf("%d\n",a*b);
 else if( op == '/')
  printf("%d\n",a/b);
 }
 return 0;
} 


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

#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
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; }
typedef long long ll;

const long long INF = 1LL << 60;

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

    map<int, int> a;
    a[s] = 1;

    int n = 2;
    while (1) {
        if (s % 2 == 1) {
            s = s * 3 + 1;
        }
        else {
            s /= 2;
        }
        auto itr = a.find(s);
        if (itr != a.end()) {
            break;
        }
        a[s] = 1;
        n++;
    }

    cout << n << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define full(c) c.begin(), c.end()
typedef signed long long int ll;
typedef unsigned long long int ull;
using namespace std;

int main(){
  while(1){
    ll a,b;
    ll n[4];
    cin>>a>>b;
    if(a==0 && b==0) break;
    ll least=1e12;
    for(n[0]=1; n[0]*n[0]<=a; n[0]++){
      if(a%n[0]==0){
	n[1]=a/n[0];
	for(n[2]=1; n[2]*n[2]<=b; n[2]++){
	  if(b%n[2]==0){
	    n[3]=b/n[2];
	    ll tmp[4];
	    for(int i=0; i<4; i++){
	      tmp[i]=n[i];
	    }
	    sort(tmp, tmp+4);
	    least=min(least,(tmp[3]-tmp[2])*(tmp[3]-tmp[2])+(tmp[2]-tmp[1])*(tmp[2]-tmp[1])+(tmp[1]-tmp[0])*(tmp[1]-tmp[0]));
	  }
	}
      }
    }
    cout<<least<<endl;
  }
  return 0;
}



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

signed main(){
  int X;
  cin>>X;
  int ans=1;
  if(X==1){
    cout<<ans<<endl;
    return 0;
  }
  for(int i=2;i*i<=X;i++){
    for(int j=i*i;j<=X;j*=i){
     ans=max(ans,j);
    }
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 256