akhauriyash/Code-Regression huggingface dataset:
/*やったぜ。　投稿者：変態糞土方 (8月16日（水）07時14分22秒)

昨日の8月15日にいつもの浮浪者のおっさん（60歳）と先日メールくれた汚れ好きの土方のにいちゃん

（45歳）とわし（53歳）の3人で県北にある川の土手の下で盛りあったぜ。

今日は明日が休みなんでコンビニで酒とつまみを買ってから滅多に人が来ない所なんで、

そこでしこたま酒を飲んでからやりはじめたんや。

3人でちんぽ舐めあいながら地下足袋だけになり持って来たいちぢく浣腸を3本ずつ入れあった。

しばらくしたら、けつの穴がひくひくして来るし、糞が出口を求めて腹の中でぐるぐるしている。

浮浪者のおっさんにけつの穴をなめさせながら、兄ちゃんのけつの穴を舐めてたら、

先に兄ちゃんがわしの口に糞をドバーっと出して来た。

それと同時におっさんもわしも糞を出したんや。もう顔中、糞まみれや、

3人で出した糞を手で掬いながらお互いの体にぬりあったり、

糞まみれのちんぽを舐めあって小便で浣腸したりした。ああ～～たまらねえぜ。

しばらくやりまくってから又浣腸をしあうともう気が狂う程気持ちええんじゃ。

浮浪者のおっさんのけつの穴にわしのちんぽを突うずるっ込んでやると

けつの穴が糞と小便でずるずるして気持ちが良い。

にいちゃんもおっさんの口にちんぽ突っ込んで腰をつかって居る。

糞まみれのおっさんのちんぽを掻きながら、思い切り射精したんや。

それからは、もうめちゃくちゃにおっさんと兄ちゃんの糞ちんぽを舐めあい、

糞を塗りあい、二回も男汁を出した。もう一度やりたいぜ。

やはり大勢で糞まみれになると最高やで。こんな、変態親父と糞あそびしないか。

ああ～～早く糞まみれになろうぜ。

岡山の県北であえる奴なら最高や。わしは163*90*53,おっさんは165*75*60、や

糞まみれでやりたいやつ、至急、メールくれや。

土方姿のまま浣腸して、糞だらけでやろうや。*/
#include "bits/stdc++.h"
#include <unordered_set>
#define rep(i,n) for(ll i = 0; i < n; i++)
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define vll vector<vector<long long>>
#define vl vector<long long>
#define vi vector<int>
#define vii vector<vector<int>>
#define pb push_back
#define pf push_front
#define ld long double
#define Sort(a) sort(a.begin(),a.end())
#define cSort(a,cmp) sort(a.begin(),a.end(),cmp)
#define reSort(a) sort(a.rbegin(), a.rend())
static ll llMAX = numeric_limits<long long>::max();
static int intMAX = numeric_limits<int>::max();
static ll  llMIN = numeric_limits<long long>::min();
static int intMIN = numeric_limits<int>::min();
static ll d_5 = 100000;
static ll d9_7 = 1000000007;
static ll d_9 = 1000000000;
template<class T>
void Printvector(std::vector<T> a){
  int size = a.size();
  rep(i,size){
    cout<<a[i]<<" ";
  }
  cout<<endl;
}
template<class T>
void Printvector(std::vector<std::vector<T>> a){
  int size = a.size();
  rep(i,size){
    int size2=a[i].size();
    rep(j,size2){
      cout<<a[i][j]<<" ";
    }
    cout<<endl;
  }
  cout<<endl;
}
ll digitpower(ll a,ll b){//aのb乗を計算
  if(b==1){
    return a;
  }else if(b==0){
    return 1;
  }
  if(b%2==1){
    ll tmp = digitpower(a,(b-1)/2);
    tmp%=d9_7;
    tmp*=tmp;
    tmp%=d9_7;
    tmp*=a;
    return (tmp)%d9_7;
  }else{
    ll tmp = digitpower(a,(b)/2);
    tmp%=d9_7;
    tmp*=tmp;
    tmp%=d9_7;
    return (tmp)%d9_7;
  }
}

//cout<<"cout (set(10))"<<std::setprecision(10)<<kilopi<<endl;
struct datas{
  ll x;
  ll y;
  bool used=false;
};
bool cmp(const datas &a, const datas &b)
{
    return a.x < b.x;
}
bool cmp2(const datas &a, const datas &b)
{
    return a.y < b.y;
}
int main(void){
  int n;
  cin>>n;
  vector<datas> red(n),blue(n);
  rep(i,n){
    cin>>red[i].x>>red[i].y;
  }
  rep(i,n){
    cin>>blue[i].x>>blue[i].y;
  }
  sort(blue.begin(),blue.end(),cmp);
  sort(red.begin(),red.end(),cmp2);
  rep(j,n){
    rep(i,n){
      if(blue[j].x>red[n-1-i].x &&blue[j].y>red[n-1-i].y && blue[j].used==false&& red[n-1-i].used==false){
        red[n-1-i].used=true;
        blue[j].used=true;
        break;
      }
    }
  }
  int cnt=0;
  rep(i,n){
    if(red[i].used){
      cnt++;
    }
  }
  cout<<cnt<<endl;
  return 0;

}


Measured memory_bytes: 256
N, K = map(int, input().split())
x_list = [0]*N
y_list = [0]*N
for i in range(N):
    x_list[i], y_list[i] = map(int, input().split())

x_sort_list = sorted(x_list)
y_sort_list = sorted(y_list)
ans = float("inf")

for i in range(len(x_sort_list)):
    for j in range(len(y_sort_list)):
        for k in range(i+1, len(x_sort_list)):
            for l in range(j+1, len(y_sort_list)):
                num = 0
                for m in range(N):
                    if x_sort_list[i] <= x_list[m] <= x_sort_list[k] and y_sort_list[j] <= y_list[m] <= y_sort_list[l]:
                        num += 1
                if num >= K:
                    ans = min((x_sort_list[k] - x_sort_list[i]) * (y_sort_list[l] - y_sort_list[j]), ans)

print(ans)


Measured memory_bytes: 47196
#include <algorithm>
#include <bits/stdc++.h>
#include <cstdint>
#include <iostream>
#include <iterator>
#include <vector>

// lib/square.hpp
#ifndef SQUARE_HPP
#define SQUARE_HPP

/*
usage:

tools::square(5) => 25
*/

namespace tools {
  template <typename T>
  constexpr T square(const T x) {
    return x * x;
  }
}

#endif

// lib/util.hpp
#ifndef UTIL_HPP
#define UTIL_HPP


typedef std::int_fast64_t i64;
typedef std::uint_fast64_t u64;
typedef std::int_fast32_t i32;
typedef std::uint_fast32_t u32;

namespace tools {
  template <typename T>
  void read(std::vector<T>& vector, const typename std::vector<T>::size_type size) {
    vector.reserve(size);
    std::copy_n(std::istream_iterator<T>(std::cin), size, std::back_inserter(vector));
  }

  template <typename T, std::size_t N>
  void read(std::array<T, N>& array) {
    std::copy_n(std::istream_iterator<T>(std::cin), N, array.begin());
  }
}

#endif

// lib/pow.hpp
#ifndef POW_H
#define POW_H


/*
usage:

tools::pow(2, 5) => 32
*/

namespace tools {
  template <typename T>
  constexpr T pow(const T base, const T exponent) {
    return exponent == 0
      ? 1
      : exponent % 2 == 0
        ? square(pow(base, exponent / 2))
        : pow(base, exponent - 1) * base;
  }
}

#endif

// main.cpp

int main() {
  i64 N;
  std::cin >> N;
  std::vector<i64> A;
  tools::read(A, N);
  std::cout << tools::pow<i64>(3, N) - std::accumulate(A.begin(), A.end(), static_cast<i64>(1), [](const i64 prod, const i64 A_i) {
    return prod * (A_i % 2 == 0 ? 2 : 1);
  }) << std::endl;
  return 0;
}

Measured memory_bytes: 256
import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        int n = sc.nextInt();
        int k = sc.nextInt();
        String s = sc.next();
        long cnt1 = 0;
        long cnt2 = 0;
        if (s.charAt(0) == 'L') {
            cnt2++;
        }
        if (s.charAt(n - 1) == 'R') {
            cnt2++;
        }
        for (int i = 0; i < n - 1; i++) {
            if (s.charAt(i) == 'R' && s.charAt(i + 1) == 'L') {
                cnt1++;
            }
        }
        long ans = n - 2 * cnt1 - cnt2;
        ans += 2 * k;
        ans = Math.min(ans, n - 1);
        System.out.println(ans);
    }
}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;

    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }

    private int readByte() {
        if (hasNextByte())
            return buffer[ptr++];
        else
            return -1;
    }

    private static boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }

    public boolean hasNext() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr]))
            ptr++;
        return hasNextByte();
    }

    public String next() {
        if (!hasNext())
            throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    public long nextLong() {
        if (!hasNext())
            throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while (true) {
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            } else if (b == -1 || !isPrintableChar(b)) {
                return minus ? -n : n;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }

    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
            throw new NumberFormatException();
        return (int) nl;
    }

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


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

int main() {
	//freopen("test.txt", "r", stdin);
	int num, cas = 1;
	while (~scanf("%d", &num) && num) {
		printf("Case %d: %d\n", cas++, num);
	}
	return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return 1;
    }
    return 0;
}
typedef long long int ll;

#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define endl "\n"
const double EPS = 1e-7;
const int INF = 1 << 30;
const ll LLINF = 1LL << 60;
const double PI = acos(-1);
const int MOD = 1000000007;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

//-------------------------------------

vector<vector<ll>> dp(1010, vector<ll>(10101, LLINF));

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int h, n;
    cin >> h >> n;
    vector<int> a(n), b(n);
    for(int i = 0; i < n; i++) {
        cin >> a[i] >> b[i];
    }
    dp[0][0] = 0;
    for(int i = 0; i < n; i++) {
        for(int j = 0; j <= h; j++) {
            chmin(dp[i + 1][j], dp[i][j]);
            chmin(dp[i + 1][min(j + a[i], h)], dp[i + 1][j] + b[i]);
        }
    }
    cout << dp[n][h] << endl;
}

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

#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")

using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define ull unsigned long long
#define rep(n) for(ll i = 0 ; i<n ; i++) 
#define rep2(n) for(ll j=0 ; j<n ; ++j )
#define repd(n) for(ll i = n-1 ; i>=0 ; i--)
#define MOD 1000000007
#define pii pair<ll,ll>
#define vll vector<ll>
#define ff first
#define ss second
typedef vector<vector<ll> > mat;
#define nl "\n"
#define INF 0x3f3f3f3f
#define sz(a) a.size() 


void solve() {
	string s ; cin>>s;
	if(s[2]==s[3] && s[4]==s[5]) cout << "Yes\n"; else cout << "No";
}


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

	ll t=1;
	// cin>>t;
	rep(t) {
		solve() ; 
	}
	return 0;
}

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

#define ll long long int

ll ar[51], n, a;
ll dp[51][51][2510];

ll rec( ll pos, ll cnt, ll sum )
{
    if( pos == n )
    {
        if( !cnt ) return 0;
        if( sum % cnt ) return 0;
        else return ( sum / cnt ) == a;
    }
    ll &ret = dp[pos][cnt][sum];
    if(ret!=-1) return ret;
    ret = rec( pos+1, cnt+1, sum+ar[pos] ) + rec( pos+1, cnt, sum );
    return ret;
}

int main()
{
#ifdef LU_SERIOUS
    freopen( "in.txt", "r", stdin );
#endif // LU_SERIOUS
    while( cin >> n >> a )
    {
        for( int i=0; i<n; i++ ) cin >> ar[i];
        memset( dp, -1, sizeof dp );
        cout << rec( 0, 0, 0 ) << "\n";
    }
    return 0;
}


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

using namespace std;

map<string, int> mp;
string s;
long long ans = 0;
int main()
{
	int n;
	cin >> n;
	while (n--)
	{
		cin >> s;
		sort(s.begin(), s.end());
		ans += mp[s]++;
	}
	cout << ans << endl;
}

Measured memory_bytes: 11136
#include<bits/stdc++.h>
using namespace std;
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int l,r,d;
    cin>>l>>r>>d;
    int cnt=0;
    for(int i=l;i<=r;i++){
        if(i%d==0){
            cnt++;
        }
    }
    cout<<cnt<<'\n';
}

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

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

using namespace std;

template <typename T> T &chmin(T &a, const T &b) {return a = min(a, b);}
template <typename T> T &chmax(T &a, const T &b) {return a = max(a, b);}

using ll = long long;
using ld = long double;

const int INF = 1e9;
const ld eps = 1e-9, pi = acos(-1.0);

int main(){
  int n;
  cin >> n;
  int s[n];
  REP(i, n) cin >> s[i];
  int q;
  cin >> q;
  int t[q];
  REP(i, q) cin >> t[i];
  ll cnt = 0;
  REP(i, q) {
    auto res = equal_range(s, s+n, t[i]);
    if(res.second != res.first) cnt++;
  }
  cout << cnt << endl;
  return 0;
}


Measured memory_bytes: 3676
import bisect
N = int(input())
seven53 = []
def dfs(cur, s):
    if all(s.count(c) > 0 for c in "753"):
        seven53.append(s)
    if cur > 8:
        return
    else:
        for i in "753":
            dfs(cur + 1, s+i)
dfs(0, "")
seven53 = list(map(int, seven53))
seven53.sort()
print(bisect.bisect_right(seven53, N))

Measured memory_bytes: 6004
//   __                    .__              ________ .________ ________   ______  
//  |  | __  ____    ______|  |__   __ __  /  _____/ |   ____//   __   \ /  __  \ 
//  |  |/ /_/ __ \  /  ___/|  |  \ |  |  \/   __  \  |____  \ \____    / >      < 
//  |    < \  ___/  \___ \ |   Y  \|  |  /\  |__\  \ /       \   /    / /   --   \
//  |__|_ \ \___  >/____  >|___|  /|____/  \_____  //______  /  /____/  \______  /
//       \/     \/      \/      \/               \/        \/                  \/ 

#include<bits/stdc++.h>
#define range 100005
#define mod 1000000007
#define eps 1e-9
#define PI 3.14159265358979323846
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define ALL(V) V.begin(), V.end()
#define _ <<" "<<

using namespace std;

typedef long long ll;
typedef vector <int> vi;
typedef vector<vi> vvi;
typedef pair <int, int> ii;
typedef pair<int, pair<int,int> > iii;
typedef vector<ii> vii;
typedef vector<iii> viii;

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	//freopen("test.txt","r",stdin);
	int n,k;
	cin>>n>>k;
	int output = 0 ;
	for(int i=0;i<n;i++){
		int x;
		cin>>x;
		output+=(x>=k);
	}
	cout<<output;
	return 0;
}


Measured memory_bytes: 256
N = int(input())
A1 = list(map(int,input().split()))
A2 = list(map(int,input().split()))
ans = 0
for i in range(N):
    tmp = 0
    tmp = sum(A1[:i+1])+sum(A2[i:])
    if tmp > ans:
        ans = tmp
print(ans)

Measured memory_bytes: 38384
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
    string c,s;
    int n,k,q[101]={},sum=0,x,ans=0;
    ios::sync_with_stdio(false);
    cin>>n>>k;
    for (int i=1; i<=n; i++)
    {
        cin>>c;
        q[c[0]]++;
        sum++;
        //cout<<c[0]<<endl;
    }
    //for (int i=65; i<=90; i++)
    //    cout<<q[i]<<endl;
    while (sum>0)
    {
        x=0;
        sort(begin(q),end(q),greater<int>());
        if (q[k-1]==0) break;
        for (int i=0; i<k; i++)
        {
            q[i]--;
                    //cout<<ans<<endl;
        }
        ans++;
    }
    cout<<ans<<endl;
    return 0;
}

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

using namespace std;
using int64 = long long;

constexpr int DEBUG = 0;

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

  int n;
  cin >> n;
  string s;
  cin >> s;
  int c = 0;
  for (int i = 0; i + 3 <= s.size(); i++) {
    if (s.substr(i, 3) == "ABC") c++;
  }
  cout << c << endl;
}

Measured memory_bytes: 256
A = [[0, 0]] + [[int(i) for i in input().split()] for j in range(3)]
V = [[] for i in range(5)]

for a, b in A:
    V[a].append(b)
    V[b].append(a)

print('NO' if any(len(v) == 3 for v in V) else 'YES')

Measured memory_bytes: 3064
package main

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

const mod = 1000000007

// 1MB
const ioBufferSize = 1 * 1024 * 1024
var sc = func() *bufio.Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Buffer(make([]byte, ioBufferSize), ioBufferSize)
	sc.Split(bufio.ScanWords)
	return sc
}()

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	n := nextInt()

	max, res := 0, 1
	for i := 1; i <= n; i++ {
		num := i
		c := 0
		for ; num%2 == 0; {
			c++
			num /= 2
		}
		if max < c {
			max = c
			res = i
		}
	}

	fmt.Println(res)
}

Measured memory_bytes: 640
#include<iostream>
using namespace std;
int main()
{
    int x;
    cin >> x;
    int c500 = x / 500;
    int r500 = x % 500;
    int c5 = r500 / 5;
    cout << c500 * 1000 + c5 * 5;
    return 0;
}

Measured memory_bytes: 3636
const int isDebugMode = 1;
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<long long, long long> P;
struct edge{long long to,cost;};
const int inf = 1 << 27;
const long long INF = 1LL << 60;
const int COMBMAX = 1001001;
const long long MOD = 1000000007;
const long long dy[] = {-1, 0, 0, 1};
const long long dx[] = {0, -1, 1, 0};
string abc = "abcdefghijklmnopqrstuvwxyz";
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define eachdo(v, e) for (const auto &e : (v))
#define all(v) (v).begin(), (v).end()
#define lower_index(v, e) (long long)distance((v).begin(), lower_bound((v).begin(), (v).end(), e))
#define upper_index(v, e) (long long)distance((v).begin(), upper_bound((v).begin(), (v).end(), e))
long long mpow(long long a, long long n, long long mod = MOD){long long res = 1; while(n > 0){if(n & 1)res = res * a % mod; a = a * a % mod; n >>= 1;} return res;}
void pt(){cout << endl; return;}
template<class Head> void pt(Head&& head){cout << head; pt(); return;}
template<class Head, class... Tail> void pt(Head&& head, Tail&&... tail){cout << head << " "; pt(forward<Tail>(tail)...);}
void dpt(){if(!isDebugMode) return; cout << endl; return;}
template<class Head> void dpt(Head&& head){if(!isDebugMode) return; cout << head; pt(); return;}
template<class Head, class... Tail> void dpt(Head&& head, Tail&&... tail){if(!isDebugMode) return; cout << head << " "; pt(forward<Tail>(tail)...);}
template<class T> void debug(T v){if(!isDebugMode) return; rep(i, v.size()) cout << v[i] << " " ; cout << endl;}
template<class T> void debug2(T v){if(!isDebugMode) return; rep(i, v.size()){rep(j, v[i].size()) cout << v[i][j] << " " ; cout << endl;}}
template<class T1, class T2> inline bool chmin(T1 &a, T2 b){if(a > b){a = b; return true;} return false;}
template<class T1, class T2> inline bool chmax(T1 &a, T2 b){if(a < b){a = b; return true;} return false;}
template<class T1, class T2> long long recgcd(T1 a, T2 b){return a % b ? recgcd(b , a % b) : b;}
bool valid(long long H, long long W, long long h, long long w) { return 0 <= h && h < H && 0 <= w && w < W; }

int main(){
    ll H, W, M; cin >> H >> W >> M;
    vector<ll> h(M), w(M);
    rep(i, M) cin >> h[i] >> w[i];
    vector<P> ch(H), cw(W); 
    rep(i, H) ch[i].second = i;
    rep(i, W) cw[i].second = i;
    set<P> mp;
    rep(i, M){
        h[i]--;
        w[i]--;
        mp.insert(P(h[i], w[i]));
        ch[h[i]].first++;
        cw[w[i]].first++;
    }
    sort(all(ch));
    reverse(all(ch));
    sort(all(cw));
    reverse(all(cw));
    // pt();
    // rep(i, H) pt(ch[i].first, ch[i].second);
    // rep(i, W) pt(cw[i].first, cw[i].second);


    ll maxh = ch[0].first;
    ll maxw = cw[0].first;
    for(ll i = 0; maxh <= ch[i].first; i++){
        for(ll j = 0; maxw <= cw[j].first; j++){
            // pt();
            // pt(ch[i].second, cw[j].second);
            if(!mp.count(P(ch[i].second, cw[j].second))){
                pt(maxh + maxw);
                return 0;
            }
        }           
    }
    pt(maxh + maxw - 1);
    return 0;
}

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

int main() {
  int N;
  int sumx = 0;
  int sumy = 0;
  cin >> N;
  
  for (int i = 0; i < N; i++) {
    int l, r;
    cin >> l >> r;
    sumx += l;
    sumy += r;
  }
  
  cout << sumy - sumx + N << endl;

}


Measured memory_bytes: 384
#include<stdio.h>
int main(){
  int i;
  int x,y,tmp;

  for(i=0;i<3000;i++){
    scanf("%d %d",&x,&y);
    if(x==0 && y==0) break;
    if(x>y){
      tmp=x;
      x=y;
      y=tmp;
    }
    printf("%d %d\n",x,y);
  }

  return 0;
}


Measured memory_bytes: 2044
#include <bits/stdc++.h>
typedef long long ll;
#define endl '\n'o
using namespace std;
const int MOD = 1000000007, MAX = 2000000007, MAXN = 100005;

void solve(int n)
{
    
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int x,a;
    cin>>x>>a;
    if(x<a)
        cout<<0;
    else
    {
        cout<<10;
    }
    
	return 0;
}

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

int main(){
  int a;
  int i;
  int u;
  int e;
  int o;
  int ka;
  int ki;
  cin>>a>>i>>u>>e>>o;

  ka=i/e;
  if(i%e>0){
    ka=ka+1;
  }
  ki=u/o;
  if(u%o>0){
    ki=ki+1;
  }
  if(ka>ki){
  cout<<a-ka<<endl;
  }else{
    cout<<a-ki<<endl;
  }
}

Measured memory_bytes: 1160
#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
#include <vector>
using namespace std;
int main(){
  long long N;
  int Q;
  cin>>N>>Q;
  long long answer=(N-2)*(N-2);
  long long line[2][200001];
  for(int i=1;i<=N;i++){
    line[0][i]=-1; line[1][i]=-1;
  }
  long long front[2]={N-1,N-1};
  line[0][N-1]=N; line[1][N-1]=N;
  for(int i=0;i<Q;i++){
    int p;
    long long x;
    cin>>p>>x;
    if(p==1){
      if(line[0][x]==-1){
        for(int j=front[0]-1;j>=x;j--) line[0][j]=line[0][front[0]];
      }
      answer-=line[0][x]-2;
      front[0]=min(front[0],x-1);
      if(x-1==front[0]){
        line[1][front[1]]=x; line[0][x-1]=line[0][x];
      }
    }
    else{
      if(line[1][x]==-1){
        for(int j=front[1]-1;j>=x;j--) line[1][j]=line[1][front[1]];
      }
      answer-=line[1][x]-2;
      front[1]=min(front[1],x-1);
      if(x-1==front[1]){
        line[0][front[0]]=x; line[1][x-1]=line[1][x];
      }
    }
  }
  cout<<answer<<endl;
  
  return 0;
}

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

using namespace std;

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

int main(){
  uint64_t n;
  cin >> n;
  if(n & 1){
    cout << 0 << endl;
    return 0;
  }
  n /= 2;
  uint64_t x = 1;
  while(n / 5 >= x) x *= 5;
  uint64_t r = 0;
  while(x > 1){
    r += n / x;
    x /= 5;
  }
  cout << r << endl;
  return 0;
}

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

#define INF             1e9
#define INFL            1e19
#define XX              first
#define YY              second
#define PB              push_back
#define MP              make_pair

#define NEWLINE         cout << endl;
#define HOISE           cerr << "hoise" << endl
#define PAUSE           system("pause")
#define DEBUG(x)        cerr << #x << " = " << x << endl
#define READ            freopen("alu.txt", "r", stdin)
#define WRITE           freopen("vorta.txt", "w", stdout)
#define FASTIO          ios_base::sync_with_stdio(false);cin.tie(NULL)

#define MASK(x)         for(int i = 0; i < 8; i++){ if(x&(1<<i)){ cout << i << " "; } } cout << endl;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int MAX = 2000 + 2;
const int MAXLOG = log2(MAX) + 2;
const int MAXN = 1e6 + 2;
const int MOD = 1000000007;

int main()
{
//    READ;
//    WRITE;
    FASTIO;

    int n;
    string s;
    cin >> s;
    n = s.size();
    vector<ll> a(n+2);

    for(int i = 0; i < n; i++){
        int j = i;
        while(j<n and s[i]==s[j]) j++;
        if(s[i]=='<'){
            ll x = 0;
            for(int k = i; k <= j; k++){
                a[k] = max(a[k], x);
                x++;
            }
        }
        else{
            ll x = 0;
            for(int k = j; k >= i; k--){
                a[k] = max(a[k], x);
                x++;
            }
        }
        i = j-1;
    }

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

    return 0;
}


Measured memory_bytes: 4764
package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strings"
)

var sc = bufio.NewScanner(os.Stdin)

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

type Strings []string

func (s Strings) Len() int {
	return len(s)
}
func (s Strings) Swap(i, j int) {
	s[i], s[j] = s[j], s[i]
}

type Down struct {
	Strings
}

type Up struct {
	Strings
}

func (s Down) Less(i, j int) bool {
	return s.Strings[i] < s.Strings[j]
}
func (s Up) Less(i, j int) bool {
	return s.Strings[i] > s.Strings[j]
}

func (s Strings) Join() string {
	return strings.Join(s, "")
}

func main() {
	line := nextLine()
	s := Strings(strings.Split(line, ""))
	sort.Sort(Down{s})

	line = nextLine()
	t := Strings(strings.Split(line, ""))
	sort.Sort(Up{t})

	sout := s.Join()
	tout := t.Join()


	if sout < tout {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


Measured memory_bytes: 640
#include <iostream>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <algorithm>

typedef long long ll;

using namespace std;

int main() {
    int N, K;
    cin >> N >> K;
    vector<int> P(N);
    for (int i = 0; i < N; i++) {
        cin >> P[i];
    }
    sort(P.begin(), P.end());
    int sum = 0;
    for (int i = 0; i < K; i++) {
        sum += P[i];
    }
    cout << sum << endl;
    return 0;
}



Measured memory_bytes: 3628
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <queue>
#include <vector>
#include <algorithm>
#include <math.h>
#include <map>
#include <list>
#include <iomanip>
#include <queue>
#include <cmath>
#include <numeric>
#define repl(i, l, r) for (ll i = l; i < r; i++)
#define rep(i, n) repl(i, 0, n)

using namespace std;
using ll = long long;
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }

int main() {

	ll AMAX = 100000;
	vector<ll> s(AMAX + 1, 0);

	ll N, K;
	cin >> N >> K;
	
	ll a, b;

	rep(i, N) {
		cin >> a >> b;
		s[a] += b;
	}
	
	ll tmp = 0, ans;

	rep(i, AMAX + 1) {
		tmp += s[i];
		if (tmp >= K) {
			ans = i;
			break;
		}
	}

	cout << ans;

	return 0;
}


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

int main() {
  int N;
  cin >>N;
  if(N-700 >=0 && N-700 <100){
    cout << "Yes" << endl;
  }
  else if(N%100 >=70 && N%100 < 80){
    cout << "Yes" << endl;
  }
  else if(N%10 == 7){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}


Measured memory_bytes: 3584
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <climits>
using namespace std;


int N, M;
int A[300][300];
bool flag[300];
int ans;

void solve(){
    int cnt[300];
    fill_n(cnt, 300, 0);
    for(int i=0; i<N; i++){
        for(int j=0; j<M; j++){
            if(flag[A[i][j]]){
                cnt[A[i][j]]++;
                break;
            }
        }
    }
    int mx = 0;
    int id;
    for(int i=0; i<M; i++){
        if(cnt[i] > mx){
            mx = cnt[i];
            id = i;
        }
    }
    ans = min(ans, mx);
    flag[id] = false;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> N >> M;
    for(int i=0; i<N; i++)
        for(int j=0; j<M; j++){
            cin >> A[i][j];
            A[i][j]--;
        }
    fill_n(flag, M, true);

    ans = N;

    for(int i=0; i<M-1; i++) solve();
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 640
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
import java.lang.*;

public class Main{
	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		int n = sc.nextInt();
		int k = sc.nextInt();
		String s = sc.next();
		int kumi = 0;
		for (int i = 1; i < n; i++) {
			if (s.charAt(i) != s.charAt(i - 1)) {
				kumi++;
			}
		}
		kumi++;
		if (kumi / 2 <= k) {
			System.out.println(n - 1);
		} else {
			if (s.charAt(0) == s.charAt(n - 1)) {
				System.out.println(n - 1 - ((kumi / 2 - k) * 2));
			} else {
				System.out.println(n - 1 - ((kumi / 2 - k) * 2) + 1);
			}
		}
	}
}



class FastScanner {
	private final InputStream in = System.in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;
	private boolean hasNextByte() {
		if (ptr < buflen) {
			return true;
		} else {
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) {
				return false;
			}
		}
		return true;
	}
	private int readByte() {
		if (hasNextByte()) {
			return buffer[ptr++];
		} else {
			return -1;
		}
	}
	private static boolean isPrintableChar(int c) {
		return 33 <= c && c <= 126;
	}
	public boolean hasNext() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
			ptr++;
		}
		return hasNextByte();
	}
	public String next() {
		if (!hasNext()) {
			throw new NoSuchElementException();
		}
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while (isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}
	public long nextLong() {
		if (!hasNext()) {
			throw new NoSuchElementException();
		}
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		}
		while (true) {
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			} else if (b == -1 || !isPrintableChar(b)) {
				return minus ? -n : n;
			} else {
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}
	public int nextInt() {
		long nl = nextLong();
		if (nl < Integer.MIN_VALUE || Integer.MAX_VALUE < nl) {
			throw new NumberFormatException();
		}
		return (int) nl;
	}
	public double nextDouble() {
		return Double.parseDouble(next());
	}
}


Measured memory_bytes: 22356
n = int(input())
s = input()
s += "_"
ans = 0
for i in range(10):
    if str(i) in s:
        x = s.index(str(i))
        for j in range(10):
            if str(j) in s[x+1:]:
                y = s[x+1:].index(str(j))
                for k in range(10):
                    if str(k) in s[x+1:][y+1:]:
                        ans += 1

print(ans)

Measured memory_bytes: 40304
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <bitset> // bitset
#include <deque> // deque
#include <iomanip> //setprecsion
#include <iostream> // cout, endl, cin
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <string> // string, to_string, stoi
#include <tuple> // tuple, make_tuple
#include <utility> // pair, make_pair
#include <vector> // vector

#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <cmath> //sin, cos, tan

using namespace std;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rrep(i, n) for (ll i = (n - 1); i >= 0; --i)
#define blank(ans) cout << (ans) << " ";
#define mp(p, q) make_pair(p, q)
#define mt(p, q, r) make_tuple(p, q, r)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef string str;

typedef vector<ll> vll;
typedef vector<ld> vd;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<str> vs;
typedef vector<vector<ll>> vvll;
typedef vector<vector<ld>> vvd;
typedef vector<vector<bool>> vvb;
typedef vector<vector<char>> vvc;
typedef vector<vector<str>> vvs;
typedef vector<pair<ll, ll>> vpll;
typedef vector<tuple<ll, ll, ll>> vtlll;

const ld PI = acos(-1.0);
const ll MAX = 9000000000000000000;
const ll MIN = -9000000000000000000;
const ld DMAX = 4500;
const ld DMIN = -4500;
const ll MOD = 1000000007;

template <typename T>
void fin(T a)
{
  cout << a << endl;
  exit(0);
}

void Main()
{
  ll k, a, b; cin >> k;
  a = 100;
  b = 0;
  while(1)
  {
    if(a >= k) fin(b);
    b++;
    a += (a * 0.01);
  }
}

//前処理
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(20); //高精度少数表示
  //cout << setfill('0') << internal << setw(4); 0埋め４桁
  Main();
  return 0;
}


Measured memory_bytes: 3640
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

namespace AtCorder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In, ' '));
        }

        public void Solve(ConsoleInput cin)
        {
            var a = cin.ReadInt;
            var b = cin.ReadInt;
            var c = cin.ReadInt;
            if (b - a == c - b)
            {
                WriteLine("YES");
            }
            else
            {
                WriteLine("NO");
            }
        }

        public long C(int X, int Y)
        {

            if (Y == 0 || Y == X)
            {
                return 1;
            }
            if(X < Y)
            {
                return 0;
            }
            var Pascal = new long[X + 1, X + 1];
            for (int i = 0; i <= X; i++)
            {
                Pascal[i, 0] = 1L;
                Pascal[i, i] = 1L;
            }
            for (int i = 2; i <= X; i++)
            {
                for (int j = 1; j < i; j++)
                {
                    Pascal[i, j] = Pascal[i - 1, j] + Pascal[i - 1, j - 1];
                }
            }
            return Pascal[X, Y];
        }

        public class ConsoleInput
        {
            private readonly System.IO.TextReader _stream;
            private char _separator = ' ';
            private Queue<string> inputStream;
            public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
            {
                this._separator = separator;
                this._stream = stream;
                inputStream = new Queue<string>();
            }
            public string Read
            {
                get
                {
                    if (inputStream.Count != 0) return inputStream.Dequeue();
                    string[] tmp = _stream.ReadLine().Split(_separator);
                    for (int i = 0; i < tmp.Length; ++i)
                        inputStream.Enqueue(tmp[i]);
                    return inputStream.Dequeue();
                }
            }
            public string ReadLine { get { return _stream.ReadLine(); } }
            public int ReadInt { get { return int.Parse(Read); } }
            public long ReadLong { get { return long.Parse(Read); } }
            public double ReadDouble { get { return double.Parse(Read); } }
            public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret; }
            public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret; }
            public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret; }
        }
    }
}


Measured memory_bytes: 11220
#include<bits/stdc++.h>
using namespace std;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    string s;
    cin>>n>>s;
    int rs[n],gs[n],bs[n];
    memset(rs,0,sizeof(rs));
    memset(gs,0,sizeof(gs));
    memset(bs,0,sizeof(bs));
    for(int i=n-1;i>=0;i--){
        if(s[i]=='R'){
            rs[i]+=1;
        }else if(s[i]=='G'){
            gs[i]+=1;
        }else{
            bs[i]+=1;
        }
        if(i<n-1){
            rs[i]+=rs[i+1];
            gs[i]+=gs[i+1];
            bs[i]+=bs[i+1];
        }
    }
    long long ans=0;
    for(int i=0;i<n;i++){
        for(int j=i+1;j<n;j++){
            if(s[i]!=s[j]){
                int dist = j-i;
                if((s[i]=='R'||s[i]=='G')&&(s[j]=='G'||s[j]=='R')){
                    if(j+dist<n)
                        ans+=(bs[j+1]-bs[j+(dist)]);
                    else
                    {
                        if(j+1<n)
                            ans+=bs[j+1];
                    }
                    if(j+dist+1<n)
                        ans+=(bs[j+dist+1]);
                }
                if((s[i]=='R'||s[i]=='B')&&(s[j]=='R'||s[j]=='B')){
                    if(j+dist<n)
                        ans+=(gs[j+1]-gs[j+(dist)]);
                    else{
                        if(j+1<n)
                            ans+=gs[j+1];
                    }
                    if(j+dist+1<n)
                        ans+=(gs[j+dist+1]);
                }
                if((s[i]=='G'||s[i]=='B')&&(s[j]=='G'||s[j]=='B')){
                    if(j+dist<n)
                        ans+=(rs[j+1]-rs[j+(dist)]);
                    else{
                        if(j+1<n)
                            ans+=rs[j+1];
                    }
                    if(j+dist+1<n)
                        ans+=(rs[j+dist+1]);
                }
            }
        }
    }
    cout<<ans<<"\n";
    
    return 0;
}

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

// template {{{
#define  range(i, l, r) for (int i = (int)(l); i < (int)(r); (i) += 1)
#define rrange(i, l, r) for (int i = (int)(r) - 1; i >= (int)(l); (i) -= 1)

#define  whole(f, x, ...) ([&](decltype((x)) container) { return (f)(  begin(container),  end(container), ## __VA_ARGS__); })(x)
#define rwhole(f, x, ...) ([&](decltype((x)) container) { return (f)( rbegin(container), rend(container), ## __VA_ARGS__); })(x)

#define debug(x) cerr << "(" << __LINE__ << ")" << #x << ": " << (x) << endl

using i32 = int;
using u32 = unsigned int;
using i64 = long long;
using u64 = unsigned long long;

// constexpr i32 mod   = 998244353;
constexpr i32 mod   = 1e9 + 7;
constexpr i32 inf   = 1001001001;
constexpr i64 infll = 1001001001001001001ll;

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

struct IoSetup { IoSetup(int x = 15){ cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(x); cerr << fixed << setprecision(x); } } iosetup;

template <typename T = i64> T input() { T x; cin >> x; return x; }

template <typename T> ostream &operator<<(ostream &os, vector<T> &v) { range(i, 0, v.size()) { os << v[i] << (i + 1 != v.size() ? " " : ""); } return os; }
template <typename T> istream &operator>>(istream &is, vector<T> &v) { for (T &in : v) is >> in; return is; }

template <typename T1, typename T2> ostream &operator<<(ostream &os, pair<T1, T2> p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
template <typename T1, typename T2> istream &operator>>(istream &is, pair<T1, T2> &p) { is >> p.first >> p.second; return is; }

template <typename T> vector<T> make_vector(size_t a, T b) { return vector<T>(a, b); }
template <typename... Ts> auto make_vector(size_t a, Ts... ts) { return vector<decltype(make_vector(ts...))>(a, make_vector(ts...)); }

template <typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template <typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
// }}}

void solver() {
    int n = input();
    vector< i64 > as(n);
    cin >> as;

    whole(sort, as);
    if (as[0] == 0) {
        cout << 0 << endl;
        return;
    }

    i64 ans = 1;
    range(i, 0, n) {
        if ((__int128_t)ans * as[i] > 1000000000000000000) {
            cout << -1 << endl;
            return;
        }

        ans *= as[i];
    }

    cout << ans << endl;
}

signed main(int argc, char *argv[]) {
    solver();
}


Measured memory_bytes: 3972
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>

using ll = long long;

using namespace std;

int main() {
    ll h, w;
    cin >> h >> w;
    if (h == 1 || w == 1) {
        cout << 1 << '\n';
        return 0;
    }
    cout << (h / 2) * w + (h % 2) * ((w + 1) / 2) << '\n';
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
    int a,b,c,ans=0;
    bool po=false;
    cin>>a>>b>>c;
    while(1){
        if(!po){
            if(c){
                c--;
                ans++;
                po=true;
                continue;
            }
            break;
        }
        if(po){
            if(b){
                b--;
                ans++;
                po=false;
                continue;
            }
            if(a){
                a--;
                po=false;
                continue;
            }
            break;
        }
    }
    cout<<ans+b;
}


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

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

	if (A == B && B == C) {
		cout << "Yes" << endl;
		return 0;
	}
	else {
		cout << "No" << endl;
		return 0;
	}


	return 0;
}

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

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)


#define IN(x,s,g) ((x) >= (s) && (x) < (g))
#define ISIN(x,y,w,h) (IN((x),0,(w)) && IN((y),0,(h)))

using namespace std;

char buff[1000][100];
int h, w;
int g[1000][100];

void dfs(int y, int x, int id){
  g[y][x] = id;

  REP(i,3) REP(j,3){
    int yy = y + i - 1;
    int xx = x + j - 1;

    if(ISIN(xx, yy, w, h) && buff[yy][xx] == '*' && g[yy][xx] == 0){
      dfs(yy, xx, id);
    }
  }
}

int main(){
  int cc = 0;
  while(fgets(buff[0], sizeof(buff[0]), stdin), (h = atoi(buff[0]))){
    w = 0;
    memset(buff, 0, sizeof(buff));
    memset(g, 0, sizeof(g));

    if(cc++ != 0)
      puts("----------");

    REP(i,h){
      fgets(buff[i], sizeof(buff[i]), stdin);
      w = max<int>(w, strlen(buff[i]) - 1);
    }
    // printf("h: %d w: %d\n", h, w);

    REP(i,h){
      REP(j,w)
	if(buff[i][j] != ' ' && buff[i][j] != '*')
	  buff[i][j] = ' ';
      buff[i][w] = '\0';

      // puts(buff[i]);
    }

    int id = 1;
    REP(i,h) REP(j,w) if(buff[i][j] == '*' && g[i][j] == 0){
      dfs(i, j, id++);
    }

    // REP(i,h){REP(j,w){printf("%d", g[i][j]);}puts("");}

    id--;
    vector<int> sizes(id, 0);
    REP(i,h) REP(j,w){
      vector<bool> flagl(id, false);
      vector<bool> flagr(id, false);

      if(buff[i][j] == '*')
	flagl[g[i][j] - 1] = flagr[g[i][j] - 1] = true;
      
      for(int jj = j - 1; jj >= 0; jj--)
	if(g[i][jj]) flagl[g[i][jj] - 1] = true;
      for(int jj = j + 1; jj < w; jj++)
	if(g[i][jj]) flagr[g[i][jj] - 1] = true;
      
      REP(k,id) if(flagl[k] && flagr[k]){
	//printf("%d %d: %d\n", i, j, k);
	sizes[k]++;
      }

    }

    map<int, int> ans;
    REP(i,id){
      ans[sizes[i]]++;
    }
    FOR(it, ans){
      printf("%d %d\n", it->first, it->second);
    }
  }
  return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <bits/stdc++.h>
#define ll long long int
#define MAXN 1000001
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")

int spf[MAXN];
ll primesused[MAXN];
ll maxnow;
void sieve()
{
    spf[1] = 1;
    for (int i = 2; i < MAXN; i++)
        spf[i] = i;
    for (int i = 4; i < MAXN; i += 2)
        spf[i] = 2;

    for (int i = 3; i * i < MAXN; i++)
    {
        if (spf[i] == i)
        {
            for (int j = i * i; j < MAXN; j += i)
                if (spf[j] == j)
                    spf[j] = i;
        }
    }
}
set<int> getFactorization(int x)
{
    set<int> k;
    while (x != 1)
    {
        k.insert(spf[x]);
        x = x / spf[x];
    }
    return k;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    sieve();
    ll n;
    cin >> n;
    vector<ll> a(n);
    maxnow = -1;
    for (int i = 0; i < n; i++) 
    {
        cin >> a[i];
        set<int> now;
        now=getFactorization(a[i]);
        for (auto i:now)
            primesused[i]++, maxnow = max(maxnow, primesused[i]);
    }
    //cout << maxnow << '\n';
    if (maxnow>=n)
        cout << "not coprime" << '\n';
    else if (maxnow==1 or maxnow==-1)
        cout << "pairwise coprime" << '\n';
    else
    {
        cout << "setwise coprime" << '\n';
    }
    
}

Measured memory_bytes: 22692
#define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f

#include <iostream>
#include <cstdio>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>
#include <cctype>
#include <utility>
#include <assert.h>
  
using namespace std;
  
typedef long long ll;
typedef pair <int,int> P;
typedef pair <int,P> PP;
  
static const double EPS = 1e-8;

void print_text(const string& text){
  int offset = 0;
  int text_i = 0;
  while(offset < text.size()){
    for(text_i = offset; text_i < text.size(); text_i++){
      if(text_i - offset >= 72) break;
      printf("%c",text[text_i]);
    }
    printf("\n");
    offset += 72;
  }
}

void print_co_occurrence(const string& text,const string& query){

  int head = 0;
  int tail = 0;

  int include_keys = 0;
  int freq[1024] = {};

  bool is_key[1024];
  memset(is_key,false,sizeof(is_key));

  for(int query_i = 0; query_i < query.size(); query_i++){
    is_key[query[query_i]] = true;
  }

  int min_tail = INF;
  int min_len = INF;
  int ans_freq = 0;
  string ans = "";

  while(tail < text.size()){
    for(;head < text.size();head++){
      if(is_key[text[head]] && !freq[text[head]]++){
        include_keys++;
        if(include_keys == query.size()){
          head++;
          break;
        }
      }
    }

    for(;tail <= head;tail++){
      if(is_key[text[tail]] && !--freq[text[tail]]){

        if(include_keys == query.size()) {
          if((head -1) - tail + 1 < min_len){
            min_len = (head -1) - tail + 1;
            ans = text.substr(tail,(head -1) - tail + 1);
            ans_freq = 1;
          }
          else if((head -1) - tail + 1 == min_len){
            ans_freq++;
          }
        }
        include_keys--;
        tail++;
        break;
      }
    }
  }

  if(ans_freq == 0){
    printf("%d\n",ans_freq);
    printf("\n");
  }
  else{
    printf("%d\n",ans_freq);
    printf("\n");
    print_text(ans);
    printf("\n");
  }
}

int main(){
  string str;
  int phase = 0;
  string text = "";
  string query = "";
  while(getline(cin,str)){
    if(str.size() == 0){
      phase++;
      continue;
    }
    if(phase % 2 == 0){
      text += str;
    }
    else{
      query = str;

      print_co_occurrence(text,query);
      
      query = "";
      text = "";
    }
  }
}

Measured memory_bytes: 1848
#include <iostream>
#include <fstream>
#include <iomanip>
#include <math.h>
#include <limits.h>
#include <algorithm>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <string>
#include <string.h>
#include <sstream>
#include <ctime>

using namespace std;

#define eps 1e-12
#define pi 3.14159265358979323846
#define pb push_back
#define mp make_pair
#define st first
#define nd second
#define bgn begin
#define ll long long
#define ld long double
#define ull unsigned long long
#define ii pair<ll,ll>









ll x,res;

void solve()
{
	cin>>x;
	res=(x/11)*2;
	if(x%11>6)res+=2;
	else if(x%11>0)res++;
	cout<<res<<"\n";
}

int main()
{
	std::ios::sync_with_stdio(0);
	cin.tie(0);
#ifdef localProject
	freopen("in.txt","r",stdin);
#endif
	solve();
	return 0;
}

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

const int MOD = 1000000007;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define copy(from, to) copy(from.begin(), from.end(), back_inserter(to))
#define sort(a) sort(a.begin(), a.end())
#define reverse(s) reverse(s.begin(), s.end())
#define p(s) cout << (s) << endl

typedef long long ll;
using namespace std;

template<class T>
void load(vector<T> &v, int n) {
  for (int i = 0; i < n; ++i) {
    T t;
    cin >> t;
    v.push_back(t);
  }
}

template<class T>
T max(vector<T> &v) {
  return *max_element(v.begin(), v.end());
}

template<class T>
T min(vector<T> &v) {
  return *min_element(v.begin(), v.end());
}

void py(bool isUpper = false) {
  if (isUpper) {
    p("YES");
  } else {
    p("Yes");
  }
}

void pn(bool isUpper = false) {
  if (isUpper) {
    p("NO");
  } else {
    p("No");
  }
}

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

  bool b = false;
  for (char i = 'a'; i <= 'z'; i++) {
    b = false;
    for (int j = 0; j < s.length(); ++j) {
      if (s[j] == i) {
        b = true;
      }
    }
    if (!b) {
      p(i);
      return 0;
    }
  }
  p("None");
}

Measured memory_bytes: 512