akhauriyash/Code-Regression huggingface dataset:
#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(v) (v).begin(),(v).end()
#define fi first
#define se second
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> pip;
const ll INF = 1ll<<29;
const ll MOD = 1000000007;
const double EPS = 1e-9;
const bool debug = 0;
//---------------------------------//

int main() {
	int a, b; cin >> a >> b;
	
	if (a % 3 == 0 || b % 3 == 0 || (a + b) % 3 == 0)
		puts("Possible");
	else
		puts("Impossible");
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long ll;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)
	
using namespace std;
const int MAX_N=4e4;
const double INF=1e18;
ll N;
double A[MAX_N],B[MAX_N],C[MAX_N];
int bit[MAX_N+1];
ll K;
int query(int x){
	int ret=0;
	while(x){
		ret+=bit[x];
		x-=x&(-x);
	}
	return ret;
}
void add(int x,int y){
	while(x<=N){
		bit[x]+=y;
		x+=x&(-x);
	}
}
bool chk(double X){
	vector<int> inx;
	REP(i,N)inx.push_back(i);
	sort(inx.begin(),inx.end(),[&](int a,int b){
		return (C[a]-A[a]*X)/B[a]<(C[b]-A[b]*X)/B[b];
	});
	vector<double> kata;
	REP(i,N){
		kata.push_back(-A[inx[i]]/B[inx[i]]);
	}
	vector<int> ckata;
	{
		vector<double> cmp;
		REP(i,N){
			cmp.push_back(kata[i]);
		}
		sort(cmp.begin(),cmp.end());
		REP(i,N){
			ckata.push_back(lower_bound(cmp.begin(),cmp.end(),kata[i])-cmp.begin());
		}
	}
	memset(bit,0,sizeof(bit));
	ll cnt=0;
	REP(i,N){
		cnt+=query(ckata[i]);
		add(ckata[i]+1,1);
	}
	return cnt<K;
}
int main(){
	scanf("%lld",&N);
	REP(i,N){
		scanf("%lf %lf %lf",A+i,B+i,C+i);
	}
	if(N*(N-1)/2%2==0){
		K=N*(N-1)/4;
	}else{
		K=N*(N-1)/4+1;
	}
	double ansx,ansy;
	REP(q,2){
		double lb=-INF,ub=INF;
		REP(i,100){
			double mid=(lb+ub)/2;
			if(chk(mid)){
				lb=mid;
			}else{
				ub=mid;
			}
		}
		if(q==0){
			ansx=ub;
		}else{
			ansy=ub;
		}
		REP(i,N)swap(A[i],B[i]);
	}
	printf("%.12f %.12f\n",ansx,ansy);
}

Measured memory_bytes: 2712
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
bitset<2000005>can;
int n,a[2005],s;
int main(){
	cin>>n;
	rep(i,n) cin>>a[i],s+=a[i];
	if(n == 1){
	    cout << s << endl; return 0;
	}
	can[0] = 1;
	rep(i,n) {
		can |= (can<<a[i]);
	}
	for(int j=s/2;j>=0;j--){
		if(can[j]){
			cout << s-j << endl;
			return 0;
		}
	}
}

Measured memory_bytes: 1024
// Author: raghav_0901
#include<bits/stdc++.h>
#define int long long int
#define f(i,s,e) for(i=s;i<e;++i)
#define fr(i,s,e) for(i=s;i>=e;i--)
#define ff(i,s,e,f) for(i=s;i<e && f;++i)
#define mem(arr,val) memset(arr, val, sizeof(arr))
#define mems(arr, val, n) memset(arr, val, n)
#define vec vector<int>
#define pr pair<int,int>
#define lim 1000000
#define mod 998244353
#define Arena ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;

vec v;
int dp[3000][3001];
int solve(int idx,int s,int n)
{
    if(s==0)
        return n-idx+1;
    if(s<0)
        return 0;
    if(idx>=n)
        return 0;
    if(dp[idx][s]!=-1)
        return dp[idx][s];
    return dp[idx][s] = (solve(idx+1,s,n)+solve(idx+1,s-v[idx],n))%mod;
}

signed main()
{
    Arena
    register int i,j,num,ans=0,t=1;
    //cin>>t;
    while(t--)
    {
        register int n,s;cin>>n>>s;
        v.resize(n);
        mem(dp,-1);
        for(register int &x:v)
            cin>>x;
        f(i,0,n)
            ans=(ans+solve(i,s,n))%mod;
        cout<<ans<<endl;
    }
    return 0;
}

Measured memory_bytes: 70784
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

const int mod = 1000000007;
typedef long long ll;

ll comb[2500][2500];

int main(){
    int K, N;
    cin >> N >> K;
    
    // 二項係数の計算(パスカルの三角形)(上限はテキトーにとってある)
    comb[0][0] = 1;
    for(int i = 1; i <= N + 5; i++){
        comb[i][0] = 1;
        comb[i][i] = 1;
    }
    for(int i = 2; i <= N + 5; i++){
        for(int j = 1; j < i; j++){
            comb[i][j] = ((ll)comb[i - 1][j - 1] + comb[i - 1][j]) % mod;
        }
    }
    
    for(int i = 1; i <= K; i++){
        cout << ((ll)comb[N - K + 1][i] * comb[K - 1][i - 1]) % mod << endl;
    }
}

Measured memory_bytes: 39680
#include<stdio.h>

int main(){

int n,x,i,j,k,count;


while(1){
scanf("%d %d",&n,&x);
if(n == x && n == 0){
break;
}
count = 0;
  for(i = 1; i <= n; i++){
    for(j = 1; j <= n; j++){
      
        for(k = 1; k <= n; k++){
          if(i + j + k == x && i < j && j < k){
          count++;
          }
        }
      
    }
  }
printf("%d\n",count);
}

return 0;
}


Measured memory_bytes: 2112
#include <iostream>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <math.h>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <climits>
#include <bitset>
#include <list>

using namespace std;

typedef unsigned long long ull;
typedef long long ll;

int main(){
    int n, q;
    string s;
    cin >> n >> q >> s;
    int cnt[n+1];
    cnt[0]=0, cnt[1]=0;
    for(int i=2; i<=n; i++){
        cnt[i]=cnt[i-1];
        if(s[i-2]=='A' && s[i-1]=='C') cnt[i]+=1;
    }
    for(int i=0; i<q; i++){
        int l, r;
        cin >> l >> r;
        cout << cnt[r]-cnt[l] << endl;
    }
    return 0;
}

Measured memory_bytes: 1408
h,w = map(int, input().split())
s = []
for i in range(h):
    t = input()
    t = '.' + t + '.'
    s.append(t)
t1 = ''
for i in range(w+2):
    t1 = t1 + '.'
res =['' for _ in range(h)]
s.append(t1)
s.insert(0,t1)
for i in range(1,h+1):
    for j in range(1,w+1):
        if s[i][j]=='#':
            res[i-1] = res[i-1]+'#'
        else:
            t2 = 0
            for k in range(-1,2):
                for l in range(-1,2):
                    if s[i+k][j+l]=='#':
                        t2 += 1
            res[i-1] = res[i-1]+str(t2)
for i in range(h):
    print(res[i])

Measured memory_bytes: 3064
#include "bits/stdc++.h"
using namespace std;
#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)

using ull = unsigned long long;
const ull b = 1000000007;

ull f(string s) {
  ull h = 0;
  rep(i, s.size()) h = b * h + s[i];
  return h;
}

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

  string s;
  cin >> s;
  int n = s.size();
  int q;
  cin >> q;
  vector<set<ull>> hashs(n + 1);
  rep(i, q) {
    string t;
    cin >> t;
    int m = t.size();
    if (m > n) continue;
    hashs[m].insert(f(t));
  }

  vector<int> l(n, -1);
  ull bb = 1;
  for (int len = 1; len <= n; len++) {
    bb *= b;
    if (hashs[len].empty()) continue;
    ull h = f(s.substr(0, len));
    int r = len - 1;
    while (true) {
      if (hashs[len].count(h) && l[r] == -1) {
        l[r] = r - len + 1;
      }
      r++;
      if (r >= n) break;
      h = b * h - bb * s[r - len] + s[r];
    }
  }

  int cnt = 0;
  int r = -1;
  rep(i, n) {
    if (r < l[i]) {
      cnt++;
      r = i;
    }
  }

  cout << cnt << endl;
}



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

using namespace std;

typedef long long int ll;
typedef pair<ll, ll> pll;

#define FOR(i, n, m) for(ll (i)=(m);(i)<(n);++(i))
#define REP(i, n) FOR(i,n,0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll) 1e15;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll A, P;
    cin >> A >> P;
    P += A * 3;
    cout << P / 2 << endl;
    return 0;
}

Measured memory_bytes: 256
fun main(args: Array<String>) {
    val n = readInteger()

    for (x in 1..n) {
        if (x * 108 / 100 == n) {
            println(x)
            return
        }
    }
    println(":(")
}

fun readInteger() = readLine()!!.toInt()
fun readLong() = readLine()!!.toLong()
fun readStringList() = readLine()!!.split(" ")
fun readIntegerList() = readStringList().map(String::toInt)
fun readLongList() = readStringList().map(String::toLong)


Measured memory_bytes: 31660
using System;
using System.IO;
using System.Linq;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            Run(Console.In);
        }

        private static void Run(TextReader textReader)
        {
            var items = textReader.ReadLine().Split(' ').ToArray();
            var MAX_M = int.Parse(items[0]);
            var MAX_D = int.Parse(items[1]);

            var count = 0;

            for (int m = 1; m <= MAX_M; m++)
            {
                for (int d = 10; d <= MAX_D; d++)
                {
                    int d10 = d / 10;
                    int d1 = d % 10;

                    if(d10 >= 2 && d1 >= 2 && d10 * d1 == m)
                    {
                        count++;
                    }
                }
            }

            Console.Out.WriteLine(count);
        }
    }
}


Measured memory_bytes: 13268
#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <climits>
#include <numeric>
#include <cmath>
#include <queue>
#include <sstream>
#include <string.h>
#include <bitset>

using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;

int N;
vector<double> p;
double dp[3100][3100];

int main() {
  cin >> N;
  p.resize(N);
  for (int i = 0; i < N; i++) {
    cin >> p[i];
  }
  
  dp[0][0] = 1.0;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j <= i; j++) {
      dp[i + 1][j + 1] += dp[i][j] * p[i];
      dp[i + 1][j] += dp[i][j] * (1 - p[i]);
    }
  }
  
  double res = 0.0;
  for (int j = (N + 1) / 2; j <= N; j++) {
    res += dp[N][j];
  }
  cout << fixed << setprecision(10) << res << endl;
  return 0;
}


Measured memory_bytes: 72320
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int a1 = Integer.parseInt(sc.next());
        int a2 = Integer.parseInt(sc.next());
        int a3 = Integer.parseInt(sc.next());
        
        if(a1+a2+a3 > 21){
            System.out.println("bust");
        }else{
            System.out.println("win");
        }
    }
}

Measured memory_bytes: 23764
#include <bits/stdc++.h>
#define X first
#define Y second
typedef long long ll;
using namespace std;

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

int n, q, l, r;
string s;
int p[100010];

int main () {

	cin >> n >> q;
	cin >> s;
	for (int i = 1; i < s.size(); i ++) {
		if (s[i-1] == 'A' && s[i] == 'C') p[i] ++;
		p[i] += p[i-1];
	}
	
	for (int i = 0; i < q; i ++) {
		cin >> l >> r;
		l -= 2, r --;
		int sol = p[r];
		if (l >= 0) {
			sol -= p[l];
			if (s[l] == 'A' && s[l+1] == 'C') sol --;
		}
		
		cout << sol << endl;
	}

	return 0;
}

Measured memory_bytes: 1408
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
int f(int x) {
    int ans = 0;
    while(x > 0) {
        ans += x%10;
        x /= 10;
    }
    return ans;
}
int main() {
    int n; cin >> n;
    if(n%f(n)==0) cout << "Yes";
    else cout << "No";   
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#include <numeric>

using namespace std;

int main(){

  string s;
  cin >> s;
  int count = 0;
  for (int i = 0; i < 3; i++){
    if (s[i] == '1'){
      count += 1;
    }
  }
  cout << count << endl;

  return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <string>
#include <queue>
#include <map>
#include <stack>
#include <vector>
#include <algorithm>
#include <set>
#include <deque>
#include <utility>
#include <chrono>
#include <sstream>
#include <iomanip>
#define INF 1 << 30
#define MOD 1000000007;
#define pi 3.14159265358979
#define rep(i, n) for (int (i) = 0; (i) < (int)(n); (i)++)
#define rer(i, l, r) for (int (i) = (int)(l); (i) <= (int)(r); (i)++)
#define reu(i, l, r) for (int (i) = (int)(l); (i) < (int)(r); (i)++)
#define D(x) cout << x << endl
#define d(x) cout << x
#define all(x) (x).begin(), (x).end()
#define pub(x) push_back(x)
#define pob() pop_back()
#define puf(x) push_front(x)
#define pof() pop_front()
#define mp(x, y) make_pair((x), (y))
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long long> vll;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef pair<long, long> pll;
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; }
static const int dx[] = {0, 0, 1, -1};
static const int dy[] = {-1, 1, 0, 0};

int main() { 
  int n;
  cin >> n;
  D(n * (n + 1) / 2);
  return 0;
}



Measured memory_bytes: 256
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE TypeFamilies #-}
import           Data.Maybe
import           Data.Int
import           Data.List
import           Data.Char
  -- import qualified Data.Vector.Unboxing as VU
import qualified Data.Vector as V
import qualified Data.Vector.Mutable as VM
import qualified Data.Vector.Unboxed as VU
import qualified Data.Vector.Unboxed.Mutable as VUM
import qualified Data.ByteString.Char8 as BS
import           Data.List (scanl')
import           Data.IORef
import           Control.Monad
import           Control.Monad.ST
import           Control.Monad.State.Strict
import           Control.Applicative

readInt = BS.readInt . BS.dropWhile isSpace
getVector f = V.unfoldr f <$> BS.getLine
getIntVector = getVector readInt
getBSVector = getVector (BS.uncons . BS.dropWhile isSpace)

main = do
  n <- readLn :: IO Int
  -- (s,t) <- (\vec -> (vec V.! 0,vec V.! 1)) <$> getBSVector
  [s,t] <- BS.words <$> BS.getLine

  let ans = BS.concat $ BS.zipWith (\n m -> BS.pack [n,m]) s t

  -- print s
  -- print t
  putStrLn $ BS.unpack ans


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

namespace A
{
    class Program
    {
        public static void Main(string[] args)
        {
            var l = ReadLineInt();
            double r =  (l*1.0) / 3;

            Console.WriteLine(r * r * r);
            ReadLine();
        }

        /// <summary>
        /// stringを一文字ずつintにキャストして配列に変換します。
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public static int[] StringCharArrayIntArray(string str)
        {
            List<int> b = new List<int>();
            for (int i = 0; i < str.Length; i++) {
                b.Add( int.Parse(str[i].ToString()));
            }
            return b.ToArray();
        }

        public static string ReadLine()
        {
            return Console.ReadLine();
        }

        public static int ReadLineInt()
        {
            return int.Parse(Console.ReadLine());
        }

        public static string[] ReadLineStringSplit(char a = ' ')
        {
            return ReadLine().Split(a).ToArray();
        }

        public static int[] ReadLineIntSpilit(char a = ' ')
        {
            return ReadLine().Split(a).Select(x => int.Parse(x)).ToArray();
        }
    }
}

Measured memory_bytes: 11092
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  int64_t sum=0;
  int64_t line=0;
  int64_t amount;
  int64_t Ans=0;
  int flag=0;
  cin>>N;
  vector<int64_t> A(N+1);
  for(int i=0;i<N+1;i++){
    cin>>A.at(i);
    sum+=A.at(i);
  }
 
  vector<vector<int64_t>> value(N+1,vector<int64_t>(3,0));
    if(sum==1){
      Ans=N+1;
    }else if(A.at(0)==1||N==0&&sum>1){
      Ans=-1;
    }else{
      Ans=1;
      value.at(0).at(2)=1;
      for(int i=0;i<N;i++){
          sum-=A.at(i+1);
          line=value.at(i).at(1)+value.at(i).at(2)*2;
          Ans+=line;
          amount=line-A.at(i+1);
          if(amount<0){
            flag=1;
            Ans=-1;
            break;
          }
          if(amount*2<=sum){
           if(amount==0&&sum!=0){
             flag=1;
             break;
          }
            value.at(i+1).at(2)=amount;
          }else if(amount<=sum){             
            value.at(i+1).at(2)=sum-amount;
            value.at(i+1).at(1)=amount*2-sum;
          }else{
            flag=1;
            Ans=-1;
            break;
          }
      }
    if(flag==1){
      Ans=-1;
    }
    }
 
    cout<<Ans<<endl;
 
 
 
}

Measured memory_bytes: 9592
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,l,r) for(long long i=(l);i<(r);++i)
#define REP(i,n) FOR(i,0,n)
#define REPS(i,n) FOR(i,1,n+1)
#define int long long
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define zero_pad(num) setfill('0') << std::right << setw(num)
const int MOD=1e9+7;
const int INF=1e18;

signed main(){
    int H,W;cin>>H>>W;
    int d[10][10];
    REP(i,10)REP(j,10)cin>>d[i][j];
    REP(k,10)REP(i,10)REP(j,10)d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
    map<int,int>memo;
    REP(i,H*W){
        int a;cin>>a;
        if(a!=-1)memo[a]++;
    }
    int ans=0;
    for(auto v:memo){
        ans+=v.second*d[v.first][1];
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
s=list(input())
from collections import defaultdict
d=defaultdict(int)
for i in s:
    d[i]+=1
# print(d)
if len(d)!=2:
    print("No")
else:
    for i in d.items():
        if i[1]!=2:
            print("No")
            import sys
            sys.exit()
    print("Yes")

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

int main() {
  string S;
  cin >>S;
  if(S.at(0)==S.at(1)){
    if(S.at(1)!=S.at(2)){
      if(S.at(2)==S.at(3)){
        cout <<"Yes"  <<endl;
        return 0;
      }
    }
  }
  else{
    if(S.at(1)==S.at(2)){
      if(S.at(0)==S.at(3)){
        cout <<"Yes" <<endl;
        return 0;
      }
    }
    else{
      if(S.at(0)==S.at(2)){
        if(S.at(1)==S.at(3)){
          cout <<"Yes" <<endl;
          return 0;
        }
      }
    }
  }
  cout <<"No" <<endl;
  return 0;
} 

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define fo(i,a,b) for((i)=(a);i<=(b);i++)
#define rfo(i,a,b) for((i)=(a);i>=(b);i--)
#define inrange(x,y,z) (((x)>=(y))&&((x)<=(z)))
#define ALL(vec) ((vec).begin(),(vec).end())
#define SOR(vec) sort(ALL(vec))
#define UNI(vec) (vec).erase(unique(ALL(vec)),(vec).end())
using namespace std;
int n;
long long a[10010],resu,lll,p=1000000007LL;
map<int,int> cnt;
vector<pair<int,int> > ret;
long long po(long long a,long long b){
	long long res=1LL;
	while(b){
		if(b&1)
			res=(res*a)%p;
		a=(a*a)%p;
		b>>=1;
	}
	return res%p;
}
long long inv(long long a){return po(a,p-2LL);}
void DV(long long x){
	int fst,scd;
	ret.clear();
	for(long long i=2;i<=1000;i++){
		fst=i;
		if(x%i==0LL){
			scd=0;
			while(x%i==0LL){
				x/=i;
				scd++;
			}
			ret.push_back(make_pair(fst,scd));
		}
	}
	if(x!=1LL)
		ret.push_back(make_pair(x,1));
}
int main(){
	#ifdef FILIN
		#ifndef DavidDesktop
			freopen(FILIN,"r",stdin);
			freopen(FILOUT,"w",stdout);
		#endif
	#endif
	ios::sync_with_stdio(0);
	cin.tie(NULL);
	cout.tie(NULL);
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a[i];
		DV(a[i]);
		for(int i=0;i<ret.size();i++)
			cnt[ret[i].first]=max(cnt[ret[i].first],ret[i].second);
	}
	lll=1LL;
	for(__typeof(cnt.begin()) it=cnt.begin();it!=cnt.end();it++){
		lll=(lll*po(it->first,it->second))%p;
	}
	for(int i=1;i<=n;i++){
		resu=(resu+lll*inv(a[i]))%p;
	}
	cout<<resu<<endl;
	return 0;
}


Measured memory_bytes: 768
#include <bits/stdc++.h>
#include <iostream>
#include <functional>
#include <vector>
#include <stdio.h>
#include <queue>
#include <string.h>
#include <math.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<=n;i++)
#define rep1(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=a;i>=n;i--)
#define per1(i,a,n) for (int i=a;i>n;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define endl "\n"
#define pi 3.14159265358979323846264338327950288419716939937510
#define IOS cin.sync_with_stdio(false);cin.tie(0);cout.tie(0);
//#pragma comment(linker, "/STACK:1024000000,1024000000")
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll mod=1000000007;
const int inf=0x3f3f3f3f;
const ll INF=0x3f3f3f3f3f3f3f3f;
ll qpow(ll a,ll b){ll s=1;while(b>0){if(b%2==1){s=s*a;}a=a*a;b=b>>1;}return s;}
ll qpowmod(ll a, ll b, ll c){ll res, t;res=1;t=a%c;while(b){if(b & 1){res=res*t%c;}t=t*t%c;b>>=1;}return res;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
inline long long read(){long long k=0,f=1;char ch=getchar();while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}while(ch>='0'&&ch<='9'){k=k*10+ch-'0';ch=getchar();}return k*f;}
inline void write(long long x){if(x<0)x=-x,putchar('-');if(x>9)write(x/10);putchar(x%10+'0');}
// head
const int maxn=100005;
ll n,a[maxn];
int main()
{
    //IOS;
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    cin>>n;
    if(400<=n&&n<=599)
    {
        cout<<8<<endl;
    }
    else if(600<=n&&n<=799)
    {
        cout<<7<<endl;
    }
    else if(800<=n&&n<=999)
    {
        cout<<6<<endl;
    }
    else if(1000<=n&&n<=1199)
    {
        cout<<5<<endl;
    }
    else if(1200<=n&&n<=1399)
    {
        cout<<4<<endl;
    }
    else if(1400<=n&&n<=1599)
    {
        cout<<3<<endl;
    }
    else if(1600<=n&&n<=1799)
    {
        cout<<2<<endl;
    }
    else if(1800<=n&&n<=1999)
    {
        cout<<1<<endl;
    }
    return 0;
}
/*

*/


Measured memory_bytes: 3636
#!/usr/bin/env python
# coding: utf-8

def ri():
    return int(input())

def rl():
    return list(input().split())

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

def main():
    a, b = rli()
    if a <= 9 and b <= 9:
        print(a*b)
    else:
        print(-1)


if __name__ == '__main__':
    main()


Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for (int i = 1; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define debug(var) do{cout << #var << " : "; view(var);}while(0)
template<class T> bool chmin(T &a, T b) {if(a>b) {a=b;return 1;}return 0;}
template<class T> bool chmax(T &a, T b) {if(a<b) {a=b;return 1;}return 0;}
using namespace std;
template<class T> void view(T e) {cout << e << endl;}
template<class T> void view(const vector<T> &v) {for(const auto &e : v){cout << e << " ";} cout << endl;}
template<class T> void view(const vector<vector<T>> &vv) {for(const auto &v : vv){view(v);}}
using vint = vector<int>;
using vvint = vector<vector<int>>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<int,int>;
const int inf = 1e9;
const ll inf_l = 1e18;
const int MAX = 1e5;

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

int f(string s, int div) {
    if (div == 0) return 0;
    int n = s.size();
    ll x = 0;
    rep(i,n) {
        x = (x*2 + (s[i]-'0')) % div;
    }
    return x;
}

int f_(int x, int ct = 1) {
    if (x == 0) return ct;
    x %= __builtin_popcount(x);
    return f_(x,ct+1);
}

int main() {
    int n; cin >> n;
    string s; cin >> s;
    int div = count(all(s),'1');
    int x_plus = f(s,div+1);
    int x_minus = f(s,div-1);
    rep(i,n) {
        int ans;
        if (s[i] == '0') {
            int x = (x_plus + modpow(2,n-1-i,div+1)) % (div+1);
            ans = f_(x);
        }
        if (s[i] == '1') {
            ll x = x_minus;
            if (div-1 != 0) x -= modpow(2,n-1-i,div-1);
            if (x < 0) x = (x + div-1) % (div-1);
            if (div == 1) ans = 0;
            else ans = f_(x);
        }
        printf("%d\n",ans);
    }
}

Measured memory_bytes: 3928
# -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
from decimal import *


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [input() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [int(input()) for i in range(n)]


class Math():
    @staticmethod
    def gcd(a, b):
        if b == 0:
            return a
        return Math.gcd(b, a % b)

    @staticmethod
    def lcm(a, b):
        return (a * b) // Math.gcd(a, b)

    @staticmethod
    def divisor(n):
        res = []
        i = 1
        for i in range(1, int(n ** 0.5) + 1):
            if n % i == 0:
                res.append(i)
                if i != n // i:
                    res.append(n // i)
        return res

    @staticmethod
    def round_up(a, b):
        return -(-a // b)

    @staticmethod
    def is_prime(n):
        if n < 2:
            return False
        if n == 2:
            return True
        if n % 2 == 0:
            return False
        d = int(n ** 0.5) + 1
        for i in range(3, d + 1, 2):
            if n % i == 0:
                return False
        return True


def pop_count(x):
    x = x - ((x >> 1) & 0x5555555555555555)
    x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
    x = (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f
    x = x + (x >> 8)
    x = x + (x >> 16)
    x = x + (x >> 32)
    return x & 0x0000007f


MOD = int(1e09) + 7
INF = int(1e15)


def isOK(A):
    A.sort()
    for i in range(len(A) - 1):
        if A[i] + 1 != A[i + 1]:
            return False
    return True


def solve():
    A, B, C = Scanner.map_int()
    A, B = B, A
    A, C = C, A
    print(A, B, C, sep=' ')


def main():
    # sys.stdin = open("sample.txt")
    solve()


if __name__ == "__main__":
    main()


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

int main() {
  int N, K, kazu = 1;

  cin >> N >> K;

  for (int i = 0; i < N ; i++) {
    if (kazu * 2 < kazu + K) {
      kazu *= 2;
    } else {
      kazu += K;
    }
  }

  cout << kazu << endl;
}


Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main(void)
{
	int n,ans;
	n=0;
	while(cin>>n){
		ans=0;
		for(int a=0;a<10;a++){
			for(int b=0;b<10;b++){
				for(int c=0;c<10;c++){
					for(int d=0;d<10;d++){
						if(a+b+c+d==n)
							ans++;
					}
				}
			}
		}
		cout<<ans<<endl;
	}
}

Measured memory_bytes: 1160
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <algorithm>
#include <cmath>
#include <cstring>

using namespace std;

#define REP(i,n) for(int i = 0; i < n; i++)
#define RREP(i,n) for(int i = n - 1; i >= 0; i--)

#define ALL(v) v.begin(),v.end()
#define pb push_back
#define mp make_pair
#define F first
#define S second

#define UNIQUE(v) do{sort(v.begin(), v.end()); v.erase( unique(v.begin(), v.end()), v.end() );} while(0)


#define y0 y3487465
#define y1 y8687969

#define m0(x) memset(x,0,sizeof(x))
#define m1(x) memset(x,63,sizeof(x))

typedef long long ll;
typedef pair<int,int> pi;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pi> vpi;
typedef vector<ll> vll;
typedef vector<vll> vvll;

double EPS = 1e-9;
int INFi = 1000000005;
long long INFll = 1000000000000000005ll;
double PI = acos(-1);
int dirx[8] = {-1,0,0,1,-1,-1,1,1};
int diry[8] = {0,1,-1,0,-1,1,-1,1};
ll MOD = 1000000007;

ll N;
const ll MAX_N = 100000;
ll x[MAX_N], y[MAX_N];
char d[MAX_N];

int main(){
  cin >> N;
  REP(i, N) cin >> x[i] >> y[i] >> d[i];
  map<char, ll> xmax, xmin, ymax, ymin;
  char cs[4] = {'R', 'L', 'U', 'D'};
  for (auto c: cs) {
    xmax[c] = -INFll;
    xmin[c] = INFll;
    ymax[c] = -INFll;
    ymin[c] = INFll;
  }
  REP(i, N) {
    xmax[d[i]] = max(xmax[d[i]], x[i] * 2);
    xmin[d[i]] = min(xmin[d[i]], x[i] * 2);
    ymax[d[i]] = max(ymax[d[i]], y[i] * 2);
    ymin[d[i]] = min(ymin[d[i]], y[i] * 2);
  }

  vll ts;
  ts.pb(0);
  ts.pb(xmax['L'] - max(xmax['U'], xmax['D']));
  ts.pb((xmax['L'] - xmax['R']) / 2);
  ts.pb(max(xmax['U'], xmax['D']) - xmax['R']);
  
  ts.pb(min(xmin['U'], xmin['D']) - xmin['R']);
  ts.pb((xmin['L'] - xmin['R']) / 2);
  ts.pb(xmin['L'] - min(xmin['U'], xmin['D']));


  ts.pb(ymax['D'] - max(ymax['L'], ymax['R']));
  ts.pb((ymax['D'] - ymax['U']) / 2);
  ts.pb(max(ymax['L'], ymax['R']) - ymax['U']);

  ts.pb(min(ymin['L'], ymin['R']) - ymin['U']);
  ts.pb((ymin['D'] - ymin['U']) / 2);
  ts.pb(ymin['D'] - min(ymin['L'], ymin['R']));


  ll ans = INFll;

  for (auto t: ts) {
    if(t >= 0 && t < 500000000) {
      ll r = max(max(xmax['L'] - t, xmax['R'] + t), max(xmax['U'], xmax['D']));
      ll l = min(min(xmin['L'] - t, xmin['R'] + t), min(xmin['U'], xmin['D']));
      ll u = max(max(ymax['U'] + t, ymax['D'] - t), max(ymax['L'], ymax['R']));
      ll d = min(min(ymin['U'] + t, ymin['D'] - t), min(ymin['R'], ymin['L']));

      ans = min(ans, (r - l) * (u - d));
    }
  }

  cout << setprecision(15) << fixed << ans / 4.0 << endl;


  return 0;
}


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

//namespace _3_B
//{
class Program
{
    static void Main(string[] args)
    {
        int i = 1;
        while (true)
        {
            //?????????????????????
            string readData = Console.ReadLine();

            // ???????????£???????????????????????£??\??????
            string[] readDataValue = readData.Split(' ');
            int x = int.Parse(readDataValue[0]);

            //??£??\???????????????1??\????????£????????????????????????
            if (x >= 1)
            {
                Console.WriteLine("Case " + i + ": " + x);
            } 
            //x???0?????¨???????????????
            else if (x == 0) break;
            ++i;

        }
    }
}
//}

Measured memory_bytes: 9368
#include <bits/stdc++.h>
using namespace std;
int main(){
  
  string s;
  cin >> s;
  
  if((s.at(5) == '0') && ((s.at(6) == '1') || (s.at(6) == '2') || (s.at(6) == '3') || (s.at(6) == '4')))
    cout << "Heisei" << endl;
  else
    cout << "TBD" << endl;
}



      

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define FOR(i,a,b) for(int i=(a); i<(b); i++)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
typedef long long ll;
typedef pair<int, int> pii;
const int inf = 1e9;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

int main(){
    int h,w; cin >> h >> w;
    char s[h][w];
    rep(i,h){
        rep(j,w){
            cin >> s[i][j];
        }
    }
    int ans = 0;
    vector<vector<int>> dist(h,vector<int>(w));
    rep(i,h){
        rep(j,w){
            if(s[i][j] == '#') continue;

    rep(k,h){
        rep(l,w){
            dist[k][l] = inf;
        }
    }
 
    queue<pii> que;
    que.push(pii(i, j));
    dist[i][j] = 0;
    int tmp = 0;
 
    while(!que.empty()){
        pii p = que.front(); que.pop();
        rep(a,4){
            int nx = p.first + dx[a];
            int ny = p.second + dy[a];
            if(0 <= nx && nx < h && 0 <= ny && ny < w && s[nx][ny] != '#' && dist[nx][ny] == inf){
                que.push(pii(nx, ny));
                dist[nx][ny] = dist[p.first][p.second] + 1;
                tmp = max(tmp, dist[nx][ny]);
            }
        }
        if(que.empty()) ans = max(ans, tmp);
    }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(void)
{
  int a,b,c;
  scanf("%d%d%d",&a,&b,&c);
  if(a>=b && a>=c)
    printf("%d\n",b+c);
  else if(b>=c && b>=a)
    printf("%d\n",a+c);
  else
    printf("%d\n",a+b);
  return 0;
}


Measured memory_bytes: 128
class Node
  attr_accessor :state, :depth
  attr_reader :parent

  def initialize(state, parent)
    @state = state
    @parent = parent
    @depth = parent.nil? ? 0 : parent.depth + 1
  end

  def goal?(limit, max)
    nums.size == limit && sum == max
  end

  def bad_end?(limit, max)
    nums.length > limit || sum > max
  end

  def nums
    parent.nil? ? [state] : parent.nums << state
  end

  def sum
    nums.inject(:+)
  end
end

  while gets
    limit, max = $_.split.map(&:to_i)

    next if limit == 0 && max == 0

    goals = []
    10.times do |i|
      init_node = Node.new(i, nil)
      queue = [init_node]
      black_list = [init_node.nums.sort]

      loop do
        break if queue.empty?

        elem = queue.shift

        goals << elem if elem.goal?(limit, max)

        next if elem.bad_end?(limit, max)

        10.times do |j|
          next if elem.nums.include?(j)
          new_node = Node.new(j, elem)
          new_nums = new_node.nums.sort
          next if black_list.include?(new_nums)
          black_list << new_nums
          queue.unshift new_node
        end
      end
    end

    puts goals.map { |e| e.nums.sort }.uniq.size
  end

Measured memory_bytes: 10724
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <complex>
#include <iomanip>
 
using namespace std;
 
//typedef
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long ll;
 
#define omajinai ios::sync_with_stdio(false);cin.tie(0)
 
//container util
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define UNIQUE(a)  (a).erase(unique((a).begin(),(a).end()),(a).end())
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
 
//repetition
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RFOR(i,b,a) for(int i=(b)-1;i>=(a);--i)
#define RREP(i,n) RFOR(i,n,0)
 
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
 
//debug
#define dump(x)  cerr << "[L " << __LINE__ << "] " << #x << " = " << (x) << "\n";
 
// #define X first
// #define Y second
 
const int INF = 1e9;
const ll LINF = 1e18;
const long double PI = 3.1415926535897932;
const int _N = 2e5;
const int _M = 270000;
int n,m;
int main() {
  omajinai;
  cin>>n;
  int ans=0;
  REP(i,n){
      int l,r;
      cin>>l>>r;
      ans+=r-l+1;
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
               long x=scan.nextLong();
               long k=scan.nextLong();
               long d=scan.nextLong();
               x=Math.abs(x);
               if(x>0 && (x/d)>=k){
                   long qq=x/d;
                   x=x-k*d;
                   System.out.print(x);
                   return;
               }
               long y=x/d;
               x=x-y*d;
               k=k-y;
               if(k%2==0){
                   System.out.print(Math.abs(x));
               }else{
                   System.out.print(Math.min(Math.abs(x-d),Math.abs(x+d)));
               }
    }
}


Measured memory_bytes: 27088
#include <bits/stdc++.h>
using namespace std::literals::string_literals;
using i64 = long long;
using std::cout;
using std::endl;
using std::cin;

template<typename T>
std::vector<T> make_v(size_t a){return std::vector<T>(a);}

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

int main() {
	int n; scanf("%d", &n); std::vector<int> p(n);
	for(int i = 0; i < n; i++) scanf("%d", &p[i]);

	std::vector<std::pair<int, int>> vec;
	for(int i = 0; i < n; i++) vec.push_back({p[i], i});
	sort(begin(vec), end(vec)); reverse(begin(vec), end(vec));

	i64 ans = 0;
	std::set<int> st;
	for(auto v: vec) {
		i64 val = v.first, ind = v.second;

		if(!st.empty()) {
			auto U = st.upper_bound(ind);
			auto L = std::prev(U);

			i64 u = (U == end(st) ? n : *U);
			i64 l = (U == begin(st) ? -1 : *L);

			auto UU = st.upper_bound(u);
			auto LL = std::prev(L);
			i64 uu = (UU == end(st) ? n: *UU);
			i64 ll = (U != begin(st) and L != begin(st) ? *LL : -1);
			i64 A = (uu - u) * (ind - l);
			i64 B = (u - ind) * (l - ll);
			
//			cout << ll << " " << l << " " << ind << " " << u << " " << uu << " " << A << " " << B << endl;
			if(l != -1) ans += B * val;
			if(u != n) ans += A * val;
		}
		st.insert(ind);
	}
	printf("%lld\n", ans);
	return 0;
}


Measured memory_bytes: 6132
#[allow(unused_macros)]
macro_rules! read {
    ([$t:ty] ; $n:expr) =>
        ((0..$n).map(|_| read!([$t])).collect::<Vec<_>>());
    ($($t:ty),+ ; $n:expr) =>
        ((0..$n).map(|_| read!($($t),+)).collect::<Vec<_>>());
    ([$t:ty]) =>
        (rl().split_whitespace().map(|w| w.parse().unwrap()).collect::<Vec<$t>>());
    ($t:ty) =>
        (rl().parse::<$t>().unwrap());
    ($($t:ty),*) => {{
        let buf = rl();
        let mut w = buf.split_whitespace();
        ($(w.next().unwrap().parse::<$t>().unwrap()),*)
    }};
}

#[allow(dead_code)]
#[allow(deprecated)]
fn rl() -> String {
    let mut buf = String::new();
    std::io::stdin().read_line(&mut buf).unwrap();
    buf.trim_right().to_owned()
}

////////////////////////////////////////////////////////////////////////////////

fn main() {
    let n = read!(i32);
    let v = read!([i32]);
    let c = read!([i32]);

    let ans: i32 = (0..n)
        .map(|i| i as usize)
        .map(|i| v[i] - c[i])
        .filter(|&x| x > 0)
        .sum();

    println!("{}", ans);
}


Measured memory_bytes: 4352
# 入力
n = int(input())
p = list(map(int, input().split()))
q = list(map(int, input().split()))

# ライブラリ
import itertools
l = [i+1 for i in range(n)]
perms = itertools.permutations(l, n)

# 処理
a = 0
b = 0
for i, perm in enumerate(perms):
    perm = list(perm)
    if perm == p:
        a = i
    if perm == q:
        b = i

import numpy as np
print(np.abs(a-b))

Measured memory_bytes: 31164
#include<stdio.h>
int main(void){
  char S[5];
  int i,a=1,b=0;
  char c='\0';
  scanf("%s",S);
  for(i=1;i<4;i++){
    if(S[i]==S[0]){
      a++;
    }else{
      if(c=='\0'){
        c=S[i];
        b++;
      }else{
        if(S[i]==c){
          b++;
        }
      }
    }
  }
  if(a==2 && b==2){
    printf("Yes\n");
  }else{
    printf("No\n");
  }
  return 0;
}

Measured memory_bytes: 128
class BIT:
    def __init__(self, n):
        self.size = n
        self.tree = [0] * (n + 1)

    def sum(self, i):
        s = 0
        while i > 0:
            s += self.tree[i]
            i -= i & -i
        return s

    def add(self, i, x):
        while i <= self.size:
            self.tree[i] += x
            i += i & -i


class RangeUpdate:
    def __init__(self, n):
        self.p = BIT(n + 1)
        self.q = BIT(n + 1)

    def add(self, s, t, x):
        t += 1
        self.p.add(s, -x * s)
        self.p.add(t, x * t)
        self.q.add(s, x)
        self.q.add(t, -x)

    def sum(self, s, t):
        t += 1
        return self.p.sum(t) + self.q.sum(t) * t - \
            self.p.sum(s) - self.q.sum(s) * s


def main():
    from string import ascii_lowercase
    dic = {s: i for i, s in enumerate(ascii_lowercase)}
    N = int(input())
    S = [s for s in input()]
    BIT26 = [RangeUpdate(N) for i in range(26)]
    for i, s in enumerate(S):
        j = dic[s]
        BIT26[j].add(i+1, i+1, 1)
    Q = int(input())
    for query in range(Q):
        A = [i for i in input().split()]
        if A[0] == "1":
            i = int(A[1])
            c = A[2]
            pre = S[i-1]
            j = dic[pre]
            BIT26[j].add(i, i, -1)
            S[i-1] = c
            j = dic[c]
            BIT26[j].add(i, i, 1)
        else:
            le = int(A[1])
            ri = int(A[2])
            ans = 0
            for i in range(26):
                if 0 < BIT26[i].sum(le, ri):
                    ans += 1
            print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 272620
#pragma region Macros
#include <bits/stdc++.h>
#define SORT(x) sort((x).begin(), (x).end())
#define RSORT(x) sort((x).rbegin(), (x).rend())
#define ALL(x) (x).begin(), (x).end()
#define REV(x) reverse(ALL(x))
#define rep(i, n) for (ll i = 0; i < n; i++)
#define reps(i, m, n) for (ll i = m; i < n; i++)
#define repr(i, m, n) for (ll i = m; i >= n; i--)
#define SP << " " <<
#define INF2 1000000000000000037
#define INF  1000000007
#define lwb(x,n) distance(x.begin(),lower_bound(ALL(x),(n)))
#define upb(x,n) distance(x.begin(),upper_bound(ALL(x),(n)))
#define fora(i, ...) if(ll i = -1) for(__VA_ARGS__) if(i++, true)
#ifdef _MY_DEBUG
#define isdebug true
#define CHOOSE(a) CHOOSE2 a
#define CHOOSE2(a0,a1,a2,a3,x,...) x
#define debug_1(x1) cout<<#x1<<": "<<x1<<endl
#define debug_2(x1,x2) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<endl
#define debug_3(x1,x2,x3) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<", "#x3<<": "<<x3<<endl
#define debug_4(x1,x2,x3,x4) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<", "#x3<<": "<<x3<<", "#x4<<": "<<x4<<endl
#define de(...) CHOOSE((__VA_ARGS__,debug_4,debug_3,debug_2,debug_1,~))(__VA_ARGS__)
#else
#define isdebug false
#define de(...)
#endif
using namespace std;
using ll = long long;
using ld = long double;
const ld PI = 3.14159265358979323846;
ll intpow(ll a, ll b){ ll ans = 1; while(b){ if(b & 1) ans *= a; a *= a; b /= 2; } return ans; }
template<class T = ll> using v = vector<T>;
template<class T = ll> using vv = vector<vector<T>>;
template<class T = ll> using vvv = vector<vector<vector<T>>>;
template<class T> bool maxi(T &a, const T &b){ if(a<b){a=b;return 1;}return 0;}
template<class T> bool mini(T &a, const T &b){ if(b<a){a=b;return 1;}return 0;}
template<class T> ll sumer(const T& a){ return accumulate(ALL(a),0LL); }
template<class T> void UNIQUE(vector<T> &a){ SORT(a);a.erase(unique(ALL(a)),a.end());}
template<class T, class U> ostream &operator<<(ostream &os, const pair<T,U> &pe) { os << pe.first << " " << pe.second; return os;}
template<class T> ostream &operator<<(ostream &os, const v<T> &ve) { rep(i,ve.size()) os<< (i?" ":"")<<ve[i]; return os;}
ll topbit(ll a) { return a==0?-1:63-__builtin_clzll(a);}
ll botbit(ll a) { return a==0?64:__builtin_ctzll(a);}
ll popcount(ll a) { return __builtin_popcountll(a);}
#define dame {cout<< retword <<"\n"; return;}
#pragma endregion
//--MODIFS---------------------------------
#pragma region Modifs
#define retword "No"
#define MOD  1000000007
const ld EPS = 1e-9;
using P  = pair<ll,ll>;
using TP  = tuple<ll,ll,ll>;
#pragma endregion
//--GLOBAL---------------------------------

//--MAIN-----------------------------------
void Main() {
    string S,T;
    cin>>S>>T;
    rep(i,S.size()){
        if(S[i]!=T[i]) dame;
    }
    cout<< "Yes" <<"\n";
    
}
//--START----------------------------------
int main() {
    cin.tie(nullptr); ios_base::sync_with_stdio(false);
    // if(isdebug) {ifstream in("input.txt"); cin.rdbuf(in.rdbuf());}
    // if(isdebug) {ofstream out("output.txt"); cout.rdbuf(out.rdbuf());}
    cout << fixed << setprecision(15);
    // ll Qkai; cin>>Qkai; rep(QQ,Qkai) Main();
    Main();
}
//-----------------------------------------

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

#define rep(i, a, b) for (int i = a, i##end = b; i <= i##end; ++i)
#define per(i, a, b) for (int i = a, i##end = b; i >= i##end; --i)
#define rep0(i, a) for (int i = 0, i##end = a; i < i##end; ++i)
#define per0(i, a) for (int i = (int)a-1; ~i; --i)
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))
#define chkmax(a, b) a = max(a, b)
#define chkmin(a, b) a = min(a, b)
#define x first
#define y second
#define enter putchar('\n')

typedef long long ll;
typedef double DB;

const DB eps = 1e-12;
const DB PI = acos(-1);

int sgn(DB x) { return fabs(x) < eps ? 0 : (x > 0 ? 1 : -1); }

struct Point {
	DB x, y;
	Point(DB x = 0, DB y = 0) : x(x), y(y) {}
	Point operator + (Point a) { return Point(x + a.x, y + a.y); }
	Point operator - (Point a) { return Point(x - a.x, y - a.y); }
	Point operator - () { return Point(-x, -y); }
	friend Point operator * (DB k, Point a) { return Point(k * a.x, k * a.y); }
	DB operator % (Point a) { return x * a.x + y * a.y; }
	DB operator / (Point a) { return x * a.y - y * a.x; }
	operator DB() { return sqrt(x*x + y*y); }
	bool operator < (const Point &a) const { int d1 = sgn(x-a.x), d2 = sgn(y-a.y); return d1 < 0 || (d1 == 0 && d2 < 0); }
};

int Direct1(Point P, Point P1, Point P2) { return sgn((P1-P)%(P2-P)); }
int Direct2(Point P, Point P1, Point P2) { return sgn((P1-P)/(P2-P)); }

Point P1, P2;
DB r1, r2;

int main() {
	scanf("%lf%lf%lf", &P1.x, &P1.y, &r1);
	scanf("%lf%lf%lf", &P2.x, &P2.y, &r2);
	DB dis = DB(P1-P2);
	if (sgn(dis-r1-r2) > 0) puts("4");
	else if (!sgn(dis-r1-r2)) puts("3");
	else if (sgn(dis-fabs(r1-r2)) > 0) puts("2");
	else if (!sgn(dis-fabs(r1-r2))) puts("1");
	else puts("0");
	return 0;
}


Measured memory_bytes: 3256