akhauriyash/Code-Regression huggingface dataset:
//  string t = "keyence";//で文字列入力ができる
//s.empty() //emptyなら1を出力 入っていれば0を出力
/*//ABC018-B 部分的にreverseをかける解法
int main() {
  string s;
  cin >> s;
  int n;
  cin >> n;
  vector<int>a(n);
  vector<int>b(n);
  rep(i,n) cin>>a.at(i)>>b.at(i);
  rep(i,n)a.at(i)--;
  rep(i,n)b.at(i)--;
  string t;
  rep(i,n){
    t = s;
    for(int k=0;k<=b.at(i)-a.at(i);k++){
      t.at(a.at(i)+k) = s.at(b.at(i)-k);
    }
    s = t;
  }
  cout << s << endl;
}
*///ABC018-B
//  string s;
//  cin >> s;
//  cout << s.at(0) <<endl;
//  cout << s.at(0)-'0' <<endl;
//  Aが16？
//  cout << char(i+48) << endl;//なぜかaは47と得る時がある。+48で出力もaにできる。
//  cout << char(97) << endl;//アスキーコードでaを出力
// sort(b.begin(), b.end());//bという配列を小さい方からソート
// reverse(b.begin(), b.end());//bという配列をリターン
// 10桁でdouble出力するパターン１ 
// printf("%.10f\n", ma);
// 10桁でdouble出力するパターン２
//cout << fixed << setprecision(10);
//  cout << ma << endl;

/*01 02 03 12 13 23　と６回見ていくパターン 
for(int i=0;i<n-1;i++){
  for(int j=i+1;j<n;j++){
    }
  }
*///vector<vector<int>> data(3, vector<int>(4));//int型の2次元配列(3×4要素の)の宣言
//int64_t a;
//10のi乗pow(10, i);
/*string s; stringでの文字列を数字型に変える方法
  cin >> s;
  rep(i,s.size()-2) {
  int a= (s.at(i)-'0')*100 + (s.at(i+1)-'0')*10+ s.at(i+2) -'0';
    */
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int kan_hyaku(int n){
  int kurai = 0;
  for(int i=0;i<3;i++){
    kurai = n%10;
    n /=10;
  }
  return kurai;
}
int kan_ju(int n){
  int kurai = 0;
  for(int i=0;i<2;i++){
    kurai = n%10;
    n /=10;
  }
  return kurai;
}
int kan_ichi(int n){
  int kurai = 0;
  for(int i=0;i<1;i++){
    kurai = n%10;
    n /=10;
  }
  return kurai;
}
int main() {
  string s;
  cin >> s;
  if(s.size()==1){
    cout << 0 << endl;
    return 0;
  }
  int tmp = 0;
  rep(i,s.size()){
    if(s.at(i)=='B')tmp++;
  }
  vector<ll>b(tmp);
  tmp = 0;
  rep(i,s.size()){
    if(s.at(i)=='W')tmp++;
  }
  vector<ll>w(tmp);
  ll bcount = 0;
  ll wcount = 0;
  ll sum = 0;
  for(int i=0;i<s.size();i++){
    if(s.at(i)=='B'){
      b.at(bcount) = i;
      bcount++;
    }
    else{
      w.at(wcount) = i;
      wcount++;
    }
  }
for(int i=0;i<bcount;i++){
  if(wcount == 0)break;
    if(b.at(i)<w.at(wcount-1)){
      sum += w.at(wcount-1)-b.at(i);
      wcount --;
    }
    else{
      break;
    }
  }
  cout << sum << endl;
  //  rep(i,3) cout<<b.at(i)<<endl;
  //  rep(i,4) cout<<w.at(i)<<endl;
}

Measured memory_bytes: 5164
#include <iostream>
#include <string>
using namespace std;
int main() {
	int ac= 0;
	string a;
	
cin>>a;
	if(a[0]=='1'){ac++;}
	if(a[1]=='1'){ac++;}
	if(a[2]=='1'){ac++;}
	cout<<ac;
	
}

Measured memory_bytes: 3584
#include<stdio.h>
int main(void){
  int a;
  int b;

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

  if(a>b)
    printf("a > b\n");
  else if(a<b)
    printf("a < b\n");
  else
    printf("a == b\n");

  return 0;
}

Measured memory_bytes: 580
#include<iostream>
#include<vector>
#include<map>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#include<set>
#include<bitset>
#include<iomanip>
#define BUG puts("no bug")
#define sci(x) scanf("%d",&x)
#define scl(x) scanf("%lld",&x)
#define ll long long
#define ull unsigned long long
#define REP(a,b,c) for(ll a=b;a<=c;a++)
#define PER(a,b,c) for(ll a=b;a>=c;a--)
#define lb(a) (a&(-a))
#define pp (p<<1)
#define ppp (p<<1|1)
#define pi pair<ll,ll>
#define pii pair<pair<ll,ll>,ll>
using namespace std;
const double Pi=acos(-1.0);
const ll MAXN=3e3+5;
ll n,m,t;
ll val[MAXN][MAXN];
ll dp[MAXN][MAXN][4];
int main(){
    cin>>n>>m>>t;
    while(t--){
        ll a,b,c;
        scl(a);scl(b);scl(c);
        val[a][b]=c;
    }
    REP(i,1,n){
        REP(j,1,m){
            REP(k,0,3){
                if(k==0){
                    dp[i][j][0]=max(dp[i][j][0],dp[i][j-1][0]);
                    dp[i][j][0]=max(dp[i][j][0],dp[i-1][j][0]);
                    dp[i][j][0]=max(dp[i][j][0],dp[i-1][j][1]);
                    dp[i][j][0]=max(dp[i][j][0],dp[i-1][j][2]);
                    dp[i][j][0]=max(dp[i][j][0],dp[i-1][j][3]);
                }
                else if(k==1){
                    dp[i][j][k]=max(dp[i][j][k],dp[i][j-1][k]);
                    dp[i][j][k]=max(dp[i][j][k],dp[i-1][j][0]+val[i][j]);
                    dp[i][j][k]=max(dp[i][j][k],dp[i-1][j][1]+val[i][j]);
                    dp[i][j][k]=max(dp[i][j][k],dp[i-1][j][2]+val[i][j]);
                    dp[i][j][k]=max(dp[i][j][k],dp[i-1][j][3]+val[i][j]);
                    dp[i][j][k]=max(dp[i][j][k],dp[i][j-1][k-1]+val[i][j]);
                }
                else {
                    dp[i][j][k]=max(dp[i][j][k],dp[i][j-1][k]);
                    dp[i][j][k]=max(dp[i][j][k],dp[i][j-1][k-1]+val[i][j]);
                }
            }
        }
    }
    cout<<max(dp[n][m][0],max(dp[n][m][1],max(dp[n][m][2],dp[n][m][3])));
}

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

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

const int INF = 1001001001;

int main() {

    int a, b;
    cin >> a >> b;

    int tap = 0;
    int socket = 1;
    while (socket < b) {
        tap++;
        socket += (a - 1);
    }
    cout << tap << endl;
}


Measured memory_bytes: 256
package main

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

func main() {
	h, n := readInt(), readInt()
	sum := 0
	for i := 0; i < n; i++ {
		sum += readInt()
	}
	if sum >= h {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

// sort ------------------------------------------------------------

type xxx struct {
	x int
}

type sortArray []xxx

func (s sortArray) Len() int           { return len(s) }
func (s sortArray) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
func (s sortArray) Less(i, j int) bool { return s[i].x < s[j].x }

// -----------------------------------------------------------------

var (
	readString func() string
	readBytes  func() []byte
)

func init() {
	readString, readBytes = newReadString(os.Stdin)
}

func newReadString(ior io.Reader) (func() string, func() []byte) {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	f1 := func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
	f2 := func() []byte {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Bytes()
	}
	return f1, f2
}

func readInt() int {
	return int(readInt64())
}

func readInt64() int64 {
	i, err := strconv.ParseInt(readString(), 10, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(readString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func sum(a []int) int {
	var ret int
	for i := range a {
		ret += a[i]
	}
	return ret
}

func sumFloat64(a []float64) float64 {
	var ret float64
	for i := range a {
		ret += a[i]
	}
	return ret
}

func gcd(m, n int) int {
	for m%n != 0 {
		m, n = n, m%n
	}
	return n
}

func lcm(m, n int) int {
	return m / gcd(m, n) * n
}


Measured memory_bytes: 1152
import sys
input = sys.stdin.readline
from collections import *

N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]
s = set(a)
dp = [0]*(N+1)
MOD = 10**9+7
dp[0] = 1

for i in range(1, N+1):
    if i not in s:
        dp[i] += dp[i-1]
        
        if i-2>=0:
            dp[i] += dp[i-2]
        
        dp[i] %= MOD

print(dp[N])

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

#define INF 1000000007
#define LINF 1000000000000000007

using namespace std;

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

Int gcd(Int x, Int y){
	if(y == 0)
		return x;
	return gcd(y, x % y);
}

Int lcm(Int x, Int y){
	return x * y / gcd(x, y);
}

bool sosuu(int x){
	bool b = 1;
	if(x == 1) b = 0;
	for(int i = 2; i * i <= x; i++){
		if(x % i == 0) {
			b = 0;
			break;
		}
	}
	return b;
}

int a[3];

int main(){
	cin >> a[0] >> a[1] >> a[2];
	
	int cnt = 0;
	
	while(!(a[0] == a[1] && a[1] == a[2])){
		cnt++;
		sort(a, a+3);
		if(a[1] == a[2]){ 
			a[0] += 2;
		}
		else {a[0]++; a[1]++;}
	}
	
	cout << cnt << endl;
	
	return 0;
}

Measured memory_bytes: 256
n=int(input())
if n%2:
    print(2*(n//2)**2)
    for i in range(1,n+1):
        for j in range(i+1,n+1):
            if i+j==n:continue
            print(i,j,sep=" ")
else:
    s=n//2
    print(2*(s-1)*s)
    for i in range(1,n+1):
        for j in range(i+1,n+1):
            if i+j==n+1 :continue
            print(i,j,sep=" ")

Measured memory_bytes: 3612
/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
	    Scanner sc=new Scanner(System.in);
	    String s=sc.nextLine().trim();
	    String  res="";
	    if(s.charAt(s.length()-1)=='s') res=s+"es";
	    else res=s+"s";
	    System.out.println(res);
	    
	}
}


Measured memory_bytes: 38500
fun main(arr:Array<String>) {
    val (n,x) = readLine()!!.split(" ").map { it.toInt() }
    val kodomo = readLine()!!.split(" ").map { it.toInt() }.sorted()

    var current = x
    for(i in (0 until kodomo.size)) {
        if(kodomo[i] <= current) {
            current -= kodomo[i]
        } else {
            print(i)
            return
        }
    }
    if(current == 0) {
        println(n)
    } else {
        println(n-1)
    }
}


Measured memory_bytes: 36076
#pragma GCC optimize(2)
#include<bits/stdc++.h>
#define ll long long
#define maxn 1000005
#define inf 1e9
#define pb push_back
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define per(i,a,b) for(int i=a;i>=b;i--)
using namespace std;

inline int read()
{
	int x=0,w=1; char c=getchar();
	while(c<'0'||c>'9') {if(c=='-') w=-1; c=getchar();}
	while(c<='9'&&c>='0') {x=(x<<1)+(x<<3)+c-'0'; c=getchar();}
	return w==1?x:-x;
}

int a[505][505],nw[505],cnt[505],n,m,v[505];

inline bool jud(int x)
{
	rep(i,1,n) nw[i]=1; rep(i,0,m) cnt[i]=0,v[i]=0;
	rep(i,1,m)
	{
		int tmp=0;
		rep(j,1,n) cnt[a[j][nw[j]]]++;
		rep(j,1,m) tmp=max(tmp,cnt[j]);
		if(tmp<=x) return true;
		rep(j,1,m) if(cnt[j]>x) v[j]=1;
		rep(j,1,n)
		{
			cnt[a[j][nw[j]]]--;
			if(v[a[j][nw[j]]])
			{
				while(v[a[j][nw[j]]]&&nw[j]<=m+1) nw[j]++;
				if(nw[j]>=m+1) return false;
			}
		}
	}
}

int main()
{
	n=read(); m=read(); rep(i,1,n) rep(j,1,m) a[i][j]=read();
	int l=1,r=n,ans=0;
	while(l<=r)
	{
		int mid=(l+r)>>1;
		if(jud(mid)) ans=mid,r=mid-1;
		else l=mid+1;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 896
<?php

class Scanner
{
    private $arr = [];
    private $count = 0;
    private $pointer = 0;

    public function next()
    {
        if ($this->pointer >= $this->count) {
            $str = trim(fgets(STDIN));
            $this->arr = explode(" ", $str);
            $this->count = count($this->arr);
            $this->pointer = 0;
        }
        $result = $this->arr[$this->pointer];
        $this->pointer++;
        return $result;
    }

    public function hasNext()
    {
        return $this->pointer < $this->count;
    }

    public function nextInt()
    {
        return (int)$this->next();
    }

    public function nextDouble()
    {
        return (double)$this->next();
    }
}

class out
{
    public static function printIn($str = "")
    {
        echo $str . PHP_EOL;
    }
}

$sc = new Scanner;

$N = $sc->nextInt();
$M = $sc->nextInt();
$arr = [];
for ($i = 1; $i <= $N; $i++) {
    $arr[$i] = 0;
}
while ($p = $sc->nextInt()) {
    $arr[$p]++;
}

for ($i = 1; $i <= $N; $i++) {
    echo $arr[$i] . PHP_EOL;
}



Measured memory_bytes: 4728
N,K = map(int,input().split())
R,S,P = map(int,input().split())
T = list(input())
from itertools import groupby
from collections import Counter
import math
ans = 0
c={'r':0,'s':0,'p':0}
for i in range(K):
  x = [[a,len(list(g))] for a,g in groupby(T[i::K])]
  for a in x:
    c[a[0]]+=math.ceil(a[1]/2)
r = c['r']*P + c['s']*R + c['p']*S
print(r)

Measured memory_bytes: 15904
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <bitset>
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;

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

const int INF = 1e9;
const int MOD = 1e9 + 7;

// 4近傍、8近傍
int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};

int main() {
  // 入力
  int N;
  cin >> N;
  ll a[N], b[N];
  for (int i = 0; i < N; i++) cin >> a[i] >> b[i];

  ll ans = 0;
  for (int i = N - 1; i >= 0; i--) {
    if ((ans + a[i]) % b[i] == 0) continue;

    ll cnt = (ans + a[i]) / b[i] + 1;
    ans += cnt * b[i] - (ans + a[i]);
  }

  // 解答
  cout << ans << endl;

  return 0;
}


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

int main(void){
  while(true){
    int n;
    cin >> n;
    if(n == 0)
      break;

    int plane[21][21] = {0};
    for(int i=0; i<n; i++){
      int x, y;
      cin >> x >> y;
      plane[x][y] = 1;
    }

    int m;
    cin >> m;
    int x = 10, y = 10;
    for(int i=0; i<m; i++){
      char d;
      int l;
      cin >> d >> l;

      int dx = 0, dy = 0;
      if(d == 'N')
        dy = 1;
      else if(d == 'S')
        dy = -1;
      else if(d == 'E')
        dx = 1;
      else
        dx = -1;

      for(int j=0; j<l; j++){
        x += dx;
        y += dy;
        if(plane[x][y] == 1){
          n--;
          plane[x][y] = 0;
        }
      }
    }

    if(n == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  
  return 0;
}

Measured memory_bytes: 3092
from sys import stdin
def main():
    #入力
    readline=stdin.readline
    n,max_t=map(int,readline().split())
    t=list(map(int,readline().split()))

    ans=0
    for i in range(n):
        if i==n-1:
            ans+=max_t
        else:
            ans+=min(max_t,t[i+1]-t[i])

    print(ans)

if __name__=="__main__":
    main()

Measured memory_bytes: 25108
/*-- ILSH  --*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define pb push_back 
#define pop pop_back
#define mp make_pair
#define vii vector < int >
#define vll vector < ll > 
#define dt cout<<"HERE\n";
#define pii pair < int , int >
#define pll pair < ll , ll >
#define vpi vector < pll >
#define vpl vector < pll >
#define fi first
#define se second 
#define sz size 
#define len length 

const ll inf=1e18+1e17;
const ll mod =1e9+7;
//const ll mod = 998244353;

ll modInverse(ll a,ll m){ll m0=m;ll y=0,x=1;if(m == 1)return 0;while(a> 1){ll q=a/m;ll t=m;m=a%m,a=t;t=y;y=x-q*y;x=t;}if(x<0)x+=m0;return x;}  
ll powm(ll a,ll b){a=a%mod;ll res=1;while(b){if(b&1)res=(res*a)%mod;a=(a*a)%mod;b>>=1;}return (res%mod);}


const ll N =5e5+5;



void solve(){
	string s;
	cin>>s;
	for ( int i=0;i<s.len();i++)
		if ( s[i]=='?')
			cout<<"D";
		else
			cout<<s[i];
		cout<<'\n';
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie( NULL);
	cout.tie(NULL);
	// #ifndef
	// 	freopen( "INPUT.txt", "r" , stdin);
	// 	freopen( "OUTPUT.txt","w", stdout);
	// #endif

	int t=1;

	//cin>>t;

	for ( int i=1;i<=t;i++){
   // 	cout<<"Case #"<<i<<": ";
    	solve();
 	}
}

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

int main()
{
	int a;
	while(cin>>a)
	{
	int b=a%10;
	a-=b;a/=10;
	int c=a%10;
	a-=c;a/=10;
	int d=a%10;
	a-=d;a/=10;
	int e=a;
	if((b==c&&c==d)||(d==c&&d==e))
	{cout<<"Yes"<<endl;}
	else
	{cout<<"No"<<endl;}
}
	return 0;

}

Measured memory_bytes: 888
#include<bits/stdc++.h>
#define in inline
#define re register
using namespace std;
in int read() {
	re int t=0;
	re char v=getchar();
	while(v<'0'||v>'9')v=getchar();
	while(v>='0'&&v<='9') {
		t=(t<<3)+(t<<1)+(v^48);
		v=getchar();
	}
	return t;
}
int n,m,ans,a[200002],head[200002],cnt;
struct edge{
	int to,next;
}e[400002];
inline void add(re int x,re int y){
	e[++cnt]=(edge){y,head[x]};
	head[x]=cnt;
}
signed main(){
	n=read();m=read();
	for(re int i=1;i<=n;++i)a[i]=read();
	for(re int i=1,x,y;i<=m;++i){
		x=read();y=read();
		add(x,y);
		add(y,x);
	}
	for(re int i=1;i<=n;++i){
		bool ia=1;
		for(re int j=head[i];j;j=e[j].next)if(a[i]<=a[e[j].to]){
			ia=0;
			break;
		}
		if(ia)++ans;
	}
	printf("%d\n",ans);
}

Measured memory_bytes: 6116
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<string>
#include<queue>
#include<set>
#include<map>
using namespace std;
typedef long long int ll;
typedef vector<pair<ll,ll> > Q;
typedef pair<int,int> P;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
const ll inf=1e9+7;
ll gcd(ll a, ll b) { return (b ? gcd(b, a % b) : a); }
ll lcm(ll a, ll b) { return a / (gcd(a, b)) * b; }

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

    bool ans=false;
    rep(i,1,b+1){
      if((i*a)%b == c) ans=true;
    }

    if(ans) cout<<"YES";
    else cout<<"NO";

}


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

int main() {
	
	int n;
	cin>>n;
	vector<ll> A(n),pre(n);
	for(int i=0;i<n;i++)cin>>A[i];
	for(int i=0;i<n;i++)pre[i]=(i==0?A[i]:pre[i-1]+A[i]);
	ll sum=0;
	for(int x:A)sum+=x;
	vector<vector<ll>> dp(n,vector<ll>(n,0));
	for(int l=n-1;l>=0;l--)
	{
		for(int r=l;r<n;r++)
		{
			if(l==r)dp[l][r]=A[l];
			else 
			dp[l][r]= (pre[r]-pre[l]+A[l]) -min(dp[l+1][r] , dp[l][r-1] );
		}
	}
	cout<<2*dp[0][n-1]-sum<<endl;
	
}

Measured memory_bytes: 73696
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <algorithm>
#include <cassert>
#include <cfloat>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define repLRE(i, l, r) for (ll i = (l); i <= (r); ++i)
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define Lower_bound(v, x) \
  distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) \
  distance(v.begin(), upper_bound(v.begin(), v.end(), x))

using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;
using T = tuple<ll, ll, ll>;
using vll = vector<ll>;
using vP = vector<P>;
using vT = vector<T>;
using vvll = vector<vector<ll>>;
using vvP = vector<vector<P>>;
using dqll = deque<ll>;

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

/* Macros reg. ends here */

const ll INF = 1LL << 50;

static const long long mod = 1000000007;

int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cout << fixed << setprecision(15);

  string s;
  cin >> s;
  string ans = "";
  rep(i, (ll)s.size()) {
    if (i % 2 == 0) ans += s[i];
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 592
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>

#define REP(i, n, N) for(ll i=(n);i<(N);i++)
#define RREP(i, n, N) for(ll i=(N-1);i>=(n);i--)
#define CK(n, a, b) ((a)<=(n)&&(n)<(b))
#define ALL(v) (v).begin(), (v).end()
#define MCP(a, b) memcpy(b,a,sizeof(b))
#define p(s) cout<<(s)<<endl
#define p2(a, b) cout<<(a)<<" "<<(b)<<endl
typedef long long ll;
using namespace std;
const ll mod = 1e9 + 7;
const ll inf = 1e18;

int N, A, B;

int main() {

    cin>>N;
    if(N==1){
        cout<<"Hello World"<<endl;
    }else{
        cin>>A>>B;
        cout<<A+B<<endl;
    }


    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,k,count=0;
    cin>>a>>b>>k;
    int i=min(a,b);
    while(count!=k)
    {
        if(a%i==0 && b%i==0)
            count++;
        i--;
    }
    cout<<i+1;
    return 0;
}

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

using namespace std;

int main() {
    int N;
    long long int x;
    cin >> N >> x;
    
    vector<long long int> A(N);
    long long int ans=0;
    long long int cur=0;
    for(int i=0; i<N; i++) {
        cin >> A[i];
        if(x<A[i]+cur) {
            ans += A[i]+cur-x;
            cur = x-cur;
        } else {
            cur = A[i];
        }
    }
    
    cout << ans << endl;


    return 0;
    
}

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

using namespace std;

typedef long long ll;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;

ll gcd(ll x, ll y) {
    return x ? gcd(y % x, x) : y;
}

int main() {
    ll n, m, i, j, k;
    ll a,b;
    cin >> a >> b;
    ll x = gcd(a,b);
    vector<ll> v;
    set<ll> st;
    if(x%2==0){
        v.push_back(2);
        while(x%2==0){
            x/=2;
        }
    }
    for(i=3;i*i<=x;i+=2){
        if(x%i==0){
            v.push_back(i);
        }
        while(x%i==0){
            x/=i;
        }
    }
    if(x!=1LL){
        v.push_back(x);
    }
    v.push_back(1ll);
    cout << (ll)v.size() << endl;
    return 0;
}

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

public class Main {
	static int mod = (int) 1e9 + 7;
	static int DX[] = { -1, 0, 1, 0 }, DY[] = { 0, -1, 0, 1 };

	public static void main(String[] args) {
		FastScanner fs = new FastScanner(System.in);
		int n = fs.nextInt(), a = fs.nextInt(), b = fs.nextInt();
		long ans = modpow(2,n);
		long s = fermatComb(n, a); 
		long t = fermatComb(n, b);
		ans = sub(ans,s);
		ans = sub(ans,t);
		ans = sub(ans,1);
		System.out.println(ans);
	}
	
	//MOD culculations
	static long plus(long x, long y) {
		x %= mod;
		y %= mod;
		long res = (x + y) % mod;
		return res;
	}

	static long sub(long x, long y) {
		x %= mod;
		y %= mod;
		long res = (x - y + mod) % mod;
		return res;
	}

	static long mul(long x, long y) {
		x %= mod;
		y %= mod;
		long res = x * y % mod;
		return res;
	}

	static long div(long x, long y) {
		x %= mod;
		y %= mod;
		long res = x * modpow(y, mod - 2) % mod;
		return res;
	}


	
	//Fermat Combination
	static long fermatComb(long a, long b) {
		if (b > a - b)
			return fermatComb(a, a - b);
		long ansMul = 1, ansDiv = 1;
		for (int i = 0; i < b; i++) {
			ansMul *= (a - i);
			ansMul %= mod;
			ansDiv *= (i + 1);
			ansDiv %= mod;
		}
		long ans = ansMul * modpow(ansDiv, mod - 2) % mod;
		return ans;
	}

	//modの元での高速pow()
	static long modpow(long a, long p) {
		if (p == 0)
			return 1;
		if (p % 2 == 0) {
			long halfP = p / 2;
			long root = modpow(a, halfP);
			return root * root % mod;
		} else
			return a * modpow(a, p - 1) % mod;
	}

}

//高速なScanner
class FastScanner {
	private BufferedReader reader = null;
	private StringTokenizer tokenizer = null;

	public FastScanner(InputStream in) {
		reader = new BufferedReader(new InputStreamReader(in));
		tokenizer = null;
	}

	public String next() {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}

	public String nextLine() {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken("\n");
	}

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

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

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

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

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

Measured memory_bytes: 24788
#include <bits/stdc++.h>
using namespace std;
#define int long long
// #define min(a,b) a<b ? a:b
// #define max(a, b) a < b ? b : a
#define IOS                           \
    ios_base::sync_with_stdio(false); \
    cin.tie(0);                       \
    cout.tie(0)
#define endl "\n"
#define pb push_back
#define pi 3.14159265358979323846

// int explore(vector<vector<int>> &adj,int x,int y,vector<int> &visited)
// {
//     if(x==y)
//     return 1;
//     visited[x]=1;
//     for(int i=0;i<adj[x].size();i++)
//     {
//         if(!visited[adj[x][i]])
//         {
//             if(explore(adj,adj[x][i],y,visited))
//             return 1;
//         }
//     }
//     return 0;
// }
bool valley(int p[], int k)
{
    if (p[k] < p[k - 1] && p[k] < p[k + 1])
        return true;
    return false;
}
bool peak(int p[], int k)
{
    if (p[k] > p[k - 1] && p[k] > p[k + 1])
        return true;
    return false;
}

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

int prime(int b)
{
    for (int i = 2; i < b; i++)
    {
        if (b % i == 0)
            return 0;
    }
    return 1;
}
int32_t main()
{
    IOS;
    // int t;
    // cin>>t;
    // while(t--)
    // {
    string s,t;
    cin>>s>>t;
    int mini=INT_MIN;
    int ctr=0;
    for(int i=0;i<s.size()-t.size()+1;i++)
    {
        for(int j=0;j<t.size();j++)
        {
            if(s[i+j]==t[j])
            ctr++;
        }
        mini=max(mini,ctr);
        ctr=0;
    }
    cout<<t.size()-mini;
    
    // }
}

Measured memory_bytes: 3652
//98tarunkumar

#include<bits/stdc++.h>
using namespace std;

#define ll long long
#define pb push_back
#define lop(i,n) for(int i=0;i<n;i++)
#define rlop(i,n) for(int i=n;i>0;i--)
#define lli long long int
#define MOD 1000000007
#define f(i,a,b) for(i=a;i<b;i++)
#define ainp(a,n) for(int i=0;i<n;i++)cin>>a[i];
#define aout(a,n) for(int i=0;i<n;i++)cout<<a[i]<<" ";
#define ss ios::sync_with_stdio(false); cin.tie(NULL);
#define vi vector<int> 
#define ln cout<<"\n"


int main(){
	ss;
	int n;
	cin>>n;
	double p[n+1];
	for(int i=1;i<=n;i++){
		cin>>p[i];
	}

	double dp[n+1][n+1];

	for(int i=0;i<=n;i++)
		for(int j=0;j<=n;j++)
			dp[i][j]=0;

	dp[1][0]=(1.0-p[1]);
	for(int i=2;i<=n;i++)
		dp[i][0]=dp[i-1][0]*(1.0-p[i]);

	dp[1][1]=p[1];
	for(int i=2;i<=n;i++){
		dp[i][i]=dp[i-1][i-1]*p[i];
	}

	for(int i=1;i<=n;i++){
		for(int j=1;j<i;j++){
			dp[i][j]=(1.0-p[i])*dp[i-1][j]+p[i]*dp[i-1][j-1];
		}
	}
	double res=0;

	
	for(int i=n/2+1;i<=n;i++)
		res+=dp[n][i];
	cout<<fixed<<setprecision(10)<<res;
}


Measured memory_bytes: 70656
/* Author - thiolhub */

#include <bits/stdc++.h>

using namespace std;

#define ll              long long int
#define ld              long double
#define db              double
#define pi              3.1415926535897932384626
#define PI              acos(-1.0)
#define endl            "\n"
#define mod             1000000007
#define mk              make_pair
#define pb              push_back
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define ps(x,y)         fixed<<setprecision(y)<<x
#define w(t)            ll t; cin>>t; while(t--)
#define sc(a)	        scanf("%lld",&a);
#define pr(a)	        printf("%lld\n",a)
#define f(i,a,n)		for(ll i=a;i<n;i++)
#define m(a)		    memset(a,0,sizeof(a))
#define FastIO          ios_base::sync_with_stdio(0);cin.tie(0),cout.tie(0)



int main(){ FastIO;

int a,b;cin>>a>>b;
cout<<(a*(a-1))/2+(b*(b-1))/2;

return 0;
}

Measured memory_bytes: 256
def examA():
    a, b = LI()
    if a>0:
        ans = "Positive"
        print(ans)
        return
    if b>=0:
        ans = "Zero"
    else:
        judge = b-a
        if judge%2==1:
            ans = "Positive"
        else:
            ans = "Negative"
    print(ans)
    return

def examB():
    N, M = LI()
    boal = [1]*N
    d = defaultdict(bool)
    d[0] = True
    for _ in range(M):
        x,y = LI()
        boal[x-1] -=1
        boal[y-1] +=1
        if d[x-1]:
            d[y-1] = True
        if boal[x-1]==0:
            d[x-1] = False
    ans = sum(d.values())
    print(ans)
    return

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

if __name__ == '__main__':
    examB()


Measured memory_bytes: 52188
#include <bits/stdc++.h>
//#include <atcoder/all>

using namespace std;
//using namespace atcoder;
using usize = ::std::size_t;
//using u64 = ::std::int_least64_t;
using u64 = long long;
static constexpr u64 Inf = ::std::numeric_limits<u64>::max() / 2;


int main(int argc, char *argv[])
{
    //std::ifstream in("in.txt");
    //std::cin.rdbuf(in.rdbuf());
    
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int N;
    cin >> N;
    
    int group = ceil(sqrt(N*2));
    
    if (group*(group - 1) != 2*N || 2*N % group != 0) {
        cout << "No" << endl;
    } else {
        cout << "Yes" << endl;
        cout << group << endl;
        int limit = 2*N / group;
        int start = 0, end = 0;
        vector<vector<int>> bag(group);
        for (int i = 1; i <= N; i++) {
            if ((int) bag[start].size() == limit) {
                start++;
                end = start;
                bag[start].push_back(i);
                bag[++end].push_back(i);
                continue;
            }
            bag[start].push_back(i);
            bag[++end].push_back(i);
        }
        for (int i = 0; i < group; i++) {
            cout << limit << " ";
            for (int j = 0; j < limit; j++) {
                if(j == limit - 1) cout << bag[i][j] << endl;
                else cout << bag[i][j] << " ";
            }
        }
    }
    
    return 0;
    
}


Measured memory_bytes: 4260
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;

namespace AtCoder.A
{
    public class Program
    {
        public static void Main() { var r = GetResult(); Debug.WriteLine(r); Console.Write(r); }

        private static object GetResult()
        {
            var D = ReadLong();
            switch (D)
            {
                case 25:return "Christmas";
                case 24:return "Christmas Eve";
                case 23:return "Christmas Eve Eve";
                case 22:return "Christmas Eve Eve Eve";
                default:
                    break;
            }
            return null;
        }

        #region Console.Read

        public static string ReadText() { return Console.ReadLine(); }
        public static List<string> ReadTexts() { return Console.ReadLine().Split(' ').ToList(); }
        public static long ReadLong() { return long.Parse(Console.ReadLine()); }
        public static (long, long) Read2Longs() { var ls = ReadLongs(); return (ls[0], ls[1]); }
        public static (long, long, long) Read3Longs() { var ls = ReadLongs(); return (ls[0], ls[1], ls[2]); }
        public static (long, long, long, long) Read4Longs() { var ls = ReadLongs(); return (ls[0], ls[1], ls[2], ls[3]); }
        public static (long, long, long, long, long) Read5Longs() { var ls = ReadLongs(); return (ls[0], ls[1], ls[2], ls[3], ls[4]); }
        public static List<long> ReadLongs() { return Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToList(); }

        #endregion
    }
}


Measured memory_bytes: 27512
#include <stdio.h>

int main(int argc, const char * argv[])
{
    int firnum,secnum,ans;
    char calc;
    while(1){
        scanf("%d %c %d",&firnum,&calc,&secnum);
        
        if(calc == '+'){
            printf("%d\n",firnum + secnum);
        }else if(calc == '-'){
            printf("%d\n",firnum - secnum);
        }else if(calc == '*'){
            printf("%d\n",firnum * secnum);
        }else if(calc == '/'){
            printf("%d\n",firnum / secnum);
        }else if(calc == '?'){
            break;
        }
    }
    return 0;
}

Measured memory_bytes: 600
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {
	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int height[] = new int[10];
		for(int i=0;i<height.length;i++){
			try {
				height[i] = Integer.parseInt(br.readLine());
			} catch (NumberFormatException e) {
				// TODO ????????????????????? catch ????????????
				e.printStackTrace();
			} catch (IOException e) {
				// TODO ????????????????????? catch ????????????
				e.printStackTrace();
			}
		}
		
		Arrays.sort(height);
		
		for(int i=0;i<3;i++){
			System.out.println(height[height.length-i-1]);
		}
		
	}
}

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

int c[10][10];

int mn_magic(int start, int goal, int howmany_change)
{
    if (howmany_change == 1) return c[start][goal];

    if (start == goal) return c[start][goal];

    int mn = 100000;
    for (int i = 0; i <= 9; i++)
    {
        mn = min(mn, mn_magic(start, i, howmany_change - 1) + c[i][goal]);
    }

    return mn;
}

int main()
{
    int H, W;
    cin >> H >> W;
    for (int i = 0; i <= 9; i++)
    {
        for (int j = 0; j <= 9; j++)
        {
            cin >> c[i][j];
        }
    }
    int A[205][205];
    for (int h = 1; h <= H; h++)
    {
        for (int w = 1; w <= W; w++)
        {
            cin >> A[h][w];
        }
    }

    int ANS[10];
    for (int k = 0; k <= 9; k++)
    {
        ANS[k] = mn_magic(k, 1, 9);
    }

    int ans = 0;
    for (int h = 1; h <= H; h++)
    {
        for (int w = 1; w <= W; w++)
        {
            if (A[h][w] == -1) continue;

            ans += ANS[A[h][w]];
        }
    }

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

Measured memory_bytes: 384
/*---------------------------------------------*/
/*
    ABC166 D
 */
/*---------------------------------------------*/

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef int64_t i6;

#define rep(i, n) for (ll i = 0; i < n; ++i)
#define rep2(i, n) for (ll i = 1; i <= n; ++i)
#define ALL(v) (v).begin(), (v).end()
#define Sort(x) sort(ALL(x))
#define Sort_rev(x) Sort(x);reverse(ALL(x))

template<typename V,typename T>
T find_num(V v, T num) {
    if ( find(ALL(v), num) == v.end() ) {
        return false;
    } else {
        return true;
    }
}

// π M_PI
// deg = rad*180/M_PI

int main() {
    ll n;
    cin >> n;
    std::vector<ll> v;
    rep(i, 1000) {
        v.push_back( pow(i, 5) );
    }

    ll keep;
    rep(i, 1000) {
        if ( find_num(v, abs(n-v[i]) ) ) {
            keep = i;
            break;
        }
    }

    ll ans = pow(abs(n-v[keep]), 0.2);
    if ( v[keep] <= n ) {
        ans *= -1;
    }
    cout << keep << " " << ans << endl;
/*
    ll num = 0;
    while (num <= 64) {
        if ( n <= pow(num, 5) ) {
            break;
        }
        // cout << num << "a " << pow(num, 5) << endl;
        num++;
    }*/
    /*
    if ( abs( n-pow(num, 5) ) <= abs( n-pow(num-1, 5) ) ) {
        num -= 1;
    }
    */
    /*
    ll num2 = 0;
    ll plus = 1;
    ll ans;
    // cout << "a " << num << " " << num-1 << endl;
    while (num2 <= 64) {
        if ( pow(num2, 5) == abs( n-pow(num, 5) ) ) {
            ans = num;
            break;
        }

        if ( pow(num2, 5) == abs( n-pow(num-1, 5)) ) {
            ans = num-1;
            // cout << "a " << ans << endl;
            plus = 0;
            break;
        }
        num2++;
    }

    if ( !plus ) {
        num2 *= -1;
    }

    cout << ans << " " << num2 << endl;*/
    return 0;
}


Measured memory_bytes: 4072
#include<iostream>
using namespace std;
int main()
{
	int n, a, b;
	while (cin>>n)
	{
		a =n / 10;
		b = n % 10;
		if (a == 9 || b == 9) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
fn modpow(b: u32, p: u32, m: u32) -> u32 {
    let mut pp = p;
    let mut bb = b;
    let mut rr = 1;

    while pp > 0 {
        if pp & 1 == 1 {
            rr = rr * bb % m;
        }
        bb = bb * bb % m;
        pp >>= 1;
    }

    rr
}

const MOD: u32 = 2019;

fn main() {
    let mut input = String::new();
    std::io::stdin().read_line(&mut input).unwrap();

    let mut a = 0;
    let mut s = 0;
    let mut c = vec![0; 2019];
    c[0] = 1;

    for x in input
        .trim()
        .chars()
        .map(|x| x.to_digit(10).unwrap())
        .rev()
        .enumerate()
        .map(|(i, d)| {
            s = (s + d * modpow(10, i as u32, MOD)) % MOD;
            s as usize
        })
    {
        a += c[x];
        c[x] += 1;
    }

    println!("{}", a)
}


Measured memory_bytes: 2232
// --------------
// Tejas Pandey  |
// 19 - 09 - 20  |
// Atcoder BC 179|
// --------------

#include <bits/stdc++.h>
using namespace std;
     
#define mod 1000000007
#define vi vector<int>
typedef long long int ll;
     
int main (void){
  //freopen("in.txt","r",stdin);
  //freopen("out.txt","w",stdout);
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  int a[n][2],b[n];
  for(int i = 0;i < n;i++) cin >> a[i][0] >> a[i][1];
  for(int i = 0;i < n;i++) b[i] = (a[i][0]==a[i][1]);
  string ans = "No";
  for(int i = 0;i < n - 2;i++){
	if(b[i] && b[i + 1] && b[i + 2])
		ans = "Yes";
  }
  cout << ans << "\n";
  return 0;
}


Measured memory_bytes: 3652
#include <iostream>
#include <algorithm>
#include <bitset>
#include <cassert>
#include <string>
#include <cstring>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <vector>
#include <tuple>

using namespace std;
mt19937_64 rng(58);

string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string) s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B>
string to_string(pair<A, B> p) { return "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; }
template <typename A>
string to_string(A v) { bool first = true; string res = ""; for (const auto &x : v) { if (!first) res += ", "; first = false; res += to_string(x); } return "{" + res + "}"; }
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) { cerr << " " << to_string(H); debug_out(T...); }
#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

void next(vector<int> &d) {
    int n = d.size();

    // find the ok position to +1
    int a = 0;
    for (; a < n - 1; a++) {
        if (d[a] + 1 <= d[a + 1] + 1 && d[a] + 1 <= 9)
            break;
    }
    if (d[a] == 9) {
        for (int i = 0; i < n; i++) d[i] = 0;
        d.push_back(1);
    } else { // fix the seq
        d[a]++;
        for (int i = a - 1; i >= 0; i--) {
            d[i] = max(d[i + 1] - 1, 0);
        }
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    int k;
    cin >> k;
    vector<int> d(1);
    d[0] = 1;
    for (int i = 1; i < k; i++) {
        // debug(i, d);
        next(d);
    }
    reverse(d.begin(), d.end());
    debug(d);
    for (auto dd : d)
        cout << dd;
    cout << endl;
}

Measured memory_bytes: 256
import sys

input = sys.stdin.readline
p = []
n = int(input())
for _ in range(n):
    x, l = map(int, input().split())
    p.append([x-l, x+l])

r = sorted(p, key=lambda x: x[1])

ans = 0
cur = - (1<<60)

for i in r:
    if cur > i[0]:
        continue
    ans += 1
    cur = i[1]

print(ans)


Measured memory_bytes: 22144
#include <algorithm>
  #include <iostream>
  #include <string>
  using namespace std;
  int main()
  {
    int N;
    cin >> N;
    
    bool flag = false;
    string s[N];
    
    for(int i = 0; i < N; i++) {
      cin>>s[i];
    }
    
    for(int i = 0; i < N; i++) {
      // cout<<s[i]<<endl;
      if(s[i] == "Y") {
        flag = true;
      }
    }
    
    if (flag) {
      puts ("Four");
    }
    else {
      puts ("Three");
    }
    
    return 0;
  }


Measured memory_bytes: 256
//MohK
//11/2/2020 ..... 8,42
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
int main(){
    ll a,max=-99999,sum=0;
    cin>>a;
    string s;
    cin>>s;
    for(ll i=0;i<s.size();i++){
        if(s[i]=='I'){
              sum++;
              if(sum>=max){
                max=sum;
              }
        }
        else {
            sum--;
            if(sum>=max){
                max=sum;
            }
        }
    }
    if(max<=0)cout<<0<<endl;
    else
    cout<<max<<endl;

    return 0;
}



Measured memory_bytes: 256
//author: zekigurbuz (Zeki Gurbuz) 2019
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<pii> vpii;
typedef queue<int> qi;
typedef map<string, int> msi;
typedef map<int, int> mii;
typedef map<int, vi> mvi;
typedef map<int, vpii> mvpii;
typedef priority_queue<int> pqi;
typedef set<int> si;

#define int ll
#define double ld
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define lb lower_bound
#define ub upper_bound
#define rsz resize
#define forn(a,b) for(int a=0;a<b;++a)
#define rep(a,b,c) for(int a=b;a<c;++a)
#define all(x) begin(x),end(x)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);

const ld PI=4*atan((ld)1);
const int MOD=1000000007;//998244353
const ll INF=0x3FFFFFFFFFFFFFFFLL;
const int N=200005;

ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

template<class T>void ckmin(T&a,T b){a=min(a,b);}
template<class T>void ckmax(T&a,T b){a=max(a,b);}
template<class T>using Tree=tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;

string Eval(bool b){return(b?"Yes":"No");}
string eval(bool b){return(b?"yes":"no");}
string EVAL(bool b){return(b?"YES":"NO");}

void precomp() {
	
}

void solve(int testCaseNumber) {
	int n; cin >> n;
	string s; cin >> s;
	int ans = 1;
	forn(i, n - 1) if (s[i] != s[i + 1]) ans++;
	cout << ans << endl;
}

signed main(){fastio//freopen("replace.in", "r", stdin);freopen("replace.out", "w", stdout);
	
	precomp();
	int t = 1;
//	cin >> t;
	rep(i, 1, t + 1) solve(i);
	
return 0;}



Measured memory_bytes: 512
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#define REP(i, m, n) for(int i=int(m);i<int(n);i++)
#define EACH(i, c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s, e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())

//#define LOCAL 1
#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR
#endif

//改造
typedef long long int ll;
using namespace std;

//ここから編集する

int gcd(int m, int n) {
    // 引数に０がある場合は０を返す
    if ((0 == m) || (0 == n))
        return 0;

    // ユークリッドの方法
    while (m != n) {
//        if ( m > n ) m = m % n;
//        else         n = n % m;
        if (m > n) {
            m = m % n;
        } else {
            n = n % m;
        }
        if(m == 0) m = n;
        if(n == 0) n = m;
    }
    return m;
}

int gcds(vector<int> a) {
    int ret = a[0];
    for (int i = 0; i < a.size(); i++) {
        ret = gcd(ret, a[i]);
    }
    return ret;
}

int main() {
    int n;
    vector<int> a;
    int k;
    cin >> n >> k;

    for (int i = 0; i < n; i++) {
        int tmp;
        cin >> tmp;
        a.push_back(tmp);
    }

    int G = gcds(a);

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

    bool flag = false;

    for (int i = 0; i < a.size(); i++) {
        if (a[i] - k >= 0 && (a[i] - k) % G == 0) flag = true;
    }
    if (flag) cout << "POSSIBLE" << endl;
    else cout << "IMPOSSIBLE" << endl;

    return 0;

}

Measured memory_bytes: 1144
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
#include <utility>
#include <functional>

using namespace std;

int main() {
	string s;
	cin >> s;
	for (int i = 0; i < s.size() - 1; ++i) {
		if (s.find(s[i], i + 1) != string::npos) {
			cout << "no\n";
			return 0;
		}
	}

	cout << "yes\n";

	return 0;
}

Measured memory_bytes: 256
N = int(input())
inf = float('inf')
dp = [inf] * 100001
dp[0] = 0
for n in range(1, 100001):
    power = 1
    while power <= n:
        dp[n] = min(dp[n], dp[n - power] + 1)
        power *= 6
    power = 1
    while power <= n:
        dp[n] = min(dp[n], dp[n - power] + 1)
        power *= 9

# print(dp)
print(dp[N])

Measured memory_bytes: 3828
from sys import exit

N,M = map(int,input().split())

Query = []
for _ in range(M):
    Query.append(list(map(int,input().split())))

i = 0
if N == 1:
    flag0 = True
    for j in Query:
        if j[0] != 1 or j[1] != 0:
            flag0 = False
            break
        else:
            None
        
    if flag0:
        print(0)
        exit(0)

for i in range(10**(N-1),10**N):
    strnum = str(i)
    flag = True
    for j in Query:
        if strnum[j[0]-1] != str(j[1]):
            flag = False
            break
        else:
            None
    if flag:
        print(i)
        exit(0)
    
print('-1')

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

using namespace std;

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

  cin >> n >> a >> b;

  cin.ignore();

  int feea;
  feea = n * a;
  if(feea < b){
    cout << feea << endl;
  } else {
    cout << b << endl;
  }

  return 0;

}


Measured memory_bytes: 256
#include<stdio.h>

int main(void) {
	char b;

	scanf("%c", &b);

	switch (b)
	{
		case 'A':
			printf("T\n");
			break;
		case 'T':
			printf("A\n");
			break;
		case 'C':
			printf("G\n");
			break;
		case 'G':
			printf("C\n");
			break;
	}

	return 0;
}

Measured memory_bytes: 128
//Solution by NurlashKO
#include <iostream>
#include <cstdio>
#include <queue>
#include <algorithm>
#include <stack>
#include <list>
#include <vector>
#include <map>

using namespace std;

#define F first
#define S second
#define pb push_back
#define sz int(1e6)

int n, a[sz];
vector <int> c1, c2;
vector <pair<int, int> > g;
map <int, int> d[2];

int main() {
    cin >> n;

    for (int i = 1; i <= n; i++) {
        cin >> a[i];
        d[i & 1][a[i]] += 1;
    }

    for (auto v: d[1]) {
        g.pb({v.S, v.F});
    }
    c1.pb(1e9);
    sort(g.rbegin(), g.rend());
    for (int i = 0; i < min(int(g.size()), 3); i++)
        c1.pb(g[i].S);

    g.clear();
    for (auto v: d[0]) {
        g.pb({v.S, v.F});
    }
    c2.pb(-1e9);
    sort(g.rbegin(), g.rend());
    for (int i = 0; i < min(int(g.size()), 3); i++)
        c2.pb(g[i].S);

    int ans = 1e9;
    for (int x: c1)
        for (int y: c2) {
            int cur1 = 0, cur2 = 0;
            if (x != y) {
                for (int i = 1; i <= n; i++) {
                    if ((i & 1) && a[i] != x) cur1++;
                    if (!(i & 1) && a[i] != y) cur2++;
                }
                ans = min(cur1 + cur2, ans);
            }
        }
        cout << ans;
}

Measured memory_bytes: 6012