akhauriyash/Code-Regression huggingface dataset:
n,k,q=[int(_) for _ in input().split()]

a=[int(input()) for i in range(q)]

ans=[k-q for i in range(n)]

for a_ in a:
  ans[a_-1]+=1
  
for i in range(n):
  if ans[i]>0:
    print("Yes")
  else:
    print("No")

Measured memory_bytes: 11816
#include <bits/stdc++.h>
using namespace std;
const int INF=1001001001;
int main() {
    int n;
    cin>>n;
    vector<int>a(n);
    for(int i=0;i<n;i++)cin>>a[i];
    int pre=-999;
    for(int i=0;i<n;i++){
        if(pre<=a[i]-1){
            pre=a[i]-1;
        }else if(pre<=a[i]){
            pre=a[i];
        }else{
            cout<<"No"<<endl;
            return 0;
        }
    }
    cout<<"Yes"<<endl;
}

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

int main() {
	int n; cin >> n;
	int ans = 0;
	for (int i = 1; i < n + 1; i += 2) {
		int count = 0;
		for (int j = 1; j < n + 1; j += 2) {
			if (i % j == 0) count++;
		}
		if (count == 8) ans++;
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
# coding: utf-8

N, K, S = map(int, input().split())

if S < 10**9:
    for _ in range(K):
        print(S, end=" ")
    for _ in range(N-K-1):
        print(S+1, end=" ")
    if K != N:
        print(S+1)
else:
    for _ in range(K):
        print(S, end=" ")
    for _ in range(N-K-1):
        print(S-1, end=" ")
    if K != N:
        print(S-1)


Measured memory_bytes: 4212
N = int(input())
T, A = map(int, input().split(' '))
places = [int(x) for x in input().split()]

base_temperature = abs(A - (T - places[-1] * 0.006))
num = N

for i in range(N - 1):
    temperature = abs(A - (T - places[i] * 0.006))
    if base_temperature > temperature:
        base_temperature = temperature
        num = i + 1

print(num)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0;i < n;i++)
#define rev(i, n) for(int i = n;i >= 0;i--)
#define Rep(i, m, n) for(int i = m;i < n;i++)
#define repeatrev(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define INF 999999999
#define itn int
const int MAX = 510000;


using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;
typedef priority_queue<int> Pr;

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

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    int max_1 = 0;
    int first;
    cin >> first;
    int count = 0;
    rep(i, n - 1){
        int second;
        cin >> second;
        if(first >= second) count ++;
        else count = 0;
        if(count > max_1) max_1 = count;
        first = second;
    }
    cout << max_1 << endl;

}

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

int a,b,k,flag=0;
int main()
{

    
    cin>>k>>a>>b;
    rep(i,a,b)
    {
        if(i%k==0)
        {
            flag=1;
            break;
        }
        if(flag)
            break;
    }
    if(flag)
        cout<<"OK";
    else
        cout<<"NG";
}

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

using namespace std;

int main() {
    
    int A, B, ans=0;
    cin >> A >> B;

    for (int i = 0; i < 2; i++) {
        if (A > B) {
            ans += A;
            A--;
        }
        else {
            ans += B;
            B--;
        }
    }
    cout << ans;

    return 0;
}

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

using namespace std;

static const int INF = 1e9 + 7;

template<typename T>
using Vec = vector<T>;

template<typename T, typename T2>
using P = pair<T, T2>;

template<typename... Args>
using Tup = tuple<Args...>;

template<typename T>
using qp = priority_queue<T, Vec<T>, greater<T> >;

template<typename T>
using pq = priority_queue<T>;

using llong = long long;
using ullong = unsigned long long;
using uint = unsigned int;

template<typename T>
T gcd(T x, T y)
{
	return y ? gcd(y, x % y) : x;
}

void hawawa()
{
	int n, m, mod;
	cin >> n >> m;
	for (int i = m / n; i > 0; i--) {
		if (m % i == 0) {
			cout << i << "\n";
			return;
		}
	}
}


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


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.math.BigInteger;

public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		FastInput in = new FastInput(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		ABC175B solver = new ABC175B();
		solver.solve(1, in, out);
		out.close();
	}

	static class ABC175B {

		public void solve(int testNum, FastInput in, PrintWriter out) {
			
			int n = in.nextInt();
			
			int []a = in.nextIntArray(n);
			int cnt = 0;
			
			for(int i = 0 ; i < n ;i++) {
				for(int j = i ; j < n ;j++) {
					for(int k = j ; k < n ; k++) {
						if(a[i] != a[j] && a[j] != a[k] && a[k] != a[i]) {
							int c = Math.abs(a[j]-a[k]);
							int d = a[j] + a[k];
							if(c < a[i] && a[i] < d) {
								cnt++;
							}
						}
					}
				}
			}
			
			out.println(cnt);
		}
		}

	}
class FastInput{
	private final BufferedReader in;
	private String[] buff;
	private int index = 0;
	
	public FastInput(InputStream im) {
		in = new BufferedReader(new InputStreamReader(im));
	}
	String nextLine() {
		try {
			return in.readLine();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}
	String next() {
		while (buff == null || index >= buff.length) {
			buff = nextLine().split(" ");
			index = 0;
		}
		return buff[index++];
	}
	int nextInt() {
		return Integer.parseInt(next());
	}
	
	long nextLong() {
		return Long.parseLong(next());
	}
	
	Double nextDouble() {
		return Double.parseDouble(next());
	}
	
	BigInteger nextBigInteger() {
		return new BigInteger(next());
	}
	
	BigDecimal nextBigDecimal() {
		return new BigDecimal(next());
	}
	
	public int[] nextIntArray(final int n) {
		final int[] res = new int [n];
		
		for(int i = 0 ; i < n ;i++) {
			res[i] = nextInt();
		}
		return res;
	}
	
	public long[] nextLongArray(final int n) {
		final long[] res= new long [n];
		
		for(int i = 0 ; i < n ;i++) {
			res[i] = nextLong();
		}
		return res;
	}
	
	public double[] nextDoubleArray(final int n ) {
		final double[] res = new double [n];
		
		for(int i = 0 ; i < n ;i++) {
			res[i] = nextDouble();
		}
		return res;
	}
	
	
	public int[][] nextInt2DArray(final int n , final int m){
		int [][]res = new int [n][m];
		
		for(int i = 0 ; i < n ;i++) {
			for(int j = 0 ; j < m ;j++) {
				res[i][j] = nextInt();
			}
		}
		return res;
	}
	public long[][] nextLong2DArray(final int n , final int m){
		long [][]res = new long [n][m];
		
		for(int i = 0 ; i < n ;i++) {
			for(int j = 0 ; j < m ;j++) {
				res[i][j] = nextLong();
			}
		}
		return res;
	}
	
	public char[][] nextChar2DArray(final int n){
		char [][]res = new char [n][];
		
		for(int i = 0 ; i < n ;i++) {
			String s = next();
			res[i] = s.toCharArray();
		}
		
		return res;
	}
}



Measured memory_bytes: 32920
#ライブラリインポート
from collections import defaultdict

con = 10 ** 9 + 7
#入力受け取り
def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	N, P = getlist()
	S = list(input())

	#例外処理
	if P == 2:
		ans = 0
		for i in range(N):
			if int(S[i]) % 2 == 0:
				ans += i + 1
		print(ans)
		return

	if P == 5:
		ans = 0
		for i in range(N):
			if int(S[i]) % 5 == 0:
				ans += i + 1
		print(ans)
		return
	
	#計算
	D = defaultdict(int)
	D[0] = 1
	var = 0
	for i in range(N):
		var += pow(10, i, P) * int(S[N - 1 - i])
		var %= P
		D[var] += 1

	ans = 0
	for i in D:
		var = D[i]
		ans += int((var * (var - 1)) // 2)

	print(ans)

if __name__ == '__main__':
	main()

Measured memory_bytes: 61936
#include<bits/stdc++.h>
using namespace std;
int main(){
	string s,t;
	cin>>s>>t;
	for(int i=0;i<t.size();i++){
		cout<<s[i]<<t[i];
	}
	if(t.size()<s.size()) cout<<s[s.size()-1];
	puts("");
	return 0;
}


Measured memory_bytes: 256
"use strict";
    
const getGcd = input => {
  let len, a, b;
  len = input.length;
  a = input[ 0 ];
  
  for (let i = 1; i < len; i++) {
    b = input[ i ];
    a = gcdTwoNumbers( a, b );
  }
  
  return a;
}

const gcdTwoNumbers = (x, y) => {
  x = Math.abs(x);
  y = Math.abs(y);
  while(y) {
    let t = y;
    y = x % y;
    x = t;
  }
  return x;
}

const main = arg => {
    arg = arg.trim().split("\n");
    const N = parseInt(arg[0]);
    const monsters = arg[1].split(" ").map(n=>parseInt(n));
    
    console.log(getGcd(monsters));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

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

int main() {
  int n;
  cin >> n;
  int64_t ans = 0;
  for (int a = 1; a <= n - 1; ++a) {
    ans += (n - 1) / a;
  }
  cout << ans << '\n';
  return 0;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
 
using namespace std;
#define ll long long
#define db long double
#define all(a) a.begin(),a.end()
#define pb push_back
#define f(i,l,u) for(ll i=l;i<u;i++)
#define lb lower_bound
#define ub upper_bound
#define pii pair<ll,ll> 
ll fac[1000001];
void powe(ll p)
{
     fac[0] = 1; 

     
    for (ll i = 1; i <= 1000000; i++) 
        fac[i] = (fac[i - 1] *i) % p; 
  
}
 
 
        
      long long power( long long x, 
                         ll y, ll p) 
{ 
   long long res = 1; // Initialize result 
  
    x = x % p; 
    while (y > 0) { 
        // If y is odd, multiply x with result 
        if (y & 1) 
            res = (res * x) % p; 
  
        // y must be even now 
        y = y >> 1; // y = y/2 
        x = (x * x) % p; 
    } 
    return res; 
} 
  
// Returns n^(-1) mod p 
 long long modInverse( long long n, ll p) 
{ 
    return power(n, p - 2, p); 
} 
  
// Returns nCr % p using Fermat's little 
// theorem. 
 long long nCrModPFermat( long long n, 
                                 ll r, ll p) 
{ 
    // Base case 
    if (r == 0) 
        return 1; 
  
       return (fac[n] * modInverse(fac[r], p) % p * modInverse(fac[n - r], p) % p) % p; 
} 
 ll gcd(ll a,ll b)
 {
     if(b==0)
     return a;
     return gcd(b,a%b);
 }
  
int main() {
   ll t=1;

   //cin>>t;
  
   while(t--)
   {
ll x,k,d;
cin>>x>>k>>d;
x=abs(x);
    
    ll val=x/d;
    val=min(val,k);
    x-=(val)*d;
    k-=val;
    ll y=x-d;
    
    
    if(k%2==0)
    cout<<abs(x);
    else if(k>0&&(k%2==1))
    cout<<abs(y);
    
    
    
    



   }
  


      

return 0;    
}

Measured memory_bytes: 3628
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#pragma region defins
#define ll long long
#define loop(i,n) for (int i = 0; i < n; i++)
#define loops(i,f,n) for (int i = (f); i < n; i++)
#define INF 100000000000000
#define sort(a) sort(a.begin(),a.end())
#define rsort(a) sort(a.rbegin(),a.rend())
using namespace std;
#pragma endregion
vector<int> balls(10);
bool dfs(int now, int btop, int ctop)
{
	if (now == 10)return true;
	if (balls[now] > btop)dfs(now + 1, balls[now], ctop);
	else if (balls[now] > ctop)dfs(now + 1, btop, balls[now]);
	else return false;
}

int main()
{
	int n; cin >> n;
	loop(i, n)
	{
		loop(i, 10)cin >> balls[i];
		cout << (dfs(0, 0, 0) ? "YES" : "NO") << endl;
	}
}


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

struct Matrix  {
	long long a [2] [2] ;
	Matrix ( )  {  memset ( a, 0, sizeof a ) ;	}
	inline long long* operator [] ( const int& u )  {
		return a [u] ;
	}
	inline Matrix operator * ( Matrix b )  const  {
		Matrix c ;
		for ( int i = 0 ; i < 2 ; ++ i )
			for ( int k = 0 ; k < 2 ; ++ k )
				if ( a [i] [k] )  {
					for ( int j = 0 ; j < 2 ; ++ j )
						c [i] [j] += a [i] [k] * b [k] [j] ;
				}
		return c ;
	}
	void reset ( )  {
		a [0] [0] = a [1] [1] = 1 ;
	}
	void set ( )  {
		a [0] [0] = 2, a [0] [1] = 1 ;
	}
} base, a, t ;

inline Matrix mpow ( Matrix a, int x )  {
	Matrix rt = base ;
	for ( ; x ; x >>= 1, a = a * a )
		if ( x & 1 )  {
			rt = rt * a ;
		}
	return rt ;
}

int main ( )  {
	a.set ( ) ;
	base.reset ( ) ;
	t [0] [0] = 0, t [0] [1] = 1, t [1] [0] = 1, t [1] [1] = 1 ;
	int n ;
	scanf ( "%d", & n ) ;
	return ! printf ( "%lld\n", ( a * mpow ( t, n ) ) [0] [0] ) ;
}


Measured memory_bytes: 256
// agrawal117
//chahatagrawal117
#pragma GCC optimize("O3", "unroll-loops")
#pragma GCC target("avx2")
#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
typedef long long int ll;
#define MAX 1005
int main()
{
    ll n;
    cin>>n;
    int flag=0;
    for(int i=1;i<=n;i++){
        ll a; cin>>a;
        if(a%2==0){
            if(a%3==0 || a%5==0) flag=0;
            else{ flag=1; break; }
        }
    }
    if(!flag) cout<<"APPROVED"<<endl;
    else cout<<"DENIED"<<endl;
}

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

typedef long long ll;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define each(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); ++itr)
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define fi first
#define se second

const int INF=100000000;

typedef pair<int,int> pi;
typedef pair<int,pi> P;

struct edge{ int to,cost; };

vector<edge> G[100];

int main()
{
    while(1)
    {
        int n,m,l,k,a,h;
        scanf(" %d %d %d %d %d %d", &n, &m ,&l, &k, &a, &h);
        if(n==0) break;

        rep(i,n) G[i].resize(0);

        //??????????¨?????????????
        int cold[100]={0};
        rep(i,l)
        {
            int t;
            scanf(" %d",&t);
            cold[t]=1;
        }

        //???????§????
        rep(i,k)
        {
            int x,y,z;
            scanf(" %d %d %d", &x, &y, &z);
            G[x].pb(edge{y,z});
            G[y].pb(edge{x,z});
        }

        int d[100][101];
        fill(d[0],d[100],INF);
        d[a][m]=0;

        //dijkstra
        priority_queue<P,vector<P>,greater<P>> que;
        que.push(P(0,pi(a,m)));
        while(!que.empty())
        {
            P p=que.top();
            que.pop();
            int v=p.se.fi;
            int r=p.se.se;
            if(d[v][r]<p.fi) continue;
            rep(i,G[v].size())
            {
                edge e=G[v][i];
                if(r-e.cost>=0 && d[e.to][r-e.cost]>d[v][r]+e.cost)
                {
                    d[e.to][r-e.cost]=d[v][r]+e.cost;
                    que.push(P(d[e.to][r-e.cost],pi(e.to,r-e.cost)));
                    if(cold[e.to])
                    {
                        for(int j=1; r-e.cost+j<=m; ++j)
                        {
                            if(d[e.to][r-e.cost+j]>d[e.to][r-e.cost]+j)
                            {
                                d[e.to][r-e.cost+j]=d[e.to][r-e.cost]+j;
                                que.push(P(d[e.to][r-e.cost+j],pi(e.to,r-e.cost+j)));
                            }
                        }
                    }
                }
            }

        }

        int ans=INF;
        rep(i,m+1) ans=min(ans,d[h][i]);

        if(ans==INF) printf("Help!\n");
        else printf("%d\n",ans);
    }
    return 0;
}

Measured memory_bytes: 3424
#include <bits/stdc++.h>
#define int long long int

using namespace std;


int h,w;
const int mod = 1e9 + 7;
vector<vector<char>> grid;
vector<vector<int>> dp;

int func(int r, int c) {
	if(r>=h||r<0||c>=w||c<0) {
		return 0;
	}
	if(r==0&&c==0)
		return dp[0][0] = 1;
	if(dp[r][c]!=-1)
		return dp[r][c];
	if(grid[r][c]=='#')
		return dp[r][c] = 0;
	dp[r][c] = (func(r-1,c) + func(r,c-1))% mod;
	return dp[r][c];
}

signed main() {
	cin>>h>>w;
	grid.resize(h,vector<char>(w));
	dp.resize(h,vector<int>(w, -1));

	for(int i=0; i<h; i++) {
		for(int j=0;j<w;j++) {
			cin>>grid[i][j];
		}
	}
	cout<<func(h-1,w-1)<<endl;
	return 0;
}

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

using namespace std;

int main(){
    int long long x;
    cin >> x;

    int long long total = 100;
    int count=0;
    while(1){
        total = total + total*0.01;
        count++;
        if(x<=total){
            break;
        }
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 3632
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <limits.h>
#include <math.h>
#include <time.h>
#include <queue>
#include <stdarg.h>
#include <map>
#include <vector>
#include <algorithm>
#include <stack>
#include <iostream>
#include <numeric>
#include <set>

#define ll long long

using namespace std;

void
solve() {
  int64_t n;
  cin>>n;

  map<int64_t, int64_t> have;
  int64_t a;
  int64_t result = 0;
  for (int64_t i=1; i<=n; i++) {
    cin>>a;

    result += have[i-a];
    have[i+a]++;
  }

  cout<<result<<endl;
}

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

  int64_t t = 1;
  //cin>>t;

  while (t > 0) {
    t--;
    solve();
  }

  return 0;
}



Measured memory_bytes: 26360
#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long
#define pb insert
#define sz(i) (int)(i.size())
#define F first
#define S second
#define L long double
#define P pair<int, int>
const int inf = 0x3f3f3f3f3f3f3f3LL;
const int mod = (int)1e9 + 7;
using namespace std;
#if LOCAL
#include "../../tr.h"
#else
#define tr(...)
#define endl '\n'
#endif
template<class T> void smin(T& a, T val) {if (a > val) a = val;}template<class T> void smax(T& a, T val) {if (a < val) a = val;}
const int N = 5*(int)1e5 + 10;

int n, a[N];

set<P> v;

int32_t main(){_

   cin>>n;

   int b = __builtin_popcountll(n);

   if (b == 1){
      cout<<"No";
      exit(0);
   }
   cout<<"Yes"<<endl;

   if(n == 3){
     cout<<"1 2\n2 3\n3 4\n4 5\n5 6"; 
     exit(0);
   }
   
  
   v.pb({1, 2});
   v.pb({2, 3});
   v.pb({3, n+1});
   v.pb({1, 3+n});
   v.pb({2+n, 3+n});

   for (int i = 4; i < n; ++i)
   {
      v.pb({1, i});
      int num = i ^ 1;
      v.pb({1, num});
      if(num > n+i){
         v.pb({n+i, num});
      }
      else{
         v.pb({num, n+i});
      }
   }

   if(n % 2){
      int i = n;
      v.pb({1, i});
      int num = i ^ 1;
      v.pb({1, num});
      if(num > n+i){
         v.pb({n+i, num});
      }
      else{
         v.pb({num, n+i});
      }
   }
   else{
      int bit = -1;
      for (int i = 0; i < 31; ++i)
      {
         if(n & (1LL << i)){
            bit = i;
            break;
         }
      }

      int num = 1LL << bit;
      int snum = num ^ n ^ 1;

      v.pb({n, num});
      v.pb({snum, 2*n});
      // if(2*n < (2^n^1)){
      //    v.pb({2*n, 2^n^1});      
      // }
      // else{
      //    v.pb({2^n^1, 2*n});      
      // }
   }

   tr(sz(v));

   for(auto it: v){
      cout<<it.F<<' '<<it.S<<endl;
   }

   assert(sz(v) == 2*n-1);

   return 0;
}

Measured memory_bytes: 14848
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <utility>

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

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

using namespace std;

int main() {
    string S, T;
    cin >> S;
    T = S;
    int cnt = 0;
    reverse(begin(T), end(T));
    for (int i = 0; i< (int)S.size()/2; i++) {
        if (S[i] != T[i]) cnt++;
    }
    cout << cnt << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ull unsigned long long int
#define ll long long int
#define ld long double
#define pb push_back 
#define ff first 
#define ss second
#define all(c) c.begin(), c.end()
#define sz(z) (int)z.size()
#define rep(i,a,b) for(int i=a; i<b; ++i)
#define rev(i,a,b) for(int i=a; i>=b; i--)
//Debugging tools 
#define debug(v) cout<<#v<<endl;for(ll i=0; i<v.size(); i++) cout<<v[i]<<" "; cout<<endl;
#define debugn(v,n) cout<<#v<<endl;for(ll i=0; i<n; i++) cout<<v[i]<<" "; cout<<endl;
#define deb(sum) cout<<#sum<<" = "<<sum<<endl;
//Predefined values
#define INF (ll)1e18
#define endl "\n"
#define pi 3.142857142857143


int main() { 
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
   
    int t=1;    
    //cin>>t;
    while(t--){
        string s,p;
        cin>>s;
        cin>>p;
        int ans = INT_MAX;
        int n = sz(s), m = sz(p);
        rep(i,0,n){
            int cnt=0;
            if(i+m<=n){
                rep(j,i,i+m){
                    if(s[j]!=p[j-i])
                        cnt++;
                }
                ans = min(ans,cnt);
            }
        }
        cout<<ans<<endl;

    }
  return 0;
 }

















Measured memory_bytes: 3596
from itertools import accumulate, repeat, takewhile
(lambda n:
    (lambda include3:
        print('',
              *filter(None,
                      map(lambda i: i if i % 3 == 0 else include3(i),
                          range(1, n+1)))))(
        (lambda x:
            next(map(lambda _: x,
                     filter(lambda d: d % 10 == 3,
                            takewhile(bool,
                                      accumulate(repeat(x),
                                                 lambda a, _: a // 10)))),
                 None))))(int(input()))

Measured memory_bytes: 8224
#include <bits/stdc++.h>
using namespace std;
int main(){
    int a, b, i;
    cin >> a >> b;
    for(i=0;i<=100000;i++){
        if(floor(i*0.08)==a && floor(i*0.1)==b){
            cout << i <<endl;
            return 0;
        } 
    }
    cout << -1 <<endl;
    return 0;
}

Measured memory_bytes: 3592
sub Check_Prime_number{
    my $number = shift;
    if($number == 2){ return 1;}
    for ( my $i=2;$i*$i<$number;$i++){
        if($number % $i ==0){
            return 0;
        }
    }
    return 1;
}
 
my $x = <STDIN>;chomp $x;
my $i =0;
my $ans =0;
while(1){
    if(&Check_Prime_number($x+$i) == 1){
        $ans=$x+$i;
        last;
    } else{
        $i+=1;
    }
}
 
print("$ans\n");

Measured memory_bytes: 384
#define _CRT_SECURE_NO_WARNINGS

#define N (307)
#define MODULO (1000000007)
#define HA1 (2420609)
#define HA2 (19260817)

#include <cstdio>
#include <iostream>
#include <fstream>
#include <sstream>
#include <queue>
#include <map>
#include <set>
#include <deque>
#include <vector>
#include <stack>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <string>
using namespace std;

inline int GetRand()
{
	int Res = rand()*rand()*rand();
	Res -= rand()*rand();
	Res += rand();
	return Res;
}

int n, m;
int a[N][N];
set<int> S;
int cnt[N];
int Ans;

inline pair<int, int> CalcAns()
{
	memset(cnt, 0, sizeof(cnt));
	for (int i = 0;i < n;i++)
	{
		for (int j = 0;j < m;j++)
		{
			if (S.find(a[i][j]) != S.end())
			{
				cnt[a[i][j]]++;
				break;
			}
		}
	}
	int nid = -1, mx = 0;
	for (int i = 0;i < m;i++)
	{
		if (mx < cnt[i])
		{
			mx = cnt[i];
			nid = i;
		}
	}
	return make_pair(nid, mx);
}

int main()
{
	scanf("%d%d", &n, &m);
	for (int i = 0;i < n;i++)
	{
		for (int j = 0;j < m;j++)
		{
			scanf("%d", &a[i][j]);
			a[i][j]--;
		}
	}
	for (int i = 0;i < m;i++)
	{
		S.insert(i);
	}
	Ans = MODULO;
	for (int r = m;r >= 1;r--)
	{
		pair<int, int> Res = CalcAns();
		Ans = min(Ans, Res.second);
		S.erase(Res.first);
	}
	printf("%d\n", Ans);
	//system("pause");
	return 0;
}



Measured memory_bytes: 640
import sys
sys.setrecursionlimit(10**8)
stdin = sys.stdin


def ni(): return int(ns())


def na(): return list(map(int, stdin.readline().split()))


def naa(N): return [na() for _ in range(N)]


def ns(): return stdin.readline().rstrip()  # ignore trailing spaces


H, W, K = na()

c_array = [ns() for _ in range(H)]

ans = 0
for i in range(2**(H+W)):
    cnt = 0
    for h in range(H):
        for w in range(W):
            if i & (1 << h) == 0 and i & (1 << (H+w)) == 0 and c_array[h][w] == "#":
                cnt += 1
    if cnt == K:
        ans += 1


print(ans)


Measured memory_bytes: 73120
//https://atcoder.jp/contests/abc044/submissions/7178262 の写経

#include "bits/stdc++.h"

using namespace std;

//using Matrix = vector< vector<int> >;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9 + 10;
//const ll INF = 1e18 + 10LL;
int dx[5] = {0, 0, 1, -1, 0}, dy[5] = {1, -1, 0, 0, 0};
const double EPS = 1e-10;
bool cmp(P a, P b) { return a.second < b.second; } //End sort (Interval scheduling problem)
ll MOD = 1e9 + 7;

int n, A;
int x[60];

ll dp[60][60][3000];

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

	dp[0][0][0] = 1;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			for (int k = 0; k < 2525; k++) {
				dp[i + 1][j][k] += dp[i][j][k];

				if (k - x[i] >= 0) dp[i + 1][j + 1][k] += dp[i][j][k - x[i]];
			}
		}
	}

	ll ans = 0;
	for (int k = 1; k <= n; k++) ans += dp[n][k][k * A];

	printf("%lld\n", ans);
	
	return 0;
}

Measured memory_bytes: 70528
#include<bits/stdc++.h>
using namespace std;
int n,k;
vector<int> dsk[100005];
int bac[100005];
int parent[100005];
void nhap()
{
    cin>>n>>k;
    for (int i=1;i<=n-1+k;i++)
    {
        int x,y;cin>>x>>y;
        dsk[x].push_back(y);
        bac[y]++;
//        cout<<x<<' '<<y<<endl;
    }
}
void bfs(int x)
{
    queue<int> st;
    st.push(x);
    while (!st.empty())
    {
        int u=st.front();
        st.pop();
        for (int v:dsk[u])
        {
            bac[v]--;
            if (!bac[v])
            {
                parent[v]=u;
                st.push(v);
            }
        }
    }
}
void xuli()
{
    for (int i=1;i<=n;i++)
    if (!bac[i])
    {
        bfs(i);
        break;
    }
    for (int i=1;i<=n;i++) cout<<parent[i]<<"\n";
}
int main()
{
   // freopen("Restorethetree.inp","r",stdin);
   // freopen("Restorethetree.out","w",stdout);
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    nhap();
    xuli();
}


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

int main(){
  long long N, K;
  cin >> N >> K;
  if(N > K) N = N % K;
  while(N * 2 >= K){
    N = abs(N - K);
  }
  if(N == K) cout << N - K << endl;
  else cout << N << endl;  
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <iomanip>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
//setbase - cout << setbase (16); cout << 100 << endl; Prints 64
//setfill -   cout << setfill ('x') << setw (5); cout << 77 << endl; prints xxx77
//setprecision - cout << setprecision (14) << f << endl; Prints x.xxxx
//cout.precision(x)  cout<<fixed<<val;  // prints x digits after decimal in val
using namespace std;
using namespace __gnu_pbds;

#define sp << " " <<
#define mod 1000000007
#define PI 3.14159265358979323
#define y second
#define x first
#define pb push_back
#define mp make_pair
#define sz(a) a.size()
#define pqueue priority_queue< ll >
//#define pdqueue priority_queue< ll,vector<ll> ,greater< ll > >
#define codejamDebug(x) cout<<"Case #"<<x<<": ";
#define debug(x) cout<<#x<<" :"<<x<<endl;
#define rep(i,n) for(long long i=0;i<n;i++)
#define f(i,a,b) for(long long i = a; i < b; i++)
#define fd(i,a,b) for(long long i = a; i >=b; i--)
#define sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
typedef long long int           ll;
typedef long double             ld;
typedef unsigned long long int ull;
typedef vector <int>            vi;
typedef vector <ll>            vll;
typedef pair <int, int>        pii;
typedef pair <ll, ll>          pll;
typedef vector < pii >        vpii;
typedef vector < pll >        vpll;
typedef vector <string>         vs;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

//Handle:cyber_rajat

int main(int argc, char const *argv[])
{
	sync;
	int n, k, x, d;
	cin >> n >> k;
	int a[n+1];
	memset(a,0,sizeof(a));
	rep(i, k){
		cin >> d;
		rep(i, d){
			cin >> x, a[x]++;
		}
	}
	int cnt = 0;
	for(int i=1; i<=n; i++) if (a[i]==0) cnt++;
	cout << cnt;
	return 0;
}


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

using namespace std;
typedef long long ll;
typedef pair<ll, ll> p_ll;

template<class T>
void debug(T itr1, T itr2) { auto now = itr1; while(now<itr2) { cout << *now << " "; now++; } cout << endl; }
#define repr(i,from,to) for (int i=(int)from; i<(int)to; i++)
#define all(vec) vec.begin(), vec.end()
#define rep(i,N) repr(i,0,N)
#define per(i,N) for (int i=(int)N-1; i>=0; i--)

const ll MOD = pow(10,9)+7;
const ll LLINF = pow(2,61)-1;
const int INF = pow(2,30)-1;

vector<ll> fac;
void c_fac(int x=pow(10,6)+10) { fac.resize(x,true); rep(i,x) fac[i] = i ? (fac[i-1]*i)%MOD : 1; }
ll inv(ll a, ll m=MOD) { ll b = m, x = 1, y = 0; while (b!=0) { int d = a/b; a -= b*d; swap(a,b); x -= y*d; swap(x,y); } return (x+m)%m; }
ll nck(ll n, ll k) { return fac[n]*inv(fac[k]*fac[n-k]%MOD)%MOD; }
ll gcd(ll a, ll b) { if (a<b) swap(a,b); return b==0 ? a : gcd(b, a%b); }
ll lcm(ll a, ll b) { return a/gcd(a,b)*b; }


int main() {
  ll N; cin >> N;
  ll count[N+1] = {};
  repr(i,1,N+1) {
    for (ll j=i; j<=N; j+=i) count[j]++;
  }
  // debug(count,count+(N+1));

  ll result = 0; repr(i,1,N+1) result += i * count[i];
  cout << result << endl;
  return 0;
}

Measured memory_bytes: 81764
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define intput(i) cout << i << endl
#define ll long long
#define stringput(s) cout << (string)(s) << endl

int main(){
  int A, B;
  cin >> A >> B;
  
  if(A>=13){
    cout << B << endl;
  }
  else if(6 <= A && A <=12){
    cout << B/2 << endl;
  }
  else intput(0);
}

Measured memory_bytes: 256
n, x = input().split()
n = int(n)
x = int(x)
m = []
result = 0

for i in range(n) :
 m.append(int(input()))

for i in range(len(m)):
 x = x - m[i]
 result = result + 1

for i in range(x):
 if x >= min(m):
  result = result + 1
  x = x - min(m)

 else:
  break

print(result)

Measured memory_bytes: 3064
# N = int(input())

N,Y = map(int, input().split())   # 2つ整数の読み取り

# A = list(map(int, input().strip().split()))  # 横に何個か
 
# N=int(input())
# A=[int(input()) for _ in range(N)]  # 縦に一個ずつ

x,y,z = 0,0,0
total = 0
flg=0

for i in range(N+1):
    for j in range(0,N-i+1):
        if flg==0:
            x=i
            y=j
            z=N-x-y
            total = x*10000 + y*5000 + z*1000
            # print(total)
            # print(x,y,z)
    
            if total == Y:
                print(x,y,z)
                flg = 1

if flg == 0:
    print("-1 -1 -1")


Measured memory_bytes: 9092
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

fn read_vec2<T: std::str::FromStr>(n: usize) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}

fn read_col<T: std::str::FromStr>(n: usize) -> Vec<T> {
    (0..n).map(|_| read()).collect()
}

fn not(b: bool) -> bool {
    if b {
        false
    } else {
        true
    }
}

fn fact(n: u64) -> u64 {
    if n == 0 {
        1
    } else {
        (n * fact(n - 1)) % 1000000007
    }
}

fn main() {
    let n: usize = read();
    let s: String = read();
    let cv: Vec<char> = s.chars().collect();

    if cv[0] == 'W' {
        println!("0");
    } else {
        let mut ans: u64 = 1;
        let mut close: bool = false;
        let mut cnt: u64 = 1;

        for i in 1..(n * 2) {
            if cv[i - 1] == cv[i] {
                close = not(close);
            }
            if close {
                ans = (ans * cnt) % 1000000007;
                cnt -= 1;
            } else {
                cnt += 1;
            }
        }
        if cnt != 0 {
            println!("0");
        } else {
            println!("{}", (ans * fact(n as u64)) % 1000000007);
        }
    }
}


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

struct RMQ {
	using type = int;
	static type id() { return INT_MAX; }
	static type op(const type& l, const type & r) { return min(l, r); }
};

template <typename M>
class SegmentTree {
	using T = typename M::type;
	const int n;
	vector<T> data;
	int size(int n) {
		int res;
		for (res = 1; res < n; res <<= 1);
		return res;
	}
public:
	SegmentTree(int n_) : n(size(n_)), data(n * 2, M::id()) {}
	SegmentTree(int n_, T val) : n(size(n_)), data(n * 2, val) {}
	void add(int p, T val) {
		p += n;
		data[p] += val;
		while (p >>= 1) data[p] = M::op(data[p * 2], data[p * 2 + 1]);
	}
	T find(int l, int r) {
		l += n; r += n + 1;
		T res1 = M::id(), res2 = M::id();
		while (l < r) {
			if (l & 1) res1 = M::op(res1, data[l++]);
			if (r & 1) res2 = M::op(data[--r], res2);
			l >>= 1; r >>= 1;
		}
		return M::op(res1, res2);
	}
};

int main()
{
	int N, K;
	cin >> N >> K;
	vector<int> a(N);
	for (int i = 0; i < N; i++) {
		cin >> a[i]; a[i]--;
	}
	int l = 0, res = N + 1;
	SegmentTree<RMQ> st(1e5, 0);
	for (int r = 0; r < N; r++) {
		st.add(a[r], 1);
		while (st.find(0, K - 1) >= 1) {
			res = min(res, r - l + 1);
			st.add(a[l++], -1);
		}
	}
	cout << (res == N + 1 ? 0 : res) << endl;
	return 0;
}

Measured memory_bytes: 4152
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define NUM 1000000007
#define MAX 100001
#define INF LLONG_MAX
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll n,tmp;
    cin>>n;
    vector<ll> v;
    for(int i=0;i<n;i++){
        cin>>tmp;
        v.pb(tmp);
    }
    ll ans = 0;
    for(int i=1;i<n;i++){
        if(v[i]<v[i-1]){
            ans+=v[i-1]-v[i];
            v[i]=v[i-1];
        }
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 5284
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <climits>
#include <string>
#include <queue>
#include <stack>
#include <map>
#include <cstring>
#include <numeric>
#include <set>

#define MOD 1000000007
#define INF 2000000000
#define sp ' '
#define st first
#define nd second
#define pb push_back
#define mp make_pair
#define FOR(YY, yy) for(long long yy = 0; yy < YY; ++yy)

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector< vector<int> > vvi;
typedef pair<int, int> ii;
typedef vector<pair<int, int> > vii;
typedef vector<pair<int, pair<int, int> > > vpip;
typedef vector<bool> vb;
typedef priority_queue<int> pqi;

int main(int argc, char **argv)
{
    ios::sync_with_stdio(); cin.tie(0);
    string S; cin >> S;

    for(int i = 1; i <= S.length(); ++i)
    {
        if(i % 2 == 0 && S[i-1] == 'R'){ cout << "No" << endl; return 0; }
        if(i % 2 == 1 && S[i-1] == 'L'){ cout << "No" << endl; return 0; }
    }

    cout << "Yes" << endl;
    return 0;
}

//cikisir



Measured memory_bytes: 256
N, K = map(int, input().split())
R, S, P = map(int, input().split())
score = {'r': R, 's': S, 'p': P}
T = input()
hand = {'r': 'p', 's': 'r', 'p': 's'}

history = []
cnt = 0
for i, t in enumerate(T):
    if i < K:
        u = hand[t]
        flag = 1
    elif K <= i < N - K:
        l = i - K
        r = i + K
        if hand[t] == history[l]:
            u = T[r]
            flag = 0
        else:
            u = hand[t]
            flag = 1
    else:
        l = i - K
        if hand[t] == history[l]:
            u = t
            flag = 0
        else:
            u = hand[t]
            flag = 1
    cnt += score[u] * flag
    history.append(u)

print(cnt)


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

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

    vector<string> strings(N);
    for (int i = 0; i < N; i++)
    {
        cin >> strings.at(i);
    }

    sort(strings.begin(), strings.end());

    string ans = "";
    for (int i = 0; i < N; i++)
    {
        ans += strings.at(i);
    }

    cout << ans << endl;
}


Measured memory_bytes: 256
import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, core.stdc.stdio;

void main() {
    auto N = readln.chomp.to!int;
    auto G = new Tuple!(int, int)[][](N);
    foreach (i; 0..N-1) {
        auto s = readln.split.map!(to!int);
        G[s[0]-1] ~= tuple(s[1]-1, i);
        G[s[1]-1] ~= tuple(s[0]-1, i);
    }

    auto ans = new int[](N-1);

    void dfs(int n, int p, int pc) {
        int c = 0;
        foreach (e; G[n]) {
            int m = e[0];
            int idx = e[1];
            if (m == p) continue;
            if (c == pc) c += 1;
            ans[idx] = c + 1;
            dfs(m, n, c);
            c += 1;
        }
    }

    dfs(0, -1, -1);
    G.map!(g => g.length).reduce!max.writeln;
    ans.each!writeln;
}


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

using namespace std;

#define PI 3.14159265358979323846264338327950L

int main(void){
    int ans=0;
    int N,X,T;

    cin>>N>>X>>T;

    ans=N/X;


    if(N%X!=0){
        ans++;
    }



    cout<<ans*T<<endl;


    return 0;
}



Measured memory_bytes: 3592
from sys import stdin,stdout
# n,e=list(map(int,stdin.readline().split()))
n=int(stdin.readline())
a=list(map(int,stdin.readline().split()))
d={};ans=0
for i in range(n):
    d[a[i]+i]=d.get(a[i]+i,0)+1
for i in range(n):
    ans+=d.get(i-a[i],0)
print(ans)

Measured memory_bytes: 39972
n = int(input())
a_list = list(map(int, input().split()))
dic = {}
i_list = []
for a in a_list:
    dic[a] = 0
for a in a_list:
    dic[a] += 1
    if dic[a] == 1:
        i_list.append(a)
ans = 0
for i in i_list:
    p = dic[i] - i 
    if p >= 0:
        ans += p
    else:
        ans += dic[i]
print(ans)

Measured memory_bytes: 17780
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = LONG_LONG_MAX / 2;
const ll mod = 1000000000 + 7;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

int main() {
  string n;
  cin >> n;
  for (int i = 0; i < n.size(); i++) {
    if (n[i] == '1')
      n[i] = '9';
    else if (n[i] == '9')
      n[i] = '1';
  }
  cout << n << endl;
}


Measured memory_bytes: 3592
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

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

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

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

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

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

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

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

fn main() {
    input! {
        x: usize
    }
    let mut x = x;
    while !is_prime(x) {
        x += 1;
    }
    println!("{}", x);
}

fn is_prime(n: usize) -> bool {
    if n <= 1 {
        return false;
    };
    for i in 2..n {
        if n % i == 0 {
            return false;
        }
    }
    true
}


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

using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;


int main()
{
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  int arr [n];
  for(int i = 0; i<n ;i++)
  {
    cin>> arr[i];
  }
  int ans[n];
  ans [0] = 0;
  ans [1] = abs(arr[0]-arr[1]);
  for(int i = 2;i<n;i++)
  {
    ans[i]=min(ans[i-1]+abs(arr[i]-arr[i-1]),ans[i-2]+abs(arr[i]-arr[i-2]));
  }
  cout<< ans[n-1];


  return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int main(){
        int x;
        cin >> x;
        bool brflag = false;
        for(int i = 0; i< 1000000001; i++){
                for(int j = -i-1; j <= i-1; j++){
                        //cout << i << " " << j << endl;
                        if(pow(i,5) - pow(j,5) == x){

                                cout << i << " " << j << endl;
                                brflag = true;
                                break;
                        }
                }
                if(brflag)break;
        }

}


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

void solve(void){
  int D, N, ans, A; 

  cin >> D >> N;
  
  if(D==0){
    A = 1;
  }
  else if(D==1){
    A = 100;
  }
  else
  {
    A = 10000;
  }
    
  if(N == 100){
    ans = A * N + A;
  }
  else
  {
    ans = A * N;
  }

  cout << ans << endl;
  
  return;
}

int main(int argc, const char * argv[]) {

    // cinを高速にするためのおまじない
    cin.tie(0);
    ios::sync_with_stdio(false);

  solve();
  
  return 0;
}

Measured memory_bytes: 384
import sys
import math
import collections
#n = int(input())
a1, a2, a3 = map(int, input().split())
a4, a5, a6 = map(int, input().split())
a7, a8, a9 = map(int, input().split())
#s = input()
#x = list(map(int, input().split()))
a = [a1, a2, a3, a4, a5, a6, a7, a8, a9]
c = [0 for k in range(9)]
n = int(input())
for i in range(n):
    b = int(input())
    for j in range(9):
        if a[j] == b:
            c[j] = 1

if c[0] + c[1] + c[2] == 3:
    print("Yes")
    sys.exit()
if c[4] + c[5] + c[3] == 3:
    print("Yes")
    sys.exit()
if c[7] + c[8] + c[6] == 3:
    print("Yes")
    sys.exit()
if c[0] + c[3] + c[6] == 3:
    print("Yes")
    sys.exit()
if c[1] + c[4] + c[7] == 3:
    print("Yes")
    sys.exit()
if c[2] + c[5] + c[8] == 3:
    print("Yes")
    sys.exit()
if c[0] + c[4] + c[8] == 3:
    print("Yes")
    sys.exit()
if c[2] + c[4] + c[6] == 3:
    print("Yes")
    sys.exit()

print("No")


Measured memory_bytes: 3316
//#include "bits/stdc++.h"

#define _USE_MATH_DEFINES
#include<cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iterator>

using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

//typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pdd;
typedef vector< vector<int> > mat;

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

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;

int dn[41];
int isum[41];
int ksum[41];

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

	int N, K;
	int A;
	cin >> N >> K;

	rep(i, 0, N)
	{
		cin >> A;
		rep(j, 0, 41)
		{
			if ((A & (1LL << j)))
			{
				dn[j]++;
			}
		}
	}

	rep(i, 0, 41)
	{
		isum[i] = (1LL << i)*max(dn[i], N - dn[i]);
		ksum[i] = (1LL << i)*((K & (1LL << i)) ? N - dn[i] : dn[i]);
		if (0 < i)
		{
			isum[i] += isum[i - 1];
			ksum[i] += ksum[i - 1];
		}
	}

	int ans = ksum[40];
	rep(i, 0, 41)
	{
		if ((K & (1LL << i)))
		{
			int t = 0;
			t += ksum[40] - ksum[i];
			t += (1LL << i)*dn[i];
			if (0 <= i - 1)t += isum[i - 1];
			chmax(ans, t);
		}
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 384
#include <iostream> // ?¨??????\??????

using namespace std;

int main() {
	int row = 9;	// ???
	int col = 9;	// ???
	for (size_t i = 1; i <= row; i++)
	{
		for (size_t j = 1; j <= col; j++)
		{
			cout << i << "x" << j << "=" << i*j << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 3056
#include<map>
#include<set>
#include<list>
#include<cmath>
#include<queue>
#include<stack>
#include<cstdio>
#include<string>
#include<vector>
#include<complex>
#include<cstdlib>
#include<cstring>
#include<numeric>
#include<sstream>
#include<iostream>
#include<algorithm>
#include<functional>
 
#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()

 
using namespace std;
 
typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;
 
const int INF=1<<29;
const double EPS=1e-9;
 
const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

int n,a,x[60],aaa;
long long int res = 0ll;
long long int sumr[2500] = {},suml[2500] = {};

int main(){
	long long int x,y,z;
	cin >> x >> y >> z;
	if(x % 2 == 0 || y % 2 == 0 || z % 2 == 0) cout << 0 << endl;
	else {
		if(x == 1) cout << min(y,z) << endl;
		else if(y == 1) cout << min(x,z) << endl;
		else if(z == 1) cout << min(x,y) << endl;
		else cout  << min(min(x * y,y * z),x * z);
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
template<class t> inline t read(t &x){
	x=0;char c=getchar();bool f=0;
	while(!isdigit(c)) f|=c=='-',c=getchar();
	while(isdigit(c)) x=(x<<1)+(x<<3)+(c^48),c=getchar();
	if(f) x=-x;return  x;
}
template<class t> inline void write(t x){
	if(x<0){putchar('-'),write(-x);}
	else{if(x>9)write(x/10);putchar('0'+x%10);}
}

#define int long long

const int mod=1e9+7;
int ans,cnt[70],n;

signed main(){
	read(n);
	for(int i=1,x;i<=n;i++){
		read(x);
		for(int j=0;j<61;j++) if(x>>j&1ll) cnt[j]++;
	}
	for(int i=0;i<61;i++) (ans+=cnt[i]*(n-cnt[i])%mod*((1ll<<i)%mod)%mod)%=mod;
	write(ans);
}

Measured memory_bytes: 256
#include <cstring>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <random>
#include <bitset>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
#define rep(i,n) for (int i=0; i<n;++i)
typedef long long ll;
using namespace std;
const ll MOD = 1000000007LL;
int N;
double A[303];
double DP[301][301][301]; //状態が3枚の個数, 2枚の個数, 1枚の個数. resは全て0にするまでのの期待値

double dfs(int i, int j, int k){
  if (DP[i][j][k] > 0) return DP[i][j][k];
  if (i==0 && j==0 && k==0) return 0.0;

  double ans = 0.0;
  if (i>0) ans += i*dfs(i-1, j+1, k);
  if (j>0) ans += j*dfs(i, j-1, k+1);
  if (k>0) ans += k*dfs(i, j, k-1);
  ans += N;
  ans /= (i+j+k);
  DP[i][j][k] = ans;
  return ans;
}

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

  cin >> N;
  int i=0,j=0,k=0;
  int a;
  rep(n, N){
    cin >> a;
    if (a==3) i++;
    else if (a==2) j++;
    else if (a==1) k++;
  }
  double ans = dfs(i,j,k);
  cout << setprecision(10) << ans << endl;
  return 0;
}


Measured memory_bytes: 213248
import java.util.Scanner;
public class Main{
  public static void main(String[] args){
	  Scanner sc = new Scanner(System.in);
    int x = sc.nextInt();
    int fX = 0;
    int quo = x;
    while(quo != 0){
      fX += quo%10;
      quo = quo/10;
    }
    if(x%fX != 0){
      System.out.println("No");
    }
    else{
      System.out.println("Yes");
    }
  }
}

Measured memory_bytes: 22996
#include <bits/stdc++.h>
using namespace std;
 
int main()
{
	int a, b = 0;
	cin >> a >> b;
	string ans = "No";
	if (a % 2 != 0 && b % 2 != 0)
	{
		ans = "Yes";
	}
	
	cout << ans << "\n";
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pb push_back
#define int long long
using namespace std;
int a[100005];
main (){
      int n,k;
      cin >> n >> k;
      for (int i =1; i <= n; i++){
             cin >> a[i];
      }
      int ans = 0;
      for (int i = 1; i<=n;i++){
             int t;
             if (a[i] + a[i + 1] > k) t = a[i + 1],a[i + 1] = k - a[i],ans+=t - a[i + 1];
      }
      cout<<ans;
}


Measured memory_bytes: 1024