akhauriyash/Code-Regression huggingface dataset:
/*

  _|_|                              _|  _|    _|
_|    _|  _|  _|_|  _|_|_|_|        _|  _|  _|
_|    _|  _|_|          _|          _|  _|_|
_|    _|  _|          _|      _|    _|  _|  _|
  _|_|    _|        _|_|_|_|    _|_|    _|    _|

*/
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<vector>
#include<queue>
#include<set>
//#define ls (rt<<1)
//#define rs (rt<<1|1)
#define vi vector<int>
#define pb push_back
#define mk make_pair
#define pii pair<int,int>
#define rep(i,a,b) for(int i=(a),i##end=(b);i<=i##end;i++)
#define fi first
#define se second
typedef long long ll;
const int maxn=4e5+1000;
const int inf=1e9+100;
using namespace std;
vi E[maxn],inset[maxn];
int s=2e5+1,t=2e5+2,cnt=1,head[maxn];
struct gg{
    int u,v,w,next;
}side[maxn*2];
void ins(int u,int v,int w) {
    side[++cnt]=(gg){u,v,w,head[u]};head[u]=cnt;
    side[++cnt]=(gg){v,u,0,head[v]};head[v]=cnt;
}
int rk[maxn],cur[maxn];
queue<int>q;
bool bfs() {
    memset(rk,0,sizeof(rk));rk[s]=1;
    while(!q.empty())q.pop();q.push(s);
    while(!q.empty()) {
        int u=q.front();q.pop();
        for(int i=head[u];i;i=side[i].next) {
            int v=side[i].v;if(rk[v]||!side[i].w)continue;
            rk[v]=rk[u]+1;
            q.push(v);
        }
    }
    if(!rk[t])return 0;
    return 1;
}
int dfs(int u,int flow) {
    if(u==t||!flow)return flow;
    int tot=0;
    for(int &i=cur[u];i;i=side[i].next) {
        int v=side[i].v;//cout<<v<<' '<<rk[v]<<endl;
        if(rk[v]!=rk[u]+1||!side[i].w)continue;
        int sent=dfs(v,min(flow,side[i].w));
        side[i].w-=sent;side[i^1].w+=sent;
        flow-=sent;tot+=sent;
    }
    return tot;
}
int dinic(){
    int maxflow=0;
    while(bfs()){
        memcpy(cur,head,sizeof(cur));
        maxflow+=dfs(s,inf);
    }
    return maxflow;
}
int match[maxn];//match[set_id]=match_point_id
bool inq[maxn];
pii ans[maxn];
int main(){
    //ios::sync_with_stdio(0);
    int n;scanf("%d",&n);//cin>>n;
    rep(i,1,n-1) {
        int c;scanf("%d",&c);//cin>>c;
        rep(j,1,c) {
            int u;scanf("%d",&u);//cin>>u;
            E[i].pb(u);inset[u].pb(i);
            ins(u,n+i,1);
        }
    }
    rep(i,2,n)ins(s,i,1);
    rep(i,1,n-1)ins(n+i,t,1);
    int flow=dinic();
    if(flow!=n-1) {
        printf("-1\n");//cout<<"-1";
        return 0;
    }
    rep(i,n+1,n+n-1) {
        for(int j=head[i];j;j=side[j].next) {
            int v=side[j].v;
            if(v<=n&&side[j].w) {
                match[i-n]=v;break;
            }
        }
    }
    while(!q.empty())q.pop();
    int tot=1;q.push(1);inq[1]=1;
    while(!q.empty()) {
        int u=q.front();q.pop();
        for(int i=0;i<inset[u].size();i++) {
            int setid=inset[u][i],set_match=match[setid];
            if(!inq[set_match]) {
                inq[set_match]=1;ans[setid]=mk(u,set_match);
                q.push(set_match);tot++;
            }
        }
    }
    if(tot!=n) {
        printf("-1\n");//cout<<"-1";
        return 0;
    }
    for(int i=1;i<n;i++) {
        printf("%d %d\n",ans[i].fi,ans[i].se);
        //cout<<ans[i].fi<<' '<<ans[i].se<<endl;
    }
    return 0;
}


Measured memory_bytes: 49056
#include<bits/stdc++.h>
using namespace std;
long long n,a,mx1=0,mx2=0;
map<long long,long long> mp;
int main(){
	scanf("%lld",&n);
	for(int i=1;i<=n;i++){
		scanf("%lld",&a);
		if(mp[a] == 0){
			mp[a] = 1;
		}
		else{
			mp[a] = 0;
			if(a > mx1){
				mx2 = mx1;
				mx1 = a;
			}
			else if(a > mx2){
				mx2 = a;
			}
		}
	}
	printf("%lld",mx1*mx2);
}

Measured memory_bytes: 6528
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int t, a=0, w=0, b=0, r=0;
	cin>>t;
	string s;
	while(t--){
	cin>>s;
	if(s=="AC")
	a++;
	else if(s=="WA")
	w++;
	else if(s=="TLE")
	b++;
	else 
	r++;
}
cout<<"AC"<<" "<<"x"<<" "<<a<<"\n";
cout<<"WA"<<" "<<"x"<<" "<<w<<"\n";
cout<<"TLE"<<" "<<"x"<<" "<<b<<"\n";
cout<<"RE"<<" "<<"x"<<" "<<r<<"\n";
	
}

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

using namespace std;
typedef long long ll;
#define debug(x) cerr << x << "\n"
#define all(x) (x).begin(),(x).end()
#define exist(s, e)((s).find(e) != (s).end())

template<typename T>
bool finditem(std::vector<T> v, T c) {
    auto ite = std::find(v.begin(), v.end(), c);
    size_t index = std::distance(v.begin(), ite);
    return index != v.size();
}


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    string s;
    cin >> s;
    vector<char> v;
    for (char& c: s) {
        if (finditem<char>(v, c)) {
            cout << "no\n";
            return 0;
        }
        else v.push_back(c);
    }
    
    cout << "yes\n";

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <random>
#include <string>
#include <cmath>
#include <sstream>
#include <istream>
#include <iomanip>
#include <typeinfo>
#include <stack>

using namespace std;
typedef long long ll;

int main(){
    ll N;
    cin >> N;
    string s;
    cin >> s;
    vector<ll > vec;
    //一番左端が0なら調整を加える
    bool start = 0;
    bool swi;
    if(s.substr(0, 1) == "#"){
        swi = 0;
    }else{
        swi = 1;
        start = 1;
    }
    if(swi == 0){
        vec.push_back(0);
    }
    //０または１が連続するところをまとめる処理
    ll f = 0;
    ll cont = 1;
    ll white = 0;
    for(ll i = 0; i < s.length()-1; i++){
        if(swi == 0){
            if(s.substr(i, 1) == "#" && s.substr(i+1, 1) == "."){
                vec.push_back(cont);
                swi = 1;
                cont = 1;
            }else{
                cont++;
            }
        }else{
            if(s.substr(i, 1) == "." && s.substr(i+1, 1) == "#"){
                vec.push_back(cont);
                white += cont;
                swi = 0;
                cont = 1;
            }else{
                cont++;
            }
        }

    }
    vec.push_back(cont);
    if(s.substr(s.length()-1,1) == "."){
        white += cont;
    } 
    //cout << white << endl;
    //０になるとき
    if(cont == s.length()){
        cout << "0" << endl;
        return 0;
    }else if(vec.size() == 2){
        if(start == 1){
            cout << "0" << endl;
        }
        return 0;
    }
    
    ll black = 0;
    ll ans = 1145141919;
    for(int i = 0; i < vec.size(); i++){
        //黒の個数確認
        if(i % 2 == 0){
            white -= vec[i];
        }else{
            black += vec[i];
        }
        //cout << black << " " << white << endl;
        ans = min(ans, black + white);

    }
    
    cout << ans << endl;  
}

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

//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;

//#define ordered_set tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update>


typedef long long ll;
typedef long double ld;
typedef pair<int,int>pii;
typedef pair<ll, ll>pll;

const int MAX = 1e5 + 6;
const ll MOD = 998244353;

ll K[MAX];

int main(){

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

    for(ll i=1; i<=9; i++){
        K[i] = i;
    }

    int shift = 9;

    for(int i=10; i<MAX; ){
        ll last = K[i-shift]%10;
        if(last == 0){
            K[i] = K[i-shift]*10LL;
            K[i+1] = K[i] + 1;
            i += 2;
            shift++;
        }else if(last == 9){
            K[i] = K[i-shift]*10LL + 8;
            K[i+1] = K[i] + 1;
            i += 2;
            shift++;
        }else{
            K[i] = K[i-shift]*10LL + last - 1;
            K[i+1] = K[i] + 1;
            K[i+2] = K[i+1] + 1;
            i += 3;
            shift += 2;
        }
    }

    int k;
    cin >> k;

    cout << K[k];


}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define MAXN 100010
#define INF 1e9
long long n;
class fastio {
public:
    fastio() {
        ios_base::sync_with_stdio(false);
        cout.tie(nullptr);
        cin.tie(nullptr);
    }
} __fastio;
void solve() {
  cin >> n;
  /**
   ind = 1 2 3 4 5 6 . . . . N
   per = 2 3 4 5 6 7 . . . . 1
   mod = 1 2 3 4 5 6 . . . . 0

   Mod_summmation = N(N-1)/2 [It's an AP series]
  */
  cout << ((n*(n-1))/2) << endl;
}
int main() {
  __fastio;
  solve();
  return 0;
}


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

int main() {

	string line;
	int len, joi, ioi;

	while (cin >> line) {
		joi = 0;
		ioi = 0;
		len = line.length() - 1;
		for (int i = 1; i < len; ++i) {
			if (line.at(i) == 'O') {
				if (line.at(i + 1) == 'I') {
					if (line.at(i - 1) == 'J') {
						joi++;
					} else if (line.at(i - 1) == 'I') {
						ioi++;
					}
				}
			}
		}
		cout << joi << endl;
		cout << ioi << endl;
	}

	return 0;
}

Measured memory_bytes: 1196
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int a,b;
	cin>>a>>b;int tax;
	vector<int> ana;
	for(int i=0;i<=100000;i++)
	{
		tax=(i*8)/100;
		if(tax==a)ana.push_back(i);
	}
	
	if(ana.size()==0)
	{cout<<-1;return 0;}
	vector<int> fin;
	for(auto i:ana)
	{
		tax=(i*10)/100;
		if(tax==b)
		{cout<<i;return 0;}
	}
	cout<<-1;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            string b = System.Console.ReadLine();
            char[] c = b.ToCharArray();

            int cou = 0;
            int coumax = 0;

            for (int i = 0; i < b.Length; i++)
            {
                if (c[i] == 'A' || c[i] == 'T' || c[i] == 'G' || c[i] == 'C')
                {
                    cou++;
                    if (cou > coumax) { 
                    coumax = cou;
                    }                    
                }
                else
                    cou = 0;
            }
            Console.WriteLine(coumax);
        }
        
    }
}


Measured memory_bytes: 11092
#include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <iterator>
#include <assert.h>
#pragma warning(disable:4996) 
 
typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF 9223300000000000000
#define INF 2140000000
const long long MOD = 1000000007;
//const long long MOD = 998244353;

using namespace std;



void solve()
{
    int n, K;
    scanf("%d%d", &n, &K);
    int i;
    ll curr = 1;
    for (i = 0; i < n; i++) {
        if (i == 0) curr = K;
        else curr *= (K - 1);
    }
    printf("%lld\n", curr);
    return;
}

int main(int argc, char* argv[])
{
#if 1
    solve();
#else
    int T; scanf("%d", &T);
    while(T--) {
        solve();
    }
#endif
    return 0;
}


Measured memory_bytes: 128
#include<iostream>

using namespace std;

struct plot{
  int x;
  int y;
};
int main(){
  plot p1,p2;
  cin>>p1.x>>p1.y>>p2.x>>p2.y;
  cout<<p2.x-(p2.y-p1.y)<<' '<<p2.y+(p2.x-p1.x);
  cout<<' '<<p1.x-(p2.y-p1.y)<<' '<<p1.y+(p2.x-p1.x)<<endl;
  return 0;


}


Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <limits>
#include <queue>
#include <iomanip>
#include <set>

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

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

using namespace std;
#define ALL(X) X.begin(),X.end()
using ll = long long int;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<vvll> vvvll;
const int MOD=1000000007;
//const int MOD=998244353;
const int INTMAX=1001001000;
const ll LLMAX=1010010010010010000;


int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    
    ll N,K;
    cin>>N>>K;
    vll A(N);
    for(ll i=0;i<N;i++)cin>>A[i];
    
    vll count(N,0);
    for(ll i=0;i<N;i++){
        count[A[i]-1]++;
    }
    
    sort(count.begin(),count.end());
    
    ll ans=0;
    for(ll i=0;i<N-K;i++){
        ans+=count[i];
    }
    cout<<ans<<endl;
    
    return 0;
}


Measured memory_bytes: 3456
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul

sys.setrecursionlimit(10000)


def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, K, XY):
    X = sorted(map(lambda x: x[0], XY))
    Y = sorted(map(lambda x: x[1], XY))

    ans = sys.maxsize
    for lx in X:
        for rx in X[::-1]:
            if lx > rx:
                break
            for by in Y:
                for ty in Y[::-1]:
                    if by > ty:
                        break

                    # print(lx, rx, by, ty)
                    k = 0
                    for x, y in XY:
                        if lx <= x <= rx and by <= y <= ty:
                            k += 1
                    # print(k)
                    if k >= K:
                        ans = min(ans, (rx-lx)*(ty-by))
                    else:
                        break

    return ans


def main():
    N, K = read_int_n()
    XY = [read_int_n() for _ in range(N)]

    # N = random.randint(2, 50)
    # N = 50
    # K = random.randint(2, N)
    # cm = int(1e+9)
    # XY = [(random.randint(-cm, cm), random.randint(-cm, cm)) for _ in range(N)]
    # print(N, K)
    print(slv(N, K, XY))


if __name__ == '__main__':
    main()


Measured memory_bytes: 68460
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func solution(n int, nums []int) string {
	var ans string = "APPROVED"

	for i := range nums {
		if nums[i]&1 == 0 {
			if nums[i]%3 == 0 || nums[i]%5 == 0 {
				continue
			} else {
				ans = "DENIED"
				break
			}
		}
	}

	return ans
}

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)

	sc.Scan()
	n, _ := strconv.Atoi(sc.Text())

	nums := make([]int, n)
	for i := 0; i < n; i++ {
		sc.Scan()
		nums[i], _ = strconv.Atoi(sc.Text())
	}

	fmt.Printf(solution(n, nums))
}


Measured memory_bytes: 640
h, n = map(int, input().split())
l = []
for i in range(n):
    a, b = map(int, input().split())
    l.append([a, b])
INF = 10 ** 9 + 11
dp = [INF] * (h + 1)
dp[0] = 0
nextj = 0
for i in range(n):
    for j in range(h):
        nextj = j + l[i][0]
        if nextj <= h:
            dp[nextj] = min(dp[nextj], dp[j] + l[i][1])
        else:
            dp[h] = min(dp[h], dp[j] + l[i][1])
print(dp[-1])


Measured memory_bytes: 41708
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
using namespace std;

int main(void){

    int a, b;
    vector<int> result;

    cin >> a >> b;

    result.push_back(a + b);
    result.push_back(a - b);
    result.push_back(a * b);

    sort(result.begin(), result.end(), greater<int>());

    cout << result[0] << endl;


    return 0;
}

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

#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;

int main() {
    int n, k; cin >> n >> k;
    vector<int> x(n);
    for(int i = 0; i < n; i++) cin >> x[i];

    int ans = 0;
    for(int i = 0; i < n; i++){
        int a = abs(x[i] - 0) * 2;
        int b = abs(x[i] - k) * 2;
        ans += min(a, b);
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <cstdio>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <iterator>
#include <cassert>
#include <numeric>
#include <functional>
//#include <numeric>
#pragma warning(disable:4996) 
 
typedef long long ll;
typedef unsigned long long ull;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF  9223300000000000000
#define LINF2 1223300000000000000
#define LINF3 1000000000000
#define INF 2140000000
const long long MOD = 1000000007;
//const long long MOD = 998244353;

using namespace std;


void solve()
{
    int h1, m1, h2, m2, K;
    scanf("%d%d%d%d%d", &h1, &m1, &h2, &m2, &K);
    int tmp=(h2 * 60 + m2) - (h1 * 60 + m1);

    printf("%d\n", MAX(0, tmp - K));

    return;
}


int main(int argc, char* argv[])
{
#if 1
    solve();
#else
    int T;
    scanf("%d", &T);
    int t;
    for(t=0; t<T; t++) {
        //printf("Case #%d: ", t+1);
        solve();
    }
#endif
    return 0;
}


Measured memory_bytes: 1736
#include <bits/stdc++.h>
#include <unordered_set>
#include <random>
using namespace std;
#define ll long long
#define fr first
#define sc second
#define pll pair<ll, ll>
#define all(v) v.begin(), v.end()

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int x; cin >> x;
	if (x >= 30) cout << "Yes";
	else cout << "No";

	return 0;
}

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

int main() {
    int a, b, c;
    cin >>a >>b >>c;
    int S=0;
    for (int i=a; i<=b; i++)
        if (0==c%i)
            S++;
    cout <<S <<endl;
    return 0;
}


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

int main() {
    int n,ptr=0,res=0,flg=0;
    cin >> n;
    vector<int> a(n);
    for(int i=0;i<n;i++)
        cin >> a.at(i);
    for(int i=0;i<2*n;i++){
        if(a.at(ptr)==2){
            ++res;
            flg=1;
            break;
        }
        ptr = a.at(ptr)-1;
        ++res;
    }
    if(flg==1)
        cout << res << endl;
    else 
        cout << -1 << endl;
}


Measured memory_bytes: 640
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
using ll = long long;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-8;
const int MOD = 1000000007;
// const int MOD = 998244353;
const int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1};
const int dy8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dx8[] = {0, -1, -1, -1, 0, 1, 1, 1};
template <typename T, typename U> inline bool chmax(T &a, U b) { return a < b ? (a = b, true) : false; }
template <typename T, typename U> inline bool chmin(T &a, U b) { return a > b ? (a = b, true) : false; }
struct IOSetup {
  IOSetup() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  }
} iosetup;

int main() {
  int n; cin >> n;
  for (int i = n; ; ++i) {
    if (i % 1000 == 0) {
      cout << i - n << '\n';
      return 0;
    }
  }
  return 0;
}


Measured memory_bytes: 3688
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <map>
#include <unordered_map>
#include <set>
#include <queue>
using namespace std;
#define ALL(x) (x).begin(),(x).end()
#define SZ(x) long long((x).size())
#define OUT(x) cout << (x) << endl
typedef long long ll;
typedef vector<ll> V;
typedef vector<vector<ll>> VV;
typedef pair<ll, ll> P;
typedef map<string, ll> M;
typedef unordered_map<ll, ll> HM;
typedef set<ll> S;
typedef multiset<ll> MS;
typedef queue<ll> Q;

int main(){
    ll n; cin>>n;
    ll a[n];
    for(ll i=0; i<n; i++)
        cin >> a[i];
    ll cost = 4000000;
    for(ll i=-100; i<=100; i++){
        ll tmp = 0;
        for(ll j=0; j<n; j++)
            tmp += abs(i-a[j])*abs(i-a[j]);
        cost = min(cost, tmp);
    }
    OUT(cost);
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
namespace FAST_IO
{
	template<typename T> void read(T &a)
	{
		a=0;
		int f=1;
		char c=getchar();
		while(!isdigit(c))
		{
			if(c=='-')
			{
				f=-1;
			}
			c=getchar();
		}
		while(isdigit(c))
		{
			a=a*10+c-'0';
			c=getchar();
		}
		a=a*f;
	}
	template <typename T> void write(T a)
	{
		if(a<0)
		{
			a=-a;
			putchar('-');
		}
		if(a>9)
		{
			write(a/10);
		}
		putchar(a%10+'0');
	}
	template <typename T> void writeln(T a)
	{
		write(a);
		puts("");
	}
}
int n;
int biggest(int a)
{
	if(a==1)
	{
		return min(n,1);
	} 
	//return log_{a}(b)
	for(int i=2;;i++)
	{
		if(pow(a,i)>n)
		{
			return pow(a,i-1);	
		} 
	}
}
int ans=0;
int main()
{
	cin>>n;
	for(int i=1;i*i<=n;i++)
	{
		ans=max(ans,biggest(i));
	}
	cout<<ans;
}


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

int main() {
    int n;
    scanf("%d\n", &n);
    char c[n];
    for (int i = 0; i < n; i++) {
        scanf("%c", &c[i]);
    }
    int ans = 0;
    for (int i = 0; i < n; i++) {
        map<char, int> m;
        int tmp = 0;
        for (int j = 0; j < n; j++) {
            if (j <= i) {
                if (m.count(c[j]) == 0) {
                    m[c[j]]++;
                }
            }else {
                if (m.count(c[j]) == 1 && m[c[j]] == 1) {
                    m[c[j]]++;
                    tmp++;
                }
            }
        }
        if (tmp >= ans) ans = tmp;
    }
    printf("%d\n", ans);

    return 0;
}


Measured memory_bytes: 256
import itertools
import math

N = int(input())
T = [[]*2]*N
for i in range(N):
  T[i] = list(map(int, input().split()))

L = 0
for i in itertools.permutations(T):
  for n in range(N-1):
    L = L + math.sqrt((i[n][0]-i[n+1][0])**2+(i[n][1]-i[n+1][1])**2)

print(L/math.factorial(N))

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

void main()
{
  char words[256];
  int n;
  int i;
  scanf("%d",&n);
  scanf("%s",words);
  int len = strlen(words);
  if ( len <= n)
  {
    printf(words);
  }
  else
  {
    for(i=0;i < n; i++)
    {
      printf("%c", words[i]);
    }
    printf("...\n");
  }
}

Measured memory_bytes: 1712
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define m 1000000007
int main()
{
	int a;
	cin>>a;
	string s,t;
	cin>>s>>t;
	for(int i=0;i<a;i++)
	{
		cout<<s[i]<<t[i];
	}
	cout<<endl;

}

Measured memory_bytes: 256
using System;

class Program{
	static void Main(string[] args){
    	string[] input = Console.ReadLine().Split(' ');
      	int N = int.Parse(input[0]);
        int M = int.Parse(input[1]);
        int C = int.Parse(input[2]);
      
      string[] Bs = Console.ReadLine().Split(' ');
      int[] B = new int[M];
      for(int i = 0;i < M;i++){
      	B[i] = int.Parse(Bs[i]);
      }
      
      int Count = 0;
      
      int [,] A = new int[N,M];
      
      for(int i = 0;i < N;i++){
        
        string[] As = Console.ReadLine().Split(' ');
        int Add = 0;
      	for(int j = 0;j< M;j++){
        	Add = Add + (int.Parse(As[j]) * B[j]);
        	
        }
        Add = Add + C;
        
        if(Add > 0){
        	Count++;
        }
      }
      
      Console.WriteLine(Count);
    }
}

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

int seg[400005];

void upd(int ver,int tl,int tr,int l,int r,int val)
{
    if(tl>tr||l>r||tr<l||r<tl)
        return ;
    else if(tl==l&&tr==r)
    {
        seg[ver]+=val;
    }
    else
    {
        int tm=(tl+tr)/2;
        upd(2*ver,tl,tm,l,min(tm,r),val);
        upd(2*ver+1,tm+1,tr,max(tm+1,l),r,val);
    }    
}

int get(int ver,int tl,int tr,int pos)
{
    if(tl>tr)
        return 0;
    else if(tl==tr)
    {
        return seg[ver];
    }
    else
    {
        int tm=(tl+tr)/2;
        if(tm>=pos)
            return seg[ver]+get(2*ver,tl,tm,pos);
        else
            return seg[ver]+get(2*ver+1,tm+1,tr,pos);
    }    
}


signed main()
{
 
ios_base::sync_with_stdio(false);
cin.tie(NULL);  
cout.tie(0);   
 
 
#ifndef ONLINE_JUDGE
    if(fopen("INPUT.txt","r"))
    {
    freopen ("INPUT.txt" , "r" , stdin);
    freopen ("OUTPUT.txt" , "w" , stdout);
    }
#endif    

    int n,m;
    cin>>n>>m;
    vector<pair<int,pair<int,int> > >pp;
    int x,y;
    for(int i=0;i<n;i++)
    {
        cin>>x>>y;
        pp.push_back({y-x+1,{x,y}});
    }
    sort(pp.begin(),pp.end());
    int ini=0;
    int tot=n;
    
    for(int i=1;i<=m;i++)
    {
        if(ini<n)
        while (ini<n && i>=pp[ini].first)
        {
            upd(1,1,m,pp[ini].second.first,pp[ini].second.second,1);
            ini++;
            tot--;
        }

        int ans=0;
        for(int j=i;j<=m;j+=i)
        {
            ans+=get(1,1,m,j);
        }
        cout<<tot+ans<<'\n';
    }

}

Measured memory_bytes: 15552
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"

using namespace std;

const long long int MOD = 1000000007;
//const int MOD = 998244353;
//const long long int MOD = 998244353;

//int N, M, K, H, W, L, R;
long long int N, M, K, H, W, L, R;


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

	cin >> N >> M;
	vector<int>v(N);
	int ans = 1;
	for (auto &i : v)cin >> i;
	ans += v[0] <= M;
	for (int i = 1; i < N; i++) {
		v[i] += v[i - 1];
		ans += v[i] <= M;
	}
	cout << ans << endl;
}

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

int main()
{
    int n,m;
    cin >> n >> m;
    int ac = 0;
    int pe = 0;
    map<int, int> am = {};
    map<int, int> pm = {};
    for(int i=0; i<m; i++){
        int e;
        string s;
        cin >> e >> s;
        if(s == "AC"){
            if(am[e] == 0){
                ac++;
                pe += pm[e];
                am[e]++;
            }

        }else if(s == "WA"){
            if(am[e] == 0) pm[e]++;
        }
    }
    cout << ac << " " << pe << endl;
    return 0;
}


Measured memory_bytes: 9600
#include <iostream>

using namespace std;

int main() {
    int A;
    int B;
    int C;
    int D;
    cin >> A >> B >> C >> D;

    while (true) {
        C -= B;
        if (C <= 0) {
            cout << "Yes" << endl;
            break;
        }
        A -= D;
        if (A <= 0) {
            cout << "No" << endl;
            break;
        }
    }
}


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

int main() {
    vector<int> vs(3);
    for (auto& v : vs) {
        cin >> v;
    }
    sort(begin(vs), end(vs));
    printf("%d %d %d\n", vs[0], vs[1], vs[2]);
}

Measured memory_bytes: 1184
#include <iostream>
using namespace std;
typedef long long ll;

int main() {
    int N, cnt = 0;
    bool res = false;
    cin >> N;
    for (int i = 0; i < N; ++i){
        int a, b;
        cin >> a >> b;
        if(a == b) {
            cnt++;
        }else {
            cnt = 0;
        }
        if(cnt >= 3) res = true;
    }

    cout << (res ? "Yes" : "No") << endl;
	return 0;
}

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

using namespace std;
using ll = long long;

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

    int k;
    cin >> k;

    int mod = 0, ans = 0;
    do {
        mod = ((mod * 10) + 7) % k;
        ans++;
    } while(mod && ans <= k);

    if(ans <= k) printf("%d\n", ans);
    else printf("-1\n");

    return 0;
}

Measured memory_bytes: 3776
n=int(input())
p=[[0,0]]
r3=1.7320508
def unit_koch(p1,p2,d):
  if d>=n:
    return
  s=[(p1[0]*2+p2[0])/3,(p1[1]*2+p2[1])/3]
  t=[(p1[0]+p2[0]*2)/3,(p1[1]+p2[1]*2)/3]
  v_s_t=[t[0]-s[0],t[1]-s[1]]
  v_s_u=[v_s_t[0]/2-v_s_t[1]*r3/2,v_s_t[1]/2+v_s_t[0]*r3/2]
  u=[s[0]+v_s_u[0],s[1]+v_s_u[1]]
  unit_koch(p1,s,d+1)
  p.append(s)
  unit_koch(s,u,d+1)
  p.append(u)
  unit_koch(u,t,d+1)
  p.append(t)
  unit_koch(t,p2,d+1)
unit_koch([0,0],[100,0],0)
p.append([100,0])
for i in p:
  print(str(i[0])+' '+str(i[1]))


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

int main(){
  int h,w,inf=1e9;
  cin>> h >> w;
  vector<vector<bool>> s(h,vector<bool>(w,false));
  char c;
  for (int i=0; i<h; i++){
    for (int j=0; j<w; j++){
      cin>> c;
      if (c=='.') s[i][j]=true;
    }
  }
  
  vector<vector<int>> d(h*w,vector<int>(h*w,inf));
  for (int x=0; x<h; x++){
    for(int y=0; y<w; y++){
      if (s[x][y]){
        d[x*w+y][x*w+y]=0;
        if(y>0 && s[x][y-1]) d[x*w+y][x*w+y-1]=1;
        if(y+1<w && s[x][y+1]) d[x*w+y][x*w+y+1]=1;
        if(x>0 && s[x-1][y]) d[x*w+y][(x-1)*w+y]=1;
        if(x+1<h && s[x+1][y]) d[x*w+y][(x+1)*w+y]=1;
      }
    }
  }
  
  for (int k=0; k<h*w; k++)
    for (int i=0; i<h*w; i++)
      for (int j=0; j<h*w; j++)
        if(d[i][j]>d[i][k]+d[k][j])
          d[i][j]=d[i][k]+d[k][j];
  
  int ans=0;
  for (int i=0; i<h*w; i++)
    for (int j=0; j<h*w; j++)
      if(d[i][j]<inf && ans<d[i][j]) ans=d[i][j];
  cout<< ans <<endl;
}

Measured memory_bytes: 896
#include<bits/stdc++.h>
  using namespace std;
  #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  #define endl "\n"
  #define int long long
  #define all(v) v.begin(),v.end()
  #define f first
  #define s second
  #define PB push_back
  #define MP make_pair
  #define double long double
  #define trace1(x)                cerr<<#x<<": "<<x<<endl
  #define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
  #define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
  #define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
  #define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
  #define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
  #define cases int testcases;cin>>testcases; while(testcases--)
  #define MOD 998244353
  #define N 200005
  #define INF 1000000000000
  #define eps 1e-6

int32_t main()
{


   set<int > s;

   int n;
   cin >> n;

   for(int i = 1; i <=n ; i++)
   {
    int x;
    cin >> x;
    s.insert(x);

   }

   if(n == s.size())
   {
    cout << "YES";
   }
   else
   {
    cout << "NO";
   }


   
    return 0;
}

Measured memory_bytes: 9600
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>

#define CK(N, A, B) (A <= N && N < B)
#define REP(i, a, b) for (int i = a; i < b; i++)
#define RREP(i, a, b) for (int i = (b - 1); a <= i; i--)
#define F first
#define S second
#define ll long long

const int INF = 1e9;
const long long LLINF = 1e18;

using namespace std;

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

/*==================================================*/
/*variable*/

/*==================================================*/
/*function*/

/*==================================================*/

int main() {
    string s;
    cin>>s;
    s[3] = '8';
    cout<<s<<endl;
    return 0;
}


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

int main()
{
    int N;
    cin >> N;
    pair<int, int> BA[N];
    rep(i,N)
    {
        int A, B;
        cin >> A >> B;
        BA[i] = make_pair(B, A);
    }
    sort(BA, BA + N);

    long long cumsum = 0;
    bool flag = true;
    rep(i, N)
    {
        cumsum += BA[i].second;
        if (cumsum <= BA[i].first){}
        else
        {
            // cout << BA[i].first << ' ' << BA[i].second << ' '<< i << ' ' << cumsum << endl;
            flag = false;
            break;
        }
    }
    if (flag)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <bitset>
#include <ctime>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <sstream>
#include <fstream>

using namespace std;
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--)
#define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--)
#define DEBUG(C) cerr << #C << " = " << C << endl;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
template<typename T> using VT = vector<T>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) rbegin((a)), rend((a))
#define SORT(a) sort(ALL((a)))
#define RSORT(a) sort(RALL((a)))
#define REVERSE(a) reverse(ALL((a)))
#define MP make_pair
#define FORE(a, b) for (auto &&a : (b))
#define FIND(s, e) ((s).find(e) != (s).end())
#define EB emplace_back
template<typename T> inline bool chmax(T &a, T b){if (a < b){a = b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if (a > b){a = b;return true;}return false;}

const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;

int main(void) {
    int n;
    cin >> n;
    VPII v(n);
    REP(i, n) {
        cin >> v[i].first;
        v[i].second = i;
    }
    VPII sv = v;
    SORT(sv);
    if (sv[n / 2 - 1].first == sv[n / 2].first) {
        REP(i, n) cout << sv[n / 2 - 1].first << endl;
        return 0;
    }
    REP(i, n) {
        if (i == sv[n / 2 - 1].second) {
            cout << sv[n / 2].first << endl;
        } else if (i == sv[n / 2].second) {
            cout << sv[n / 2 - 1].first << endl;
        } else {
            if (v[i].first <= sv[n / 2 - 1].first) {
                cout << sv[n / 2].first << endl;
            } else {
                cout << sv[n / 2 - 1].first << endl;
            }
        }
    }
}


Measured memory_bytes: 5376
#include<iostream>
#include<algorithm>
#include<string.h>
#include<string>
#include<cmath>
#include<cstdlib>
#include<vector>
#include<functional>

using namespace std;

int main() {
	int r, flag = 1;
	cin >> r;
	if (r < 2800) {
		if(r<1200){}
		else{ flag = 2; }
	}
	if (r >= 2800) {
		flag = 3;
	}
	if (flag == 1)cout << "ABC" << endl;
	if (flag == 2)cout << "ARC" << endl;
	if (flag == 3)cout << "AGC" << endl;
	return 0;
}

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

using namespace std;

vector<string>vec;

int main(){
    
    string str;
    
    int n, l;
    
    cin >> n >> l;
    
    for(int i=0; i<n; i++){
        cin >> str;
        vec.push_back(str);
    }
    
    sort(vec.begin(),vec.end());
    
    for(int i=0; i<n; i++){
        cout << vec[i];
    }
    
    
    return 0;
}

Measured memory_bytes: 256
/*
--------------              |   /
      |                     |  /
      |                     | /
      |             *       |/          |    |         ------            *
      |                     |           |    |        /      \
      |             |       |\          |    |       |       |\          |
   \  |             |       | \         |    |       |       | \         |
    \ |             |       |  \        |    |        \     /   \        |
     V              |       |   \        \__/|         -----     \       |
*/
#include <bits/stdc++.h>
using namespace std;

#define EmiliaMyWife ios::sync_with_stdio(0); cin.tie(NULL);
#define mem(i,j) memset(i,j,sizeof (i));
#define F first
#define S second
#define lowbit(x) ((x)&(-(x)))
#define siz(v) (long long)(v).size()
typedef int64_t ll;
typedef uint64_t ull;
const double EPS  = 1e-8;
const int INF     = 0x3F3F3F3F;
const ll LINF     = 4611686018427387903;
const int MOD     = 1e9+7;
/*-----------------------------------------------------------------------------------------------------*/

#define int ll
const int mod = 998244353;
int frac[200025] = {1};
int mpow(int n, int m) {
	int ans = 1, a = n;
	while(m) {
		if(m&1)
			ans = (ans * a) % mod;
		a = (a * a) % mod;
		m >>= 1;
	}
	return ans;
}
int c(int n, int m) {
	return (frac[n] * mpow(frac[n-m], mod-2) % mod * mpow(frac[m], mod-2) % mod);
}

signed main() {
	EmiliaMyWife

	int n, m, k;
	cin >> n >> m >> k;
	for(int i = 1; i <= n; i++)
		frac[i] = (frac[i-1]*i)%mod;
	int cal = m;
	for(int i = k+1; i < n; i++)
		cal = (cal * (m-1)) % mod;
	ll ans = 0;
	//cout << (3*mpow(3, mod-2))%mod << '\n';
	for(int i = k; ~i; i--) {
		//cout << (c(n-1, i)%mod) << '\n';
		ans = (ans + cal * c(n-1, i)) % mod;
		cal = (cal * (m-1)) % mod;
	}
	cout << ans;

	return 0;
}


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

using namespace std;

int main() {
  int s, a, b;
  cin >> s >> a >> b;
  a = abs(a - s);
  b = abs(b - s);
  if (a > b) cout << 'B';
  else cout << 'A';
  return 0;
}

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

using namespace std;

#define rep(i, n) for(int i = 0; i < n; i++)
#define MOD 1000000007
#define el endl
#define INF 1e8
typedef long long ll;
typedef long double ld;
// 'a' = 97 'z' = 122 => 'a' = 0 'z' = 25

ll RepeatSquaring(ll n, ll p, ll M){
    if(p == 0) return 1;
    if(p % 2 == 0){
        ll t = RepeatSquaring(n, p/2, MOD);
        return t*t % M;
    }else{
        return n * RepeatSquaring(n, p-1, MOD);
    }
}

ll Factorial(ll n, ll M){
    ll res = 1;
    for(ll i = 1; i <= n; i++){
        res *= i;
        res %= M;
    }
    return res;
}

ll modn(ll n, ll a, ll M){
    ll res = 1;
    ll mul = n;
    rep(i, a){
        res *= mul;
        res %= M;
        mul--;
    }
    return res;
}

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

int main() {
    int n, a, b;
    cin >> n >> a >> b;
    ll all = modpow(2, n, MOD) - 1;
    if(all < 0) all += MOD;
    
    ll coma, comb, a1, b1;
    a1 = modn(a, a, MOD);
    b1 = modn(b, b, MOD);
    coma = modpow(a1, MOD-2, MOD) * modn(n, a, MOD);
    coma %= MOD;
    comb = modpow(b1, MOD-2, MOD) * modn(n, b, MOD);
    comb %= MOD;
    
    all -= coma;
    if(all < 0) all += MOD;
    all %= MOD;
    
    all -= comb;
    if(all < 0) all += MOD;
    all %= MOD;
    cout << all << endl;
}




Measured memory_bytes: 256
/* ANTHOR KUMAR DAS
KUET ECE 2K18*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define sc(a) scanf("%d",&a)
#define sc1(n) scanf("%lld",&n)
#define sc2(b,c) scanf("%lld%lld",&b,&c)
#define f(a,b) for(a=0;a<b;a++)
#define pb(a) push_back(a)
#define br break
int main()
{
    int i,n,j,k,l;
    cin>>n;
    int a[n],b[n];
    f(i,n)
    {
        cin>>a[i];
    }
    f(i,n)
    {
        b[a[i]-1]=(i+1);
    }
    f(i,n)
    {
        cout<<b[i]<<" ";
    }
    cout<<endl;


    return 0;
}



Measured memory_bytes: 1536
import math
n = int(input())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
ans_p = 0
ans_q = 0
memo_p = [0]*n
memo_q = [0]*n
for i in range(n):
    ans_p += (p[i] - 1 - sum(memo_p[:p[i]-1])) * math.factorial(n - i - 1)
    memo_p[p[i] - 1] = 1
    ans_q += (q[i] - 1 - sum(memo_q[:q[i]-1])) * math.factorial(n - i - 1)
    memo_q[q[i] - 1] = 1
ans = abs(ans_p - ans_q)
print(ans)

Measured memory_bytes: 3064
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

typedef long long int ll;

#define FOR(i,n,m) for(ll i=(ll)(m);i<(ll)(n);++i)
#define REP(i,n) FOR(i,n,0)
#define IREP(i,n) for(ll i=(ll)(n);i>=0;--i)

const ll MOD = 1000000007;

using namespace std;

int main()
{
	ll x;
	cin >> x;
	ll ans = 0;
	ans += (x / (ll)11) * (ll)2;
	x %= (ll)11;
	ans += (ll)(x > 6 ? 2 : (x == 0 ? 0 : 1));

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

Measured memory_bytes: 256
s=gets.chomp.split("").map(&:to_i)
if((s[0]*10+s[1])>12 or (s[0]*10+s[1])==0)
	if((s[2]*10+s[3])>12 or (s[2]*10+s[3])==0)
		print "NA"
	else
		if(s[2]*10+s[3])<=12 and (s[2]*10+s[3])>=1
			print "YYMM"
		else
			print "AMBIGUOUS"
		end
	end
else
	if(s[2]*10+s[3])<=12 and (s[2]*10+s[3])>=1
		print"AMBIGUOUS"
	else
		print "MMYY"
	end
end

Measured memory_bytes: 1788
//PseudoName

    #pragma GCC optimize("O3")
    #include <bits/stdc++.h>
/*
	#include <ext/pb_ds/assoc_container.hpp>
	#include <ext/pb_ds/tree_policy.hpp>
	using namespace __gnu_pbds;
	template<class T> using oset=tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
*/
    #define FOR(i,n) for(i=0;i<n;i++)
    #define FOR1(i,n) for(i=1;i<=n;i++)
    #define FOR2(I, A, B) for (int I = (A); I <= (B); ++I)
    #define pb push_back
    #define unique_sort(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
    #define print(v) for(auto it:v)cout<<it<<" ";cout<<endl
    #define fast() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
    #define endl "\n"
    #define min3(a,b,c) min(a,min(b,c))
    #define forr(n) for(int i=0;i<n;i++)
    #define jorr(n) for(int j=0;j<n;j++)
    #define frr(n) for(int i=1;i<=n;i++)
    #define MAX 200005
    #define inf 200008

    using namespace std;

    typedef long long ll;
    typedef long li;
    typedef vector<int> vi;
    typedef vector<ll> vli;
    typedef vector<vi> vvi;
    typedef vector<vli> vvli;
    typedef pair<int,int> pi;
    typedef pair<ll,ll> pli;
    typedef vector<pi> vpi;
    typedef vector<pli> vpli;



    int main() {

        fast();
        int n;
        cin>>n;
        int dp[n+1][3],a[n][3];
        forr(n)
        {
            jorr(3)cin>>a[i][j];
        }

        jorr(3)dp[0][j]=a[0][j];
        for(int i=1;i<n;i++)
        {
            dp[i][0]=max(dp[i-1][1],dp[i-1][2])+a[i][0];
            dp[i][1]=max(dp[i-1][0],dp[i-1][2])+a[i][1];
            dp[i][2]=max(dp[i-1][1],dp[i-1][0])+a[i][2];
        }

        cout<<max({dp[n-1][0],dp[n-1][1],dp[n-1][2]})<<endl;
    }


Measured memory_bytes: 2560
#include<iostream>
#include<iomanip>
#include<queue>
#include<string>
#include<stack>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<cassert>
#include<ctime>
#include<algorithm>
#include<utility>
#include<map>
#include<set>
#include<vector>
#include<functional>
#include<complex>

using namespace std;

typedef long long            ll;
typedef unsigned             ui;
typedef unsigned long long   ull;
typedef pair<int,int>        i_i;
typedef pair<ll,int>         ll_i;
typedef pair<ll,ll>          ll_ll;
typedef pair<double,int>     d_i;
typedef pair<double,double>  d_d;
typedef vector<int>          vi;
typedef vector<vector<int> > vii;

#ifdef DEBUG
#define dprintf      printf
#define dputs        puts
#define dout(x)      cout<<#x" = "<<(x)<<endl
#define darray(x,n)  {int i;rep(i,n)cout<<#x"["<<i<<"] = "<<*((x)+i)<<endl;}
#define dloop(i,s,g) for(int (i)=(s);(i)<(g);(i)++)
#define drep(i,n)    for(int (i)=0;(i)<(n);(i)++)
#define dstop()      scanf("%*c")
#else
#define dprintf      (1)?0:printf
#define dputs        (1)?0:puts
#define dout(x)
#define darray(x,n)
#define dloop(i,s,g) if(int i=0){}else
#define drep(i,n)    if(int i=0){}else
#define dstop()
#endif

#define F    first
#define S    second
#define pb   push_back
#define mp   make_pair

#define loop(i,s,g) for((i)=(s);(i)<(g);(i)++)
#define rep(i,n)    for((i)=0;(i)<(n);(i)++)
#define all(x)      (x.begin(),x.end())
#define in(T,...) T __VA_ARGS__; impl(__VA_ARGS__)
#define array(T,id,n) T id[(n)]; for(int i=0;i<(n);i++)cin>>id[i]
#define putv(n)     cout<<(n)<<endl

//#define int long long
#ifndef int
#define INF __INT32_MAX__
#else
#define INF __INT64_MAX__
#endif

void impl(){};
template <typename T,typename... TS >
void impl(T &head,TS &... tail)
{
  cin>>head;
  impl(tail ...);
}

signed main(void)
{
  in(int,a,b);
  if((a*b)%2){
    puts("Odd");
  }
  else{
    puts("Even");
  }
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define pb push_back
#define X first
#define Y second
#define sz(v) (int)v.size()

void solve();

main() {
	ios_base::sync_with_stdio(0), cin.tie(0);
#ifdef ONPC
	freopen("in.txt", "r", stdin);
#endif
	int t = 1;
	//cin >> t;
	while (t--) solve();
	return 0;
}



void solve() {
	int n;
	cin >> n;
	int ans = 0;
	for (int i = 1; i <= n; ++i) {
		int a = i;
		int cnt = 1;
		a /= 10;
		while (a) {
			++cnt;
			a /= 10;
		}
		ans += cnt & 1;
	}
	cout << ans;
}

Measured memory_bytes: 256
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;
#define rep(i,n) for(int (i)=0;(i)<(ll)(n);++(i))
#define repd(i,n,d) for(ll (i)=0;(i)<(ll)(n);(i)+=(d))
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset((m),(v),sizeof(m))
#define chmin(x,y) (x=min(x,y))
#define chmax(x,y) (x=max(x,y))
#define fst first
#define snd second
#define UNIQUE(x) (x).erase(unique(all(x)),(x).end())
template<class T> ostream &operator<<(ostream &os, const vector<T> &v){int n=v.size();rep(i,n)os<<v[i]<<(i==n-1?"":" ");return os;}

string s[300];

int main(){
	int h, w;
  cin>>h>>w;
  rep(i, h) cin>>s[i];
  for(int i = 2*h-1; i > 0; i--) s[i] = s[i/2];
  rep(i, 2*h) cout<<s[i]<<endl;
	return 0;
}


Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
#include<algorithm>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<iostream>
#include<vector>
#include<queue>
#include<deque>
#include<stack>
#include<set>
#include<map>
#include<string>
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define rep2(i,s,n) for(int i=s;i< (int)n; i++)
#define ll long long 
#define all(v) v.begin(),v.end()
using namespace std;
int main(){ 
  int n; cin >>n;
   cout <<180*(n-2)<<endl;
}

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

    #define ll long long
    #define ff first
    #define ss second
    #define pb push_back
    #define vll vector<ll>
    #define mll map<ll,ll>
    #define MOD 1000000007
    #define pll pair<ll,ll>
    #define fastio ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
    int main() {
      fastio;
      int k,x;
      cin>>k>>x;
      if(k*500>=x)
        cout<<"Yes"<<endl;
      else cout<<"No"<<endl;
    }

Measured memory_bytes: 256