akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <functional>
#include <map>
#include <iomanip>
#include <math.h> 
#include <stack>
#include <queue>
#include <bitset>
#include <cstdlib>
#include <tuple>
#include <cctype>
#include <ctype.h>
#include <set>
#include <sstream>

using namespace std;

int main() {
	int i, j, k;
	string s;

	cin >> s;

	for (i = 0; i < 3; i++) {
		if (s[i] == '1') {
			cout << 9;
		}
		else if (s[i] == '9') {
			cout << 1;
		}
	}

	cout << endl;










	getchar();
	getchar();
	return 0;
}

Measured memory_bytes: 256
using System;
using System.Linq;

namespace _1_A
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] A = new int[n];
            A = Console.ReadLine().Split().Select(int.Parse).ToArray();
            Console.Write(A[0]);
            for (int i = 1; i < n; i++)
            {
                Console.Write(" " + A[i]);
            }
            Console.WriteLine();
            for (int i = 1; i < n; i++)
            {
                int v = A[i];
                int j = i - 1;
                while (j >= 0 && A[j] > v)
                {
                    A[j + 1] = A[j];
                    j--;
                }
                A[j + 1] = v;
                Console.Write(A[0]);
                for (int k = 1; k < n; k++)
                {
                    Console.Write(" " + A[k]);
                }
                Console.WriteLine();
            }
            Console.ReadLine();
        }
    }
}

Measured memory_bytes: 9600
def main():
    import sys
    input = sys.stdin.readline
    class BIT:
        def __init__(self,n):
            self.tree = [0]*(n+1)
            self.size = n
        
        def add(self,i,x):
            while i <= self.size:
                self.tree[i] += x
                i += i&-i
        
        def sum(self,i):
            s = 0
            while i > 0:
                s += self.tree[i]
                i -= i&-i
            return s

    N,Q = map(int,input().split())
    bit = BIT(N)
    C = list(map(int,input().split()))
    query = []
    for i in range(Q):
        l,r = map(int,input().split())
        query.append([l,r,i])
    query.sort(key=lambda x: x[1])
    ans = [0]*Q
    #良い玉のindexを1-indexで管理する
    colorMemo = [0]*(N+1)
    cur = 1
    for q in query:
        l,r,j = q
        #良い玉の情報を更新する
        for i in range(cur,r+1):
            c = C[i-1]
            if colorMemo[c]:
                bit.add(colorMemo[c],-1)
            bit.add(i,1)
            colorMemo[c] = i
        cur = r + 1
        ans[j]=bit.sum(r)-bit.sum(l-1)

    for a in ans:
        print(a)
main()

Measured memory_bytes: 226292
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
using edge = tuple<int, int, int>;  // w, s, t

struct unionFind {
  vector<int> d;  // 根： 木のサイズ x -1, それ以外： 親のID
  unionFind(int n = 0) : d(n, -1) {}
  int find(int x) {
    if (d[x] < 0) return x;
    return d[x] = find(d[x]);
  }
  bool unite(int x, int y) {
    // root化しておく
    x = find(x);
    y = find(y);
    if (x == y) return false;

    // x を y に unite
    // d[x] のほうが多きい（=サイズが小さい）場合はswap
    if (d[x] > d[y]) swap(x, y);
    d[x] += d[y];
    d[y] = x;
    return true;
  }
  bool same(int x, int y) { return find(x) == find(y); }
  int size(int x) { return -d[find(x)]; }
} uf;

const int MAX_N = 1e4;
vector<edge> G;
int V, E;

void kruskal() {
  ll ans = 0;
  uf = unionFind(V);
  uf.d = vector<int>(V);
  rep(i, V) uf.d[i] = -1;
  sort(G.begin(), G.end());
  for (edge e : G) {
    int w = get<0>(e), s = get<1>(e), t = get<2>(e);
    if (!uf.same(s, t)) {
      uf.unite(s, t);
      ans += w;
    }
  }
  cout << ans << endl;
}

int main() {
  cin >> V >> E;
  G = vector<edge>(E);
  rep(i, E) {
    int s, t, w;
    cin >> s >> t >> w;
    G[i] = edge(w, s, t);
  }
  kruskal();
  return 0;
}


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

int main()
{


        long long n,m,a,b,c,d,e,f,g,h,p,q,r,fr,sc,tr,sz,tz,i,j,k,mx=LLONG_MIN,mn=LLONG_MAX;
        long long x=1,y=0,cnt=0,res=0,ttl=0,ans=0,sum=0; long long flg=0,flag=1,na=0,as=1;
        vector<long long>u,v,w; vector< pair<long long,long long> >vct; vector<string>vst;
        set<long long>st,nt,tt; map<char,char>mp,nq,qr; string str,ttr,ntr;

        scanf("%lld %lld",&n,&k);

        for(i=0;i<n;i++)
        {
            scanf("%lld",&a);  v.push_back(a);

        }

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


        for(i=0;i<k;i++)res=res+v[i];


        cout<<res<<endl;






        return 0;

}





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

int main(){
    int w,h,n;
    cin >> w >> h >> n;
    char c[h][w];
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            c[i][j] = '.';
        }
    }

    for(int k=0;k<n;k++){
        int x,y,a;
        cin >> x >> y >> a;
        switch (a)
        {
            case 1:
                for(int i=0;i<h;i++){
                    for(int j=0;j<x;j++){
                        c[i][j] = '#';
                    }
                } 
                break;
            case 2:

                for(int i=0;i<h;i++){
                    for(int j=x;j<w;j++){
                        c[i][j] = '#';
                    }
                } 
                break;
            case 3:

                for(int i=0;i<y;i++){
                    for(int j=0;j<w;j++){
                        c[i][j] = '#';
                    }
                } 
                break;
            case 4:

                for(int i=y;i<h;i++){
                    for(int j=0;j<w;j++){
                        c[i][j] = '#';
                    }
                } 
                break;
            default:
                break;
        }
    }
    int ans = h*w;
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            //cout << c[i][j];
            if(c[i][j] == '#'){
                ans --;
            }
        }
        //cout << endl;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
// なんでこれがダメなの？？？？？？？？？？？？？？？？？？？？？？？？？？？？？？？？？？？？？ 
// 3 4 5
package main
import (
	"fmt"
	"sort"
)
func main(){
	A := make([]int, 3)
	for i:=0; i<3; i++{
		fmt.Scan(&A[i])
	}
	sort.Ints(A)
	minimum,maximum := A[0], A[2]
	if minimum == maximum{
		fmt.Println(0)
		return
	}
	ans := 0
	if (maximum-minimum)%2 == 0{
		ans += (maximum - minimum)/2
	}else{
		A[1]++
		ans += (maximum - minimum)/2 + 1
	}
	A[0] = A[2]
	sort.Ints(A)
	if (A[2]-A[0])%2==0{
		ans += (A[2]-A[0])/2
	}else{
		if A[0] == A[1]{
			ans += (A[2]-A[1])/2+1
		}else if A[1] == A[2]{
			ans += (A[2]-A[0])/2+2
		}else{
			panic("あわわわわ")
		}
	}
	fmt.Println(ans)
}

Measured memory_bytes: 1840
#include <bits/stdc++.h>
#define MOD 1000000007

using namespace std;

typedef long long ll;

ll facd[5005];

void pre(int n) {
  facd[0]=1;
  for(int i=1;i<=n;i++) facd[i]=facd[i-1]*(2*i-1)%MOD;
}

vector <int> e[5005];

int f[5005][5005],size[5005];

void dfs(int x,int fa) {
  static int g[5005];
  size[x]=1;
  f[x][1]=1;
  for(int i=0;i<e[x].size();i++)
    if (e[x][i]!=fa) {
    	int u=e[x][i];
    	dfs(u,x);
    	memset(g,0,sizeof(g));
    	for(int j=1;j<=size[x];j++)
    	for(int k=0;k<=size[u];k++)
    	  g[j+k]=(g[j+k]+(ll)f[x][j]*f[u][k])%MOD;
    	size[x]+=size[u];
    	for(int j=1;j<=size[x];j++) f[x][j]=g[j];
	}
  for(int i=2;i<=size[x];i+=2) f[x][0]=(f[x][0]-f[x][i]*facd[i>>1])%MOD;
}

int main() {
  int n;
  scanf("%d",&n);
  pre(n);
  for(int i=1;i<n;i++) {
  	int x,y;
  	scanf("%d%d",&x,&y);
  	e[x].push_back(y);
  	e[y].push_back(x);
  }
  dfs(1,0);
  printf("%d\n",(MOD-f[1][0])%MOD);
  return 0;
}

Measured memory_bytes: 97408
import copy
n=int(input())
s=list(input())
x=[]
y=copy.copy(s)
num=0
for i in range(n):
    x+=[s[i]]
    y.pop(0)
    if len(set(x)&set(y))>num:
        num=len(set(x)&set(y))
    
print(num)

Measured memory_bytes: 3444
//author:luckYrat(twitter:@luckYrat_)
//#include <bits/stdc++.h>

//def
#include <iostream>

#include <cmath>
#include <algorithm>
#include <iomanip>

//array
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <utility>
#include <climits>



using namespace std;

using ll = long long;
using P = pair<ll,ll>;

#define anyfill(n,s) setw(n) << setfill(s)
#define loop(s) for(int i = 0; s > i; i++)
#define rep(i,q) for(int i = 0; (q) > i; i++)
#define repp(i,n,q) for(int i = n; (q) > i; i++)
#define dep(i,q) for(int i = (q); 0 < i; i--)


#define MAX 1000000000
const int mod = 1000000007;
#define EPS (1e-10)

#define pb push_back
#define fir first
#define scn second
#define ednl endl

#define YesNo(a) (a?"Yes":"No")
#define YESNO(a) (a?"YES":"NO")
#define yesno(a) (a?"yes":"no")


P ar4[4] = {{0,1},{0,-1},{1,0},{-1,0}};
P ar8[8] = {{-1,-1},{-1,0},{-1,1},{0,-1},{0,1},{1,-1},{1,0},{1,1}};
/*
確認ポイント
cout << fixed << setprecision(n) << 小数計算//n桁の小数表記になる
vector.unique()は隣接した同じ要素を削除するので先にソートをする

計算量は変わらないが楽できるシリーズ
C++11以降でmin({a,b,c...})で複数個のmic,maxを処理できる
min(max)_element(iter,iter)で一番小さい(大きい)値のポインタが帰ってくる
count(iter,iter,int)でintがiterからiterの間にいくつあったかを取得できる

*/
__attribute__((constructor))
void initial() {
 cin.tie(0);
 ios::sync_with_stdio(false);
}



int main(){
  int k,x;cin>>k>>x;
  vector<int> A;
  for(int i = x-k+1; x+k-1 >= i; i++){
    if(-1000000 <= i && i <= 1000000){
      A.push_back(i);
    }
  }
  for(int i = 0; A.size() > i; i++){
    cout << A[i];
    if(i+1 != A.size())cout << " ";
  }
  cout << endl;
}


Measured memory_bytes: 256
<?php
fscanf(STDIN, "%d", $N);
$d = [];
for ($i = 0; $i < $N - 1; $i++) {
    fscanf(STDIN, "%d %d %d", $a, $b, $c);
    $d[$a][$b] = $c;
    $d[$b][$a] = $c;
}
fscanf(STDIN, "%d %d", $Q, $K);
$stack = [$K];
$distance = [$K => 0];
while($stack) {
    $tmp = array_pop($stack);
    foreach ($d[$tmp] as $v => $dist) {
        $distance[$v] = $distance[$tmp] + $d[$tmp][$v];
        unset($d[$tmp][$v]);
        unset($d[$v][$tmp]);
        array_push($stack, $v);
    }
}
$ans = [];
for ($i = 0; $i < $Q; $i++) {
    fscanf(STDIN, "%d %d", $x, $y);
    $ans[] = $distance[$x] + $distance[$y];
}
echo implode(PHP_EOL, $ans);


Measured memory_bytes: 63088
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 1000000000000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;


#define SIZE 61

ll N,K;
ll POW[SIZE];
ll table[SIZE][200005];

int main(){

	POW[0] = 1;
	for(int i = 1; i < SIZE; i++){

		POW[i] = POW[i-1]*2;
	}

	scanf("%lld %lld",&N,&K);

	for(int i = 0; i < N; i++){

		scanf("%lld",&table[0][i]);
		table[0][i]--;
	}

	for(int i = 1; i < SIZE; i++){
		for(int k = 0; k < N; k++){

			table[i][k] = table[i-1][table[i-1][k]];
		}
	}

	ll current = 0;

	for(int i = SIZE-1; i >= 0; i--){
		if(POW[i] > K)continue;

		K -= POW[i];

		current = table[i][current];
	}

	printf("%lld\n",current+1);

	return 0;
}


Measured memory_bytes: 99112
#include<stdio.h>

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

  scanf("%d%d",&a,&b);

  if(a < 1 || a > 1000000000 || b < 1 || b > 1000000000){
    return 0;
  } 

  while(a != b){
    if(a > b){
      a = a-b;
    }
    else b =b-a;
  }
  printf("%d\n",a);

  return 0;
}

Measured memory_bytes: 592
#include <stdio.h>

int main(void)
{
	int a;
	int b;
	int c;
	
	scanf("%d",&a);
	scanf("%d",&b);
	scanf("%d",&c);
	
	if ((a+b)>=c){
		printf("Yes");
	}
	else {
		printf("No");
	}
	
	return (0);
}

Measured memory_bytes: 128
/**
 *   author: Shubham Srivastava
 *   created: 26 January 2020  21:23:32
**/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define MOD 1000000007
#define INF 0x7fffffff
#define sorti(v) sort(v.begin(),v.end())
#define sortd(v) sort(v.rbegin(),v.rend())
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vii;
ll parent[2000005];

ll helper(vector <int> &h, vector <int> &v, int w, int ind, int n, vector <vector <int> > &dp){
	if(w <= 0)
		return 0;
	if(ind == n)
		return INT_MAX;
	if(dp[ind][w] != -1)
		return dp[ind][w];
	return dp[ind][w] = min(v[ind] + helper(h,v,w-h[ind],ind,n,dp), helper(h,v,w,ind+1,n,dp));
}

int main(){
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL);
    ll w,n;cin>>w>>n;
    vector <vector <int> > dp(n+1,vector <int> (w+1,-1));
    vector <int> h(n), v(n);
    for(int i=0;i<n;i++){
    	cin>>h[i]>>v[i];
    }
    cout<<helper(h,v,w,0,n,dp);
   	return 0;
}

Measured memory_bytes: 40448
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<string>
#define line cout << endl
using namespace std;

int main () {
	char x;
	cin >> x;
	if (x >= 'A' && x <= 'Z') cout << "A";
	else cout << "a";
	line;
	return 0;
}


Measured memory_bytes: 3628
#include<bits/stdc++.h>
using namespace std;
const int N=200000+10;
int n,k,l,x,y,p1[N],p2[N];
map<pair<int,int>,int>m;
int find(int x,int *p){return p[x]==x?p[x]:p[x]=find(p[x],p);}
void cha(int x,int y,int *p)
{
  int px=find(x,p);
  int py=find(y,p);
  if(px!=py)  p[px]=py;
}
int main()
{
  scanf("%d%d%d",&n,&k,&l);
  for(int i=1;i<=n;i++)  p1[i]=i,p2[i]=i;
  for(int i=1;i<=k;i++)
    scanf("%d%d,",&x,&y),cha(x,y,p1);
  for(int i=1;i<=l;i++)
    scanf("%d%d,",&x,&y),cha(x,y,p2);
  for(int i=1;i<=n;i++)
    find(i,p1),find(i,p2);
  for(int i=1;i<=n;i++)
    m[make_pair(p1[i],p2[i])]++;
  for(int i=1;i<=n;i++)
    printf("%d ",m[make_pair(p1[i],p2[i])]);
  return 0;
}

Measured memory_bytes: 13568
#define _CRT_SECURE_NO_WARNINGS
#include<cstdio>
#include<iostream>
#include<stack>
#include<cstdlib>
#include<cstring>
#include<string>

using namespace std;

int main()
{
	string s;
	stack<int> S;
	int a, b, x;
	while (cin >> s)
	{
		if (s[0] == '+')
		{
			a = S.top(); 
			S.pop();
			b = S.top();
			S.pop();
			S.push(a + b);
		}
		else if (s[0] == '*')
		{
			a = S.top();
			S.pop();
			b = S.top();
			S.pop();
			S.push(a * b);
		}
		else if (s[0] == '-')
		{
			a = S.top();
			S.pop();
			b = S.top();
			S.pop();
			S.push(b-a);
		}
		else
		{
			int tmp = atoi(s.c_str());
			S.push(tmp);
		}
	}
	cout << S.top() << endl;
	return 0;
}


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

int main() {
	string N; cin >> N;
	for (int i = 0; i < 2; i++) {
		if(N[i]==N[i+1] && N[i+1] == N[i+2]){
			cout << "Yes" << endl;
			return 0;
		}
	}
	cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define nl '\n'
#define wee ios_base::sync_with_stdio(false), cin.tie(0);
typedef long long ll;
typedef unsigned long long ull;

using namespace std;

const int MAXN = 1000002;

int main() {
	wee
	int n, ans = 0;
	cin >> n;
	vector<int> a(n), c(MAXN);
	vector<bool> g(MAXN, true);
	for (auto &it : a) cin >> it;
	for (int i = 0; i < n; i++)
		c[a[i]] += 1;
	for (int i = 1; i < MAXN; i++)
		if (c[i] != 0)
			for (int j = i + i; j < MAXN; j += i)
				g[j] = false;
	for (int i = 0; i < MAXN; i++)
		if (g[i] && c[i] == 1)
			ans++;
	cout << ans << nl;
}

Measured memory_bytes: 8244
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		String S = stdIn.next();
		int lose = 0;
		for(int i = 0; i < S.length(); i++) {
			if(S.charAt(i) == 'x') {
				lose++;
			}
		}
		if(lose >= 8) {
			System.out.println("NO");
		}
		else {
			System.out.println("YES");
		}
	}

}

Measured memory_bytes: 21844
use text_io::*;
use std::process::exit;

fn main(){
    let mut a:isize = read!();
    let mut b:isize = read!();
    let mut c:isize = read!();
    let mut k:isize = read!();
    if k<=a {
        println!("{}",k);
    }
    else if k <= a+b {
        println!("{}",a);
    }
    else {
        println!("{}",a-k+a+b)
    }
}

Measured memory_bytes: 2188
S = str(input())
tmp1 = int(S[0:2])
tmp2 = int(S[2:4])
flag = ""

if tmp2>0 and tmp2<13:
    flag += "YM"
if tmp1>0 and tmp1<13:
    flag += "MY"

if flag == "YM":
    print("YYMM")
elif flag == "MY":
    print("MMYY")
elif flag =="YMMY":
    print("AMBIGUOUS")
else:
    print("NA")

Measured memory_bytes: 3064
#include <bits/stdc++.h>
 
#define ll long long int
#define ld long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define rep(i,a,b)	for(ll  i=a;i<b;i++)
#define hello777 ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#include <string>
#define pie 3.14159265358979323846
constexpr int MOD = 1e9+7;
const int MAX= 1e5+5;
using namespace std;


//ll gcd(int a, int b)
//{ 
//    if (a == 0) 
//        return b;  
//    return gcd(b % a, a);  
// } 
// 
//ll lcm(int a, int b)  
// {  
//    return a/gcd(a, b) *b;  
// }
//  
//int prime(int n)
//{
//	rep(i,2,n+1)
//	{
//		if(n%i==0)return i;
//	}
//	
//vector<unordered_set<int> > prime_factors(MAX,unordered_set<int>());
//int primes[MAX];
//int prefix[MAX][6];
//void sieve(){
//    //primes i stores the largest prime factor of a number....
//    for(int i=2;i<MAX;++i){
//        if(primes[i]!=0){
//            continue;
//        }
//        primes[i] = i;
//        for(int j=2*i;j<MAX;j+=i){
//            primes[j] = i;
//        }
//    }
//    
//    for(int i=2;i<MAX;++i){
//        int current = i;
//        
//        while(current!=1){
//            prime_factors[i].insert(primes[current]);
//            current = current/primes[current];
//        }
//    }
//    
//    for(int i=1;i<MAX;++i){
//        for(int k=1;k<=5;++k){
//            prefix[i][k] = prefix[i-1][k] + (prime_factors[i].size()==k);
//        }
//    }
//    
//}
const int m = 1e7+5;
vector<int> v(m);
void sieve(int n)
{
	rep(i,0,n+1)v[i] = 1;
//		for(int i = 2; i <= n; i+= 2)v[i]++;
	for(int i =2; i <= n;i++){
		for(int j = i; j <= n;j += i){
			v[j]++;
			// cout << v[j] << ' ';
		}
		// cout << endl;
	}
}
void solve() 
{	
	ll n;
	cin>>n;	
	sieve(n);
	ll ans=0;
	rep(i,1,n+1)
	{
		ans+=i*v[i];
	}
	cout<<ans<<endl;
}

int main()
{
	hello777;
	int q=1;
	
//    cin>>q;
    while(q--)
    {   
      solve();

    }
}



Measured memory_bytes: 42156
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		
		if (A==B) System.out.println(C);
		else if (B==C) System.out.println(A);
		else if (C==A) System.out.println(B);
		
	}
}


Measured memory_bytes: 22608
#include<iostream>
#include<math.h>
#include<set>
using namespace std;
#define l long long
#define pb push_back
void frooty()
{
	set<string> s;
	int n;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		string x;
		cin>>x;
		s.insert(x);
	}
	cout<<s.size()<<"\n";
}
int main()
{
	l t=1;
	//cin>>t;
	while(t--)
	{
		frooty();
	}
}

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

int main() {
  int A, B;
  cin >> A >> B;

  int Y;
  
  Y = A * B;
  
  if ((Y % 2) == 0){
  	cout << "Even" << endl;
  }
  else{
  	cout << "Odd" << endl;
  }

}
  
 

Measured memory_bytes: 3520
use std::io::{stdin, Read, StdinLock};
use std::str::FromStr;

fn main() {
    let cin = stdin();
    let mut scan = Scanner::new(cin.lock());
    let s = scan.chars();
    let t = scan.chars();
    let mut d = 0;
    for i in 0..3 {
        if s[i] == t[i] {d+=1;}
    }
    println!("{}", d);
}

// region template
#[allow(dead_code)]
fn iu(i: isize) -> usize { i as usize }

#[allow(dead_code)]
fn ui(i: usize) -> isize { i as isize }

#[allow(dead_code, deprecated)]
fn join<T: std::fmt::Display>(slice: &[T], sep: &str) -> String {
    let strings = slice.iter().map(|t| format!("{}", t)).collect::<Vec<_>>();
    strings.connect(sep)
}

#[allow(dead_code)]
fn arr<'a, S, T>(n: usize, mut f: S) -> Vec<T> where S: FnMut(usize) -> T + 'a {
    (0..n).map(|i| f(i)).collect::<Vec<T>>()
}

struct Scanner<'a> {
    cin: StdinLock<'a>,
}

#[allow(dead_code)]
impl<'a> Scanner<'a> {
    fn new(cin: StdinLock<'a>) -> Scanner<'a> {
        Scanner { cin: cin }
    }

    fn read1<T: FromStr>(&mut self) -> Option<T> {
        let token = self.cin.by_ref().bytes().map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        token.parse::<T>().ok()
    }

    fn read<T: FromStr>(&mut self) -> T {
        self.read1().unwrap()
    }

    fn readn<T: FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read::<T>()).collect()
    }

    fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}
// endregion

Measured memory_bytes: 4352
use proconio::input;
use std::collections::HashSet;
// use itertools::*;

fn main() {
  input!{
    n: usize,
    ss: [String; n]
  };
  let mut h = HashSet::with_capacity(n);
  for s in ss {
    h.insert(s);
  }
  println!("{}", h.len())
}


Measured memory_bytes: 21468
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    ll h=0,w=0;
    cin>>h>>w;
    char c;
    ll ar[h+1][w+1];
    for(ll i=0;i<=h;++i){
        for(ll j=0;j<=w;++j){
            ar[i][j]=1;
        }
    }
    for(ll i=1;i<=h;++i){
        for(ll j=1;j<=w;++j){
            cin>>c;
            if(c=='.')
                ar[i][j]=1;
            else
                ar[i][j]=0;
        }
    }
//    for(ll i=0;i<h;++i){
//        for(ll j=0;j<w;++j){
//            cout<<ar[i][j]<<" ";
//        }
//        cout<<"\n";
//    }
    ll dp[h+1][w+1];
    for(ll i=0;i<=h;++i){
        for(ll j=0;j<=w;++j){
            dp[i][j]=100000;
        }
    }

    dp[0][1]=dp[1][0]=0;
    for(ll i=1;i<=h;++i){
        for(ll j=1;j<=w;++j){
            if(ar[i][j])
                dp[i][j]=min(dp[i-1][j],dp[i][j-1]);
            else
                dp[i][j]=min(dp[i][j-1]+ar[i][j-1],dp[i-1][j]+ar[i-1][j]);
        }
    }
    cout<<dp[h][w];
   	return 0;
}


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

typedef long long ll;
ll MOD = 1000000007;

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

    if (a >= 3200) cout << s << endl;
    else cout << "red" << endl;
    
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using Graph = vector<vector<int>>;
using P = pair<int, int>;

int main()
{
  string S;cin>>S;
  if (S=="Sunny") cout<<"Cloudy"<<endl;
  else if (S=="Cloudy") cout<<"Rainy"<<endl;
  else if (S=="Rainy") cout<<"Sunny"<<endl;
}

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


int nrbiti1(int x) {
    int ret = 0;
    for (int i = 0; (x >> i); i++)
        ret += ((x >> i) & 1);
    return ret;
}

int n;
int A[20], pers[20][20], rasp[20][20];

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

    cin >> n;
    for (int i = 1; i <= n; i++) {
        cin >> A[i];
        for (int j = 1; j <= A[i]; j++) {
            cin >> pers[i][j];
            cin >> rasp[i][pers[i][j]];
        }
    }

    int ans = 0;
    for (int mask = 1; mask < (1 << n); mask++) {
        bool ok = 1;
        for (int i = 1; i <= n; i++) {
            if (mask & (1 << (i - 1))) { // sincer
                for (int j = 1; j <= A[i]; j++) {
                    int p = pers[i][j];
                    bool esteP = (mask & (1 << (p - 1))) ? 1 : 0;
                    if (esteP != rasp[i][p])
                        ok = 0;
                }
            }
        }

        if (ok)
            ans = max(ans, nrbiti1(mask));
        /*if (ok && ans == 1)
            cout << mask << " ";*/
    }

    cout << ans;


    return 0;
}

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

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

  int n;
  cin >> n;

  double result = 0;

  for (int i = 0; i < n; ++i) {
    double v;
    string currency;

    cin >> v;
    cin >> currency;

    if (currency == "BTC") {
      v *= 380000.0;
    }
    result += v;
  }

  cout << result;

  return 0;
}


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

int main() {
	char s[5];
	int a,b;
	scanf("%s", s,5);
	b = atoi(&s[2]);
	s[2] = '\0';
	a = atoi(s);
	int am, bm;
	if (a >= 1 && a <= 12) 	am = 1; else am = 0;
	if (b >= 1 && b <= 12) 	bm = 1; else bm = 0;

	if (am&&bm) printf("AMBIGUOUS\n");
	else if (am&&!bm) printf("MMYY\n");
	else if (!am&&bm) printf("YYMM\n");
	else printf("NA\n");

	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
using int64 = long long;
#define int int64
#define rep(i, n) for(int i=0; i<n; i++)
#define FOR(i, a, b) for(int i=a; i<b; i++)
#define SORT(x) sort(x.begin(), x.end())
#define GSORT(x) sort(x.begin(), x.end(), greater<int>())
#define mk make_pair
#define fi first
#define se second
#define pb push_back
#define ALL(x) x.begin(), x.end()
#define V(T) vector<T>
typedef pair<int, int> P;
typedef pair<P, P> PP;
typedef vector<int> vi;
typedef vector<vi> vvi;
int max(int a, int b) {if(b>a) return b; else return a;}
int min(int a, int b) {if(b<a) return b; else return a;}

int euq(int a, int b) {return b ? euq(b, a%b) : a;}

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

    int gcd;
    cin >> gcd;
    int res = gcd;
    rep(i, N-1) {
        int t;
        cin >> t;
        if(res < t) gcd = euq(t, res);
        else gcd = euq(res, t);
        
        res = res/gcd*t;
        //cout << res << endl;
    }

    cout << res << endl;
    
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
//#include <bits/stdc++.h>
#include<vector>
#include<float.h>
#include<iomanip>
#include<algorithm>
#include<string>
#include<cstring>
#include<math.h>
#include<cmath>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include <cassert>
#include <cmath>
#include<cstdint>

#define INF 1e9
#define rep(i,n)for(int i=0;(i)<(int)(n);i++)
#define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)
#define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i;
#define vec(type,n) vector<type>(n)
#define vvec(m,n) vector<vector<int>> (int(m),vector<int>(n))
#define ALL(a)  (a).begin(),(a).end()

using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using P = pair<int,int>;

vector<int>bitSearch(int bit,int n){
    vector<int>S;
    rep(i,n)if(bit&(1<<i))S.push_back(i);
    return S;
}


int d[3] = {-1,0,1};
int main(){
   int a,b;cin>>a>>b;
   if(b>=a)cout<<0;
   else cout<<a-b;
}



Measured memory_bytes: 256
#include<stdio.h>
#define MAX 100005
#define NIL -1

void print(int);
int rec(int,int);

typedef struct{
  int p;
  int l;
  int r;
}Node;

Node T[MAX];
int n,D[MAX];

int main(){

  int i, j, d, v, c, l, r;
  
  scanf("%d",&n);
  
  for(i=0;i<n;i++){
    T[i].p = NIL;
    T[i].l = NIL;
    T[i].r = NIL;
  }

  for(i=0;i<n;i++){
    scanf("%d",&v);
    scanf("%d",&d);
    for(j=0;j<d;j++){
      scanf("%d",&c);
      if(j==0) T[v].l=c;
      else T[l].r = c;
      l=c;
      T[c].p = v;
    }
  }

  for(i=0;i<n;i++){
    if(T[i].p==NIL) r=i;
  }

  rec(r,0);

  for(i=0;i<n;i++) print(i);

  return 0;
}

  
    
void print(int u){

  int i, c;

  printf("node %d: ",u);
  printf("parent = %d, ",T[u].p);
  printf("depth = %d, ",D[u]);

  if( T[u].p ==NIL ) printf("root, ");
  else if( T[u].l==NIL ) printf("leaf, ");
  else printf("internal node, ");

  printf("[");

  for(i=0,c=T[u].l;c!=NIL;i++,c=T[c].r){
    if(i!=0) printf(", ");
    printf("%d",c);
  }
  printf("]\n");

}


int rec(int u,int p){
  D[u] = p;
  if(T[u].r != NIL) rec(T[u].r,p);
  if(T[u].l != NIL) rec(T[u].l,p+1);
}

Measured memory_bytes: 5300
import bisect
import heapq
import math
N,A,B =list(map(int,input().split()))
h = [ int(input()) for _ in range(N)]
h.sort()


sp_damage = A-B
"""
heap = []
for hval in h:
    heapq.heappush(heap,-hval)
count = 0
while True:
    if heap[0]  >= -count*B:
        break
    count+=1
    hp = heapq.heappop(heap)
    hp += sp_damage
    heapq.heappush(heap,hp)
print(count)

"""
def nibun(func ,min_ ,max_ ):
    left = min_
    right= max_
    while not(left==right):
        mid = (left+right) //2
        tmp = func(mid)
        if tmp:
            right = mid
        else:
            left = mid+1
    return left

def check(num):
    i = num
    for hval in h:
        rest = hval-B*num
        if rest <= 0 :
            continue
        i -= math.ceil(rest/sp_damage)
        #print(rest,i)
        # sp * m + B*hval
    return i>=0

print(nibun(check,0,1000000000))



Measured memory_bytes: 7552
#include <bits/stdc++.h>
#include <math.h>
#define _GLIBCXX_DEBUG
using namespace std;
int main() {
 
  int X;cin>>X;
  
  if(X==3||X==5||X==7){
    cout<<"YES"<<endl;
  }
  else{
    cout<<"NO"<<endl;
  }
}

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

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

#define mod 1e9+7;
#define inf 1e18+7;

typedef long long ll;

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

    cout<<t<<s<<endl;

}


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

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

  int A, B;
  cin >> A >> B;
  int sum = 0;
  sum += A;
  int i = 1;
  for (i; ; i++) {
    if (sum >= B) break;
    sum += A - 1;
  }
  if (B == 1) cout << 0 << '\n';
  else cout << i << '\n';
}

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

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

using namespace std;
using lint=long long;

int main(){
	int n; scanf("%d",&n);
	vector<lint> a(n);
	rep(i,n) scanf("%lld",&a[i]);

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

	if(n%2==0){
		lint ans=0;
		rep(i,n){
			if     (i< n/2-1) ans-=2*a[i];
			else if(i==n/2-1) ans-=a[i];
			else if(i==n/2  ) ans+=a[i];
			else              ans+=2*a[i];
		}
		printf("%lld\n",ans);
	}
	else{
		lint ans1=0;
		rep(i,n){
			if     (i<n/2-1) ans1-=2*a[i];
			else if(i<n/2+1) ans1-=  a[i];
			else             ans1+=2*a[i];
		}
		lint ans2=0;
		rep(i,n){
			if     (i<n/2  ) ans2-=2*a[i];
			else if(i<n/2+2) ans2+=  a[i];
			else             ans2+=2*a[i];
		}
		printf("%lld\n",max(ans1,ans2));
	}

	return 0;
}


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

fn main() {
    let mut s: String = String::new();
    std::io::stdin().read_to_string(&mut s).ok();
    let mut itr = s.trim().split_whitespace();
    let a: i64 = itr.next().unwrap().parse().unwrap();
    let b: i64 = itr.next().unwrap().parse().unwrap();
    if a == 1 || b == 1 {
        println!("1");
        return;
    }
    let x = (b + 1) / 2;
    let y = b / 2;
    let z = (a + 1) / 2;
    let w = a / 2;
    println!("{}", x * z + y * w);
}


Measured memory_bytes: 4352
#include "bits/stdc++.h"
using namespace std;


int main(){
    int n,m;
    
    cin>>n>>m;
	map<long long,unsigned int> mp;

    vector<long long> v(n);
    vector<long long> sum(n+1);
    for (int i = 0; i < n; i++)
    {
        cin >> v[i];
    }
    
    sum[0]=0;
    for (int i = 0; i < n; i++)
    {
        sum[i+1]= sum[i]+v[i];
    }
    for (int i = 0; i <= n; i++)
    {
        sum[i] %= m;
    }
    
    long long ans=0;
    for (int i = 0; i <= n; i++)
    {
      int temp = sum[i]%m;
      	ans += mp[temp];
        mp[temp]++;
    }
    
    cout << ans <<endl;
    return(0);
}

Measured memory_bytes: 5760
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD=1e9+7;
const int INF=1e9;
const ll LINF=1e18;

int main(){
    ll n,k;
    cin>>n>>k;
    vector<pair<ll,ll>> p;
    for(ll i=1;i*i<=n;i++){
        ll l=n/(i+1);
        ll r=n/i;
        p.push_back({i,1});
        if(i<=l)p.push_back({r,r-l});
    }
    sort(p.begin(),p.end());
    int sz=p.size();
    ll dp[2][sz+1];
    dp[0][0]=dp[1][0]=0;
    for(int i=0;i<sz;i++){
        dp[0][i+1]=p[i].second;
        dp[0][i+1]=(dp[0][i+1]+dp[0][i])%MOD;
    }
    for(int i=1;i<k;i++){
        for(int j=0;j<sz;j++){
            int it=lower_bound(p.begin(),p.end(),make_pair(n/p[j].first,-1LL))-p.begin();
            dp[i&1][j+1]=(dp[(i+1)&1][it+1]*p[j].second)%MOD;
            dp[i&1][j+1]=(dp[i&1][j+1]+dp[i&1][j])%MOD;
        }
    }
    cout<<dp[(k-1)&1][sz]<<endl;
}

Measured memory_bytes: 2292
N,K=map(int, input().split())
def cmb(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p

p = 10 ** 9 + 7
n= 2*10 ** 5  # N は必要分だけ用意する
fact = [1, 1]  # fact[n] = (n! mod p) 階乗のmod
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p)
inv = [0, 1]  # factinv 計算用
 
for i in range(2, n + 1):
  fact.append((fact[-1] * i) % p)
  inv.append((-inv[p % i] * (p // i)) % p)
  factinv.append((factinv[-1] * inv[-1]) % p)


#0の数
zeros=min(K, N-1)
ans=1
for i in range(1,zeros+1):
    ans+=(cmb(N,i,p)*cmb(i+N-i-1, i, p))%p
    #print(pow(N-i, i, p))
    ans%=p

print(ans)

Measured memory_bytes: 27116
#include<iostream>
#include<stdlib.h>
#include<math.h>
#include<vector>
#include<algorithm>
#include<climits>
#include<string>
#include<map>
#include<queue>
using namespace std;

int main(){

	//#ifndef ONLINE_JUDGE
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	//#endif

	string S;
	cin>>S;

	bool ans = true;

	for(int i=0;i<S.length()-1;i++){
		if(S[i]==S[i+1])
			ans = false;
	}
	if(ans)
		cout<<"Good";
	else
		cout<<"Bad";


	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <utility>
#include <map>
#include <vector>
#include <algorithm>
#include <queue>
#include <math.h>
#include <stack>
#include <set>
#include <deque>
#include <cmath>
#include <cassert>

using namespace std;
typedef long long ll;
ll mod = 1e9+7;
#define rep(i,n) for(int i = 0; i < (n); ++i)

string dfs(ll n, string s) {
    if (n == 0) return s;
    --n;
    return dfs(n/26, (char)(n%26+'a')+s);
}

int main() {
    ll n;
    cin >> n;
    cout << dfs(n, "") << endl;
    return 0;
}


Measured memory_bytes: 3608
#include <iostream>

int main()
{
	int n; std::cin >> n;
	int* A = new int[n];
	
	for (int i=0; i<n; i++) std::cin >> A[i];
	
	int q; std::cin >> q;
	for (int i=0; i<q; i++) {
		int op, b, e;
		std::cin >> op >> b >> e;
		if (op==0) {
			int min = A[b];
			for (int j=b+1; j<e; j++) {
				if (min > A[j]) min = A[j];
			}
			std::cout << min << std::endl;
		} else {
			int max = A[b];
			for (int j=b+1; j<e; j++) {
				if (max < A[j]) max = A[j];
			}
			std::cout << max << std::endl;
		}
	}
	
	delete[] A;
	
	return 0;
}
		



Measured memory_bytes: 3104
#include <bits/stdc++.h>
#define vsort(v) sort(v.begin(), v.end())
#define rvsort(v) sort(v.begin(), v.end(), greater<ll>())

#define vfind(v, target) find(v.begin(), v.end(), target)
#define notFound(v, target) (vfind(v, target) == v.end())

#define ll long long
#define rep(i, s, g) for (ll i = (s); i < (g); i++)
#define MOD 1000000007
using namespace std;

int main()
{
  ll N; cin >> N;
  float p;
  if (N % 2) p = ((float)N + 1) / (2 * N);
  else p = 0.5;
  cout << p << endl;
}

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

using namespace std;

int main(){
  
  int N = 0,max = 0,sum = 0,i = 0;
  
  cin >> N;
  
  int C[N];
  
  for(i=0;N > i;i++)
    cin >> C[i];

  for(i=0;N > i;i++)
    if(C[i]>max)
      max = C[i];
  
  for(i=0;N > i;i++)
    sum += C[i];
  
  
    
  cout << (sum - max + max/2) << "\n";
    
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <algorithm>
#define N 301000
typedef long long ll;
template<typename T> inline void read(T &x) {
	x = 0; char c = getchar();
	while (!isdigit(c))	c = getchar();
	while (isdigit(c)) x = (x << 1) + (x << 3) + (c ^ 48), c = getchar();
}
using namespace std;
const int P = 998244353;
const int inv2 = 499122177;
inline ll quickpow(ll x, int k) {
	ll res = 1;
	while (k) {
		if (k & 1)	res = res * x % P;
		x = x * x % P;
		k >>= 1;
	}
	return res;
}
int n, nn;
ll p[N], I[N], f[N];
inline void FWT(ll *a, int type) {
	for (int i = 1; i < nn; i <<= 1) {
		for (int j = 0; j < nn; j += (i << 1)) {
			for (int k = 0; k < i; ++k) {
				if (type == 1) {
					int nx = a[j + k], ny = a[i + j + k];
					a[j + k] = (nx + ny) % P;
					a[i + j + k] = (nx - ny + P) % P;
				} else {
					int nx = a[j + k], ny = a[i + j + k];
					a[j + k] = 1ll * inv2 * (nx + ny) % P;
					a[i + j + k] = 1ll * inv2 * (nx - ny + P) % P;
				}
			}
		}
	}
}
int main() {
	read(n); nn = (1 << n);
	ll tot = 0;
	for (int i = 0; i < nn; ++i)	read(p[i]), tot += p[i];
	tot = quickpow(tot % P, P - 2);
	for (int i = 0; i < nn; ++i)	p[i] = p[i] * tot % P;
	p[0] = (p[0] - 1 + P) % P;
	I[0] = nn - 1;
	for (int i = 1; i < nn; ++i)	I[i] = P - 1;
	FWT(p, 1); FWT(I, 1);
	tot = 0;
	for (int i = 1; i < nn; ++i)	f[i] = I[i] * quickpow(p[i], P - 2) % P, tot += f[i];
	f[0] = P - tot % P;
	FWT(f, -1);
	for (int i = 0; i < nn; ++i)	printf("%lld\n", f[i]);
	return 0;
}


Measured memory_bytes: 9196
#include <bits/stdc++.h>
using namespace std;
#define rep(i, s, n) for (int i = (s); i < (n); i++)
#define ll long long
#define ull unsigned long long

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

    // double dice_expected = (n + 1) / 2;
    double n_inv = 1 / (double) n;
    double ans = 0;
    // 各ダイスの目を探索
    rep(dice, 1, n+1){
        // cout << "dice:" << dice << endl;
        int win_count = 0;
        int tmp = dice;
        // 2倍してkを超える回数をカウント(ループ回数は適当)
        rep(i, 1, k){
            if(tmp >= k){
                break;
            }
            tmp *= 2;
            win_count++;
            // cout << "win:" << win_count << endl;
            // cout << "tmp:" << tmp << endl;
        }
        
        // cout << "n_inv:" << n_inv << endl;
        // cout << "pow:" << pow(0.5, win_count) << endl;
        // 勝率を加算
        ans += pow(0.5, win_count) / (double)n;
        // cout << "ans:" << ans << endl;
    }
    cout << setprecision(10) << ans << endl;
    return 0;
}

Measured memory_bytes: 256
// 
// 
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define is_in(i, s) (s.find(i) != s.end())
#define all(x) (x).begin(),(x).end()
#define outl(x) cout<<x<<endl
#define outsp(x) cout<<x<<" "
typedef long long ll;
typedef pair<int,int> P;


#define MAX_N 1000000005


int main() {
	string s;
	cin >> s;
	rep(i,s.size()){
		if(s[i]=='?'){
			s[i]='D';
		}
	}
	outl(s);
    return 0;
}



Measured memory_bytes: 3724
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;

#define mem(dp,a)       memset(dp,a,sizeof dp)
#define ninja           ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define pb(x)           push_back(x)
#define all(c)          c.begin(), c.end()
#define int             long long
#define ff              first
#define ss              second
#define nl              '\n'


int32_t main()
{
	ninja
	// int t;cin>>t;
	string s,t; cin>>s>>t;
	for(int i=0;i<t.size()-1;i++){
		if(s[i]!=t[i]){
			cout<<"No";
			return 0;
		}
	}
	cout<<"Yes";
}



Measured memory_bytes: 3644
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		
		int n = scanner.nextInt();
		
		int a[] = new int[n];
		
		for (int i = 0; i < n; i++) {
			a[i] = scanner.nextInt();
		}
		
		scanner.close();
		
		int count = 0;
		
		for (int i = 0; i < n; i++) {
			int minj = i;
			for (int j = i; j < n; j++) {
				if (a[j] < a[minj]) {
					minj = j;
				}
			}
			if (i != minj) {
				int temp = a[i];
				a[i] = a[minj];
				a[minj] = temp;
				count ++;
			}
		}
		
		for (int i = 0; i < n-1; i++) {
			System.out.print(a[i] + " ");
		}
		System.out.println(a[n - 1]);
		
		System.out.println(count);
	}
} 



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

using int32 = int_fast32_t;
using int64 = int_fast64_t;

const int32 INF = 1e9;
const int32 MOD = 1e9+7;
const int64 LLINF = 1e18;

#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define ANS(n) cout << (n) << endl
#define REP(i,n) for(int64 i=0;i<(n);++i)
#define FOR(i,a,b) for(int64 i=(a);i<(b);i++)
#define FORR(i,a,b) for(int64 i=(a);i>=(b);i--)
#define ALL(obj) (obj).begin(),(obj).end()
#define pii pair<int32,int32>
#define pll pair<int64,int64>
#define pb(a) push_back(a)
#define mp make_pair

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int32 s;
    cin >> s;
    int32 x = s / 100;
    int32 y = s % 100;
    if(1 <= x && x <= 12 && 1 <= y && y <= 12){
        ANS("AMBIGUOUS");
    }else if(1 <= x && x <= 12){
        ANS("MMYY");
    }else if(1 <= y && y <= 12){
        ANS("YYMM");
    }else{
        ANS("NA");
    }
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#define MAX 100000

typedef struct Q{
    char name[10];
    int time;
    int sum;
}Q;

void enqueue(Q);
Q dequeue();
int head=0;
int tail=0;
Q data[MAX];

int main(){
    int n,q;
    Q x;
    int i,all=0;
    scanf("%d%d",&n,&q);
    for(i=0;i<n;i++){
        scanf("%s%d",x.name,&x.time);
        x.sum=0;
        enqueue(x);
    }
    //printf("\n");
    while(head!=tail){
        x=dequeue();
        if(x.time-q>0){
            x.time-=q;
            all+=q;
            enqueue(x);
        }else{
            all+=x.time;
            x.sum+=all;
            printf("%s %d\n",x.name,x.sum);
        }
    }
    return 0;

    
}

void enqueue(Q x){
    data[tail]=x;
    if(tail+1==MAX)tail=0;
    else tail++;
}

Q dequeue(){
    Q x;
    x=data[head];
    if(head+1==MAX)head=0;
    else head++;
    return x;
}

Measured memory_bytes: 2552
// 有點不耐煩會破壞偉大的計劃

#include <bits/stdc++.h>

#define append push_back

using namespace std;
using ll = long long;

const int N = 1e5 + 3;
const int M = 1e6 + 7;
const long long MOD = 1e9 + 7;
const long long INF = 1e18 + 9;
const int SM = 1e3 + 5;
const int logN = 22, BL = 400;
const double EPS = 1e-9, PI = acos(-1);
const int dx[] = {1, 0, 0, -1, -1, 1, -1, 1};
const int dy[] = {0, 1, -1, 0, -1, 1, 1, -1};

void debug(){
	cerr << "\n";
}
template<typename Type1, typename... Type2>
void debug(Type1 a, Type2... b) {
    cerr << a << " ";
    debug(b...);
}

vector<long long> adj[N * 2];
set<pair<long long, long long>> s;
long long ans = 0, cnt = 0;
bitset<N * 2> used;

void dfs(long long v){
    cnt++;
    used[v] = 1;
    for(auto to : adj[v]){
        if(!used[to]){
            dfs(to);
        }
    }
}

int main(){
//    freopen(".in", "r", stdin);
//    freopen(".out", "w", stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);

    long long n, m; cin >> n >> m;

    for(long long i = 1; i <= m; i++){
        long long u, v; cin >> u >> v;
        if(!s.count({u, v})){
            adj[u].append(v);
            adj[v].append(u);
        }
        s.insert({u, v});
        s.insert({v, u});
    }

    for(long long i = 1; i <= n; i++){
        if(!used[i]){
            cnt = 0;
            dfs(i);
            ans = max(ans, cnt);
        }
    }

    cout << ans;

    return 0;
}


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

using namespace std;

#define INF 1000000007
#define LINF (1LL << 61)
#define PI 3.14159265358979

typedef long long i64;
typedef pair<i64,i64> P;

inline i64 mod(i64 a, i64 m) { return (a % m + m) % m; }

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

i64 ceil(i64 a, i64 b) { return (a+b-1)/b; }
mt19937 rnd(time(NULL));

int d, c[30], s[404][30];
int ans[400];
clock_t start;

int score(int a[400], int l, int r){
	int cnt = 0;
	int last[26] = {};
	fill(last,last+26,l-1);
	
	for(int i = l; i < r; i++){
		cnt += s[i][a[i]];
		last[a[i]] = i;
		for(int j = 0; j < 26; j++){
			cnt -= c[j]*(i-last[j]);
		}
	}
	return cnt;
}

void solve(){
	start = clock();
	
	cin >> d;
	for(int i = 0; i < 26; i++) cin >> c[i];
	for(int i = 0; i < d; i++){
		for(int j = 0; j < 26; j++) cin >> s[i][j];
	}
	
	int ma = 0;
	for(int i = 0; i < d; i++){
		int v = i%26;
		ans[i] = v;
	}
	ma = score(ans,0,d);
	
	int cc[30] = {};
	for(int i = 0; i < 26; i++){
		cc[i+1] = c[i] + cc[i];
	}
	
	int lp = 0;
	while(clock()-start < 1.9*CLOCKS_PER_SEC){
		int res[400] = {};
		for(int i = 0; i < d; i++){
			res[i] = ans[i];
			int r = rnd()%100;
			if(r == 0){
				int value[30] = {};
				for(int j = 0; j < 26; j++){
					value[j+1] = value[j];
					value[j+1] -= cc[26] - c[i];
					value[j+1] += s[i][j];
				}
				r = rnd()%value[26];
				r = lower_bound(value,value+26, r)-value-1;
				res[i] = r;
			}
		}
		
		if(chmax(ma,score(res,0,d))){
			for(int i = 0; i < d; i++){
				ans[i] = res[i];
			}
		}
		//cout << score(res,0,d) << endl;
		lp++;
	}
	//cout << lp << endl;
	//cout << ma << endl;
	
	for(int i = 0; i < d; i++){
		cout << ans[i]+1 << endl;
	}
}

int main(){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	int t = 1;
	//cin >> t;
	while(t--){
		solve();
	}
	
	return 0;
}

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

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = mod * mod;
const int INF_N = 1e+9;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-12;
const ld pi = acos(-1.0);
//typedef vector<vector<ll>> mat;
typedef vector<int> vec;

//繰り返し二乗法
ll mod_pow(ll a, ll n, ll m) {
	ll res = 1;
	while (n) {
		if (n & 1)res = res * a%m;
		a = a * a%m; n >>= 1;
	}
	return res;
}

struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n%mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint &a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint &a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint &a, modint b) { a.n = ((ll)a.n*b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, int n) {
	if (n == 0)return modint(1);
	modint res = (a*a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

//逆元(Eucledean algorithm)
ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p%a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }

const int max_n = 1 << 18;
modint fact[max_n], factinv[max_n];
void init_f() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}
using mP = pair<modint, modint>;

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




void solve() {
    int N; cin >> N;
    vec a(N), mi(N);
    rep(i, N){
        cin >> a[i];
    }
    int comp = a[0];
    rep(i, N){
        mi[i] = min(comp, a[i]);
        comp = mi[i];
    }
    
    int ans=0;
    rep(i, N){
        if(a[i] == mi[i]) ans++;
    }

    cout << ans << endl;
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  //cout << fixed << setprecision(10);
  //init_f();
  //init();
  //int t; cin >> t; rep(i, t)solve();
  solve();
//   stop
    return 0;
}


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

int main(){
  int a[5],k;
  
  for(int i=0;i<5;i++)  cin >> a[i];
  cin >> k;
 
  for(int i=0;i<4;i++){
    for(int j=i+1;j<5;j++){
    if(abs(a[i] - a[j]) > k){ 
       cout << ":(" << endl;
       return 0; 
    }
    }
  }
  cout << "Yay!" << endl;
}


Measured memory_bytes: 256