akhauriyash/Code-Regression huggingface dataset:
from collections import Counter
_ = int(input())
A = [int(x) for x in input().split()]
A_ = Counter(A)
A_minusone = Counter([x - 1 for x in A])
A_plusone = Counter([x + 1 for x in A])
print((A_ + A_minusone + A_plusone).most_common()[0][1])

Measured memory_bytes: 37284
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007

int main() {

  long long x,y;
  cin >> x >> y;

  long long mini = 1LL<<60;
  if(x <= y) mini = min(mini,y-x);

  x *= (-1);
  if(x <= y) mini = min(mini,y-x+1);

  y *= (-1);
  if(x <= y) mini = min(mini,y-x+2);

  x *= (-1);
  if(x <= y) mini = min(mini,y-x+1);
  
  cout << mini << endl;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,dis;
    while(scanf("%d%d",&a,&b)!=EOF)
    {
        dis=b-a+1;
        if((dis&1)&&b<0)
            printf("Negative\n");
        else if((dis&1)==0&&b<0)
            printf("Positive\n");
        else if(a<=0&&b>=0)
            printf("Zero\n");
        else printf("Positive\n");
    }
}


Measured memory_bytes: 256
#include <stdio.h>

int main(){
  int a,b,c;
  int count=3;
  scanf("%d %d %d", &a, &b, &c);
  if(a==b)count--;
  if(a==c)count--;
  if(b==c)count--;
  if(count<1)count=1;
  printf("%d", count);
  return 0;
}


Measured memory_bytes: 128
import scala.collection.mutable.ArrayDeque

object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val h, w = sc.nextInt()
  val ch, cw, dh, dw = sc.nextInt() - 1
  val s = Array.fill(h)(sc.next())

  def compose(x1: Int, x2: Int): Int = {
    x1 * w + x2
  }

  def decompose(n: Int): (Int, Int) = {
    val x1 = n / w
    val x2 = n % w
    (x1, x2)
  }

  val sp = Array.fill(h*w)(Int.MaxValue)
  sp(compose(ch, cw)) = 0
  val deque = ArrayDeque[Int]()
  deque.append(compose(ch, cw))
  while (deque.nonEmpty) {
    val (i1, j1) = decompose(deque.removeHead())
    val d = List((1,0), (-1, 0), (0,1), (0, -1))
    for ((di, dj) <- d) {
      val i2 = i1 + di
      val j2 = j1 + dj
      if (0 <= i2 && i2 < h && 0 <= j2 && j2 < w && s(i2)(j2) == '.' &&
        sp(compose(i2, j2)) > sp(compose(i1, j1))) {
        sp(compose(i2, j2)) = sp(compose(i1, j1))
        deque.prepend(compose(i2, j2))
      }
    }

    for {
      di <- -2 to 2
      dj <- -2 to 2
    } {
      val i2 = i1 + di
      val j2 = j1 + dj
      if (0 <= i2 && i2 < h && 0 <= j2 && j2 < w && s(i2)(j2) == '.'
        && sp(compose(i2, j2)) > sp(compose(i1, j1)) + 1) {
        sp(compose(i2, j2)) = sp(compose(i1, j1)) + 1
        deque.append(compose(i2, j2))
      }
    }
  }

  println(if (sp(compose(dh, dw)) == Int.MaxValue) -1 else sp(compose(dh, dw)))
}

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

#define mod 1000000007

 
int powm(int a, int b) {
    int res=1;
    while(b) {
        if(b&1)
            res=(res*a)%mod;
        a=(a*a)%mod;
        b>>=1;
    }
    return res;
}

int ncr(int n, int r){
    int mx = max(n-r, r);

    int a = n;
    int res = 1;

    while(a>mx){
        res*=a;
        res%=mod;
        a--;
    }

    int b = min(n-r, r);

    while(b){
        res*=powm(b, mod-2);
        res%=mod;
        b--;
    }

    return res;
}



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

    int a,b;
    cin >> a >> b;

    int ans = (powm(2,n)-1)%mod;

    ans=( ans %mod - ncr(n,a)%mod + mod )%mod;
    //ans+=mod;
    ans=(ans%mod - ncr(n,b)%mod + mod)%mod;
    //ans+=mod;

    cout << ans << endl;

  //cout << fixed << setprecision(8) << ans << endl;
  return 0;
}
    


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define MOD 1000000007
#define INF 0x7fffffff
#define IO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace __gnu_pbds;
typedef tree<int,null_type,std::less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
using namespace std;
/*
ordered_set X;
X.insert(1);
cout<<*X.find_by_order(1)<<endl; Kth largest element
cout<<X.order_of_key(-5)<<endl;  number of elemets less than K
*/
int const maxi = 200000;
pair<int, pair<int,int> > dp[3003][3003];
int main(){
    //freopen(".txt", "w", stdout
    //IO;
    string a,b;
    cin>>a>>b;
    int n = 3003;
    for(int i = 0; i < a.size(); i++){
        for(int j = 0; j < b.size(); j++){
            if(a[i] == b[j]){
                if(dp[i][j].first + 1 >= dp[i+1][j+1].first){
                    dp[i+1][j+1].first = dp[i][j].first + 1;
                    dp[i+1][j+1].second = {i,j};
                }

            }
            if(dp[i][j].first >= dp[i+1][j].first){
                    dp[i+1][j].first = dp[i][j].first;
                    dp[i+1][j].second = {i,j};
            }
            if(dp[i][j].first >= dp[i][j+1].first){
                    dp[i][j+1].first = dp[i][j].first;
                    dp[i][j+1].second = {i,j};
            }
        }
    }
    pair<int,int> answer;
    int sum = 0;
    for(int i = 0; i < 3003; i++){
        for(int j = 0; j < 3003; j++){
            if(sum < dp[i][j].first){
                sum = dp[i][j].first;
                answer = dp[i][j].second;
            }
        }
    }
    //cout<<answer.first<<" "<<answer.second<<"\n";
    if(sum == 0){
        cout<<"";
        return 0;
    }
    //cout<<sum<<"\n";
    string ans="";
    ans += a[answer.first];
    while(answer.first != 0 && answer.second != 0){
        pair<int,int>prev = answer;
        answer = dp[answer.first][answer.second].second;
        if(answer.first + 1 == prev.first && answer.second + 1 == prev.second){
            ans += a[answer.first];
        }
    }
    reverse(ans.begin(),ans.end());
    cout<<ans;
    return 0;
}


Measured memory_bytes: 105856
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = (s); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) for(int i = (n); i >= 0; i--)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << '\n';
#define CFYN(n) cout << ( (n) ? "YES":"NO") << '\n';
#define OUT(n) cout << (n) << '\n';
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

int main(void)
{
    IOS
    int n,k; cin >> n>>k;
    vector<int> v(n);
    REP(i,n) cin >> v[i];
    sort(RALL(v));
    int ans = 0;
    REP(i,k) ans += v[i];
    cout << ans << '\n';

    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#pragma warning(disable:4996)

int main()
{
	int i = 1, j, n, m = 0;
	scanf("%d", &n);
	for (i; i < 10; i++) {
		for (int j = 1; j < 10; j++) {
			if (n == i*j) {
				m++;
				break;
			}
		}
	}

	if (m == 0) {
		printf("No");
	}
	else {
		printf("Yes");
	} 
	return 0;
}

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

int main() {
  string S;
  cin >> S;
  
  int ss = S.size();
  
  if(S.at(ss-1)=='s'){
    S = S + "es";}
  
  else{S = S + 's';}
  
  cout << S << endl;

  

  
  
}


Measured memory_bytes: 3592
#include <bits/stdc++.h>
using namespace std;
 
template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &vec){ os << "["; for (auto v : vec) os << v << ", "; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const deque<T> &vec){ os << "deq["; for (auto v : vec) os << v << ", "; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const set<T> &vec){ os << "{"; for (auto v : vec) os << v << ", "; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const unordered_set<T> &vec){ os << "{"; for (auto v : vec) os << v << ", "; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const multiset<T> &vec){ os << "{"; for (auto v : vec) os << v << ", "; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const unordered_multiset<T> &vec){ os << "{"; for (auto v : vec) os << v << ", "; os << "}"; return os; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &pa){ os << "(" << pa.first << ", " << pa.second << ")"; return os; }
template<typename TK, typename TV> ostream &operator<<(ostream &os, const map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << ": " << v.second << ", "; os << "}"; return os; }
template<typename TK, typename TV> ostream &operator<<(ostream &os, const unordered_map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << ": " << v.second << ", "; os << "}"; return os; }
template<typename T> void ndarray(vector<T> &vec, int len) { vec.resize(len); }
template<typename T, typename... Args> void ndarray(vector<T> &vec, int len, Args... args) { vec.resize(len); for (auto &v : vec) ndarray(v, args...); }
template<typename T> bool chmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool chmin(T &m, const T q) { if (q < m) {m = q; return true;} else return false; }
template<typename T1, typename T2> pair<T1, T2> operator+(const pair<T1, T2> &l, const pair<T1, T2> &r) { return make_pair(l.first + r.first, l.second + r.second); }
template<typename T1, typename T2> pair<T1, T2> operator-(const pair<T1, T2> &l, const pair<T1, T2> &r) { return make_pair(l.first - r.first, l.second - r.second); }
#define f first
#define s second
 
int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int a;
    cin >> a;
    if(a == 0)
        cout << 1;
    else
        cout << 0;
}

Measured memory_bytes: 3636
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <utility>
#include <algorithm>
#include <cstdio>
#include <iomanip>
#include <queue>
#include <deque>
#include <stack>
#include <fstream>
#include <cmath>
#include <random>
#include <complex>
#include <functional>

#define ll int64_t
#define Rep(i, n) for (ll i = 0; i < n; i++)
using namespace std;
typedef vector<ll> vec;
typedef vector<vec> mat;

const ll inf = 1LL << 60;

template<class T> inline void chmin(T& a, T b) {
    if (a > b) {
        a = b;
    }
}
template<class T> inline void chmax(T& a, T b) {
    if (a < b) {
        a = b;
    }
}

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

    string S;
    cin >> S;
    vector<string> h = {"hi", "hihi", "hihihi", "hihihihi", "hihihihihi"};
    for (string s : h) {
        if (s == S) {
            cout << "Yes\n";
            return 0;
        }
    }
    cout << "No\n";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define i_7 (ll)(1E9+7)
#define i_5 (ll)(1E9+5)
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    else return c+i_7;
}
typedef pair<int,int> i_i;
typedef pair<ll,ll> l_l;
ll inf=(ll)1E12;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll * pos,ll val){*pos=max(*pos,val);}//Max(&dp[i][j],dp[i-1][j]);
void Min(ll * pos,ll val){*pos=min(*pos,val);}
void Add(ll * pos,ll val){*pos=mod(*pos+val);}
const long double EPS=1E-8;
////////////////////////////////////////


int main(){
    int n;cin>>n;
    while(n--){
        int c;cin>>c;if(c%2==1){cout<<"first";return 0;}
    }
    cout<<"second";
    
    
    return 0;
}



Measured memory_bytes: 256
package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {

	var a []int

	for sc.Scan() {
		tmp, _ := strconv.Atoi(sc.Text())
		if tmp == 0 {
			break
		}
		a = append(a, tmp)
	}

	for i, v := range a {
		fmt.Printf("Case %d: %d\n", i+1, v)
	}
}



Measured memory_bytes: 1712
from collections import deque

dxy = [(1, 0), (0, 1), (-1, 0), (0, -1)]

while True:
    W, H = map(int, input().split())
    if W == 0 and H == 0:
        break
    
    sx = -1
    sy = -1
    mat = [[None for _ in range(W)] for _ in range(H)]
    for i in range(H):
        s = input()
        for j in range(W):
            if s[j] == "@":
                sx = j
                sy = i
            mat[i][j] = s[j]
    
    ans = 0
    q = deque()
    q.append((sx, sy))
    while q:
        (cx, cy) = q.popleft()
        ans += 1
        for dx, dy in dxy:
            nx = cx + dx
            ny = cy + dy
            if 0 <= nx < W and 0 <= ny < H:
                if mat[ny][nx] == ".":
                    mat[ny][nx] = "#"
                    q.append((nx, ny))
    print(ans)


Measured memory_bytes: 6012
N=int(input())
num_list=[]
S=""
P=""
for i in range(0,N):
    S,P=map(str,input().split())
    P=int(P)
    num_list.append([i+1,S,100-P])
num_list=sorted(num_list,key=lambda x:(x[1],x[2]),reverse=False)

for i in range(0,N):
    print(num_list[i][0])

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

int main(void){
    lli x;

    cin>>x;

    lli xx=120;

    for(lli i=-xx;i<=xx;i++){
        for(lli j=-xx;j<=xx;j++){
            lli temp=pow(i,5)-pow(j,5);
            if(temp==x){
                cout<<i<<" "<<j<<endl;
                return 0;
            }
        }
    }

    return 0;
}

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

int main()
{
    long double r ;
    cin >> r ;

    long double pie = 3.1415926535897932 ;

    long double ans = 2 * pie * r ;
    cout << fixed << setprecision ( 5 ) << ans ;

    return 0 ;
}


Measured memory_bytes: 3788
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<cassert>
#include<complex>//real().imag().
#include<cctype>
#include<algorithm>
#include<iomanip>
#include<stack>
#include<queue>
#include<list>
#include<map>
#include<set>
#include<deque>
#include<string>
#include<utility>
#include<iterator>
#define pii pair<int,int>
#define make_pair mp
using namespace std;
typedef long long ll;
int main()
{
    // freopen("D:\\in.txt","r",stdin);
    // freopen("D:\\out.txt","w",stdout);
    //ios::sync_with_stdio(false);
    //system("pause");
    string s;
    int sum=0;
    cin>>s;
    for(int i=0;i<s.size()-1;i++)
    {
        if(s[i]!=s[i+1])
        {
            sum++;
        }
    }
    cout<<sum<<endl;

  return 0;
}



Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <cstring>
#include <math.h>
#include <bitset>
#include <queue>
#include <set>
#include <iomanip>
#include <math.h>
#include <assert.h>
// #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr long long int INFLL = 1001001001001001LL;
constexpr int INF = 1000000007;
const int mod = 1000000007;

template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}
template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}

ll gcd(ll a, ll b)
{
    if (a % b == 0)
    {
        return (b);
    }
    else
    {
        return (gcd(b, a % b));
    }
}

ll lcm(ll a, ll b)
{
    return a / gcd(a, b) * b;
}

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

int main()
{
    ll n;
    cin >> n;
    ll a;
    map<ll, ll> rensou;
    for (int i = 0; i < n; i++)
    {
        cin >> a;
        rensou[a]++;
    }
    ll sum = 0;
    for (auto f : rensou)
    {
        if (f.first > f.second)
        {
            sum += f.second;
        }
        else if (f.first < f.second)
        {
            sum += f.second - f.first;
        }
    }
    cout << sum << endl;
}


Measured memory_bytes: 6272
#D - Alter Altar /
N = int(input())
C =[]
C = list(map(str,input()))
red_ko    = len(list(filter(lambda x :x == 'R',C)))
write_ko  = 0
total = max(write_ko,red_ko)
for i in range(N):
    if str(C[i]) == 'R' :
        red_ko -= 1
    else:
        write_ko += 1
    M = max(write_ko,red_ko)
    if total > M : total = M
# 出力
print(total)

Measured memory_bytes: 12272
class PrimeOptimizer:
    def __init__(self, MAX_NUM=10**3):
        is_prime = [True] * MAX_NUM
        is_prime[0] = False
        is_prime[1] = False
        primes = []
        for i in range(MAX_NUM):
            if is_prime[i]:
                primes.append(i)
                for j in range(2*i, MAX_NUM, i):
                    is_prime[j] = False
        self.primes = primes

    def prime_factorization(self, x):
        res = {}
        for prime in self.primes:
            while x % prime == 0:
                if not prime in res:
                    res[prime] = 0
                res[prime] += 1
                x //= prime
        if x > 1:
            res[x] = 1
        return res

MOD = 10**9+7

def mod_pow(p, q):
    res = 1
    while q:
        if q & 1:
            res = (res * p) % MOD
        p = (p * p) % MOD
        q //= 2
    return res

def mod_inv(p):
    return mod_pow(p, MOD - 2)

def solve(n, a):
    primeOpt = PrimeOptimizer()
    D = {}
    for i in range(n):
        prime_num_mapping = primeOpt.prime_factorization(a[i])
        for prime, num in prime_num_mapping.items():
            if not prime in D:
                D[prime] = 0
            D[prime] = max(D[prime], num)
    L = 1
    for prime, num in D.items():
        L = (L * mod_pow(prime, num)) % MOD
    res = sum([L * mod_inv(x) % MOD for x in a])
    return res % MOD

N = int(input())
A = list(map(int, input().split()))
print(solve(N, A))


Measured memory_bytes: 4596
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <sstream>
#include <istream>

using namespace std;

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

int main(){
	int n,k;
	cin >> n >> k;
	string s;
	cin >> s;
	s[k - 1] = s[k - 1] - 'A' + 'a';
	cout << s << endl;

		return 0;
}

Measured memory_bytes: 256
def has_child(data, n):
    data_len = len(data) - 1  # [0]????????????????????§?????£?????????????????°???-1??????
    if data_len < n * 2:
        return 0
    else:
        if data_len >= (n * 2) + 1:
            return 2
        else:
            return 1


if __name__ == '__main__':
    # ??????????????\???
    num_of_data = int(input())
    data =  [int(x) for x in input().split(' ')]

    # ???????????????
    data.insert(0, None)  # ?????????????????????????????????[0]????????????????????\??????

    # ???????????????
    for i in range(1, num_of_data+1):
        print('node {0}: key = {1}, '.format(i, data[i]), end='')
        if i > 1:
            print('parent key = {0}, '.format(data[i//2]), end='')
        child = has_child(data, i)
        if child == 1:
            print('left key = {0}, '.format(data[i*2]), end='')
        if child == 2:
            print('left key = {0}, right key = {1}, '.format(data[i*2], data[i*2+1]), end='')
        print('')

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

const int INF = 1e9;
string s, t;
int A[26][100000];
int main() {
  cin >> s >> t;
  const int N = s.size();
  for (int k = 0; k < 26; ++k) {
    for (int i = 0; i < N; ++i) {
      if (s[i] == 'a' + k) {
        A[k][i] = 0;
      } else {
        A[k][i] = INF;
      }
    }
  }

  for (int k = 0; k < 26; ++k) {
    for (int i = 2 * N; i >= 0; --i) {
      A[k][i % N] = min(A[k][i % N], A[k][(i + 1) % N] + 1);
    }
  }
  
  long sum = -1;
  for (char c : t) {
    ++sum;
    int i = sum % N;
    if (A[c - 'a'][i] == INF) {
      cout << -1 << endl;
      return 0;
    }
    sum += A[c - 'a'][i];
  }
  cout << sum + 1 << endl;
}


Measured memory_bytes: 10880
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <queue>
#include <deque>

using namespace std;

typedef long long ll;

int n, m, k;
ll a[111111];
ll dp4[333][111111];
int deq[333][111111];
int s[333], t[333];

int main(void) {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 0; i < n; i++) {
    scanf("%lld", a+i);
  }
  memset(dp4, -1, sizeof(dp4));
  for (int i = 0; i <= n; i++) {
    dp4[0][i] = 0;
    deq[0][t[0]++] = 0;
  }
  ll res = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = k-1; j >= 0; j--) {
      if (s[j] < t[j]) {
        dp4[j+1][i] = dp4[j][deq[j][s[j]]] + a[i-1]*(j+1);
        res = max(res, dp4[j+1][i]);
        while (s[j+1] < t[j+1] &&
               dp4[j+1][deq[j+1][t[j+1]-1]] <= dp4[j+1][i]) --t[j+1];
        deq[j+1][t[j+1]++] = i;
        if (i-m >= 0) {
          if (j > 0 && deq[j][s[j]] == i-m) {
            ++s[j];
          }
        }
      }
    }
  }
  printf("%lld\n", res);
  return 0;
}


Measured memory_bytes: 408192
/*
　　　  ∧＿∧　やあ
　　 （´・ω・｀)　　　　　/　　　　　ようこそ、バーボンハウスへ。
　　 ／∇y:::::＼　　　 [￣]　　　　　このテキーラはサービスだから、まず飲んで落ち着いて欲しい。
　　 |:⊃:|:::::|　　　|──|
￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣|　うん、「また」なんだ。済まない。
￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣|￣　  仏の顔もって言うしね、謝って許してもらおうとも思っていない。
￣￣￣￣￣￣￣￣￣￣￣￣￣￣／|
　　　　∇　∇　∇　∇　　　／.／|　　　でも、この提出を見たとき、君は、きっと言葉では言い表せない
　　　　┴　┴　┴　┴　／ ／　  |　　　「ときめき」みたいなものを感じてくれたと思う。
￣￣￣￣￣￣￣￣￣￣|／　　  |　　　殺伐としたコンテストの中で、そういう気持ちを忘れないで欲しい
￣￣￣￣￣￣￣￣￣￣　　　　 |　　　そう思って、この提出を投げたんだ。
　　　(⊆⊇)　(⊆⊇)　(⊆⊇)　　|
　    ||　　 ||　　||　　|　　　 じゃあ、判定を聞こうか。
　　.／|＼　／|＼ ／|＼
*/

#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <functional>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define fst first
#define snd second
#define mp make_pair
#define ALL(obj) (obj).begin(),(obj).end()
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i = (b-1);i>=a;i--)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n) 
#define SIZE(x) ((int)(x).size())
#define debug(x) cerr << #x << " -> " << x << " (line:" << __LINE__ << ")" << '\n';
#define debugpair(x, y) cerr << "(" << #x << ", " << #y << ") -> (" << x << ", " << y << ") (line:" << __LINE__ << ")" << '\n';
typedef long long lint;
typedef pair<int, int> pint;
typedef pair<lint, lint> plint;
typedef vector<lint> vec;
typedef vector<vector<lint>> matrix;
typedef priority_queue<lint> p_que;
typedef priority_queue<lint, vector<lint>, greater<lint>> p_que_rev;
const lint INF = INT_MAX;
const lint LINF = LLONG_MAX;
const lint MOD = 1000000000 + 7;
const double EPS = 1e-9;
const double PI = acos(-1);
const int di[]{0, -1, 0, 1, -1, -1, 1, 1};
const int dj[]{1, 0, -1, 0, 1, -1, -1, 1};

lint gcd(lint a, lint b) {
    lint r;
    while (b != 0) {
        r = a % b;
        a = b; 
        b = r;
    }
    return a;
}

lint lcm(lint a, lint b) {
    return (a / gcd(a, b)) * b;
}

lint power(lint x, lint n, lint mod = MOD) {
    lint ret = 1;
    while(n > 0) {
        if(n & 1){
            (ret *= x) %= mod;
        }
        (x *= x) %= mod;
        n >>= 1;
    }
    return ret;
}

vector<lint> make_power(int n, lint base){
    lint num = 1;
    vector<lint> ret;
    for (int i=0; i<=n; ++i){
        ret.push_back(num);
        num *= base;
    }
    return ret;
}

// vars
string s;

void input(){
    cin >> s;
}

void solve(){
    lint ans = 0;
    int l = s.length();
    int loop = power(2, l-1);
    REP(i, loop){
        auto b = static_cast<bitset<10>>(i);
        lint num = s[0] - '0';
        REP(j, l-1){
            if(b[j] == 1){
                ans += num;
                num = s[j+1] - '0';
            }
            else {
                num = num * 10 + (s[j+1] - '0');
            }
        }
        ans += num;
    }
    cout << ans << endl;
}

int main() {
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    input();
    solve();
    return 0;
}

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

// definitions
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define rep(i, l, r) for (long long i = (l); i < (long long)(r); i++)
#define repb(i, r, l) for (long long i = (r); i > (long long)(l); i--)
#define pb push_back
#define mod1 998244353
#define mod 1000000007
#define MAX_CHAR 256

using namespace std;
typedef vector<long long> vl;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector< pair<long long, long long> > vp;
typedef vector<tuple<long long , long long , long long> > vtup;
typedef deque <long long> dq;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;


// standard functions
ll gcd(ll x, ll y) {
    if (x < y) return gcd(y, x);
    if (y == 0) return x;
    return gcd(y, x % y);
} 
 


ll modexp(ll x, ll ex, ll modp) {
    ll ans = 1ll;
    while (ex > 0) {
        if (ex & 1ll) ans = (ans * x)%modp;
        ex >>= 1ll;
        x = (x * x)%modp;
    }
    return ans;
} 
 
ll nCrModp(ll n, ll r, ll p) 
{ 
    ll C[r+1]; 
    memset(C, 0, sizeof(C)); 
  
    C[0] = 1; 
    for (ll i = 1; i <= n; i++) 
    { 
        for (ll j = min(i, r); j > 0; j--) 
            C[j] = (C[j] + C[j-1])%p; 
    } 
    return C[r]; 
}
 
bool isPrime(ll n) 
{ 
    if (n <= 1)  return false; 
    if (n <= 3)  return true;  
    if (n%2 == 0 || n%3 == 0) return false; 
  
    for (ll i=5; i*i<=n; i=i+6) 
        if (n%i == 0 || n%(i+2) == 0) 
           return false; 
  
    return true; 
} 
 
vl countFreq(ll arr[], ll n) 
{ 
    unordered_map<ll, ll> mp; 
    vector <ll> v;
    
    for (ll i = 0; i < n; i++) 
        mp[arr[i]]++; 
   
    for (auto x : mp) 
        v.pb(x.second);
    
    return v;
}

ll binarySearch(ll arr[], ll l, ll r, ll x) 
{ 
    while (l <= r) 
    { 
        ll m = l + (r - l) / 2; 
        if (arr[m] == x) 
            return m; 
        if (arr[m] < x) 
            l = m + 1; 
        else
            r = m - 1; 
    }
    return -1; 
}

const ll MAXSIEVE=(1e3);
ll spf[MAXSIEVE];
void sieve() 
{ 
    spf[1] = 1; 
    for (ll i=2; i<MAXSIEVE; i++) 
        spf[i] = i; 

    for (ll i=4; i<MAXSIEVE; i+=2) 
        spf[i] = 2; 
  
    for (ll i=3; i*i<MAXSIEVE; i++) 
    { 
        if (spf[i] == i) 
        { 
            for (ll j=i*i; j<MAXSIEVE; j+=i) 
                if (spf[j]==j) 
                    spf[j] = i; 
        } 
    } 
}

// code beigns in main
int main()
{
    
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    ll t=1;
    // cin >> t;
    
    while(t--)
    {
        ll k,n;
        cin >> k >>n;
        
        ll arr[n];
        rep(i,0,n)
            cin >> arr[i];
        
        ll min1=(ll)1e18;
        rep(i,0,n-1)
        {
            ll diff=k-abs(arr[i]-arr[i+1]);
            min1=min(min1,diff);
        }
        min1=min(min1,(arr[n-1]-arr[0]));
        cout << min1 << endl;
        
    }
}


Measured memory_bytes: 1792
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;

namespace AtCoder.C
{
    public class Program
    {
        public static void Main() { var r = GetResult(); Debug.WriteLine(r); Console.Write(r); }

        private static object GetResult()
        {
            var N = ReadLong();

            var f = new long[N + 1];
            for (int x = 1; x <= 100; x++)
            {
                for (int y = 1; y <= 100; y++)
                {
                    for (int z = 1; z <= 100; z++)
                    {
                        var n = x * x + y * y + z * z + x * y + y * z + z * x;
                        
                        if (n <= N)
                        {
                            f[n]++;
                        }
                    }
                }
            }


            var sb = new StringBuilder();
            for (int i = 1; i <= N; i++)
            {
                sb.AppendLine(f[i].ToString());
            }

            File.WriteAllText("x.txt",sb.ToString().Trim());
            return sb.ToString().Trim();
        }

        #region Console.Read

        public static string ReadText() { return Console.ReadLine(); }
        public static List<string> ReadTexts() { return Console.ReadLine().Split(' ').ToList(); }
        public static long ReadLong() { return long.Parse(Console.ReadLine()); }
        public static (long, long) Read2Longs() { var ls = ReadLongs(); return (ls[0], ls[1]); }
        public static (long, long, long) Read3Longs() { var ls = ReadLongs(); return (ls[0], ls[1], ls[2]); }
        public static (long, long, long, long) Read4Longs() { var ls = ReadLongs(); return (ls[0], ls[1], ls[2], ls[3]); }
        public static (long, long, long, long, long) Read5Longs() { var ls = ReadLongs(); return (ls[0], ls[1], ls[2], ls[3], ls[4]); }
        public static List<long> ReadLongs() { return Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToList(); }

        #endregion
    }
}


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

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

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

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

int n;
void dfs(string s, char c){
    if(s.size() == n){
        cout << s << "\n";
    }else{
        for (char cc = 'a'; cc <= c; ++cc) {
            if(cc == c){
                dfs(s+cc, c+1);
            }else{
                dfs(s+cc, c);
            }
        }
    }
}


int main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

    cin >> n;

    dfs("", 'a');

    return 0;
}


Measured memory_bytes: 1536
#include <bits/stdc++.h>
using namespace std;
int main()
{
  int n,x;cin>>n>>x;
  while(n!=0|x!=0){
  int ans=0;
  for(int i=1;i<=n;i++){
    for(int j=i+1;j<=n;j++){
      for(int k=j+1;k<=n;k++){
        if(i+j+k==x){
          ans++;
        }
      }
    }
  }
  cout<<ans<<endl;
  cin>>n>>x;
  }
}


Measured memory_bytes: 3112
#include <set>
#include <map>
#include <queue>
#include <cmath>
#include <vector>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;

#define LL long long
#define lson l , m , rt << 1
#define rson m + 1 , r , rt << 1 | 1

const int maxn = 2e5 + 7;
const int INF = 0x3f3f3f3f;

int dp[maxn];

struct node {
    int w,v;
}a[maxn];

int main() {
    int h,n;
    while(~scanf("%d%d",&h,&n)) {
        for(int i = 1 ; i <= n ; i++) {
            scanf("%d%d",&a[i].w,&a[i].v);
        }
        int H = h + 10010;
        for(int i = 0 ; i <= H ; i++) {
            dp[i] = INF;
        }
        dp[0] = 0;
        for(int i = 1 ; i <= n ; i++) {
            for(int j = a[i].w ; j <= H ; j++) {
                dp[j] = min(dp[j],dp[j-a[i].w]+a[i].v);
            }
        }
        int ans = INF;
        for(int i = h ; i <= H ; i++) {
//            cout << "i = " << i << " -> " << dp[i] << endl;
            ans = min(ans,dp[i]);
        }
        printf("%d\n",ans);
    }
    return 0;
}


Measured memory_bytes: 384
import copy
h, w = map(int, input().split())
S = []
for i in range(h):
  S.append(input())
#print(S)
single = [-1] * w
A = []
for i in range(h):
  A.append(copy.copy(single))
#print(A)

counter = 0
memory = "."
for i in range(w):
  if memory == "." and S[0][i] == "#":
    counter += 1
  A[0][i] = counter
  memory = S[0][i]

counter = 0
memory = "."
for i in range(h):
  if memory == "." and S[i][0] == "#":
    counter += 1
  A[i][0] = counter
#  print(i, A, counter, memory, S[i][0])
  memory = S[i][0]

for i in range(1, h):
  for j in range(1, w):
    #A[i][j]
    tate_counter = A[i-1][j]
    if S[i-1][j] == "." and S[i][j] == "#":
      tate_counter += 1
    yoko_counter = A[i][j-1]
    if S[i][j-1] == "." and S[i][j] =="#":
      yoko_counter += 1
    A[i][j] = min(tate_counter, yoko_counter)
  
print(A[-1][-1])

Measured memory_bytes: 42736
import java.util.Scanner;

class Main{
    public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	int[]height=new int[10];
	for(int i=0;i<10;i++){
	    height[i]=sc.nextInt();
	}
	int max=0;

	int[]top={-1,-1,-1};

	for(int i=0;i<3;i++){
	    for(int j=0;j<10;j++){
		if(j!=top[0]&&j!=top[1]&&j!=top[2]){
		    if(max<height[j]){
			top[i]=j;
			max=height[j];
		    }
		}
	    }
	max=0;	   
	}
	for(int i=0;i<3;i++) {
	    System.out.println(height[top[i]]);
	}
    }
}

Measured memory_bytes: 12000
#include<bits/stdc++.h>
using namespace std;
#define fr first
#define sc second
typedef long long ll;
typedef double ld;
typedef pair<int,int> p2;
typedef pair<p2,int> p3;
typedef vector<ll> vi;
const ll INF32 = 5 + 2e9;
const ll INF64 = 5+ 1e18;
const ll Mod = 7 + 1e9;
const int MAX = 5+ 1e5;

int N,M;
int dp[MAX][2];
vi G[MAX];

int Try(int u,int pre,bool c)
{
    int &r = dp[u][c];
    if( r!=-1 )
        return r;
    r = 1;
    for(int v : G[u])
        if( v != pre )
        r = ((ll) r *( Try(v,u,0) + ( c ? 0 : Try(v,u,1) ))%Mod )%Mod;
    return r;
}

int main()
{
    cin >> N;
    for(int i=1; i<N; i++)
    {
        int u,v;
        cin >> u >> v;
        G[u].push_back(v);
        G[v].push_back(u);
    }
    memset(dp,-1,sizeof(dp));
    cout << (Try(1,1,0) + Try(1,1,1))%Mod << endl;
    return 0;
}


Measured memory_bytes: 13440
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <iomanip>

using namespace std;

int A[30][2100000];

int NUM = 1 << 20;

void update(int i, int k, int val) {

	A[i][k + NUM] = val;

	int x = k + NUM;

	int p = x / 2;
	while (p > 0) {
	A[i][p] = A[i][p * 2] + A[i][p * 2 + 1];
	p /= 2;
    }
}

int rmq(int i, int p, int a, int b, int l, int r) {

	int ret = 0;
	if (r < a || b < l) { return 0; }

	if (a <= l && r <= b) { ret+=A[i][p]; }
	else {
		ret += rmq(i, p * 2, a, b, l, (r + l) / 2);
		ret += rmq(i, p * 2 + 1, a, b, (r + l) / 2 + 1, r);
	}

	return ret;
}

int N;
string S;
int Q;

int query[100005];
int q[100005];
int iq[100005],lq[100005],rq[100005];
char cq[100005];

int main(void) {

	cin >> N >> S >> Q;

	for (int i = 1; i <= N; i++) {
		update(S[i-1] - 'a', i, 1);
	}
	

	for (int u = 1; u<= Q; u++) {
		cin >> q[u];
		if (q[u] == 1) { cin >> iq[u] >> cq[u]; }
		else { cin >> lq[u] >> rq[u]; }
	}

	for (int u = 1; u <= Q; u++) {
		if (q[u] == 1) {
			char pre = S[iq[u]-1];
			update(pre - 'a', iq[u], 0);
			S[iq[u]-1] = cq[u];
			update(cq[u] - 'a', iq[u], 1);
		}
		else if (q[u] == 2) {
			int ans = 0;
			for (int k = 0; k < 26; k++) {
				if (rmq(k, 1,lq[u], rq[u],0, NUM-1) > 0) { ans++; }
			}
			cout << ans << endl;
		}
	}

	return 0;
}

Measured memory_bytes: 197892
#include<stdio.h>
#include<iostream>
using namespace std;

int N,A,B;
string S;
int main(){
    cin >> N >> A >> B >> S;
    int l = S.length();
    for(int i=0; i<l;i++) {
        int cnt = A + B;
        if( cnt ) {
            if(S[i] == 'a') {
                A--;
                cout << "Yes" << endl;
            } else if( S[i] == 'b' && B ){
                cout << "Yes" << endl;
                B--;
           } else cout << "No" << endl;
        } else cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 896
#include <algorithm>
#include <array>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#define REP(X, Y, Z) for (ll(X) = (Y); (X) < (Z); (X)++)
#define REV(X, Y, Z) for (ll(X) = (Y); (X) > (Z); (X)--)

using namespace std;
using ll = long long;
using dll = deque<ll>;
using pll = pair<ll, ll>;
using qll = queue<ll>;
using usll = unordered_set<ll>;
using umll = unordered_map<ll, ll>;
using sll = stack<int>;
using vll = vector<ll>;
using vvll = vector<vll>;

constexpr ll kMax = 1e12 + 1;
constexpr ll kMod = 1e9 + 7;

ll gcd(ll a, ll b) {
  if (a < b) {
    return gcd(b, a);
  }
  ll c = a % b;
  while (c != 0) {
    a = b;
    b = c;
    c = a % b;
  }
  return b;
}

ll lcm(ll a, ll b) {
  return a / gcd(a, b) * b;
}

void init() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
}

int main() {
  init();

  ll N;
  cin >> N;
  vll A(101, 0), B(101, 0);
  REP(i, 1, N + 1) {
    cin >> B[i];
  }

  REV(k, N, 0) {
    bool flag = false;
    REV(i, k, 0) {
      if (B[i] == i) {
        REP(j, i + 1, k + 1) {
          B[j - 1] = B[j];
        }
        A[k] = i;
        flag = true;
        break;
      }
    }
    if (!flag) {
      cout << "-1" << endl;
      return 0;
    }
  }
  REP(i, 1, N + 1) {
    cout << A[i] << endl;
  }

  return 0;
}


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

using namespace std;

const int N = 5010;
const int M = 1e9 + 7;

map <string,int> mp;
string ans[200010];

int main()
{
    int n;
    scanf("%d",&n);
    int mx = -1;
    for (int i = 0; i < n; i++){
        string st;
        cin>>st;
        mp[st] ++;
        if (mp[st] > mx) {
            mx = mp[st];
        }
    }
    int m = 0;
    for (map <string , int> :: iterator it = mp.begin();it != mp.end();it ++){
        if (it->second == mx){
            ans[m++] = it->first;
        }
    }
    sort(ans,ans + m);
    for (int i = 0; i < m; i++){
        cout<<ans[i]<<endl;
    }
    return 0;
}


Measured memory_bytes: 27520
#include <bits/stdc++.h>
#define rep(i, x, y) for (int i = x; i <= y; i++)
using namespace std;

typedef long long ll;
ll n, a, b;

int main() {
    cin >> n >> a >> b;
    printf("%lld\n", (n / (a + b)) * a + min(a, n % (a + b)));
    return 0;
}


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

#define reps(i,s,n) for(int (i) = (s); (i) < (n); (i)++)
#define rep(i,n) reps(i,0,n)
using namespace std;
using ll = long long;
using vi = vector<int>;

int main(){
    int n,x;
    cin >> n >> x;
    ll ans = 0;
    vi v(n,0);
    rep(i,n) cin >> v[i];

    if(v[0] > x){
        ans = v[0]-x;
        v[0] = x;
    }

    rep(i,n-1){
        if(v[i] + v[i+1] > x){
            ans += (v[i]+v[i+1]-x); 
            v[i+1] -= (v[i]+v[i+1]-x);
        }
    }
    cout << ans << endl;
    return 0;
}


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

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

  for (int i = 0; i <= 25; i++)
    for (int j = 0; j <= 7; j++)
      if (4 * i + 7 * j == N) {
        cout << "Yes" << endl;
        return 0;
      }

  cout << "No" << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int lld;
typedef pair<int,int> pi;
typedef pair<lld,lld> pl;
typedef long double ld;
typedef vector<int> vt;
typedef vector<vt> vtt;
#define x first
#define y second
#define all(v) v.begin(), v.end()
#define sz(x) (int)x.size()
#define mk(a,b) make_pair(a,b)
bool isrange(int y,int x,int n,int m){
	 if(0<=y&&y<n&&0<=x&&x<m) return true;
	 return false;
}
int dy[4] = {1,0,-1,0},dx[4]={0,1,0,-1},ddy[8] = {1,0,-1,0,1,1,-1,-1},ddx[8] = {0,1,0,-1,1,-1,1,-1};
const lld mod = 1e9 +  7;
lld dp[1000100],vv[1000100];
lld calc(lld now,lld num){
	if(num==0) return 1;
	if(num==1) return now;
	lld now2 = calc(now,num/2);
	if(num%2==0) return (now2*now2)%mod;
	return (now*((now2*now2)%mod))%mod;
}
lld ncr(lld n,lld r){
	lld f1 = dp[n];
	lld f2 = (dp[r]*dp[n-r])%mod;
	return (f1*calc(f2,mod-2))%mod;
}
int main(void){
	lld n;
	scanf("%lld",&n);
	if(n==1) printf("0");
	else{
		lld vv = 1,vv1 = 1,vv3 = 1;
		vv3 %= mod;
		for(int e=0;e<n;e++) vv = (vv*10)%mod;
		for(int e=0;e<n;e++) vv1 = (vv1*8)%mod;
		for(int e=0;e<n;e++) vv3 = (vv3*9)%mod;
		vv = (vv-vv3+mod)%mod;
		vv = (vv-vv3+mod)%mod;
		vv = (vv+vv1)%mod;
		printf("%lld",vv);
	}
	return 0;
}


Measured memory_bytes: 3824
#![allow(unused_imports)]
#![allow(dead_code)]
use std::io::prelude::*;
use std::cmp::{max, min};
use std::collections::BinaryHeap;

const MOD: i64 = 1e9 as i64 + 7; 

fn main(){
    let n: usize = read();
    let a: Vec<usize> = (0..n).map(|_| read()).collect();
    let mut ans: usize = 0;
    for _ in 0..n{
        let b: usize = read();
        ans += b;
    }
    let c: Vec<usize> = (0..n-1).map(|_| read()).collect();
    for i in 1..n{
        if a[i - 1] + 1 == a[i]{
            ans += c[a[i - 1] - 1];
        } 
    }
    println!("{}", ans);
}

fn read<T>() -> T
where
    T: std::str::FromStr,
{
    let stdin = std::io::stdin();
    let token: String = stdin
        .lock()
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}


Measured memory_bytes: 4352
#include<iostream>
#include<vector>

using namespace std;

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

  int a, b;
  cin >> a >> b;

  vector<int> towers(999);
  towers[0] = 1;
  for (int i = 2; i <= 999; ++i) {
     towers[i-1] = towers[i-2] + i;
  }

  cout << (towers[b - a - 1] - b) << endl;

  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string S;
    cin >> S;
    map<string,int> mp;
    mp["RRR"] = 3;
    mp["RRS"] = 2;
    mp["RSR"] = 1;
    mp["SRR"] = 2;
    mp["SSR"] = 1;
    mp["RSS"] = 1;
    mp["SRS"] = 1;
    mp["SSS"] = 0;

    cout << mp[S] << "\n";
}

Measured memory_bytes: 3648
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
#include <map>
#include <queue>
#include <cassert>
#include <bitset>
#include <cstdint>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int iINF = 1001001001;
const long long llINF = 1LL << 60;
ll repPow(ll x, ll n, ll m)
{
	// x^n % mを高速に求めるアルゴリズム
	if (n == 0) return 1;
	if (n % 2 == 0) return repPow(x * x % m, n / 2, m);
	else return x * repPow(x, n - 1, m) % m;
}
int getDigit(int i)
{
	int dig = 0;
	while (i != 0) {
		i /= 2;
		dig++;
	}
	return dig;
}
int pcnt(int x)
{
	int d = getDigit(x);
	int cnt = 0;
	rep(i, d) {
		if (x >> i & 1) cnt++;
	}
	return cnt;
}
int f(int x)
{
	if (x == 0) return 0;
	return f(x % pcnt(x)) + 1;
}
int main()
{
	ll n; string s;
	cin >> n >> s;
	vector<int> x(n);
	rep(i, n) x[i] = s[i] - '0';
	int pc = 0;
	rep(i, n) pc += x[i];
	vector<int> ans(n);
	rep(b, 2) {
		// b == 0 : 0 → 1に変更
		// b == 1 : 1 → 0に変更
		int npc = pc;
		if (b == 0) npc++; else npc--;
		if (npc <= 0) continue;	// npc == 0の時は必ずans == 0. また, 0徐算が起こるためcontinueする.
		// 変更前の値(mod npc)を求めておく
		int r0 = 0;
		rep(i, n) {
			r0 = (r0 * 2) % npc;
			r0 += x[i];
		}
		// r0に変更分を足し引きする
		// kを計算しやすくするために下の桁から計算していく
		int k = 1;
		for (int i = n - 1; i >= 0; --i) {
			if (x[i] == b) {
				int r = r0;
				if (b == 0) r = (r + k) % npc;
				else r = (r - k + npc) % npc; // ()内が負にならないようにnpcを足す
				ans[i] = f(r) + 1;
			}
			k = (k * 2) % npc;
		}
	}
	rep(i, n) cout << ans[i] << endl;
	return 0;
}

Measured memory_bytes: 5256
import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instr = lambda: sys.stdin.readline()
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

n, a, b = inintm()

if n == 2:
    print("Borys")
    exit()

print("Alice") if (abs(a-b)-1) % 2 == 1 else print("Borys")


Measured memory_bytes: 61992
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s, t;
    cin >> s >> t;
    if (s.length() + 1 == t.length())
    {
        s.push_back(t.back());
        if (s == t)
        {
            cout << "Yes";
        }
        else
        {
            cout << "No";
        }
    }
    else
    {
        cout << "No";
    }
    return 0;
}

Measured memory_bytes: 3648
package main

import (
	"fmt"
)

func main() {
	var N, M, X, Y, in int
	fmt.Scan(&N, &M, &X, &Y)
	xarr := make([]int, N)
	yarr := make([]int, M)
	xmax := -100
	ymin := 100
	for i := 0; i < N; i++ {
		fmt.Scan(&in)
		if in > xmax {
			xmax = in
		}
		xarr[i] = in
	}
	for i := 0; i < M; i++ {
		fmt.Scan(&in)
		if in < ymin {
			ymin = in
		}
		yarr[i] = in
	}
	r := "War"
	for i := X + 1; i <= Y; i++ {
		if i > xmax && i <= ymin {
			r = "No War"
			break
		}
	}
	fmt.Println(r)
}

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

#ifdef LOCAL
#define debug(var) cerr << (#var) << " = " << (var) << endl;
#else
#define debug(var)
#endif

void init() {
  ios_base::sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
}

const int N = 1e5+34;

map<int, int> mp;

void solve() {
  int n, m; scanf("%d%d", &n, &m);
  long long ans = 0;
  for (int i = 0; i < n; ++i) {
    int a; scanf("%d", &a);
    ++mp[a];
    ans += a;
  }
  for (int i = 0; i < m; ++i) {
    int value = mp.rbegin()->first;
    --mp[value]; ans -= value;
    ++mp[value/2]; ans += value/2;
    if (mp[value] == 0) mp.erase(value);
  }
  printf("%lld", ans);
}

int main() {
  init();
  int t = 1; //scanf("%d", &t);
  while (t--) {
    solve();
  }
  return 0;
}


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

#define pb push_back
#define sp " "
#define sl "\n"
#define fi first
#define se second
#define mp make_pair
#define sz(a) ((int)a.size())
#define tra(a,b) for (auto a:b) 
#define fo(a,b,c) for (int a=b;a<=c;a++) 
#define ms(a,b) memset(a,b,sizeof(a)) 
#define all(a) a.begin(),a.end()
#define rev(a) reverse(a.begin(),a.end())
#define bit(i,j) (i&(1<<j))

using namespace std;

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

const int N=2e5+5,mod=1000000007;
int A,B,M,a[N],b[N],x[N],y[N],c[N];
int main()
{
	cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
	cin>>A>>B>>M;
	fo(i,0,A-1) cin>>a[i];
	fo(i,0,B-1) cin>>b[i];
	int q,w,res;
	q=a[0]; w=b[0];
	fo(i,1,A-1) { q=min(q,a[i]); }
	fo(i,1,B-1) w=min(w,b[i]);
	res=q+w;
	fo(i,0,M-1) { cin>>x[i]>>y[i]>>c[i]; }
	fo(i,0,M-1) { res=min(res,a[x[i]-1]+b[y[i]-1]-c[i]); }
	cout<<res;
	return 0;
}


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

const double PI = acos(-1.0);

int main() {
	int a, b, h, m;
	scanf("%d%d%d%d", &a, &b, &h, &m);
	double k = (double)m/60-(double)h/12-(double)m/720;
	k *= 2*PI;
	double c = sqrt(a*a+b*b-2*a*b*cos(k));
	printf("%.11f\n", c);
	return 0;
}

Measured memory_bytes: 4264
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <stack>
#include <set>
#include <queue>
#include <iomanip>
#include <math.h>
#include <fstream>

using namespace std;

long long mod = 1000000007;

void dfs(int p, int prev, vector<int> &a, vector<int> &dp, int dpl, vector<vector<int>> &v, vector<int> &res)
{
    int l = -1, r = dpl, mid;
    while (r - l > 1)
    {
        mid = (l + r) / 2;
        if (dp[mid] >= a[p])
        {
            r = mid;
        }
        else
        {
            l = mid;
        }
    }
    int temp = dp[r];
    dp[r] = a[p];
    if (temp == -1)
    {
        dpl++;
    }
    res[p] = dpl;
    for (int i = 0; i < v[p].size(); i++)
    {
        if (v[p][i] == prev)
        {
            continue;
        }
        dfs(v[p][i], p, a, dp, dpl, v, res);
    }
    dp[r] = temp;
}

int main()
{
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(12);
    // ifstream cin("in.txt");
    // ofstream cout("out.txt");
    
    
    // int t;
    // cin >> t;
    // for (int qwe = 0; qwe < t; qwe++)
    // {
    //     cout << "Case #" << qwe + 1 << ": ";
    // }


    int a, b, c, k;
    cin >> a >> b >> c >> k;
    int rez = 0;
    rez += min(a, k);
    k -= min(a + b, k);
    rez -= min(c, k);
    cout << rez << '\n';


    return 0;
}


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

int main(){
    int N,A; //int型変数N,Aを宣言
    cin >> N >> A;
    if (N % 500 > A) cout << "No" << endl;//変数Nを500で割った余りが変数Aより小さいとき"No"
    else cout << "Yes" << endl;
}

Measured memory_bytes: 256