akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<vector>
using namespace std;

int mini_ans[5] = {2, 5, 20, 30, 63};

int main() {
    int N;
    cin >> N;
    if (N <= 5) {
        for (int i = 0; i < 5; i++) {
            if (N == 3) {
                if (i != 2 && i != 3) cout << mini_ans[i] << ' ';
            }
            else if (N == 4) {
                if (i != 3) cout << mini_ans[i] << ' ';
            }
            else cout << mini_ans[i] << ' ';
        }
        cout << endl;
        return 0;
    }
    vector<int> ans;
    int k = 0, sum = 0;
    int plus_num[4] = {2, 3, 4, 6};
    for (int i = 0; i < N / 4; i++) {
        for (int j = 0; j < 4; j++) {
            ans.push_back(6 * k + plus_num[j]);
            sum += 6 * k + plus_num[j];
        }
        k++;
    }
    for (int i = 0; i < N % 4; i++) {
        ans.push_back(6 * k + plus_num[i]);
        sum += 6 * k + plus_num[i];
    }
    if (sum % 6 == 0) {
        for (int i = 0; i < ans.size(); i++) {
            cout << ans[i] << ' ';
        }
    }
    else if (sum % 6 == 2) {
        ans.push_back(6 * k + 6);
        for (int i = 0; i < ans.size(); i++) {
            if (ans[i] != 8) {
                cout << ans[i] << ' ';
            }
        }
    }
    else if (sum % 6 == 3) {
        ans.push_back(6 * k + 6);
        for (int i = 0; i < ans.size(); i++) {
            if (ans[i] != 9) {
                cout << ans[i] << ' ';
            }
        }
    }
    else if (sum % 6 == 5) {
        if (N % 4 >= 2) k++;
        ans.push_back(6 * k + 4);
        for (int i = 0; i < ans.size(); i++) {
            if (ans[i] != 9) {
                cout << ans[i] << ' ';
            }
        }
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <set>
using namespace std;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string S;
    cin >> S;
    int ans = 0;
    for(int i=0; i<S.size(); i++)
        ans += S[i] - '0';
    int ans2 = (S[0] - '0') - 1 + 9 * (S.size() - 1);
    cout << max(ans, ans2) << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
        using namespace std;
       // #define int long long
const int MAX = 510000;
const int MOD = 1000000007;

     signed main(){
           string a,b;
           cin>>a>>b;
           int n=b.size();
           bitset<2000> x(a),y[b.size()],p[n],q[n],z;
           for(int i=0;i<n;i++){y[i]=bitset<2000>(b,i);b.push_back(b[i]);}
           p[0]=y[0];for(int i=1;i<n;i++)p[i]=p[i-1]|y[i];
           q[0]=y[0];for(int i=1;i<n;i++)q[i]=q[i-1]|y[n-i];
           int k,ans=MOD,t;
           for(int i=0;i<n;i++){
                   k=i+1;t=0;
                   for(int j=i;j<n;j++){
                           if(k==j)break;
                           while(k<=n&&(z==((x^y[i])&(~(p[j]|q[n-k]))))){
                                t=max(t,k-j);
                                   k++;
                           }
                      
                   }
                   if(t!=0)ans=min(ans,2*(n-t)-i+int((x^y[i]).count()));

           }
           for(int i=1;i<n;i++){
                   k=i+1;t=0;
                   for(int j=i;j<n;j++){
                           if(k==j)break;
                           while(k<=n&&(z==((x^y[n-i])&(~(q[j]|p[n-k]))))){
                                t=max(t,k-j);
                                   k++;
                           }
                      
                   }
                   if(t!=0)ans=min(ans,2*(n-t)-i+int((x^y[n-i]).count()));

           }
           if(z==((x^y[0])&(~p[n-1])))ans=min(ans,n+int((x^y[0]).count()));
           if(ans==MOD)cout<<-1<<endl;
           else cout<<ans<<endl;
        
}

        


Measured memory_bytes: 1920
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int long long m,M,temp=0;
    int n,i;
    cin>>n;
    if(n==1){
        M=1;
        cout<<M;}
    else if(n>=2)
    {
        m=2;
        M=1;
        for(i=1;i<=n-1;i++)
        {
             temp=M;
             M=M+m;
             m=temp;
        }
        cout<<M;
    }
}


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

using namespace std;
//using namespace __gnu_pbds;

#define ll  long long
#define PR  pair<int, int>

const int N = 3e5 + 5;
const int MOD = 1e9 + 7;
const long long INF = 5e18;
const double PI = 2 * acos(0.0);
//template<typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

int main() {
//    ios::sync_with_stdio(false);
//    cin.tie(0);
    int x, n, ans;
    cin >> x >> n;
    set<int> s;
    for (int i = 0; i < n; i++) {
        int y;
        cin >> y;
        s.insert(y);
    }
    int mn = 1e9;
    for (int i = x; i < 1000; i++) {
        if (s.find(i) == s.end()) {
            mn = min(mn, abs(x - i));
            ans = i;
            break;
        }
    }
    for (int i = x; i > -1000; i--) {
        if (s.find(i) == s.end()) {
            if (abs(x - i) <= mn) {
                ans = min(ans, i);
            }
            break;
        }
    }
    cout << ans << '\n';
    return 0;
}


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

#define dlog(str) cout << "====" << str << endl;
#define INF 999999999
#define MOD 1000000009
#define REP(i, n) for(int i = 0, i##_l = (n); i < i##_l; i++)
#define FOR(i, s, e) for(int i = s; i <= e; i++)
#define LLI long long int
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define bit(a, shift) ((a>>shift)&1))
#define ALL(v) (v).begin(), (v).end()
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort((v).rbegin(), (v).rend())
// int 2.14E±9    lli 9.2E±18    double 1.7E±380

int main() {
    int N;
    cin >> N;
    if(N % 2 == 1) {
        cout << 0;
        return 0;
    }
    vector<int> v(N);
    REP(i, N) { cin >> v[i]; }
    SORT(v);
    cout << v[N / 2] - v[N / 2 - 1];
    return 0;
}

// 1 4 4 6 7 9

Measured memory_bytes: 640
/// c.cpp

# include <stdio.h>
# include <bits/stdc++.h>
using namespace std;
const pair < int , int > DD[] = {{1,0},{1,1},{0,1},{-1,1},{-1,0},{-1,-1},{0,-1},{1,-1}};
# define fi cin
# define fo cout
# define x first
# define y second
# define ll long long
# define IOS ios_base :: sync_with_stdio(0);cin.tie(0)
# define p(v) cerr << #v << " = " << v << '\n'
# define p2(v) cerr << #v << " = " << (complex < __typeof(v.x) > (v.x,v.y)) << '\n'
# define vi vector < int >
# define vl vector < ll >
# define pll pair < ll , ll >
# define pii pair < int , int >
# define mp make_pair
# define db long double
# define fail puts("-1")
# define yes puts("YES")
# define no puts("NO")
# define PP puts("Possible")
# define II puts("Impossible")
# define vii vector < pii >
# define vll vector < ll >
# define pb push_back
# define pdd pair < db , db >
template < class T > T smin(T &a,T b) {if (a > b) a = b;return a;}
template < class T > T smax(T &a,T b) {if (a < b) a = b;return a;}
int main(void)
{
    #ifdef CF
    freopen("input","r",stdin);
    #endif // CF
    srand(time(0));
    fo << fixed << setprecision(7);
    cerr << fixed << setprecision(7);
    static char s[1 << 20];
    fi>>(s + 1);
    static int D[1 << 20][30];
    static int F[20][1 << 20];
    int n = strlen(s + 1);
    for (int i = 1;i <= n;++i)
        s[i] -= 'a';
    const int C = 26;
    for (int i = n;i;--i)
    {
        D[i][s[i]] = i + 1;
        int ok = 1;
        for (int k = s[i] + 1;k <= C;++k)
        {
            const int cnt = D[D[i][k - 1]][k - 1];
            if (!cnt)
            {
                ok = 0;
                break;
            }
            D[i][k] = cnt;
        }
        if (ok)
        {
            for (int k = 0;k < s[i];++k)
                D[i][k] = D[D[i][26]][k];
        }
    }
    for (int i = 1;i <= n;++i)
        F[0][i] = D[i][26];
    for (int k = 1;k < 20;++k)
        for (int i = 1;i <= n;++i)
            F[k][i] = F[k - 1][F[k - 1][i]];
    int m;
    fi>>m;
    while (m --)
    {
        int l,r;
        fi>>l>>r;
        ++r;
        for (int k = 19;k + 1;--k)
            if (F[k][l] && F[k][l] <= r)
                l = F[k][l];
        puts(l == r ? "Yes" : "No");
    }
    cerr << "Time elapsed :" << clock() * 1000.0 / CLOCKS_PER_SEC << " ms" << '\n';
    return 0;
}


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

using namespace std;

int main(){
  int n,m;
  cin>>n>>m;
  int a[1000];
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  int c[1000]={};
  for(int i=0;i<m;i++){
    int b;
    cin>>b;
    c[find_if(begin(a),end(a),[=](int x){
	  return x<=b;
	})-begin(a)]++;
  }
  cout<<max_element(begin(c),end(c))-begin(c)+1<<endl;
}

Measured memory_bytes: 1168
/**
 *    Author  : Ador
 *    Created : 24.07.2020
**/
#include <iostream>
#include <cstdio>
#include <iomanip>
#include <algorithm>
#include <string>
#include <cstring>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <cctype>
typedef long long int ll ;
typedef unsigned long long int ull ;
using namespace std ;
int main(void)
{
    ios_base::sync_with_stdio(false) ; cin.tie(0) ; cout.tie(0) ;
        //freopen("input.txt", "r", stdin) ;
        //freopen("output.txt", "w", stdout) ;
    ll n , a , b , i , flag = 0 ; cin >> n ;
    ll result = n - 1 ;
    for(i = 1 ; i <= sqrt(n) ; ++i)
    {
        if(!(n % i))
        {
            a = i ;
            b = n / i ;
            flag = 1 ;
            result = min(result , ((a - 1) + (b - 1))) ;
        }
    }
    if(flag) cout << result << "\n" ;
    else cout << n - 1 << "\n" ;
    return 0 ;
}


Measured memory_bytes: 3640
#include <stdio.h>

int main(){
  int n, i, j, flag; scanf("%d", &n);
  int H[30] = {};
  int count = 0;
  for(i = 0; i < n; i++){
    flag = 1;
    scanf("%d", &H[i]);
    if(i == 0){
      count++;
    }
    else{
      for(j = 0; j < i; j++){
	if(H[i] < H[j]) flag = 0;
      }
      if(flag == 1) count++;
    }
  }
  printf("%d", count);

  return 0;
}


Measured memory_bytes: 128
#include <map>
#include <list>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#define endl '\n'
#define fast ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
using namespace std; 
int n,ansa,ansb;
int main()
{
	cin>>n;
	for (int i=1;i<=n;i++)
	   if (i%2==0)
	      ansa++;
	   else
	      ansb++;
	cout<<ansa*ansb<<endl;
	return 0;
} 

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

using namespace std;

int main(){
    int N;
    cin>>N;
    int ans = 1e9;

    for(int i=0;i<=N;i++){
        int count = 0;
        int nine = 9;
        int six = 6;
        int n = i;
        int m = N - n;

        while(nine < n) nine *= 9;
        while(nine >= 9){
            count += (n / nine);
            n %= nine;
            nine /= 9;
        }

        m += n;

        while(six < m) six *= 6;
        while(six >= 6){
            count += (m / six);
            m %= six;
            six /= 6;
        }

        count += m;
        ans = min(ans,count);
    }

    cout<<ans<<endl;

}

Measured memory_bytes: 256
def solve():
    N = int(input())
    P = list(map(int, input().split()))

    mn = P[0]

    cnt = 0
    for p in P:
        if p <= mn:
            cnt += 1
    
        mn = min(mn, p)

    print(cnt)    

if __name__ == '__main__':
    solve()


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

using namespace std;

int main(){
	int H, W; cin >> H >> W;
	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
			string s; cin >> s;
			if(s == "snuke") cout << char('A'+j) << i+1 << endl;
		}
	}
}



Measured memory_bytes: 256
import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const S = input[0][0];

  return 700 + (S.match(/o/g) || []).length * 100;
};

console.log(main(read()));


Measured memory_bytes: 29664
#include <string>
#include <vector>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <map>
#include <list>
#include <set>
#include <numeric>
#include <queue>
#include <stack>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <climits>
#include <cfloat>
#include <ctime>
#include <complex>
#include <cassert>
#include <iomanip>
#include <tuple>
using namespace std;
typedef long long LL;
typedef pair<int,int> P;

map<string, int> ids;
vector<P> roads[6000];
vector<int> st;
int cap;
int N;
int M;
int dist[6000];
vector<P> road2[302];
void exec()
{
	fill(roads,roads+6000, vector<P>());
	fill(road2,road2+302, vector<P>());
	st.clear();
	ids.clear();
	cin >> N >> M >> cap;
	cap*=10;
	if((N|M|cap)==0)exit(0);
	string in;
	cin >> in;
	int id=0;
	ids[in]=id++;
	cin >> in;
	ids[in]=id++;
	for(int i=0;i<N;i++){
		string c;
		int d;
		cin >> in >> c >> d;
		if(ids.find(in)==ids.end())
		{
			ids[in]=id++;
		}
		if(ids.find(c)==ids.end()){
			ids[c]=id++;
		}
		int a=ids[in];
		int b=ids[c];
		roads[a].push_back(P(b,d));
		roads[b].push_back(P(a,d));
		//cout << a << ", " << b << ":: " << d << endl;
	}
	/*
	for(auto a:ids)
	{
		cout << a.first << ": " << a.second << endl;
	}*/
	st.push_back(0);
	st.push_back(1);
	for(int i=0;i<M;i++){
		cin >> in;
		int a=ids[in];
		if(a>1){
			st.push_back(a);
		}
	}
	for(int i=0;i<st.size();i++){
		fill(dist,dist+ids.size(),cap+1);
		priority_queue<P, vector<P>, greater<P> > q;
		q.push(P(0,st[i]));
		dist[st[i]]=0;
		while(q.size()){
			int f=q.top().second;
			int d=q.top().first;
			q.pop();
			if(dist[f]<d)continue;
			for(auto p:roads[f]){
				int b=p.first;
				int dd=d+p.second;
				if(dd<dist[b]){
					q.push(P(dd,b));
					dist[b]=dd;
				}
			}
		}
		for(int j=0;j<st.size();j++){
			if(dist[st[j]]<=cap)
			{
				road2[i].push_back(P(j,dist[st[j]]));
				//cout << i << ", " << j << ": " << dist[st[j]] << ", " << st[j] << ": " << ids.size() << endl;
			}
		}
	}
	{
		fill(dist,dist+st.size(),INT_MAX);
		priority_queue<P, vector<P>, greater<P> > q;
		q.push(P(0,0));
		dist[0]=0;
		while(q.size()){
			int f=q.top().second;
			int d=q.top().first;
			q.pop();
			if(dist[f]<d)continue;
			for(auto p:road2[f]){
				int b=p.first;
				int dd=d+p.second;
				if(dd<dist[b]){
					q.push(P(dd,b));
					dist[b]=dd;
				}
			}
		}
	}
	if(dist[1]<INT_MAX){
		cout << dist[1] << endl;
	}
	else
	{
		cout << -1 << endl;
	}
}
int main() {
	while(1)exec();
}

Measured memory_bytes: 3736
//g++ -std=c++14 test.cpp -o test.out
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <iomanip>
#include <vector>
using namespace std;

#define MOD 1000000007

long long int N;
long long int A[300000];
long long int ans= 0;

void solve(){
	//2進数表示でAの要素のi桁目を全て調べて
	//その時に1がX個,0がY個出てきたとする
	//0と1を1つづつ選ぶ場合の個数をD(i)とおくと
	//D(i)＝(X_C_1)*(Y_C_1)=X*Y
	//ansのi桁目はD(i) * 2^kとなる
	for(int i=0;i<60;i++){
		long long int X = 0;
		long long int digit = ((long long int)pow(2,i))%MOD;
		for(int j=0;j<N;j++) X+=(A[j]>>i)&1;
		X %= MOD;
		X = (X*(N-X))%MOD;
		ans+=(X*digit)%MOD;
		ans%=MOD;
	}
	ans%=MOD;
}

int main(){
	cin >> N;
	for(int i=0;i<N;i++) cin >> A[i];

	solve();

	cout << ans;
	return 0;
}

Measured memory_bytes: 2560
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  int x=1;
  cin>>n;
  vector<int>vec(n);
  for(int i=0;i<n;i++){
    cin>>vec.at(i);}
  sort(vec.begin(),vec.end());
  for(int i=0;i<n-1;i++){
    if(vec.at(i)<vec.at(i+1)){
      x++;
    }
  }
  cout<<x<<endl;
}
  


Measured memory_bytes: 3604
import heapq
N, M = map( int, input().split() )
A = list( map( int, input().split() ))
A = list( map( lambda x: -x, A ))
heapq.heapify( A )

for i in range( M ):
  a = - heapq.heappop(A) // 2
  heapq.heappush( A, - a )
  
print( - sum( A ))

Measured memory_bytes: 14180
#include<bits/stdc++.h>
using namespace std;
string s;  int l,r;
bool check(int i,int j)
{ 
    l=i-1 ; r=j-1; 
    while(l<r)
    {if(s[l]!=s[r])
    return false;
     l++;
     r--;
    }return true;
}
void solve()
{  double l;
   cin>>l;
   l=l/3;
   l=l*l*l;
   cout<<fixed<<setprecision(12)<<l;
}
int main()
{   
   solve();
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
///Welcome to Nasif's Code
#define bug printf("bug\n");
#define bug2(var) cout<<#var<<" "<<var<<endl;
#define co(q) cout<<q<<endl;
#define all(q) (q).begin(),(q).end()
typedef long long int ll;
typedef unsigned long long int ull;
const int MOD = (int)1e9+7;
const int MAX = 1e6;
#define pi acos(-1)
#define inf 1000000000000000LL
#define FastRead    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int arr[MAX];
int main()
{
    FastRead
    //freopen("output.txt", "w", stdout);
    map<int,int>mp;
    vector<int>v;
    int n;
    cin>>n;
    set<int>s;
    while(n--){
        int a;
        cin>>a;
        mp[a]++;
        s.insert(a);
    }
    for(auto i:s){
        while(mp[i]>1)
        {
            v.push_back(i);
            mp[i]-=2;
        }
    }
    sort(v.begin(),v.end());
    if(v.size()<2)
        cout<<"0"<<endl;
    else{
        ll x=v[v.size()-1];
        ll y=v[v.size()-2];
        cout<<x*y<<endl;
    }
    return 0;
}


Measured memory_bytes: 12888
N = int(input())
A = [int(input()) for i in range(N)]
 
 
left_max = [-1] * N
right_max = [-1] * N
all = sum(A)
left_max[0] = A[0]
right_max[-1] = A[-1]
for i in range(1, N):
        left_max[i] = max(left_max[i-1], A[i])
for i in reversed(range(0, N-1)):
        right_max[i] = max(right_max[i+1], A[i])
 

print(right_max[1])
for i in range(1,N-1):
        print(max(left_max[i-1], right_max[i+1]))
print(left_max[-2])

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

using namespace std;

typedef pair<int, int> P;
typedef long long ll;
#define rep(i, n) for(int i=0;i<n;i++)
#define rep2(i, m, n) for(int i=m;i<n;i++)
#define rrep(i, n, m) for(int i=n;i>=m;i--)
using Graph = vector<vector<int>>;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const ll MOD = 1000000007;
#ifdef __DEBUG

#include "cpp-pyprint/pyprint.h"

#endif

ll dp[100005][13];

void Main() {
    string s;
    cin >> s;

    dp[0][0] = 1;
    int N = s.length();

    for (int i = 0; i < N; ++i) {
        if (s[i] == '?') {
            for (int j = 0; j < 10; ++j) {
                for (int k = 0; k < 13; ++k) {
                    dp[i + 1][(10 * k + j) % 13] += dp[i][k];
                    dp[i + 1][(10 * k + j) % 13] %= MOD;
                }
            }

        } else {
            int j = s[i] - '0';
            for (int k = 0; k < 13; ++k) {
                dp[i + 1][(10 * k + j) % 13] += dp[i][k];
                dp[i + 1][(10 * k + j) % 13] %= MOD;
            }
        }
    }
    cout << dp[N][5] % MOD << endl;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
}


Measured memory_bytes: 10704
#include <algorithm>
#include <functional>
#include <iostream>
#include <numeric>
#include <queue>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

using ll = long long;
using ull = unsigned long long;

using vll = vector<ll>;

void solve();

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

  solve();

  return 0;
}

#define ini(...)   \
  int __VA_ARGS__; \
  in(__VA_ARGS__)

#define inl(...)  \
  ll __VA_ARGS__; \
  in(__VA_ARGS__)

#define ins(...)      \
  string __VA_ARGS__; \
  in(__VA_ARGS__);

void in() {}
template <typename T, class... U>
void in(T& t, U&... u) {
  cin >> t;
  in(u...);
}

void out() {
  cout << endl;
}
template <typename T, class... U>
void out(const T& t, const U&... u) {
  cout << t;
  if (sizeof...(u))
    cout << " ";
  out(u...);
}

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

void solve();
#ifndef ONLINE_JUDGE
#include "./lib.hpp"
#endif

const ll MOD = 1000000007;

void solve() {
    ini(N);

    vector<bool> is_prime(1001, true);
    is_prime[0] = is_prime[1] = false;
    unordered_map<int, ll> primes;
    for (int i = 2; i <= 1000; i++) {
        if (!is_prime[i])
            continue;

        primes.insert(make_pair(i, 0LL));
        for (int j = 2; i * j <= 1000; j++)
            is_prime[i * j] = false;
    }

    for (int i = 1; i <= N; i++) {
        int tmp = i;
        for (auto& p : primes) {
            while (tmp % p.first == 0) {
                tmp /= p.first;
                p.second++;
            }
            if (tmp == 1)
                break;
        }
    }

    ll ret = 1LL;
    for (auto p : primes)
        ret = (ret * (p.second + 1)) % MOD;

    out(ret);
}


Measured memory_bytes: 3608
S=input()

if S=='SUN':
    print(7)
elif S=='MON':
    print(6)
elif S=='TUE':
    print(5)
elif S=='WED':
    print(4)
elif S=='THU':
    print(3)
elif S=='FRI':
    print(2)
elif S=='SAT':
    print(1)

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

int main()
{
  int N;
  cin >> N;
  int h[N];
  int cnt = 0;
  int inner = 0;

  for (int i = 0; i < N; i++)
  {
    cin >> h[i];
  }

  for (int i = 0; i < N; i++)
  {
    if (inner >= h[i])
    {
      inner = h[i];
    }
    else
    {
      cnt += h[i] - inner;
      inner = h[i];
    }
  }
  cout << cnt;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
 
int main(){
    int n;
    cin >> n;
    for (int i = 0; i < n; i++){
        int Y, M, D;
        cin >> Y >> M >> D;
 
        int offset = (10 - M + 1) * 20 - (D - 1);
        if (Y % 3 != 0){
            offset -= (12 - M) / 2;
        }
 
        Y++;
        int uruutime = (1002 - Y) / 3;
        int ans = offset + 195 * (1000 - Y) + uruutime * 5;
        cout << ans << endl;
    }
    return 0;
}

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

using namespace std;

#define debug(n) cerr << #n << ':' << n << endl;
#define dline    cerr << __LINE__ << endl;
#define rep(i,s,e) for(int i = (int)(s); i < (int)(e); ++i)
#define per(i,s,e) for(int i = (int)(s)-1; i >= (int)(e); --i)

using ll = long long;
template<class T, class U> using P = pair<T,U>;
template<class T> using Heap = priority_queue<T>;
template<class T> using heaP = priority_queue<T,vector<T>,greater<T>>;

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

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

template<class T, size_t N, class U>
void Fill(T (&a)[N], const U&v){
    fill((U*)a,(U*)(a+N),v);
}

template<class T>
istream& operator >> (istream&is, vector<T>&v){
  for(auto&e:v)is >> e;
  return is;
}

int main(){
  int n, k; cin >> n >> k;
  vector<int> v(n);
  for(auto&e:v) cin >> e;
  ll ans = 1001001001;
  rep(i,0,n){
    ll l = i;
    ll r = i+k-1;
    if(r >= n) break;
    l = v[l];
    r = v[r];
    if(l*r>=0){
      ChangeMin(ans, max(abs(l),abs(r)));
    } else {
      l = -l;
      if(r > l)swap(r,l);
      ChangeMin(ans, 2*r+l);
    }    
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 640
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner D = new Scanner(System.in);
        int n = D.nextInt();
        if (n == 25) {
            System.out.println("Christmas");
        } else if (n == 24) {
            System.out.println("Christmas Eve");
        } else if (n == 23) {
            System.out.println("Christmas Eve Eve");
        } else {
            System.out.println("Christmas Eve Eve Eve");
        }
    }
}

Measured memory_bytes: 21844
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>

using namespace std;

int a, b, c;

int main(){
    cin >> a >> b >> c;

    if(a == b && b == c){
        cout << "Yes";
    }else{
        cout << "No";
    }
    return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
const int maxn=2e5+5;
const ll inf=1ll<<54;
int n,m,a,b;
ll s[maxn],q[maxn],f[maxn],ans=inf;
inline int read(){
    int x=0,f=1;char ch=getchar();
    for(;ch>'9'||ch<'0';f=ch=='-'?-1:1,ch=getchar());
    for(;ch<='9'&&ch>='0';x=x*10+ch-48,ch=getchar());
    return x*f;
}
#define mid (l+r>>1)
#define ls (root<<1)
#define rs (root<<1|1)
ll t[maxn<<2][2];
void build(int root,int l,int r,int id){
    t[root][id]=inf;
    if(l==r)return;
    build(ls,l,mid,id);build(rs,mid+1,r,id);
}
void update(int root,int l,int r,int k,ll v,int id){
    if(l==r){t[root][id]=v;return;}
    if(k<=mid)update(ls,l,mid,k,v,id);
    else update(rs,mid+1,r,k,v,id);
    t[root][id]=min(t[ls][id],t[rs][id]);
}
ll query(int root,int l,int r,int a,int b,int id){
    if(l==a&&r==b)return t[root][id];
    if(b<=mid)return query(ls,l,mid,a,b,id);
    else if(a>mid)return query(rs,mid+1,r,a,b,id);
	return min(query(ls,l,mid,a,mid,id),query(rs,mid+1,r,mid+1,b,id));
}
void solve(int a,int b){
	f[1]=abs(a-q[1]);build(1,1,m,0);build(1,1,m,1);
    update(1,1,m,b,f[1]-b-s[1],0);
    update(1,1,m,b,f[1]+b-s[1],1);
    for(int i=2;i<=n;i++){
        f[i]=min(query(1,1,m,1,q[i],0)+q[i],
		query(1,1,m,q[i],m,1)-q[i])+s[i-1];
        update(1,1,m,q[i-1],f[i]-q[i-1]-s[i],0);
        update(1,1,m,q[i-1],f[i]+q[i-1]-s[i],1);
    }
    for(int i=1;i<=n;i++)ans=min(ans,f[i]+s[n]-s[i]);
}
int main(){
    m=read();n=read();a=read();b=read();
    for(int i=1;i<=n;i++)q[i]=read();
    for(int i=2;i<=n;i++)s[i]=s[i-1]+abs(q[i]-q[i-1]);
    solve(a,b);solve(b,a);
    printf("%lld\n",ans);
    return 0;
}


Measured memory_bytes: 15360
a, b, m = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

min_ = min(A)+min(B)

for i in range(m):
  x, y, c = map(int, input().split())
  x, y = x-1, y-1
  if A[x]+B[y]-c <= min_:
    min_ =  A[x]+B[y]-c
    
print(min_)

Measured memory_bytes: 70468
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#define LL long long
using namespace std;
LL read() {
    LL k = 0; char c = getchar();
    while(c < '0' || c > '9') c = getchar();
    while(c >= '0' && c <= '9')
        k = k * 10 + c - 48, c = getchar();
    return k;
}
int main() {
    LL n = read(), tot = 1, ans = 0;
    while(n > 0) {
        ans += tot;
        n >>= 1ll; tot <<= 1ll;
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
bool used[50];
typedef pair<int,int>P;
int n,k,a[11];
void dfs(int d){
}
int main(){
  cin>>n>>k;
  set<int>st;
  r(i,k)cin>>a[i],st.insert(a[i]);
  for(int i=n;;i++){
    int c=i,f=0;
    while(c){
      if(st.count(c%10))f++;
      c/=10;
    }
    if(!f){
      cout<<i<<endl;
      return 0;
    }
  }
}

Measured memory_bytes: 256
N=int(input())
A=list(map(int, input().split()))
nums=[0]*(N+1)

for i in range(N):
  nums[A[i]]+=1
  
tmp=0
for i in range(1, N+1):
  tmp+=nums[i]*(nums[i]-1)//2
  
for i in range(N):
  print(tmp-max(0, nums[A[i]]-1))

Measured memory_bytes: 25716
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

int main(){
    int N,K;
    scanf("%d %d",&N,&K);
    if(N >= 10){
        printf("%d",K);
    }else{
        printf("%d",K+100*(10-N));
    }
    return 0;
}

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

using namespace std;

int main() {
  string s;
  cin >> s;
  long long res = 0;
  int cnt = 0;
  for (char c : s) {
    if (c == 'W') {
      res += cnt;
    } else {
      ++cnt;
    }
  }
  cout << res << '\n';
  return 0;
}


Measured memory_bytes: 3688
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long k,a,b;
   cin>>k>>a>>b;
   for(int i=a; i<=b; i++)
       if(i%k==0)
       {
           cout<<"OK";
           return 0;
       }
   cout<<"NG";
}


Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
int main() {
    int a, b, c, d, e, k;
    cin >> a >> b >> c >> d >> e >> k;
    int ctr = 0;
    if ((b - a > k) || (c - a > k) || (d - a > k) || (e - a > k) || (c - b > k) || (d - b) > k || (e - b > k) ||
        (d - c > k) || (e - c > k) || (e - d > k)) {
        ctr++;
    }
    if (ctr > 0) {
        cout << ":(";
    } else {
        cout << "Yay!";
    }
}

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

int main()
{
    ll N, Q;
    cin >> N >> Q;
    vector<tuple<ll, bool, ll>> events;
    for (ll i = 0; i < N; i++) {
        ll S, T, X;
        cin >> S >> T >> X;
        events.emplace_back(S - X, true, X); // 通行止め期間に入る
        events.emplace_back(T - X, false, X); // 通行止め期間が終わる
    }

    sort(begin(events), end(events), [](auto&& a, auto&& b) { return get<0>(a) < get<0>(b); });

    multiset<ll> closed;
    auto it_s = begin(events);

    for (ll i = 0; i < Q; i++) {
        ll D;
        cin >> D;
        while (it_s != end(events) && get<0>(*it_s) <= D) {
            ll x;
            bool insert;
            tie(ignore, insert, x) = *it_s;
            if (insert) {
                closed.insert(x);
            } else {
                // 必ず存在しなければおかしいのでfindの戻り値チェックは不要
                closed.erase(closed.find(x));
            }
            it_s++;
        }
        if (closed.empty()) {
            cout << -1 << "\n";
        } else {
            cout << *begin(closed) << "\n";
        }
    }
}


Measured memory_bytes: 21864
#include <stdio.h>

int main(){
	int a, b, c, n, m;

	while (scanf("%d %d %d", &a, &b, &c) != EOF) {
		n = 20-a-b;
		m = 0;

		if(n >= 10) printf("YES\n");
		else{
			if(a < n) m++;
			if(b < n) m++;
			if(c < n) m++;

			if(n-m > 3) printf("YES\n");
			else printf("NO\n");
		}
	}

	return 0;
}

Measured memory_bytes: 580
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <numeric>

using namespace std;

using ll = long long;

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)

#define input(...) __VA_ARGS__; in(__VA_ARGS__)

#if __has_include("debugger.cpp")
  #include "debugger.cpp"
#else
void print() {
  std::cout << std::endl;
}

template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
  cout << head;
  if (sizeof...(tail) > 0) cout << " ";
  print(std::forward<Tail>(tail)...);
}
# endif

void in() { }

template <class Head, class... Tail>
void in(Head&& head, Tail&&... tail) {
  cin >> head;
  in(std::forward<Tail>(tail)...);
}

int main() {
  ll input(n);
  vector<ll> a(n + 1), b(n);
  REP(i, n + 1) cin >> a[i];
  REP(i, n) cin >> b[i];
  ll cnt = 0;
  REP(i, n) {
    if (a[i] > b[i]) cnt += b[i];
    else {
      cnt += a[i];
      ll diff = b[i] - a[i];
      cnt += diff;
      a[i + 1] -= diff;

      if (a[i + 1] < 0) {
        cnt += a[i + 1];
        a[i + 1] = 0;
      }
    }
  }
  print(cnt);
}


Measured memory_bytes: 4716
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define loop(i,a,b) for (int i=a; i<b; ++i)
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll N, W;
    cin >> N >> W;
    vector <ll> values(N), weights(N);
    loop(i,0,N) cin >> weights[i] >> values[i];
    vector < vector <ll> > dp(N+1, vector <ll>(W+1));
    // dp[i][j] = max value possible with weight j, and items upto item i
    loop (i, 0, W+1) dp[0][i]=0;
    loop(i, 1, N+1)
    {
        loop(j, 0, W+1)
        {
            if (weights[i-1]>j) dp[i][j]=dp[i-1][j];
            else dp[i][j]=max(dp[i-1][j-weights[i-1]]+values[i-1], dp[i-1][j]);
            // cout << i << " "<< j << " "<<dp[i][j] << "\n";
        }
    }
    cout << dp[N][W] << "\n";
    return 0;
}

Measured memory_bytes: 80256
// AOJ 0600 Baumkuchen
// 2017.12.5 bal4u@uu

#include <stdio.h>
#include <stdlib.h>

int a[100002], p[100002];
long long s[100002];

char buf[15], *bp;
int getint()
{
	int n = 0;
	while (*bp >= '0') n = (n<<3) + (n<<1) + (*bp++ & 0xf);
	return n;
}

int main()
{
	int n, i, ii, f;
	long long sum, l, m, r;

	fgets(bp=buf, 15, stdin), n = getint();
	for (sum = 0, i = 0; i < n; i++) {
		fgets(bp=buf, 15, stdin);
		sum += a[i] = getint();
	}
	
	l = 0, r = sum + 1;
	while (l + 1 < r) {
		m = (l+r) >> 1;
		for (i = 0; i < n; i++) {
			if (!i) s[i] = p[i] = 0;
			else p[i] = p[i-1] - 1, s[i] = s[i-1] - a[i-1];
			
			while (s[i] < m) {
				ii = (i + p[i]) % n;
				s[i] += a[ii], p[i]++;
			}
		}
	
		for (f = 0, i = 0; i < n; i++) {
			ii = (i + p[i]) % n;
			if (sum - s[i] - s[ii] >= m) f = 1;
		}
		if (f) l = m; else r = m;
    }
	printf("%lld\n", l);
	return 0;
}

Measured memory_bytes: 3384
#include "bits/stdc++.h"
#define ll long long
#define inf 1000000007
#define sort(vec) sort((vec).begin(),(vec).end());
using namespace std;

ll kai(ll n) {
	ll ans=1;
	for(ll i=1;i<=n;i++) {
		ans*=i;
		ans%=inf;
	}
	return ans;
}

int main() {
	ll n;
	cin>>n;
	ll e=kai(n);
	ll f=e%inf;
	cout<<f<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <cstdlib>
#include <cmath>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cstdio>
#include <numeric>
#include <bitset>
#include <stack>
#include <cstring>
using namespace std;

const int INF = 1 << 30;
const double EPS = 1e-10;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};

int main()
{
  int N, T, E;
  while (cin >> N >> T >> E) {
    vector<int> x(N);
    for (int i = 0; i < N; ++i)
      cin >> x[i];

    int ans = -1;
    for (int i = 0; i < N; ++i) {
      for (int j = 0; j < 2000; ++j) {
        if (T-E <= x[i]*j && x[i]*j <= T+E)
          ans = i+1;
      }
    }
    cout << ans << endl;
  }
  return 0;
}

Measured memory_bytes: 1200
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <string>

#define ll long long
#define rep(i,n) for(int i = 0; i < n; i++)
#define PI 3.141592653589

using namespace std;

int gcd(int a, int b);
int lcm(int a, int b);

void solve_A(){
    char c;
    cin >> c;
    printf("%c", c+1);
}

int main(void){
    solve_A();
    
    return 0;
}

int gcd(int a, int b){
    if(a < b) swap(a, b);

    int r = a % b;
    while(r != 0){
        a = b;  b = r;  r = a % b;
    }
    return b;
}

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define RI(a) scanf("%d",&a)
#define RII(a,b) scanf("%d%d",&a,&b)
#define RIII(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#define ALL(a) a.begin(),a.end()
#define F first
#define S second
#define REP(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#ifdef leowang
#define debug(...) do{\
	fprintf(stderr,"%s - %d : (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);\
	_DO(__VA_ARGS__);\
}while(0)
template<typename I> void _DO(I&&x){cerr<<x<<endl;}
template<typename I,typename...T> void _DO(I&&x,T&&...tail){cerr<<x<<", ";_DO(tail...);}
#else
#define debug(...)
#endif
//}}}
const ll maxn=100005;
const ll maxlg=__lg(maxn)+2;
const ll INF64=8000000000000000000LL;
const int INF=2000000000;

int main()
{
	int n;
  cin>>n;
	if(n%10==9||n/10==9) puts("Yes");
	else puts("No");
	return 0;
}


Measured memory_bytes: 256
/*********************
*  Author: xuziyuan  * 
*********************/

#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
#define LL long long
#define pii pair <int,int>
#define fi first
#define se second
#define pb push_back
#define mpr make_pair

using namespace std;

const LL MOD=1e9+7;

int main()
{
  string s,t;
  cin>>s>>t;
  cout<<t<<s<<endl;
  return 0;
}

Measured memory_bytes: 256
{-# LANGUAGE BangPatterns #-}
import           Control.Exception           (assert)
import           Control.Monad
import           Control.Monad.Primitive
import qualified Control.Monad.ST            as ST
import qualified Data.Array.IO               as IO
import qualified Data.Array.ST               as ST
import qualified Data.Array.Unboxed          as A
import           Data.Bits
import qualified Data.ByteString.Char8       as BS
import           Data.Char
import           Data.Foldable
import           Data.List
import qualified Data.Map.Strict             as Map
import           Data.Maybe
import qualified Data.Sequence               as Seq
import qualified Data.Set                    as Set
import qualified Data.Vector                 as VB
import qualified Data.Vector.Mutable         as VBM
import qualified Data.Vector.Unboxed         as V
import qualified Data.Vector.Unboxed.Mutable as VM
import           Debug.Trace

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine
getIntVec n = V.unfoldrN n (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine

readInteger = fst . fromJust . BS.readInteger
readIntegerList = map readInteger . BS.words
getInteger = readInteger <$> BS.getLine
getIntegerList = readIntegerList <$> BS.getLine

inf :: Int
inf = 10^18

main = do
  [x, k, d] <- getIntList

  let x' = abs x
      q = x' `div` d
      r = x' `mod` d
      q' = if d - r < r then q + 1 else q

      m  = min k q'
      k' = k - m

      y = x' - d * m

      ans = if odd k'
            then d - abs y
            else abs y

  print ans


Measured memory_bytes: 3776
fun main(args : Array<String>) {
    val N = readLine()!!.toInt()
    val AandB = mutableListOf<Pair<Int, Int>>()
    (1..N).forEach {
        val (A, B) = readLine()!!.split(" ").map { it.toInt() }
        AandB.add(Pair(A, B))
    }

    AandB.sortBy {
        it.second
    }

    var currentTime = 0
    AandB.forEach {
        currentTime = currentTime + it.first
        if (currentTime > it.second) {
            println("No")
            return
        }
    }
    println("Yes")
}

Measured memory_bytes: 127292
#include <iostream>
#include <string>
#include <stdlib.h>
#include <algorithm>
#include <math.h>
using namespace std;

void swap(int *xp, int *yp)
{
    int temp = *xp;
    *xp = *yp;
    *yp = temp;
}
  
void bubbleSort(int arr[], int n)
{
    int i, j;
    for (i = 0; i < n-1; i++){
        for (j = 0; j < n-i-1; j++){
            if (arr[j] < arr[j+1])
                swap(&arr[j], &arr[j+1]);
        }
    }
}

int main(void) {
    int n;
    cin >>n;
    int n_ary[n];
    
    for (int i = 0; i < n; i++) {
        cin >> n_ary[i];
    }
    
    bubbleSort(n_ary, n);
    
    int a_total = 0;
    int b_total = 0;
    for (int i = 0; i < n; i++) {
        if (i % 2 == 0) {
            a_total += n_ary[i];
        }else{
            b_total += n_ary[i];
        }
    }
    
    cout << a_total - b_total;

    return 0;
}

Measured memory_bytes: 256
#include <algorithm>  
#include <iostream>  
#include <sstream>  
#include <string>  
#include <cstring>
#include <vector>  
#include <queue>  
#include <set>  
#include <map>  
#include <cstdio>  
#include <cstdlib>  
#include <cctype>  
#include <cmath>  
#include <list>  
#include <cassert>
#include <ctime>
#include <climits>
using namespace std;  

#define PB push_back  
#define MP make_pair  
#define SZ(v) ((int)(v).size())  
#define FOR(i,a,b) for(int i=(a);i<(b);++i)  
#define REP(i,n) FOR(i,0,n)  
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)  
#define REPE(i,n) FORE(i,0,n)  
#define FORSZ(i,a,v) FOR(i,a,SZ(v))  
#define REPSZ(i,v) REP(i,SZ(v))  
typedef long long ll;
typedef unsigned long long ull;
ll gcd(ll a,ll b) { return b==0?a:gcd(b,a%b); }

const int MAXN = 100000;

int n;
int t[MAXN], x[MAXN], y[MAXN];

bool solve() {
	REP(i, n) {
		int pt = i == 0 ? 0 : t[i - 1], px = i == 0 ? 0 : x[i - 1], py = i == 0 ? 0 : y[i - 1], ct = t[i], cx = x[i], cy = y[i];
		int dt = ct - pt, d = abs(cx - px) + abs(cy - py); if (dt < d || dt % 2 != d % 2) return false;
	}
	return true;
}

void run() {
	scanf("%d", &n); REP(i, n) scanf("%d%d%d", &t[i], &x[i], &y[i]);
	printf("%s\n", solve() ? "Yes" : "No");
}

int main() {
	run();
	return 0;
}


Measured memory_bytes: 1408
import java.io.IOException;
import java.util.InputMismatchException;

public class Main {
	void run() {
		MyScanner sc = new MyScanner();

		int n = sc.nextInt();
		int max = 1000000 + 1;
		long[] sum = new long[max];
		for (int i = 0; i < n; i++) {
			int k = sc.nextInt();
			sum[k] += k;
		}
		for (int i = 1; i < max; i++) {
			sum[i] += sum[i - 1];
		}

		int m = sc.nextInt();
		int[] b = sc.nextIntArray(m);
		long[] c = sc.nextLongArray(m);

		for (int i = 0; i < m; i++) {
			System.out.println(sum[b[i]] >= c[i] ? "Yes" : "No");
		}
	}

	public static void main(String[] args) {
		new Main().run();
	}

	public void mapDebug(int[][] a) {
		System.out.println("--------map display---------");
		for (int i = 0; i < a.length; i++) {
			for (int j = 0; j < a[i].length; j++) {
				System.out.printf("%3d ", a[i][j]);
			}
			System.out.println();
		}
		System.out.println("----------------------------" + '\n');
	}

	class MyScanner {
		int read() {
			try {
				return System.in.read();
			} catch (IOException e) {
				throw new InputMismatchException();
			}
		}

		boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		boolean isEndline(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		int[] nextIntArray(int n) {
			int[] array = new int[n];
			for (int i = 0; i < n; i++)
				array[i] = nextInt();
			return array;
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		long[] nextLongArray(int n) {
			long[] array = new long[n];
			for (int i = 0; i < n; i++)
				array[i] = nextLong();
			return array;
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		double[] nextDoubleArray(int n) {
			double[] array = new double[n];
			for (int i = 0; i < n; i++)
				array[i] = nextDouble();
			return array;
		}

		String next() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		String[] nextStringArray(int n) {
			String[] array = new String[n];
			for (int i = 0; i < n; i++)
				array[i] = next();

			return array;
		}

		String nextLine() {
			int c = read();
			while (isEndline(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndline(c));
			return res.toString();
		}
	}
}

Measured memory_bytes: 104088
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main() {
  int n,i;
  scanf("%d",&n);
  int total = 0;
  int max = 0;
  int a = 0;
  for(i=0;i<n;i++) {
    scanf("%d",&a);
    total += a;
    if(a > max) {
      max = a;
    }
  }
  printf("%d\n",total-max/2);
  return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
#define ll long long 
using namespace std;
const int _=3e3+20,yl=1e9+7;
ll f[_][_],a[_],g[_],h[_],n,q,p;
ll POW(ll x,ll y){
	ll res=1;
	while(y){
		if(y&1)res=res*x%yl;
		x=x*x%yl;y>>=1;
	}
	return res;
}
int main(){
	ios::sync_with_stdio(false);
	cin>>n>>q;p=POW(2,yl-2);
	for(int i=1;i<=n;++i){
		cin>>a[i];
		for(int j=0;j<i;++j){
			if(a[j]<a[i])f[i][j]=1;
			if(a[j]>a[i])f[j][i]=1;
		}
	}
	for(int i=1;i<=q;++i){
		int x,y;cin>>x>>y;
		for(int i=1;i<=n;++i){
			g[i]=(f[x][i]+f[y][i])*p%yl;
			h[i]=(f[i][x]+f[i][y])*p%yl;
		}
		for(int i=1;i<=n;++i){
			if(i==x||i==y)continue;
			f[x][i]=f[y][i]=g[i];
			f[i][x]=f[i][y]=h[i];
		}
		f[x][y]=f[y][x]=(f[x][y]+f[y][x])*p%yl;
	}
	ll ans=0;
	for(int i=1;i<=n;++i)
		for(int j=i+1;j<=n;++j)
			ans+=f[i][j];
	ans=ans%yl*POW(2,q)%yl;
	cout<<ans<<endl;
}


Measured memory_bytes: 71168
import java.util.Scanner;

public class Main{
    
    public static void main (String[] args){
        
        Scanner sc = new Scanner (System.in);
        
        int N = sc.nextInt();
        int [] order = new int [N];
        int [] manzoku = new int [N];
        int [] tsuika = new int [N];
        
        for (int index=0; index<N; index++){
            order[index]=sc.nextInt();
        }
        
        for (int index=0; index<N; index++){
            manzoku[index]=sc.nextInt();
        }
        
        for (int index=0; index<N-1; index++){
            tsuika[index]=sc.nextInt();
        }
        
        int total = 0;
        int lastNum = 0;
        
        for (int index=0; index<N; index++){
            int num = order[index]-1;
            total += manzoku [num];
            
            if (index!=0){
                if (lastNum == num-1){
                    total+=tsuika[lastNum];
                }
            }
            lastNum = num;
        }
        
        System.out.println(total);
    }
}

Measured memory_bytes: 23764
#include<bits/stdc++.h>
using namespace std;
bool s[101];
int main(){
	int a,sum=0;
	for(int i=0;i<3;i++){
		cin>>a;
		s[a]=true;
	}
	for(int i=1;i<=100;i++){
		if(s[i])
		sum++;
	}
	cout<<sum;
	
	
	
	
	
	return 0;
}

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

int main()
{
	string s;
	cin >> s;

	if (s[s.length() - 1] == 's')
	{
		cout << s << "es" << endl;
	}
	else
	{
		cout << s << "s" << endl;
	}
}

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

#define PI 3.14159265359
#define INF 1e9
#define LINF 1e18
#define IMOD 1000000007 
#define irep(i,n) for(int i = 0; i < (int)(n); i++)
#define irep2(i,a,n) for(int i = (int)(a); i <= (int)(n); i++)
#define lrep(i,n) for(long long  i = 0; i < (long long)(n); i++)
#define lrep2(i,a,n) for(long long i = (long long)(a); i <= (long long)(n); i++)

#define irrep(i,n) for(int i = (int)(n-1); i > -1; i--)
#define irrep2(i,a,n) for(int i = (int)(n); i >= (int)(a); i--)

typedef long long ll;
typedef std::vector<char> v_char;
typedef std::vector<v_char > v2_char;
typedef std::vector<double> v_double;
typedef std::vector<v_double > v2_double;
typedef std::vector<int> v_int;
typedef std::vector<v_int > v2_int;
typedef std::vector<ll> v_ll;
typedef std::vector<v_ll > v2_ll;
typedef std::vector<std::string> v_string;
typedef std::vector<v_string > v2_string;
typedef std::vector<bool> v_bool;
typedef std::vector<v_bool > v2_bool;
typedef std::pair<ll, ll> pll;
typedef std::pair<int, int> pii;

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

int main(void)
{
    ll a, b, c;
    cin >> a >> b >> c;

    ll ans = 0;

    while(a%2 == 0 && b % 2 == 0 && c % 2 == 0) {
        ll d = b/2 + c/2;
        ll e = a/2 + c/2;
        ll f = a/2 + b/2;
        ans++;

        if(d == e && e == f && d == f) {
            cout << -1 << endl;
            return 0;
        } else {
            a = d;
            b = e;
            c = f;
        }
    }
    cout << ans << endl;
    return 0;
}
/** tcoder **/


Measured memory_bytes: 256
import java.util.Scanner;
 
public class Main{
    public static void main(String args[]){
        Scanner sc=new Scanner(System.in);
        int i=1,n=sc.nextInt();
        while(i<=n){
            int x=i;
            if(x%3==0){
                System.out.printf(" %d",i);
            }else{
                while(x>=1){
                    if(x%10==3){
                        System.out.printf(" %d",i);
                        break;
                    }
                    x/=10;
                }
            }
            i++;
        }
        System.out.printf("\n");
    }
}


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

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

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define ALL(v) (v.begin(),v.end())
#define COUT(x) cout<<(x)<<"\n"

int gool[200010];

int main(){
    int n,m;
    cin >> n >> m;
    vector<int> a(m);
    vector<int> b(m);
    bool flag = false;
    
    REP(i,m)cin >> a[i] >> b[i];
    REP(i,m)if(a[i]==1)gool[b[i]]++;
    REP(i,m)if(gool[a[i]]>=1&&b[i]==n)flag = true;
    
    if(flag)COUT("POSSIBLE");
    else COUT("IMPOSSIBLE");
    return 0;
}

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

a = list(input())

b = list(input())

c = list(input())
co = 0
for i in range(n):
	if a[i] == b[i] and c[i] == b[i]:
		co += 0
	elif a[i] == b[i] or b[i] == c[i] or a[i] == c[i]:
		co += 1
	else:
		co += 2
print(co)

Measured memory_bytes: 38484