akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <regex>
#include <numeric>
using namespace std;

/*--- Macro ---*/
#define rep(i, n) for(int i=0; i<(int)n; i++)
#define rep1(i, n) for(int i=1; i<(int)n; i++)
#define mp make_pair
#define pb push_back
#define all(a) (a).begin(), (a).end()

/*---  Type ---*/
typedef long long ll;

/*--- Constants ---*/
template <typename T> const T INF = numeric_limits<T>::max() / 10;
const int MOD = (int)1e9 + 7;

// Floating
const double EPS = 1e-11;
#define EQ0(x) (abs(x) < EPS)
#define EQ(x, y) (abs(a-b) < EPS)

// Util
int max(int a, int b, int c) {return max(a, max(b, c));}
int min(int a, int b, int c) {return min(a, min(b, c));}
ll max(ll x, ll y) {return x > y ? x : y;}
ll min(ll x, ll y) {return x < y ? x : y;}
ll max(ll a, ll b, ll c) {return max(a, max(b, c));}
ll min(ll a, ll b, ll c) {return min(a, min(b, c));}

// How to use 「map」
/*
  - 宣言
    map<{key_type}, {value_type}> salary;
  - 要素の挿入
    salary["Alice"] = 1000;
  - 要素の取得 O(logn)
    salary.at("Alice");
  - 要素の削除
    salary.erase("Alice");
  - キー検索
    salary.find("Alice"); -> true
    salary.find("Bob");   -> false
  - イテレーション
    for(auto& [key, value] : salary) {...}
 */
// -------------------------------------


// How to use 「lower_bound」, 「upper_bound」
/*
  vector<int> a = {1, 2, 3, 4, 5};
  auto iter1 = lower_bound(all(a), 3);  <- 第二引数「以上」の最小イテレータが返る
  auto iter2 = upper_bound(all(a), 3);  <- 第二引数「より大きい」最小のイテレータが返る
 */
// -------------------------------------


// How to use 「struct sort」
/*
  struct Person {
    string name;
    int age;

    Person(string _name, int _age) {
      name = _name;
      age = _age;
    }

    bool operator<(const Person &another) const {
      return age < another.age;
    }
  };

  vector<Person> people;
  people.pb(Person("Alice", 20));
  people.pb(Person("Bob", 19));
  people.pb(Person("John", 40));
  people.pb(Person("Chris", 30));
  sort(all(people));
 */
 // -------------------------------------

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



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

  string ans = "";
  while(n != 0) {
    if(n % 2 != 0) {
      ans = '1' + ans;
      n--;
    } else {
      ans = '0' + ans;
    }

    n /= -2;
  }

  if(ans == "") cout << 0 << endl;
  else cout << ans << endl;

  return 0;
}

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

using namespace std;
using ll = long long;


int main()
{
    int n, m;
    cin >> n >> m;
    vector<int> a(n);
    for(int i = 0; i < n; i++)cin >> a[i];
    int sum = accumulate(a.begin(), a.end(), 0);
    long double t = (long double)sum * ((long double)1 / (4 * m));

    int cnt = 0;
    for(int i = 0; i < n; i++){
        if(a[i] >= t)cnt++;
    }
    cout << (cnt >= m ? "Yes" : "No") << endl;

}

Measured memory_bytes: 256
using System;

namespace ABC168
{
    class Program
    {
        static void Main(string[] args)
        {
            var K = int.Parse(Console.ReadLine());
            var S = Console.ReadLine();

            if (S.Length <= K)
                System.Console.WriteLine(S);
            else
            {
                var ans = S.Substring(0, K);
                ans += "...";
                System.Console.WriteLine(ans);
            }
        }
    }
}


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

int main() {
    int N, K;
    cin >> N >> K;
    int A[N];
    for (int i=0; i<N; i++) cin >> A[i];
    int B[210000]={0};
    for (int i=0; i<N; i++) B[A[i]]++;
    sort (B, B+210000, greater <int>());
    int total=0;
    for (int i=K; i<N; i++) total+=B[i];
    cout << total<< endl;
}


Measured memory_bytes: 1792
#include <stdio.h>
#include <stdlib.h>
long long Max(long long a, long long b){
    return a>b?a:b;
}
long long x[100000],v[100000];
long long f1[100000]={0},f2[100000]={0},g1[100000],g2[100000];

int main(){
    long long n,c;
    scanf("%lld %lld",&n,&c);

    int i,j,k;
    for(i=0;i<n;i++){
        scanf("%lld %lld",&x[i],&v[i]);
    }
    f1[0]=v[0]-x[0];
    f2[n-1]=v[n-1]-(c-x[n-1]);
    //printf("%lld %lld\n",f1[0],f2[n-1]);
    for(i=1;i<n;i++){
        f1[i]=f1[i-1]+v[i]+x[i-1]-x[i];
        f2[n-1-i]=f2[n-i]+v[n-1-i]-x[n-i]+x[n-1-i];
        //printf("%lld %lld\n",f1[i],f2[n-1-i]);
    }
    g1[0]=Max(f1[0],0);
    g2[n-1]=Max(f2[n-1],0);
    //printf("%lld %lld\n",g1[0],g2[n-1]);
    for(i=1;i<n;i++){
        g1[i]=Max(g1[i-1],f1[i]);
        g2[n-1-i]=Max(g2[n-i],f2[n-1-i]);
        //printf("%lld %lld\n",g1[i],g2[n-1-i]);
    }
    long long max=0;
    for(i=0;i<n;i++){
        long long tmp = g1[i]+(i==n-1?0:g2[i+1]-(c-x[i+1]));
        if(max<tmp)max=tmp;
    }
    for(i=n-1;i>=0;i--){
        long long tmp = g2[i]+(i==0?0:g1[i-1]-x[i-1]);
        if(max<tmp)max=tmp;
    }
    printf("%lld\n",max);
}


Measured memory_bytes: 4864
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int r = stdIn.nextInt();
		int g = stdIn.nextInt();
		int b = stdIn.nextInt();
		if((r*100+g*10+b)%4 == 0) {
			System.out.println("YES");
		}
		else {
			System.out.println("NO");
		}

	}

}

Measured memory_bytes: 21716
#include <bits/stdc++.h>
using namespace std;;
#define ll long long
#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 FORR(i, m, n) for(int i = m;i >= n;i--)
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;
int main(){
    long double n; cin >> n;
    int ansh=0,ansn=0,answ=0;
    for(long double i=0; i<=3500; i++){
        for(long double j=0; j<=3500; j++){
            if(4*i*j/n - i - j > 0 && floor(i*j/(4*i*j/n - i - j)) ==i*j/(4*i*j/n - i - j ) && floor(i*j/(4*i*j/n - i - j)) <= 3500 ){
                ansh = i; ansn = j; answ = floor(i*j/(4*i*j/n - i - j));
                break;
            }
        }
        if(ansh!=0){
            break;
        }
    }
    cout << ansh << " " <<ansn <<" " << answ << endl;

}

Measured memory_bytes: 512
// {{{
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <cmath>
#include <cstdio>

using namespace std;

typedef long int i32;
typedef unsigned long int u32;
typedef long long int i64;
typedef unsigned long long int  u64;
typedef pair<i32, i32> PII;
#define IN(x) cin >> x;
#define MEM(a, b) memset(a, (b), sizeof(a))
#define ZERO(a) memset(a, 0, sizeof(a))
#define FOR(i, j, k, in) for (int i=j ; i<k ; i+=in)
#define RFOR(i, j, k, in) for (int i=j ; i>=k ; i-=in)
#define REP(i, j) FOR(i, 0, j, 1)
#define RREP(i, j) RFOR(i, j-1, 0, 1)
#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.rbegin(), cont.rend()
#define MP make_pair
#define PB push_back
#define PF push_front
#define INF (int)1e9
#define EPS 1e-9
#define PI 3.1415926535897932384626433832795
#define DEBUG(x) cout << #x << ": " << x << endl;

template<typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; }
template<typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }
// }}}

const u32 MAX_N = 5000;
const u32 MAX_K = 5000;
u32 N, K;
vector<u32> a;

bool check(i32 m) {
    // printf("m: %d\n", m);
    array<bool, MAX_K+1> dp;
    fill(all(dp), false);
    dp[0] = true;
    REP(i, N) {
        if(i == m) {
            continue;
        }
        RREP(j, K) {
            if(dp[j] && j + a[i] < K) {
                dp[j+a[i]] = dp[j+a[i]] || dp[j];
            }
        }
    }
    REP(j, K) {
        // printf("dp[%d]: %d, j+a[m]: %d\n", j, dp[j], j+a[m]);
        if(dp[j] && j + a[m] >= K) {
            return true;
        }
    }
    return false;

}

int main() {
    cin >> N >> K;
    a = vector<u32>(N);
    REP(i, N) {
        IN(a[i]);
    }
    sort(a.rbegin(), a.rend());
    i32 l = -1;
    i32 r = N;
    i32 m = (l + r + 1) / 2;
    while(r - l > 1) {
        if(check(m)) {
            l = m;
        } else {
            r = m;
        }
        m = (l + r + 1) / 2;
    }
    // printf("m: %d\n", m);
    cout << N - m << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
    int l,r,d,c=0;
    cin>>l>>r>>d;
  for(int i=l;i<=r;i++)
  {
      if(i%d==0)c++;
  }
  cout<<c;
    return 0;
}



Measured memory_bytes: 3628
from math import gcd


def prime_factorize(n):
    a=set()
    while n%2==0:
        a.add(2)
        n //=2
    f=3
    while f**2<=n:
        if n%f==0:
            a.add(f)
            n //=f
        else:f +=2
    if n!=1:a.add(n)
    return a


n=int(input())
A=list(map(int,input().split()))
prime=[True for _ in range(10**6+1)]

flag=0
for i in A:
    for j in prime_factorize(i):
        if prime[j]:
            for k in range(j,10**6+1,j):
                prime[k]=False
        else:
            flag=1
            break
if flag==0:print("pairwise coprime");exit()
line=[0]*n
line[0]=A[0]
for i in range(1,n):
    line[i]=gcd(line[i-1],A[i])
if line[-1]==1:print("setwise coprime");exit()
print("not coprime")

Measured memory_bytes: 206180
#include<bits/stdc++.h>
#define F first
#define S second
#define pb push_back
#define ll long long
#define mp make_pair
#define pii pair<int,int>
#define mod 1000000007
#define M 1000000
using namespace std;

std::vector<int> adj[10];


void answer(){
    ll n,m,ans=0;
    double x,y;
    cin>>n>>m;
    ll a[n+1];
    for(int i=0;i<m;i++){
        cin>>a[i];
        ans+=a[i];
    }
    cout<<max(-1LL,n-ans);
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    int q;
    //cin>>q; while(q--)
        answer();
    return 0;
}

Measured memory_bytes: 3736
import std.stdio, std.string, std.conv;
import std.range, std.algorithm, std.array, std.typecons, std.container;
import std.math, std.numeric, core.bitop;

enum inf = 1_001_001_001;
enum inf6 = 1_001_001_001_001_001_001L;
enum mod = 1_000_000_007L;

void main() {
    int n;
    scan(n);
    auto a = readln.split.to!(int[]);

    auto ans = new long[](n);
    foreach (i ; 0 .. n) {
        ans[0] += (-1)^^i * a[i];
    }

    foreach (i ; 1 .. n) {
        ans[i] = (a[i - 1] - ans[i - 1] / 2) * 2;
    }

    writefln("%(%s %)", ans);
}








void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}

void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}

bool chmin(T, U...)(ref T x, U args) {
    bool isChanged;

    foreach (arg; args) {
        if (x > arg) {
            x = arg;
            isChanged = true;
        }
    }

    return isChanged;
}

bool chmax(T, U...)(ref T x, U args) {
    bool isChanged;

    foreach (arg; args) {
        if (x < arg) {
            x = arg;
            isChanged = true;
        }
    }

    return isChanged;
}


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

#define debug(x) cerr<<#x<<'='<<x<<endl
#define set0(x) memset(x,0,sizeof(x))
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pii;

template<typename T> void read(T &x){
	x = 0;char ch = getchar();ll f = 1;
	while(!isdigit(ch)){if(ch == '-')f*=-1;ch=getchar();}
	while(isdigit(ch)){x = x*10+ch-48;ch=getchar();}x*=f;
}
template<typename T, typename... Args> void read(T &first, Args& ... args) {
	read(first);
	read(args...);
}
ll req;
int main(){
	read(req);
	int x = sqrt(req);
	if(1ll*x*x<req)x+=1;
	int ax,ay,bx,by;
	if(1ll*x*x == req){
		ax = x;
		ay = 0;
		bx = 0;
		by = x;
	}else{
		ax = x;
		ay = 1;
		int diff =1ll*x*x-req;
		if(diff>x){
			ax-=1;
			diff-=x;
		}
		bx = diff;
		by = x;
	}
	cout<<0<<' '<<0<<' '<<ax<<' '<<ay<<' '<<bx<<' '<<by<<endl;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define maxn 100005
#define endl '\n'
using namespace std;
int sum[2][maxn];
int query(int *sum,int l,int r) {
	return sum[r] - sum[l-1];
}
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	string s,t;
	cin >> s >> t;
	for(int i=0;i<(int)s.size();i++)
		sum[0][i+1] = (s[i] == 'A' ? 1 : 2) + sum[0][i];
	for(int i=0;i<(int)t.size();i++)
		sum[1][i+1] = (t[i] == 'A' ? 1 : 2) + sum[1][i];
	int q;
	cin >> q;
	while(q--) {
		int a,b,c,d;
		cin >> a >> b >> c >> d;
		int x = query(sum[0],a,b) , y = query(sum[1],c,d);
		if(x % 3 == y % 3)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
	return 0;
}


Measured memory_bytes: 1744
#include <bits/stdc++.h>
using namespace std;
const double pi=3.14159265358979323846;

double calcC (double H,double M){
double kakuA, kakuB;
  kakuA= 360*((60*H+M)/(12*60));
  kakuB=360*M/60;
    if (kakuA > kakuB){
    if((kakuA-kakuB)>180) return 360-(kakuA-kakuB);
      else return kakuA-kakuB;
    }
  
  if (kakuA <= kakuB){
    if((kakuB-kakuA)>180) return 360-(kakuB-kakuA);
      else return kakuB-kakuA;
    }
  
}


int main() {
double A,B,H,M;
  cin >> A >> B >> H >> M;

double ans;
  ans = A*A+B*B-2*A*B*cos(calcC(H,M)*2*pi/360);
  ans = sqrt(ans);
  cout << fixed << setprecision(10);
  cout << ans << endl;
  
  
}

Measured memory_bytes: 4180
#include <stdio.h>
#define MAX 250

int parent(int );
int left(int );
int right(int );

int main(void){

  int n,i;
  int Tree[MAX];

  scanf("%d",&n);

  for(i = 1; i <= n;i++)
    scanf("%d",&Tree[i]);
  
  for(i = 1;i <= n;i++){
    printf("node %d: key = %d, ", i, Tree[i]);

    if(parent(i) != 0)
      printf("parent key = %d, ", Tree[i/2]);

    if(left(i) <= n)
      printf("left key = %d, ", Tree[2 * i]);

    if(right(i)  <= n)
      printf("right key = %d, ", Tree[2 * i + 1]);

    printf("\n");
  }

  return 0;
}

int parent(int i){
  return i / 2;
}

int left(int i){
  return 2 * i;
}

int right(int i){
  return 2 * i + 1;
} 

Measured memory_bytes: 600
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt();
			int k = scanner.nextInt();
			System.out.println(IntStream.range(0, n).map(i -> scanner.nextInt()).sorted().skip(n - k).sum());
		}
	}
}


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

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 1000000007

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

vector<vector<ll>> v(222222);
ll ma[222222];
ll ans[222222];
map<pair<int,int>,int> mp;

int seica(ll num, ll lim, ll pre){
	if(mp[MP(num,lim)] != 0)return mp[MP(num,lim)];
	ll ret = 0;
	REP(i,v[num].size()){
		if(v[num][i] != pre && v[num][i] < lim){
			ret += seica(v[num][i],lim,num);
		}
	}
	return mp[MP(num,lim)] = ret + 1;
}

void dfs(ll num, ll pre) {
	ll ret = ans[pre];
	ma[num] = max(ma[pre], pre);
	ret += seica(num,ma[num],pre);
	if(ma[pre] > num)ret -= seica(num,ma[pre],pre);	
	ans[num] = ret;
	REP(i,v[num].size()){
		if(v[num][i] != pre){
			dfs(v[num][i], num);
		}
	}
}

int main(){
	
	int n;cin >> n;
	REP(i,n-1){
		int a,b;cin >> a >> b;
		a--;b--;
		v[a].EB(b);
		v[b].EB(a);
	}
	
	REP(i,v[0].size()){
		dfs(v[0][i], 0);
	}
	
	REP(i,n-1)cout << ans[i+1] << " ";cout << endl;
	
	return 0;
}


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

// template {{{  0 
// using {{{ 1
using ll = long long int;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vii = vector<pii>;
using vll = vector<pll>;
// }}} 1
// definition {{{ 1
// scaning {{{ 2
#define Scd(x) scanf("%d", &x)
#define Scd2(x,y) scanf("%d%d", &x, &y)
#define Scd3(x,y,z) scanf("%d%d%d", &x, &y, &z)
#define Scll(x) scanf("%lld", &x)
#define Scll2(x,y) scanf("%lld%lld", &x, &y)
#define Scll3(x,y,z) scanf("%lld%lld%lld", &x, &y, &z)
#define Scc(c) scanf("%c", &c);
#define Scs(s) scanf("%s", s);
#define Scstr(s) scanf("%s", &s);
// }}} 2
// constants {{{ 2
#define EPS (1e-7)
#define INF (2e9)
#define PI (acos(-1))
// }}} 2
// systems {{{ 2
#define Repe(x,y,z) for(ll x = z; x < y; x++)
#define Rep(x,y) Repe(x,y,0)
#define RRepe(x,y,z) for(ll x = y-z-1; x >= 0; x--)
#define RRep(x,y) RRepe(x,y,0)
// }}} 2
// output {{{ 2
#define YesNo(a) (a)?printf("Yes\n"):printf("No\n")
#define YESNO(a) (a)?printf("YES\n"):printf("NO\n")
// }}} 2
// }}} 1
// input {{{ 1
// }}} 1
// }}} 0

int main() {

    int N;
    Scd(N);

    vi d(N);
    vl c(N);
    Rep(i,N) Scd(d[i]),Scll(c[i]);
    ll to = 0;
    Rep(i,N) to += d[i]*c[i];

    ll ans = (to-1)/9;
    Rep(i,N){
        ans += c[i];
    }
    ans--;

    printf ("%lld\n", ans );

    return 0;
}





Measured memory_bytes: 2560
import java.util.Scanner;

public class Main {
	public static Scanner sc = new Scanner(System.in);
	public static void main(String[] args){
		//A
		int n = sc.nextInt();
		if(n%2 == 0)
			System.out.println(n);
		else
			System.out.println(n*2);
	}
}


Measured memory_bytes: 21844
from sys import stdin
R, G, B, N = (int(i) for i in input().split())

count = 0
for i in range(N+1):
    N1 = N - i*R
    for j in range(N1+1):
        b = (N1 - j*G)/B
        if b.is_integer() and b >= 0:
            count +=1

print(count)


Measured memory_bytes: 2940
package main

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

func main() {
        buf := make([]byte, 10000000)
        si := bufio.NewScanner(os.Stdin)
        si.Split(bufio.ScanWords)
        si.Buffer(buf, 10000000)
        si.Scan()
        S := si.Bytes()
        si.Scan()
        Q, _ := strconv.Atoi(si.Text())
        s := make([]byte, 0, 800000)
        reversed := false
        for i := 0; i < Q; i++ {
                si.Scan()
                if si.Text() == "1" {
                        reversed = !reversed
                } else {
                        si.Scan()
                        f := si.Text()
                        si.Scan()
                        c := si.Text()
                        if f == "1" {
                                if reversed {
                                        S = append(S, c[0])
                                } else {
                                        s = append(s, c[0])
                                }
                        } else {
                                if reversed {
                                        s = append(s, c[0])
                                } else {
                                        S = append(S, c[0])
                                }
                        }
                }
        }
        for i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 {

                s[i], s[j] = s[j], s[i]

        }
        s = append(s, S...)
        if reversed {
                for i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 {

                        s[i], s[j] = s[j], s[i]

                }
        }
        fmt.Println(string(s))

}

Measured memory_bytes: 5376
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lvector vector<ll>
#define lque queue<ll>
#define lpque priority_queue<ll>
#define dlpque priority_queue<ll,lvector,greater<ll>>
#define P pair<ll,ll>
#define ALL(a) (a).begin(),(a).end()
#define rep(i,n) for(ll (i)=0; (i)<(n); ++(i))
#define print(a) cout << (a) << endl

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n;cin>>n;
  string s;
  map<string,ll> mp;
  rep(i,n) {cin>>s;mp[s]++;}
  ll mx=0;
  for(auto i:mp) mx=max(mx,i.second);
  for(auto i:mp) if(i.second==mx) print(i.first);
  return 0;
}

Measured memory_bytes: 23808
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<tuple>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<deque>
#include<cmath>
#include<stack>
#include<string.h>
#include <iomanip>
#define rep(i,n) for(int i = 0;i<n;i++)
#define _GLIBCXX_DEBUG
using ll = long long; 
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; }

int main() {
    string s;
    cin >> s;
    rep(i,s.size()) {
        if(s[i]==',') s[i] = ' ';
    }
    cout << s << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int x,y,a,b,c;
const int N=1e5+50;
ll aa[N]; 
bool cmp(int a,int b){
	return a>b;
}
vector<int> v;
int main(){
	scanf("%d%d%d%d%d",&x,&y,&a,&b,&c);
	for(int i=0;i<a;i++){
		scanf("%lld",&aa[i]);
	}
	sort(aa,aa+a,cmp);
	for(int i=0;i<x;i++){
		v.push_back(aa[i]);
	}
	for(int i=0;i<b;i++){
		scanf("%lld",&aa[i]);
	}
	sort(aa,aa+b,cmp);
	for(int i=0;i<y;i++){
		v.push_back(aa[i]);
	}
	for(int i=0;i<c;i++){
		scanf("%lld",&aa[i]);
		v.push_back(aa[i]);
	}
	sort(v.begin(),v.end(),cmp);
	ll sum=0;
	int siz=v.size();
	for(int i=0;i<x+y;i++){
		sum+=v[i];
	}
	printf("%lld\n",sum);
	return 0;
}

Measured memory_bytes: 3188
#include <bits/stdc++.h>
using namespace std;
int main(void){
    long long N;
    cin >> N;
    long long a[N], b[N], c[N];
    for ( int i = 0 ; i < N ; i++){
        cin >> a[i];
    }
    for ( int i = 0 ; i < N ; i++){
        cin >> b[i];
    }
    for ( int i = 0 ; i < N ; i++){
        cin >> c[i];
    }
    sort(a , a + N);
    sort(c , c + N);
    long long count = 0;
    for(int i = 0; i < N ; i++){
        count += ( lower_bound(a, a + N, b[i] ) - a)*(N - ( lower_bound(c, c + N, b[i] + 1) - c )  );
   }
    printf("%lld\n", count);
    
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
#define ll long long

using namespace std;

ll mod = 1e9+7;

ll gcd(ll a,ll b){
	if(b==0)return a;return gcd(b,a%b);
}
ll expo(ll base,ll pow){
    ll ans = 1;
    while(pow != 0){
        if(pow&1==1){ans = ans*base;}
        base *= base;pow/=2;}return ans;
}
ll inv(ll x){return expo(x,mod-2);}

ll lt[1234][1234], rt[1234][1234], upper[1234][1234], lower[1234][1234];

int dist(int x1, int y1, int x2, int y2){
    return abs(x1-x2)+abs(y1-y2);
}

int pre[123456];

int main(){
    //freopen("ip.txt", "rt", stdin);
    //freopen("op.txt", "wt", stdout);
    int n, k;
    cin >> n >> k;
    int ans = 1;
    vector <int> vec;
    vec.push_back(1);
    for(int i = 0; i < n; i++){
        int s = vec.size();
        vector <int> vec1;
        for(int j = 0; j < s; j++){
            vec1.push_back(vec[j]*2);
            vec1.push_back(vec[j]+k);
        }
        vec = vec1;
    }
    int min1 = vec[0];
    for(int i = 0; i < vec.size(); i++){
        min1 = min(vec[i], min1);
    }
    cout << min1;
}


Measured memory_bytes: 256
using System;

class Program
{
    static void Main()
    {
        solveRectanglePloblems();        
    }
    
    static void solveRectanglePloblems()
    {
        string input = Console.ReadLine();
        string[] inputValues = input.Split(' ');
        int a = Int32.Parse(inputValues[0]);
        int b = Int32.Parse(inputValues[1]);
        Console.WriteLine(a * b + " " + 2 * (a + b));
    }
}


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

using namespace std;

int main(){
  string a, b , c;
  cin >> a >> b >> c;
  if(a[a.length()-1]==b[0] && b[b.length()-1]==c[0]){
    cout << "YES" << endl;
  }
  else{
    cout << "NO" << endl;
  }
}


Measured memory_bytes: 256
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String {
            bytes
                .by_ref()
                .map(|r| r.unwrap() as char)
                .skip_while(|c| c.is_whitespace())
                .take_while(|c| !c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_imports)]
use std::cmp::{min, max};
use std::collections::HashSet;

fn main() {
    input!{
        n: usize,
        m: usize,
        v: [(usize1, usize1); m]
    }
    let mut g = vec![HashSet::new(); n];
    for &(s, t) in &v {
        g[s].insert(t);
    }
    let mut tab0 = search(&g);
    let mut ans = tab0[0];
    for i in 0..n - 1 {
        if g[i].len() == 1 {
            continue;
        }
        let mut rem = 0;
        let mut maxe = 0.0;
        for &c in g[i].iter() {
            if maxe < tab0[c] {
                maxe = tab0[c];
                rem = c;
            }
        }
        g[i].remove(&rem);
        let e = search(&g)[0];
        if ans > e {
            ans = e;
        }
        g[i].insert(rem);
    }
    println!("{}", ans);
}

fn search(g: &Vec<HashSet<usize>>) -> Vec<f64> {
    let n = g.len();
    let mut tab = vec![0.0; n];
    for i in (0..n - 1).rev() {
        for &c in g[i].iter() {
            tab[i] += tab[c] + 1.0;
        }
        tab[i] /= g[i].len() as f64;
    }
    tab
}


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

int main()
{
 string s;
 cin >> s;
 string ans = "" ;
 int cnt = 0;
 for(int i=s.size()-1; i>=0; i--)
 {
     if(!cnt && s[i]!='B')
        ans += s[i];
     else if(cnt && s[i]!='B')
     {
         cnt--;
     }
     else if(s[i]=='B')
        cnt++;
 }
 reverse(ans.begin(),ans.end());
 cout << ans << endl;

 }


Measured memory_bytes: 3612
#include<iostream>
#include<math.h>
#include<algorithm>
#include<utility>
#include<queue>
#include<string.h>
#include<string>
#include<set>
#include<map>
#include<vector>
using namespace std;
typedef long long LL;
typedef pair<int, int> P;

int N,M,Q;
char s[2010][2010]={};
int temp[2010][2010]={};
int p[2010][2010]={};//iとi-1との,高さがjあるときの共通部分の数
int main(){
    cin>>N>>M>>Q;
    for(int i=0;i<N;i++){
        cin >> s[i] ;
    }

    for(int i=0;i<M;i++){
        temp[i][0]=0;
        p[i][0]=0;
        for(int j=1;j<=N;j++){
            temp[i][j] = temp[i][j-1];
            p[i][j] += p[i][j-1];
            if(s[j-1][i]=='1'){
                if(j-2>=0){
                    if(s[j-2][i]=='0'){
                        temp[i][j]++;
                    }
                }else{
                    temp[i][j]++;
                }
                if(i>0 && s[j-1][i-1]=='1'){
                    p[i][j]++;
                }
            }
        }
    }

    for(int i=0;i<Q;i++){
        int x1,y1,x2,y2;
        cin >> x1 >> y1 >> x2 >> y2;
        int ans=0;
        for(int j=y1-1;j<=y2-1;j++){
            ans += temp[j][x2] - temp[j][x1-1];
            if(x1-2>=0 && s[x1-2][j]=='1' && s[x1-1][j]=='1'){
                ans++;
            }
            if(j>0 && j-(y1-1)>0){
                ans -= p[j][x2] - p[j][x1-1];
            }
        }
        cout<<ans<<endl;
    }
    return 0;   
}

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

using namespace std;

#define IOS 			ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ld			long double
#define ll 			long long
#define ull			unsigned long long
#define si(a)			a.size()
#define pb			push_back
#define mp			make_pair
#define F			first
#define S			second
#define lb			lower_bound
#define ub			upper_bound
#define deb(x)			cout<<"#x "<<x<<"\n";
#define trace(x,y)		cout<<"#x "<<x<<" #y "<<y<<"\n";
#define cn			cout<<"\n";
#define mod			1000000007


bool SBF(const pair<int,int>& a, const pair<int,int>& b){return a.F < b.F;}

bool SBS(const pair<int,int>& a, const pair<int,int>& b){return a.S < b.S;}



ll power(ll x, ll y){
	ll res = 1;
	x = x%mod;
	while(y){
	 	
                if(y&1)res = (res*x)%mod;
		y = y >> 1;
		x = (x*x)%mod;
	}
	return res;
}
ll modInv(ll x){
	return power(x , mod - 2);
}


const int INF = 1e9;





void solve(){ 
     int n;
     cin >> n;
     ll a[n];
     ll p[n];
     for(int i= 0 ; i < n ;i++ ){
	     cin >> a[i];
     }
     p[n-1] = a[n-1];
     for(int i = n-2; i>=0 ;i--){
	     p[i] = (a[i] + p[i+1])%mod;

     }
     ll ans = 0;
     for(int i = 0 ;i < n-1 ;i++ ){
         ans = (ans + (a[i]*p[i+1]%mod) )%mod;
     }
     cout<<ans<<"\n";




}











int main(){

    solve();

}
















Measured memory_bytes: 6672
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,d,k,i,j,cnt=0;

    long long int s,x=0;

    cin>>n>>d;
    int a[n][d];
    for(i=0;i<n;i++)
        for(j=0;j<d;j++)
            cin>>a[i][j];

    for(i=0;i<n;i++)
        for(k=i+1;k<n;k++)
        {
            x=0;
            for(j=0;j<d;j++)
                x=x+(a[i][j]-a[k][j])*(a[i][j]-a[k][j]);
            s=sqrt(x);
            //cout<<x<<endl;
            if(s*s==x)
                cnt++;
        }
    cout<<cnt;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(a,n) for (ll a = 0; a < (n); ++a)
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<vector<ll> > Graph;
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; }
const ll INF = 1e18;

ll n,k;
vector<ll>a;

int main(){
    cin >> n >> k;
    a.resize(n);
    rep(i,n)cin>>a[i];
    rep(i,min(100LL,k)){
        vector<ll>b(n+1,0);
        rep(j,n){
            ll l = max(0LL,j-a[j]);
            b[l]++;
            ll r = min(n,j+a[j]+1);
            b[r]--;
        }
        rep(j,n){
            b[j+1] += b[j];
        }
        rep(j,n){
            a[j]=b[j];
        }
    }
    rep(i,n){
        cout << a[i] << endl;
    }
    return 0;
}


Measured memory_bytes: 6360
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstring>
#include <unordered_set>
#include <unordered_map>
#include <numeric>
#include <ctime>
#include <bitset>
#include <complex>
#include <chrono>
#include <random>
#include <functional>

using namespace std;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
typedef long long ll;

using ipair = pair<int, int>;

ll INF = 1e16+7;

bool operator>(const ipair a,const ipair b){return a.first > b.first;}


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

  vector<vector<ipair>> connect(N);
  rep(i, N-1){
    int u, v, w;
    cin >> u >> v >> w;
    u--; v--;
    connect[u].push_back(make_pair(v, w%2));
    connect[v].push_back(make_pair(u, w%2));
  }

  vector<int> colors(N, -1);

  queue<ipair> q;
  q.push(make_pair(0, 0));

  while(!q.empty()){
    ipair p = q.front(); q.pop();
    colors[p.first] = p.second;

    for(ipair np: connect[p.first]){
      if(colors[np.first] != -1) continue;

      q.push(make_pair(np.first, (p.second + np.second)%2));
    }
  }

  rep(i, sz(colors)){
    cout << colors[i] << endl;
  }

}


Measured memory_bytes: 6784
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#ifdef ONLINE_JUDGE
#define LLD "%I64d"
#else
#define LLD "%lld"
#endif
#define fu(a,b,c) for(int a=b;a<=(int)c;++a)
#define fd(a,b,c) for(int a=b;a>=(int)c;--a)
#define cu(a,b,c) for(int a=b;a<(int)c;++a)
#define cd(a,b,c) for(int a=(b)-1;a>=(int)c;--a)
#define gcd(a,b) __gcd(a,b) 
#define pii pair<int,int>
#define pll pair<long long,long long>
#define all(a) a.begin(),a.end()
#define F first
#define S second
#define pb push_back
#define pf push_front
#define MOD 1000000007 
#define MAXN 52
#define MAXH 20
#define MAXM 52
#define INF 100000000
#define ll long long
#define ull unsigned long long
#define RNG rng mt19937(time(NULL))
#define udist(a,b) uniform_int_distribution<uint32_t> distribution(a,b)
#define max3(a,b,c) max(a, max(b, c))
#define min3(a,b,c) min(a, min(b, c))
#define gmax(a,b) a = max(a, b)
#define gmin(a,b) a = min(a, b)
#define whatis(x) cerr << #x << " is " << x << endl;
#define fast_io() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define PI 3.1415926535897932384626433
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

int main(){
	int a,b;
	cin >> a >> b;
	int ans;
	if(a >= 13)ans = b;
	else if(a <= 5)ans = 0;
	else ans = b/2;
	cout << ans << '\n';
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define itn int
#define mod 1000000007
#define INFi 2147483647
#define INFl 9223372036854775807LL
#define fi first
#define se second
#define be begin()
#define en end()
int abs(int a,int b){
    return max(a,b)-min(a,b);
}
int gcd(int a,int b){//最大公約数
int c=a%b;
while(true){
if(c==0) break;
a=b;
b=c;
c=a%b;
}
return b;
}
bool IsPrime(int num){
if (num < 2) return false;
else if (num == 2) return true;
else if (num % 2 == 0) return false;
double sqrtNum = sqrt(num);
for(int i=3;i<=sqrtNum;i+=2){
if(num%i==0){
return false;
}
}
}
int lcm(int a,int b){//最小公倍数
return (a*b)/gcd(a,b);
}	
signed main(){
// __builtin_ctz(N); Nを２で何回割り切れるかを返す
//(n+1)*n/2; １からNまでの総和を求める式
    cin.tie(0);
    ios::sync_with_stdio(false);
    string a,b,c;
    int d=0,e=0;
    cin>>a>>b;
    cout<<b<<a<<"\n";
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <functional>
#include <map>
#include <ostream>
#include <queue>
#include <random>
#include <string>
#include <vector>
#include <cstdlib>
#include <cmath>
#include <cstring>

using std::cin;
using std::cout;
using std::cerr;
using std::endl;

using ll = long long;

inline void init() {
  cin.tie(0);
  std::ios::sync_with_stdio(false);
}

bool is_prime[300001];
std::vector<int> prime;

void eratosthenes(int n) {
  std::fill(is_prime, is_prime + 300000, true);

  is_prime[0] = is_prime[1] = false;

  for (int i = 2; i <= n; ++i) {
    if (is_prime[i]) {
      if (i <= 55555) prime.push_back(i);

      for (int j = 2; i * j <= n; ++j) {
        is_prime[i * j] = false;
      }
    }
  }

  return;
}

int main() {
  init();

  int N;

  cin >> N;

  eratosthenes(300000);

  std::vector<int> ans;

  for (int i = 0; i < prime.size(); ++i) {
    if (prime[i] % 5 == 1) {
      ans.push_back(prime[i]);
      if (ans.size() == N) {
        break;
      }
    }
  }

  for (int i = 0; i < N; ++i) {
    cout << ans[i] << " \n"[i == N - 1];
  }

  return 0;
}

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

int main(){
	char O[51], E[51];
	int i, Olen, Elen;

	scanf("%s", O);
	scanf("%s", E);

	Olen = strlen(O);
	Elen = strlen(E);

	for(i=0; i<Olen-1; i++)
		printf("%c%c", O[i], E[i]);

	if(Olen != Elen)
		printf("%c\n", O[i]);
	else
		printf("%c%c\n", O[i], E[i]);

	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
#define all(x) x.begin(),x.end()
#define rep(i,j,n) for (int i = j; i < (int)(n); i++)
#define _GLIBCXX_DEBUG
#define MOD 1000000007
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; }
//name[i][j]-> vvl name(i,vl(j))
//map<int,int>mp
//余りを切り上げる =>  (a + b - 1) / b 

signed main(){
	string s; cin>>s;
	int n=s.size();
	ll ans=0;
	int cnt=0;
	rep(i,0,n){
		if(s[i]=='B'){
			cnt++;
		}
		else {
			ans+=cnt;
		}
	}
	cout<<ans;
			
	
	return 0;
}

Measured memory_bytes: 640
#include <iostream>
using namespace std;
int main(){

  int n;
  int w,a,b;
  while(cin >> n,n){
    int k[200] = {0},t[200] = {0};
    for(int i = 0 ; i < n ; i++){
      cin >> w >> a >> b;
      k[i] = -w;
      k[i + n] = w;
      t[i] = b;
      t[i + n] = a;
    }

    for(int i = 2*n - 1 ; i >= 0 ; i-- ){
      for(int j = 0 ; j < 2*n ; j++ ){
	if(t[j] > t[j + 1]){
	  swap(t[j],t[j + 1]);
	  swap(k[j],k[j + 1]);
	}
      }
    }
    int ans = 0;
    for(int i = 0 ; i < 2*n ; i++){
      ans +=  k[i];
      if(ans > 150)break;
    }
    if(ans > 150)cout << "NG" << endl;
    else cout << "OK" << endl;
}
  return 0;
}

Measured memory_bytes: 1152
#include <algorithm>
#define _USE_MATH_DEFINES
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include<list>
#include<map>
#include<utility>
#include<tuple>
#include<numeric>
#include<set>

#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(a) a.begin(),a.end()
using namespace std;

int main()
{
	int n;
	cin >> n;
	int ans = 1110 - n;
	cout << ans << endl;
	return 0;


}


Measured memory_bytes: 256
#pragma comment(linker, "/stack:640000000")

#include<bits/stdc++.h>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<stdio.h>
using namespace std;
#define ll long long int
#define scanl(a) scanf("%lld",&a)
#define scanii(a,b) scanf("%d%d",&a,&b)
#define scaniii(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define scanll(a,b) scanf("%lld%lld",&a,&b)
#define scanlll(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
#define scani(a) scanf("%d",&a)
#define clr(a) memset(a,0,sizeof(a))
#define clr_(a) memset(a,-1,sizeof(a))
#define pb(a) push_back(a)
#define pii pair<int,int>
#define sqr(a) a*a
#define eps 1e-9
#define inf INT_MAX
#define pi acos(-1.0)
#define ff first
#define ss second
#define INF 1e18
#define endl '\n'
#define vsort(v) sort(v.begin(),v.end())
#define all(v) v.begin(),v.end()
int fx[]={0,0,-1,1,-1,1,1,-1};
int fy[]={1,-1,0,0,1,1,-1,-1};
#ifdef shaft
     #define debug(args...) {cerr<<"Debug: "; dbg,args; cerr<<endl;}
#else
    #define debug(args...)  // Just strip off all debug tokens
#endif

struct debugger{
    template<typename T> debugger& operator , (const T& v){
        cerr<<v<<" ";
        return *this;
    }
}dbg;


int main()
{
     ios_base::sync_with_stdio(0);
     cin.tie(0);
    #ifdef shaft
       // freopen("in.txt","r",stdin);
        ///freopen("out.txt","w",stdout);
    #endif ///shaft
    string s;
    cin>>s;
    string t;
    t=s;reverse(t.begin(),t.end());
    if(s==t)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}


Measured memory_bytes: 256
// clang-format off
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = 3.14159265358979;
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
bool odd(const int &n) { return n & 1; }
bool even(const int &n) { return ~n & 1; }
template<typename T> int len(const T &v) { return v.size(); }
template<typename T = int> T in() { T x; cin >> x; return x; }
template<typename T = int> T in(T &&x) { T z(forward<T>(x)); cin >> z; return z; }
template<typename T> istream &operator>>(istream &is, vector<T> &v) { for (T &x : v) is >> x; return is; }
template<typename A, typename B> istream &operator>>(istream &is, pair<A, B> &p) { return is >> p.first >> p.second; }
template<typename T> ostream &operator<<(ostream &os, const vector<vector<T>> &v) { int n = v.size(); rep(i, n) os << v[i] << (i == n - 1 ? "" : "\n"); return os; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &v) { int n = v.size(); rep(i, n) os << v[i] << (i == n - 1 ? "" : " "); return os; }
template<typename A, typename B> ostream &operator<<(ostream &os, const pair<A, B> &p) { return os << p.first << ' ' << p.second; }
template<typename Head, typename Value> auto vectors(const Head &head, const Value &v) { return vector<Value>(head, v); }
template<typename Head, typename... Tail> auto vectors(Head x, Tail... tail) { auto inner = vectors(tail...); return vector<decltype(inner)>(x, inner); }
// clang-format on

main() {
  int n = in();
  vector<int> a(n);
  cin >> a;
  int m = in();
  vector<int> b(m);
  cin >> b;
  cout << includes(all(a), all(b)) << endl;
}



Measured memory_bytes: 5892
#include <stdio.h>

#define SIZE 2000000

int main() {
  setvbuf(stdout, NULL, _IOFBF, 2000);
  int A[SIZE];
  int H=0;
  int i, l, largest, tmp, n;
  char com[21], buf[20];
  buf[19]='\n';
  char *p,*c1,*c2;
  c1 = com+1;
  c2 = com+2;
  do {
    fgets(com, 20, stdin);
    if (*com == 'i') {
      n = 0;
      p = com+7;
      while (*p!='\n') {
        n = n*10+*p-'0';
        p++;
      }
      A[++H] = n;
      for (i=H; i>1 && A[i>>1]<A[i];i>>=1) {
        tmp = A[i>>1];
        A[i>>1] = A[i];
        A[i] = tmp;
      }

    } else if (*c1=='x') { // extract
      n = A[1];
      for (i=18; n>0; n/=10) buf[i--]=(n%10)+'0';
      fputs(buf+i+1, stdout);
      A[1] = A[H];
      i = 1;
      while (1) {
        l = i<<1;
        if (l < H && A[l] > A[i])        largest = l;
        else         largest = i;
        if (l+1 < H && A[l+1] > A[largest])  largest = l+1;
        if (largest == i) break;
        tmp = A[i];
        A[i] = A[largest];
        A[largest] = tmp;
        i = largest;
      }
      H--;
    }
  } while (*c2!='d');
  return 0;
}


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

const int nIMPOS = -1;
struct StDist
{
  int m_nDist;
  int m_nFromMeTo;

  StDist(int nDist) : m_nDist(nDist), m_nFromMeTo(0)
  { }
};

void fnInput(vector<vector<int>>& rvvnAdjcy, vector<StDist>& rvoDist)
{
  int nxSiz;
  cin >> nxSiz;

  rvvnAdjcy.resize(nxSiz + 1, vector<int>(nxSiz + 1, 0));
  for (int i = 0; i < nxSiz; ++i)
  {
    int nx, nySiz;
    cin >> nx >> nySiz;
    for (int j = 0; j < nySiz; ++j)
    {
      int ny;
      cin >> ny;
      rvvnAdjcy[nx][ny] = 1;
    }
  }
  StDist oDist(nIMPOS);
  rvoDist.resize(nxSiz + 1, oDist);
}

void fnBreadthFirstSearch(const vector<vector<int>>& cnrvvnAdjcy, 
                          queue<int>& rqnBFSrch, vector<StDist>& rvoDist)
{
  while (rqnBFSrch.size())
  {
    int nx = rqnBFSrch.front(); rqnBFSrch.pop();
    if (rvoDist[nx].m_nDist == nIMPOS)  continue;
    if (rvoDist[nx].m_nFromMeTo == 1 )  continue; 

    rvoDist[nx].m_nFromMeTo = 1;
    for (int ny = 1; ny < cnrvvnAdjcy[nx].size(); ++ny)
      if (cnrvvnAdjcy[nx][ny] == 1)
      {
        int nDist = rvoDist[nx].m_nDist + 1;
        if (rvoDist[ny].m_nDist == nIMPOS)
          rvoDist[ny].m_nDist = nDist;
        else
          rvoDist[ny].m_nDist = min(rvoDist[ny].m_nDist, nDist);

        rqnBFSrch.push(ny);
      }
  }
}

void fnResult(const vector<StDist>& cnrvoDist)
{
  for (int i = 1; i < cnrvoDist.size(); ++i)
    cout << i <<  " " << cnrvoDist[i].m_nDist << endl;
}

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  vector<vector<int>> vvnAdjcy;
  queue<int>  qnBFSrch;
  vector<StDist> voDist;

  fnInput(vvnAdjcy, voDist);

  voDist[1].m_nDist = 0;
  qnBFSrch.push(1);
  fnBreadthFirstSearch(vvnAdjcy, qnBFSrch, voDist);
  fnResult(voDist);

  return 0;
}

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

int main(){
    long long N,K;
    cin>>N>>K;
    long long v=N/K;
    long long ans=v*v*v;
    if(K%2==0){
    long long p=(N+K/2)/K;
    ans+=p*p*p;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define rrep(i,a,b) for(ll i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()

int main(void){
    ll n, k;
    cin >> n >> k;

    ll p[n];
    rep(i, 0, n){
        cin >> p[i];
    }

    ld ans = 0;
    ld ma = 0;
    rep(i, 0, k){
        ans += (p[i] + 1);
        ma = ans;
    }

    rep(i, k, n){
        ans += (p[i] + 1);
        ans -= (p[i - k] + 1);
        ma = max(ma, ans);
    }

    printf("%.9Lf", ma / ld(2.0));
    return 0;
}


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

int main()
{
	int n;
	cin>>n;
	string s;
	cin>>s;
	int sum=0;
	for(int i=1;i<n;i++){
		if(s[i-1]!=s[i])sum++;
	}
	cout<<sum+1;
	return 0;
}


Measured memory_bytes: 512