akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<cstring>
#include<map>
#include<vector>
#include<queue>
#include<stack>
#include<climits>
#include<set>
#include<utility>
#include<typeinfo>
#include<random>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
typedef set<int> S;
#define rep(i, n) for(int i=0; i<n; i++)
const ll MOD=1e9+7;

int main(){

  string s;
  cin >> s;
  if(s == "ABC"){
    cout << "ARC" << endl;
  } else {
    cout << "ABC" << endl;
  }

	return 0;
}

Measured memory_bytes: 3604
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); i++)
#define ALL(v) (v).begin(),(v).end()
using ll = long long;
using P = pair<int, int>;
const int INF = 1e9;
const long long LINF = 1e18;
const long long MOD = 1e9 + 7;

int d[] = {1, 1, 1, 2, 1, 2, 1, 5,  2, 2, 1, 5, 1, 2, 1, 14,
           1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};

signed main(){
    int k;
    cin >> k;
    cout << d[k - 1] << endl;
    return 0;
}

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

#define INF 0x3FFFFFFF

using namespace std;

int a[100000], b[100000];

int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d %d", &a[i], &b[i]);
  }
  int maxiA = 0;
  int miniB = INF;
  for (int i = 0; i < n; i++) {
    if (a[i] > maxiA) {
      maxiA = a[i];
      miniB = b[i];
    }
  }
  cout << maxiA + miniB << endl;
  return 0;
}


Measured memory_bytes: 1024
n = int(input())
a = list(map(int,input().split()))
for i in range(int(input())):
    l = list(map(int,input().split()))
    if l[0]:
        print(max(a[l[1]:l[2]]))
    else:
        print(min(a[l[1]:l[2]]))
        


Measured memory_bytes: 5708
#include <bits/stdc++.h>
//#define int ll
typedef long long ll;
const int INF = 0x3f3f3f3f;
const int mod = 1e9 + 7;
const int maxn = 2e5 + 10;
using namespace std;

int a[maxn],b[maxn];

int find_(int x){
    return x==a[x]?x:a[x]=find_(a[x]);
}

void solve() {
    int n,m,max_=0;
    cin>>n>>m;
    for (int j = 0; j<=n; ++j)  a[j]=j,b[j]=1;
    for (int i = 0; i < m; ++i) {
        int x,y;
        cin>>x>>y;
        int fx=find_(x);
        int fy=find_(y);
        if (fx!=fy) a[fx]=fy,b[fy]+=b[fx];
    }
    for (int k =1; k <=n; ++k)  if(b[k]>max_) max_=b[k];
    cout<<max_;
}

signed main() {
    //ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int _ = 1;
//    cin>>_;
    while (_--) {
        solve();
    }
    return 0;
}

Measured memory_bytes: 5156
#include<cstdio>
#include<map>
#include<queue>
#include<vector>
#include<cstring>
#include<algorithm>
using namespace std;
#define N 1000000
struct mzls
{
	int to,cost;
}as;
vector<mzls>g[N+5];
inline void insert(int x,int y,int z) 
{
	as.to=y,as.cost=z;
	g[x].push_back(as);
	as.to=x;
	g[y].push_back(as);
}
queue<int>q;
int dist[N+5];
bool f[N+5];
inline void SPFA(int s) 
{
	memset(dist,0x3f3f3f,sizeof(dist));
	q.push(s);
	f[s]=1,dist[s]=0;
	while(!q.empty()) 
	{
		int x=q.front();
		q.pop();
		f[x]=0;
		for(int i=0;i<g[x].size();i++) 
		{
			int v=g[x][i].to;
			if(dist[v]>dist[x]+g[x][i].cost) 
			{
				dist[v]=dist[x]+g[x][i].cost;
				if(!f[v]) 
				{
					f[v]=1;
					q.push(v);
				}
			}
		}
	}
}
map<pair<int,int>,int>fa;
int n,m,t;
int X(int x,int y) 
{
	if(fa[make_pair(x,y)])
		return fa[make_pair(x,y)];
	return fa[make_pair(x,y)]=++t;
}
int main()
{
	scanf("%d%d",&n,&m);
	t=n;
	for(int i=1;i<=m;i++) 
	{
		int x,y,z;
		scanf("%d%d%d",&x,&y,&z);
		int t1=X(x,z);
		int t2=X(y,z);
		insert(t1,t2,0);
		insert(x,t1,1);
		insert(y,t2,1);
	}
	SPFA(1);
	printf("%d\n",dist[n]>=0x3f3f3f?-1:dist[n]/2);
	return 0;
}

Measured memory_bytes: 71552
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    string ans,str;
    cin>>ans;
    int co=0;
    for(int i=0;i<n;i++){
        cin>>str;
        bool kawa=0;
        for(int j=0;j<str.size()&&!kawa;j++){
            if(ans[0]==str[j]){
                for(int k=j+1;k<str.size()&&!kawa;k++){
                    if(str[k]==ans[1]){
                        for(int l=0,m=j;!kawa&&m<str.size();l++,m+=k-j){
                            if(ans[l]!=str[m])break;
                            if(l==ans.size()-1)kawa=1;
                        }
                    }
                }
                if(kawa)co++;
            }
        }
    }
    cout<<co<<endl;
}

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

    #define FAST ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    #define F first
    #define int long long
    #define f(i,l,n) for(int i=l;i<n;i++)
    #define S second
    #define sz size()
    #define mp make_pair
    #define pb push_back
    #define E "\n"
    
    #define double long double
    #define inf 1e17
	
	
	double dp[3004][3004],a[3004];
	int n;
	
	double solve(int id,int k)
	{
		
	//	cout<<id<<"==id "<<k<<" tails\n";
		if(dp[id][k]!=-1) return dp[id][k];
		
		double ans=0;
		if(id==n+1)
		{
			if(k>(n/2))  ans=1.00000;
			else  ans=0.00000;
			return dp[id][k]=ans;
		}
		double t1=(a[id]*solve(id+1,k+1));
		double t2=((1-a[id])*solve(id+1,k));
		ans=t1+t2;

	    return dp[id][k]=ans;
	}
	
    int32_t main()
    {
		FAST;
		
		
		//int n;
		cin >> n;
		f(i,0,3004) f(j,0,3004) dp[i][j]=-1;
	   
		
		f(i,1,n+1) cin >> a[i];
		
		double aa=solve(1,0);
		
		
		cout<<fixed<<setprecision(10)<<aa;
		return 0;
    }
 


Measured memory_bytes: 141568
import math
from math import gcd,pi,sqrt
INF = float("inf")
MOD = 10**9 + 7

import sys
sys.setrecursionlimit(10**6)
import itertools
import bisect
from collections import Counter,deque
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]


def main():
    n = i_input()
    l = i_list()
    ans = 0
    for i in l:
        while i%2 == 0:
            ans += 1
            i //= 2
    print(ans)



if __name__=="__main__":
    main()


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

void insertionSort(int A[], int N) {
	int v, j;
	for (int i = 1; i < N; i++) {
		v = A[i];
		j = i - 1;
		while (j >= 0 && A[j] > v) {
			A[j + 1] = A[j];
			j--;
			A[j + 1] = v;
		}
		for (int z = 0; z < N-1; z++) {
			cout << A[z] << " ";
		}
		cout << A[N - 1] << endl;
	}
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	int N; cin >> N;
	int a[1100];
	cin >> a[0];
	for (int i = 1; i < N; i++) {
		cout << a[i - 1] << " ";
		cin >> a[i];
	}
	cout << a[N - 1] << endl;
	insertionSort(a, N);
}


Measured memory_bytes: 3164
#include <bits/stdc++.h>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#include <boost/integer/common_factor.hpp>
#include <boost/integer/common_factor_rt.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>

using std::string;
using std::vector;
using std::set;
using std::map;
using std::unordered_map;
using std::pair;
using std::cin;
using std::cout;

typedef uintmax_t    ull;
typedef intmax_t     ll;
typedef uint64_t     ul;
typedef uint32_t     ui;
typedef uint8_t      uc;

typedef boost::multiprecision::number<boost::multiprecision::cpp_dec_float<1000>> cpp_dec_float_1000;

constexpr char CRLF = '\n';
constexpr char SPACE = ' ';
constexpr char VECTOR_COUT_SEPARATOR = SPACE;
constexpr ll INF = 1000'000'007;

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; }
template<class T> std::ostream& operator<< (std::ostream& os, const std::vector<T>& vc) { for(auto it = vc.begin(); it != vc.end(); ++it) { if (std::next(it) == vc.end()) os << *it; else os << *it << VECTOR_COUT_SEPARATOR; } return os; }
template<class T1, class T2> inline std::ostream & operator<< (std::ostream & os, const std::pair<T1, T2> & p) { return os << p.first << ' ' << p.second; }

void solve(void)
{
  ui a{}, b{}, c{};
  cin >> a >> b >> c;

  cout << (a * b / 2) << CRLF;

  return;
}

int main(void)
{
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(0);

  solve();

  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
void trade(int *a,int *b);

int main(){
	int n;
	scanf("%d",&n);
	int a[n];
	int i;
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
	}
	int flag=1;
	int count=0;
	int j;
	while(flag){
		flag=0;
		for(j=n-1;j>=1;j--){
			if(a[j]<a[j-1]){
				trade(&a[j],&a[j-1]);
				flag=1;
				count++;
			}
		}
	}
	int k=0;
	while(1){
		printf("%d",a[k]);
		k++;
		if(k==n){
			printf("\n%d\n",count);
			break;
		}
		printf(" ");
	}
}


void trade(int *a,int *b){
	int temp;
	temp=*a;
	*a=*b;
	*b=temp;
}

Measured memory_bytes: 2748
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef pair<int, int> P;

using vi = vector<int>;
using vvi = vector<vector<int>>;
using vvvi = vector<vector<vector<int>>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using vvvll = vector<vector<vector<ll>>>;
using vd = vector<double>;
using vvd = vector<vector<double>>;
using vvvd = vector<vector<vector<double>>>;
using vb = vector<bool>;
using vvb = vector<vector<bool>>;
using vs = vector<string>;
using pint = pair<int, int>;
using Graph = vvi;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()

bool cmp(pint a, pint b) {return a.second < b.second;}
void YN(bool flg) {cout<<(flg?"YES":"NO")<<'\n';}
void Yn(bool flg) {cout<<(flg?"Yes":"No")<<'\n';}
void yn(bool flg) {cout<<(flg?"yes":"no")<<'\n';}

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

    int ans = 0;
    for(int i = 1; i <= n; i++) {
        int cnt = 0;
        if(i % 2 == 0) continue;
        for(int j = 1; j <= i; j++) {
            if(i % j == 0) cnt++;
        }
        if(cnt == 8) ans++;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <set>
#include <map>
#include <functional>
#include <string>
#include <cassert>
#include <string>
#include <cmath>
#define MX 1000000000LL

using namespace std;
typedef long long int ll;
typedef pair <int,int> P;

void print(ll a,ll b,ll c,ll d)
{
	printf("0 0 %lld %lld %lld %lld\n",a,b,c,d);
}
int main()
{
	ll S;
	scanf("%lld",&S);
	ll x=(ll) floor(sqrt(S));
	for(ll i=x-2;i<=x+2;i++)
	{
		if(i>=0)
		{
			if(i*i>=S&&i*i-S<=MX)
			{
				print(i,i*i-S,1,i);
				return 0;
			}
			if(i*(i+1)>=S&&i*(i+1)-S<=MX)
			{
				print(i,i*(i+1)-S,1,i+1);
				return 0;
			}
		}
	}
	return 0;
}


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

#define int         long long
#define uint        unsigned int
#define ld          long double
#define showoff     ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb          push_back
#define pii         pair<int,int>
#define FOR(i,a,b)  for(int i=a;i<b;++i)
#define RFOR(i,a,b) for(int i=a;i>b;--i)
#define f           first
#define se          second
#define maxn        200005
#define all(v)      v.begin(),v.end()
#define sz(x)       (int)x.size()
#define mod         1000000007
#define pqueue      priority_queue<int>
#define pdqueue     priority_queue< int,vector<int> ,greater< int >>

using namespace std;


//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

/*int power(int a,int n)
{
    if(n == 1)return a%mod;
    if(n == 0)return 1;
    if(n&1)return ((a%mod)*(power((a*a)%mod,n/2))%mod)%mod;
    return power((a*a)%mod,n/2)%mod;
}*/
//const int md = 998244353;



signed main()
{
    showoff;
    int n,k;
    cin >> n >> k;
    vector<int>v;
    for(int i=1;i<=n;i += 2){
        v.push_back(i);
    }
    if(sz(v) >= k)cout << "YES";
    else cout << "NO";
    
    return 0;
}
//*->for large size of matrix take int not long long if possible......

Measured memory_bytes: 256
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n = 10**6
a,b,c = inpl()
for i in range(1,n):
    if (a*i)%b == c:
        print('YES')
        break
else:
    print('NO')

Measured memory_bytes: 77280
import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      	String S = sc.next();
      	if(S.length() == 2){
        	System.out.println(S);
        }else{
        	StringBuffer sb = new StringBuffer(S);
          	System.out.println(sb.reverse());
        }
    }
}

Measured memory_bytes: 35676
from collections import Counter,defaultdict,deque
import sys
import bisect
import math
import itertools
import string
import queue
import copy
# import numpy as np
# import scipy
from itertools import permutations, combinations
from heapq import heappop, heappush
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7

def inp(): # n=1
    return int(input())
def inpm(): # x=1,y=2
    return map(int,input().split())
def inpl(): # a=[1,2,3,4,5,...,n]
    return list(map(int, input().split()))
def inpls(): # a=['1','2','3',...,'n']
    return list(input().split())
def inplm(n): # x=[] 複数行
    return list(int(input()) for _ in range(n))
def inpll(n): # [[1,1,1,1],[2,2,2,2],[3,3,3,3]]
    return sorted([list(map(int, input().split())) for _ in range(n)])


def main():
    d,g=inpm()
    p,c,t=[],[],[]
    ans=10**5
    for i in range(d):
        x,y=inpm()
        p.append(x)
        c.append(y)
        t.append(x*(i+1)*100+y)
    for num in range(1,d+1):
        for groop in combinations(range(d),num):
            total = 0
            member = 0
            for e in groop:
                total += t[e]
                member += p[e]
            if total < g:
                continue
            notgroup = []
            for i in range(d):
                if i not in groop:
                    notgroup.append(i)
            max_e=-1
            if len(notgroup)>0:
                max_e = max(notgroup)
            if max_e == d-1 or max_e==-1:
                pre_ans = 0
                for i in groop:
                    pre_ans += p[i]
                ans = min(ans,pre_ans)
            if max_e!=d-1:
                for way in range(max_e+1,d):
                    if total - c[way] - (way+1)*100 <g:
                        continue
                    diff = total - g - c[way] - (way+1)*100
                    pre_ans = member - 1 - min(p[way]-1,diff//((way+1)*100))
                    ans = min(ans,pre_ans)
    print(ans)

if __name__ == "__main__":
    main()

Measured memory_bytes: 45528
#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <utility>
#include <map>
#include <list>
#include <climits>
#include <set>
#include <deque>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <bitset>

// #define cerr if(false)cerr
#define watch(x) cerr << "> " << #x << ": " << x << "\n";

using namespace std;

template <typename T>
std::ostream &operator <<(std::ostream &out, vector<T> &v) {
	for (typename vector<T>::size_type i = 0; i < v.size(); ++i)
		out << v[i] << " ";
	out << "\n";
    return out;
}
template <typename T, typename N>
std::ostream &operator <<(std::ostream &out, vector<pair<T, N> > &v) {
	for (size_t i = 0; i < v.size(); ++i)
		out << "(" << v[i].first << ", " << v[i].second << ") ";
	out << "\n";
    return out;
}
template <typename T>
std::ostream &operator <<(std::ostream &out, vector<vector<T> > &v) {
	for (size_t i = 0; i < v.size(); ++i) {
		for (size_t j = 0; j < v[i].size(); ++j) {
			out << v[i][j] << " ";
		}
		out << "\n";
	}
   	return out;
}

int main() {

	std::ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	string s;
	cin >> s;

	int a = s[0] - '0';
	int b = s[1] - '0';
	int c = s[2] - '0';
	int d = s[3] - '0';

	char first, second, last;
	for (int i = 1; i <= 2; ++i) {
		for (int j = 1; j <= 2; ++j) {
			for (int k = 1; k <= 2; ++k) {
				int ans = a;
				if (i == 1) {
					ans += b;
					first = '+';
				} else {
					ans -= b;
					first = '-';
				}
				if (j == 1) {
					ans += c;
					second = '+';
				} else {
					ans -= c;
					second = '-';
				}
				if (k == 1) {
					ans += d;
					last = '+';
				} else {
					ans -= d;
					last = '-';
				}
				
				if (ans == 7) {
					cout << a << first << b << second << c << last << d << "=7\n";
					return 0;
				}
			}
		}
	}

	return 0;

}

Measured memory_bytes: 384
from collections import defaultdict as dd
N, M = map(int, input().split())
Hs = list(map(int, input().split()))
Es = dd(dict)
for _ in range(M):
    a, b = map(int, input().split())
    Es[a-1][b-1] = Es[b-1][a-1] = 1

ans = 0
for i in range(N):
    h = Hs[i]
    for j in Es[i].keys():
        if h <= Hs[j]:
            break
    else:
        ans += 1
print(ans)


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

int main(){
	ll a,b,q;
	cin>>a>>b>>q;
	ll S[a],T[b],X[q];
	vector<ll> s,t,x;
	s.push_back(-pow(10,18));
	t.push_back(-pow(10,18));
	for(ll i=0;i<a;i++){
		cin>>S[i];s.push_back(S[i]);
	}
	for(ll i=0;i<b;i++){
		cin>>T[i];t.push_back(T[i]);
	}
	for(ll i=0;i<q;i++){
		cin>>X[i];x.push_back(X[i]);
	}

	s.push_back(pow(10,18));
	t.push_back(pow(10,18));
	ll s_w,s_e,t_w,t_e;
	ll res = pow(10,18);
	//神社先
	for(ll i=0;i<q;i++){
		res = pow(10,18);
		s_e = lower_bound(s.begin(),s.end(),X[i])-s.begin();
		s_w = s_e - 1;
		//cout<<s_w<<endl;
		t_e = lower_bound(t.begin(),t.end(),X[i])-t.begin();
		t_w = t_e - 1;
		//cout<<t_w<<endl;
		for(int j=0;j<2;j++){
			t_w = t_e-1;
			for(int k=0;k<2;k++){
				res = min(abs(s[s_w]-X[i])+abs(s[s_w]-t[t_w]),res);//神社先
				res = min(abs(t[t_w]-X[i])+abs(t[t_w]-s[s_w]),res);//寺先
				//cout<<"i:"<<i<<" s_w:"<<s_w<<" t_w:"<<t_w<<"res:"<<res<<endl;
				t_w++;
			}
			s_w++;
		}
		cout<<res<<endl;
	}
}


Measured memory_bytes: 6132
a = [list(input()) for i in range(3)]
p=0
for i in range(400):
    if len(a[0])==0 and p==0:
        print("A")
        exit()
    elif len(a[1])==0 and p==1:
        print("B")
        exit()
    elif len(a[2])==0 and p==2:
        print("C")
        exit()
    p=a[p].pop(0)
    if p=="a":
        p=0
    elif p=="b":
        p=1
    else :
        p=2

Measured memory_bytes: 3188
#include<stdio.h>
int main(void)
{
	 int x,y,temp,cnt;
	scanf("%d %d",&x,&y);
	while(x!=0 && y!=0){
		cnt=0;
		if(y>=x){
			temp=x;
			x=y;
			y=temp;
		}
		/*printf("%d %d",x,y);*/
		while(y!=0){
			cnt++;
			x=x%y;
			temp=x;
			x=y;
			y=temp;
		}
		printf("%d %d\n",x,cnt);
		scanf("%d %d",&x,&y);
	}
	return 0;
}

Measured memory_bytes: 600
N = int(input())
A = list(map(int,input().split()))

dp = [[0] * 2 for _ in range(N+1)]#dp[i][0] = A1からAiの最大値(Ai+1は反転なし)

dp[0][0] = 0
dp[0][1] = -float("inf")

for i in range(N):
    dp[i+1][0] = max(dp[i][0] + A[i], dp[i][1] - A[i])
    dp[i+1][1] = max(dp[i][0] - A[i], dp[i][1] + A[i])
print(dp[N][0])

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

#define INF 1<<30
#define LINF 1ll<<60ll
#define MOD 1000000007
#define pb(a) push_back(a)

#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) _repi(i,0,n)
#define _repi(i,a,b) for(int i=a, i##_len=(b); i<i##_len; ++i)
#define REP(...) _overload3(__VA_ARGS__,_repi,_rep,)(__VA_ARGS__)

#define REPR(i, n) for(int i = n;i >= 0;--i)
#define REPARR(i, v) for(int i = 0;i < sz(v);++i)

#define all(vec) (vec.begin()),(vec.end())
#define sz(x) ((int)(x).size())
#define bit(n) (1ll<<(n))

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

#define YES(n) cout<<((n)?"YES":"NO")<<endl
#define Yes(n) cout<<((n)?"Yes":"No")<<endl
#define yes(n) cout<<((n)?"yes":"no")<<endl
#define poss(n) cout<<((n)?"possible":"impossible")<<endl
#define Poss(n) cout<<((n)?"Possible":"Impossible")<<endl


int main(){
    ll x,ans;
    cin>>x;
    ans=(x/11)*2;
    x%=11;
    if(x){
        if(x<=6)ans++;
        else ans+=2;
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
n=int(input())
m=0
l=0
for i in range(n):
    a=[]
    x,y=map(str,input().split())
    a.append(x)
    a.append(y)
    b=sorted(a)
    if x==y:
        m+=1
        l+=1
    else:
        if x==b[1]:
            m+=3
        elif y==b[1]:
            l+=3
print(m,l)


Measured memory_bytes: 5600
using System;
using System.Collections.Generic;

namespace AtCoder{
    public static class AtCoder{
        private static int[,,] gcd = new int[201, 201, 201];
        public static void Main(){
            int k = int.Parse(Console.ReadLine());
            long ans = 0;
            for(int a = 1; a<=k;a++){
                for(int b = 1; b<=k; b++){
                    for(int c = 1; c<= k; c++){
                        var l = new List<int>(){a, b, c};
                        l.Sort();
                        int g = gcd[l[0], l[1], l[2]];
                        if(g == 0){g = get_gcd(l[0], l[1], l[2]);}
                        ans += g;
                    }
                }
            }
            Console.WriteLine(ans);
        }

        private static int get_gcd(int a, int b, int c){
            // a, bの最大公約数
            int a_b = 1;
            while(true){
                var mod = b % a;
                if(mod == 0){
                    a_b = a;
                    break;
                }
                b = a;
                a = mod;
            }

            // a_b, cの最大公約数
            int ans = 1;
            while(true){
                var mod = c % a_b;
                if(mod == 0){
                    ans = a_b;
                    break;
                }
                c = a_b;
                a_b = mod;
            }
            gcd[a, b, c] = ans;
            return ans;
        }
    }
}

Measured memory_bytes: 25612
#include <bits/stdc++.h>
using namespace std;
#define int lint
typedef long long lint;
typedef pair<int,int> P;
const int    INF=(int)1e9;
const int    MOD=(int)1e9+7;
const double EPS=(double)1e-10;
struct Accelerate_Cin{
    Accelerate_Cin(){
        cin.tie(0); ios::sync_with_stdio(0);cout<<fixed<<setprecision(20);
    };
};

bool calc(int n,int t){
  for(int a=t*t;a<=n;a*=t){
    if(a==n)return true;
  }
  return false;
}

signed main(){
  int X;
  cin>>X;

  if(X==1){
    cout<<"1"<<"\n";
    return 0;
  }

  for(int x=X;1<=x;x--){
    for(int t=2;t<=31;t++){
      if(calc(x,t)){
        cout<<x<<"\n";
        return 0;
      }
    }
  }

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
const int inf = 1e9 + 7;
const ll INF = 1e18;
#define abs(x) (x >= 0 ? x : -(x))
#define lb(v, x) (int)(lower_bound(all(v), x) - v.begin())
#define ub(v, x) (int)(upper_bound(all(v), x) - v.begin())
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }
template<typename T> T pow(T a, int b) { return b ? pow(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
const int mod = 1000000007;
ll modpow(ll a, int b) { return b ? modpow(a * a % mod, b / 2) * (b % 2 ? a : 1) % mod : 1; }
template<class T> ostream& operator<<(ostream& os, const vector<T>& vec) { for (auto &vi: vec) os << vi << " "; return os; }

void solve();

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

    int T;
    // cin >> T;
    T = 1;

    while (T--) {
        solve();
    }
}

void solve() {
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i, n) cin >> a[i];
  int now = 1;
  rep(i, n) {
    if (a[i] == now) {
      now++;
    }
  }
  now--;
  cout << (now == 0 ? -1 : n - now) << endl;
  /*
  vector<int> ans;
  ans.eb(a[0]);
  rep3(i, 1, n) {
    int it = ub(ans, a[i]);
    if (it == sz(ans)) ans.eb(a[i]);
    else ans[it] = a[i];
  }
  cout << n - sz(ans) << endl;
  */
}


Measured memory_bytes: 1024
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> P;
typedef long long ll;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

ll gcd(ll a, ll b) {
    ll tmp;
    if(a<b){
        tmp = a;
        a = b;
        b = tmp;
    }

    ll r = a % b;
    while(r!=0){
        a = b;
        b = r;
        r = a % b;
    }
    return b;
}

int main() {
    int N;
    ll a[3000];
    cin >> N;
    REP(i, N) cin >> a[i];
    ll ans = 0;
    REP(i, N) ans += a[i] - 1;
    // ll m = a[0] * a[1] / gcd(a[0], a[1]);
    // ll ans = 0;
    // for(int i = 2; i < N; i++) {
    //     m = m * a[i] / gcd(m, a[i]);
    // }
    //
    // for(int i = 0; i < N; i++) {
    //     ans += (m - 1) % a[i];
    // }

    cout << ans<< endl;


    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(void){
    int i,j,num,count[26];
    char a[1200],ch;
     
    i = 0;
    while(scanf("%c", &ch)!=EOF){
        a[i]=ch;
        i++;
    }
  
    for(j=0;j<26;j++) count[j]=0;
    
  
    for(j=0;j<i;j++){
  
        if(a[j]>=65 && a[j]<=90) a[j]+=32;
        if('a'<=a[j] && a[j]<='z'){
            num= a[j]-'a';
            count[num]++;
        }
    }
  
    for(j=0;j<26;j++) printf("%c : %d\n",j+97,count[j]);
     
    return 0;
}


Measured memory_bytes: 2052
#include<bits/stdc++.h>
#define rep(i,x,y) for (int i=(x);i<=(y);i++)
#define ll long long
#define pii pair<int,int>
#define fi first
#define se second
using namespace std;
const int N=2e5+5;
int n,x,y,vis[N],flag; pii a[N]; ll s1,s2,s3;
int main(){
	scanf("%d",&n);
	rep (i,1,n){
		scanf("%d%d",&x,&y);
		a[2*i-1]=pii(x,i),a[2*i]=pii(y,i);
		s1+=x,s2+=y;
	}
	sort(a+1,a+1+2*n);
	rep (i,1,n){
		s3+=a[i].fi;
		if (vis[a[i].se]) flag=1;
		vis[a[i].se]=1;
	}
	if (!flag)
		if (a[n].se==a[n+1].se) s3+=min(a[n+2].fi-a[n].fi,a[n+1].fi-a[n-1].fi);
		else s3+=a[n+1].fi-a[n].fi;
	printf("%lld\n",min(s1,min(s2,s3)));
	return 0;
}

Measured memory_bytes: 2176
//#include<bits/stdc++.h>
#include<iostream>
#include<cmath>
#include<cstdio>
#include<vector>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<utility>
#include<algorithm>
#include<cstring>
#include<sstream>
#include <iomanip>

using namespace std;

typedef long long ll ;
typedef double db;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef vector< pair<int,int> > vii;
const double pi = 2*acos(0) ;

#define pf		  	printf
#define sf			  scanf
#define pb(a)         push_back(a)
#define mp			make_pair
#define fi			 first
#define se			 second
#define for0(i,n)        for(int i=0;i<n;i++)
#define for1(i,n)        for(int i=1;i<=n;i++)
#define forab(i,a,b)       for(int i=a;i<=b;i++)
#define lcm(a, b)     ((a)*((b)/gcd(a,b)))
#define sq(a)		   (a)*(a)
#define nw				"\n"
#define abs(x)		fabs(x)
#define pcase(z,x)    cout<<"Case "<<z<<": "<<x<<"\n"

int main()
{
	ll r,d,x;
	cin>>r>>d>>x;
	for1(i,10){
		x = r*x - d;
		cout<<x<<nw;
		}
	return 0;
}

Measured memory_bytes: 256
from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque,Counter,defaultdict
from operator import mul
import copy
# ! /usr/bin/env python
# -*- coding: utf-8 -*-
import heapq
sys.setrecursionlimit(10**6)
INF =  float("inf")
import bisect
import statistics
# mod = 10**9+7
mod = 998244353

N ,S = list(map(int, input().split()))
A = [0] + list(map(int, input().split()))

dp = [[0 for j in range(S+1)] for i in range(N+1)]
dp[0][0] = 1

for i in range(1,N+1):
    for y in range(S+1):
        dp[i][y] = (dp[i][y] + dp[i-1][y] * 2) % mod
        if y - A[i] >= 0:
            dp[i][y] = (dp[i][y] + dp[i-1][y-A[i]]) % mod

print(dp[N][S] % mod)


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

int main(void){

    int a, b;
    char op;
    
    while(std::cin >> a >> op >> b, op != '?') {
        switch(op) {
            case '+':
                std::cout << a + b << std::endl;
                break;
            case '-':
                std::cout << a - b << std::endl;
                break;
            case '*':
                std::cout << a * b << std::endl;
                break;
            case '/':
                std::cout << a / b << std::endl;
                break;
        }
    }
    
    return 0;
    
}

Measured memory_bytes: 3092
def main():
    n,m = map(int,input().split())
    job =[[] for _ in range(m)]
    for i in range(n):
        a,b=map(int,input().split())
        if a-1 < m:
            job[a-1].append(-b) # b:asc, -b:desc
    
    res = 0
    q = []
    from heapq import heappop, heappush
    for i in range(m):
        for j in job[i]:
            heappush(q, j)
        if len(q) > 0:
            res += heappop(q) * -1 # -b -> b
    print(res)

if __name__ == '__main__':
    main()



Measured memory_bytes: 68512
/* Simplicity and Goodness */
 
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>

// using namespace __gnu_pbds;
using namespace std;
// typedef tree<int, null_type, less<int>, rb_tree_tag,
//             tree_order_statistics_node_update> indexed_set;

void my_dbg() { cout << endl; }
template<typename Arg, typename... Args> void my_dbg(Arg A, Args... B) 
{ cout << ' ' << A; my_dbg(B...); }
#define dbg(...)  cout << "(" << #__VA_ARGS__ << "):", my_dbg(__VA_ARGS__)

#define scn(n) scanf("%d", &n)
#define lscn(n) scanf("%lld", &n)
#define pri(n) printf("%d ", (int)(n))
#define prin(n) printf("%d\n", (int)(n))
#define lpri(n) printf("%lld ", n)
#define lprin(n) printf("%lld\n", n)
#define rep(i,a,b) for(int i=(int)(a); i<(int)(b); i++)
#define pb push_back
#define mp make_pair
#define F first
#define S second

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;

const int inf = INT_MAX;
const int ninf = INT_MIN;
const int mod = 1e9+7;
const int N = 2e5+2;


void solve()
{   
    char c;
    cin >> c;

    if(c >= 'A' and c <= 'Z')
        puts("A");
    else
        puts("a");
}

int main()
{
    int t = 1;
    // scn(t);

    while(t --) {
        solve();
    }
    return 0;
}

Measured memory_bytes: 3592
from bisect import bisect_left, bisect_right

n, m, Q = map(int, input().split())
lr = [tuple(map(lambda x: int(x)-1, input().split())) for _ in range(m)]
lr.sort(reverse=True)

fin = []
offset = 0
ans = [[0] * n for _ in range(n)]

for i in range(n)[::-1]:
    while i == lr[offset][0]:
        fin.append(lr[offset][1])
        offset += 1
        if offset == m: break
    fin.sort()
    for j in range(i, n):
        ans[i][j] = bisect_right(fin, j)

for _ in range(Q):
    p, q = map(int, input().split())
    p -= 1; q -= 1
    print(ans[p][q])


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

int main(void) {
	int n;
	double t, a;
	cin >> n >> t >> a;
	double h[n];

	double DIF = 10000;
	int ans;
	for(int i=0;i<n;i++) {
		cin >> h[i];
		double dif = abs(a-t+0.006*h[i]);
		if(dif < DIF) {
			ans = i;
			DIF = dif;
		}
	}

	cout << ans + 1 << endl;

}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();

        int[] d = new int[n];
        for (int i = 0; i < n; i++) {
            d[i] = in.nextInt();
        }

        int total = 0;
        for (int i = 0; i < n - 1; i++) {
            for (int j = i + 1; j < n; j++) {
                total += d[i] * d[j];
            }
        }

        System.out.println(total);
    }
}


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


#define ll long long int
#define ld long double
#define mod 1000000007
#define big 1e18+100000000
#define small -big
#define pb push_back



template <typename T>

void prarr(T a)
{
     cerr << "[ ";
     
     for(auto i : a){
         cerr << i << " ";
     }
     
     cerr << "]" << endl;
}


#define trace(...) _er(#__VA_ARGS__, __VA_ARGS__)

template <typename Arg1>

void _er(const char* name, Arg1&& arg1){
	cerr << "[" << name << " : " << arg1 << "]" << endl;
}

template <typename Arg1, typename... Args>

void _er(const char* names, Arg1&& arg1, Args&&... args){
    
	const char* comma = strchr(names + 1, ',');
	cerr << "[" ; cerr.write(names, comma - names) << " : " << arg1 << "] ";
	_er(comma+2, args...);
}



ll times[1000005] = {0};

void doit() {
        
        for(ll i = 1; i <= 1000000; i++) {
                for(ll j = i; j <= 1000000; j += i) {
                        times[j]++;
                }
        }
}

void solve() {
            
           ll n;
           cin >> n;
           
           ll sum = 0LL;
           for(ll i = 1; i <= (n - 1); i++) {
                    sum += times[i];
           }
           cout << sum << endl;
            
}


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    doit();

    int t=1;
   // cin >> t;

    for(int i = 1; i <= t; i++) {  
   
         solve();
    }


    return 0;
        
}


Measured memory_bytes: 11452
#include <iostream>
#include <vector>
#include <iomanip>
#include <cmath>
using namespace  std;

const double PI = 3.141592;

struct StPnt
{
  double m_nx;
  double m_ny;

  StPnt() :
    m_nx(0), m_ny(0)
  { }
  StPnt(double nx, double ny) :
    m_nx(nx), m_ny(ny)
  { }

  ~StPnt() { }
};

void fnInput(int &rnRcSiz)
{
  cin >> rnRcSiz;
}

void fnKochCrv( const StPnt &cnroPnt1, const StPnt &cnroPnt2, vector<StPnt> &rvoRtnPnt)
{
  rvoRtnPnt[0] = cnroPnt1;
  rvoRtnPnt[1].m_nx = (2 * cnroPnt1.m_nx + cnroPnt2.m_nx) / 3;
  rvoRtnPnt[1].m_ny = (2 * cnroPnt1.m_ny + cnroPnt2.m_ny) / 3;
  rvoRtnPnt[3].m_nx = (cnroPnt1.m_nx + 2 * cnroPnt2.m_nx) / 3;
  rvoRtnPnt[3].m_ny = (cnroPnt1.m_ny + 2 * cnroPnt2.m_ny) / 3;

  double nRad = 60 * PI / 180; 
  rvoRtnPnt[2].m_nx = (rvoRtnPnt[3].m_nx - rvoRtnPnt[1].m_nx) * cos(nRad) - (rvoRtnPnt[3].m_ny - rvoRtnPnt[1].m_ny) * sin(nRad);
  rvoRtnPnt[2].m_nx += rvoRtnPnt[1].m_nx;
  rvoRtnPnt[2].m_ny = (rvoRtnPnt[3].m_nx - rvoRtnPnt[1].m_nx) * sin(nRad) + (rvoRtnPnt[3].m_ny - rvoRtnPnt[1].m_ny) * cos(nRad);
  rvoRtnPnt[2].m_ny += rvoRtnPnt[1].m_ny;

  rvoRtnPnt[4] = cnroPnt2;
}

void fnKochCtl(int nRcSiz, vector<vector<StPnt>> &rvvoPnt)
{
  StPnt oPntB(0.0, 0.0);
  StPnt oPntE(100.0, 0.0);

  rvvoPnt.resize(7);
  rvvoPnt[0].clear();
  rvvoPnt[0].push_back(oPntB);
  rvvoPnt[0].push_back(oPntE);

  for (int nRc = 0; nRc < nRcSiz; nRc++)
  {
    rvvoPnt[nRc + 1].clear();
    rvvoPnt[nRc + 1].push_back(oPntB);
    for (int i = 0; i < rvvoPnt[nRc].size() - 1; i++)
    {
      StPnt oPnt1 = rvvoPnt[nRc][i];
      StPnt oPnt2 = rvvoPnt[nRc][i + 1];
      vector<StPnt> voRtnPnt(5);

      fnKochCrv(oPnt1, oPnt2, voRtnPnt);
      for (int j = 1; j < 5; j++)
        rvvoPnt[nRc + 1].push_back(voRtnPnt[j]);
    }
  }
}

void fnResult(int nRcSiz, const vector<vector<StPnt>> &cnrvvoPnt)
{
  for (int i = 0; i < cnrvvoPnt[nRcSiz].size(); i++)
    cout << cnrvvoPnt[nRcSiz][i].m_nx << " " << cnrvvoPnt[nRcSiz][i].m_ny << endl;
}

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(8);

  int nRcSiz;
  vector<vector<StPnt>> vvoPnt;

  fnInput(nRcSiz);
  fnKochCtl(nRcSiz, vvoPnt);

  fnResult(nRcSiz, vvoPnt);

  return 0;
}

Measured memory_bytes: 1392
module Main where

import Data.Functor

getInts :: IO [Int]
getInts = map read . words <$> getLine

main :: IO ()
main = do
  { [w,h,x,y,r] <- getInts
  ; putStrLn (check' (w,h,x,y,r))
  }

check :: (Int,Int,Int,Int,Int) -> String
check (w,h,x,y,r)
  | x < r     = "No"
  | y < r     = "No"
  | x > w-r   = "No"
  | y > h-r   = "No"
  | otherwise = "Yes"

check' :: (Int,Int,Int,Int,Int) -> String
check' (w,h,x,y,r)
  | r <= x && x <= w - r && r <= y && y <= h - r = "Yes"
  | otherwise                                    = "No"

Measured memory_bytes: 3680
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ldb = long double;
using pa = pair < ll, ll >;
using vec = vector < ll >;
#define pb push_back
#define po pop_back
#define mp make_pair
#define mt make_tuple
#define F  first
#define S  second
#define f(i,x,n) for(ll i=x;i<n;i++) 
#define unique_sort(x) sort(all(x)), x.resize(distance(x.begin(), unique(all(x))))
#define all(c) c.begin(),c.end()
#define str string
#define edl "\n"
#define add insert
#define cot continue
#define fast() ios_base::sync_with_stdio(false);cin.tie(NULL)
const int MOD = 1e9 + 7, INF = INT_MAX, N = 1e5 + 10;
const double PI = acos(-1);
const ll LINF = LLONG_MAX;

// ll le(string s1,string s2,ll m,ll n)
// {
//  if(m==0||n==0)
//      return 0;
//  if(s1[m-1]==s2[n-1])
//  {
//      return 1+le(s1,s2,m-1,n-1);
//  }
//  else
//      return max(le(s1,s2,m-1,n),le(s1,s2,m,n-1));
// }



int main() 
{

 fast();
  

  str s1,s2;
  
  cin>>s1>>s2;
  ll m=s1.size(),n=s2.size();
  ll dp[m+1][n+1];
  f(i,0,m+1)
  {
    f(j,0,n+1)
    {
        if(i==0||j==0)
            dp[i][j]=0;
        
        else if(s1[i-1]==s2[j-1])
            dp[i][j]=1+dp[i-1][j-1];
        else
            dp[i][j]=max(dp[i-1][j],dp[i][j-1]);

            
    }
  }  

 
   char lcs[dp[m][n]]; 
   
   ll index=dp[m][n];
  
   int i = m, j = n; 
   while (i > 0 && j > 0) 
   { 
   
      if (s1[i-1] == s2[j-1]) 
      { 
          lcs[index-1] = s1[i-1]; 
          i--; j--; index--;     
      } 
  
      else if (dp[i-1][j] > dp[i][j-1]) 
         i--; 
      else
         j--; 
   } 
  lcs[dp[m][n]]='\0';

   cout<<lcs;


  


    




    cerr << "Time taken: " << int((clock() * 1000.) / CLOCKS_PER_SEC) << "ms\n";
    return 0;
}
 

Measured memory_bytes: 70656
#include <iostream>
#include <stdio.h>
using namespace std;

int main(){
  int a,b,c,d,r;
  double f;
  cin >> a >> b ;
  d = a / b;
  r = a % b;
  f = ((double) a) / b;
  cout << d << ' ' << r <<  ' ' ;
  printf("%.8lf\n", f);
  return 0;
}



Measured memory_bytes: 3204
#include<bits/stdc++.h>
#define int long long
#define ff first
#define ss second
#define ad pair<int,pair<int,int>>  
using namespace std;	

vector<string> a;
int h,wi,k,x1,y11,x2,y2;
bool isValid(int x,int y)
{
	if(x<h && x>=0 && y<wi && y>=0)
			return true;
	return false;
}
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	// #ifndef ONLINE_JUDGE 
	// 	freopen("_input.txt", "r", stdin); 
	// freopen("_output.txt", "w", stdout); 
	// #endif 
	cin>>h>>wi>>k;
	cin>>x1>>y11>>x2>>y2;
	//cout<<h<<" "<<wi<<"\n";
	a.clear();
	x1--,y11--,x2--,y2--;
	a.resize(h);
	int w[h][wi];
	for(int i=0;i<h;i++)
		for(int j=0;j<wi;j++)
			w[i][j]=LLONG_MAX;
	for(int i=0;i<h;i++)
		cin>>a[i];
	priority_queue<ad,vector<ad>,greater<ad>> pq;
	pq.push({0,{x1,y11}});
	w[x1][y11]=0;
	while(!pq.empty())
	{
		ad pp=pq.top();
		pq.pop();

		int x=pp.ss.ff,y=pp.ss.ss,dist=pp.ff;
		//cout<<x<<" "<<y<<"\n";
		if(x==x2 && y==y2)
		{
			cout<<dist<<"\n";
			return 0;
		}
		for(int i=0;i<4;i++)
		{
			for(int j=1;j<=k;j++)
			{
				int new_x=x+dx[i]*j,new_y=y+dy[i]*j;
				bool f=isValid(new_x,new_y);
				//cout<<new_x<<" "<<new_y<<" "<<f<<"\n";
				if(f && a[new_x][new_y]=='@')
					break;
				if(f)
				{
					if(dist+1<w[new_x][new_y])
					{
						w[new_x][new_y]=dist+1;
						pq.push({w[new_x][new_y],{new_x,new_y}});
					}
					else if(dist+1>w[new_x][new_y])
						break;
				}
				else
					break;
			}
		}
	}
	cout<<"-1\n";
}

Measured memory_bytes: 15468
import sys
from collections import deque

cin = sys.stdin
# cin = open("in.txt", "r")

def line2N():
    return map(int, cin.readline().split())


N, = line2N()
adj = [[] for i in range(N+1)]
for i in range(N-1):
    u, v = line2N()
    adj[u].append(v)
    adj[v].append(u)

color = [0]*(N+1)
h_cnt = 1
t_cnt = 1
dq_head = deque([1])
color[1] = 1
dq_tail = deque([N])
color[N] = 1
for step in range(N):
    if step % 2==0:
        if not dq_head:
            t_cnt = N - h_cnt
            break
        dq_head_n = deque()
        for u in dq_head:
            for v in adj[u]:
                if color[v]==0:
                    color[v] = 1
                    dq_head_n.append(v)
                    h_cnt += 1
        dq_head = dq_head_n

    else:
        if not dq_tail:
            h_cnt = N - t_cnt
            break
        dq_tail_n = deque()
        for u in dq_tail:
            for v in adj[u]:
                if color[v]==0:
                    color[v] = 2
                    dq_tail_n.append(v)
                    t_cnt += 1
        dq_tail = dq_tail_n

# print(h_cnt, t_cnt)
if h_cnt > t_cnt:
    print("Fennec")
else:
    print("Snuke")



Measured memory_bytes: 22268
#include "bits/stdc++.h"

using namespace std;

//typedef pair<int, int> P;
#define int long long
#define ll long long
#define mod 1000000007
#define INF (1LL<<60)


signed main(){

	string s, t;
	cin >> s >> t;

	for (int i = 0; i < s.length(); i++){

		rotate(s.begin(), s.begin() + 1, s.end());
		if (s == t){
			cout << "Yes" << endl;
			return 0;
		}
	}
	cout << "No" << endl;

	return 0;
}


Measured memory_bytes: 256
// clang-format off
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <numeric>
#include <array>
#include <cmath>
#include <memory>
#include <map>
using namespace std;
#define DEB(variable) cout << #variable << '=' << variable << endl

#define FOR(LoopVariable,numberOFbegin,numberOFend) for (long long int LoopVariable = (numberOFbegin); (LoopVariable) < (numberOFend); (LoopVariable)++)
#define DEFOR(LoopVariable,numberOFbegin,numberOFend) for (long long int LoopVariable = (numberOFbegin)-1; (LoopVariable) >= (numberOFend); (LoopVariable)--)
#define REP(LoopVariable,numberOFend) for(long long int LoopVariable = 0;(LoopVariable)<(numberOFend);LoopVariable++)

using llint = long long int;

constexpr long long int linf = numeric_limits<long long int>::max()-5;
constexpr long long int inf= numeric_limits<int>::max()-5;
constexpr long long int mod = 1000000007;

// clang-format on
struct Point {
    int y, x;
};
int kyori(Point a, Point b) {
    return abs(a.x - b.x) + abs(a.y - b.y);
}
int main() {

    int h, w, d;
    cin >> h >> w >> d;

    vector< Point> mp(h*w+1);
    int tmp;
    REP(i, h) {
        REP(j, w) {
            scanf("%d", &tmp);
            mp[tmp] = {(int)i, (int)j};
        }
    }
    vector<vector<int>> grid(d, vector<int>((h * w + 3 * d - 1) / d, 0ll));
    FOR(i,1,h*w+1) {
        grid[i % d][i / d] = kyori(mp[i], mp[i + d]);

        if(i == h * w - d) {
            break;
        }
    }
    mp.clear();
    vector<vector<int>> sum(d, vector<int>((h * w + 4 * d - 1) / d, 0ll));
    REP(i, d) {
        REP(j, (h * w + 2 * d - 1) / d) {
            sum[i][j + 1] = sum[i][j] + grid[i][j];
        }  
    }
    grid.clear();
    int q;
    cin >> q;
    int a, b;
    REP(i,q){
        scanf("%d %d", &a,&b);
        printf("%d\n", sum[b % d][b / d] - sum[a % d][a / d] );
    //    cout << "unko" << endl;
    }
    return 0;
}


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

int N;
vector<pair<int, int>> q(100001);
vector<vector<int>> tree(100001);
vector<set<int>> used(100001);

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

  cin >> N;
  for (int i = 0; i < N - 1; ++i) {
    int a, b;
    cin >> a >> b;
    pair<int, int> p = make_pair(a, b);
    q.at(i) = p;
    tree.at(a).push_back(b);
  }

  int max = 0;
  map<pair<int, int>, int> m;
  for (int i = 1; i <= N; ++i) {
    for (int j = 0; j < tree.at(i).size(); ++j) {
      int a = i;
      int b = tree.at(i).at(j);

      int t = 1;
      if (max == used.at(a).size() || max == used.at(b).size()) {
        t = max + 1;
      }
      while (true) {
        if (!used.at(a).count(t) && !used.at(b).count(t)) {
          used.at(a).insert(t);
          used.at(b).insert(t);
          if (used.at(a).size() > max) {
            max = used.at(a).size();
          }
          if (used.at(b).size() > max) {
            max = used.at(b).size();
          }
          break;
        }
        ++t;
      }
      m[make_pair(a, b)] = t;
    }
  }

  cout << max << endl;
  for (int i = 0; i < N - 1; ++i) {
    cout << m.at(q.at(i)) << endl;
  }
}


Measured memory_bytes: 25472
using System;
using System.Collections.Generic;
class Program
{
    static void Main(string[] args)
    {
        string[] input = Console.ReadLine().Split(' ');
        int X = int.Parse(input[0]);
        int A = int.Parse(input[1]);

        if(X < A) {
            Console.WriteLine("0");
        } else {
            Console.WriteLine("10");
        }        
    }
}

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


using namespace std;

int main(){

    int a,b;
    string X,Y;

    cin >>X >>Y;
    // a=(int)(X-'0');
    // b=(int)(Y-'0');

if(X=="A"){a=10;}
if(X=="B"){a=11;}
if(X=="C"){a=12;}
if(X=="E"){a=14;}
if(X=="D"){a=13;}
if(X=="F"){a=15;}
if(Y=="A"){b=10;}
if(Y=="B"){b=11;}
if(Y=="C"){b=12;}
if(Y=="D"){b=13;}
if(Y=="E"){b=14;}
if(Y=="F"){b=15;}

    if(a<b){cout<<"<"<<endl;}
    if(a==b){cout<<"="<<endl;}    
    if(a>b){cout<<">"<<endl;}
}

Measured memory_bytes: 256