akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
#define INF 1145141919810893364
//#define INF 810114514
//#define PI 3.141592653589
typedef pair<int,int> PP;
typedef long long ll;
#define int ll
#define setdouble setprecision
#define REP(i,n) for(int i=0;i<(n);++i)
#define OREP(i,n) for(int i=1;i<=(n);++i)
#define RREP(i,n) for(int i=(n)-1;i>=0;--i)
#define GOODBYE do { cout << "No" << endl; return 0; } while (false)
#define MM <<" "<<
#define Endl endl

signed main(void){
    string S;
    cin >> S;
    REP(i,S.size()){
        cout << 'x';
    }cout << endl;
    return 0;
}



Measured memory_bytes: 256
import sys
input = sys.stdin.readline

N, M, X, Y = map(int, input().split())
LX = [int(v) for v in input().split()]
LY = [int(v) for v in input().split()]

mx = max(LX)
my = min(LY)

n = mx + 1
while n <= my:
    if X < n and n <= Y:
        print("No War")
        exit()
    else:
        n += 1
        
print("War")

Measured memory_bytes: 3064
#include<cstdio>
#include <iostream>
#include<sstream>
#include<fstream>
#include<iomanip>
#include<algorithm>
#include<cmath>
#include<complex>
#include <cstring>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<bitset>
#include<numeric>
#include<limits>
#include<climits>
#include<cfloat>
#include<functional>
#include<iterator>
#include <random>
#define inf  1000000000
#define mod  1073741824
#pragma GCC optimization ("O3")
using namespace std;
const long long int N = 6999999;
#define all(x) begin(x),end(x)
int main()
{
   
    // freopen("input.txt","r",stdin);
    // freopen("output.txt","w",stdout);
    //ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
  	string n,k;
  	cin >> n;
	for (int i = 0; i < n.size(); ++i)
  	{
  		cout << "x";
  	}	
  	return 0;
}	

Measured memory_bytes: 256
/*
ID: learnin7
TASK: test
LANG: C++                 
*/
/* LANG can be C++11 or C++14 for those more recent releases */
#include<bits/stdc++.h>

/*  Macros from Endagorion */
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)

using namespace std;

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef double ld;


int main(){
        
    ios_base::sync_with_stdio(0);
    
    //ofstream fout ("test.out");
    //ifstream fin ("test.in");
    //fin >> a >> b;
    //fout << a+b << endl;
    int w,h,n;
    cin>>w>>h>>n;
    int rec[w][h];
    forn(i,w){
        forn(j,h){
            rec[i][j]=0;
        }
    }
    int area = h*w;
    forn(i,n){
        int x,y,a;
        cin>>x>>y>>a;
        //x--,y--;
        if(a==1){
            forn(j,x){
                forn(k,h){
                    if(rec[j][k]==0){
                        rec[j][k] = 1;
                        area--;
                    }
                }
            }
        }
        else if(a==2){
            for(int j=x;j<w;j++){
                forn(k,h){
                    if(rec[j][k]==0){
                        rec[j][k] = 1;
                        area--;
                    }
                }
            }
        }
        else if(a==3){
            forn(j,w){
                forn(k,y){
                    if(rec[j][k]==0){
                        rec[j][k] = 1;
                        area--;
                    }
                }
            }
        }
        else{
            forn(j,w){
                for(int k=y;k<h;k++){
                    if(rec[j][k]==0){
                        rec[j][k] = 1;
                        area--;
                    }
                }
            }
        }
    }
    /*
    forn(i,w){
        forn(j,h){
            cout<<rec[i][j]<<" ";
        }
        cout<<"\n";
    }
    */
    cout<<area<<endl;
    return 0;
}



Measured memory_bytes: 3644
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
def main
  dat=[]
  fh=STDIN
  #fh=File.new("x.txt", "r")
  txt = fh.gets.chomp
  str = fh.gets.chomp
  re=Regexp.new(/#{str}/)
  txt2 = txt + txt
  if re.match(txt2)
    puts "Yes"
  else
    puts "No"
  end

end

if $0 == __FILE__ then
  main
end


Measured memory_bytes: 6876
a=[]
n=int(input())
b=list(map(int,input().split()))

l=[]
flg=0

for i in range(n-1,-1,-1):
  #print(i,"kocchi",b)
  flg=0
  for j in range(i,-1,-1):
    #print(j,"acchi")
    if j+1==b[j]:
      flg=1
      l.append(b.pop(j))
      break
  if flg==0:
    break

if flg==0:
  print(-1)
else:
  for i in range(n-1,-1,-1):
    print(l[i])


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
//#pragma GCC optimize("Ofast")
#define rep(i,n) for(long long i=0;i<(long long)(n);i++)
#define REP(i,k,n) for(long long i=k;i<(long long)(n);i++)
#define all(a) a.begin(),a.end()
#define eb emplace_back
#define lb(v,k) (lower_bound(all(v),k)-v.begin())
#define ub(v,k) (upper_bound(all(v),k)-v.begin())
#define fi first
#define se second
#define pi M_PI
#define PQ(T) priority_queue<T>
#define SPQ(T) priority_queue<T,vector<T>,greater<T>>
using ll=long long;
using P=pair<ll,ll>;
using PP=tuple<ll,ll,ll>;
using S=multiset<ll>;
using vi=vector<ll>;
using vvi=vector<vi>;
using vvvi=vector<vvi>;
const ll inf=1001001001001001;
const int INF=1001001001;
const int mod=998244353;
const double eps=1e-10;
template<class T> bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<class T> bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<class T> void out(T a){cout<<a<<'\n';}
template<class T> void outp(T a){cout<<'('<<a.fi<<','<<a.se<<')'<<'\n';}
template<class T> void outvp(T v){rep(i,v.size())cout<<'('<<v[i].fi<<','<<v[i].se<<')';cout<<'\n';}
template<class T> void outv(T v){rep(i,v.size()){if(i)cout<<' ';cout<<v[i];}cout<<'\n';}
template<class T> void outvv(T v){rep(i,v.size())outv(v[i]);}
template<class T> bool isin(T x,T l,T r){return (l)<=(x)&&(x)<=(r);}
template<class T> void YesNo(T b){if(b)out("Yes");else out("No");}
void decimal(int x){cout<<fixed<<setprecision(x);}
//ll GCD(ll a,ll b){if(b==0) return a; return GCD(b,a%b);}
//ll LCM(ll a,ll b){return(a/GCD(a,b))*(b/GCD(a,b))*GCD(a,b);}
ll POW(ll a,ll b){a%=mod;if(b==0)return 1;if(b&1)return a*POW(a,b-1)%mod;ll k=POW(a,b/2);return k*k%mod;}
vi calc(ll x){vi res;while(x>0){res.eb(x%10);x/=10;}reverse(all(res));return res;}

void solve() {
  ll n;
  cin>>n;
  vector<string> s(n);
  rep(i,n) cin>>s[i];
  vector<P> v(n);
  rep(i,n){
    ll now=0,below=0;
    rep(j,s[i].size()){
      if(s[i][j]=='(') now++;
      else{
        now--; chmin(below,now);
      }
    }
    v[i]=make_pair(below,now);
  }
  //outvp(v);
  vector<P> plus,zmin;
  rep(i,n){
    if(v[i].se>0) plus.eb(v[i]);
    else{
      ll x,y;
      tie(x,y)=v[i];
      x-=y;
      zmin.eb(make_pair(x,y));
    }
  }
  sort(all(plus)); reverse(all(plus));
  sort(all(zmin)); //これは逆にしない
  //outvp(plus); outvp(zmin);
  bool f=true;
  ll now=0;
  rep(i,plus.size()){
    if(now+plus[i].fi<0) f=false;
    now+=plus[i].se;
  }
  rep(i,zmin.size()){
    if(now+zmin[i].fi+zmin[i].se<0) f=false;
    now+=zmin[i].se;
  }
  if(now!=0) f=false;
  YesNo(f);
}

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  solve();
}


Measured memory_bytes: 65912
#include <bits/stdc++.h>
       
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main() {
  int n, m;
  cin >> n >> m;
  vector<int> c(m);
  for (int i = 0; i < (int)(m); ++i) cin >> c[i];

  vector<int> dp(n + 1, 1e9);
  dp[0] = 0;

  for (int i = 0; i < (int)(m); ++i) for (int j = 0; j < (int)(n + 1); ++j) if (j - c[i] >= 0) chmin(dp[j], dp[j - c[i]] + 1);
  cout << dp[n] << endl;

  return 0;
}



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

using namespace std;

int main() {
    deque<int> A;
    int q;
    cin >> q;
    
    while(q--) {
        int code;
        cin >> code;
        switch (code) {
            case 0: {
                int d,x;
                cin >> d >> x;
                if (d) A.push_back(x);
                else A.push_front(x);
            } break;
            case 1: {
                int p;
                cin >> p;
                cout << A[p] << endl;
            } break;
            case 2: {
                int d;
                cin >> d;
                if (d) A.pop_back();
                else A.pop_front();
            } break;
        }
    }
    return 0;
}


Measured memory_bytes: 4576
#include <bits/stdc++.h>
using namespace std;
typedef struct node
{
	char str[10001];
	int time;
}NODE,*PNODE;
NODE arr[10001]; 
int main()
{
	int i,n,ans=0,flag=0;
	char c[5001];
	scanf("%d",&n);
	for(i=1;i<=n;i++)
		scanf("%s %d",&arr[i].str,&arr[i].time);
	scanf("%s",&c);
	for(i=1;i<=n;i++)
	{
		if(flag)
			ans+=arr[i].time;
		if(strcmp(c,arr[i].str)==0)
			flag=1;
	}
	printf("%d",ans);
	return 0;
}

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

int main(){
	string today;

	cin >> today;
	if(today[0] == 'S'){
		cout << "Cloudy";
	}
	else if(today[0] == 'C'){
		cout << "Rainy";
	}
	else if(today[0] == 'R'){
		cout << "Sunny";
	}

	return 0;
}


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

#define pout(n)  printf ("%d\n", n)
#define rep(i,a,n) for (int i = a;i < n;i++)
#define per(i,n,a) for (int i = n-1;i >= a;i--)
 
typedef long long ll;
using namespace std;
 
int main (){
  string s;
  cin >> s;

  rep(i,0,s.length()){
    rep(j,i+1,s.length()){
      if(s[i] == s[j]){
        puts("no");
        return 0;
      }
    }      
  }
  puts("yes");
  return 0;
}

Measured memory_bytes: 256
import java.io.InputStream;
import java.io.PrintStream;
import java.util.*;

public class Main {

    public static void main(String[] args) {
        solve(System.in, System.out);
    }

    static void solve(InputStream is, PrintStream os) {
        Scanner sc = new Scanner(is);
        /* read */
        int n = sc.nextInt();

        Map<Integer, Set<Integer>> lists = new HashMap<>();

        for (int i = 0; i < n; i++) {
            String s = sc.next();
            Set<Integer> list = new HashSet<>();

            for (int j = 0; j < n; j++) {
                if (s.charAt(j) == '1') {
                    // matrix[i][j] = true;
                    list.add(j);
                }
            }
            lists.put(i, list);
        }

        int max = -1;
        for (int i = 0; i < n; i++) {
            max = Math.max(depth(i, lists, n), max);
        }

        os.println(max);
    }

    private static class Node {
        int node;
        Set<Integer> parents = new HashSet<>();
    }

    private static int depth(int start, Map<Integer, Set<Integer>> lists, int N) {
        HashMap<Integer, HashSet<Integer>> tempLists = new HashMap<>();
        for (int j = 0 ; j < N ; j++) {
            tempLists.put(j, new HashSet<>(lists.get(j)));
        }
        Set<Integer> visited = new HashSet<>();
        Set<Integer> firstGp = new HashSet<>();
        firstGp.add(start);

        int count = 0;
        while (!firstGp.isEmpty()) {
            count++;
            Set<Integer> next = new HashSet<>();
            for (Integer n : firstGp) {
                visited.add(n);
                for (int nx : tempLists.get(n)) {
                    if (visited.contains(nx)) {
                        // visiting again
                        return -1;
                    }
                    next.add(nx);
                }
            }
            for (Integer n : firstGp) {
                for(Integer child : next) {
                    tempLists.get(child).remove(n);
                }
            }
            firstGp.clear();
            firstGp.addAll(next);
        }
        return count;
    }
}

Measured memory_bytes: 161604
#include <iostream>

using namespace std;
typedef long long ll;
string s;

void solve () {
  ll maxK0 = s.size();
  ll maxK1 = s.size();
  for (ll i=0;i<s.size();i++) {
    if (s[i] == '1') {
      maxK0 = min(maxK0, max<ll>(i, s.size() - i - 1));
    } else {
      maxK1 = min(maxK1, max<ll>(i, s.size() - i - 1));
    }
  }
  cout << max(maxK0, maxK1) << endl;
}

int main() {
  cin >> s;
  solve();
}


Measured memory_bytes: 512
import sys
n=int(input())
b=list(map(int,input().split()))
a=[b[0]]*n
if n==2:
  print(2*b[0])
  sys.exit()
for i in range(1,n-1):
  if a[i]>b[i]:
    a[i]=b[i]
  else:
    a[i]=a[i]
  a[i+1]=b[i]
print(sum(a))
    
    

Measured memory_bytes: 3064
// 0229
#include <iostream>
using namespace std;

int main(){
	while(1){
		int b, r, g, c, s, t;
		int medal, bonus;

		cin>>b>>r>>g>>c>>s>>t;
		if(b == 0 && r == 0 && g == 0 && c == 0 && s == 0 && t == 0)
			break;

		bonus = b*5 + r*3;

		medal = 100 - (t-bonus-s)*3 + bonus*13 + 15*(b+r) + 7*g + 2*c;

		cout<<medal<<endl;
	}
	return 0;
}

Measured memory_bytes: 1156
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    int n = Integer.parseInt(in.readLine());
    int a = Integer.parseInt(in.readLine());
    System.out.println(n%500<=a?"Yes":"No");
  }
}

Measured memory_bytes: 32576
import java.util.*;
import java.lang.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a = sc.nextInt();
		int[] x = new int[n + 1];
		int max = a;
		for (int i = 1; i <= n; i++) {
			x[i] = sc.nextInt();
			max = Math.max(max, x[i]);
		}
		long[][][] dp = new long[n + 1][n + 1][n * max + 1];
		for (int i = 0; i <= n; i++) {
			dp[i][0][0] = 1;
		}
		for (int i = 1; i <= n; i++) {
			for (int j = 1; j <= n; j++) {
				for (int k = 0; k <= n * max; k++) {
					if (k - x[i] < 0) {
						dp[i][j][k] = dp[i - 1][j][k];
					} else if (j > 0 && k - x[i] >= 0) {
						dp[i][j][k] = dp[i - 1][j][k] + dp[i - 1][j - 1][k - x[i]];
					}
				}
			}
		}
		long sum = 0;
		for (int i = 1; i <= n; i++) {
			sum += dp[n][i][i * a];
		}
		System.out.println(sum);
	}
}

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

#define lli long long int
#define ld long double
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define pf push_front
#define ff first
#define ss second
#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))

////////////////////////////////////////////////////////    By: Umang Srivastava

// lli extgcd(lli a, lli b, lli *x , lli *y)
// {
//   if(a==0)
//   {
//     *x=0;
//     *y=1;
//     return b;
//   }
//   lli x1 , y1;
//   lli gcd = extgcd(b%a , a , &x1 , &y1);
//   *x=y-(b/a)*x1;
//   *y=x1;
//   return gcd;
// }

// lli modinv(lli a, lli m)
// {
//   lli x,y;
//   lli g = extgcd(a,m,&x,&y);
//   if(g!=1)
//     return -1;
//   return (x%m+m)%m;
// }

// lli moddiv(lli a, lli b, lli m)
// {
//   a=a%m;
//   lli inv = modinv(b,m);
//   if(inv!=-1)
//     return ((a*inv + m)%m);
//   else
//     return -1;
// }

// lli binpow(lli a, lli b, lli m)
// {
//  lli res=1;
//  a=a%m;
//  while(b>0)
//  {
//    if(b & 1)
//    {
//      res = (res * a)%m;
//    }
//    b=b>>1;
//    a=(a*a)%m;
//  }
//  return res;
// }

// lli gcd(lli a, lli b)
// {
//     // if(b<a)
//     // {
//     //     lli t=a;
//     //     a=b;
//     //     b=t;
//     // }
//     if(a==0)
//         return b;
//     return gcd(b%a,a);
// }

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

int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  lli t,i,j,f=0,n=0;
  lli ar[1000001]={0};
  for(i=1;i<=1000000;i++)
  {
  	for(j=i;j<=1000000;j+=i)
  	{
  		ar[j]++;
  	}
  }
  cin>>n;
  lli ans=0;
  for(j=1;j<n;j++)
  {
  	ans+=ar[j];
  	// cout<<j<<" = "<<ar[j]<<endl;
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 11436
#include <iostream>
using namespace std;
 
int main() {
    int N;

    cin >> N;

    int ans[10100];

    for (int i = 0; i < 10100; i++) {
        ans[i] = 0;
    }

    int v;

    for (int x = 1; x <= 100; x++) {
        for (int y = 1; y <= 100; y++) {
            for (int z = 1; z <= 100; z++) {
                v = x*x + y*y + z*z + x*y + y*z + z*x;

                if (v < 10100) {
                    ans[v] += 1;
                }
            }
        }
    }

    for (int i = 1; i <= N; i++) {
        cout << ans[i] << endl;
    }
}

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

#define pb push_back
#define all(v) (v).begin() , (v).end()
#define popcnt(x) __builtin_popcount(x)
#define inf 0x3f3f3f3f
#define watch(x) cout << (#x) << " is " << (x) << endl
#define rand() (rand() << 15 | rand())
using namespace std;
//using namespace __gnu_pbds;

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

typedef long long  ll;
#define EPS 1e-9
#define PI acos(-1.0)
const int MOD = 1e9 + 7;

int mul(int a , int b , int m = MOD){
   return (1LL * (a % m) * (b % m)) % m;
}

int add(int a , int b , int m = MOD){ // moded
   a += b;
   while(a >= MOD)a -= MOD;
   while(a < 0) a += MOD;
   return a;
}

int powMOD(int x , int n , int m = MOD){
   if(!n)return 1;
   int ret = 1;
   if(n & 1)ret = mul(x , powMOD(x , n - 1 , m) , m);
   else{
      int y = powMOD(x , n / 2 , m);
      ret = mul(y , y , m);
   }
   return ret;
}

int main() {
   ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
   int n, k;
   cin >> n >> k;

   vector<int> ways(k + 1, 0);
   for (int i = k; i >= 1; --i) {
      ways[i] = powMOD(k / i , n);
      for (int j = 2 * i; j <= k; j += i) {
         if((int)k / j == 0)break;
         ways[i] = add(ways[i] , -ways[j]);
      }
   }

   int ans = 0;
   for(int i = 1 ; i <= k ; ++i)
      ans = add(ans , mul(ways[i] , i));
   cout << ans << "\n";
}

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

using namespace std;
using ll=long long;
using ld=long double;
using P=pair<ll,ll>;
#define FOR(i,n,m) for(ll i=n; i<(ll)m;i++)
#define FORr(i,n,m) for(ll i=n; i>(ll)m; i--)
#define FORm(i,m) for(auto i=m.begin();i!=m.end();i++)
#define VEC2(x,a,b) vector<vector<ll>> x = vector<vector<ll>>(a,vector<ll>(b,0))
#define sortAl(v) sort(v.begin(),v.end())
#define sortAlr(v) sort(v.begin(),v.end()); reverse(v.begin(),v.end())
#define cinv(v,n,m) FOR(i,n,m) cin>>v.at(i)
#define coutv(v,n,m) FOR(i,n,m) cout<<v.at(i) <<" "; cout<<endl
#define cout(n) cout<<fixed<<setprecision(n)
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  ll n;
  cin>>n;
  while(n>0){
    vector<ll> dp(1<<n,1e9);
    VEC2(v,n,n+1);
    FOR(i,0,n){
      FOR(j,0,n+1){
        cin>>v[i][j];
      }
    }
    dp[0]=0;
    for(ll i=0;i<1<<n;i++){
      FOR(j,0,n){
        if(i&1<<j)continue;
        ll m=v[j][0];
        FOR(k,1,n+1){
          if(i&1<<(k-1))m=min(v[j][k],m);
          //cout<<i<<" "<<j<<" "<<k<<endl;
        }
        dp[i|1<<j]=min(dp[i|1<<j],dp[i]+m);
      }
    }
    cout<<dp[(1<<n)-1]<<endl;
    cin>>n;
  }
}



Measured memory_bytes: 3744
#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <cstdlib>
#include <algorithm>
using namespace std;

static int n;
static int m;
static int d[1000];

int main()
{
	for (;;) {
		scanf("%d%d", &n, &m);
		if (n == 0 && m == 0) {
			break;
		}
		fill(d, d + n, 0);

		for (int i = 0; i < m; ++i) {
			for (int j = 0; j < n; ++j) {
				int e;
				
				scanf("%d", &e);
				d[j] += e;
			}
		}
		printf("%d\n", *max_element(d, d + n));
	}

	return EXIT_SUCCESS;
}



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

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

    vector<ll> L(n + 1);
    L[0] = 2;
    L[1] = 1;

    for(int i = 2; i <= n; i++) {
        L[i] = L[i - 1] + L[i - 2];
    }
    cout << L[n] << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define ld long double
const ll MOD = 998244353;
const ll INF = 1e18;
using namespace std;


main(){    
    #ifdef XOX
        freopen("D:\\V S Code\\cpp\\competitiveProgramming\\Input.txt", "r", stdin);
        freopen("D:\\V S Code\\cpp\\competitiveProgramming\\OPT.txt", "w", stdout);
    #endif

    ios::sync_with_stdio(!cin.tie(NULL));
    
    string s, t;
    cin >> s >> t;
    int n = s.length();
    int cnt = 0;
    for(int i = 0; i < n; i++) {
        cnt += (s[i] != t[i]);
    }

    cout << cnt;
}

Measured memory_bytes: 3772
#include <iostream>
#include <algorithm>
#include <climits>
#include <numeric>
#include <iomanip>
#include <cmath>
#include <vector>
#include <set>
#include <unordered_set>
#include <string>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <unordered_map>
 
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define cina(s, n, a) for(int i = s; i < n; i++) cin >> a[i]
#define couta(n, a) for(int i = 0; i < n; i++) cout << a[i] << ' '
#define copy(s, n, a, b) for(int i = s; i < n; i++) b[i] = a[i]
#define yesno(ok) cout << (ok ? "YES" : "NO")
#define mod(a, b) (b + (a % b)) % b
#define MOD  (int)1e9 + 7
 
typedef long long ll;
typedef unsigned long long ull;
typedef std::vector<int> vi;
typedef std::pair <int, int> pii;
typedef std::pair <ll, ll> pll;
typedef std::vector<pii> vpii;
using namespace std;
 
void solve(){
    ll x, y;
    cin >> x >> y;
    if(abs(x - y) > 2019){
        cout << 0;
    }
    else{
        ll ans = INT_MAX;
        for(ll i = x; i <= y; i++){
            for(ll j = x; j <= y; j++){
                if(i != j) ans = min(ans, (i * j) % 2019);
            }
        }
        cout << ans;
    }
    
}
 
int main(){
    ios::sync_with_stdio(false);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int q = 1;
    //cin >> q;
    for(int i = 1; i <= q; i++){
        solve();
    }
}
 


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

int a[100];
signed main(){
	int k;
	scanf("%lld", &k);
	printf("50\n");
	int p = k/50, mod = k%50;
	for(int i = 0;i < 50;i++){
		a[i] = 49+p;
		if(i < mod)a[i]++;
		else a[i]-=mod;
	}
	printf("%lld", a[0]);
	for(int i = 1;i < 50;i++)printf(" %lld", a[i]);
	printf("\n");
	return 0;
}

Measured memory_bytes: 256
import sys

input = sys.stdin.readline


def ii():
    return int(input())


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


A, B = il()
c = 0
for i in range(A, B + 1):
    s = str(i)
    if s[0] == s[-1] and s[1] == s[-2]:
        c += 1
print(c)


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

int main() {
  int n;

  cin >> n;

  vector<int> memo(26);

  string s;
  cin >> s;

  for (int i = 0; i < (int)s.size(); i++) {
    memo[s[i] - 97]++;
  }

  for (int i = 1; i < n; i++) {
    cin >> s;

    vector<int> kari(26);

    for (int i = 0; i < (int)s.size(); i++) {
      kari[s[i] - 97]++;
    }

    for (int i = 0; i < 26; i++) {
      memo[i] = min(memo[i], kari[i]);
    }
  }

  int i = 0;
  while (i < 26) {
    while (memo[i] > 0) {
      char c = i + 97;
      cout << c;
      memo[i]--;
    }
    i++;
  }
  return 0;
}

Measured memory_bytes: 256
import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String a[] = S.split("");

		int s[] = new int[3];
		for (int i=0;i<3;i++) {
			s[i]=Integer.parseInt(a[i]);
		}
		int cnt = 0;
		for (int i=0;i<3;i++) {
			if (s[i]==1) {
				cnt++;
			}
		}
		System.out.println(cnt);
	}
}

Measured memory_bytes: 21716
#include <bits/stdc++.h>
using namespace std;
const  int maxn = 1e6 + 5;
typedef long long ll;
const ll inf = 1e18;
ll w[maxn], v[maxn];
ll dp[maxn];
int main() {
//    freopen("in.in", "r", stdin);
    int n, V;
    cin >> n >> V;
    for (int i = 1; i <= n; i++) {
        cin >> v[i] >> w[i];
    }
    int W = 1e5;
    for (int i = 1; i <= W; i++) dp[i] = inf;
    for (int i = 1; i <= n; i++) {
        for (int j = W; j >= w[i]; j--) {
            dp[j] = min(dp[j], dp[j - w[i]] + v[i]);
        }
    }
    ll ans = 0;
    for (int i = 1; i <= W; i++) {
        if (dp[i] <= V) {
            ans = i;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 5120
#include<bits/stdc++.h>
using namespace std;
const int N=1<<10;
int n,m;
char a[N][N];
void solve(int x)
{
    int now=1;x=(1<<x)-1;
    a[1][1]='1';
    while(now<x)
    {
        int nx=now*2+1;
        for(int i=1;i<=now;i++)
            for(int j=1;j<=now;j++)
            a[i+now+1][j+now+1]=a[i+now+1][j]=a[i][j+now+1]=a[i][j];
        for(int j=1;j<=nx;j++)
            a[now+1][j]='1';
        now=nx;
    }
}
int main()
{
    memset(a,'0',sizeof(a));
    scanf("%d%d",&n,&m);
    if(n>m)
    {
        solve(n);
        for(int i=1;i<=(1<<n)-1;i++)
        {
            for(int j=1;j<=(1<<m)-1;j++)
                putchar(a[i][j]);
            putchar('\n');
        }
    }
    else
    {
        solve(m);
        for(int i=1;i<=(1<<n)-1;i++)
        {
            for(int j=1;j<=(1<<m)-1;j++)
                putchar(a[j][i]);
            putchar('\n');
        }
    }
}


Measured memory_bytes: 2304
#include <iostream>
#include <string.h>
using namespace std;

int main() {
	int a, b;

	cin >> a >> b;

	int diff = b - a;

	int sum = 0;
	int x = 1;
	while(1) {
		if( x >= diff ) {
			break;
		}
		sum += x;
		x++;
	}

	cout << sum - a << "\n";

	return 0;
}


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

int main() {
  int N,counter =1;
  
  cin >> N;
  
  // 配列で初期化
  vector<int> vec(N);

  // N個の入力を受け取る
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  
  //小さい順にソート
  sort(vec.begin(),vec.end());
  
  //小さくなった時にcounterを増やす
  for (int i = 1; i < N; i++) {
    if(vec.at(i-1)<vec.at(i))
      counter++;
  }
  
  cout << counter << endl;

}


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

#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define mp make_pair
#define pb push_back
#define each(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define dbg(x) cerr<<__LINE__<<": "<<#x<<" = "<<(x)<<endl

using namespace std;

typedef unsigned long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
const int inf = (int)1e9;
const double INF = 1e12, EPS = 1e-9;

int N, p, q;
ll A[2000][2000], B[2000][2000];
int la[2000], ra[2000];
int lb[2000], rb[2000];

void input(int n, ll a[2000][2000], int *l, int *r){
	
	rep(i, 2000) rep(j, 2000) a[i][j] = 0;
	
	rep(i, 2 * n - 1){
		int len = i < n ? n + i : 3 * n - i - 2;
		int ofs = i < n ? 0 : i - n + 1;
		
		l[i] = ofs;
		r[i] = ofs + len;
		
		rep(j, len){
			int t; scanf("%d", &t);
			
			if(t) rep(k, 60){
				if(ofs + j - k < 0) break;
				a[i][ofs + j - k] |= 1ull << k;
			}
		}
	}
	//rep(i, 2 * n - 1) rep(j, 2 * n - 1) cerr<<(a[i][j]&1)<<(j==2*n-2?"\n":" ");
}

int main(){
	
	scanf("%d%d%d", &N, &p, &q);
	
	input(N, A, la, ra);
	while(q--){
		input(p, B, lb, rb);
		
		bool found = 0;
		
		rep(i, 2 * N - 1) for(int j = la[i]; j < ra[i]; j++){
			
			bool ok = 1;
			
			rep(k, 2 * p - 1){
				
				int len = rb[k] - lb[k];
				int pos = 0;
				
				if(ra[i + k] - j < len){
					ok = 0;
					break;
				}
				
				rep(it, 2){
					
					int clen = min(60, len);
					
					ll x = A[i + k][j + lb[k] + pos] & (1ull << clen) - 1ull;
					ll y = B[k][lb[k] + pos] & (1ull << clen) - 1ull;
					
					/*
					if(i == 2 && j == 1){
						dbg(it); dbg(x); dbg(y);
					}
					*/
					if(x != y){
						ok = 0;
						break;
					}
					
					len -= clen;
					pos += clen;
					if(len <= 0) break;
				}
				if(!ok) break;
			}
			if(ok){
				//cerr<<"i: "<<i<<" j: "<<j<<endl;
				found = 1;
				goto END;
			}
		}
		END:
		if(!found){
			cout << "NO" << endl;
			return 0;
		}
	}
	cout << "YES" << endl;
	
	return 0;
}


Measured memory_bytes: 63728
/* ex 5_4
   Jun_JPN */

#include <stdio.h>
#define LIMIT 16

int main(void){

    char gene[LIMIT];
    int i=0, cnt, ans=0;

    scanf("%s", gene);

    while(gene[i]){ // NULL文字まで
        cnt = 0;    // cntを0に初期化
        while(gene[i]=='A'||gene[i]=='G'||gene[i]=='C'||gene[i]=='T'){
            cnt++;
            i++;
        }
        ans = (cnt>ans) ? cnt : ans;    // cntがansより大きかったらansをindに更新
        i++;
    }

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

    return 0;
}

Measured memory_bytes: 1684
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <cstring>
#include <functional>
#include <queue>
#include <cmath>

using namespace std;

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

int N, K;
int A[100010];
int bit_counter[41];
int sum[41];

// 0-indexed sum[l, r]
int get_sum(int l, int r)
{
	return sum[r] - (l == 0 ? 0 : sum[l-1]);
}

signed main()
{
	cin >> N >> K;

	int left = -1;
	rep(i, 40) if (K & (1ll << i)) left = i;

	rep(i, N) cin >> A[i];

	if (left == -1) {
		int ans = 0;

		rep(i, N) ans += A[i]^0;

		cout << ans << endl;

		return 0;
	}

	rep(i, N) {
		rep(j, 40) {
			if(A[i] & (1ll << j)) {
				bit_counter[j]++;
			}
		}
	}

	rep(i, 40) {
		sum[i] = max(bit_counter[i], (N - bit_counter[i])) * (1ll << i);
		if (i) sum[i] += sum[i-1];
	}

	int a = 0;
	for (int i = 40; i > left; --i) {
		a += bit_counter[i] * (1ll << i);
	}

	int ans = a;
	for (int i = left; i >= 0; --i) {
		if (K & (1ll << i)) {
			ans = max(ans, a + bit_counter[i] * (1ll << i) + get_sum(0, i-1)); // not use
			a += (N - bit_counter[i]) * (1ll << i);
		} else {
			a += bit_counter[i] * (1ll << i);
		}

		ans = max(ans, a);
	}

	cout << ans << endl;
}


Measured memory_bytes: 1024
use std::io::prelude::*;

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

fn main() {
    let s = input::<String>().chars().collect::<Vec<char>>();
    let k = input::<usize>();

    let mut set = std::collections::HashSet::new();
    for c in 'a' as u8..'z' as u8 + 1 {
        for i in 0..s.len() {
            if s[i] as u8 == c {
                for j in 1..6 {
                    if i + j <= s.len() {
                        set.insert(s[i..i + j].iter().cloned().collect::<String>());
                    }
                }
            }
        }

        if set.len() >= k {
            break;
        }
    }

    let mut v = set.iter().cloned().collect::<Vec<String>>();
    v.sort();
    println!("{}", v.iter().nth(k - 1).unwrap());
}


Measured memory_bytes: 4352
#include <iostream>
#include <set>
#include <vector>
#include <string>
#include <algorithm>
#include <iterator>
#include <map>
#include <utility>
#include <list>
#include <climits>
#include <bitset>

using namespace std;

#define rep(i, n) for(int i = 0; i < n; i++)
#define repi(i, n) for(auto i = (n).begin(); i != (n).end(); i++)
#define in_arr(type, a, n) copy_n(istream_iterator<type>(cin), n, (a).begin());
#define ll long long int

int main(){
    int a, b, c, x, y;
    cin >> a >> b >> c >> x >> y;
    c *= 2;
    ll sum = 0;
    if(c <= a && c <= b){
        cout << max(x, y) * c << endl;
    }else if(c <= a){
        cout << x * c + max(y - x, 0) * b << endl;
    }else if(c <= b){
        cout << max(x - y, 0) * a + y * c << endl;
    }else if(a + b <= c){
        cout << a * x + b * y << endl;
    }else if(x < y){
        cout << x * c + (y - x) * b << endl;
    }else{
        cout  << y * c + (x - y) * a << endl;
    }
    return 0;
}


Measured memory_bytes: 256
n = int(input())
 
def is_product_of_two_digits(n):
  for i in range(1, 10):
    if n % i == 0 and 1 <= n // i <= 9:
      return True
  return False
    
if is_product_of_two_digits(n):
  print('Yes')
else:
  print('No')
  

Measured memory_bytes: 2940
#include <stdio.h>
#include <string.h>
#include <math.h>
#define lop(i, n) for(i=0; i<=n; i++)

int main()
{
	int a, b, c;
	
	scanf("%d %d %d", &a, &b, &c);
	int d=c-a+b;
	
	printf("%d", (d>0)?(d):0);
	
	return 0;
}

Measured memory_bytes: 128
#include<iostream>
using namespace std;
int main(){
	int a,b,c;
	cin >> a >> b >> c;
	if(a>b)swap(a,b);
	if(b>c)swap(b,c);
	if(a>b)swap(a,b);
	cout << a << " " << b << " " << c << endl;
	return 0;
}

Measured memory_bytes: 3092
#include <stdio.h>
struct C{
  int num;
  char c;
};

int main(){

  int n,i,j,tmp,min,flag=0;
  char tmpc;
  struct C card[36],out2[36];

  scanf("%d",&n);

  for(i=0;i<n;i++){
    scanf(" %c%d",&card[i].c,&card[i].num);
    out2[i].c=card[i].c;
    out2[i].num=card[i].num;
  }

  for(i=0;i<n;i++){
    for(j=n-1;i<j;j--){
      if(card[j].num < card[j-1].num){
	tmp=card[j].num;
	tmpc=card[j].c;
	card[j].num=card[j-1].num;
	card[j].c=card[j-1].c;
	card[j-1].num=tmp;
	card[j-1].c=tmpc;
      }
      
    }
  }

  for(i=0;i<n;i++){
    if(i==0) printf("%c%d",card[i].c,card[i].num);
    else printf(" %c%d",card[i].c,card[i].num);
    }
  printf("\n");

  printf("Stable\n");
 


  for(i=0;i<n;i++){
    min=i;
    for(j=i;j<n;j++){
      if(out2[j].num < out2[min].num) min=j;

      
    }
      tmp=out2[min].num;
      tmpc=out2[min].c;
      out2[min].num=out2[i].num;
      out2[min].c=out2[i].c;
      out2[i].num=tmp;
      out2[i].c=tmpc;
      
    
  }

  for(i=0;i<n;i++){
    if(i==0) printf("%c%d",out2[i].c,out2[i].num);
    else printf(" %c%d",out2[i].c,out2[i].num);

    if(out2[i].c!=card[i].c) flag=1;
     
    else if(out2[i].num!=card[i].num) flag=1;
  }
  printf("\n");

 if(flag==0) printf("Stable\n");
 else printf("Not stable\n");


  return 0;
}

Measured memory_bytes: 612
#include <iostream>
#include<vector>
using namespace std;
int main()
{
    int a,h,t;
    
    cin>>a;cin>>h;
    int d=0;
    for(int i=0;i<h;i++){
        cin>>t;d+=t;
        if(d>a){cout<<"-1"; return 0;}
    }
    
    cout<<a-d;
    return 0;
}

Measured memory_bytes: 3648
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define M 1000000007

int main()
{
    int n,a,b;
    cin >> n;
    if(n==1) cout << "Hello World" << "\n";
    else 
    {
        cin >> a >> b;
        cout << a+b << "\n";
    }
    return 0;
}

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

typedef long long int ll;
#define MAXN 10010

int N, W;
int w[110], v[110];
ll dp[110][MAXN];

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

	cin >> N >> W;	
	for (int i = 1; i <= N; i++)
		cin >> w[i] >> v[i];

	for (int i = 1; i <= N; i++)
		for (int j = W; j >= 0; j--)
			if (j-w[i] >= 0)
				dp[i][j] = max(dp[i-1][j], dp[i-1][j-w[i]] + v[i]);
			else
				dp[i][j] = dp[i-1][j];

	cout << dp[N][W] << endl;
	
	return 0;
}


Measured memory_bytes: 8832
A = [0]*9
A[0], A[1], A[2] = map(int, input().split())
A[3], A[4], A[5] = map(int, input().split())
A[6], A[7], A[8] = map(int, input().split())
N = int(input())
B = [0]*N
for i in range(N):
    B[i] = int(input())
if A[4] in B:
    if A[0] in B and A[8] in B:
        print("Yes")
        exit()
    if A[2] in B and A[6] in B:
        print("Yes")
        exit()
    if A[1] in B and A[7] in B:
        print("Yes")
        exit()
    if A[3] in B and A[5] in B:
        print("Yes")
        exit()
if A[0] in B and A[1] in B and A[2] in B:
    print("Yes")
    exit()
if A[6] in B and A[7] in B and A[8] in B:
    print("Yes")
    exit()
if A[0] in B and A[3] in B and A[6] in B:
    print("Yes")
    exit()
if A[2] in B and A[5] in B and A[8] in B:
    print("Yes")
    exit()

print("No")

Measured memory_bytes: 38256
#coding=UTF-8

mozir=input()
hyo=mozir.split(' ')
N=int(hyo[0])
ans_nth=int(hyo[1])

hai=[]
for idx in range(0,N,1):
    mozir=input()
    hyo=mozir.split(' ')
    entr=tuple([int(mono) for mono in hyo])
    hai.append(entr)

#print(hai)
kirei_hai=sorted(hai,key=lambda po:po[0])
#print(kirei_hai)

ans_ent_ichi=-1
tmp_nth=0
#初期値はめり込んでいる

while tmp_nth < ans_nth:
    ans_ent_ichi+=1
    tmp_nth=tmp_nth+kirei_hai[ans_ent_ichi][1]

print(kirei_hai[ans_ent_ichi][0])


Measured memory_bytes: 19020
"use strict";
function main(input) {
  let a = 0;
  let b = 0;
  let c = 0;
  let d = 0;
  [a,b,c,d] = input[0].trim().split(" ").map(i => parseInt(i));

  let ta = Math.floor(a/d) + ((a%d===0)?0:1);
  let tb = Math.floor(c/b) + ((c%b===0)?0:1);

  console.log((ta<tb)?"No":"Yes");
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"));


Measured memory_bytes: 29624
#include <iostream>
#include <string>
#include <math.h>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <set>
#include <queue>
#include <map>
using namespace std;

#define mod 1000000007
#define ten5 100005
#define PI 3.1415926

typedef long long LL;


int num[15];

int main()
{
    //int m,n,o=0,i,j,k;
    long long int sum=0,sum2=0,n1=0,n2=0,n3;
    double ans=0.0,half;
    long long int m,n,o,i,j,k=1,now=1;
    long long int a,a1,a2,a3,a4;
    //float f,g,h;
    char c;
    string s,s1;
    priority_queue<long long int> pq;
    vector<long long int> vint;
    //map<string,int> mp;
    //map<string,int>::iterator iter;
    cin>>s;
    cin>>s1;
    s.append(s);
    if(s.find(s1,0)<s1.size()) cout<<"Yes";
    else cout<<"No";
    return 0;
}



Measured memory_bytes: 256
M=1e9+7;long f[1<<17];i;main(n,m){for(*f=1;++i<1<<17;)f[i]=i*f[i-1]%M;scanf("%d%d",&n,&m);i=abs(n-m);printf("%d",(i>2?0:2-i)*f[n]*f[m]%M);}

Measured memory_bytes: 1152
#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;
#define DEBUG
#ifdef DEBUG
#define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
	template <typename Arg1>
	void __f(const char* name, Arg1&& arg1){
		cerr << name << " : " << arg1 << std::endl;
	}
	template <typename Arg1, typename... Args>
	void __f(const char* names, Arg1&& arg1, Args&&... args){
		const char* comma = strchr(names + 1, ','); cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
	}
#else
#define debug(...)
#endif
#define FOR(i,a,b) 	for(ll i=a;i<b;++i)
#define RFOR(i,a,b) 	for(int i=a;i>=b;--i)
#define ln 		"\n"
#define mp make_pair
#define pb push_back
#define sz(a)	ll(a.size())
#define F first
#define S second
#define all(c)	c.begin(),c.end()
#define rall(c) c.rbegin(), c.rend()
#define trace(c,x) for(auto &x:c)
#define pii pair<ll,ll>
#define init(a, x) memset(a,x,sizeof(a))
typedef long long ll;
typedef long double ld;
typedef	priority_queue<pii,std::vector<pii>,greater<pii> > revpr;

typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> pbds;
// ordered_set X
//K-th smallest
//*X.find_by_order(k-1)
//NO OF ELEMENTS < A
//X.order_of_key(A)
const int L=1e6+7;
map<ll,ll> counter;
ll m = 1e9 + 7;
ll fastexpo(ll x,ll y)
{
	ll temp=1;
	while(y>0)
	{
		if(y&1)temp = ((temp%m)*(x%m))%m;
		x = ((x%m)*(x%m))%m;
		y>>=1;
	}return temp;
}
ll p2[L], p8[L], fact[L];
ll get(ll n, ll x)
{
	if(x>n)return 0;
	ll num = fact[n];
	ll den = fact[x];
	den *= fact[n-x];
	den %= m;
	return (num * fastexpo(den, m-2))%m;
}
void fff()
{
	ll n;
	cin >> n;
	if(n<2)
	{
		cout << 0 << ln;
		return;
	}
	p2[0] = p8[0] = 1;
	fact[0] = 1;
	FOR(i,1,n+1)
	{
		fact[i] = (fact[i-1]*i)%m;
		p2[i] = (p2[i-1]*2LL)%m;
		p8[i] = (p8[i-1]*8LL)%m;
	}
	ll ans = 0, tmp;
	FOR(i,2,n+1)
	{
		tmp = ((p2[i]-2)%m * p8[n-i])%m;
		tmp = (tmp * get(n,i));
		tmp %= m;
		// debug(i,tmp);
		ans = (ans + tmp)%m;
	}
	cout << ans << ln;
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	//int t;cin >> t;while(t--)
	fff();
	return 0;
}

Measured memory_bytes: 26928
#include <stdio.h>
#include <math.h>

#define PI (3.14159265358979)
#define deg2rad(_a) ((_a) / 180.0 * PI)

int
main(void)
{
	char line[80];
	int h;
	int r;
	double s = 0.0;
	double x = 0.0;
	double y = 0.0;

	while (fgets(line, sizeof line, stdin)) {
		if (sscanf(line, "%d,%d", &h, &r) == 2) {
			if (h == 0 && r == 0) {
				break;;
			}

			x += sin(deg2rad(s)) * (double)h;
			y += cos(deg2rad(s)) * (double)h;

			s += r;
			if (s > 180.) {
				s -= 360.0;
			} else if (s < -180.) {
				s += 360.0;
			}
		}
	}

	printf("%d\n%d\n", (int)x, (int)y);

	return 0;
}

Measured memory_bytes: 1048
N = int(input())
A = [int(a) for a in input().split()]
ma = -1
mai = -1
for i in range(N):
    if abs(A[i]) > ma:
        ma = abs(A[i])
        mai = i

print(2*N-1)
for i in range(N):
    print(mai+1, i+1)
if A[mai] > 0:
    for i in range(N-1):
        print(i+1, i+2)
else:
    for i in range(N-1)[::-1]:
        print(i+2, i+1)

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

#ifdef _DEBUG
#define debug(x) cerr << "line: " << __LINE__ << ", func: " << __func__ << " ->  " << #x << " = " << x << endl
#else
#define debug(x)
#endif

#define all(s) begin(s), end(s)
#define rall(s) rbegin(s), rend(s)
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = ((a)-1); i >= (b); i--)
#define pb push_back
#define sz(a) int((a).size())
#define put(a) ((cout) << (a) << (endl))
#define putf(a, n) ((cout) << (fixed) << (setprecision(n)) << (a) << (endl))
#define deg2rad(x) (((x)*PI) / (180.0))
#define rad2deg(x) (((x) * (180.0)) / PI)

using namespace std;

using ll = long long;
using ull = unsigned long long;
using ld = long double;
using i_i = pair<int, int>;
using ll_ll = pair<ll, ll>;
using d_ll = pair<double, ll>;
using ll_d = pair<ll, double>;
using d_d = pair<double, double>;
template <class T> using vec = vector<T>;

static constexpr ll LL_INF = 1LL << 60;
static constexpr int I_INF = 1 << 28;
static constexpr double PI = static_cast<double>(3.14159265358979323846264338327950288);
static constexpr double EPS = numeric_limits<double>::epsilon();

static map<type_index, const char* const> scanType = {
    {typeid(int), "%d"}, {typeid(ll), "%lld"}, {typeid(double), "%lf"}, {typeid(char), "%c"}};

template <class T> static void scan(vector<T>& v);
[[maybe_unused]] static void scan(vector<string>& v, bool isWord = true);
template <class T> static inline bool chmax(T& a, T b);
template <class T> static inline bool chmin(T& a, T b);
template <class T> static inline T gcd(T a, T b);
template <class T> static inline T lcm(T a, T b);
template <class A, size_t N, class T> static void Fill(A (&arr)[N], const T& val);
template <class T> T mod(T a, T m);

int main(int argc, char* argv[]) {
  std::string S;
  std::cin >> S;

  ll ans = 0;
  rep(i, 1, sz(S)) {
    if (S[i] == S[i - 1]) continue;
    ans++;
  }
  put(ans);
  return 0;
}

template <class T> static void scan(vector<T>& v) {
  auto tFormat = scanType[typeid(T)];
  for (T& n : v) {
    scanf(tFormat, &n);
  }
}

static void scan(vector<string>& v, bool isWord) {
  if (isWord) {
    for (auto& n : v) {
      cin >> n;
    }
    return;
  }

  int i = 0, size = v.size();
  string s;
  getline(cin, s);

  if (s.size() != 0) {
    i++;
    v[0] = s;
  }

  for (; i < size; ++i) {
    getline(cin, v[i]);
  }
}

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

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

template <class T> inline T gcd(T a, T b) { return __gcd(a, b); }

template <class T> inline T lcm(T a, T b) {
  T c = min(a, b), d = max(a, b);
  return c * (d / gcd(c, d));
}

template <class A, size_t N, class T> void Fill(A (&arr)[N], const T& val) {
  std::fill((T*)arr, (T*)(arr + N), val);
}

template <class T> T mod(T a, T m) { return (a % m + m) % m; }


Measured memory_bytes: 512
#include <iostream>
#include <bits/stdc++.h>
#include <math.h>
#include <stdio.h>
#include <algorithm>
using namespace std;
#define rep(i,n) for(int i = 0; i < n;i++)
#define ll long long
int main(){
  int n;cin>>n;
  string s;cin>>s;
  string t;
  string ans="No";
  if(n%2==0)
  {
    for(int i=0;i<n/2;i++)
    {
      t+=s.at(i);
    }
  }
  if(t+t==s)
  {
    ans="Yes";
  }
  cout<<ans;
}
  
  
  


Measured memory_bytes: 256
using namespace std;
#include<bits/stdc++.h>
#define ll long long int
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin>>n;
    int l=n/500;
    int res=n%500;
    int p=res/5;
    cout<<l*1000+p*5;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
static const int MAX = 100000;

int countComb(int n, int x){
  int count = 0;
  for(int k=1; k<n-1; k++){
    for(int j=k+1; j<n; j++){
      for(int i=j+1; i<n+1; i++)
        if(i+j+k == x) count++;
    }
  }
  return count;
}

int main(){
  int num, n, x, count[MAX];
  for(int i=0; i<MAX; i++){
    cin >> n >> x;
    if(n == 0 && x == 0){
      num = i;
      break;
    }
    count[i] = countComb(n, x);
  }

  for(int i=0; i<num; i++)
    cout << count[i] << endl;
  return 0;
}



Measured memory_bytes: 3112
N = int(input())
XYH = []
for i in range(N):
  XYH.append(list(map(int,input().split())))
XYH.sort(key=lambda x: x[2], reverse=True)
#print(XYH)

# 与えられた情報のhiがすべて0ということはありえない。
# cx,cyを全探索し、与えられた情報がすべて矛盾がない場合を答えとして出力する。
x0,y0,h0 = XYH[0]
for cx in range(101):
  for cy in range(101):
    ch = h0 + abs(x0-cx) + abs(y0-cy)
    flag = True
    for i in range(1,N):
      x,y,h = XYH[i]
      if (h > 0 and ch != h + abs(x-cx) + abs(y-cy)) or (h == 0 and ch > h + abs(x-cx) + abs(y-cy)):
        flag = False
        break
    if flag:
      print(cx,cy,ch)
      exit()


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



using namespace std;

int main(){
	int n; cin >> n;
	long long int p; cin >> p;
	vector<int> a(n),t(n,-1);
	for(int i = 0; i < n; i++){
		cin >> a[i];
		--a[i];
	}
	int start = 0;
	int m_time = 0;
	t[start] = m_time++;
	int cycle_length = 0;
	vector<pair<int,int> > cycle;
	while(true){
		int prev = start;
		start = a[start];
		if(t[start]!=-1){
			cycle_length = t[prev] - t[start] + 1;
			for(int i = 0; i < n; i++){
				if(t[i] >= t[start]){
					cycle.push_back({t[i],i});
				}
			}
			break;
		}
		t[start] = m_time++;
		if(1ll * m_time==p+1){
			cout << start + 1 << "\n";
			return 0;
		}
	}
	p-=m_time - cycle_length;
	sort(cycle.begin(),cycle.end());
	p%=cycle_length;
	cout << cycle[p].second + 1 << "\n";
	return 0;
}


Measured memory_bytes: 6880
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

ll c[102][102],s[1020],e[1020],co[1020];

int main() {
	ll n,m;
	cin>>n>>m;
	for(int i=0;i<102;i++){
		for(int j=0;j<102;j++){
			c[i][j]=c[j][i]=inf;
		}
	}
	for(int i=0;i<m;i++){
		ll x,y,z;
		cin>>x>>y>>z;
		x--;y--;
		s[i]=x;
		e[i]=y;
		co[i]=z;
		c[x][y]=c[y][x]=z;
	}
	for(int k=0;k<n;k++){
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				c[i][j]=min(c[i][j],c[i][k]+c[k][j]);
			}
		}
	}
	ll ans=0;
	for(int i=0;i<m;i++){
		ll nows=s[i];
		ll nowe=e[i];
		ll nowcos=co[i];
		if(c[nows][nowe]!=nowcos){
			ans++;
		}
	}
	cout << ans;
	// your code goes here
	return 0;
}

Measured memory_bytes: 384