akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, begin, end) for(ll i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(ll i=(begin)-1;i>=(end);i--)
#define IREP(i, n) IFOR(i,n,0)
#define SORT(a) sort(a.begin(), a.end())
#define ISORT(a) sort(a.begin(), a.end(),greater<ll>())
#define REVERSE(a) reverse(a.begin(), a.end())
#define debug(x) cout << #x << "=" << x << endl;
#define vdebug(v) cout << #v << "=(" << v[0]; FOR(i_debug, 1, v.size()){ cout << "," << v[i_debug]; } cout << ")" << endl;
#define mdebug(m) cout << #m << "=" << endl; REP(i_debug, m.size()){ REP(j_debug, m[i_debug].size()){ cout << m[i_debug][j_debug] << ","; } cout << endl;}
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
#define Max(a, b) a = max(a, b)
#define Min(a, b) a = min(a, b)

#define ll long long
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define INF 1000000000000000000

using vec = vector<ll>;
using mat = vector<vec>;
using Pii = pair<ll, ll>;
using PiP = pair<ll, Pii>;
using PPi = pair<Pii, ll>;
using bvec = vector<bool>;
using Pvec = vector<Pii>;


template<typename T> void readv(vector<T> &a) {
    REP(i, a.size()) cin >> a[i];
}
void readv_m1(vector<int> &a) {
    REP(i, a.size()) {
        cin >> a[i];
        a[i]--;
    }
}

ll mod = 1000000007;

int main()
{
    ll N;
    cin >> N;
    ll ans = 0;
    REP(i, 6) {
        // debug(i);
        if (i % 2 == 0) continue;
        if (N < pow(10, i - 1)) break;
        if (N < pow(10, i) - 1) {
            ans += N - pow(10, i - 1) + 1;
            break;
        } else {
            ans += pow(10, i) - pow(10, i - 1);
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i, a, b) for(ll i = (a); i < (b); ++i)
#define FORR(i, a, b) for(ll i = (a); i > (b); --i)
#define REP(i, n) for(ll i = 0; i < (n); ++i)
#define REPR(i, n) for(ll i = n; i >= 0; i--)
#define FOREACH(x, a) for(auto &(x) : (a))
#define dump(x) cout << #x << " = " << (x) << endl;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
using namespace std;
using ll = long long;
using P = pair<ll, ll>;

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  if(N % 10 == 0) {
    cout << 10 << endl;
  } else {
    int tmp = N;
    int ans = 0;
    while(tmp > 0) {
      ans += tmp % 10;
      tmp /= 10;
    }
    cout << ans << endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<queue>
#include <string>
#include <sstream>
#include <queue>
#include <complex>
#include <map>
#include <algorithm>
#include <cmath>
#include <limits>
#include <iomanip>
#include <set> 
using namespace std;

#define ll int64_t
const long MOD = 1e9 + 7;






int main()
{


  long n,k;
  cin >> n >>k;



  long knum = n/k;

  long k_mul = n/k;

  long k_half_mul=0;
  if (k>1)k_half_mul = n/(k/2) - k_mul;

  cerr<<k_mul << ":" << k_half_mul;



  long ans=0;
  if (k%2==0){
    if (n>1)ans = pow(k_half_mul,(long)3) + pow(k_mul,(long)3);
    if (n==1)ans = pow(k_half_mul,(long)3);
  }else if (k!=1){
    ans = pow(k_mul,(long)3);
  }else{
    ans = pow(n,(long)3);
  }


  cout << ans;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<cctype>
#include<utility>
#include<string>
#include<cmath>
#include<cstring>
#include<queue>
#include<map>
#include<set>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)

using namespace std;

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


template<typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }
template<typename T, typename... Ts>
auto make_v(size_t a, Ts... ts) {
	return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}
template<typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T& t, const V& v) { t = v; }
template<typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T& t, const V& v) {
	for (auto& e : t) fill_v(e, v);
}


#define ARRAY_MAX 100005
const int INF = 1e9;
const ll MOD = 1e9 + 7;

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




/******************************************************************************************/

int main(){

	int n;
	cin >> n;
	vector<int> a(n), b(n), c(n - 1);
	for (int i = 0; i < n; i++)
	{
		cin >> a[i];
		a[i]--;
	}
	for (int i = 0; i < n; i++)
	{
		cin >> b[i];
	}

	for (int i = 0; i < n-1; i++)
	{
		cin >> c[i];
	}

	int ans = 0;
	//cout << "a" << endl;

	for (int i = 0; i < n; i++)
	{
		ans += b[a[i]];
		//cout << "ans = " << ans << endl;
		if (i < n - 1) {
			//cout << "i= " << i << endl;
			if (a[i] + 1 == a[i + 1]) {
				//cout << "c[i] = " << c[i] << endl;
				ans += c[a[i]];
			}
		}
		//cout << "ans = " << ans << endl;
	}
	
	cout << ans << endl;

	return 0;
}


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

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

    #define FAST_IO() ios::sync_with_stdio(0); cin.tie(0)
    
     
    const int MOD = 1e9 + 7;
    const int MAXV = 1e5;
     
    int main() {
        FAST_IO();
        int N, K; cin >> N >> K;
        vector<int> A(N);
        rep(i, N) {
            cin >> A[i];
        }
        cout << (N - 1 + K - 2) / (K - 1) << endl;
        return 0;
    }


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
using ul = unsigned long;
using ull = unsigned long long;
#define vec vector
#define rep(_i,_n) for(ull _i = 0; _i < _n; _i++)
#define rep2(_i,_s,_n) for(ull _i = _s; _i < _n; _i++)
#define elif else if
#define push(_a) push_back(_a)
#define fullSort(_a) sort(_a.begin(), _a.end())
#define inputVecI(_name, _n) vec<int> _name(_n);rep(_i, _n)cin >> _name[_i];
#define inputVecUL(_name, _n) vec<ul> _name(_n);rep(_i, _n)cin >> _name[_i];
#define inputVecULL(_name, _n) vec<ull> _name(_n);rep(_i, _n)cin >> _name[_i];
#define inputVecS(_name, _n) vec<string> _name(_n);rep(_i, _n)cin >> _name[_i];
#define printVec(_vec) cout << "{";rep(i, _vec.size()-1)cout << _vec[i] << ",";cout << _vec[_vec.size()-1];cout << "}\n";
#define append(_x) push_back(_x)
#define mapLoop(_i, _name) for(auto i = _name.begin(); i != _name.end(); i++)
 
 
int main(){
   int N,M;
   cin >> N >> M;
   int L=0;
   int R=N+1;
   rep(i, M){
      int l,r;
      cin >> l >> r;
      L=max(L,l);
      R=min(R,r);
   }
   cout << max((R-L)+1,0)<< endl;
   
   return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(var, begin, end) for (int var = (begin); var < (end); var++)
#define RFOR(var, begin, end) for (int var = (begin) - 1; var >= (end); var--)
#define REP(var, length) FOR(var, 0, length)
#define RREP(var, length) RFOR(var, length, 0)
#define SORT(vector) sort(vector.begin(), vector.end())

const ll MOD = 1e9 + 7;

string max_s(string a, string b) {
  if (a.size() > b.size()) {
    return a;
  } else {
    return b;
  }
}

void solve(istream& cin, ostream& cout) {
  string s, t;
  cin >> s >> t;

  vector<vector<int>> dp(s.size() + 1, vector<int>(t.size() + 1, 0));

  REP(i, s.size()) {
    REP(j, t.size()) {
      if (s[i] == t[j]) {
        dp[i + 1][j + 1] = dp[i][j] + 1;
      } else {
        dp[i + 1][j + 1] = max(dp[i + 1][j], dp[i][j + 1]);
      }
    }
  }
  int l = dp[s.size()][t.size()];
  int i = s.size();
  int j = t.size();
  string ans(l, 'a');

  while (i) {
    if (dp[i][j] == dp[i - 1][j]) {
      i--;
    } else if (dp[i][j] == dp[i][j - 1]) {
      j--;
    } else {
      ans[l - 1] = s[i - 1];
      l--;
      i--;
      j--;
    }
  }

  cout << ans << endl;
}

#ifndef TEST
int main() {
  solve(cin, cout);
}
#endif


Measured memory_bytes: 35584
from math  import gcd
import sys
sys.setrecursionlimit(10**5)

K = int(input())
ans = 0
a = 1
while a <= K:
  b = 1
  while b <= K:
    c = 1
    while c <= K:
      ans += gcd(a, gcd(b, c))
      c += 1
    b += 1
  a += 1
print(ans)


Measured memory_bytes: 66376
def find_index(l, x):
    return l.index(x) if x in l else -1

def water(sum, H):
    if len(H)==0:
        return sum
    elif len(H)==1:
        sum += H[0]
        return sum
    minimum = min(H)
    sum += minimum
    for i in range(len(H)):
        H[i] -= minimum
    index = find_index(H, 0)
    H1 = H[:index]
    sum = water(sum,H1)
    H2 = H[index+1:]
    sum = water(sum,H2)
    return sum


    water(sum, array)

def main():
    n = int(input())
    H = list(map(int, input().split()))
    sum = 0
    sum += water(sum, H)
    print(sum)


if __name__ == '__main__':
    main()


Measured memory_bytes: 39024
#include <iostream>      // cout, endl, cin
#include <string>        // string, to_string, stoi
#include <vector>        // vector
#include <algorithm>     // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility>       // pair, make_pair
#include <tuple>         // tuple, make_tuple
#include <cstdint>       // int64_t, int*_t
#include <cstdio>        // printf
#include <map>           // map
#include <queue>         // queue, priority_queue
#include <set>           // set
#include <stack>         // stack
#include <deque>         // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset>        // bitset
#include <cctype>        // isupper, islower, isdigit, toupper, tolower
#include <cmath>

using namespace std;
typedef long long ll;

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

int main()
{
        string N;
        cin >> N;
        vector<int> vec(26, 0);
        rep(i, N.size()) vec[N[i] - 'a']++;
        rep(i, 26)
        {
                if (vec[i])
                        continue;
                else
                {
                        cout << char(i + 'a') << endl;
                        return 0;
                }
        }
        cout << "None" << endl;

        return 0;
}


Measured memory_bytes: 512
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<map>
#include<stack>
#include<cmath>
#include<iomanip>
#include<set>
#include<numeric>
#include<sstream>
#include<random>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rrep(i, st, n) for (int i = st; i < n; ++i)
using pii = pair<int, int>;
const int inf = 1e9 + 7;
int dy[] = {0, 0, -1, 1, -1, 1, -1, 1};
int dx[] = {1, -1, 0, 0, -1, 1, 1, -1};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a[5]; rep(i, 5) cin >> a[i];
    int k; cin >> k;
    sort(a, a + 5);
    int flg = 0;
    rep(i, 5) {
        rrep(j, i + 1, 5) {
            if (abs(a[i] - a[j]) > k) flg = 1;
        }
    }
    
    if (flg == 0) cout << "Yay!" << endl;
    else cout << ":(" << endl;
    
    
}


Measured memory_bytes: 256
#include <stdio.h>
int main(void)
{
  int k;
  scanf("%d", &k);

  if (k % 2 == 0)
  {
    printf("%d\n", (k / 2) * (k / 2));
  }
  else
  {
    printf("%d\n", ((k / 2) + 1) * (k / 2));
  }

  return 0;
}

Measured memory_bytes: 128
n = int(input())
A = list(map(int,input().split()))
q = int(input())
m = list(map(int,input().split()))


#組み合わせ列挙版



def solve(i, m):
  if m == 0:
    return True
  if i >= n or m < 0:
    return False

  if (i+1,m) in d.keys():
    s1 =  d.get((i+1,m))
  else:
    s1 = solve(i+1, m)
    d[(i+1,m)] = s1
  
  if (i+1, m - A[i]) in d.keys():
    s2 = d.get((i+1, m - A[i]))
  else:
    s2 = solve(i+1, m - A[i])
    d[(i+1,m - A[i])] = s2

  return s1 | s2

d = dict()
for num in m:
  ret = solve(0,num)
  d = dict()
  if ret:
    print("yes")
  else:
    print("no")



Measured memory_bytes: 6672
#include <iostream>
#include <vector>
#include <string>
using namespace std;

int ans;

vector<int> split(string s){
 	int n=0;
	vector<int> vc;
 	s += " ";
	for(int i=0 ; i < s.size() ; i++ ){
		if( s[i] == ' ' ){
			vc.push_back( n );
 			n = 0;
		}else if( s[i] >= '0' && s[i] <= '9' ){
			n = n*10 + (s[i] - '0');
		}
	}
	return vc;
}

void solve(const vector<int>& a,int i,int p){
	if( p > 21 ){
		return;
	}
 	if( i == a.size() ){
		ans = max( ans , p );
		return;
	}

 	if( a[i] == 1 ){
		solve( a , i+1 , p+1  );
		solve( a , i+1 , p+11 );
 	}else if( a[i] >= 10 ){
		solve( a , i+1 , p+10 );
	}else{
		solve( a , i+1 , p+a[i] );
	}
} 

int main(){
	string s;
	while( getline(cin,s) , s != "0" ){
		vector<int> a = split(s);
		ans = 0;
		solve( a , 0 , 0 );
		cout << ans << endl;
	}
}

Measured memory_bytes: 0
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <math.h>
 
#define P 1000000007
 
int comp(const void *a, const void *b){return *(int*)a-*(int*)b;}
 
int main(void){
	int n, i;
	int d[100000];
	scanf("%d", &n);
	for(i=0; i<n; i++){
		scanf("%d", d+i);
	}
	qsort(d, n, sizeof(int), comp);
	printf("%d\n", d[n/2]-d[n/2-1]);
}

Measured memory_bytes: 892
//#pragma GCC target("avx2")
//#pragma GCC optimize("O3")

//# include <x86intrin.h>
# include <bits/stdc++.h>

//# include <ext/pb_ds/assoc_container.hpp>
//# include <ext/pb_ds/tree_policy.hpp>

//using namespace __gnu_pbds;
using namespace std;
 
//template<typename T> using ordered_set = tree <T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define _USE_MATH_DEFINES_
#define ll long long
#define ld long double
#define Accepted 0
#define pb push_back
#define mp make_pair
#define sz(x) (int)(x.size())
#define every(x) x.begin(),x.end()
#define F first
#define S second
#define lb lower_bound
#define ub upper_bound
#define For(i,x,y)  for (ll i = x; i <= y; i ++) 
#define FOr(i,x,y)  for (ll i = x; i >= y; i --)
#define SpeedForce ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
// ROAD to...                                                                                                                                                                                                                Red

inline void Input_Output () {
	//freopen(".in", "r", stdin);
   //freopen(".out", "w", stdout);
}

const double eps = 0.000001;
const ld pi = acos(-1);
const int maxn = 1e7 + 9;
const int mod = 1e9 + 7;
const ll MOD = 1e18 + 9;
const ll INF = 1e18 + 123;
const int inf = 2e9 + 11;
const int mxn = 1e6 + 9;
const int N = 6e5 + 123;                                          
const int M = 22;
const int pri = 997;
const int Magic = 2101;

const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
 
int n, m, k;
int cnt[N];
string s;
int a[N];
vector < int > g[N];
int u[N];
int ans, res;
int cur;
//	mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
//	shuffle(permutation.begin(), permutation.end(), rng);



int main () {
	SpeedForce;

	set < ll > all;
	ll n, k;
	cin >> n >> k;
	n %= k;
	while(1) {
		if(all.count(n)) break;
		all.insert(n);
		n = abs(n-k);
	}
	cout << *all.begin();

	return Accepted;
}

// B...a

Measured memory_bytes: 18688
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
int main() {
	int n;
	cin >> n;
	long long a = 0;
	for (int i = 1; i <= n; i++) {
		if ((i % 3 != 0) && (i % 5 != 0)) {
			a += i;
		}
	}
	cout << a;
}


Measured memory_bytes: 3636
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
 
int max1(int a, int b) {
	if (a > b)
		return a;
	else
		return b;
}
 
int main()
{
	int N = 0;
	int *A,*B,*C;
	int SUM = 0;
	int sumA = 0, sumB = 0, sumC = 0;
	char ref = 0;
	int N_limit = pow(10, 5);
 
	if (scanf("%d", &N) <= 0) {
		exit(1);
	}
	if ( N <= 0 || N_limit < N)
		exit(1);
 
	A = (int *)malloc(N * sizeof(int));
	B = (int *)malloc(N * sizeof(int));
	C = (int *)malloc(N * sizeof(int));
 
 
 
	for (int i = 0; i < N; i++)
	{
 
		if (scanf("%d%d%d", &A[i], &B[i], &C[i]) < 3) {
			exit(1);
		}
		if (A[i] <= 0 || pow(10, 4) < A[i])
			exit(1);
		else if (B[i] <= 0 || pow(10, 4) < B[i])
			exit(1);
		else if (C[i] <= 0 || pow(10, 4) < C[i])
			exit(1);
	}
 
	int ref_A = 0, ref_B = 0, ref_C = 0;
 
 
	for (int i = 0; i < N; i++)
	{
		if (i - 1 < 0)
		{
			sumA = A[i];
			sumB = B[i];
			sumC = C[i];
			ref_A = sumA;
			ref_B = sumB;
			ref_C = sumC;
			continue;
		}
		sumA = A[i] + max1(ref_B, ref_C);
		sumB = B[i]+ max1(ref_C, ref_A);
		sumC = C[i] + max1(ref_A, ref_B);
 
		ref_A = sumA;
		ref_B = sumB;
		ref_C = sumC;
 
	}
 
	if (sumA >= sumB)
	{
		if (sumA >= sumC)
		{
			SUM = sumA;
		}
		else
		{
			SUM = sumC;
		}
	}
	else if (sumB >= sumA)
	{
		if (sumB >= sumC)
		{
			SUM = sumB;
		}
		else
		{
			SUM = sumC;
		}
 
	}
	else if (sumC >= sumB)
	{
		if (sumC >= sumA)
		{
			SUM = sumC;
		}
		else
		{
			SUM = sumA;
		}
	}
 
 
	printf("%d", SUM);
}

Measured memory_bytes: 1280
#include"bits/stdc++.h"
using namespace std;
typedef long long ll;
const ll MOD = (ll)(1e9+7);
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int (i)=0; (i)<(int)(n); (i)++)
#ifdef LOCAL
#define debug(x) cerr << #x << ": " << x << endl
#else
#define debug(x)
#endif
int dx[4]={ 1,0,-1,0 };
int dy[4]={ 0,1,0,-1 };

//RSQ
struct RSQ{
private:
	int N;
	vector<long long> node, lazy;
	vector<bool> lazyFlg;
	const long long DEFAULT = 0LL;
public:
	void init(int n){ //初期化 O(N)
		node.clear();
		lazy.clear();
		lazyFlg.clear();
		N = 1;
		while(N < n) N = (N<<1);
		for(int i=0; i<2*N-1; i++){
			node.push_back(DEFAULT);
			lazy.push_back(0LL);
			lazyFlg.push_back(false);
		}
	}
	void eval(int k, int l, int r){ //遅延評価 O(1)
		if(lazyFlg[k]){ //RUQ：下に更新クエリが溜まっていても加算クエリが溜まっていても上書き
			node[k] = lazy[k];
			if(r-l > 1){
				lazy[(k<<1)+1] = lazy[k] >> 1;
				lazyFlg[(k<<1)+1] = true;
				lazy[(k<<1)+2] = lazy[k] >> 1;
				lazyFlg[(k<<1)+2] = true;
			}
			lazy[k] = 0LL;
			lazyFlg[k] = false;
		}
		else{ //RAQ：下に更新クエリが溜まっていても加算クエリが溜まっていても加算
			node[k] += lazy[k];
			if(r-l > 1){
				lazy[(k<<1)+1] += lazy[k] >> 1;
				lazy[(k<<1)+2] += lazy[k] >> 1;
			}
			lazy[k] = 0LL;
		}
	}
	void update(int a, long long x){ //[a,a+1)の値を変更 O(log N)
		update(a, a+1, x);
	}
	void update(int a, int b, long long x, int k=0, int l=0, int r=-1){ //[a,b)の値を変更 O(log N)
		if(r == -1) r = N;
		eval(k, l, r);
		if(b <= l || r <= a) return; //交差する場合
		if(a <= l && r <= b){ //完全に含む場合
			lazy[k] = x * (r-l);
			lazyFlg[k] = true;
			eval(k, l, r);
		}
		else{
			update(a, b, x, (k<<1)+1, l, (l+r)>>1);
			update(a, b, x, (k<<1)+2, (l+r)>>1, r);
			node[k] = node[(k<<1)+1] + node[(k<<1)+2];
		}
	}
	void add(int a, long long x){ //[a,a+1)の値に加算 O(log N)
		add(a, a+1, x);
	}
	void add(int a, int b, long long x, int k=0, int l=0, int r=-1){ //[a,b)の値に加算 O(log N)
		if(r == -1) r = N;
		eval(k, l, r);
		if(b <= l || r <= a) return; //交差する場合
		if(a <= l && r <= b){ //完全に含む場合
			lazy[k] += x * (r-l);
			eval(k, l, r);
		}
		else{
			add(a, b, x, (k<<1)+1, l, (l+r)>>1);
			add(a, b, x, (k<<1)+2, (l+r)>>1, r);
			node[k] = node[(k<<1)+1] + node[(k<<1)+2];
		}
	}
	long long sum(int a, int b, int k=0, int l=0, int r=-1){ //[a,b)の和 O(log N)
		if(r == -1) r = N;
		if(b <= l || r <= a) return DEFAULT; //交差する場合
		eval(k, l, r);
		if(a <= l && r <= b) return node[k]; //完全に含む場合
		return sum(a, b, (k<<1)+1, l, (l+r)>>1) + sum(a, b, (k<<1)+2, (l+r)>>1, r);
	}
};

int N, Q;
string S;
int t[20000];
int p[20000];
char c[20000];
int l[20000], r[20000];

RSQ rsq[26];
signed main(){
	cin >> N >> S >> Q;
	rep(i, Q){
		cin >> t[i];
		if(t[i] == 1){
			cin >> p[i] >> c[i];
			p[i]--;
		}
		else{
			cin >> l[i] >> r[i];
			l[i]--;
		}
	}

	rep(i, 26) rsq[i].init(N);
	rep(i, N) rsq[S[i]-'a'].update(i, 1);
	rep(i, Q){
		if(t[i] == 1){
			rsq[S[p[i]]-'a'].update(p[i], 0);
			S[p[i]] = c[i];
			rsq[S[p[i]]-'a'].update(p[i], 1);
		}
		else{
			int ans = 0;
			rep(j, 26){
				if(rsq[j].sum(l[i], r[i]) > 0) ans++;
			}
			cout << ans << endl;
		}
	}
}

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

int main(){
  int A, B, C, D;
  cin >>A >>B >>C >>D;
  
  if ((A+B) > (C+D)){
    cout <<"Left" <<endl;
  }
  else if ((A+B) == (C+D)){
    cout <<"Balanced" <<endl;
  }
  
  else{
    cout <<"Right" <<endl;
  }
}


Measured memory_bytes: 256
// g++ -std=c++11 a.cpp
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<random>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
//#define int ll
typedef int Def;
//typedef ll Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
//#define mt make_tuple
//typedef tuple<int,int,int> tp;
//typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
//template<class C>constexpr int size(const C &c){return (int)c.size();}
//template<class T,size_t N> constexpr int size(const T (&xs)[N])noexcept{return (int)N;}
const double PI=acos(-1);
const double EPS=1e-9;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9+10;
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};
int main(){
	int n;
	cin>>n;
	vvi in(n,vi(n));
	rep(i,n)rep(j,n)cin>>in[i][j];
	bool h=true;
	ll out=0;
	vvi b=in;
	rep(i,n)rep(j,i)rep(k,n)if(i!=k&&j!=k){
		if(in[i][j]>in[i][k]+in[k][j])h=false;
		if(in[i][j]==in[i][k]+in[k][j]){
			b[i][j]=0;
		}
	}
	rep(i,n)rep(j,i)out+=b[i][j];
	if(!h)out=-1;
	cout<<out<<endl;
}






Measured memory_bytes: 1024
#include<iostream>

using namespace std;
int h,w,k;
char grid[10][10];
int count(){
	int c = 0;
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			if(grid[i][j]=='#')c++;
		}
	}
	return c;
}

void color(char c,int n){
	if(c=='r'){
		for(int i=0;i<w;i++){
			if(grid[n][i]=='#')grid[n][i] = 'c';
		}
	}
	else{
		for(int i=0;i<h;i++){
			if(grid[i][n]=='#')grid[i][n] = 'c';
		}
	}
}

void reverse(){
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			if(grid[i][j]=='c')grid[i][j] = '#';
		}
	}
}



int main(){
int flag = 0;
cin >> h >> w >> k;
char c;
for(int i=0;i<h;i++){
	scanf("%s%c",grid[i],&c);
}

//subset
int total = h + w;
for(int i=0;i<1<<total;i++){
	for(int j=0;j<total;j++){
		if(i & 1<<j){
			if(j>=h){
				int index = j - h;
				color('c',index);
			}
			else color('r',j);

		}
	}
	int ko = count();
	if(ko == k){
		/*for(int i=0;i<h;i++)printf("%s\n",grid[i]);
			printf("\n");*/
		flag++;
	}
	reverse();
}


printf("%d\n",flag);

	return 0;
}

Measured memory_bytes: 3824
#include <iostream>

using namespace std;

int main() {

	int a = 0;
	int b = 0;

	cin >> a >> b;

	if (a > b) {

		cout << "a > b" << endl;

	}
	else if (a < b) {

		cout << "a < b" << endl;

	}
	else {

		cout << "a == b" << endl;

	}

	return 0;

}

Measured memory_bytes: 3088
//{{{
#include<algorithm>
#include<cmath>
#include<fstream>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<random>
#include<set>
#include<sstream>
#include<sys/time.h>
#include<unordered_map>
#include<unordered_set>
#include<vector>
using ll = long long;
enum : int { M = (int)1e9 + 7 };
enum : ll { MLL = (ll)1e18L + 9 };
using namespace std;
#ifdef LOCAL
#include"rprint2.hpp"
#else
#define FUNC(name) template <ostream& out = cout, class... T> void name(T&&...){ }
FUNC(prints) FUNC(printw) FUNC(printwe) FUNC(printb) FUNC(printbe) FUNC(printd) FUNC(printde) FUNC(printdu);
#endif
template <class S, class T>
istream& operator >> (istream& in, pair<S, T>& p){ return in >> p.first >> p.second; }
template <class T>
istream& operator >> (istream& in, vector<T>& v){ for(auto& e : v){ in >> e; } return in; }
//}}}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, m;
    cin >> n >> m;
    vector<int> ss(n); cin >> ss;
    vector<int> ts(m); cin >> ts;
    vector<vector<ll>> dp(n + 1, vector<ll>(m + 1));
    // dp[0][0] = 1;
    for(int i = 0; i <= n; i++){
        dp[i][0] = 1;
    }
    for(int i = 0; i <= m; i++){
        dp[0][i] = 1;
    }
    for(int i = 0; i < n; i++){
        for(int j = 0; j < m; j++){
            // dp[i + 1][j + 1] = dp[i][j + 1];
            // dp[i + 1][j + 1] = max(dp[i + 1][j], dp[i][j + 1]);
            // dp[i + 1][j + 1] = dp[i + 1][j] + dp[i][j + 1];
            // dp[i + 1][j + 1] = dp[i + 1][j] + dp[i][j + 1] - 1;
            dp[i + 1][j + 1] = dp[i + 1][j] + dp[i][j + 1] - dp[i][j] + M;
            if(ss[i] == ts[j]){
                // dp[i + 1][j + 1] += 1;
                dp[i + 1][j + 1] += dp[i][j];
                // dp[i + 1][j + 1] = dp[i][j] * 2;
            }
            // if(ss[i] == ts[j]){
            //     dp[i + 1][j + 1] = dp[i][j] + 1;
            // }else{
            //     dp[i + 1][j + 1] = dp[i][j + 1];
            // }
            dp[i + 1][j + 1] %= M;
        }
    }
    printde(dp);
    cout << dp[n][m] << '\n';
}


Measured memory_bytes: 31616
#include <stdio.h>
#include <stdlib.h>


int main(){

    int N, M;
    scanf("%d %d",&N, &M);

    int answer = 0;
    if(N>0){
        answer += N*(N-1)/2;
    }
    if(M>0){
        answer += M*(M-1)/2;
    }
    printf("%d",answer);

   return 0;
}

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

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

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

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

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

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

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

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

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

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

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

fn main() {
    input!{
        n: usize,
        s: chars
    }
    let m = s.len();
    let d = 1000000007;
    let mut tab = vec![vec![0; n + 2]; n + 1];
    tab[0][0] = 1;
    for i in 1..n + 1 {
        tab[i][0] = (tab[i - 1][0] + tab[i - 1][1]) % d;
        for j in 1..i + 1 {
            tab[i][j] = (tab[i - 1][j - 1] * 2 + tab[i - 1][j + 1]) % d;
        }
    }
    println!("{}", tab[n][m] * inv_m(pow_m(2, m, d), d) % d);
}

fn pow_m(n: usize, mut p: usize, d: usize) -> usize {
    let mut r = n;
    let mut ret = 1;
    while p > 0 {
        if p % 2 == 0 {
            r = r * r % d;
            p /= 2;
        } else {
            ret = ret * r % d;
            p -= 1;
        }
    }
    ret
}

fn inv_m(n: usize, d: usize) -> usize {
    pow_m(n, d - 2, d)
}


Measured memory_bytes: 231676
#include<iostream>
#include<algorithm>
#include<string>
#include<map>
#include<vector>
#include<set>
#include<iomanip>
#include<cmath>
using namespace std;
typedef long long ll;
typedef long long int llint;
typedef pair<ll, ll> pa;
#define MM 1000000000
#define MOD MM+7
#define MAX 101000
#define MAP 110
#define initial_value -1
#define MAX_T 1001
#define Pair pair<int,int>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
#define INF (1 << 29) //536870912
const long double PI = acos(-1);
const ll DEP = 1e18;
int dx[4] = {-1,0,1,0};
int dy[4] = {0,-1,0,1};
int main(){
    char x,y; cin >> x >> y;
    if(x < y) cout << '<' << endl;
    else if (x > y) cout << '>' << endl;
    else cout << '=' << endl;
}

Measured memory_bytes: 256
import java.util.Scanner

object Main {
  def main(args: Array[String]) {
    if (args.length > 0 && args(0) == "TEST") {
      println(test())
    } else {
      val input = io.Source.stdin.getLines().mkString("\n")
      println(solve(input).trim())
    }
  }

  def solve(input: String): String = {
    val sc: Scanner = new Scanner(input)
    val n = sc.nextInt
    val sum: Int = n.toString.map(_.asDigit).sum
    if (n % sum == 0) "Yes" else "No"
  }

  val tests = List(
    """12""".stripMargin -> """Yes""",
    """57""".stripMargin -> """No""",
    "148" -> "No"
  )

  def test(): String = tests.map { case (i, o) => (i.trim(), o.trim()) }
    .zipWithIndex.map {
    case ((input, outputExpect), i) =>
      val output = solve(input).trim()
      val tnum = i + 1
      s"test$tnum:" + (
        if (output == outputExpect) "Passed"
        else s"Failed\nexpect:\n$outputExpect\noutput:\n$output")
  }
    .mkString("\n")
}

Measured memory_bytes: 25424
#include <bits/stdc++.h>
using namespace std;
#define eni(x) template < class c > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
template < class c > struct rge { c b, e; };
template < class c > rge<c> range(c i, c j) { return rge<c>{i, j}; }
template < class c > auto dud(c* x) -> decltype(cerr << *x, 0);
template < class c > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; return * this; }
eni(==) return * this << range(begin(i), end(i)); }
template < class c, class b > debug & operator <<(pair < b, c > d) {
  return * this << "(" << d.first << ", " << d.second << ")";
}
template < class c > debug & operator <<(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  return * this << "]";
}
#else
template < class c > debug & operator <<(const c&) { return * this; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define pll pair<ll,ll>
#define pii pair<int,int>
#define all(v) v.begin(),v.end()
#define mod 998244353
#define mx 1000050
mt19937 myrand(time(0));

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(),cout.tie();
    int n,k;
    cin>>n>>k;
    vector<int> l(k),r(k);
    for(int i=0;i<k;i++) cin>>l[i]>>r[i];
    vector<ll> dp(n+1,0),cum(n+1,0);
    dp[1]=cum[1]=1;
    for(int i=2;i<=n;i++){
        for(int j=0;j<k;j++){
            int x=i-r[j];
            int y=i-l[j];
            if(y<1) continue;
            //debug()<<imie(i)imie(x)imie(y);
            assert(x<=y);
            assert(y<i);
            x=max(1,x);
            ll tmp=(cum[y]-cum[x-1])%mod;
            (tmp+=mod)%=mod;
            dp[i]=(dp[i]+tmp)%mod;
        }
        cum[i]=(dp[i]+cum[i-1])%mod;
    }
    cout<<dp[n]<<endl;
    return 0;
}

Measured memory_bytes: 6400
#include <iostream>
#include <cmath>
#include <vector>
#include <bitset>
#include <algorithm>
#include <stack>
#include <queue>
#include <map>
#include <climits>
#include <set>
#include <map>
#include <iomanip>
#include <cassert>
#include <functional>
#include <cstring>

using namespace std;

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

typedef pair<int, int> P;
#define mp make_pair
#define FOR(i, a, b) for(int (i)=a;(i)<(b);++(i))
#define rep(i, n)  FOR(i,0,n)
#define rrep(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define vsort(v) sort((v).begin(), (v).end());					//小さい順
#define rvsort(v) sort(v.begin(), v.end(),greater<int>());		//大きい順
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl  
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define all(c) (c).begin(),(c).end()
#define ll long long
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define vs vector<string>
#define vc vector<char>
#define vvc vector<vector<char>>
#define Print(p) cout<<(p)<<endl
#define F first
#define S second
#define pb push_back
#define mod 1000000007LL
#define INF 12345678901234567

const int maxn = 1e5 + 10;


int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	// your code is here
	
	int n; cin >> n;

	int ans = 800 * n - (n / 15) * 200;

	Print(ans);
	// your code finished
	return 0;

}

Measured memory_bytes: 256
c = [list(map(int, input().split())) for _ in range(3)]
a = [None, None, None]
b = [None, None, None]
a[0] = 0

b[0] = c[0][0] - a[0]
b[1] = c[0][1] - a[0]
b[2] = c[0][2] - a[0]

a[1] = c[1][0] - b[0]
a[2] = c[2][0] - b[0]
for i in range(3):
    for j in range(3):
        if c[i][j] != a[i]+b[j]:
            print("No")
            exit()
print("Yes")

Measured memory_bytes: 8952
#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long int a,b,c,d,count,sum;
	cin>>a;
	b=a;
	while(1)
	{
		if(a==0)
		{
			break;
		}
		else
		{
			c=a%10;
			a=a/10;
			sum=sum+c;
		}
	}
if(b%sum==0)
{
	cout<<"Yes";
}
else
{
	cout<<"No";
}
}

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

int main(){

  string str;
  cin >> str;

  int ans = 0;
  for(int i = 0; i < str.size(); i++){
    if(str[i] == '+') ans++;
    else ans--;
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
import sys
sys.setrecursionlimit(10**7)
 
N, Q = map(int, input().split())
root = [[] for i in range(N)]
ans = [0]*N
 
for i in range(N-1):
  a, b = map(int, input().split())
  a, b = a-1, b-1
  root[a].append(b)
  root[b].append(a)

for i in range(Q):
  p, x = map(int, input().split())
  ans[p-1] += x
  
visit = [False]*N
def dfs(n):
  visit[n] = True
  for go in root[n]:
    if visit[go]:
      continue
    ans[go] += ans[n]
    dfs(go)

dfs(0)
print(*ans)

Measured memory_bytes: 223540
if __name__ == "__main__":
    A,B = map(int,input().split())
    for i in range(1,1251):
        A_tmp,B_tmp = int(i*0.08),int(i*0.10)
        if A is A_tmp and B is B_tmp:
            print(i)
            exit()
    print(-1)

Measured memory_bytes: 9168
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;
#ifndef FAST_IO
 #define IOS ios_base::sync_with_stdio(false);cin.tie(nullptr);
#endif

#define FILE_IO freopen("input.txt","r",stdin)
#define int long long
#define f first
#define s second
#define endl '\n'
#define all(c) c.begin(),c.end()
#define bp __builtin_popcount
#define debug(x) cerr << #x << " = " << x << endl;

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

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template <typename T>void print(T t){for(auto &it : t)cout<<it<<" ";}
inline int powerexp(int a, int b, int m = MOD){ int res = 1;while(b){if(b&1)res = res * a % m;a = a * a % m,b >>= 1;}return res % m;}
inline int modinv(int a){ return powerexp(a,MOD-2,MOD);}
inline int lcm(int a, int b){ int g = __gcd(a,b);return a/g*b;}
inline int add(int x, int y){ x += y; if (x >= MOD) x -=  MOD; return x;}
inline int mul(int x, int y){ return (x * 1ll * y) % MOD;}
inline int sub(int x, int y){ x -= y; if (x<0) x += MOD; return x ;}

//-------------------< start here >-------------------------// 

void solve(){
   int n, m;
   cin >> n ;
   vector<int> a, b;
   for(int i = 0; i < n; i++){
	   int x;
	   cin >> x;
	   a.push_back(x);  
	 }
   cin >> m;
   for(int i = 0; i < m; i++){
	    int x;
	    cin >> x;
	    b.push_back(x);
	 }
   if (lexicographical_compare(all(a), all(b)))
     cout << 1 << endl;
   else cout << 0 << endl;
}

//-----------------------------
//comment from here for TOPCODER 
int32_t main(){
   IOS;
   solve();
   //find();
   #ifdef LOCAL_DEFINE
   cerr << "time elapsed " << (double)clock()/CLOCKS_PER_SEC << endl;
   #endif
}



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

int main() {
  int A,B,C;
  cin>>A>>B>>C;
  if ((A==5&&B==5&&C==7)||(A==5&&B==7&&C==5)||(A==7&&B==5&&C==5)) {
    cout<<"YES"<<endl;
  } else {
    cout<<"NO"<<endl;
  }
  return 0;
}


Measured memory_bytes: 256
def lcs(X,Y):
  L = []
  for yk in Y:
    prev_idx = -1
    for l_idx, l in enumerate(L):
      x_idx = X.find(yk, prev_idx + 1)
      if x_idx < 0:
        break
      L[l_idx] = min(l, x_idx) 
      prev_idx = l
    else:
      x_idx = X.find(yk, prev_idx + 1)
      if x_idx >= 0:
        L.append(x_idx)

  return len(L)

def main():
  q = int(input())
  for _ in range(q):
    X = input()
    Y = input()
    print(lcs(X,Y))

if __name__ == "__main__":
  import sys, io
  main()



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

int main(){
  long x;
  long a=-2000;
  long b=-2000;
  long a5 = 0;
  long b5 = 0;
  long res =0;
  cin >> x;
  for(a=-2000;a<2000;a++){
    for(b=-2000;b<2000;b++){
      a5 = a*a*a*a*a;
      b5 = b*b*b*b*b;
      res = a5-b5;
      if(x==res){
        cout << a<< " " << b;
        return 0;
      }
    }
  }
  
}


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

int main() {
	int n;
	cin>>n;
	double a[n],average=0;
	for(int i=0;i<n;i++) {
		cin>>a[i];
		average+=a[i];
	}
	average/=(double)n;
	
	int ans;
	double minus=10000;
	for(int i=0;i<n;i++)
		if(abs(average-a[i])<minus) {
			minus=abs(average-a[i]);
			ans=i;
		}
	
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
n = gets.chomp.to_i
h = gets.split.map(&:to_i)

(0..(n-2)).each do |i|
  h[i+1] -= 1 if h[i+1] > h[i]
  if h[i] > h[i+1]
    puts 'No'
    exit
  end
end
puts 'Yes'

Measured memory_bytes: 8580
#import sys
MOD = 10 ** 9 + 7
INFI = 10**10
#input = sys.stdin.readline
import math
from collections import deque
import itertools
import heapq
#import bisect
from fractions import Fraction
import copy
from functools import lru_cache
from collections import defaultdict
import pprint

#oo=list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
# ko=list("abcdefghijklmnopqrstuvwxyz")

def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def kingaku(a,b,n):
    keta=len(str(n))
    return a*n+b*keta

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

#    h,w,a,b = map(int, input().split())
#    c = [[0 for j in range(n)] for i in range(n)]

def ret(a):
    c=[None]*(len(a)-1)
    if len(a)==1:
        return a[0]
    elif len(a)==0:
        return 0
    for i in range(1,len(a)):
        c[i-1]=abs(a[i]-a[i-1])
    return ret(c)

def soinsubunkai(n):
    a = []
    i = 1
    while i*i <= n:
        if n % i == 0 and i!=1:
            a.append(i)
            n=n//i

        if n% i !=0 or i==1:
            i += 1
    nokori=[n]
    return a + nokori

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

def main():
    #l,r,d=map(int,input().split())
    x=int(input())
    ans=8
    for i in range(8):
        if x >=400+200*i:
            ans=8-i
    print(ans)














if __name__ == "__main__":

    main()


Measured memory_bytes: 77312
#include <iostream>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

string s;
string t;

int main() {
    cin >> s >> t;
    for (int i = 0; i < s.size(); i++) {
        if (s[i] != t[i]) {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 3132
#include<bits/stdc++.h>
#define LL long long
#define UP(i,l,h) for(int i=l;i<h;i++)
#define DOWN(i,h,l) for(int i=h-1;i>=l;i--)
#define W(t) while(t)
#define INF 0x3f3f3f3f
#define MEM(a,b) memset(a,b,sizeof(a))
#define MAXN 200010
using namespace std;
char mp[110][110];
int num[150];

int main() {
    int four=0,two=0,one=0;
    int n,m;
    scanf("%d%d",&n,&m);
    UP(i,0,n) {
        scanf("%s",mp[i]);
    }
    MEM(num,0);
    UP(i,0,n) UP(j,0,m) num[mp[i][j]]++;
    UP(i,'a','z'+1) {
        four+=num[i]/4;
        num[i]%=4;
        two+=num[i]/2;
        num[i]%=2;
        one+=num[i];
    }
    int nfour=(n/2)*(m/2);
    if(n%2==1||m%2==1) {
        int ntwo=n%2*m/2+m%2*n/2;
        int none=0;
        if(n%2==1&&m%2==1){
            none++;
        }
//        cout<<ntwo<<" "<<none<<endl;
        if(four<nfour) puts("No");
        else{
            four-=nfour;
            two+=four*2;
            if(two<ntwo) puts("No");
            else{
                two-=ntwo;
                one+=two*2;
                if(one<none) puts("No");
                else puts("Yes");
            }
        }

    }else{
        if(four<nfour) puts("No");
        else puts("Yes");
    }
}


Measured memory_bytes: 256
# https://atcoder.jp/contests/abc121/tasks/abc121_c
# C - Energy Drink Collector

n, m = list(map(int, input().split()))
ab_list = []

for _ in range(n):
    a, b = list(map(int, input().split()))
    ab_list.append((a, b))

# 一番安いお店を探す
ab_list.sort(key=lambda val: val[0])
nokori = m
cost = 0

for a, b in ab_list:
    if nokori < b:
        cost += a * nokori
        break
    else:
        cost += a * b
        nokori -= b

print(cost)

Measured memory_bytes: 18120
from bisect import bisect_left, bisect_right
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort()
C.sort()

ans = 0
for b in B:
    acnt = bisect_left(A, b)
    ccnt = N - bisect_right(C, b)
    ans += acnt * ccnt
print(ans)

Measured memory_bytes: 23360
#include<bits/stdc++.h>
using namespace std;
#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 (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
typedef long long LL;
int main(){
        double a,b,c,d,e,f;
        while(cin>>a,cin>>b,cin>>c,cin>>d,cin>>e,cin>>f){
           double x=(b*f-e*c)/(b*d-e*a);
           double y=(a*f-d*c)/(a*e-d*b);
           if(x==0)x=0;
           if(y==0)y=0;
           cout<<setprecision(3)<<fixed<<x<<" "<<y<<endl;
        }
	return(0);
}

Measured memory_bytes: 3164
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAX_N=1e5+10;
int a[MAX_N],val[MAX_N];
ll sum,cnt,cnt2;
vector<int> in[MAX_N],out[MAX_N],in2[MAX_N],out2[MAX_N];
inline void change_val(int idx,int new_val){
	sum-=val[idx];
	val[idx]=new_val;
	sum+=new_val;
}
int main(){
	int N,M;
	scanf("%d%d",&N,&M);
	for(int i=1;i<=N;i++){
		scanf("%d",a+i);
		if(i>1){
			int s=a[i-1],t=a[i];
			if(s<t){
				val[i]=t-s;
				sum+=t-s;
				in[s+1].push_back(i);
				out[t].push_back(i);
			}else{
				val[i]=t+1;
				sum+=t+1;
				cnt2++;
				in2[t+1].push_back(i);
				out2[s].push_back(i);
			}
		}
	}
	ll ans=sum-cnt2;
	for(int k=2;k<=M;k++){
		for(int& v:in[k]){
			int t=a[v];
			change_val(v,t+1);
			cnt++;
		}
		for(int& v:in2[k]){
			int s=a[v-1],t=a[v];
			change_val(v,M-s+t);
			cnt2--;
		}
		ans=min(ans,sum-(cnt+cnt2)*k);
		for(int& v:out[k]){
			int s=a[v-1],t=a[v];
			change_val(v,t-s);
			cnt--;
		}
		for(int& v:out2[k]){
			int s=a[v-1],t=a[v];
			change_val(v,M+1+t);
			cnt2++;
		}
	}
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 15104
#include <iostream>
#include <string>
#include <stdio.h>
#include <math.h>
#include <queue>
#include <algorithm>
#include <utility>
#include <vector>
#include <tuple>
#include <numeric>
using namespace std;


int main(int argc, char* argv[]){
	int N, X, T;
	scanf("%d %d %d", &N, &X, &T);
	if(N%X==0){
		printf("%d\n", N / X * T);
	}else{
		printf("%d\n", (N / X+1)*T);
	}

}


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

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define debug(x) cout << #x << ": " << x << endl
#define out(x) cout << x << endl
//#define int long long int
const int MOD = 1000000007;
const ll LINF = (ll)1e18 - 1;
const int INF = 1e9 - 1;
const double EPS = 0.000000001;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

void print(const vector<int> &v) {
  for(auto x : v) {
    cout << x << " ";
  }
  cout << endl;
}

signed main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  int a, b, q;
  cin >> a >> b >> q;
  VL s(a+2), t(b+2), x(q);
  s[0] = -LINF;
  s[a+1] = LINF;
  t[0] = -LINF;
  t[b+1] = LINF;
  rep(i, a) cin >> s[i+1];
  rep(i, b) cin >> t[i+1];
  rep(i, q) cin >> x[i];
  rep(i, q) {
    auto its = lower_bound(all(s), x[i]);
    auto itt = lower_bound(all(t), x[i]);
    ll c[2] = {*its, *(its-1)};
    ll d[2] = {*itt, *(itt-1)};
    ll ans = LINF;
    rep(j, 2) {
      rep(k, 2) {
        ans = min(ans, abs(c[j] - x[i]) + abs(c[j] - d[k]));
        ans = min(ans, abs(d[k] - x[i]) + abs(c[j] - d[k]));
      }
    }
    out(ans);
  }
  return 0;
}


Measured memory_bytes: 3712
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <map>
#include <set>

using namespace std;

int main() {
    int n, k[10000], cnt;
    while(1){
        cnt = 0;
        cin >> n;
        if(n == 0){
            break;
        }
        for(int i = 0; i < n; i++){
            cin >> k[i];
            if(k[i] == 0){
                cnt++;
            }
        }
        sort(k, k + n);
        if(k[n - 1] >= 2){
            cout << n + 1 - cnt << endl;
        }
        else{
            cout << "NA" << endl;
        }
    }
    return 0;
}

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

def main(input_str):
    checker = {}
    checker['a'] = False
    checker['b'] = False
    checker['c'] = False
    
    if 3 != len(list(input_str)):
        print('No')
        return

    for s in list(input_str):
        checker[s] = True
    
    
    if checker['a'] and checker['b'] and checker['c']:
        print('Yes')
        return
    print('No')
    return


if __name__ == '__main__':
    try:
        main(input().strip())
    except EOFError:
        pass


Measured memory_bytes: 3060