akhauriyash/Code-Regression huggingface dataset:
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
// #include<ext/pb_ds/assoc_container.hpp>
// #include<ext/pb_ds/tree_policy.hpp>
// #include<ext/pb_ds/tag_and_trait.hpp>
// using namespace __gnu_pbds;
using namespace std;
using ll=long long;
#define double long double
using datas=pair<ll,ll>;
using ddatas=pair<double,double>;
using tdata=pair<ll,datas>;
using vec=vector<ll>;
using mat=vector<vec>;
using pvec=vector<datas>;
using pmat=vector<pvec>;
// using llset=tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>;
#define For(i,a,b) for(i=a;i<(ll)b;i++)
#define bFor(i,b,a) for(i=b-1;i>=(ll)a;i--)
#define rep(i,N) For(i,0,N)
#define rep1(i,N) For(i,1,N)
#define brep(i,N) bFor(i,N,0)
#define all(v) (v).begin(),(v).end()
#define allr(v) (v).rbegin(),(v).rend()
#define vsort(v) sort(all(v))
#define vrsort(v) sort(allr(v))
#define endl "\n"
#define pb push_back
#define eb emplace_back
#define print(v) cout<<v<<endl
#define printyes cout<<"Yes"<<endl
#define printno cout<<"No"<<endl
#define printYES cout<<"YES"<<endl
#define printNO cout<<"NO"<<endl
#define output(v) do{bool f=0;for(auto outi:v){cout<<(f?" ":"")<<outi;f=1;}cout<<endl;}while(0)
const ll mod=1000000007;
// const ll mod=998244353;
const ll inf=1LL<<60;
const double PI = acos(-1);
const double eps = 1e-9;
template<class T> inline bool chmax(T& a,T b){bool x=a<b;if(x)a=b;return x;} 
template<class T> inline bool chmin(T& a,T b){bool x=a>b;if(x)a=b;return x;} 

void startupcpp(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout<<fixed<<setprecision(15);
}

double distance(ddatas x,ddatas y){
  double a=x.first-y.first,b=x.second-y.second;
  return sqrt(a*a+b*b);
}

ll modinv(ll a) {
  ll b=mod,u=1,v=0,t;
  while(b){
    t=a/b;
    a-=t*b; swap(a,b);
    u-=t*v; swap(u,v);
  }
  return (u+mod)%mod;
}

ll moddevide(ll a,ll b){return (a*modinv(b))%mod;}

vec modncrlistp,modncrlistm;

ll modncr(ll n,ll r){
  if(n<r)return 0;
  ll i,size=modncrlistp.size();
  if(size<=n){
    modncrlistp.resize(n+1);
    modncrlistm.resize(n+1);
    if(!size){
      modncrlistp[0]=modncrlistm[0]=1;
      size++;
    }
    For(i,size,n+1){
      modncrlistp[i]=modncrlistp[i-1]*i%mod;
      modncrlistm[i]=modinv(modncrlistp[i]);
    }
  }
  return modncrlistp[n]*modncrlistm[r]%mod*modncrlistm[n-r]%mod;
}

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

ll gcd(ll a,ll b){if(!b)return a;return (a%b==0)?b:gcd(b,a%b);}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

ll countdigits(ll n){
  ll ans=0;
  while(n){n/=10;ans++;}
  return ans;
}

ll sumdigits(ll n){
  ll ans=0;
  while(n){ans+=n%10;n/=10;}
  return ans;
}
int main(){
  // startupcpp();
  // int codeforces;cin>>codeforces;while(codeforces--){
  ll i,N,K,C,cnt=0;
  string s;
  cin>>N>>K>>C;
  cin>>s;
  vec ans;
  vec mp(N+1,0);
  rep(i,N){
    if(s[i]=='o'){
      cnt++;
      mp[i+1]=1;
      i+=C;
    }
  }
  if(cnt!=K)return 0;
  // output(mp);
  brep(i,N){
    if(s[i]=='o'){
      if(mp[i+1]){
        ans.pb(i+1);
      }
      i-=C;
    }
  }
  vsort(ans);
  rep(i,ans.size())print(ans[i]);
}

Measured memory_bytes: 4980
A=int(input())
print(0)
S=input()
if S=="Vacant":
    exit()

MAX=A
MIN=0
MID=(MAX+MIN)//2
for i in range(19):
    print(MID)
    s=input()
    if s=="Vacant":
        exit()
    elif MID%2==0:
        if S==s:
            MIN=MID
            MID=(MAX+MIN)//2
        else:
            MAX=MID
            MID=(MAX+MIN)//2
    else:
        if S!=s:
            MIN=MID
            MID=(MAX+MIN)//2
        else:
            MAX=MID
            MID=(MAX+MIN)//2

Measured memory_bytes: 3660
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
using ll = long long;
#define fst first
#define snd second

/* clang-format off */
template <class T, size_t D> struct _vec { using type = vector<typename _vec<T, D - 1>::type>; };
template <class T> struct _vec<T, 0> { using type = T; };
template <class T, size_t D> using vec = typename _vec<T, D>::type;
template <class T> vector<T> make_v(size_t size, const T& init) { return vector<T>(size, init); }
template <class... Ts> auto make_v(size_t size, Ts... rest) { return vector<decltype(make_v(rest...))>(size, make_v(rest...)); }
template <class T> inline void chmin(T &a, const T& b) { if (b < a) a = b; }
template <class T> inline void chmax(T &a, const T& b) { if (b > a) a = b; }
/* clang-format on */

const ll INF = 1ll << 60;

ll getmin(const vector<ll>& a, ll x) {
  int A = a.size();
  int right = distance(a.begin(), lower_bound(a.begin(), a.end(), x));
  int left = right - 1;
  ll res = INF;
  if (right < A) chmin(res, a[right] - x);
  if (left >= 0) chmin(res, x - a[left]);
  return res;
}

ll func(const vector<ll>& a, const vector<ll>& b, ll x) {
  int A = a.size();
  int right = distance(a.begin(), lower_bound(a.begin(), a.end(), x));
  int left = right - 1;
  ll res = INF;
  if (right < A) chmin(res, getmin(b, a[right]) + a[right] - x);
  if (left >= 0) chmin(res, getmin(b, a[left]) + x - a[left]);
  return res;
}

int main() {
#ifdef DEBUG
  ifstream cin("in.txt");
#endif
  int A, B, Q;
  while (cin >> A >> B >> Q) {
    vector<ll> a(A), b(B);
    for (int i = 0; i < A; i++) cin >> a[i];
    for (int i = 0; i < B; i++) cin >> b[i];
    for (int q = 0; q < Q; q++) {
      ll x;
      cin >> x;
      ll res = min(func(a, b, x), func(b, a, x));
      cout << res << endl;
    }
  }
  return 0;
}


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

int main() {
	ios_base::sync_with_stdio( false );

	int N;
	cin >> N;

	vector<int> a( N );
	for( auto& v: a ) {
		cin >> v;
		v -= 1;
	}

	int ans = 0;
	for( int i = 0; i < N; ++i ) {
		ans += (a[a[i]] == i);
	}

	cout << ans/2 << endl;

	return 0;
}


Measured memory_bytes: 640
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);

		class Task{
			int A;
			int B;

			public Task(int A, int B) {
				this.A = A;
				this.B = B;
			}

			int getA() {
				return A;
			}

			int getB() {
				return B;
			}
		}

		int N = sc.nextInt();
		Task[] tasks = new Task[N];

		for(int i=0; i<N; i++) {
			int A = sc.nextInt();
			int B = sc.nextInt();
			tasks[i] = new Task(A, B);
		}

		sc.close();

		Arrays.sort(tasks, Comparator.comparing(Task::getB));

		String ans = "Yes";
		int time = 0;
		for(int i=0; i<N; i++) {
			int A = tasks[i].getA();
			int B = tasks[i].getB();

			if(time + A > B) {
				ans = "No";
				break;
			}

			time += A;
		}

		System.out.println(ans);
	}

}



Measured memory_bytes: 163624
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n,y,i,m=1,p;
   cin>>n;
   
   int a[1000] = { 1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51 };
	cout << a[n - 1] << endl;
}



Measured memory_bytes: 3580
n=int(input())
s=input()
ans = 0
j=0
for i in s:
    if i=="A":
        j=1
        continue
    if i=="B" and j==1:
        j=2
    elif i=="C" and j==2:
        ans+=1
        j=0
    else:
        j=0
print(ans)    

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

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

    int N, X;
    cin >> N >> X;

    int b = 10000;

    for(int i = 0; i < N; i++) {
        int m;
        cin >> m;
        b = min(b, m);
        X -= m;
    }

    cout << X / b + N << endl;
}

Measured memory_bytes: 256
import math

N,D = map(int,input().split())

ary = []
for _ in range(N):
    ary.append(list(map(int,input().split())))

counter = 0
ary_len = len(ary)
for i in range(ary_len - 1):
    for j in range(i+1,ary_len):
        tmp = 0
        for k in range(D):
            tmp += pow(abs(ary[i][k]-ary[j][k]),2)
        if math.sqrt(tmp) % 1 == 0:
            counter += 1
print(counter)


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


using namespace std;
#define rep(i,n) for (int i = 0; i < (int)(n); ++i)
#define reps(i,n) for (int i = 1; i <= (int)(n); ++i)
#define repd(i,n) for (int i = (int)(n - 1); i >= 0; --i)
#define repds(i,n) for (int i = (int)(n); i > 0; --i)
#define loop(i,x,n) for (int i = (int)(x); i < (n); ++i)
#define loops(i,x,n) for (int i = (int)(x); i <= (n); ++i)
#define loopd(i,x,n) for (int i = (int)(x); i > (n); --i)
#define loopds(i,x,n) for (int i = (int)(x); i >= (n); --i)
#define itrep(i,s) for (auto i = begin(s); i != end(s); ++i)
#define itrepd(i,s) for (auto i = rbegin(s); i != rend(s); ++i)
#define all(f,x,...) [&](decltype(x)& whole) { return (f)(begin(whole), end(whole), ##__VA_ARGS__); }(x)
#define rall(f,x,...) [&](decltype(x)& whole) { return (f)(rbegin(whole), rend(whole), ##__VA_ARGS__); }(x)
using ll = long long;
using ld = long double;
constexpr ll inf = static_cast<ll>(1e17);
constexpr int iinf = static_cast<int>(1e9);
constexpr double dinf = 1e10;
constexpr ld ldinf = 1e17;
ll mod = static_cast<ll>(1e9 + 7);
std::ostream& endn(std::ostream& os) { return os.put(os.widen('\n')); }
template<class T> constexpr int sz(const T& a) { return (int)a.ne(); }
template<class T> constexpr T pow2(const T a) { return a * a; }
template<class T, class ... Args> constexpr T mins(T& a, Args... args) { return a = min<T>({ a, args... }); }
template<class T, class... Args> constexpr T maxs(T& a, Args... args) { return a = max<T>({ a,args... }); }
template<typename A, int N, typename T>
void fillArray(A(&array)[N], const T& val) { std::fill((T*)array, (T*)(array + N), val); }

string s;
void solve() {
    cin >> s;

    bool ok = s.size() % 2 == 0;
    rep(i, s.size())
        if (i % 2 == 0 && s[i] != 'h') {
            ok = false;
            break;
        }
        else if (i % 2 != 0 && s[i] != 'i') {
            ok = false;
            break;
        }

    if (ok) cout << "Yes" << endn;
    else cout << "No" << endn;

}

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


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll           long long
#define N            100005
#define Fill(a,b)    memset(a,b,sizeof a)

ll dist[N];
ll vis[N];
vector<pair <ll,ll> >nod[N];
void dijkstra(int s) {
    priority_queue< pair <ll,ll> >pq;
    for(int i=0; i<N; i++) {
        vis[i]=0,dist[i]= LLONG_MAX;
    }
    pq.push(make_pair(0,s));
    vis[s]=true;
    dist[s]=0;
    //stk.push(n);
    while(!pq.empty()) {
        ll u = pq.top().second;
        vis[u]=true;
        pq.pop();
        for(int i=0; i<nod[u].size(); i++) {
            ll p = nod[u][i].first;
            ll q = nod[u][i].second;
            if(dist[p]>dist[u]+q) {
                dist[p]=dist[u]+q;
                if(!vis[p])
                    pq.push(make_pair(-1LL*dist[p],p));
            }
        }
    }
}
int main() {
    int u,v,w,i,j,n,m;
    scanf("%d",&n);
    for(i=1; i<n; i++) {
        ll l,r,k;
        scanf("%lld%lld%lld",&l,&r,&k);
        nod[l].push_back({r,k});
        nod[r].push_back({l,k});
    }
    /*for(i=0;i<s.size();i++)
    {
        cout<<s[i]<<endl;
    }*/
    scanf("%d%d",&m,&w);
    dijkstra(w);
    for(i=1; i<=m; i++) {
        scanf("%d %d",&u,&v);
        ll f=dist[u]+dist[v];
        printf("%lld\n",f);
    }

    return 0;
}


Measured memory_bytes: 11888
#include <stdio.h>
int parent(int i)
{
  return i/2;
}
int left(int i)
{
  return 2*i;
}
int right(int i)
{
  return 2*i+1;
}

int key[251];

int main()
{
  int h,i,p,r,l;
  
  scanf("%d",&h);
  for(i=1;i<=h;i++)
    {
      scanf("%d",&key[i]);
    }
  for(i=1;i<=h;i++)
    {
      printf("node %d: ",i);
      printf("key = %d, ",key[i]);
      p=parent(i);
      l=left(i);
      r=right(i);
      if(p>=1)printf("parent key = %d, ",key[p]);
      if(l<=h)printf("left key = %d, ",key[l]);
      if(r<=h)printf("right key = %d, ",key[r]);
      printf("\n");
    }
  return 0;
}



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

int main(){

    int k,x;
    cin >> k >> x;

    for(int i=x-k+1;i<x+k;i++){
        cout << i << " ";
    }cout << endl;

    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner((System.in));
		int a = sc.nextInt();
		int b = sc.nextInt();
		int ans = 0;
		
		ans = (a - 1) * (b - 1);
		
		System.out.println(ans);

		sc.close();
	}
}


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

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;
  
  int L = A + B;
  int R = C + D;
  
  if (L > R) {
    cout << "Left" << endl;
  }
  else if (L == R) {
    cout << "Balanced" << endl;
  }
  else {
    cout << "Right" << endl;
  }
}

Measured memory_bytes: 256
package main

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

func main() {
	readVariables()
	result := judge.EvalDays(t)
	for _,v := range result {
		fmt.Println(v)
	}
}

type Solution [365]int
type Gain [365][26]int
type Penalty [26]int
type Judge struct {
	gain Gain
	penalty Penalty
	span int
	kind int
}

// EvalDays returns score for given solution
func (jd Judge) EvalDays(s Solution) []int {
	var last []int = make([]int, K)
	for i:=0;i<K;i++ {
		last[i] = -1 // day should be 0-indexed
	}
	var score int
	var result []int
	for i:=0;i<D;i++ {
		// Add satisfaction
		score += jd.gain[i][s[i]]
		// Update last 
		last[s[i]] = i
		// Calculate penalty for not holding certain type of contests
		// can be O(1)
		p := 0
		for j := 0; j<K; j++ {
			p += jd.penalty[j] * (i - last[j]) // always >= 0
		}
		score -= p
		result = append(result, score)
	}
	return result
}

var (
	D int
	K int = 26
	c Penalty
	s Gain
	t Solution
	judge Judge
)

func readVariables() {
	D = nextInt()
	for i:=0;i<K;i++ {
		c[i] = nextInt()
	}
	for i:=0;i<D;i++ {
		for j:=0;j<K;j++ {
			s[i][j] = nextInt()
		}
	}
	judge = Judge{
		gain: s,
		penalty: c,
		span: D,
		kind: K,
	}
	for i:=0;i<D;i++ {
		t[i] = nextInt() - 1 // convert to 0-indexed 
	}
}



/* Template */

var scanner *bufio.Scanner

func init() {
	Max := 1001001
	scanner = bufio.NewScanner(os.Stdin)
	scanner.Buffer(make([]byte, 0, Max), Max)
	scanner.Split(bufio.ScanWords)
}

//nextInt converts next token from stdin and returns integer value.
//nextInt panics when conversion into an integer fails.
func nextInt() int {
	if !scanner.Scan() {
		panic("No more token.")
	}
	num, err := strconv.Atoi(scanner.Text())
	if err != nil {
		panic("nextInt(): cannot convert to int: " + scanner.Text())
	}
	return num
}

func nextStr() string {
	if !scanner.Scan() {
		panic("No more token.")
	}
	return scanner.Text()
}

// MinInt returns minimum argument
func MinInt(x, y int) int {
	if x < y {
		return x
	} else {
		return y
	}
}

//MaxInt returns maximum argument
func MaxInt(x, y int) int {
	if x < y {
		return y
	} else {
		return x
	}
}

//AbsInt returns |x| for x
func AbsInt(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

//ModPow calculates integer power with modulo operation
//if modulo <= 1, it powers w/o module operation
//if base < 0, return value might be negative too.
func ModPow(base, exponent, modulo int) (result int) {
	result = 1
	for exponent > 0 {
		if exponent%2 == 1 {
			result *= base
			if modulo > 1 {
				result %= modulo
			}
		}
		base *= base
		if modulo > 1 {
			base %= modulo
		}
		exponent /= 2
	}
	return
}

//Gcd
func Gcd(vals ...int) (result int) {
	if len(vals) == 0 {
		return
	}
	result = vals[0]
	for i := 1; i < len(vals); i++ {
		result = gcd(result, vals[i])
	}
	return
}

func gcd(x, y int) int {
	x, y = AbsInt(x), AbsInt(y)
	for y > 0 {
		x, y = y, x%y
	}
	return x
}

//Lcm
func Lcm(vals ...int) (result int) {
	if len(vals) == 0 {
		return
	}
	result = vals[0]
	for i := 1; i < len(vals); i++ {
		result = lcm(result, vals[i])
	}
	return
}

func lcm(x, y int) int {
	return x * y / gcd(x, y)
}


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

int main() {
  
  int A,B,a,b,c,max;
  cin>>A>>B;
  a=A+B;
  b=A-B;
  c=A*B;
  if (a>=b){
    if(a>=c){max=a;}}
 if (b>=a){
    if(b>=c){max=b;}}
if (c>=a){
    if(c>=b){max=c;}}
cout<<max<<endl;

} 

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

using namespace std;
int main()
{
	char a;
  	cin>>a;
 	int ascii=int(a);
  	if(ascii>=65 && ascii <=90)
    {
    	cout<<"A";
    }
  	else if(ascii>=97 && ascii <=122)
    {
    	cout<<"a";
    }
}

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

long long int N, M;

int ddt(long long A){
    int ret = 0;
    while(A){
        ++ret;
        A /= 10;
    }
    return ret;
}

int main(){
    scanf("%lld", &N);
    M = int(sqrt(N));
    for(; M > 0; --M){
        if(N % M == 0){
            cout << ddt(N / M) << endl;
            return 0;
        }
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <math.h>
#include <vector>
#include <map>
#include <queue>
#include <utility>
#include <algorithm>
#include <string>
#include <set>
#include <random>
using namespace std;
int main() {
  int N;
  cin >> N;
  int prime[25] = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97 };
  vector <int> pc(25, 0);
  for (int i = 2; i <= N; i++) {
	  int n = i;
	  int j = 0;
	  while (n > 1) {
		  while (n % prime[j] == 0) {
			  pc[j]++;
			  n /= prime[j];
			}
		  j++;
		}
	}
  int c[75] = { };
  for (int i = 0; i < 25; i++) {
	  for (int j = 1; j <= 74; j++) {
		  if (pc[i] >= j) {
			  c[j]++;
			}
		}
	}
  cout << c[4] * (c[4] - 1) * (c[2] - 2) / 2 + c[74] + (c[2] - 1) * c[24]  + c[14] * (c[4] - 1) << endl;
  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 REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1e9
typedef long long ll;


int main() {
    int N; cin >> N;
    while(N%111!=0){
        N++;
    }
    cout << N << endl;
    return 0;
}

Measured memory_bytes: 3588
#include <cstdio>
int n, a, b, tmp, ans;
int main() {
	scanf("%d%d%d", &n, &a, &b);
	while (n --> 0) {
		scanf("%d", &tmp);
		if (tmp < a || tmp >= b) ans++;
	}
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 128
/*
 * Author: .-O_O-.
 */
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include<bits/stdc++.h>
using namespace __gnu_pbds;
using namespace std;
#define ll long long
#define pb push_back
#define vi vector<int>
#define rep0(a,b) for(int a=0;a<b;a++)
#define rep1(a,b) for(int a=1;a<=b;a++)
#define repp(a,b,c) for(int a=b;a<c;a++)
#define in insert
#define len length()
#define si size()
#define lb lower_bound
#define ub upper_bound
#define beg begin()
#define en end()
#define f first
#define s second
#define pr(a) cout<<a
#define pr2(a,b) cout<<a<<" "<<b<<"\n"
#define nx cout<<"\n"
#define int long long
// void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
                                                     
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]"<<endl;}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define deb(x...)
#endif
const ll mod = 1000000007;
const ll N = 105;
const ll mm = 1e+18;
void solve()
{
    int x;
    cin>>x;
    int ans=2*(x/11);
    x%=11;
    if(x){
        if(x>6) ans+=2;
        else ans++;
    }
    pr(ans);
}
signed main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int t=1;
    //cin>>t;
    rep1(_i,t){
        //cout<<"Case #"<<_i<<": ";
        solve();
        //nx;
    }
    return 0;
}

Measured memory_bytes: 3616
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <math.h>
using namespace std;
#define int long long


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

    int n; cin >> n;
    vector<int> x(n),y(n),h(n);
    for(int i = 0;i < n;i ++){
        cin >> x.at(i) >> y.at(i) >> h.at(i);
    }

    vector<int> hn(n);
    for(int i = 0;i < n;i ++){
        hn.at(i) = h.at(i);
    }
    sort(hn.begin(),hn.end());
    int hm = hn.at(0), hM = hn.at(n-1);

    for(int X = 0;X <= 100;X ++){
        for(int Y = 0;Y <= 100;Y ++){
            for(int H = hM;H <= hm+200;H ++){
                for(int i = 0;i < n;i ++){
                    if(max(H - abs(X-x.at(i)) - abs(Y-y.at(i)) , (int) 0) != h.at(i)) break;
                    if(i == n-1){
                        cout << X << " " << Y << " " << H << endl;
                        return 0;
                    }
                }
            }
        }
    }
}

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

const int MAXN = 1e5 + 10;
string a[MAXN];

int main()
{
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	int n;
	cin >> n;
	for (int i = 0; i < n; ++i)
	{
		cin >> a[i];
		sort(a[i].begin(), a[i].end());
	}
	sort(a, a + n);
	a[n] = "#";
	LL ans = 0;
	LL cnt = 1;
	for (int i = 0; i < n; ++i)
	{
		if (a[i] == a[i + 1])
		{
			cnt++;
		}
		else
		{
			ans += cnt * (cnt - 1) / 2;
			cnt = 1;
		}
	}
	cout << ans;
	return 0;
}

Measured memory_bytes: 5760
import java.util.*;

//update 2020/1/1 23:01

public class Main{

  static Scanner sc = new Scanner(System.in);
  static StringBuilder sb = new StringBuilder();

  public static void main(String[] args) {

    int x = nextInt();
    int n = nextInt();
    if(n==0){
      System.out.println(x);
    }
    else{
      int[] p = new int[210];
      for(int i=0;i<n;i++){
        p[nextInt()]++;
      }

      int abs = 0;
      int ans = 999;
      int anss = 0;

      for(int i=-100;i<105;i++){
        if(i>=0 && p[i]==0){
          abs = Math.abs(i-x);
          if(abs<ans){
            ans = abs;
            anss = i;
          }
        }
        if(i<0){
          abs = Math.abs(i-x);
          if(abs<ans){
            ans = abs;
            anss = i;
          }
        }
      }

      System.out.println(anss);

    }



    //System.out.println();

  }

  static int lcm(int a,int b){
    return a*b*gcd(a,b);
  }

  static int gcd(int a,int b){
    if(a%b!=0){
      return gcd(b,a%b);
    }
    else{
      return b;
    }
  }

  /*
    static String toSmall(String s){
      char c = s.charAt(0);
      //if(Character.isUpperCase(c)){
      if(c<=90){
        c += 32;
      }
      return String.valueOf(c);
    }
    static String toBig(String s){
      char c = s.charAt(0);
      //if(Character.isLowerCase(c)){
      if(c>=97){
        c -= 32;
      }
      return String.valueOf(c);
    }
  */

  static String toSmall(String s){
    return s.toLowerCase();
  }

  static String toBig(String s){
    return s.toUpperCase();
  }

  static String next(){
    return sc.next();
  }

  static int nextInt(){
    return Integer.parseInt(sc.next());
  }

  static long nextLong(){
    return Long.parseLong(sc.next());
  }

  static double nextDouble(){
    return Double.parseDouble(sc.next());
  }

  static String[] splitString(String s){
    return s.split("");
  }

  static char[] splitChar(String s){
    return s.toCharArray();
  }

  static int charToInt(char a){
    return a - 48;
  }

////////////////////////////////////////////
  public static int max(int[] a){
    int lng = a.length;
    int max = a[0];
    for(int i=1;i<lng;i++){
      max = Math.max(max,a[i]);
    }
    return max;
  }
  public static long max(long[] a){
    int lng = a.length;
    long max = a[0];
    for(int i=1;i<lng;i++){
      max = Math.max(max,a[i]);
    }
    return max;
  }
////////////////////////////////////////////

////////////////////////////////////////////
  public static int min(int[] a){
    int lng = a.length;
    int min = a[0];
    for(int i=1;i<lng;i++){
      min = Math.min(min,a[i]);
    }
    return min;
  }
  public static long min(long[] a){
    int lng = a.length;
    long min = a[0];
    for(int i=1;i<lng;i++){
      min = Math.min(min,a[i]);
    }
    return min;
  }
////////////////////////////////////////////

}


Measured memory_bytes: 35680
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <cstdlib>
#define llong long long
#define For(i,a,b) for(int i=(a);i<(b);i++)
#define Rep(i,n) for(int i=0;i<(n);i++)
using namespace std;

void modifyprint(string c){
  Rep(i, c.size()){
    if (c[i]=='?'){
      c[i]='a';
    }
    cout << c[i];
  }

}

int main(){
  string a, b;
  cin >> a >> b;
  int cnt=0;
  for (int i=a.size()-1; i>=0; i--){
    if (b[b.size()-1]==a[i]||a[i]=='?'){
      bool result = true;
      for (int j=0; j<b.size(); j++){
        if(a[i-j]==b[b.size()-1-j]||a[i-j]=='?'){
          result &= true;
        } else {
          result &= false;
        }
      }
      if (result == true){
        for (int j=0; j<b.size(); j++){
          a[i-j] = b[b.size()-1-j];
        }
        modifyprint(a);
        cout << endl;
        cnt++;
        break;
      }
    }
  }
  if (cnt==0){
    cout << "UNRESTORABLE" << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
 
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC optimize("-ffloat-store")
 
#define int  long long
#define rep(i,begin,end) for(__typeof(end)i=(begin)-((begin)>(end));i!=(end)-((begin)>(end));i+=1-2*((begin)>(end)))
#define F first
#define S second
#define sz(x) ((int)x.size())
#define pb push_back
#define pf push_front
#define eb emplace_back
#define all(v) (v).begin(), (v).end()
#define mod 1000000007
#define what_is(x) cerr << #x << " is " << x <<"\n";
#define sortA(v) sort(v.begin(), v.end())
#define sortD(v) sort(v.rbegin(), v.rend())
#define PI 3.14159265358979323846
#define vout(a) for(auto x:a) cout<<x<<" ";
#define INF 10000000000000000 //1e16
 
// #define ordered_set tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update>
 
 
// using namespace __gnu_pbds;
using namespace std;
 
using ll  = long long;
using vi  = vector<int>;
using pii = pair<int,int>;
using vii = vector<pii>;
using mi  = multiset<int>;
using mii = multiset<pii>;
 
int lcm(int a,int b) {return (a*(b/__gcd(a,b)));}

vi f(1000000,0);

void pre()
{
    rep(i,1,101)
    {
        rep(j,1,101)
        {
            rep(k,1,101)
            {
                f[i*i+j*j+k*k+i*j+i*k+j*k]++;
            }
        }
    }
}

void solve()
{
    int t,n,m,i,k,r,l,u,v,w,j,s,sum=0,pos,flag=0,count=0;
    string S,T,U; 
    // int x,y;
    cin>>n;
    rep(i,1,n+1) cout<<f[i]<<"\n";
}
 
 
signed main()
{
    #ifndef ONLINE_JUDGE 
       freopen("input.txt","r",stdin);
       freopen("output.txt","w",stdout);
    #endif
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int t=1;
    pre();
    // cin>>t;
    while(t--)
    {
        solve();
        if(t)cout<<"\n";
    }
    return 0;
}


Measured memory_bytes: 10940
#include<cstdio>
#include<algorithm>
using namespace std;


int main(){
  int a[4],b[2];
  for(int i=0;i<4;i++) scanf("%d",a+i);
  for(int i=0;i<2;i++) scanf("%d",b+i);
  sort(a,a+4);
  sort(b,b+2);
  int ans = 0;
  for(int i=3;i>0;i--) ans+=a[i];
  ans+=b[1];
  printf("%d\n",ans);
  return 0;
}

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

using ll = long long;
using P = pair<int, int>;

const int INF = 1e9;
const int MOD = 1e9 + 7;

// 4近傍、8近傍
int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};

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

  int ans = 0;
  for (int i = 1; i <= N; i++) {
    if (i < 10 || (100 <= i && i <= 999) || (10000 <= i && i <= 99999)) ans++;
  }

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


Measured memory_bytes: 256
//
// Created by yamunaku on 2019/08/30.
//

#include <bits/stdc++.h>

using namespace std;

#define rep(i, n) for(int i = 0; i < (n); i++)
#define repl(i, l, r) for(int i = (l); i < (r); i++)
#define per(i, n) for(int i = ((n)-1); i >= 0; i--)
#define perl(i, l, r) for(int i = ((r)-1); i >= (l); i--)
#define all(x) (x).begin(),(x).end()
#define MOD9 998244353
#define MOD1 1000000007
#define IINF 1000000000
#define LINF 1000000000000000000
#define SP <<" "<<
#define CYES cout<<"Yes"<<endl
#define CNO cout<<"No"<<endl
#define CFS cin.tie(0);ios::sync_with_stdio(false)
#define CST(x) cout<<fixed<<setprecision(x)

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vector<int>> mti;
typedef vector<ll> vl;
typedef vector<vector<ll>> mtl;

int main(){
    int n;
    cin >> n;
    mtl a(n, vl(n, 0));
    ll total = 0;
    rep(i, n){
        rep(j, i) cin >> a[i][j], total += a[i][j];
        repl(j, i + 1, n) cin >> a[i][j], total += a[i][j];
        reverse(all(a[i]));
    }
    reverse(all(a));
    mtl x(n + 1, vl(n + 1, 0)), y(n + 1, vl(n + 1, 0));
    repl(i, 1, n+1){
        repl(j, 1, i){
            x[i][j] = x[i][j - 1] + a[i - 1][j - 1];
        }
        per(j, i - 1){
            y[i][j] = y[i][j + 1] + a[j][i - 1];
        }
    }
    mtl dp(n + 1, vl(n + 1, 0));
    repl(i, 1, n + 1){
        dp[0][i] = dp[0][i - 1] + y[i][0];
    }
    rep(i, n+1){
        repl(j, i + 1, n+1){
            ll d = 0;
            repl(k, j + 1, n + 1){
                d += x[k][j] + y[k][i];
                dp[j][k] = max(dp[j][k], dp[i][j] + d);
            }
        }
    }
    ll ans = 0;
    rep(i, n) ans = max(ans, dp[i][n]);
    cout << total - ans << endl;
    return 0;
}


Measured memory_bytes: 8192
#include<iostream>
#include<vector>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<map>
#include<string>
#include<numeric>
#include<set>
using namespace std;

int main(){
    long N;
    cin >> N;
    
    vector<vector<long> > AB(N, {0, 0});
    for(int i = 0; i < N; i++) cin >> AB[i][1] >> AB[i][0];

    stable_sort(AB.begin(), AB.end());

    long passed = 0;

    for(int i = 0; i < N; i++){
        passed += AB[i][1];
        
        if(passed > AB[i][0]){
            cout << "No" << endl;
            return 0;
        }
    }

    cout << "Yes" << endl;

    return 0;
}

Measured memory_bytes: 15872
#include<iostream>
#include<algorithm>
#include<cmath>

using namespace std;

int main() {
	string s, c1, c2, c3, c4;
	int i, n;
	int len1, len2;

	cin >> s;

	n = s.size();

	bool can = true;
	for (i = 0; i < (n - 1) / 2; i++) {

		if (s[i] != s[(n - 1) / 2 - 1 - i]) {
			can = false;
		}

	}

	for (i = (n + 3) / 2 - 1; i < n; i++) {

		if (s[i] != s[n - 1 - i]) {
			can = false;
		}
	}

	for (i = 0; i < n; i++) {
		if (s[i] != s[n - i - 1]){
		can = false;
	}
	}
	if (can)cout << "Yes";
	else cout << "No";

	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>


int main() {
  int n;
  int count = 0;
  scanf("%d",&n);

  while(n - 500 >= 0) {
    if(n - 500 >= 0) {
      n = n - 500;
      count += 1000;
    }
  }

  while(n - 5 >= 0) {
    if(n - 5 >=0) {
      n = n-5;
      count += 5;
    }
  }

  printf("%d",count);

  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cmath>
#include<vector>
#include<algorithm>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n)   REP(i,0,n)
#define inf (1<<29)
#define all(n) (n).begin(),(n).end()
#define MAX 1000004
using namespace std;

vector<int> prime;
bool isntprime[MAX+1]; 
void init()
{	
  isntprime[0] = isntprime[1] = true;
  int j;	
  for(int i=2;i<= MAX;i++)if(!isntprime[i])for(prime.push_back(i),j=2*i;j<=MAX;j+=i)isntprime[j] = true;
}

int main()
{
  init();
  int n;
  while(cin >> n,n)
    {
      int p,m;
      //int ans = n/101;
      int ans = 0;
      rep(i,n)
	{
	  cin >> p >> m;
	  int bottom = max(0,p-m);
	  int top = min(999983,p+m);
	  int X = upper_bound(all(prime),top) - lower_bound(all(prime),bottom);
	  if(X == 0)ans--;
	  else      ans += X-1;
	}
      cout << ans << endl;
    }
  return 0;
} 

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

#define int long long
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define all(v) (v).begin(),(v).end()
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define pb push_back
#define fi first
#define se second
template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

int H,W,D;
char fld[111][111];
signed main(){
    cin>>H>>W>>D;
    rep(i,H)cin>>fld[i];

    int ans=0;
    rep(i,H){
        for(int j=0;j<=W-D;j++){
            bool ok=true;
            rep(k,D)if(fld[i][j+k]!='.')ok=false;
            ans+=ok;
        }
    }
    rep(j,W){
        for(int i=0;i<=H-D;i++){
            bool ok=true;
            rep(k,D)if(fld[i+k][j]!='.')ok=false;
            ans+=ok;
        }
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3092
#include <bits/stdc++.h>
#define rep(i,m,n) for(int i=m;i<n;i++)
#define c(n) cin>>n
#define c2(n,m) cin>>n>>m
#define c3(n,m,k) cin>>n>>m>>k
#define c4(n,m,k,l) cin>>n>>m>>k>>l
#define co(n) cout<<n<<endl
using namespace std;

int main(){
  long a,b=2,c=0,d=0,e,n,m=1,x;
  c(n);
  rep(i,2,32){
    if(i*i>n) break;
    while(a<=n){
      a=pow(i,b);
      if(a<=n) m=max(m,a);
      b++;
    }
    b=2;
    a=0;
  }
  co(m);
  
  
  return 0;
}

Measured memory_bytes: 256
from math import ceil


n, h = map(int, input().split())
katana = []
attacker = 0

for _ in range(n):
    array = list(map(int, input().split()))
    katana.append(array)
    if array[0] > attacker:
        attacker = array[0]

katana.sort(key=lambda x:x[1], reverse=True)

ans = 0
for i in range(n):
    if katana[i][1] < attacker:
        break
    h -= katana[i][1]
    ans += 1
    if h <= 0:
        print(ans)
        exit()

ans += ceil(h/attacker)

print(ans)

Measured memory_bytes: 28892
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor, cos, radians, pi, sin
from operator import mul
from functools import reduce
from operator import mul


sys.setrecursionlimit(2147483647)
INF = 10 ** 13
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]

n = I()
A = []
B = []
for _ in range(n):
    s = S()
    ret = 0
    ret2 = 0
    for i in s:
        if ret and i == ')':
            ret -= 1
        elif i == '(':
            ret += 1
        else:
            ret2 += 1
    if ret2 > ret:
        A += [(ret, ret2)]
    else:
        B += [(ret, ret2)]

A.sort()
B.sort(key=lambda x:x[1], reverse=True)
L = A + B
now = 0
for x, y in L:
    if x > now:
        print('No')
        exit()
    now = now - x + y

if now:
    print('No')
else:
    print('Yes')






Measured memory_bytes: 181632
#include <cstdio>
#include <cmath>
#include<iostream>
#include <iomanip>
#include <limits>
using namespace std;
int n;
double x[1005], y[1005], X, Y, d, e;
double dist(double a, double b) {
	return a*a + b*b;
}
int main() {
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%lf%lf", &x[i], &y[i]);
		X += x[i]; Y += y[i];
	}
	X /= n; Y /= n;
	double P = 0.1;
	for (int i = 0; i < 30000; i++) {
		int f = 0;
		d = dist(X - x[0], Y - y[0]);
		for (int j = 1; j < n; j++) {
			e = dist(X - x[j], Y - y[j]);
			if (d < e) { d = e; f = j; }
		}
		X += (x[f] - X)*P;
		Y += (y[f] - Y)*P;
		P *= 0.999;
	}
  cout << setprecision(10) << sqrt(d) << endl;
}

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

// macros
#define int long long 
#define TIME clock() * 1.0 / CLOCKS_PER_SEC
#define all(c) c.begin(), c.end()
#define PB push_back
#define MP make_pair
#define bitcount __builtin_popcount
#define watch(x) cerr<< (#x) << " is " << (x) <<"\n";
#define sz(x) ((int)((x).size()))
#define UNIQUE(c) (c).resize(unique(all(c)) - (c).begin())
#define pii2ll(p) ((ll)(p).first<<32 | (p).second)

// type definitions
typedef long long ll;
typedef vector<int> vi;
typedef vector< vi > vvi;
typedef pair<int, int> pii;
typedef long double ld;

// template functions
template < typename A, typename B >
ostream &operator << ( ostream& os, const pair< A, B > & p ) {
    return os << "(" << p.first << ", " << p.second << ")";
}
template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v ) {
    os << "[";
    typename vector< T > :: const_iterator it;
    for( it = v.begin(); it != v.end(); it++ ) {
        if( it != v.begin() ) os << ", ";
        os << *it;
    }
    return os << "]";
}
template < typename T >
ostream &operator << ( ostream & os, const set< T > &v ) {
    os << "{";
    typename set< T > :: const_iterator it;
    for ( it = v.begin(); it != v.end(); it++ ) {
        if( it != v.begin() ) os << ", ";
        os << *it;
    }
    return os << "}";
}
template < typename A, typename B >
ostream &operator << ( ostream & os, const map< A, B > &v ) {
    os << "[";
    typename map< A, B >::const_iterator it;
    for( it = v.begin(); it != v.end(); it++ ) {
        if( it != v.begin() ) os << ", ";
        os << it -> first << " -> " << it -> second ;
    }
    return os << "]";
}
template <typename T1, typename T2>
inline auto mini(T1 a, T2 b) { return (a < b ? a : b); }
template<typename T, typename... Args>
inline auto mini(T a, Args... args) { return mini(a, mini(args...)); }
template <typename T1, typename T2>
inline auto maxi(T1 a, T2 b) { return (a > b ? a : b); }
template<typename T, typename... Args>
inline auto maxi(T a, Args... args) { return maxi(a, maxi(args...)); }
template<typename T>
T gcd(T a, T b) { if(a==0 or b==0) return a+b; return gcd(b, a%b) ; }
template<typename T>
T lcm(T a, T b) { if(a==0 or b==0) return 0; return a/gcd(a, b)*b; }

// random number generation
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); // use mt19937_64 for 64 bit

// constants
const long double eps = LDBL_EPSILON;
const int inf = 1e15;
const int modn = 1e9+7;
const int maxn = 2e5+3;

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    // Your code here
    string s, t;
    cin >> s>>t;
    int ans =0;
    for(int i=0; i<sz(s); i++) {
        if(s[i] != t[i]) {
            ans++;
        }
    }
    cout << ans << "\n";
    return 0;
}



Measured memory_bytes: 3880
#include <stdio.h>
#include <limits.h>
int A[100][100];
int d[100];
int v[100];

void getMST(int n){
	int i,j,k=1;
	int minCost,min,result=0;

	d[0] = 0;
	v[0] = 1;
	for(i=1;i<n;i++) v[i]=0;

	while(1){
		minCost = 2001;
		for(i=0;i<k;i++){
			for(j=0;j<n;j++){
				if( A[d[i]][j]<minCost && A[d[i]][j] != -1 && v[j] != 1){
					minCost = A[d[i]][j];
					min = j; 
				}
			}
		}

		if(k != n){
			d[k] = min;
			v[min] = 1;
			result += minCost;
			k++;
		}
		else break;
	}
	printf("%d\n",result);
}

int main(){
	int n;
	int i,j;

	scanf("%d",&n);
	for(i=0;i<n;i++){
		for(j=0;j<n;j++){
			scanf("%d",&A[i][j]);
			//A[i][j] = A[i][j]==-1?INT_MAX:A[i][j];
		}
	}

getMST(n);

	return 0;
}

Measured memory_bytes: 636
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		int c = Integer.parseInt(sc.next());
		if (a != b) {
			System.out.println("No");
		} else if (a != c) {
			System.out.println("No");
		} else {
			System.out.println("Yes");
		}
		sc.close();
	}
}

Measured memory_bytes: 21584
// ====================================
//   author: M_sea
//   website: https://m-sea-blog.com/
// ====================================
#include <bits/stdc++.h>
#define file(x) freopen(#x".in","r",stdin); freopen(#x".out","w",stdout)
#define debug(...) fprintf(stderr,__VA_ARGS__)
using namespace std;
typedef long long ll;

ll read() {
	ll X=0,w=1; char c=getchar();
	while (c<'0'||c>'9') { if (c=='-') w=-1; c=getchar(); }
	while (c>='0'&&c<='9') X=X*10+c-'0',c=getchar();
	return X*w;
}

int main() {
	ll n=read(),m=read();
	puts(abs(n-m)<=1?"Brown":"Alice");
	return 0;
}

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

int main()
{
  int A, B, K; cin >> A >> B >> K;
  vector<int> ans;

  for(int i = 1; i < min(A,B)+1; i ++) {
    if (A % i == 0 && B % i == 0) {
      ans.push_back(i);
    }
  }



  cout << ans[ans.size()-K] << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#ifdef LOCAL
#define debug(x) cout << #x << " = " << x << endl
#else
#define debug(x) 0
#endif
#define pb push_back
#define F first
#define S second
#define SZ(x) ((int)x.size())
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;

const int MAX = 200005;
int v[MAX];
int pot[31];
map<int, int> mapa;

int main() {
    #ifdef LOCAL
        freopen("in.txt", "r", stdin);
        //freopen("out.txt", "w", stdout);
    #endif
    ios::sync_with_stdio(0);
    cin.tie(0);

    pot[0] = 1;
    for(int i = 1; i <= 30; i++){
        pot[i] = pot[i-1]*2;
    }

    int n;
    cin >> n;
    for(int i = 0; i < n; i++){
        cin >> v[i];
        mapa[v[i]]++;
    }
    sort(v, v+n);
    int ans = 0;
    for (int i = n-1; i > 0; i--) {
        if (mapa[v[i]]) {
            mapa[v[i]]--;
            int p = pot[lower_bound(pot, pot+31, v[i]) - pot];
            if (v[i] != p) p -= v[i];
            if (mapa.count(p) && mapa[p]) {
                mapa[p]--;
                ans++;
            }
        }
    }
    cout << ans << '\n';
}


Measured memory_bytes: 10368
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(a,b) for(int a=0;a<(b);++a)
#define REP1(i,n) for(int i=1;i<=(n);++i)
#define debug(x) cerr<<#x<<": "<<x<<'\n'
#define all(x) (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define isYES(x) printf("%s\n",(x) ? "YES" : "NO")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define isYes(x) printf("%s\n",(x) ? "Yes" : "No")
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair
#define INF (1<<29)
#define Sp(p) cout<<setprecision(25)<< fixed<<p<<endl
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
#define X first
#define Y second
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;


template<class T=int>
T in(){T x;cin>>x;return (x);}
template<class T>
void print(T& x){cout<<x<<'\n';}

const int MOD =(int)1e9+7;
const int MAX =510000;
ll fac[MAX],finv[MAX],inv[MAX];
void COMint(){
    fac[0]=fac[1]=1;
    finv[0]=finv[1]=1;
    inv[1]=1;
    for(int i=2;i<MAX;i++){
        fac[i]=fac[i-1]*i%MOD;
        inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;
        finv[i]=finv[i-1]*inv[i]%MOD;
    }
}
ll COM(int n,int k){
    if(n<k) return 0;
    if(n<0||k<0)return 0;
    return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;
}
ll gcd(ll a,ll b){
    if(b==0)return a;
    if(a>b){
        swap(a,b);
    }
    return gcd(a,b%a);
}
ll lcm(ll a,ll b){
    ll g;g=gcd(a,b);
    return a*b/g;
}
bool compare_by_b(pair<int, int> a, pair<int, int> b) {
    if(a.second != b.second){
        return a.second < b.second;
    }else{
        return a.first < b.first;
    }
}

bool compare_by_a(pair<int, int> a, pair<int, int> b) {
    if(a.first != b.first){
        return a.first < b.first;
    }else{
        return a.second < b.second;
    }
}
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

ll RS(ll N,ll P,ll M){
    if(P==0){
        return 1;
    }else{
        if(P%2==0){
            ll t=RS(N,P/2,M);
            return t*t%M;
        }else{
            return N*RS(N,P-1,M)%M;
        }
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N,X,Y;
    cin>>N>>X>>Y;
    --X;--Y;
    vector<vector<int>>dist(N,vector<int>(N,0));
    REP(i,N)REP(j,N){
        if(j>=i)continue;
        dist[i][j]=min(abs(i-j),abs(Y-i)+abs(X-j)+1);
        //debug(abs(Y-i)+abs(X-j)+1);
    }
    
    vector<int> ans(N-1,0);
    REP(i,N)REP(j,N){
        if(j>=i)continue;
        ans[dist[i][j]-1]++;
    }
    REP(i,N-1){
        cout<<ans[i]<<endl;
    }
    return 0;
}


Measured memory_bytes: 16000
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')


n = I()
a = LI()
a = [0] + a + [0]
sum_a = sum([abs(a[i] - a[i - 1]) for i in range(1, n + 2)])
ans = []
for i in range(1, n + 1):
    diff = - abs(a[i] - a[i - 1]) - abs(a[i + 1] - a[i]) + \
        abs(a[i + 1] - a[i - 1])
    cost = sum_a + diff
    ans.append(cost)
print(*ans, sep='\n')


Measured memory_bytes: 20748