akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>

using namespace std;

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

class Graph{
public:
  int n;
  vector<vector<int> > e;
  vector<int> w,vdeg,cost;

  Graph(int v){
    n = v;
    w = vector<int>(n,0);
    vdeg = vector<int>(n,0);
    cost = vector<int>(n,0);
    e = vector<vector<int> >(n,vector<int>(0));
  }

  void addEdge(int a, int b){
    e[a].push_back(b);
    e[b].push_back(a);
    vdeg[a]++;
    vdeg[b]++;
  }

  int degree(int u){
    return (int)e[u].size();
  }

  bool isConnected(int u, int v){
    auto itr = find(e[u].begin(),e[u].end(),v);
    if(itr == e[u].end()) return false;
    return true;
  }

};

class Tree{
public:
  int n,mc=0;
  vector<int> par,w,cost;
  vector<vector<int> > child;

  Tree(int v){
    n = v;
    par = vector<int>(n,-1);
    w = vector<int>(n,0);
    cost = vector<int>(n,0);
    child = vector<vector<int> >(n,vector<int>(0));
  }

  void setCost(int v, int c){
    cost[v] = c;
    mc = max(mc,c);
  }

  void addCost(int v, int c){
    cost[v] += c;
    mc = max(mc,cost[v]);
  }

  void addEdge(int pr,int chi){
    child[pr].push_back(chi);
    par[chi] = pr;
  }

  int childsize(int u){
    return (int)child[u].size();
  }
};

int main(){

  int n,m;
  cin >> n >> m;
  Graph g(n);
  vector<int> tour(n,1);
  rep(i,n){
    int w;
    cin >> w;
    g.w[i] = w;;
  }
  rep(i,m){
    int u,v;
    cin >> u >> v;
    u--;v--;
    g.addEdge(u,v);
  }

  // 次数1の頂点を消していく
  queue<int> que;
  rep(i,n){
    if(g.degree(i)==1)que.push(i);
  }
  while(!que.empty()){
    int i = que.front();
    que.pop();
    if(i==0)continue;
    tour[i] = 0;
    rep(j,g.e[i].size()){
      int to = g.e[i][j];
      if(tour[to]){
        g.vdeg[to]--;
        if(g.vdeg[to]==1)que.push(to);
      }
    }
  }
  
  int cent = 0;
  int w = 0;
  rep(i,n)if(tour[i]==1){cent++;w+=g.w[i];}
  
  vector<int> inds(n);
  int index = 0;
  rep(i,n){
    if(tour[i]==0){
      inds[i] = index;
      index++;
    }
  }

  // gから巡回可能部分を縮約したグラフtを構築する
  int nt = n-cent+1;
  Graph t(nt);
  if (cent>0){
    t.w[nt-1] = w;
    //t.setWeight(nt-1,w);
  }
  index = 0;
  rep(i,n){
    if (tour[i]==0){
      t.w[inds[i]] = g.w[i];
      // t.setWeight(inds[i],g.w[i]);
      rep(j,g.e[i].size()){
        if(tour[g.e[i][j]]==0&&!t.isConnected(inds[i],inds[g.e[i][j]])){
          t.addEdge(inds[i],inds[g.e[i][j]]);
        } else if (tour[g.e[i][j]]==1) {
          t.addEdge(inds[i],nt-1);
        }
      }
    }
  }
  int rt;
  if (tour[0]==0){rt = inds[0];}
  else {rt = nt-1;}

  // BFS
  vector<bool> visited(nt,false);
  rep(i,nt)t.cost[i] = t.w[i];
  que.push(rt);
  int maxcost = 0;
  while(!que.empty()){
    int u = que.front();
    que.pop();
    visited[u] = true;
    if (t.cost[u]>maxcost)maxcost = t.cost[u];
    rep(i,t.e[u].size()){
      int to = t.e[u][i];
      if(!visited[to]){
        que.push(to);
        t.cost[to] += t.cost[u];
      }
    }
  }
  cout << maxcost << endl;

  return 0;
}



Measured memory_bytes: 18072
#include <bits/stdc++.h>
#include <numeric>
#define REP(i, s, n) for (int i = s; i < n; ++i)
#define rep(i, n) REP(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define SORT_INV(c) sort((c).begin(), (c).end(), greater<int>())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG false
#define LL long long
#define Num 1000000007
// sort(a.begin(), a.end(), std::greater<int>());
using namespace std;

int main()
{
    vector<LL int> a(3);
    cin >> a[0] >> a[1] >> a[2];
    SORT(a);
    LL int n;
    cin>>n;
    cout<<a[0]+a[1]+a[2]*pow(2,n)<<endl;
    return 0;
}

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

typedef long long ll;
#define REP(i,n) for(int i=0,_n=(int)(n);i<_n;++i)
#define ALL(v) (v).begin(),(v).end()
#define CLR(t,v) memset(t,(v),sizeof(t))
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>&a){return os<<"("<<a.first<<","<<a.second<< ")";}
template<class T>void pv(T a,T b){for(T i=a;i!=b;++i)cout<<(*i)<<" ";cout<<endl;}
template<class T>void chmin(T&a,const T&b){if(a>b)a=b;}
template<class T>void chmax(T&a,const T&b){if(a<b)a=b;}


int nextInt() { int x; scanf("%d", &x); return x;}

const ll MOD = 1000000007;

const int MAX_N = 512345;
int border1[MAX_N];
int border2[MAX_N];
// int kmpnxt[MAX_N];
void KMP(const string& S, int* border) {
  int N = (int)S.size();
  border[0] = -1; // border[0] = kmpnxt[0] = -1;
  for (int i = 0, j = -1; i < N; i++) { 
    while (j >= 0 && S[i] != S[j]) j = border[j]; // j = kmpnxt[j];
    j++;
    border[i+1] = j;
    // kmpnxt[i+1] = (S[i+1] == S[j]) ? kmpnxt[j] : j;
  }
  // cout << "S     :"; pv(ALL(S));
  // cout << "border:"; pv(border, border+N+1);
  // cout << "kmpnxt:"; pv(kmpnxt, kmpnxt+N+1);
}

int main2() {
  string w; cin >> w;
  int N = (int)w.size();
  if (N == 1) {
    cout << 1 << endl;
    cout << 1 << endl;
    return 0;
  }

  KMP(w, border1);
  int p = N - border1[N];
  if (!(N % p == 0 && N / p >= 2)) {
    cout << 1 << endl;
    cout << 1 << endl;
    return 0;
  }
  if (p == 1) {
    cout << N << endl;
    cout << 1 << endl;
    return 0;
  }
  reverse(ALL(w));
  KMP(w, border2);
  int ans = 0;
  for (int i = 1; i <= N; i++) {
    bool yes = true;
    p = i - border1[i];
    if (i%p == 0 && i/p >= 2) yes = false;
    p = N-i - border2[N-i];
    if ((N-i) % p == 0 && (N-i)/p >= 2) yes = false;
    if (yes) ans++;
  }
  cout << 2 << endl;
  cout << ans << endl;
  return 0;
}

int main() {
  for (;!cin.eof();cin>>ws)
    main2();
  return 0;
}


Measured memory_bytes: 4740
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#pragma GCC optimize("Ofast")
//*********************************************DO IT NOW****************************************************************
#include<bits/stdc++.h> 
#include<random>
#define int long long   
#define pp pair<int,int> 
#define ss second 
#define ff first 
#define pb push_back
#define mod 1000000007
#define pi 3.14159265359
#define mk(arr,n,type)  type *arr=new type[n];
#define sl s1.length();
#define yes cout<< "YES"<<endl
#define no  cout<< "NO"<<endl
#define all(v) (v).begin(),(v).end()
#define s(v)   sort(v,v+n)
#define  mt mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define read(a,n) for(int i=0;i<n;i++)cin>>a[i]
#define print(a,n) for(int i=0;i<n;i++)cout<<a[i]<<" "
#define for1(i,a,n)  for(int i=0;i<n;i++)
#define rep(i, c) for(int i = 0; i < (int)c; i++)
#define set(x) cout<<fixed<<setprecision(x);
using namespace std;
//**********************************************DO IT NO****************************************************************
void fastio()
{  
  #ifndef ONLINE_JUDGE
  freopen("INPUT.txt","r",stdin);
  freopen("OUTPUT.txt","w",stdout); 
  #endif
  ios_base :: sync_with_stdio(false); 
  cin.tie(NULL) ; 
  cout.tie(NULL);
}
int dp[101][1001],ans1=1e9,dp1[1000001];
int num[10];
int a[1000000];
signed main()
{   
    fastio();
    int t=1;
    //cin>>t;
    while(t--)
    {  
       int n,m,x,y;
       cin>>n>>m>>x>>y;
       if(n==x)
       cout<<0;
       else
       cout<<1;
       
    }
}
// 🍪 🍪 🍪


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

using lint = long long;

int main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int x;
    cin >> x;
    vector<int> sieve((int)1e5+101, 1);
    sieve[0] = sieve[1] = 0;
    int res = 0;
    for (int i = 4; i <= (int)1e5+100; i += 2) sieve[i] = 0;
    for (int i = 3; i*i <= (int)1e5+100; i += 2)
    	if (sieve[i]) 
    		for (int j = i*i; j <= (int)1e5+100; j += 2*i) {
    			sieve[j] = 0;
    		}
	for (int i = x; i <= 2*x; ++i)
		if (sieve[i]) {
			cout << i << '\n';
			break;
		}
}

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

int main(){ 
 // int t;
 // cin>>t;
 // while(t--)
 // {
    
 //    int 
 // }
    int a[5];
    for(int i=0;i<5;i++)
    {
    	cin>>a[i];
    }
    int position;
    for(int i=0;i<5;i++)
    {
    	if(a[i]==0)
    		{
    			position = i+1;
    			break;
    		}
    }
    cout<<position<<"\n";

}

Measured memory_bytes: 3620
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <cmath>
#include <algorithm>
#include <functional>
#include <stack>
#include <numeric>
typedef long long ll;
using namespace std;
const int MOD = (int)1e9 + 7;
const ll INF = (ll)1e18 + 7;
//#define int long long
#define all(vec) vec.begin(), vec.end()

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

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

	int N,A,B;
	cin>>N>>A>>B;
	if(abs(A-B)%2==0){
		cout << "Alice" << endl;
	}else{
		cout << "Borys" << endl;
	}

	return 0;
}

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

typedef long double ld;
typedef long long ll;

using namespace std;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    //freopen("input.txt","r",stdin);
  //  freopen("output.txt","w",stdout);
    int n;cin>>n; ll a[n];
    for(int i=0;i<n;i++) cin>>a[i];
    ll cnt=0;
    for(int i=0;i<n;i++){
        for(int j=i;j<n;j++){
            for(int k=j;k<n;k++){
                if(a[i]!=a[j]&&a[j]!=a[k]&&a[k]!=a[i]&&a[i]+a[j]>a[k]&&a[j]+a[k]>a[i]&&a[k]+a[i]>a[j])
                cnt++;
            }
        }
    }
    cout<<cnt;
    return 0;
}

Measured memory_bytes: 3612
#include <iostream>
#include <map>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <sstream>
#include <cmath>
#include <math.h>
#include <string>
using namespace std;
typedef long long ll;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    string a = "";
    while( n != 0 ) {
        int r = n % 2;
        if( r == -1 ) r = 1;
        a += r + '0';
        n = ( n - r ) / ( -2 );
    }
    reverse( a.begin() , a.end() );
    if( a == "" ) cout << '0';
    else cout << a;
}

Measured memory_bytes: 3628
N, K = map(int, input().split())
R, S, P = map(int, input().split())
T = input()
d = {'r': 'p', 's': 'r', 'p': 's'}
a = {'r' : R, 's' : S, 'p' : P}
l = [d[s] for s in T]
cnt = 0
for i, s in enumerate(T):
    if i < K:
        cnt += a[l[i]]
        continue
    if s == 'r' and l[i-K] != 'p':
        cnt += P
    elif s == 'r' and l[i-K] == 'p':
        #cnt += R
        l[i] = 'a'

    if s == 's' and l[i-K] != 'r':
        cnt += R
    elif s == 's' and l[i-K] == 'r':
        #cnt += S
        l[i] = 'a'

    if s == 'p' and l[i-K] != 's':
        cnt += S
    elif s == 'p' and l[i-K] == 's':
        #cnt += P
        l[i] = 'a'
print(cnt)
    


Measured memory_bytes: 4212
N = input()
if N == "SSS":
  print(0)
elif N == "RRS":
  print(2)
elif N == "SRR":
  print(2)
elif N == "SRS":
  print(1)
elif N == "RSR":
  print(1)
elif N == "SSR":
  print(1)
elif N == "RSS":
  print(1)
else:
  print(3)

Measured memory_bytes: 61744
import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] arr = new int[n];
		for (int i = 0; i < n; i++) {
		    arr[i] = sc.nextInt() - i - 1;
		}
		Arrays.sort(arr);
		long total = 0;
		int base = arr[n / 2];
		for (int i = 0; i < n; i++) {
		    total += Math.abs(arr[i] - base);
		}
		System.out.println(total);
	}
}


Measured memory_bytes: 65084
x, y = map(int, input().split())

agr = {1,3,5,7,8,10,12}
bgr = {4,6,9,11}
cgr = {2,}

if x in agr: x = 0
elif x in bgr: x = 1
else: x = 2
  
if y in agr: y = 0
elif y in bgr: y = 1
else: y = 2
  
print('Yes' if x==y else 'No')

Measured memory_bytes: 3060
import sys
import math
import numpy as np
from collections import deque

def I():
  return int(input())
def IS():
  return map(int, input().split())
def IL():
  return [int(x) for x in input().split()]
def ILL(n):
  return [list(map(int, input().split())) for _ in range(n)]
def S():
  return input()
def SS():
  return input().split()

def main():
  N, M = IS()
  to = [[] for _ in range(N)]
  INF = float('inf')
  for i in range(M):
    A, B = IS()
    A -= 1
    B -= 1
    to[A].append(B)
    to[B].append(A) 
  # queue
  q = deque()
  q.append(0)
  # diatance to first room
  dist = [INF] * N
  # previous room
  prev = [-1] * N
 
  #### BFS ####
  while len(q) != 0:
    # pop from queue
    v = q.popleft()
    # seatch room of v's neighboor
    for u in to[v]:
      if prev[u] == -1:
        dist[u] = dist[v] + 1
        prev[u] = v
        q.append(u)
  # print answer
  print("Yes")
  for i in range(1, len(prev)):
    print(prev[i] + 1)

if __name__ == "__main__":
    main()

Measured memory_bytes: 55636
import java.util.Arrays;
import java.util.Scanner;

public class Main {


	public static void main(String args[]){

		Scanner cin = new Scanner(System.in);

		int target = cin.nextInt();
		int list[] = new int[target];
		int sum = 0;
		for(int i=0;i<target;i++){
			list[i] = cin.nextInt();
			sum += list[i];
		}

		if(sum%10!=0){
			System.out.println(sum);
		}else{
			Arrays.sort(list);
			for(int j=0;j<target;j++){
				if(list[j]%10!=0){
					sum-=list[j];
					break;
				}
			}
			if(sum%10==0){
				System.out.println(0);
			}else{
				System.out.println(sum);
			}
		}
	}
}


Measured memory_bytes: 21844
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
typedef long long ll;

int main(){
  int n;
  cin >> n;
  vector<string> s(n);
  for(int i=0;i<n;i++){
    cin >> s[i];
    sort(s[i].begin(),s[i].end());
  }
  ll ans=0;
  sort(s.begin(),s.end());
  ll cnt=1;
  string a=s[0];
  for(int i=1;i<n;i++){
    if(s[i]==a) cnt++;
    else{
      ans+=cnt*(cnt-1)/2;
      cnt=1;
      a=s[i];
    }
  }
  ans+=cnt*(cnt-1)/2;
  cout << ans << endl;
}


Measured memory_bytes: 7296
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define VIEW(x) do {cerr << #x << ": "; for(auto i : x) cerr << i << " "; cerr << endl;} while(0)
#define ALL(x) (x).begin(),(x).end()
template<class T>bool umax(T &a, const T &b) {if(a<b){a=b;return 1;}return 0;}
template<class T>bool umin(T &a, const T &b) {if(b<a){a=b;return 1;}return 0;}

template<typename A,size_t N,typename T> void FILL(A (&array)[N],const T &val){fill((T*)array,(T*)(array+N),val);}
template<typename T> void FILL(vector<T> &v, const T &x) {fill(v.begin(), v.end(), x);}
template<typename T> void FILL(vector<vector<T>> &v, const T &x) {for(auto &i:v)fill(i.begin(), i.end(), x);}

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

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

  vector<ll> index(m);
  vector<ll> sum(m);

  int a = x;
  set<int> s;
  for(ll i = 0; i < n; i++) {
    sum[i] += a;
    if(i!=0) sum[i] += sum[i-1];
    //printf("%5lld: %5d  %5lld\n",i, a, sum[i]);
    if(s.count(a)) {
      ll loop_start_index = index[a];
      ll loop_sum = sum[i] - sum[index[a]];
      ll loop_len = i - index[a];
      ll nokori = n - 1 - i;
      ll loop_nokori = nokori / loop_len;
      ll out_of_loop_nokori = nokori % loop_len;

      //cout << "loop detected at " << i << " (" << a << ")" << endl;
      //cout << "loop start at " << loop_start_index << endl;
      //cout << "loop sum    = " << loop_sum << endl;
      //cout << "loop length = " << loop_len << endl;
      //cout << "nokori      = " << nokori << endl;
      //cout << "nokori_loop = " << loop_nokori << endl;
      //cout << "nokori_out  = " << out_of_loop_nokori << endl;

      ll ans = sum[i - 1];
      ans += loop_nokori * loop_sum;
      if(loop_start_index > 0) ans += sum[loop_start_index+out_of_loop_nokori] - sum[loop_start_index-1];
      else                     ans += sum[loop_start_index+out_of_loop_nokori];
      cout << ans << endl;
      return 0;
    }
    index[a] = i;
    s.insert(a);
    a = modpow(a, 2, m);
  }
  cout << sum[n-1] << endl;
}


Measured memory_bytes: 7200
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <queue>
#include <string>
#include <set>
#include <map>
#define REP(i,n) for(ll i = 0; i < (ll)n; i++)
#define INF 1000000000000000
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;

int main(){
  int n,m;
  cin >> n >> m;
  bool s[m][n];
  fill(s[0],s[m],false);
  REP(i,m){
    int k; cin >> k;
    REP(j,k){
      int _s; cin >> _s;
      s[i][_s-1] = true;
    }
  }
  bool p[m];
  REP(i,m) cin >> p[i];

  ll ans = 0;
  REP(j,1<<n){
    int cnt = 0;
    REP(i,m){
      int cnt_sw = 0;
      REP(l,n){
        if(j>>l&1) if(s[i][l]) cnt_sw++;
      }
      if(cnt_sw%2==p[i]) cnt++;
    }
    if(cnt==m) ans++;
  }
  cout << ans << endl;
  return 0;
}


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

const int MAX = 1005;
const int MOD = 1e9+7;
int dp[MAX][MAX];

int main() {
    int n, m;
    cin >> n >> m;
    vector<string> mat(n);
    for (int i = 0; i < n; i++) {
        cin >> mat[i];
    }
    bool found = false;
    for (int i = 0; i < n; i++) {
        if (found) {
            dp[i][0] = 0;
        }
        else {
            found = mat[i][0] == '#';
            dp[i][0] = !found;
        }
    }
    found = false;
    for (int j = 0; j < m; j++) {
        if (found) {
            dp[0][j] = 0;
        }
        else {
            found = mat[0][j] == '#';
            dp[0][j] = !found;
        }
    }

    for (int i = 1; i < n; i++) {
        for (int j = 1; j < m; j++) {
            if (mat[i][j] != '#') {
                dp[i][j] = (dp[i-1][j] + dp[i][j-1]) % MOD;
            }
        }
    }
    cout << dp[n-1][m-1] << "\n";
}

Measured memory_bytes: 5248
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <queue>
#include <stack>
#include <tuple>
#include <bitset>
#include <cmath>

#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
using namespace std;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

bool is_prime(int num){
    if(num<2) return 0;
    else if(num==2) return 1;
    else if(num%2==0) return 0;
    for(int i=3;i*i<=num;i+=2){
        if(num%i == 0) return 0;
    }
    return 1;
}
int a[100];
int main(){
    int n_75=0,n_25=0,n_15=0,n_5=0,n_3=0;
    int n;
    cin >> n;
    for(int i=1;i<=n;i++){
        if(is_prime(i)){
            int j = i;
            while(n/j>0){
                a[i] += n/j;
                j*=i;
            }
        }
    }
    for(int i=0;i<=n;i++){
        if(a[i]>=2) n_3++;
        if(a[i]>=4) n_5++;
        if(a[i]>=14) n_15++;
        if(a[i]>=24) n_25++;
        if(a[i]>=74) n_75++;
    }
    int ans = (n_3-n_5)*n_5*(n_5-1)/2 + n_5*(n_5-1)*(n_5-2)/2 + (n_5-n_15)*n_15 + n_15*(n_15-1) + (n_3-n_25)*n_25 + n_25*(n_25-1) + n_75;
    cout << ans << endl;
}


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

#define rep(i,s,n) for (int i = (int)s; i < (int)n; i++)
#define ll long long
#define ld long double
#define pb push_back
#define eb emplace_back
#define All(x) x.begin(), x.end()
#define Range(x, i, j) x.begin() + i, x.begin() + j
#define lbidx(x, y) lower_bound(x.begin(), x.end(), y) - x.begin()
#define ubidx(x, y) upper_bound(x.begin(), x.end(), y) - x.begin()
#define llbidx(x, y, z) lower_bound(x.begin(), x.end(), z) - lower_bound(x.begin(), x.end(), y) // 二要素間の距離
#define deg2rad(deg) ((((double)deg)/((double)360)*2*M_PI))
#define rad2deg(rad) ((((double)rad)/(double)2/M_PI)*(double)360)
#define Find(set, element) set.find(element) != set.end()
#define Decimal(x) printf("%.10f\n", x) // 小数点を10桁まで表示
// debug用
#define PrintVec(x) for (auto elementPrintVec: x) { cout << elementPrintVec << " "; } cout << "\n";
#define debug(x) cerr << #x << ": " << (x) << "\n";
#define endl "\n"
// gcj print用
#define Case(x) printf("Case #%d: ", x);

typedef pair<int, int> PI;
typedef pair<ll, ll> PLL;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<vector<vector<int>>> vvvi;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<vector<vector<int>>> vvvl;
typedef vector<PI> vpi;
typedef vector<vector<PI>> vvpi;
typedef vector<vector<vector<PI>>> vvvpi;
typedef vector<PLL> vpl;
typedef vector<vector<PLL>> vvpl;
typedef vector<vector<vector<PLL>>> vvvpl;

int POWINT(int x, int n) {
  int ret = 1;
  while (n > 0) {
    if (n & 1) ret *= x;
    x *= x;
    n >>= 1;
  }
  return ret;
};

ll POWLL(ll x, int n) {
  ll ret = 1;
  while (n > 0) {
    if (n & 1) ret *= x;
    x *= x;
    n >>= 1;
  }
  return ret;
};

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;
};

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

  ll x;
  cin >> x;
  ll ans = 2 * (x / 11);
  x %= 11;
  if (1 <= x && x <= 6) {
    ans+=1;
  } else if (6 < x) {
    ans+= 2;
  }

  cout << ans << endl;



  return 0;
};


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

using namespace std;
int MX = (1<<15);
int n ,a,x,y,cntr,ans=0;
vector< pair<int , int > >arr[15];
vector<deque<bool> >states;
deque<bool> tmp;
void rec(int i)
{
    if(i== n)
    {
        states.push_back(tmp);
        return;
    }
    tmp.push_back(1);
    rec(i+1);
    tmp.pop_back();
    tmp.push_back(0);
    rec(i+1);
    tmp.pop_back();
}
int main()
{
    cin >> n;
    int a[n];
    for(int i = 0 ; i < n ;i++)
    {
        cin >> a[i] ;
        for(int j = 0  ; j < a[i] ; j++)
        {
            cin >> x >> y;
            arr[i].push_back(make_pair(x,y));
        }
    }
    rec(0);
    bool flag = true;
    for(int i = 0 ; i < states.size() ; i++)
    {
        cntr=0;
        flag=true;
            for(int k = 0 ;  k < n ;k++)
            {
                for(int s = 0 ; s < a[k] ;s++ )
                {
                    if(states[i][arr[k][s].first-1]!=arr[k][s].second&&states[i][k]!=0)
                    {
                        flag=false;
                        break;
                    }
                }
                if(flag!=true)
                {
                    break;
                }
            }
            if(flag)
            {
                for(int f = 0 ; f < states[i].size();f++)
                {
                    if(states[i][f]==1)
                        cntr++;
                }
                ans=max(ans,cntr);
            }
    }
    cout << ans;
}


Measured memory_bytes: 23316
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
using namespace std;
const int N=100010;
int a[N],f[N][31];
inline int gi() {
    int x=0,o=1;
    char ch=getchar();
    while(ch!='-'&&(ch<'0'||ch>'9')) ch=getchar();
    if(ch=='-') o=-1,ch=getchar();
    while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
    return x*o;
}
inline int calc(int x) {
    if(x==1) return 0;
    return 1+calc((x+1)>>1);
}
int main() {
    int n,x,y;
    cin>>n;
    memset(f,127/3,sizeof(f));
    f[0][0]=0;
    for(int i=1;i<=n;i++) {
	x=gi(),y=calc(x);
	if((1<<y)==x) x=y;
	else x=y-1;
	for(int j=0;j<31;j++) {
	    f[i][x]=min(f[i][x],f[i-1][j]+max(0,y-j));
	    f[i][y]=min(f[i][y],f[i-1][j]+max(0,x-j)+y-x);
	}
    }
    cout<<min(f[n][x],f[n][y]);
    return 0;
}

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

int main(){
    int a, b, c;
    
    cin>> a >> b >> c;
    
    if(a < b){
        if(b < c){
            cout << "Yes" << endl;
        }else{
            cout << "No" << endl;
        }
    }else{
        cout << "No" << endl;
    }

    return 0;
}


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

using namespace std;
#define ll long long
#define rep(i,n,N) for(int i=(int)n;i<=(int)N;i++)
#define rap(i,n,N) for(int i=(int)n;i>=(int)N;i--)
#define mp make_pair
#define pb push_back
#define pob pop_back
#define pf push_front
#define pof pop_front
#define fi first
#define se second
#define pii pair<int,int> 
#define pll pair<ll,ll>
const ll MAX=2010;
const int MOD=1000000000 + 7;
const ll INF=1000000000000000000;
const int nr[]={1,-1,0,0,1,1,-1,-1};
const int nc[]={0,0,1,-1,1,-1,1,-1};
map<int,int> M;
int n,x;
int main(){
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    cin>>n;
    rep(i,1,n)cin>>x, M[x]++;
    cin>>n;
    rep(i,1,n){
    	cin>>x;
    	M[x]++;
    	M[x]--;
    	//cout<<M[x]<<endl;
    	if(M[x]==0){
    		cout<<"NO"<<endl;
    		return 0;
		}
		M[x]--;
	}
	cout<<"YES"<<endl;
    return 0;
}

Measured memory_bytes: 9600
import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      	int x = sc.nextInt();
      	int y = sc.nextInt();
      	int a,b;//a鶴2,b亀4
      	boolean isTrue = false;
      	for(a = 0; a <= x; a++){
        	b = x - a;
          	if(2*a + 4*b == y){
              isTrue = true;
              break;
            }
        }
      	if(isTrue) System.out.println("Yes");
      	else System.out.println("No");
    }
}


Measured memory_bytes: 35592
#include<bits/stdc++.h>
#define ll long long
#define inf 0x3f3f3f3f
#define fi first
#define se second
#define pb push_back
#define mkp make_pair
#define pa pair<int,int>
const int N=1e6+10; 
const int mod=998244353;
using namespace std;

int a[111],b[111];
int main()
{
	 int n; cin>>n;
	 int ans=0;
	 for(int i=1;i<=n;++i) cin>>a[i];
	 for(int i=1;i<=n;++i) cin>>b[i];
	 for(int i=1;i<=n;++i) ans+=max(0,a[i]-b[i]);
	 cout<<ans<<endl;
return 0;
}
/*
*/

Measured memory_bytes: 256
from sys import stdin


if __name__ == "__main__":
    _in = [_.rstrip() for _ in stdin.readlines()]
    N, K = list(map(int,_in[0].split(' ')))  # type:list(int)
    d_arr = []
    for i in range(K):
        _ = int(_in[2*i+1])  # type:int
        d_arr.append(_)
    A_arr = []
    for i in range(K):
        _ = list(map(int,_in[2*i+2].split(' ')))  # type:list(int)
        A_arr.append(_)
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    _ = list(set(sum(A_arr,[])))
    cnt = N-len(_)
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    print(cnt)


Measured memory_bytes: 73288
#include <iostream>
#include <vector>

int main()
{
  int n = 3;
  std::vector<int> a(n);
  for (int i = 0; i < n; ++i)
    std::cin >> a[i];

  int sum = 0;
  for (auto v : a)
    sum += v;

  if (sum >= 22)
    std::cout << "bust" << std::endl;
  else
    std::cout << "win" << std::endl;

  return 0;
}



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

using lint = long long;

int main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int n;
	cin >> n;
	bool ok = 1;
	int last = -1;
	for (int i = 0; i < n; ++i) {
		int height;
		cin >> height;
		if (height > last || last == -1) height--;
		else if (height < last){
			ok = 0;
			break;
		}
		last = height;
	}
	cout << (ok ? "Yes\n" : "No\n");
}



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

#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return input().rstrip().decode()
def II(): return int(input())
def FI(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode()

from collections import defaultdict

def main():
	n=II()
	d=defaultdict(int)
	for _ in range(n):
		s=list(RD())
		s.sort()
		d[tuple(s)]+=1

	ans=0

	for _,v in d.items():
		ans+=(v*(v-1))//2
	print(ans)









if __name__ == "__main__":
	main()


Measured memory_bytes: 28072
from sys import stdin
n = int(stdin.readline())
h = list(map(int,stdin.readline().split()))
dp = [0]
for i in range(1,n):
    dp.append(min(dp[i-1]+abs(h[i]-h[i-1]),10**9 if i==1 else dp[i-2]+abs(h[i]-h[i-2])))
print(dp[-1])

Measured memory_bytes: 89664
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s, e) for (int i = (int)(s); i <= (int)(e); i++)
#define printYesNo(is_ok) puts(is_ok ? "Yes" : "No");
#define printVector(v) rep(i, v.size()) cout << v[i] << endl;

int main()
{
  string S;
  cin >> S;
  reverse(S.begin(), S.end());
  vector<string> T = {"maerd", "esare", "remaerd", "resare"};

  rep(i, S.size())
  {
    bool is_ok = false;
    rep(j, 4)
    {
      string t = T[j];

      if (S.substr(i, t.size()) == t)
      {
        is_ok = true;
        i = i + t.size() - 1;
        break;
      }
    }
    if (!is_ok)
    {
      cout << "NO" << endl;
      return 0;
    }
  }

  cout << "YES" << endl;
  return 0;
}

Measured memory_bytes: 512
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <climits>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)

int n, t, a;

double f(const int x) {
  return t - x * 0.006;
}

int main() {
  cin >> n >> t >> a;
  pair<double, int> p{INT_MAX, INT_MAX};
  REP(i, n) {
    int h;
    cin >> h;
    p = min(p, {abs(a - f(h)), i + 1});
  }
  cout << p.second << endl;
}


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

const int N=85;
int n,a[N],mx[N],dp[N];

main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cin>>n;
    for(int i=1;i<=n;i++) cin>>a[i];
    dp[0]=1000;
    for(int i=1;i<=n;i++)
    {
        int mn=1e9;
        for(int j=i;j>=1;j--)
        {
            int cur=dp[j-1];
            mn=min(mn,a[j]);
            dp[i]=max(dp[i],(cur/mn)*a[i]+cur%mn);
        }
    }
    cout<<*max_element(dp,dp+n+1);
}


Measured memory_bytes: 3648
/*
1. I'm the Future Red Coder :)
2. Hopefully, I'll be Yellow Soon.
*/
#include<bits/stdc++.h>
#define mod 998244353 //1000000007
#define lim 1000000000000000007
#define lim1 18446744073709551615  //Unsigned
#define sq(a) ((a)*(a))
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define mms(v,i) memset(v,i,sizeof(v))
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define REP(i,a,b) for (int i = a; i <= b; i++)
#define REPN(i,a,b) for (int i = a; i >= b; i--)
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef pair<int,int> pi;
typedef pair<ll,ll> PL;
typedef pair<ll,int> PLI;
typedef pair<int,ll> PIL;
typedef pair<int,pair<int,int> > pii;
ll power(ll a,ll b,ll m=mod) {
    if (b==0) return 1;
    ll c = power(a,b>>1,m);
    c = (c*c)%m;
    if (b&1) return (c*a)%m;
    return c;
}
ll gcdll(ll a,ll b) {
    if (b==0) return a;
    return gcdll(b,a%b);
}
int gcd(int a,int b) {
    if (b==0) return a;
    return gcd(b,a%b);
}
/*struct node {
    int l,r,nq;
};
bool compare(const node& a,const node& b) {
    if (a.r != b.r) return a.r<b.r;
    return a.l<b.l;
}*/
/* ******* DSU START ****** */
/*
const int dsusize = (int)1e5+5;
struct node {
    int data;
    int rk,pn;
}dsu[dsusize];
//ll fans;
void initialize(int n) {
    REP(i,1,n) {
        dsu[i].data = 1;
        dsu[i].rk = 0;
        dsu[i].pn = i;
    }
}
int fnd(int i) {
    if (dsu[i].pn != i) dsu[i].pn = fnd(dsu[i].pn);
    return dsu[i].pn;
}
void unn(int i,int j) {
    i = fnd(i);
    j = fnd(j);
    if (i!=j) {
        //fans -= dsu[i].data*dsu[j].data;
        if (dsu[i].rk>dsu[j].rk) {
            dsu[j].pn = i;
            dsu[i].data += dsu[j].data;
        }
        else {
            dsu[i].pn = j;
            dsu[j].data += dsu[i].data;
            if (dsu[i].rk==dsu[j].rk) {
                dsu[j].rk++;
            }
        }
    }
}
*/
/* ******* DSU END****** */

const int N = (int)2e5+5;
const int Q = 250;
void solve() {
    int n,d;
    cin>>n>>d;
    d = (d<<1|1);
    cout<<((n+d-1)/d);
}
int main() {
    //freopen("class_treasurer.txt","r",stdin);
    //freopen("output.txt","w",stdout);

    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int T=1;
    //cin>>T;
    REP(TC,1,T) {
        //cout<<"Case #"<<TC<<": ";
        solve();
        cout<<"\n";
    }
}


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

int main()
{
    long long int n,a,b,i,d=1;
    cin>>n;
    cin>>a>>b;
    for(i=a;i<=b;i++)
    {
        if(i%n==0)
        {
            d=1;
            break;
        }
        else
        {
            d=0;
            continue;
        }
    }
    if(d==1)
    {
        cout<<"OK\n";
    }
    else
    {
        cout<<"NG\n";
    }
    return 0;
}


Measured memory_bytes: 3636
using namespace std;
#include <cstdio>
#include <cstring>
#include <algorithm>
#define N 55
#define ll long long
#define INF 1000000000
int n,x,d;
int p[N];
ll w[N],v[N];
ll f[N*N*N];
int q[N];
bool cmpq(int a,int b){return (ll)v[a]*w[b]>(ll)v[b]*w[a];}
int main(){
	scanf("%d%d%d%lld",&n,&x,&d,&w[1]),v[1]=1;
	for (int i=2;i<=n;++i)
		scanf("%lld%d",&w[i],&p[i]),v[i]=1;
	for (int i=n;i>=2;--i){
		w[p[i]]+=w[i];
		v[p[i]]+=v[i];
	}
	int c=min(n,d);
	memset(f,63,sizeof f);
	f[0]=0;
	for (int i=1;i<=n;++i){
		ll w_=w[i],v_=v[i];
		int r=c;
		for (int lg=0;r;++lg){
			w_=w[i]*min(1<<lg,r);
			v_=v[i]*min(1<<lg,r);
			r-=min(1<<lg,r);
			for (int k=n*c*i;k>=v_;--k)
				f[k]=min(f[k],f[k-v_]+w_);
		}
	}
	d-=c;
	for (int i=1;i<=n;++i)
		q[i]=i;
	sort(q+1,q+n+1,cmpq);
	ll ans=0;
	for (int j=0;j<=n*n*n;++j){
		if (f[j]>x) continue;
		ll r=x-f[j],s=j;
		for (int i=1;i<=n;++i){
			ll t=min(r/w[q[i]],q[i]==1?(ll)INF:d);
			r-=w[q[i]]*t;
			s+=v[q[i]]*t;
		}
//		printf("%d %lld %lld\n",j,f[j],s);
		ans=max(ans,s);
	}
	printf("%lld\n",ans);
	return 0;
}















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

int main() {
  int n;
  std::cin >> n;

  std::string s;
  std::cin >> s;

  int count = 1;
  char color = s[0];
  for (int i = 1; i < n; ++i) {
    if (s[i] != color) {
      color = s[i];
      ++count;
    }
  }

  std::cout << count << std::endl;
}

Measured memory_bytes: 512
#include<iostream>
#include<algorithm>
#include<math.h>
#include<set>
#include<vector>
#include<map>
using namespace std;
int main(){
char a,b;
cin>>a>>b;
if(a=='H'&&b=='H')
cout<<'H'<<endl;
else if(a=='H'&&b=='D')
cout<<'D'<<endl;
else if(a=='D'&&b=='D')
cout<<'H'<<endl;
else if(a=='D'&&b=='H')
cout<<'D'<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define Yes() std::cout << "Yes" << std::endl
#define No() std::cout << "No" << std::endl
#define Say(s) std::cout << s << std::endl
const ll MOD = 1000000007;
const ll INF = 1061109567;

int main()
{
    ll n;
    std::cin >> n;
    bool flag = false;
    ll flag_1 = 0;
    for (ll i = 0; i < n; ++i) {
        ll temp_1, temp_2;
        std::cin >> temp_1 >> temp_2;
        if (temp_2 == temp_1) {
            ++flag_1;
        } else {
            flag_1 = 0;
        }
        if (flag_1 == 3) {
            flag = true;
        }
    }
    if (flag) {
        Yes();
    } else {
        No();
    }
    return 0;
}

Measured memory_bytes: 3584
import std.algorithm;
import std.conv;
import std.stdio;
import std.string;

void main()
{
	auto ab = readln.split.map!( to!int );
	
	writeln( solve( ab[ 0 ], ab[ 1 ] ) );
}

int solve( in int a, in int b )
{
	return ( a <= b ) ? a : a - 1;
}

unittest
{
	assert( solve( 5, 5 ) == 5 );
	assert( solve( 2, 1 ) == 1 );
	assert( solve( 11, 30 ) == 11 );
}


Measured memory_bytes: 256
using System;
using System.Linq;
using System.Text;

namespace ALDS1_6_C {
    public struct Card {
        public char Suit;
        public int Number;

        public override string ToString() {
            return Suit + " " + Number;
        }
    }

    public static class MyExtension {
        public static void QuickSort(this Card[] arr,int p,int r) {
            if (p < r) {
                int q = arr.Pertition(p, r);
                arr.QuickSort(p, q - 1);
                arr.QuickSort(q + 1, r);
            }
        }

        public static int Pertition(this Card[] arr, int p, int r) {
            Card x = arr[r];
            int i = p - 1;
            for (int j = p; j < r; j++) {
                if (arr[j].Number <= x.Number) {
                    i++;
                    arr.Replace(i, j);
                }
            }
            arr.Replace(i + 1, r);
            return i + 1;
        }

        public static void Replace(this Card[] arr, int indexA, int indexB) {
            Card temp = arr[indexA];
            arr[indexA] = arr[indexB];
            arr[indexB] = temp;
        }
    }

    class Program {
        static void Main(string[] args) {
            int n = int.Parse(Console.ReadLine());
            Card[] cards = new Card[n];
            for(int i = 0; i < n; i++) {
                string[] input = Console.ReadLine().Split(' ');
                cards[i] = new Card { Suit = input[0][0], Number = int.Parse(input[1]) };
            }
            Card[] stable = cards.OrderBy(c => c.Number).ToArray();
            cards.QuickSort(0, n - 1);

            StringBuilder sb = new StringBuilder();
            sb.AppendLine(cards.SequenceEqual(stable) ? "Stable" : "Not stable");
            foreach (Card card in cards)
                sb.AppendLine(card.ToString());
            Console.Write(sb);
        }
    }
}

Measured memory_bytes: 17548
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define gsort(x) sort(x, x+n, greater<ll>()); 
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define sync2 cout<<fixed<<setprecision(10)
const ll inf=1e9+7;
#define pi 3.14159265358979323846
#define REP(i,j,n) for (int i = (int)j; i <=(int)n; i++)
#define REPD(i,n,j) for (int i = (int)n; i>=(int)j; i--)
#define all(vv) vv.begin(),vv.end()
//priority_queue <int, vector<int>, greater<int>> mnheap;

ll arr[200005],brr[200005];
ll ans=0;
int n;
void dfs(int id)
{
    ll val[3];
    REP(i,-1,1)
    {
        val[i+1]=brr[(id+i+n)%n];
    }
    ll used;//=val[1]/(val[0]+val[2]);
    used=(brr[id]-arr[id])/(val[0]+val[2]);
    if(used==0)
        return;
    ans+=used;
    brr[id]-=(used*(val[0]+val[2]));
    dfs((id-1+n)%n);
    dfs((id+1+n)%n);
}
int main()
{
    sync;
    cin>>n;
    REP(i,0,n-1)
        cin>>arr[i];
    REP(i,0,n-1)
        cin>>brr[i];
    for(int itr=0;itr<1;itr++)
    {
        REP(i,0,n-1)
            dfs(i);
    }
    REP(i,0,n-1)
    {
        if(arr[i]!=brr[i])
            ans=-1;
    }
    cout<<ans<<endl;
}
/*
3
RRRGGGBBB
*/

Measured memory_bytes: 3328
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
#define ld long double
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
	int a,b,c;
	cin>>a>>b>>c;
	if(b+c>=a){
		cout<<c-a+b;
	}
	else{
		cout<<"0";
	}
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include <string>
#include<cmath>
#include<map>
#include<cstdio>
#include<stack>
#include<queue>

#define ok printf("ok\n");
#define MAX 1000000
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(g);(i)--)
#define all(a) (a).begin(),(a).end()
#define pb push_back

using namespace std;

typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;

int main()
{
	ll x,y,ans = 0,cal;
	string s,t;
	vi v,w;
	cin >> x >> y;
	cal = x;
	while(x<=y)
	{
		ans++;
		x*=2;
	}
	cout << ans;
	
	return 0;
}

Measured memory_bytes: 256
// The moment you think of giving up you have already lost the battle
#include <iostream>
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
typedef long long int ll;
typedef long double dl;
#define PI  3.14159265358979323846
#define Mod 1000000007
ll fast(ll n,ll a,ll m)
{
    if(n==0)
        return 1;
    else if(n==1)
        return a;
    else
    {
        ll r=fast(n/2,a,m);
        if(n%2==0)
        {
            return (((r%m)*(r%m))%m);
        }
        else
        {
            return (((((r%m)*a)%m)*r)%m);
        }
    }
}

int main()
{
 ll n,K;
 cin>>n>>K;
 ll i,d[K];
 map<ll,ll> res;

 for(i=0;i<K;i++)
 {
     cin>>d[i];
     ll y,j;
     for(j=0;j<d[i];j++)
     {
         cin>>y;
         res[y]++;
     }
 }
 ll ans=0;
 for(i=1;i<=n;i++)
 {
     if(res[i]==0)
     {
         ans++;
     }
 }
 cout<<ans;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
//#define ll long long
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 (a>b) { a=b; return 1; } return 0; }
#define rep(i, n) REP(i, 0, n)
#define rep_rev(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
#define all(x) (x).begin(),(x).end()
ll t1,t2,t3;
const ll mod = 1000000007;
const int INF = 1e9;
const ll INFLONG = 1e18;
void swap(ll *x,ll *y){
  ll tmp;
  tmp = *x;
  *x = *y;
  *y = tmp;
}

int main(){
  ll n;
  cin >> n;
  ll ans = 0;
  if(n % 2 == 1){
    ans = 0;
  }else{
    ll piv = 5;
    while(piv < INFLONG){
      t1 = n / piv;
      ans += (t1) / 2;
      piv *= 5;
    }
  }
  cout << ans << endl;
}

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

int main() {
    ll n, m;
    cin >> n >> m;
    if(n==4 && m==1)cout<<"1 2"<<endl;
    else if (n % 2 == 0&& m>=n/4) {
        for (ll i = 0; i < n/4; ++i) {
            cout << i + 1 << " " << n - i << endl;
        }
        for (int j = 0; j < m-(n/4); ++j) {
            cout<<n/4+j+1<<" "<<n-1-(n/4+j)<<endl;
        }
    } else {
        for (ll i = 0; i < m; ++i) {
            cout << i + 1 << " " << n - i << endl;
        }
    }
    return 0;
}


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

using namespace std;

#define ALL(x) (x).begin(), (x).end()
#define AND(x,y,z) 
#define DUMP(xs) for (auto x:xs) cout<<x<<' ';cout<<endl
#define DUMPP(xs) for (auto x:xs) cout<<'('<<x.first<<','<<x.second<<')';cout<<endl
#define FOR(i,a,b) for (ll i=(ll)(a);i<(ll)(b);++i)
#define OUT(x) cout<<x<<endl
#define REP(i,n) FOR(i,0,n)
#define YES(cond) cond ? OUT("YES") : OUT("NO")
#define Yes(cond) cond ? OUT("Yes") : OUT("No")

template<class T> T gcd(const T x,const T y){if(!y){return x;}return gcd(y,x%y);}
template<class T> T lcm(const T x,const T y){return x/gcd(x,y)*y;};
template<class T> T modpow(const T x,const T n,const T mod) {
  T res=1;while(n>0){if(n%2)res=res*x%mod;x=x*x%mod;n/=2;};return res;
}
template<class T> bool alltrue(const T &a){return all_of(ALL(a),[](bool x){return x;});}
template<class T> bool anytrue(const T &a){return any_of(ALL(a),[](bool x){return x;});}
template<class T> bool contain(const T &a,const T &b){for(auto x:b){if (a.find(x)==a.end()){return false;}}return true;}
template<class T> bool mmax(T &m,const T q){ if (m < q) {m = q; return true;} else return false; }
template<class T> bool mmin(T &m,const T q){ if (m > q) {m = q; return true;} else return false; }
template<class T> int siz(const T &a) {return (int)a.size();}
template<class T> set<T> devisers(T n) {
  set<T> res;for(T i=1;i<(T)sqrt(n)+1;i++){if(n%i==0){res.insert(i);res.insert(n/i);}}return res;
}
template<class T> void concat(T &a, const T &b){a.insert(a.end(),b.begin(),b.end());}
template<class T> void getand(const T &a,const T &b,T &c) {
  set_intersection(a.begin(),a.end(),b.begin(),b.end(),inserter(c,c.end()));
}
template<class T> void getor(const T &a,const T &b,T &c) {
  set_union(a.begin(),a.end(),b.begin(),b.end(),inserter(c,c.end()));
}

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

const int MOD=1e9+7;
const int MAX=1e5+100;

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

  if (K>(N-1)*(N-2)/2) {
    OUT(-1);
    return 0;
  }

  vector<P> res;
  REP(i,N-1) res.push_back({1,i+2});
  int from=2,to=3;
  REP(i,(N-1)*(N-2)/2-K) {
    res.push_back({from,to});
    if (to==N) {
      from++;
      to = from+1;
    } else {
      to++;
    }
  }
  OUT(siz(res));
  REP(i,siz(res)) {
    cout<<res[i].first<<' '<<res[i].second<<endl;
  }

  return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <math.h>
using namespace std;


int main() {
	string s;
	cin >> s;
	bool c = false;
	int a = s.size();
	for (int i = 0; i < a-1; i++) {
				if (s[i] == s[i+1]) {
					c = true;
				}
	}
	if (c) {
		cout << "Bad" << endl;
	}
	else {
		cout << "Good" << endl;
	}
}

Measured memory_bytes: 256
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

lst = [a,b,c,d,e]
bottle = min(lst)

tmp = (n/bottle) - (n//bottle)
if tmp != 0:
    ans = (n // bottle) + 1
else:
    ans = n//bottle
print(ans + 4)

Measured memory_bytes: 3064
a,b,m = map(int,input().split())
ap = list(map(int,input().split()))
bp = list(map(int,input().split()))
ls = []
for i in range(m):
    ls.append(list(map(int,input().split())))
m = min(ap)+min(bp)

for x,y,c in ls:
    if m > ap[x-1] + bp[y-1] - c:
        m =  ap[x-1] + bp[y-1] - c
print(m)


Measured memory_bytes: 38572
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define sidha(i,a,b) for(int i=a;i<b;i++)
#define vi vector<int> 
#define pb push_back

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
	int n,m;cin>>n>>m;
	ll c=0;
	for(int i=0;i<n;i++){
		ll a,b;cin>>a>>b;
		double x=pow(a*a+b*b,0.5);
		if(x<=m){
			c++;
		}
	}
	cout<<c<<endl;
	return 0;
}

Measured memory_bytes: 4312
s = input()
yymm = False
mmyy = False
first = int(s[:2])
last = int(s[2:])
if first<=12 and first >0:
    mmyy = True
if last <=12 and last>0:
    yymm = True
if mmyy == True and yymm == True:
    print('AMBIGUOUS')
elif mmyy == True and yymm == False:
    print('MMYY')
elif mmyy == False and yymm == True:
    print('YYMM')
else:
    print('NA')

Measured memory_bytes: 3064
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cassert>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)(n); ++i)

int H, N;

using vs = vector<string>;
using vss = vector<vs>;

vss t;
vector<vss> bs;

int erase(vss &t) {
    int res = 0;
    for (auto &l : t) {
        if (l[0] == "##" && l[1] == "##") {
            l.clear();
            ++res;
        }
    }
    t.erase(remove(t.begin(), t.end(), vs()), t.end());
    return res;
}

vss shift(vss t, int di, int dj) {
    vss res(2, vs(2, ".."));
    rep(l, 2)rep(i, 2)rep(j, 2) {
        if (t[l][i][j] == '#') {
            if (0 <= i - di && i - di < 2 && 0 <= j - dj && j - dj < 2) {
                res[l][i - di][j - dj] = t[l][i][j];
            } else {
                return{};
            }
        }
    }
    return res;
}

bool hit(const vss &t, int p, const vss &b) {
    rep(i, 2)rep(j, 2)rep(k, 2) {
        if (t[i + p][j][k] == '#' && b[i][j][k] == '#') {
            return true;
        }
    }
    return false;
}

vss put(vss t, const vss &b) {
    vss res = t;
    int p = t.size() - 3;
    while (p >= 0 && !hit(t, p, b)) --p;
    ++p;
    rep(i, 2)rep(j, 2)rep(k, 2) {
        if (b[i][j][k] == '#') {
            res[i + p][j][k] = '#';
        }
    }
    return res;
}

int rec(int p, vss t) {
    if (p == N) {
        return 0;
    }
    const vss &b = bs[p];
    int res = 0;
    for (int di = -1; di <= 1; ++di) {
        for (int dj = -1; dj <= 1; ++dj) {
            vss nb = shift(b, di, dj);
            if (nb.size()) {
                vss nt = put(t, nb);
                int score = erase(nt);
                score += rec(p + 1, nt);
                res = max(res, score);
            }
        }
    }
    return res;
}

int main() {
    while (cin >> H >> N && H) {
        t = vss(H + 10, vs(2, ".."));
        rep(i, H) {
            cin >> t[i][0] >> t[i][1];
        }
        bs = vector<vss>(N, vss(2, vs(2)));
        rep(i,N){
            rep(j, 2)rep(k, 2) cin >> bs[i][j][k];
            if (bs[i][0][0] == ".." && bs[i][0][1] == "..") {
                swap(bs[i][0], bs[i][1]);
            }
        }
        cout << rec(0, t) << endl;
    }
}

Measured memory_bytes: 3236