akhauriyash/Code-Regression huggingface dataset:
/*
Mangal bhavan amangal haari
Drabahu su Dasharath achar Bihari
Raam Siya Raam Siya Raam jai jai Raam
Raam Siya Raam Siya Raam jai jai Raam
Ho hoi hai wohi jo Raam rachi raakha
Ko kari tarak badhave saakha
Raam Siya Raam Siya Raam jai jai Raam
Ho dheeraj dharam mitra aru naari
Aapad kaal parakhiye chaari
Ho jehike jehi par satya sanehu
So tehi milay na kachhu sandehu
Ho jaaki rahi bhawana jaisi
Prabhu murati dekhi tin taisi
Ho Raghukul reet sada chali aayi
Praan jaaye par vachan na jaayi
Raam Siya Raam Siya Raam jai jai Raam, Raam
Raam Siya Raam Siya Raam jai jai Raam
Ho hari anant hari katha ananta
Kahahi sunahi bahuvidhi sab santa
Raam Siya Raam Siya Raam jai jai Raam, Raam
Raam Siya Raam Siya Raam jai jai Raam
Raam Siya Raam Siya Raam jai jai Raam
*/


#include<bits/stdc++.h>
using namespace std;
#define ll long long 
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define all(v) v.begin(),v.end()
//auto->.
//map<int,int>::iterator i
vector<int> sieve(ll n) 
{ 
//cout<<":";
    vector<bool> prime(n+1,true); 
       
    prime[0] = false; 
    prime[1] = false; 
    int m = n; 

    for (int p=2; p<=m; p++) 
    { 
    
        if (prime[p]) 
        { 
         
            for (int i=p*2; i<=n; i += p) 
            prime[i] = false; 
        } 
    }  
    vector<int> ans; 
    for (int i=0;i<n;i++) 
        if (prime[i]) 
            ans.push_back(i);  
}

int gcd(int a,int b)
{
	if(b==0) return a;
	return gcd(b,a%b);
}
int mod = 1e9 + 7;
int power(int a , ll b)
{
	int res = 1;
	while(b)
	{
		if(b & 1)
			res = 1LL * res * a ;//% mod;
		a = 1LL * a * a ;//% mod;
		b >>= 1;
	}
	return res;
}
ll min(int a,ll b)
{
	if(a>b)
	return b;
	return a;
}
ll max(int a,ll b)
{
	if(a>b)
	return a;
	return b;
}
#define PI 3.141592653589793
ll lcm(ll a,ll b)
{
	return a*b/__gcd(a,b);
	//return t*c/__gcd(t,c);
}
bool isprime(ll n)
{
	for(int i=2;i*i<=n;i++)
	{
		if(n%i==0)
		return false;
	}
	return true;
}
ll v(ll n)
{
	if(isprime(n))
	return 1;
	for(int i=2;i*i<=n;i++)
	{
		if(n%i==0)
		{
			return max(i,n/i);
		}
	}
}
void solve()
{
int n,k;
cin>>n>>k;
int arr[n];
for(int i=0;i<n;i++)
{
	cin>>arr[i];
}
for(int i=0;i<n;i++)
{
	if(i<k)
	{
		continue;
	}
	else
	{
		if(arr[i-k]<arr[i])
		{
			cout<<"Yes\n";
		}
		else
		{
			cout<<"No\n";
		}
	}
}
return ;
}

int main()
{
	
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	
int mul=0;
if(mul==1)
{
 int t;
    cin>>t;
   while(t--)
    {
    //	cout<<"Case #"<<i<<": ";
		solve();
	cout<<"\n";
    }
}
else
{
	solve();
}
}

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

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

using namespace std;

int main(){
  int n;cin>>n;
  int result=200;
  rep(i,n){
    int t;cin>>t;
    int tr=0;
    while(t%2==0){
      tr++;
      t/=2;
    }
    result = min(result, tr);
  }

  cout<<result;

  return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <math.h>

// ===============================================================
//using系

using namespace std;
using ll = long long;
using vl = vector<long long>;
using vll = vector<vector<long long>>;
using vs = vector<string>;
using vc = vector<char>;
using vcc = vector<vector<char>>;
using vm = vector<short>;
using vmm = vector<vector<short>>;
using pii = pair<int, int>;
using psi = pair<string, int>;
using ld = long double;
using ull = unsigned long long;
using ld = long double;
using qul = queue<ll>;
using pql = priority_queue<ll>;

// ========================================================================
//define系

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

// ========================================================================


ll gcd(ll a, ll b)
{
	if (a % b == 0)
	{
		return(b);
	}
	else
	{
		return(gcd(b, a % b));
	}
}
//最大公約数
ll lcm(ll a, ll b)
{
	return a * b / gcd(a, b);
}
//最小公倍数
ll box(double a)
{
	ll b = a;
	return b;
}
//切り捨て
ll fff(double a)
{
	ll b = a + 0.5;
	return b;
}
//四捨五入
ll mch(ll n) {
	if (n == 1) return 1;
	else return n * mch(n - 1);
}
//1から整数nまでの階乗を出す(INFで割っていない)
bool prime(ll a)//素数判定、primeならtrue,違うならfalse
{
	if (a < 2) return false;
	else if (a == 2) return true;
	else if (a % 2 == 0) return false;
	double m = sqrt(a);
	for (int i = 3; i <= m; i += 2)
	{
		if (a % i == 0)
		{
			return false;
		}
	}

	// 素数である
	return true;
}
//素数判定
ll modpow(ll a, ll n, ll mod) {
	ll hi = 1;
	while (n > 0) {
		if (n & 1) hi = hi * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return hi;
}
//いろいろやります（ただの前座）
ll mg(ll a, ll mod) {
	return modpow(a, mod - 2, mod);
}
//割り算の10^9+7等対策で逆元を出します 




// ========================================================================


/*signed*/int main() {
	ll n, k; cin >> n >> k;
	vl a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	vl b(n + 1, 0);
	for (int i = 0; i < n; i++) {
		b[a[i]]++;
	}
	sort(b.begin(), b.end());
	ll cnt = 0;
	for (int i = 0; i < n + 1; i++) {
		if (b[i] > 0) cnt++;
	}
	if (cnt <= k) cout << 0 << endl;
	else {
		k = cnt - k;
		cnt = 0;
		for (int i = 0; i < n; i++) {
			if (b[i] != 0) {
				if (k == 0) break;
				else {
					k--;
					cnt += b[i];
				}
			}
		}
		cout << cnt << endl;
	}

	return 0;
}

Measured memory_bytes: 6492
import collections
N = int(input())
D = list(map(int,input().split()))
longest = max(D)
c = collections.Counter(D)
ans = 1
if c[0] > 1 or D[0] != 0:
    print(0)
else:
    for i in range(longest):
        if c[0] > 1:
            ans = 0
            break
        ans = ans * (c[i])**(c[i+1]) % 998244353
    print(ans)

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

int main(void){
    int N;
    string S;
    cin>>N>>S;
    int x=0;
    int ans=0;
    for (int i=0;i<N;i++){
        if (S[i]=='I') x++;
        else x--;
        ans=(ans>x)?ans:x;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main(){

    int N, M, T;
    cin >> N>> M>> T;
    int a[N];
    for(int i=0; i<N; i++) cin>> a[i];

    int b[N+1];
    for(int i=0; i<N+1; i++){
        if(i==0) b[i]=a[i]-M;
        else if(i==N) b[i]=max(T-a[i-1]-M, 0);
        else b[i]=max(a[i]-a[i-1]-2*M, 0);
    }
    int c=0;
    for(int i=0; i<N+1; i++) c+=b[i];

    cout<< c<< endl;

    return 0;
}

Measured memory_bytes: 3044
/*
ID: markusz1
TASK: template
PROG: template
LANG: C++
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ul;
typedef priority_queue<int> p_int;
typedef priority_queue<ll> p_ll;
typedef priority_queue<double> p_double;

int a,b,c;
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	cin >> a >> b >> c;
		if (c <= a+b+1)cout << b+c << endl;
		else cout << a+2*b+1 << endl;

}

Measured memory_bytes: 256
#include<stdio.h>
#include<limits.h>
#include<queue>
#include<utility>
#include<algorithm>
using namespace std;

const int N = 108;
bool isConnect[N][N];

int MinRoot(int from,int to,int rootNum)
{
	int distance[N],i;
	fill(distance,distance+N,INT_MAX);
	queue<pair<int,int> > q;
	pair<int,int> p;
	q.push(make_pair(from,1));
	while(!q.empty())
	{
		p=q.front(); q.pop();
		if(distance[p.first] <= p.second) continue;

		distance[p.first] = p.second;

		for(i=1; i<=rootNum; ++i)
		{
			if(isConnect[p.first][i])
			{
				q.push(make_pair(i,p.second+1));
			}
		}
	}
	return distance[to];
}
int main()
{
	int n,connectCount,fromRooterNum,toRooterNum,i,j,p,ttl;

	for(i=0;i<N;++i) for(j=0;j<N;++j) isConnect[i][j] = false;

	scanf("%d",&n);
	for(i=0; i<n; ++i)
	{
		scanf("%d%d",&fromRooterNum,&connectCount);
		for(j=0; j<connectCount; ++j)
			scanf("%d",&toRooterNum),isConnect[fromRooterNum][toRooterNum]=true;
	}
	scanf("%d",&p);
	for(i=0;i<p;++i)
	{
		scanf("%d%d%d",&fromRooterNum,&toRooterNum,&ttl);
		int minRooter = MinRoot(fromRooterNum,toRooterNum,n);
		if(minRooter>ttl) puts("NA");
		else printf("%d\n",minRooter);
	}
	return 0;
}

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

using namespace std;

long long gcd(long long a,long long b)
{
    if(b==0)
        return a;

    return gcd(b,a%b);
}

void test()
{
   string a,b,c;
   cin>>a>>b>>c;

   cout<<"A"<<b[0]<<"C";

}

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

    test();

    return 0;
}


Measured memory_bytes: 3640
S = input()
def two(n):
    A = []
    x = n
    for i in range(3):
        A.append(x%2)
        x//=2
    return A
for i in range(2**3):
    a = S[0]
    T = two(i)
    for j in range(3):
        a+="+" if T[j] else "-"
        a+=S[j+1]
    if eval(a)==7:
        print(a+"=7")
        break

Measured memory_bytes: 3064
#include <cstdio>
#include <algorithm>
using namespace std;
int main()
{
	int x, t;
	scanf("%d", &x);
	bool is = false;
	if (x%10 == 9) is = true;
	if (x/10 == 9) is = true;
	if (is) printf("Yes");
	else printf("No");
} 

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
#define sz(x) int(x.size())
using ll = long long;
const ll LLINF = numeric_limits<long long>::max();
const int mod = 1000000007;
const int INF = 1001001001;

int main()
{
    string s;
    cin >> s;
    if(s=="ABC"){
        cout << "ARC";
    }
    else cout << "ABC";
    return 0;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
const long long  mod = 1000000007;


int gcd(int n, int m){
  if(n < m) swap(n,m);

  if(m==0) return n; // 0's deviser is all numbers.
  while(m > 0){
    int res = n%m;
    n = m;
    m = res;
  }
  return n;
}

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

  vector<int> a(n,0);
  vector<int> c(1000005,0);
  rep(i,n) {
    cin >> a[i];
    c[a[i]]++;
  }

  bool par = true;
  for(int i = 2; i <= 1000000; i++){
    int cnt = 0;
    for(int j = i; j <= 1000000; j += i){
      cnt += c[j];
    }
    if(cnt > 1) par = 0;
  }
  if(par){
       cout << "pairwise coprime" << endl;
       return 0;
    }

  int g = 0;
  rep(i,n) g = gcd(g,a[i]);
  if(g == 1){
    cout << "setwise coprime" << endl;
    return 0;
  }
 
  cout << "not coprime" << endl;
  
 }


Measured memory_bytes: 11128
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

using namespace std;
using ll = long long;
using vpii = vector<pair<int, int>>;
using vpll = vector<pair<ll, ll>>;
// ceil() 切り上げ, floor() 切り捨て
// next_permutation(all(x))

int		main(void)
{
	int N, M;
	cin >> N >> M;
	int sum = 0;
	for (int i = 0; i < M; i++)
	{
		int A;
		cin >> A;
		sum += A;
	}
	if (sum > N)
		cout << -1 << endl;
	else
		cout << N - sum << endl;
}



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

int H,N;
int t[100005][4];
int dp[100005][1<<4];

int main(){
  cin>>H>>N;
  for(int i=0;i<N;i++){
    int x,y;
    cin>>x>>y;
    t[y][x]=1;
  }
  
  for(int i=0;i<H;i++)
    for(int j=0;j< (1<<4);j++)
      dp[i][j]=-100000000;
  
  dp[0][0]=0;
  int ans=0;
  
  for(int i=0;i<H;i++){
  
    for(int b=0;b<(1<<4);b++){
      
      ans=max(ans,dp[i][b]);
      if(i==H-1)continue;
      
      int tmp[2][4]={};
      
      for(int j=0;j<4;j++){
        tmp[0][j]=t[i][j];
        tmp[1][j]=t[i+1][j];
        tmp[0][j]|=(b>>j&1);
      }

      dp[i+1][0]=max(dp[i+1][0],dp[i][b]);
      
      if(!tmp[0][0]&&!tmp[0][1]&&!tmp[1][0]&&!tmp[1][1]){
        dp[i+1][3]=max(dp[i+1][3],dp[i][b]+1);
      }
      
      if(!tmp[0][1]&&!tmp[0][2]&&!tmp[1][1]&&!tmp[1][2]){
        dp[i+1][6]=max(dp[i+1][6],dp[i][b]+1);
      }
      
      if(!tmp[0][2]&&!tmp[0][3]&&!tmp[1][2]&&!tmp[1][3]){
        dp[i+1][12]=max(dp[i+1][12],dp[i][b]+1);
      }
      
      if(!tmp[0][0]&&!tmp[0][1]&&!tmp[1][0]&&!tmp[1][1]){
        if(!tmp[0][2]&&!tmp[0][3]&&!tmp[1][2]&&!tmp[1][3]){
          dp[i+1][15]=max(dp[i+1][15],dp[i][b]+2);
        }
      }
      
    }

    
  }

  cout<<ans<<endl;
  return 0;
}

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

int main() {
	int n;
	cin >> n;
	vector<int> r(n);

	for(int i = 0; i < r.size(); ++i) cin >> r[i];

	// insertionSort
	[&] {
		for(int i = 0; i < r.size(); ++i) {
			int v = r[i];
			int j = i - 1;
			while(j >= 0 && r[j] > v) {
				r[j+1] = r[j];
				j--;
			}
			r[j+1] = v;

			// presentation
			for(int j = 0; j < r.size(); ++j) {
				cout << r[j];
				if(j == r.size()-1) cout << endl;
				else cout << " ";
			}
		}
	}();

	return 0;
}

Measured memory_bytes: 3092
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define ll long long
using namespace std;
//typedef vector<unsigned int>vec;
//typedef vector<ll>vec;
//typedef vector<vec> mat;
typedef pair<int, int> P;
typedef pair<ll,ll> LP;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const int INF = 1000000000;
const ll LINF = 1000000000000000000;//1e18
const ll  MOD = 1000000007;
const double PI = acos(-1.0);
const double EPS = 1e-10;

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; }
//template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int K;
    cin >> K;
    int v[32] ={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
    cout << v[K-1] << endl;
}

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

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;
string char_to_string(char val) {
    return string(1, val);
}

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

    for(int i = 0; i < s.size(); i = i + 2) {
        cout << s[i];
    }
    cout << endl;
}

Measured memory_bytes: 512
#include<stdio.h>
int main(){
  char b;
  scanf("%s",&b);
  if(b == 'A')printf("T\n");
  if(b == 'T')printf("A\n");
  if(b == 'G')printf("C\n");
  if(b == 'C')printf("G\n");
  return 0;
}

Measured memory_bytes: 128
import java.util.*;

public class Main {
    public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int ac = 0;
		int wa = 0;
		int tle = 0;
		int re = 0;

        for(int i = 0; i < n; i++){
            String str = sc.next();
            switch(str){
                case "AC":
                    ac++;
                    break;
                case "WA":
                    wa++;
                    break;
                case "TLE":
                    tle++;
                    break;
                case "RE":
                    re++;
                    break;
                default:
                    break;
            }
        }
        
        System.out.println("AC x " + String.valueOf(ac));
        System.out.println("WA x " + String.valueOf(wa));
        System.out.println("TLE x " + String.valueOf(tle));
        System.out.println("RE x " + String.valueOf(re));
		
	}
}


Measured memory_bytes: 48744
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

const ll INF = 1LL << 60;

ll a, b;
int main() {
    cin >> a >> b;
    if (a == 0 || b == 0) {
        cout << "Zero" << endl;
        return 0;
    }

    // 0 をまたぐので 0
    if (a < 0 && b > 0 || a > 0 && b < 0) {
        cout << "Zero" << endl;
        return 0;
    }

    // 両方マイナス
    if (a < 0 && b < 0) {
        // 個数
        ll target = -b - (- a) + 1;
        if (target % 2 == 0) {
            cout << "Positive" << endl;
        } else {
            cout << "Negative" << endl;
        }
    } else {
        // 両方プラス
        cout << "Positive" << endl;
    }
}

Measured memory_bytes: 256
S = str(input())
T = str(input())
x = 0
ans = 100000000

for i in range(len(S) - len(T) + 1):
  if S[i:len(T)+i+1] == T:
    print(0)
    exit()
  else:
    for j in range(len(T)):
      if S[i:len(T)+i+1][j] != T[j]:
        x += 1
      
    ans = min(x ,ans)
    x = 0
print(ans)

Measured memory_bytes: 9008
package main

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

type segmentTree struct {
	data   []int
	offset int
}

func newSegmentTree(n int) segmentTree {
	var result segmentTree
	t := 1
	for t < n {
		t *= 2
	}
	result.offset = t - 1
	result.data = make([]int, 2*t-1)
	return result
}

func (st segmentTree) updateAll(a []int) {
	for i, v := range a {
		st.data[st.offset+i] = 1 << uint(v)
	}
	for i := st.offset - 1; i > -1; i-- {
		st.data[i] = st.data[i*2+1] | st.data[i*2+2]
	}
}

func (st segmentTree) update(index, value int) {
	i := st.offset + index
	st.data[i] = 1 << uint(value)
	for i >= 1 {
		i = (i - 1) / 2
		st.data[i] = st.data[i*2+1] | st.data[i*2+2]
	}
}

func (st segmentTree) query(start, stop int) int {
	result := 0
	l := start + st.offset
	r := stop + st.offset
	for l < r {
		if l&1 == 0 {
			result = result | st.data[l]
		}
		if r&1 == 0 {
			result = result | st.data[r-1]
		}
		l = l / 2
		r = (r - 1) / 2
	}
	return result
}

func toInt(s string) int {
	result, err := strconv.Atoi(s)
	if err != nil {
		panic(err)
	}
	return result
}

func bitCount(a int) int {
	result := 0
	for a != 0 {
		if a&1 == 1 {
			result++
		}
		a >>= 1
	}
	return result
}

func main() {
	N := readInt()
	S := readString()

	t := make([]int, len(S))
	for i, v := range []byte(S) {
		t[i] = int(v - 'a')
	}

	st := newSegmentTree(N)
	st.updateAll(t)

	Q := readInt()
	for i := 0; i < Q; i++ {
		t := readString()
		if t == "1" {
			i := toInt(readString()) - 1
			c := int([]byte(readString())[0] - 'a')
			st.update(i, c)
		} else if t == "2" {
			l := toInt(readString())
			r := toInt(readString())
			fmt.Println(bitCount(st.query(l-1, r)))
		}
	}
}

const (
	ioBufferSize = 1 * 1024 * 1024 // 1 MB
)

var stdinScanner = func() *bufio.Scanner {
	result := bufio.NewScanner(os.Stdin)
	result.Buffer(make([]byte, ioBufferSize), ioBufferSize)
	result.Split(bufio.ScanWords)
	return result
}()

func readString() string {
	stdinScanner.Scan()
	return stdinScanner.Text()
}

func readInt() int {
	result, err := strconv.Atoi(readString())
	if err != nil {
		panic(err)
	}
	return result
}

func readInts(n int) []int {
	result := make([]int, n)
	for i := 0; i < n; i++ {
		result[i] = readInt()
	}
	return result
}


Measured memory_bytes: 15104
#include<stdio.h>
#define MAX 1000000
int main(){
  int i,j=1,n,q,cou=0;
    int S[MAX],key;

  
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&S[i]);
  }
    
  scanf("%d",&q);
  
  for(i=0;i<q;i++){
    scanf("%d",&key);
    for(j=0,S[n]=key;S[j]!=key;j++);
    if(j!=n)cou++;

  }
  
  /* for(i=0;i<q;i++){
     for(j=0;j<n;j++){
     if(T[i]==S[j])cou++;
     }
     }
  */
  printf("%d\n",cou);

  return 0;
}

Measured memory_bytes: 644
#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<ll,pll> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-9;
const ll mod=998244353;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

int n;
string s;

int main(){
	cin>>n>>s;
	ll a[3]={0,0,0},res=1;
	for(int i=0;i<3*n;i++){
		int t=0,I=1,J=2;
		if(s[i]=='G') t=1,I=0;
		if(s[i]=='B') t=2,J=0;
		if(a[I]&&a[J]){
			(res*=min(a[I],a[J]))%=mod;
			a[I]--;a[J]--;
		}
		else{
			if(!a[I]) swap(I,J);
			if(a[t]<a[I]) (res*=a[I]-a[t])%=mod;
			a[t]++;
		}
	}
	for(int i=1;i<=n;i++) (res*=i)%=mod;
	cout<<res<<endl;
}

Measured memory_bytes: 900
#include <bits/stdc++.h>
#include<algorithm>
#define int long long
using namespace std;
typedef pair<int,int> P;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define INF 1000000000000

int MOD=1000000007;
int modpow(int a,int x){
  if(a<0)a+=MOD;
  int ans=1;
  while(x>0){
    if(x&1) ans=ans*a%MOD;
      a=a*a%MOD;
      x>>=1;
  }
  return ans;
}

int gyaku(int n){
    return modpow(n,MOD-2);
}
////////////////////////////////////////////////////////////

signed main() {
  int n;
  cin>>n;
  vector<int>v(n);
  rep(i,n)cin>>v[i];
  int ans=v[0];
  rep(i,n-1){
    ans=lcm(ans,v[i+1]);
  }
  cout<<ans<<endl;
}


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

int main(){
    int A, B;
    cin >> A >> B;
    int n = 0;
    while(A <= B){
        if (A / 10000 == A % 10 && (A % 10000) / 1000 == (A % 100) / 10 ){
            n++;
        }
        A++;
    }
    cout << n << endl;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }
        int[] l = new int[n];
        int[] r = new int[n];
        l[0] = 0;
        r[n - 1] = 0;
        for (int i = 0; i < a.length - 1; i++) {
            l[i + 1] = gcd(l[i], a[i]);
            r[n - i - 2] = gcd(r[n - i - 1], a[n - i - 1]);
        }
        int max = gcd(l[0], r[0]);
        for (int i = 1; i < n; i++) {
            max = Math.max(max, gcd(l[i], r[i]));
        }
        System.out.println(max);
        sc.close();
    }

    static int gcd(int a, int b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }
}

Measured memory_bytes: 50528
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<functional>
#include<map>
#include<cstdlib>
#include<complex>
#include<numeric>
#include<set>
#include<deque>

using namespace std;
using Int = long long;
Int INF = 1LL << 60;
const Int MOD = 1000000000 + 7;

template<int Modulo = MOD> struct Mint {
	Int val;
	constexpr Mint(Int v = 0) noexcept : val(v% Modulo) {
		if (val < 0) v += Modulo;
	}
	constexpr int getmod() { return Modulo; }
	constexpr Mint operator - () const noexcept { return val ? Modulo - val : 0; }
	constexpr Mint operator + (const Mint& r) const noexcept { return Mint(*this) += r; }
	constexpr Mint operator - (const Mint& r) const noexcept { return Mint(*this) -= r; }
	constexpr Mint operator * (const Mint& r) const noexcept { return Mint(*this) *= r; }
	constexpr Mint operator / (const Mint& r) const noexcept { return Mint(*this) /= r; }
	constexpr Mint& operator += (const Mint& r) noexcept {
		val += r.val;
		if (val >= Modulo) val -= Modulo;
		return *this;
	}
	constexpr Mint& operator -= (const Mint& r) noexcept {
		val -= r.val;
		if (val < 0) val += Modulo;
		return *this;
	}
	constexpr Mint& operator *= (const Mint& r) noexcept {
		val = val * r.val % Modulo;
		return *this;
	}
	constexpr Mint& operator /= (const Mint& r) noexcept {
		Int a = r.val, b = Modulo, u = 1, v = 0;
		while (b) {
			Int t = a / b;
			a -= t * b; swap(a, b);
			u -= t * v; swap(u, v);
		}
		val = val * u % Modulo;
		if (val < 0) val += Modulo;
		return *this;
	}
	constexpr bool operator == (const Mint& r) const noexcept {
		return this->val == r.val;
	}
	constexpr bool operator != (const Mint& r) const noexcept {
		return this->val != r.val;
	}
	friend ostream& operator << (ostream& os, const Mint<Modulo>& x) noexcept {
		return os << x.val;
	}
	friend istream& operator >> (istream& is, Mint<Modulo>& x) noexcept {
		Int tmp; is >> tmp;
		x = Mint<Modulo>(tmp);
		return is;
	}
	friend constexpr Mint<Modulo> modpow(const Mint<Modulo>& a, Int n) noexcept {
		Mint res(1), tmp = a;
		while (n > 0) {
			if (n & 1) res *= tmp;
			tmp *= tmp;
			n >>= 1;
		}
		return res;
	}
};

using mint = Mint<>;

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	Int N, M;
	cin >> N >> M;

	Int temp = 1;
	for (Int i = 0; i < M; i++) {
		temp *= 2;
	}

	cout << (M * 1900 + 100 * (N - M)) * temp << "\n";
}

Measured memory_bytes: 256
import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		while (in.hasNext()) {
			int n = in.nextInt();
			System.out.println(num_prime(n));
		}
		in.close();
	}

	static int num_prime(int n) {
		int num = 0;
		if (2 <= n)
			num++;
		for (int i = 3; i <= n; i = i + 2) {
			if (is_prime(i))
				num++;
		}
		return num;
	}

	static Boolean is_prime(int n) {
		if (n <= 1)
			return false;
		if (n == 2)
			return true;
		if (n % 2 == 0)
			return false;
		for (int i = 3; i * i <= n; i = i + 2) {
			if (n % i == 0)
				return false;
		}
		return true;
	}
}

Measured memory_bytes: 26276
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <limits>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x * x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18

int main() {

	int n; cin >> n;

	cout << (n - 1) / 2 << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include<math.h>
#include<algorithm> 
#define rep(i,n) for (int i = 0; i < (n) ; ++i)
using namespace std;
using ll = long long ;
using P = pair<int, int> ;
#define PI 3.14159265358979323846264338327950
#define INF 1e18

int main() {
    int x, a ;
    cin >> x >> a ;
    if(x < a){
        cout << 0 << endl ;
    }
    else {
        cout << 10 << endl ;
    }
}

Measured memory_bytes: 3584
#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long long ll;
typedef pair<ll, ll> PLL;
typedef vector<int> VI;
typedef vector<char> VC;
typedef vector<double> VD;
typedef vector<string> VS;
typedef vector<ll> VLL;
typedef vector<PLL> VP;
const static int INF = 1000000000;
const static int MOD = 1000000007;
const int dx[4]={1, 0, -1, 0};
const int dy[4]={0, 1, 0, -1};
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; }
#define rep(i,n) for (ll i=0; i<(ll)(n); i++)
#define repd(i,n) for (ll i=n-1; i>=0; i--)
#define rept(i,m,n) for(ll i=m; i<n; i++)
#define stl_rep(itr, x) for (auto itr = x.begin(); itr != x.end(); ++itr)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define PF push_front
#define PB push_back
#define SORT(V) sort((V).begin(), (V).end())
#define RVERSE(V) reverse((V).begin(), (V).end())
#define paired make_pair
#define PRINT(V) for(auto v : (V)) cout << v << " "
//charを整数に
int ctoi(char c) { if (c >= '0' && c <= '9') { return c - '0'; } return 0; }
// 累積和 for (int i = 0; i < N; ++i) s[i+1] = s[i] + a[i]; 
void cum_sum(int N,vector<double> a, vector<double> &s){ for(int i=0; i<N; i++){ s[i+1]=s[i]+a[i];}}
//ユークリッドの控除法
ll gcd(ll a,ll b){
    if(b == 0) return a;
    return gcd(b,a%b);
}
//最小公倍数
ll lcm(ll a,ll b){
    ll g = gcd(a,b);
    return a / g * b; // Be careful not to overflow
}
//素数判定
bool is_prime(long long n) {
    if (n <= 1) return false;
    for (long long p = 2; p * p <= n; ++p) {
        if (n % p == 0) return false;
    }
    return true;
}
int getdigit(ll num){
    unsigned digit=0;
    while(num!=0){
        num /= 10;
        digit++;
    }
    return digit;
}
//空白文字も入力 getline(cin, S);
//桁数指定 setprecision

int main()
{
    ios::sync_with_stdio(0); 
    cin.tie(0); 
    cout.tie(0);
    double A, B;
    cin >> A >> B;
    rept(i,1,1010){
       double At=double(i)*0.08;
       double Bt=double(i)*0.1;
       string As=to_string(At);
       string Bs=to_string(Bt);
       if(int(At)==A && int(Bt)==B){
           cout << i << endl;
           return 0;
       }
    }
    cout << -1 << endl;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> iint;
typedef pair<ll,ll> llll;
const ll zero = 0;
const ll INF = 3000000000000000000; //10^18
const int inINF = 1000000000; //10^9
const ll MOD = 1000000007; //10^9+7
const ll MOD2 = 998244353;

// 1-indexedのBIT
struct BIT {
    vector<int> array;
    const int N;

    // 0として初期化
    BIT(int _N) : array(_N + 1, 0), N(_N) {}

    // 左からi番目にxを加える
    void add(int i, int x){
        int lsb;
        while(i <= N){
            array[i] += x;
            lsb = i & (-i);
            i += lsb;
        }
    }

    //左からi番目までのSUMを得る
    int getSUM1(int i){
        int ret = 0;
        int lsb;
        while(i >= 1){
            ret += array[i];
            lsb = i & (-i);
            i -= lsb;
        }
        return ret;
    }

    //左からi番目からj番目のSUMを得る
    int getSUM(int i, int j){
        return getSUM1(j) - getSUM1(i-1);
    }
};

int main(){
    ll N, K; cin >> N >> K;
    vector<ll> a(N);
    for (ll i = 0; i < N; i++) {
        cin >> a[i];
        a[i] = a[i] - K;
    }

    vector<ll> s(N+1);
    s[0] = 0;
    for (int i = 0; i < N; i++) {
        s[i+1] = s[i] + a[i];
    }

    map<ll, int> m;
    for (int i = 0; i < N+1; i++) {
        m[s[i]] = 1;
    }
    int ind = 1;
    for (auto v : m) {
        m[v.first] = ind;
        ind++;
    }
    for (int i = 0; i < N+1; i++) {
        s[i] = m[s[i]];
    }

    BIT bit(N+1);
    ll ans = 0;
    for (int i = 0; i < N+1; i++) {
        ans += bit.getSUM1(s[i]);
        bit.add(s[i], 1);
    }
    printf("%lld\n", ans);
}

Measured memory_bytes: 19612
#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int M = S.size();
  vector<char>s(M,'2');
  int A = 0;
  for (int i = 0; i < M; i++) {
    if (S.at(i) == '0'){
      s.at(A) = '0';
      A++;
    }
    else if (S.at(i) == '1'){
      s.at(A) = '1';
      A++;
    }
    else if (S.at(i) == 'B'){
      if (A != 0){
        s.at(A-1) = '2';
        A--;
      }
    }
  }
  for (int i = 0; i < M; i++) {
    if (s.at(i) != '2'){
      cout << s.at(i);
    }
  }
  cout << endl;
}

Measured memory_bytes: 3548
//#pragma GCC optimize("Ofast")
//#pragma GCC target("avx,avx2,fma")

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define F first
#define S second
#define ins insert
#define mp make_pair
#define fo(i, n1, n, x) for(int i = n1; i <= n; i += x)
#define foo(i, n, n1, x) for(int i = n; i >= n1; i -= x)
#define bit __builtin_popcount
#define md (l + ((r - l) / 2))
#define all(x) x.begin(),x.end()
#define eb emplace_back
#define ub upper_bound
#define lb lower_bound
#define ios ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define file(s) if (fopen(s".in", "r")) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout)

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef long double ld;

const int N = 2e5 + 11, mod = 1e9 + 7, mod2 = 998244353;
const ll MAX = 1e15 + 11;
const int INF1 = 2e9 + 11;
const ll INF2 = 2e18 + 11;
const double INF3 = 1e8 + 11;
const int base = 500;
const int P = 31;
const int dx[] = {1, -1, 0, 0, 1, 1, -1, -1};
const int dy[] = {0, 0, 1, -1, 1, -1, 1, -1};
const double EPS = 1e-4;
const double PI = acos(-1.0);


template<typename T> using ordered_set = tree <T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update>;
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }


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


mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int n, r, mx;
vector <int> g[N];
void dfs(int v, int pr, int dist) {
    if (mx < dist) {
        mx = dist;
        r = v;
    }
    for (int to : g[v]) {
        if (to != pr) dfs(to, v, dist + 1);
    }
}
main() {
    file("rmq");
    ios;
    cin >> n;
    fo(i, 1, n - 1, 1) {
        int u, v;
        cin >> u >> v;
        g[u].eb(v);
        g[v].eb(u);
    }
    dfs(1, 1, -1);
    mx = -1;
    dfs(r, r, -1);
    if (mx % 3) cout << "First";
    else cout << "Second";
    return 0;
}
/**

*/


Measured memory_bytes: 20608
#include<iostream>
#include<algorithm>
#include<string>
#include<cmath>
#include<vector>
#include<map>
using namespace std;
int main() {
    int a[3];
    int x = 0, y = 0, z = 0;
    for(int i = 0; i < 3; i++){
        cin >> a[i];
    }
    for(int i = 0; i < 3; i++){
        if(a[i] == 5) x++;
        if(a[i] == 7) y++;
    }

    if(x == 2 && y == 1) cout << "YES" << endl;
    else cout << "NO" << endl;
    return 0;
}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,m;
  	cin>>n>>m;
  	int P[m+1],Y[m+1];
  	map<int,int>mp;
  	map<int,int>cnt;
    vector<pair<int,int>>v;
  	for(int i=0; i<m; i++){
      cin >> P[i] >> Y[i];
      v.push_back(make_pair(P[i],Y[i]));
    }
  	sort(v.begin(),v.end());
  	for(int i=0; i<m; i++){
      mp[v[i].first]++;
      cnt[v[i].second]=mp[v[i].first];
    }
  	for(int i=0; i<m; i++){
      cout << setw(6) << setfill('0') << P[i];
      cout << setw(6) << setfill('0') << cnt[Y[i]]<<endl;  
    }
}
 


Measured memory_bytes: 12404
#include <cstdio>
#include <vector>
#include <memory>
using namespace std;

int num[11];

int main()
{
	int n, m;
	int ans = 0;
	
	vector<int> con[11];
	int p[11];

	scanf("%d %d", &n, &m);

	for (int i = 1; i <= m; i++)
	{
		int amount;
		scanf("%d", &amount);
		for (int j = 0; j < amount; j++)
		{
			int temp;
			scanf("%d", &temp);
			con[temp].push_back(i);
		}
	}

	for (int i = 1; i <= m; i++)
		scanf("%d", &p[i]);

	for (int i = 0; i < 1 << n; i++)
	{
		memset(num, 0, sizeof(num));
		int temp = i;
		for (int j = 1; j <= n; j++)
		{
			int now = temp & 1;
			if (now)
			{
				for (int k = 0; k < con[j].size(); k++)
					num[con[j][k]]++;
			}
			temp = temp >> 1;
		}
		int flag = 0;

		for (int j = 1; j <= m; j++)
		{
			if (num[j] % 2 != p[j])
				flag = 1;
		}
		if (flag == 0)
			ans++;
	}

	printf("%d", ans);

	return 0;
}

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

using namespace std;
#define ff(i, a, b) for(int i = (a), _b = (b); i <= _b; ++i)
#define rep(i, a, b) for(int i = (a), _b = (b); i < _b; ++i)
#define fd(i, a, b) for(int i = (a), _b = (b); i >= _b; --i)
#define SZ(x) ((int)(x).size())
#define db(x) cout << #x << " == " << x << endl
#define _ << ", " << 
#define X first
#define Y second
#define pb(x) push_back(x)
#define mp(x, y) make_pair(x, y)
#define endl '\n'
#define pc putchar
#define gc getchar 
#define bit(i) (1<<(i))

typedef long long ll;
typedef pair<int, int> ii;
typedef pair<ii, int> iii;

const int N=1e5+5;
int n,cnt[3];

void enter(){
	cin>>n;
	int tmp;
	ff(i,1,n){
		int c=0;
		cin>>tmp;
		while (tmp&&(tmp%2==0)){
			tmp/=2;
			++c;
		}
		c=min(c,2);
		++cnt[c];
	}
}

void process(){
	int prv=2,mx=0,ans=1;
	ff(i,1,n){
		int c;
		if (!mx) {
			for(c=0;c<=2;++c) if (cnt[c]) break; 
		}
		else { 
			for(c=2;c>=0;--c) if (cnt[c]) break;
		}

		if (c+prv<2) ans=0;
		prv=c;
		--cnt[c];
		mx=1-mx;
	}
	if (ans==0) cout<<"No"<<endl;
	else cout<<"Yes"<<endl;
}

int main(){
	ios_base::sync_with_stdio(false); cin.tie(NULL);
	//freopen("test.inp","r",stdin);
	//freopen("test.out","w",stdout);

	enter();
	process();	

	return 0;
}

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

int main(){
    int R, G, B, N;
    cin >> R >> G >> B >> N;

    int ans=0;
    for(int r=0; r<=N; r++){
        for(int g=0; g<=N; g++){
            int nokori=N-(R*r+G*g);
            if(0<=nokori && nokori%B==0) ans++;
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define rep(i, n) for (int i = 0; i < (n); i++)
 
int main(){
    int N;
    cin >> N;
    vector<pair<int,int>> R(N);
    vector<pair<int,int>> B(N);
    bool F[N] = {};
    int a,b;
    rep(i,N){
        cin >> a >> b;
        R[i] = make_pair(b,a);
    }
    rep(i,N){
        cin >> a >> b;
        B[i] = make_pair(a,b);
    }
    sort(R.begin(),R.end());
    sort(B.begin(),B.end());
    int count = 0;
    rep(i,B.size()){
        for(int j=R.size()-1;0<=j;j--){
            if(R[j].first < B[i].second && R[j].second < B[i].first && !F[j]){
                F[j] = true;
                count++;
                break;
            }
        }
    }
    cout << count << endl;

    return 0;
}

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

using namespace std;

#define F first
#define S second
#define modulo ll (1e9 + 7)

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

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

const int N = 55, M = 3e3, OO = 0x3f3f3f3f;
const ll llOO = 0x3f3f3f3f3f3f3f3f;

int main(){
    init();

    string a[] = {"dream", "dreamer", "erase", "eraser"};
    string  s;  cin >> s;
    int n = s.size();
    for(int i = n - 1;i >= 0;i--){
        string w = s.substr(i);
        for(int j = 0;j < 4;j++)    if(w == a[j]){
            s.erase(i);
        }
    }

    cout << (s.empty() ? "YES" : "NO");
}

Measured memory_bytes: 512
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in)) {
			String s = sc.nextLine();

			do {
				s = s.substring(0, s.length() - 1);
				if (s.length() % 2 != 0) {
					continue;
				}
				String a = s.substring(0, s.length() / 2);
				String b = s.substring(s.length() / 2, s.length());

				if (a.equals(b)) {
					System.out.println(a.length() * 2);
					return;
				}
			} while(0 < s.length());
		}
	}
}

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

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n, k; cin >> n >> k;
    vector<int> c(n, 0);
    for (int i = 0; i < k; i++) {
        int d; cin >> d;
        for (int j = 0; j < d; j++) {
            int e; cin >> e;
            c[--e]++;
        }
    }
    int ans = 0;
    for (int i = 0; i < n; i++) ans += (c[i] == 0);
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 3616
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>

using namespace std;


#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repr(i,n) for(int (i)=(n); (i)>=(0); (i)--)
#define SIZE(x) ((int)(x).size())
#define GCD(a, b) int gcd(int a,int b){return b?gcd(b,a%b):a;}
#define QP(a, b) int qp(int a,ll b){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define all(v) (v).begin(),(v).end()


template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
template<typename A, size_t N, typename T>
void FILL(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

typedef vector<int, int> vint;
typedef pair<int,int> pint;
typedef vector<pint>vpint;
typedef long long ll;

int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const ll INF = 1LL << 60;
const ll MOD = 1000000007LL;


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n, k; cin >> n >> k;
    if(k == 1) cout << 0;
    else cout << n - k;
    cout << endl;
    return 0;
}


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

namespace SaoTi
{
	const int N=101000;
	bool cmp(int *s,int *t,int n)
	{
		static int A[N],B[N];
		memcpy(A+1,s+1,n*4),std::sort(A+1,A+n+1);
		memcpy(B+1,t+1,n*4),std::sort(B+1,B+n+1);
		for(int i=1;i<=n;i++)if(A[i]!=B[i])return 0;
		return 1;
	}
	std::map<int,int> id;
	int fa[N],sel[N];
	void reset(int n){for(int i=1;i<=n;i++)fa[i]=i;}
	int ask(int p){return p==fa[p]?p:fa[p]=ask(fa[p]);}
	void link(int u,int v){fa[ask(u)]=ask(v);}

	int A[N],B[N];
	int n,tot;
	void solve()
	{
		scanf("%d",&n);
		A[n+1]=0;
		for(int i=1;i<=n;i++)
			scanf("%d",A+i),A[n+1]^=A[i];
		B[n+1]=0;
		for(int i=1;i<=n;i++)
			scanf("%d",B+i),B[n+1]^=B[i];
		if(!cmp(A,B,n+1)){printf("-1\n");return ;}

		int ans=0;

		reset(n+1);
		for(int i=1,u,v;i<=n;i++)
			if(A[i]!=B[i])
			{
				ans++;
				if(!id.count(A[i]))id[A[i]]=++tot;
				if(!id.count(B[i]))id[B[i]]=++tot;
				u=id[A[i]],v=id[B[i]];
				link(u,v);
			}

		for(int i=1;i<=tot;i++)
			if(fa[i]==i)ans++;
		if(!id.count(A[n+1]))ans++;
		ans--;
		printf("%d\n",ans);
	}
}

int main()
{
	SaoTi::solve();
	return 0;
}


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

#define LL long long
#define pii pair<int,int>
using namespace std;
const int inf = 2147483647;
const int mod = 1e9 + 7;
const int N = 5001;

int _max(int x, int y) {return x > y ? x : y;}
int _min(int x, int y) {return x < y ? x : y;}
inline int read() {
    int x = 0, f = 1; char ch = getchar();
    while(ch < '0' || ch > '9') {if(ch == '-') f = -1; ch = getchar();}
    while(ch >= '0' && ch <= '9') x = (x << 3) + (x << 1) + (ch ^ 48), ch = getchar();
    return x * f;
}
void put(int x) {
	if(x < 0) putchar('-'), x = -x;
	if(x >= 10) put(x / 10);
	putchar(x % 10 + '0');
}

struct edge {
	int x, y, next;
} e[2 * N]; int len, last[N];
int n, mn, tot[N], f[N], jc[N], inv[N], tmp[N], hh[N], F[N];

int add(int x, int y) {
	x += y;
	return x >= mod ? x - mod : x;
}
int dec(int x, int y) {
	x -= y;
	return x < 0 ? x + mod : x;
}
int pow_mod(int a, int k) {
	int ans = 1;
	while(k) {
		if(k & 1) ans = (LL)ans * a % mod;
		a = (LL)a * a % mod, k /= 2;
	} return ans;
}
int C(int n, int m) {return (LL)jc[n] * inv[m] % mod * inv[n - m] % mod;}

void ins(int x, int y) {
	e[++len].x = x, e[len].y = y;
	e[len].next = last[x]; last[x], last[x] = len;
}

void findrt(int x, int fa) {
	tot[x] = 1;
	for(int k = last[x]; k; k = e[k].next) {
		int y = e[k].y;
		if(y != fa) {
			findrt(y, x);
			tot[x] += tot[y];
			f[x] = _max(f[x], tot[y]);
		}
	} f[x] = _max(f[x], n - tot[x]);
	mn = _min(mn, f[x]);
}

int main() {
	n = read();
	for(int i = 1; i < n; i++) {
		int x = read(), y = read();
		ins(x, y), ins(y, x);
	} mn = n + 1, findrt(1, 0);
	int h1 = 0, h2 = 0;
	for(int i = 1; i <= n; i++) {
		if(f[i] == mn) h2 = h1, h1 = i;
	} if(h2) {
		int ans = 1;
		for(int i = 1; i <= n / 2; i++) ans = (LL)ans * i % mod;
		put((LL)ans * ans % mod), puts("");
	} else {
		jc[0] = 1; for(int i = 1; i <= n; i++) jc[i] = (LL)jc[i - 1] * i % mod;
		inv[n] = pow_mod(jc[n], mod - 2); for(int i = n; i >= 1; i--) inv[i - 1] = (LL)inv[i] * i % mod;
		F[0] = 1; int s = 0;
		for(int k = last[h1]; k; k = e[k].next) {
			int y = e[k].y;
			findrt(y, h1);
			for(int i = 0; i <= s + tot[y]; i++) tmp[i] = 0;
			for(int j = 0; j <= tot[y]; j++) {
				for(int i = s; i >= 0; i--) {
					tmp[i + j] = add(tmp[i + j], (LL)F[i] * jc[tot[y]] % mod * inv[tot[y] - j] % mod * C(tot[y], j) % mod);
				}
			} s += tot[y];
			for(int i = 0; i <= s; i++) F[i] = tmp[i];
		} int ans = 0;
		for(int i = 0; i < n; i++) ans = i & 1 ? dec(ans, (LL)F[i] * jc[n - i] % mod) : add(ans, (LL)F[i] * jc[n - i] % mod);
		put(ans), puts("");
	}
	return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
//    std::sort(a.begin(), a.end(), std::greater<int>() );
#define REP(i, s, n) for (int i = s; i < n; ++i)
#define rep(i, n) REP(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG false

int main()
{
    int n;
    cin >> n;
    int ans = 2;
    if (n == 1)
    {
        cout << 1 << endl;
        return 0;
    }

    while (true)
    {
        if (n < ans)
        {
            cout << ans / 2 << endl;
            return 0;
        }
        ans*=2;
    }
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int ct=0;
    for(int i=1;i<=n;i++)
    {
        int c;
        cin>>c;
        if(c%2&&i%2)
        ct++;
    }
    cout<<ct<<endl;
}

Measured memory_bytes: 3568
import java.util.Scanner;

class Main {
    public static void main(String args[]){
	Scanner sc = new Scanner(System.in);
	int a,p,maxap;

	a = sc.nextInt();
	p = sc.nextInt();

	maxap = (3*a + p) /2;

	System.out.println(maxap);
    }
}


Measured memory_bytes: 21972
#include <bits/stdc++.h>
#define err(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)

using namespace std;

typedef long long ll;

int main() {
    int n, m;

    cin >> n >> m;


    double cur = 0;

    double t = 1;
    for (int i = 0; i < m; i++) t /= 2;

    double p0 = 1 - t;
    double p = 1;

    for (int it = 1; it <= 1e5; it++) {

        cur += (100 * (n - m) + 1900 * m) * it * p * t;

        p *= p0;

        //err("p = %lld\n", p);
    }

    cout << (ll)(cur + 0.5) << "\n";

    return 0;
}


Measured memory_bytes: 256
# 入力 : 横並びの数字N個（リスト内包表記で）
N = int(input())
list_a = [int(x) for x in input().split()]

# 大きい順にソートして、交互にとったときの差
list_a.sort(reverse = True)

Alice = 0
Bob = 0

for i in range(len(list_a)) :
    if i%2 == 0:
        Alice += list_a[i]
    else :
        Bob += list_a[i]

print(Alice-Bob)


Measured memory_bytes: 3060
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>
#include <string>
#include <queue>

using namespace std;

typedef long long int ll;
typedef long int li;


int main(void){
    int n;
    cin >> n;
    int t[n];
    for(int i=0;i<n;i++)cin >> t[i];
    sort(t,t+n);
    int sum=0;
    for(int i=0;i<n-1;i++)sum+=t[i];
    if(sum>t[n-1])cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}



Measured memory_bytes: 256