akhauriyash/Code-Regression huggingface dataset:
using System;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            string t = Console.ReadLine();

            string ans = "No";
            string u = t.Substring(0, t.Length - 1);

            if(u == s)
            {
                ans = "Yes";
            }
            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 25892
package main

import (
	"fmt"
	"strconv"
)

func main() {
	var str string
	fmt.Scan(&str)
	n := len(str)
	s := make([]int, n)
	m := make([]int, 2020)
	c := 0
	a := 1
	sum := 0
	m[0] = 1

	for i, v := range str {
		s[i], _ = strconv.Atoi(string(v))
	}
	for i := n - 1; i >= 0; i-- {
		sum = (sum + s[i]*a) % 2019
		m[sum]++
		a *= 10
		a %= 2019
	}
	for _, v := range m {
		c += v * (v - 1) / 2
	}
	fmt.Println(c)
}


Measured memory_bytes: 4836
import java.io.*
import java.util.*

// N!の約数のうち,約数の数が75のものの数
// P[ai^bi] -> P(1+bi)
// 75 = 3 * 5 ^ 2 -> (2, 4, 4), (2, 24)
// 10以下の素数 -> 2, 3, 5, 7
// 11 - 97 は21個ある
val primes = listOf(
    2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41,
    43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97
)
fun solve(N: Int) {
    val divisors = primes.map { divisor(N, it) }
    val one = divisors.size
    // (2, 4, 4) -> 3 * 5 * 5 = 75
    val four = divisors.filter { it >= 4 }.size
    val two = divisors.filter { it >= 2 }.size
    val s1 = four * (four - 1) / 2 * (two - 2)
    // (2, 24) -> 3 * 25 = 75
    val twentyFour = divisors.filter { it >= 24 }.size
    val s2 = twentyFour * (two - 1)
    // (4, 14) -> 5 * 15 = 75
    val fourTeen = divisors.filter { it >= 14 }.size
    val s4 = fourTeen * (four - 1)
    // (0, 74) -> 1 * 75 = 75
    val s3 = divisors.filter { it >= 74 }.size
    println(s1 + s2 + s3 + s4)
    return
}

// n!がxで何回割り切れるか
fun divisor(n: Int, x: Int): Int = if (n / x < 1) 0 else n / x + divisor(n / x, x)

fun main(args: Array<String>) {
    fun StringArray(size: Int, init: (Int) -> String = { "\u0000" }): Array<String> {
        return Array<String>(size, init)
    }
    class Scanner(stream: InputStream) {
        private val reader = BufferedInputStream(stream).bufferedReader()
        private var st: StringTokenizer? = null
        fun next(): String {
            while (!(st?.hasMoreTokens() ?: false)) st = StringTokenizer(reader.readLine())
            return st!!.nextToken()
        }
    }
    val sc = Scanner(System.`in`)
    val N = sc.next().toInt()
    solve(N)
}


Measured memory_bytes: 31944
using System;
namespace ITP1_5_A
{
    class Program
    {
        static void Main(string[] args)
        {
            while(true)
            {
                string[] S = Console.ReadLine().Split();
                int H = int.Parse(S[0]);
                int W = int.Parse(S[1]);
                int i;
                int j;
                if(H == 0 && W == 0)
                {
                    break;
                }
                for(i = 1; i <= H; i++)
                {
                    for(j = 1; j <= W; j++)
                    {
                        Console.Write("#");
                    }
                    Console.WriteLine();
                }
                Console.WriteLine();
            }
        }
    }
}


Measured memory_bytes: 15964
N = int(input())
C = list(map(int,input().split()))
C.sort(reverse=True)
MOD = 10**9+7
if N==1:
    print((C[0]*2)%MOD)
    exit()

ans = 0
d = pow(2,N-2,MOD)
base = pow(2,N-1,MOD)
for i,c in enumerate(C):
    ans += c * (base + i*d)
ans *= pow(2,N,MOD)
ans %= MOD
print(ans)

Measured memory_bytes: 26176
x = list(map(int, input().split()))
a = []
a.append(x[2] - x[0])
a.append(x[3] - x[1])

ans = [0, 0, 0, 0]

if a[0] >= 0 and a[1] >= 0:
    ans[0] = x[2] - abs(a[1])
    ans[1] = x[3] + abs(a[0])
elif a[0] >= 0 and a[1] < 0:
    ans[0] = x[2] + abs(a[1])
    ans[1] = x[3] + abs(a[0])
elif a[0] < 0 and a[1] < 0:
    ans[0] = x[2] + abs(a[1])
    ans[1] = x[3] - abs(a[0])
else:
    ans[0] = x[2] - abs(a[1])
    ans[1] = x[3] - abs(a[0])

if a[0] >= 0 and a[1] >= 0:
    ans[2] = ans[0] - abs(a[0])
    ans[3] = ans[1] - abs(a[1])
elif a[0] >= 0 and a[1] < 0:
    ans[2] = ans[0] - abs(a[0])
    ans[3] = ans[1] + abs(a[1])
elif a[0] < 0 and a[1] < 0:
    ans[2] = ans[0] + abs(a[0])
    ans[3] = ans[1] + abs(a[1])
else:
    ans[2] = ans[0] + abs(a[0])
    ans[3] = ans[1] - abs(a[1])
zzz = []
for x in ans:
    zzz.append(str(x))
print(" ".join(zzz))


Measured memory_bytes: 3188
n = gets.chomp.to_i

ref = [*'a'..'z']
arr = Array.new(n) { Array.new(26, 0) }

n.times do |i|
  s = gets.chomp
  s.each_char do |c|
    idx = ref.index(c)
    arr[i][idx] += 1
  end
end

ans = ''

26.times do |j|
  num = 10000
  n.times do |i|
    num = [num, arr[i][j]].min
  end
  ans += ref[j] * num
end

puts ans


Measured memory_bytes: 14244
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
void ABC60(void);
void ABC61(void);
void ABC62(void);
void ABC63(void);
void ABC64(void);
void ABC65(void);
void ABC66(void);
void ABC67(void);
void ABC68(void);
void ABC69(void);

int main(void){
    ABC62();
}

void ABC62(){
    int h,w,i,j;
    cin>>h>>w;
    char a[h][w];
    for(i=0;i<h;i++){
        for(j=0;j<w;j++){
            cin>>a[i][j];
        }
    }
    for(i=0;i<h+2;i++){
        for(j=0;j<w+2;j++){
            if(i==0||j==0||i==h+1||j==w+1)cout<<'#';
            else cout<<a[i-1][j-1];
        }
        cout<<endl;
    }
}

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

int main(){
  string s;
  cin>>s;
  int count=0;
  if(s.at(2)==s.at(3)){
    count++;
  }
  if(s.at(4)==s.at(5)){
    count++;
  }
  if(count==2){
    cout<<"Yes"<<endl;
  }
  else {
    cout<<"No"<<endl;
  }
}

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

using namespace std;

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

int main(){
  int a, b;
  cin >> a >> b;
  cout << max(max(a + b, a - b), a * b) << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define inf (ll)1e9
#define mod (ll)(1e9+7)
#define d(x) cerr<<#x<<"="<<x<<endl;
#define p(x) cout<<(x)<<endl
#define ps(x) cout<<(x);
#define pfix(d,x) cout << fixed << setprecision(d) << x << endl;
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define minel(v) *min_element(all(v))
#define minind(v) distance((v).begin(), min_element(all(v)))
#define maxel(v) *max_element(all(v))
#define maxind(v) distance((v).begin(), max_element(all(v)))
#define fi first
#define se second
ll a[101],b[101],c,d,n,m,x,y,z,h,w,sum,mi,ma,ans,s,t,l,r,res,tmp,itr,p,q;
bool flag;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
int dx8[8]={1,1,0,-1,-1,-1,0,1},dy8[8]={0,1,1,1,0,-1,-1,-1};
char cha;
string st;
typedef map<int, int> imap;
typedef pair<ll, ll> P;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<pair<ll,ll> > VP;

void rec(ll l,ll r){
    if(l>=r)return;
    while(-1){
        rep(i,l,r){
            if(b[i]-a[i]<=0){rec(l,i);rec(i+1,r);return;}
        }
        rep(i,l,r)a[i]++;
        ans++;
    }
}


int main(void){
    cin>>n;
    rep(i,n)cin>>b[i];
    rec(0,n);
    p(ans);
    return 0;
}


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

using namespace std;
typedef long long ll;

int main(){
    ll a,b,n;
    cin>>a>>b>>n;
    if(b>n){
        cout<<floor(a*n/b)<<endl;
    }else{
        cout<<floor(a*(b-1)/b)<<endl;
    }
    
    return 0;
}

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

#include <vector>
using namespace std;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define deg_to_rad(deg) (((deg) / 360) * 2 * M_PI)
#define rad_to_deg(rad) (((rad) / 2 / M_PI) * 360)

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i < (int)(n); i++)

typedef long long ll;

const long long MOD = 1000000007;

int main() {
    int n;
    cin >> n;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];
    ll ans = 0;
    rep(i, 60) {
        ll x = 0;
        rep(j, n) if (a[j] >> i & 1)++ x;
        ll now = x * (n - x) % MOD;
        rep(j, i) now = now * 2 % MOD;
        ans += now;
        ans %= MOD;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 2560
import heapq
n, m = map(int, input().split())
a = list(map(int, input().split()))
h = []
for i in range(n):
    heapq.heappush( h, -a[i])

for _ in range(m):
    cost = heapq.heappop(h)
    heapq.heappush( h, int(cost/2) )

print(-sum(h))

Measured memory_bytes: 14180
#include <bits/stdc++.h>
#include <unistd.h>
#include <sys/time.h>
#include <stdlib.h>
 
using namespace std;
 
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<P, ll> T;
 
long long int INF = 3e18;
const ll fact_table = 1200008;
double Pi = 3.1415926535897932384626;

priority_queue <ll> pql;
priority_queue <P> pqp;
priority_queue <P> bag;
//big priority queue
priority_queue <ll,vector<ll>,greater<ll> > pqls;
priority_queue <P,vector<P>,greater<P> > pqps;
//small priority queue
//top pop
 
ll dx[8]={1,0,-1,0,1,1,-1,-1};
ll dy[8]={0,1,0,-1,1,-1,-1,1};
char dir[] = "DRUL";
//↓,→,↑,←

// インタラクティブ問題の時はこのdefineを外してください
#define endl "\n"
#ifdef ENJAPMA
    #undef endl
#endif
#define p(x) cout<<x<<endl;
#define el cout<<endl;
#define pe(x) cout<<x<<" ";
#define ps(x) cout<<fixed<<setprecision(25)<<x<<endl;
#define pu(x) cout<<(x);
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define CLEAR(a) a = decltype(a)(); 
#define pc(x) cout << x << ",";
 
const ll mod = 998244353ll;
// const ll mod = 1000000007ll;
  
ll mypow(ll number1,ll number2, ll mod){
    if(number2 == 0){
        return 1ll;
    }else{
        ll number3 = mypow(number1,number2 / 2, mod);
        number3 *= number3;
        number3 %= mod;
        if(number2%2==1){
            number3 *= number1;
            number3 %= mod;
        }
        return number3;
    }
}
void YES(bool condition){
    if(condition){
        p("YES");
    }else{
        p("NO");
    }
    return;
}
void Yes(bool condition){
    if(condition){
        p("Yes");
    }else{
        p("No");
    }
    return;
}
/*

ll fact[fact_table + 5],rfact[fact_table + 5]; 
 
void c3_init(){
    fact[0] = rfact[0] = 1;
    for(ll i=1; i<=fact_table; i++){
        fact[i] = (fact[i-1]*i) % mod;
    }
    rfact[fact_table] = mypow(fact[fact_table],mod - 2, mod);
    for(ll i=fact_table; i>=1; i--){
       rfact[i-1] = rfact[i] * i;
       rfact[i-1] %= mod;
    }
    return;}
ll c3(ll n,ll r){
    assert(n >= r);
    assert(n >= 0);
    assert(r >= 0);
    return (((fact[n] * rfact[r]) % mod ) * rfact[n-r]) % mod;}
*/
bool multicase = false;

ll n,m,num,a,b,c,d,e,q, ans;
ll x[500005], y[500005], z[500005];;

void solve(){
    ll h, m;
    cin >> a >> b >> h >> m;
    double ado = (double)30 * h + (double)0.5 * (double)m;
    double bdo = 6 * m;
    ado = ado * 2.0 * Pi / 360;
    bdo = bdo * 2.0 * Pi / 360;
    double ax = cos(ado) * (double)a, ay = sin(ado) * (double)a;
    double bx = cos(bdo) * (double)b, by = sin(bdo) * (double)b;
    double distance = sqrt((ax - bx) * (ax - bx) + (ay - by) * (ay - by));
    ps(distance);
    return;
}

int main(){
    // init();
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll q, testcase = 1;
    if(multicase){
        cin >> q;
    }else{
        q = 1; 
    }
    while(q--){
        // pu("Case ");pu("#");pu(testcase);pu(": ");
        solve();
        testcase++;
    }
    // solve();
    return 0;
}
















Measured memory_bytes: 4124
#include<stdio.h>
signed main(void)
{
  int N,f=0;
  long long x,y,L=1e18;
  x=scanf("%d",&N);
  while(~scanf("%lld",&y))
  {
    if(y==0)return puts("0"),0;
    else if(L/y<x)f=1;
    else x*=y;
  }
  if(f)x=-1;
  return printf("%lld\n",x),0;
}

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

using namespace std;

int main()
{
    int n;
    cin>>n;
    int a[n];
    int b[n];
    for(int i = 0;i<n;i++)
    {
        int x,y;
        cin>>x>>y;
        a[i] = x+y;
        b[i] = x-y;
    }
    sort(a,a+n);
    sort(b,b+n);
    int ans = max(a[n-1]-a[0],b[n-1]-b[0]);
    cout<<ans<<endl;
    return 0;
}


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

const int MAXN = 1e5;

int N, P[MAXN + 10];

int main() {
   scanf("%d", &N);
   for(int i = 1; i <= N; i++) {
      scanf("%d", &P[i]);
   }
   int cc = 0;
   for(int i = 1; i <= N; i++) {
      if(P[i] == i) {
         swap(P[i], P[i+1]);
         cc++;
      }
   }
   printf("%d\n", cc);
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
	ll a,n,b,i,j,k,l,m,s=0,op=0;
	cin>>n;
	ll x[n+1],y[n+1],z[n+1],dp[n+1][3]={0};
	for(i=0;i<n;i++)
		{
			cin>>x[i]>>y[i]>>z[i];
		}
		
	for(i=0;i<n;i++)
	{
		for(j=0;j<3;j++)
		{
			if(i==0)
			{
				if(j==0) dp[i][j]=x[i];
				else if(j==1) dp[i][j]=y[i];
				else dp[i][j]=z[i];
			}
			else
			{
				for(k=0;k<3;k++)
				{
					if(j==k) continue;
					if(j==0) dp[i][j]=max(dp[i][j],dp[i-1][k]+x[i]);
					else if(j==1) dp[i][j]=max(dp[i][j],dp[i-1][k]+y[i]);
					else dp[i][j]=max(dp[i][j],dp[i-1][k]+z[i]);
				}
			}
		}
	}
	cout<<max(dp[n-1][0],max(dp[n-1][1],dp[n-1][2]));
}

Measured memory_bytes: 4992
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long ll;

int main(void)
{
    int n;
    cin >> n;
    ll ans = 0;
    ll d[5]={0};
    for (int i = 0; i < n;i++){
        string s;
        cin >> s;
        if(s[0]=='M')
            d[0]++;
        if(s[0]=='A')
            d[1]++;
        if(s[0]=='R')
            d[2]++;
        if(s[0]=='C')
            d[3]++;
        if(s[0]=='H')
            d[4]++;
    }
    for (int i = 0; i <= 2;i++){
        for (int j = i + 1; j <= 3;j++){
            for (int k = j + 1; k <= 4;k++){
                ans += d[i] * d[j] * d[k];
            }
        }
    }
        cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
string S;
  cin>>S;
  int N=S.size();
  bool ans=true;
  int sum=0;
  if(S.at(0)=='A'){
  for(int i=2;i<N-1;i++){
  if(S.at(i)=='C'){
  sum++; if(sum==2){ans=false;break;}
  }else{
  if(!('a'<=S.at(i) && S.at(i)<='z')){
     ans=false; break;}
  }
  }
  
  }else{
  ans=false;
  }if(sum==0) ans=false;
  if(!('a'<=S.at(N-1) && S.at(N-1)<='z'))
    ans=false;
  if(!('a'<=S.at(1) && S.at(1)<='z'))
    ans=false;
     if(ans)
     cout<<"AC"<<endl;
     else
     cout<<"WA"<<endl;
  return 0;
}



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

#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define mp make_pair
#define pb push_back
#define X first
#define Y second
#define MOD 1000000007

#define trace1(x)                    cout <<#x<<": "<<x<< endl;
#define trace2(x, y)                 cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<< endl;
#define trace3(x, y, z)              cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define trace4(a, b, c, d)           cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;

typedef long long ll;
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(NULL);
    ll i,j,n,m;
    cin>>n;
    ll a[n];
    ll x=0;
    for(i=0;i<n;i++)
    cin>>a[i],x=x^a[i];
    if(x==0)
    cout<<"Yes";
    else
    cout<<"No";
    return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
#include <queue>
#include <cstring>
#define mp make_pair
#define pb push_back
#define p push

#define FOR(a,c) for(int a = 0;a<c;a++)
#define ll long long int

#define getI(a) scanf("%d",&a)
#define getII(a,b) scanf("%d%d",&a,&b)
#define getIII(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define getL(a) scanf("%lld",&a)
#define getLL(a,b) scanf("%lld%lld",&a,&b)
#define getLLl(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
#define BEND(c) (c).begin(),(c).end()
#define BEND2(c) (c).rbegin(),(c).rend()
#define fi first
#define se second
#define pi 3.1415926535897932384626
#define getS(a) scanf("%s",a)
#define pfi(a) printf("%d",a);
#define pfii(a,b) printf("%d%d",a,b);
#define pfl(a) printf("%lld",a);
#define pfll(a,b) printf("%lld%lld",a,b);
#define pfd(a) printf("%lf",a);
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);

#define sag (sol|1)
#define sol (root<<1)
#define ort (bas+son)/2
#define SIZE 1000000007
#define MAXN 100005

using namespace std;

typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<long long> vl;
typedef vector<pair<int, int>> vpi;
typedef vector<pair<long long, long long>> vpl;
typedef pair<int, int> pii;
typedef pair <ll, ll> pll;
typedef vector<vi> graph ;


int main(){
   ll a , b;
   cin >>a>>b;
   if(a <6){
       cout <<0;
   }else  if(a <=12 &&  a>=6 ){
       cout << b/2;
   }else {
       cout << b;
   }
    return 0;
}

Measured memory_bytes: 256
import sys
readline = sys.stdin.readline
N = int(readline())
dp = [[0,0,0] for i in range(N)]
dp[0] = list(map(int,readline().split()))
for i in range(1,N):
    a,b,c = map(int,readline().split())
    dp[i][0] = max(dp[i-1][1],dp[i-1][2]) + a
    dp[i][1] = max(dp[i-1][0],dp[i-1][2]) + b
    dp[i][2] = max(dp[i-1][0],dp[i-1][1]) + c
print(max(dp[N-1]))


Measured memory_bytes: 22772
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;

int main(void) {
    int n;
    cin >> n;
    int ans[n][n];
    int d[n];
    for (int i = 0; i < n; i++) d[i] = -1;
    for (int i = 0; i < n; i++)
        for (int j = 0; j < n; j++)
            ans[i][j] = 0;
    for (int i = 0; i < n; i++) {
        int u, k;
        cin >> u >> k;
        for (int j = 0; j < k; j++) {
            int tmp;
            cin >> tmp;
            ans[u-1][tmp-1] = 1;
        }
    }
//    for (int i = 0; i < n; i++) {
//        for (int j = 0; j < n; j++) {
//            if (j == n-1) cout << ans[i][j];
//            else cout << ans[i][j] << " ";
//        }
//        cout << endl;
//    }
    d[0] = 0;
    queue<int> q;
    q.push(0);
    while (!q.empty()) {
        int now = q.front(); q.pop();
        for (int i = 0; i < n; i++) {
            if (ans[now][i] == 1 && d[i] == -1) {
                d[i] = d[now] + 1;
                q.push(i);
            }
        }
    }
    for (int i = 0; i < n; i++) {
        printf("%d %d\n", i+1, d[i]);
    }
    return 0;
}

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

int main() {
	int n;
	cin >> n;
	vector<string> a(n);
	string k = "Yes";
	for(int i = 0;i < n;i++)
	{
		cin >> a.at(i);
	}
	for(int i = 0;i < n - 1;i++)
	{
		if(a.at(i).at(a.at(i).size()-1) != 
		   a.at(i+1).at(0))
		{
			k = "No";
		}
	}
	sort(a.begin(),a.end());
	for(int i = 0;i < n - 1;i++)
	{
		if(a.at(i) == a.at(i + 1))
		{
			k = "No";
		}
	}
	cout << k << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
#define SIZE 200005
#define INF 1000000005LL
//#define INF 1e18
#define MOD 1000000007

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

string s,t;

int main(){
  cin >> s >> t;
  rep(i,0,s.size()){
    if(s[i] == t[i])continue;
    else{
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;

  return 0;
}


Measured memory_bytes: 3592
#include<bits/stdc++.h>
using namespace std;
#define ll  long long
#define endl '\n'
#define FASTINOUT ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
int main()
{
    FASTINOUT;
    string s;
    cin>>s;
    if (s.back()=='s')
        cout<<s+"es";
    else
        cout<<s+"s";
    return 0;
}


Measured memory_bytes: 3664
package main;

import (
    "fmt"
)

func main() {
    var N, Ma, Mb int
    fmt.Scan(&N, &Ma, &Mb)

    var A, B, C []int;
    var a, b, c int;
	for i := 0; i < N; i++ {
		fmt.Scan(&a, &b, &c)
		A = append(A, a)
		B = append(B, b)
		C = append(C, c)
    }
    fmt.Println(solver(N,Ma,Mb,A,B,C))
}

func solver(N, Ma, Mb int, A, B, C []int) int {
    dp := make([][][]int, N+1)

    var abMax, cMax int;
    for i := 0; i < N; i++ {
            abMax = max(A[i], abMax)
            abMax = max(B[i], abMax)
            cMax = max(C[i], cMax)
    }

    for i := 0; i < N+1; i++ {
        dp[i] = make([][]int, N*abMax+1)
        for j := 0; j < N*abMax+1; j++ {
            dp[i][j] = make([]int, N*abMax+1)
            for k := 0; k < N*abMax+1; k++ {
                dp[i][j][k] = N*cMax+1
            }
        }
    }
    dp[0][0][0] = 0

    for i := 0; i < N; i++ {
        for j := 0; j < N*abMax+1; j++ {
            for k := 0; k < N*abMax+1; k++ {
                if dp[i][j][k] == N*cMax+1 {
                    continue
                }
                dp[i+1][j][k] = min(dp[i+1][j][k], dp[i][j][k])
                dp[i+1][j+A[i]][k+B[i]] = min(dp[i+1][j+A[i]][k+B[i]], dp[i][j][k]+C[i])
            }
        }
    }

    var ans int = N*cMax+1

    for ca := 1; ca < N*abMax+1; ca++ {
        for cb := 1; cb < N*abMax+1; cb++ {
            if ca * Mb == cb * Ma {
                ans = min(ans, dp[N][ca][cb])
            }
        }
    }

    if ans == N*cMax+1 {
        ans = -1
    }
    return ans
}

func min(a, b int) int {
    if a < b {
        return a
    }
    return b
}
func max(a, b int) int {
    if a > b {
        return a
    }
    return b
}

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

int main(){
	int n,x,counter;

	while(1){
		cin>>n>>x;
		counter=0;
		if(n==0&&x==0) return 0;
		for(int i=1;i<=(n-2);i++){
			for(int j=i+1;j<=(n-1);j++){
				for(int k=j+1;k<=n;k++){
					if(i+j+k==x) counter++;
				}
			}
		}
		cout<<counter<<endl;
	}
        return 0;
}

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

int main()
{
	int n,k,s;
	while(cin>>n>>k>>s)
	{
		for(int i=1;i<=n;i++)
		{
			if(i<=k) cout<<s<<" ";
			else
			{
				if(s==1000000000) cout<<s-1<<" ";
				else cout<<s+1<<" ";
			}
		 } 
		 cout<<"\n";
	}
}

Measured memory_bytes: 1280
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define show(x) cout<<#x<<" = "<<x<<endl;
#define print(x)cout<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef tuple<int,int,int> T;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<T> vt;

string f(ll n){
  if(n == 0) return "";
  n--;
  return f(n/26) + string(1,'a' + n%26);

}
int main(){
  ll n;
  cin >> n;
  cout<<f(n)<<endl;
  return 0;
}


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

using namespace std;

using i8 = int8_t;
using i16 = int16_t;
using i32 = int32_t;
using i64 = int64_t;
using u8 = uint8_t;
using u16 = uint16_t;
using u32 = uint32_t;
using u64 = uint64_t;

int main(int argc, char* argv[]) {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  
  i8 C;
  cin >> C;
  cout << (i8)(C+1) << endl;
  
  return 0;
}

Measured memory_bytes: 256
//libraries
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>

//namespace
using namespace std;
using namespace __gnu_pbds;

//typedef
typedef tree<long long,null_type,less<long long>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
typedef tree<long long,null_type,greater<long long>,rb_tree_tag,tree_order_statistics_node_update> ordered_set1;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<long,long> pll;

//define
#define inp(X) cin>>X;
#define inp_long(X) long long X; cin>>X;
#define inp_arr(A,N) long long A[N]; for(int i=0;i<N;i++) {cin>>A[i];}
#define sz(A) A.size()
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define endl '\n'
#define vect(A) vector<long long> A;
#define inp_vect(A,N); for(int i=0;i<N;i++){long long q; cin>>q; A.push_back(q);}
#define forin(i,a,b) for(long long i=a;i<=b;i++)
#define forde(i,a,b) for(long long i=a;i>=b;i--)
#define fio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

const long long inf=(long long)1e18;
const long long MOD=(long long)(1e9+7);

ll power(ll x,ll y)
{
    if (y == 0)
        return 1;
    ll p = power(x, y/2) % MOD;
    p = (p * p) % MOD;

    return (y%2 == 0)? p : (x * p) % MOD;
}
ll modInverse(ll a)
{
   return power(a,MOD-2);
}
int longestRepeatedSubstring(string str) 
{ 
    int n = str.length(); 
    int LCSRe[n+1][n+1]; 
  
    // Setting all to 0 
    memset(LCSRe, 0, sizeof(LCSRe)); 
  
    string res; // To store result 
    int res_length  = 0; // To store length of result 
  
    // building table in bottom-up manner 
    int i, index = 0; 
    for (i=1; i<=n; i++) 
    { 
        for (int j=i+1; j<=n; j++) 
        { 
            // (j-i) > LCSRe[i-1][j-1] to remove 
            // overlapping 
            if (str[i-1] == str[j-1] && 
                LCSRe[i-1][j-1] < (j - i)) 
            { 
                LCSRe[i][j] = LCSRe[i-1][j-1] + 1; 
  
                // updating maximum length of the 
                // substring and updating the finishing 
                // index of the suffix 
                if (LCSRe[i][j] > res_length) 
                { 
                    res_length = LCSRe[i][j]; 
                    index = max(i, index); 
                } 
            } 
            else
                LCSRe[i][j] = 0; 
        } 
    } 
  
    // If we have non-empty result, then insert all 
    // characters from first character to last 
    // character of string 
    if (res_length > 0) 
        for (i = index - res_length + 1; i <= index; i++) 
            res.push_back(str[i-1]); 
  
    return res.length(); 
} 
  
// Driver program to test the above function 
int main() 
{ 
	int n;
	cin>>n;
    string s;
	cin>>s;
	 cout<<longestRepeatedSubstring(s)<<endl;
    return 0; 
} 

Measured memory_bytes: 97920
LARGE = 10 ** 9 + 7


def solve_a(test=False, a=2, b=16):

    if not test:
        a, b = map(int, input().split())
    if (b - a) % 2 == 0:
        print((a + b) // 2)
    else:
        print("IMPOSSIBLE")


def solve_b(test=False, n=5, p_list=[5, 2, 3, 4, 1]):

    if not test:
        n = int(input())
        p_list = list(map(int, input().split()))

    r = 0
    for i in range(n):
        if p_list[i] != i + 1:
            r += 1
    if r == 0 or r == 2:
        print("YES")
    else:
        print("NO")


def solve_c(test=False, n=2, a_list=[3, 5, 2], b_list=[4, 5]):

    if not test:
        n = int(input())
        a_list = list(map(int, input().split()))
        b_list = list(map(int, input().split()))

    res = 0
    for i in range(n):
        if b_list[i] <= a_list[i]:
            res += b_list[i]
            a_list[i] -= b_list[i]
        elif b_list[i] < a_list[i] + a_list[i + 1]:
            res += b_list[i]
            a_list[i + 1] -= b_list[i] - a_list[i]
            a_list[i] = 0
        else:
            res += a_list[i] + a_list[i + 1]
            a_list[i] = 0
            a_list[i + 1] = 0

    print(res)


def solve_d(test=False, s='??2??5'):

    if not test:
        s = input()

    l = len(s)
    res_list_new = [0] * 13
    res_list_old = [0] * 13
    zero_mod = int(s.replace('?', '0')) % 13
    res_list_new[zero_mod] += 1

    for i in range(1, l + 1):
        if s[-i] == '?':
            for k in range(13):
                res_list_old[k] = res_list_new[k] % LARGE
            base_mod = pow(10, i-1, 13)
            for j in range(1, 10):
                for k in range(13):
                    res_list_new[(k + base_mod * j) % 13] += res_list_old[k]

    print(res_list_new[5] % LARGE)


# solve_a(test=True, a=2, b=16)
# solve_a(test=True, a=0, b=3)
# solve_a(test=True, a=998244353, b=99824435)

# solve_b(test=True, n=5, p_list=[5, 2, 3, 4, 1])
# solve_b(test=True, n=5, p_list=[2, 4, 3, 5, 1])
# solve_b(test=True, n=7, p_list=[1, 2, 3, 4, 5, 6, 7])

# solve_c(test=True, n=2, a_list=[3, 5, 2], b_list=[4, 5])
# solve_c(test=True, n=3, a_list=[5, 6, 3, 8], b_list=[5, 100, 8])
# solve_c(test=True, n=2, a_list=[100, 1, 1], b_list=[1, 100])

# solve_d(test=True, s='??2??5')
# solve_d(test=True, s='?44')
# solve_d(test=True, s='7?4')
# solve_d(test=True, s='?6?42???8??2??06243????9??3???7258??5??7???????774????4?1??17???9?5?70???76???')

solve_b()


Measured memory_bytes: 38484
#include <iostream>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <queue>
 
using namespace std;
 
typedef long long ll;
 
const ll INF = 1e9, MOD = 1e9 + 7, MOD2 = 1e6 + 3;

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

int n;

bool f (vector <int> v)
{
	int odd = 0;
	for (int a : v)
		odd += (a & 1);

	if ((v.size () - odd) & 1) {
		return true;
	}
	else {
		if (odd > 1) return false;
		else {
			int g = v[0];
			for (int a : v)
				if ((a & 1) && a != 1) g = gcd (g, a - 1);
				else g = gcd (g, a);

			for (int& a : v)
				a /= g;

			if (g != 1) return !f (v);
			else return false;
		}
	}
}

int main ()
{
	cin >> n;
	vector <int> v (n);

	for (int i = 0; i < n; i++)
		scanf ("%d", &v[i]);

	if (f (v)) cout << "First";
	else cout << "Second";
}

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

int main() {
    int width, height, x, y, r;
    cin >> width >> height >> x >> y >> r;

    if ((x<=width-r) && (x>=r) && (y<=height-r) && (y>=r)) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 3124
#include <bits/stdc++.h>
using namespace std;
int main(){
while(1){
int H, W;
cin>>H>>W;
if(H == 0 && W == 0) break;

for(int i=0;i<H;i++){
for(int j=0;j<W;j++){
if(i == 0 || i == H - 1 || j == 0 || j == W - 1) cout<<"#";
else cout<<".";
}
cout<<endl;
}
cout<<endl;
}
return 0;
}


Measured memory_bytes: 3084
#include <bits/stdc++.h>
 
using namespace std;
 
#define repr(i,a,b) for (int i=a; i<b; i++)
#define rep(i,n) for (int i=0; i<  n; i++)
 
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
 
const long long INF = 1LL << 60;
#define PI 3.14159265359 
 
template<typename T>
void remove(std::vector<T>& vector, unsigned int index)
{
    vector.erase(vector.begin() + index);
}
 
int gcd(int a, int b){
    if(b == 0) return a;
    else return gcd(b, a%b);
}
 
long long lcm (int a, int b){
    return  (long long) a*b /gcd(a,b);
}



int main(){
    int r, D, x;
    cin >>r >> D >> x;

    rep(i,10){
        x = r*x -D;
        cout << x << endl;
    }
}


Measured memory_bytes: 3624
var
	n,i:int64;
begin
	read(n);
	i:=round(sqrt(n));
	while n mod i<>0 do dec(i);
	n:=n div i;
	i:=0;
	while n<>0 do begin
		inc(i);
		n:=n div 10;
	end;
	writeln(i);
end.


Measured memory_bytes: 128
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
#define f first
#define s second
#define fore(i,a,b) for(int i = (a), ThxMK = (b); i < ThxMK; ++i)
#define pb push_back
#define all(s) begin(s), end(s)
#define _ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define sz(s) int(s.size())
#define ENDL '\n'
using namespace std;
typedef long double ld;
typedef long long lli;
typedef pair<lli,lli> ii;
typedef vector<lli> vi;
#define deb(x) cout << #x": " << (x) << endl;

int main(){ _
  lli n;
  cin >> n;
  if (n == 0){
    cout << '1' << ENDL;
  }
  else{
    cout << '0' << ENDL;
  }
  return 0;
}


Measured memory_bytes: 3648
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>

using namespace std;

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

int main(){
    long int n, k;
    cin >> n >> k;

    long int a = k;
    long int ans = 1;
    while(a <= n){
        a *= k;
        ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <bits/stdc++.h>
#define io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define INF 1000000000
#define MOD 1000000007
#define M 998244353
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define ll long long
#define endl "\n"
#define fori(i, a, b) for(i=a; i<b; i++)
#define ford(i, a, b) for(i=a; i>b; i--)
using namespace std;


void solve()
{
    int x, y;
    cin >> x >> y;
    int a = y-2*x, b = 4*x-y;
    if(a>=0 && b>=0 && a%2==0 && b%2==0)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}

int main()
{
    io
    int t;
    t=1;
    // cin >> t;
    while(t--)
        solve();
    return 0;
}

Measured memory_bytes: 3652
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <iterator>
#include <climits>


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

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

inline int ctoi(char c) {
    return (int)(c -'0');
}

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

int main() {
    ll n;
    cin >> n;
    ll ans = 0;
    for (ll i = 1; i <= n; ++i) {
        if (i % 2 == 0) {
            continue;
        }
        ll yakusu = 0;
        for (ll j = 1; j <=i; ++j) {
            if ( i % j == 0) {
                ++yakusu;
            }
        }

        if (yakusu == 8) {
            ++ans;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
n = int(input())

import fractions
import collections
a = collections.deque(list(map(int, input().split())))
 
lcm = a.popleft()
a.append(lcm)
for i in range(1, n):
    tem = a.popleft()
    lcm = lcm * tem // fractions.gcd(lcm, tem)
    a.append(tem)
 
ans = 0
for i in range(n):
    tem = a.popleft()
    ans += lcm // tem
 
print(ans % (10**9+7))

Measured memory_bytes: 6196
use proconio::input;

// ABC086C - Traveling
// https://atcoder.jp/contests/abs/fasks/arc089_a

fn main() {
    input! {
        a: i32,
        b: i32,
        c: i32,
        k: i32,
    }

    let mut amut: i32 = a;
    let mut bmut: i32 = b;
    let mut cmut: i32 = c;

    let mut count = 0;
    while bmut <= amut {
        bmut = bmut * 2;
        count += 1;
    }

    if count > k {
        println!("No");
        return;
    }

    while cmut <= bmut {
        cmut = cmut * 2;
        count += 1;
    }
    if count > k {
        println!("No");
    } else {
        println!("Yes");
    }
}


Measured memory_bytes: 2140
#include <bits/stdc++.h>
using namespace std;
static const int WHITE = 0;
static const int GRAY = 1;

int V, E;
vector<vector<int> > G;
vector<int> color;
list<int> ans;
void init()
{
  G.resize(V);
  color.resize(V, WHITE);
}

void dfs(int u)
{
  color.at(u) = GRAY;
  for (int i = 0; i < G.at(u).size(); i++)
  {
    if (color.at(G.at(u).at(i)) == WHITE)
    {
      dfs(G.at(u).at(i));
    }
  }
  ans.push_front(u);
}

void topological_sort()
{
  for (int i = 0; i < V; i++)
  {
    if (color.at(i) == WHITE)
    {
      dfs(i);
    }
  }
}

int main()
{
  cin >> V >> E;
  init();
  for (int i = 0; i < E; i++)
  {
    int s, t;
    cin >> s >> t;
    G.at(s).push_back(t);
  }
  topological_sort();
  for (int i = 0; i < V; i++)
  {
    cout << ans.front() << endl;
    ans.pop_front();
  }
}


Measured memory_bytes: 3768
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] a = new int[N];

        for(int i = 0; i < N; i++) a[i] = sc.nextInt();
        Arrays.sort(a);
        
        System.out.println(a[N - 1] - a[0]);
    }
}


Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
int main(){
  string str;
  cin >> str;
  int q;
  cin >> q;
  for (int i = 0; i < q; i++){
    string c;
    cin >> c;
    if (c == "print"){
      int a, b;
      cin >> a >> b;
      for (int i = a; i <= b; i++){
        cout << str[i];
      }
      cout << endl;
    }
    if (c == "reverse"){
      int a, b;
      cin >> a >> b;
      string s;
      for (int i = a; i <= b; i++){
        s[i] = str[a + b - i];
      }
      for (int i = a; i <= b; i++){
        str[i] = s[i];
      }
    }
    if (c == "replace"){
      int a, b;
      string p;
      cin >> a >> b >> p;
      for (int i = a; i <= b; i++){
        str[i] = p[i - a];
      }
    }
  }
}


Measured memory_bytes: 3200
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<map>
#include<iostream>
using namespace std;
#define rep(i,n) for(int i=0;i<((int)(n));i++)
#define reg(i,a,b) for(int i=((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i=((int)(n))-1;i>=0;i--)
#define ireg(i,a,b) for(int i=((int)(b));i>=((int)(a));i--)
typedef long long int lli;
typedef pair<int,int> mp;
#define fir first
#define sec second
#define IINF INT_MAX
#define LINF LLONG_MAX
#define eprintf(...) fprintf(stderr,__VA_ARGS__)
#define pque(type) priority_queue<type,vector<type>,greater<type> >
#define memst(a,b) memset(a,b,sizeof(a))
#define iter(v,ite) for(auto ite=(v).begin();ite!=(v).end();ite++)
#define mimunum(v,x) distance((v).begin(),lower_bound((v).begin(),(v).end(),x))


int used[300005];
int main(void){
	int n;
	lli k;
	scanf("%d%lld",&n,&k);
	vector<tuple<lli,lli,lli>> ans;
	
	int sp=n/2;
	rep(i,n){
		lli s=k+n*2+n-1-i;
		lli a = ((sp+i)%n) + k;
		lli b;
		if(sp+i >= n){
			b = n+1+(n-i-1)*2;
		}
		else{
			b = n+(n-i-sp-1)*2;
		}
		b += k;
		if(a+b>s){
			puts("-1");
			return 0;
		}
		ans.push_back(make_tuple(a,b,s));
	}
	rep(i,n){
		lli a,b,s;
		tie(a,b,s) = ans[i];
		printf("%lld %lld %lld\n",a,b,s);
	}
	return 0;
}






Measured memory_bytes: 5360
#include<cstdio>

int main() {
		int r, g, b;
		scanf("%d %d %d", &r, &g, &b);
		if ( (r * 100 + g * 10 + b) % 4 == 0) printf("YES\n");
		else printf("NO\n");
		
		return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <iomanip>

#define ll long long int
#define pb push_back
#define mk make_pair
#define pq priority_queue

using namespace std;
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
const int inf = 1e9;
const ll linf = 1LL << 50;

int main(int argc, char const* argv[])
{
	set<int> st;
	int a, b, c;
	cin >> a >> b >> c;
	st.insert(a);
	st.insert(b);
	st.insert(c);
	cout << st.size() << endl;
	return 0;
}


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

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define ALL(a)     (a).begin(),(a).end()
#define MOD 1000000007

typedef long long int ll;

const ll INF=(ll)1e19;
//const int INF=(1<<30);


int main(){
  int N;
  cin >> N;
  cout << N/3 << endl;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#define rep(i,n) for(int (i) = 0; (i) < (n); ++(i))
#define repp(i,n) for(int (i) = 1; (i) <= (n); ++(i))
#define popcnt __builtin_popcount
#define all(v) v.begin(),v.end()
#define _Pi 3.1415926535
#define _MOD = 1e9+7;
using namespace std;
using ll = long long;
using pint = pair<int,int>;
using itn = int;
using vint = vector<int>;
template<class T> inline bool chmax(T& a, T b){if(a<b){a = b; return true;} return false;}
template<class T> inline bool chmin(T& a, T b){if(a>b){a = b; return true;} return false;}
template<class T> T gcd(T a, T b){return b?gcd(b,a%b):a;}
template<class T> T lcm(T a, T b){return a*b/gcd(a,b);}

int main(){
    int n,k; cin >> n >> k;
    vint h(n); rep(i,n) cin >> h[i];
    sort(all(h));
    int ans = INT_MAX;
    rep(i,n-k+1){
        chmin(ans,h[i+k-1]-h[i]);
    }
    cout << ans << endl;
    
    return 0;
}


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

using namespace std;

using i8 = char;
using u8 = unsigned char;
using i32 = int;
using u32 = unsigned int;
using i64 = long long int;
using u64 = unsigned long long int;

using pii = pair<i32, i32>;

#define LOOP_TYPE(s, n) decltype((n) - (s))
#define FOR(i, s, n) for (auto i = LOOP_TYPE(s, n)(s); i != LOOP_TYPE(s, n)(n); i++)
#define FORR(i, s, n) for (auto i = LOOP_TYPE(s, n)(n) - 1; i != LOOP_TYPE(s, n)(s) - 1; i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) FORR(i, 0, n)
#define mp make_pair

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

int main()
{
	i32 N, M;
	cin >> N >> M;

	vector<list<i32>> g(N + M);
	vector<list<i32>> rg(N + M);
	vector<i32> src(N, 0);	// 頂点iの入次数
	REP(i, N - 1 + M) {
		i32 u, v;
		cin >> u >> v;
		g[u - 1].emplace_back(v - 1);
		rg[v - 1].emplace_back(u - 1);
		src[v-1]++;
	}

	// 入次数が0の頂点をparentsに追加
	stack<i32> parents;
	REP(i, N) {
		if (src[i] == 0) parents.emplace(i);
	}

	// 入次数が0の頂点がなくなるまで繰り返す
	vector<i32> sorted(N);
	i32 index = 0;
	while (!parents.empty()) {
		i32 parent = parents.top();
		parents.pop();
		sorted[parent] = index++;
		for (auto& i : g[parent]) {
			src[i]--;
			if (src[i] == 0) parents.emplace(i);
		}
	}

	REP(i, N) {
		i32 maxOrder = -1;
		i32 parent = -1;
		for (auto j : rg[i]) {
			if (maxOrder < sorted[j]) {
				maxOrder = sorted[j];
				parent = j;
			}
		}
		printf("%d\n", parent + 1);
	}

	return 0;
}


Measured memory_bytes: 11344
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
int main(void){
    int a,b; cin>>a>>b;
    if(a%3==0||b%3==0||(a+b)%3==0){
        cout<<"Possible"<<endl;
    }else{
        cout<<"Impossible"<<endl;
    }
    
}


Measured memory_bytes: 3556
#include <bits/stdc++.h>
using ll = long long;
using ld = long double;
#define F first
#define S second
const ll mod = 1e9 + 7;
const ll INF = 922337203685477;
#define pb push_back
#define deb(x) cout << '>' << #x << ':' << x << endl;
#define fastio ios_base::sync_with_stdio(false); cin.tie(0);
#define maxN 200007
using namespace std;
int main() {
  fastio;
  ll n = 0, m = 0, bombs = 0;
  cin >> n >> m >> bombs;
  vector<ll>row(n, 0);
  vector<ll>col(m, 0);
  set<pair<ll, ll>>s;
  for (ll i = 0; i < bombs; ++i) {
    ll r = 0, c = 0;
    cin >> r >> c;
    --r, --c;
    s.insert({r, c});
    ++row[r], ++col[c];
  }
  ll rmax = *max_element(row.begin(), row.end());
  ll cmax = *max_element(col.begin(), col.end());
  vector<ll>row_ind, col_ind;
  for (ll i = 0; i < n; ++i) {
    if (row[i] == rmax)
      row_ind.pb(i);
  }
  for (ll i = 0; i < m; ++i) {
    if (col[i] == cmax)
      col_ind.pb(i);
  }
  if (row_ind.size()*col_ind.size() > bombs) {
    cout << rmax + cmax;
    return 0;
  }
  ll destroyed = 0;
  for (auto i : row_ind) {
    for (auto j : col_ind) {
      if (s.count({i, j}))
        destroyed = max(destroyed, row[i] + col[j] - 1);
      else
        destroyed = max(destroyed, row[i] + col[j]);
    }
  }
  cout << destroyed;
}

Measured memory_bytes: 35036
#include <iostream>
#include <algorithm>

using namespace std;

int main(){
  int N;
  long long int ans=0;
  cin >> N;
  int L[N];
  for(int i=0; i<N; i++) cin >> L[i];
  sort(L, L+N);

  for(int i=0; i<N; i++){
    for(int j=i+1; j<N; j++){
      for(int k=j+1; k<N; k++){
        if(L[i]+L[j] <= L[k]){
          ans += k-j-1;
          break;
        }
        if(k==N-1) ans+=N-j-1;
      }
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
/*------------------------------------ 
........Bismillahir Rahmanir Rahim.... 
..........created by Abdul Aziz....... 
------------------------------------*/ 
#include <iostream> 
#include <algorithm> 
#include <stdio.h> 
#include <cmath> 
#include <vector> 
#include <set> 
#include <list> 
#include <map> 
#include <cstring> 
#include <unordered_map> 
#include <queue> 
#define   mod  998244353 
#define   int  long long 
#define   ld   long double 
#define   pb   push_back 
#define   vi  vector<int> 
#define   dbg(x)  cerr << #x << " = " << x << '\n' 
#define   sz(x)  (int)x.size() 
#define   all(a) (a.begin(),a.end()) 
#define   ff   first 
#define   ss   second 
#define   pii  pair<int,int> 
#define   lcm(a,b) (a*b)/__gcd(a,b) 
using namespace std;

inline void solve(){
	map <int,int> cnt;
    int n,h=-1; cin>>n; 
    vi a(n);
    for (int i=0,j=0;i<n;i++) 
    	cin >> a[i] ; 
    sort(a.begin(),a.end()); 
    vi res(n);
    if (n&1) res.resize(n-1);
    for (int i=0,j=0;i<n;i++){
    	if (n&1 and i==n/2) h=a[i];
    	else res[j++] = a[i];
    }
    if (n&1) n--;
    list <int> r1;
    r1.pb(res[0]);
    for (int c=1,i=1,j=n-1,k=1;k<n;k++,c+=2){
    	if (k&1) {
    		if (!cnt[j]) r1.pb(res[j]);
	    	if (c+1<n) r1.push_front(res[j-1]);
	    	j -= 2; 
	    	cnt[j+1] = cnt[j+2] = 1;
	    }
	    else {
	    	if (!cnt[i]) r1.pb(res[i]);
	    	if (c+1<n) r1.push_front(res[i+1]);
	    	i += 2; 
	    	cnt[i-1] = cnt[i-2] = 1;
	    }
    }
    int ans=0,pre=-1;
    for (auto &it: r1) {
    	if (pre != -1) ans += abs(pre-it);
    	pre = it;
    } 
    int l=r1.front(),r=r1.back();
    if (h != -1) ans += max(abs(l-h),abs(r-h)); 
    cout << ans << endl;
}

signed main()
{
    int n=1; // cin>>n;
    while (n--) solve();
    return 0;
}
/*
10
5
6 8 1 2 3

5
1 8 2 6 3

6
1 1 3 4 5 9

5
3 1 3 1 3

3 
1 1 3

3
1 3 3

*/


Measured memory_bytes: 14364
#include <iostream>
#include <cstdio>
#include <stack>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
	stack<int> S1;
	stack<pair<int, int> > S2;
	char ch;
	int sum = 0;
	for(int i = 1;cin >> ch; i++){
		if(ch == '\\')S1.push(i);
		else if(ch == '/' && S1.size() > 0){
			int j = S1.top();S1.pop();
			sum += i - j;
			int a = i - j;
			while(S2.size() > 0 && S2.top().first > j){
				a += S2.top().second;S2.pop();
			}
			S2.push(make_pair(j, a));
		}
	}
	vector<int> ans;
	while(S2.size() > 0){ans.push_back(S2.top().second);S2.pop();}
	reverse(ans.begin(),ans.end());
	cout<< sum << endl;
	cout<< ans.size();
	for( int i = 0; i < ans.size(); i++){
		cout<< " ";
		cout<< ans[i];
	}
	cout << endl;
	return 0;
}

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


using namespace std;
int main(){
    int N,D;
    cin >> N >> D;
    vector<vector<int>> X(N,vector<int>(D));
    for (int i=0; i < N; i++){
        for (int j = 0; j < D; j++){
            cin >> X[i][j];
        }
    }
    int ans = 0;

    for (int i=0; i < N; i++){
        for(int j=i+1; j<N; j++){
            int norm =0;
            for (int k=0; k < D; k++){
                int diff = abs(X[i][k]-X[j][k]);
                norm += diff * diff;
            }
            bool flag = false;
            for (int k=0; k <= norm; k++){
                if (k*k == norm){
                    flag = true;
                }
            }
            if(flag) ans++;
        }
    } 
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256