akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define fi first
#define se second
typedef pair<int,int> P;
#define Mod 1000000007
using VP = vector<P>; using VVP = vector<VP>;
using VI = vector<int>; using VVI = vector<VI>; using VVVI = vector<VVI>;
#define INF 123456789012

#define MAX_V 202020

int V;
vector<int> G[MAX_V];
vector<int> rG[MAX_V];
vector<int> vs;
bool used[MAX_V];
int cmp[MAX_V];

void  addedge(int from,int to){
    G[from].push_back(to);
    rG[to].push_back(from);
}
 
void dfs(int v){
    used[v]=true;
    for(int i=0;i<G[v].size();i++){
        if(!used[G[v][i]]) dfs(G[v][i]);
    }
    vs.push_back(v);
}
 
void rdfs(int v,int k){
    used[v]=true;
    cmp[v]=k;
    for(int i=0;i<rG[v].size();i++){
        if(!used[rG[v][i]]) rdfs(rG[v][i],k);
    }
}
 
int scc(){
    memset(used,0,sizeof(used));
    vs.clear();
    for(int v=0;v<V;v++){
        if(!used[v]) dfs(v);
    }
    memset(used,0,sizeof(used));
    int k=0;
    for(int i=vs.size()-1;i>=0;i--){
        if(!used[vs[i]]) rdfs(vs[i],k++);
    }
    return k;
}

int m;

void yaj(int i,int j){
    addedge(i,j);
    addedge((j+m)%V,(i+m)%V);
}



int main(){
    int i,j;
    int n,x,a,o;
    cin>>n>>x>>a>>o;
    m=1<<(n+1);
    V=2*m;

    for(i=0;i<m;i++){
        for(j=i;j<m;j++){
            if(((i^j)==x)||((i&j)==a)||((i|j)==o)){
                yaj(i,j+m);
                yaj(j,i+m);
                //cout<<i<<" "<<j<<endl;
            }
        }
    }
    for(i=0;i<m;i++){
        j=i^x;
        yaj(i+m,j);
    }

    scc();

    vector<int> ans;
    for(i=0;i<m;i++){
        if(cmp[i]==cmp[i+m]) {
            cout<<"No"<<endl;
            return 0;
        }
        else if(cmp[i]>cmp[i+m]){
            ans.pb(i);
            //cout<<i<<endl;
        }
    }

    cout<<"Yes"<<endl;
    for(i=0;i<ans.size();i++){
        if(i!=0) cout<<" ";
        cout<<ans[i];
    }
    cout<<endl;

    return 0;
}


Measured memory_bytes: 254476
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define rep( i, n, m ) for(int i = ( n ); i < ( m ); i++)
#define rep_d( i, n, m ) for(int i = ( n ) - 1; i >= ( m ); i--)
#define sort_asc( X ) sort(( X ).begin(), ( X ).end())
#define sort_desc( X ) sort(( X ).begin(), ( X ).end(), greater <>())

template <class T> bool chmax( T& a, T b );
template <class T> bool chmin( T& a, T b );
int* eratosthenes( int N );
bool bit_search( int pattern, int N );
template <class T> void cumulative_sum( T array, size_t N );

const ll INF = 1LL << 60;
const int k_mod = 1e9 + 7;

typedef struct {
	vector <int> to;
	int cost;
} edge;
typedef struct {
	bool a;
	bool b;
} P;
int main( void ){
	int R, G, B, N; cin >> R >> G >> B >> N;
	ll ans = 0;
	rep( r, 0, N + 1 ){
		rep( g, 0, N + 1 ){
			int b = ( N - r * R - g * G );
			if (b < 0)
				break;
			if ( b % B == 0)
				ans++;

		}
	}
	cout << ans << endl;
}

int* eratosthenes( int N ){
	int* prime_array = new int[ N + 1 ];
	int lim = N;
	prime_array[ 0 ] = 0;
	prime_array[ 1 ] = 0;
	rep( i, 2, N + 1 ){
		prime_array[ i ] = 1;
	}
	rep( i, 2, lim ){
		if (prime_array[ i ] == 0)
			continue;
		lim = N / i;
		for(int j = i * 2; j < N + 1; j += i){
			prime_array[ j ] = 0;
		}
	}
	return prime_array;
}
template <class T> void cumulative_sum( T array, size_t N ) {
	rep( i, 1, N + 1 ){
		array[ i ] += array[ i - 1 ];
	}
}
template <class T> bool chmax( T& a, T b ) {
	if (a < b){
		a = b; return true;
	}
	return false;
}
template <class T> bool chmin( T& a, T b ) {
	if (a > b){
		a = b; return true;
	}
	return false;
}
bool bit_search( int pattern, int N ){
	int cnt = 0;
	rep( bit, 0, N ){
		if (pattern & ( 1 << bit )){
			cnt++;
		}
	}
	return true;
}


Measured memory_bytes: 256
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *

import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

if __name__ == '__main__':
    n = int(input())

    a = input()
    listr = [0]*n
    listg = [0]*n
    listb = [0]*n
    r =a.count("R")
    g =a.count("G")
    b =a.count("B")

    count = 0

    for i in range(n):

        if a[i] == "R":
            r -=1
        if a[i] == "G":
            g -=1
        if a[i] == "B":
            b -=1
        listr[i] =r
        listb[i] =b
        listg[i] =g

    for i in range(n-2):
        for j in range(i+1,n-1):
            if a[i] != a[j]:
                if a[i] =="R" and a[j] =="G":
                    count += listb[j]
                    if (j-i)+j < len(a) and a[(j-i)+j] =="B" and listb[j] >0:
                        count -=1
                    continue
                if a[i] =="R" and a[j] =="B":
                    count += listg[j]
                    if (j-i)+j < len(a) and a[(j-i)+j] =="G" and listg[j] >0:
                        count -=1
                    continue
                if a[i] =="G" and a[j] =="B":
                    count += listr[j]
                    if (j-i)+j < len(a) and a[(j-i)+j] =="R" and listr[j] >0:
                        count -=1
                    continue
                if a[i] =="G" and a[j] =="R":
                    count += listb[j]
                    if (j-i)+j < len(a) and a[(j-i)+j] =="B" and listb[j] >0:
                        count -=1
                    continue

                if a[i] =="B" and a[j] =="G":
                    count += listr[j]
                    if (j-i)+j < len(a) and a[(j-i)+j] =="R" and listr[j] >0:
                        count -=1
                    continue

                if a[i] =="B" and a[j] =="R":
                    count += listg[j]
                    if (j-i)+j < len(a) and a[(j-i)+j] =="G" and listg[j] >0:
                        count -=1
                    continue


    print(count)

Measured memory_bytes: 74056
#include <vector>
#include <iostream>
#include <map>
#include <string>
#include <utility>
#include <algorithm>
#include <stack>
#include <cstdlib>

const int INF = 1001001000;
const int MOD = (int)1e9 + 7;

using ll = long long;

using namespace std;

int s[1000];
int top;

void initialize(){
  top = 0;
  for( int i = 0; i < 1000; ++i){
    s[i] = 0;
  }
}

void push( int x){
  ++top;
  s[top] = x;
}

int pop(){
  --top;
  return s[top+1];
}


int main(){

  string str;
  int a,b;
  initialize();

  while( cin >> str){
    if( str == "+"){
      a = pop();
      b = pop();
      push(a+b);
    }else if( str == "-"){
      a = pop();
      b = pop();
      push(b-a);
    }else if( str == "*"){
      a = pop();
      b = pop();
      push(a*b);
    }else{
      push(::atoi(str.c_str()));
    }
  }
  cout << pop() << endl;
}

Measured memory_bytes: 3160
#include <iostream>
#include <algorithm>
using namespace std;
int selectionsort(int A[], int N) {
    int t, sw = 0, minj;
    for(int i = 0; i < N - 1; i++) {
        minj = i;
        for(int j = i; j < N; j++) {
            if(A[j] < A[minj]) {
                minj = j;
            }
        }
        swap(A[i], A[minj]);
        if(i != minj) {
            sw++;
        }
    }
    return sw;
}
int main() {
    int A[100], sw, N;

    cin >> N;
    for(int i = 0; i < N; i++) {
        cin >> A[i];
    }
    sw = selectionsort(A, N);
    for(int i = 0; i < N; i++) {
        if(i > 0) {
            cout << " ";
        }
        cout << A[i];
    }
    cout << endl;
    cout << sw << endl;
    return 0;
}


Measured memory_bytes: 3120
# D
res = 0

A = int(input())
B = int(input())

def pow2_floor_log2(x):
    res = 1
    while res*2 <= x:
        res *= 2
    return res

if A == B:
    res += 1
    
while A < B:
    # find log2A and log2B
    C = pow2_floor_log2(B)
    if A < C:
        # A to C
        res += C - A
        if B > C:
            B_ = C + pow2_floor_log2(B - C)*2 - 1
        else:
            B_ = C
        if C + A <= B_:
            res += C
            break
        else:
            res += (C - A) + (B_ - C + 1)
            break
    else:
        A -= C
        B -= C

print(res)

Measured memory_bytes: 3064
def inv(N):
    #n^-1
    inv=[1,1]

    for i in range(2,N+1):
        inv.append(mod-mod//i*inv[(mod%i)]%mod)
    return inv
n,a,b=map(int,input().split())

mod=10**9+7

def repmod(n,m):
    if n==1:return 2
    nn = n // 2
    te = repmod(nn, m)
    if n%2==0:
        ans=(te*te)%mod
        return ans
    elif n%2==1:
        ans=(2*te*te)%mod
        return ans


total=repmod(n,mod)-1

c=max(a,b)

temp=1
s=0
invlist=inv(c)
for i in range(c):
    temp=(temp*(n-i))%mod
    invi=invlist[i+1]
    temp=temp*invi
    if i+1==a:
        s+=temp
    if i+1==b:
        s+=temp

ans=(total-s)%mod
print(ans)


Measured memory_bytes: 11064
#include <iostream>

#include <string>
#include <vector>

using std::cin;
using std::cout;
using std::endl;

using std::string;
using std::vector;

int
main()
{
  int N, M;
  cin >> N >> M;
  vector<char> ok(N, 0);
  vector<int> err(N, 0);
  int ok_count = 0;
  int err_count = 0;
  for (int m = 0; m < M; m++)
  {
    int p;
    string S;
    cin >> p >> S;
    if (ok[p - 1] == 0)
    {
      if (S == "AC")
      {
        ok[p - 1] = 1;
        ok_count++;
        err_count += err[p - 1];
      }
      else
      {
        err[p - 1]++;
      }
    }
  }
  cout << ok_count << ' ' << err_count << endl;
  return 0;
}


Measured memory_bytes: 768
#include <iostream>
#include <bits/stdc++.h>
#define pb push_back
#define ob pop_back
#define xx first
#define yy second
#define dob double
#define int long long int
#define ss size()

using namespace std;

const int M=1e9+7,maxn=105;
std::vector<int> adj[30];
std::vector<int> v1;
std::vector<int> v;

int ans,n,k,m,x,y,q,par[maxn],h[maxn][maxn],mach[maxn];
bool mark[maxn];


int32_t main(){
    cin>>n>>m>>k;
    int a[k];
    for(int i=0;i<k;i++){
        cin>>a[i];
        ans+=a[i];
    }
    int d=0,i=0,j=0,l=1;
    while(ans>0){
        if(a[d]>0){
            ans--;
            a[d]--;
            h[i][j]=(d+1);
            if((j==m-1&&l==1)||(j==0&&l==-1)){
                i++;
                l*=-1;
            }
            else
                j+=l;
        }
        else{
            d++;
            ans--;
            a[d]--;
            h[i][j]=(d+1);
            if((j==m-1&&l==1)||(j==0&&l==-1)){
                i++;
                l*=-1;
            }
            else
                j+=l;
        }
    }
    for(int i=0;i<n;i++){
        for(int j=0;j<m;j++)
            cout<<h[i][j]<<" ";
        cout<<endl;
    }
    return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template<class T> inline bool chmax(T &a, T b) { if (a<b) {a=b; return 1;} return 0;}
template<class T> inline bool chmin(T &a, T b) { if (b<a) {a=b; return 1;} return 0;}

int dp[110][10010];

int main() {
    int n, W;
    cin >> n >> W;
    vector<int> value(n), weight(n);
    rep(i, n) cin >> value[i] >> weight[i];
    
    rep(i, n) {
        rep(j, W+1) {
            chmax(dp[i+1][j], dp[i][j]);
            if (j - weight[i] >= 0) chmax(dp[i+1][j], dp[i+1][j-weight[i]] + value[i]);
        }
    }

    cout << dp[n][W] << endl;
}


Measured memory_bytes: 7004
#[allow(unused_macros)]
macro_rules! get {
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
}
#[allow(unused_macros)]
macro_rules! get_v {
    ($t:ty) => {{
        let mut line: String = String::new();
        std::io::stdin().read_line(&mut line).unwrap();
        line.split_whitespace()
            .map(|t| t.parse::<$t>().unwrap())
            .collect::<Vec<_>>()
    }};
    ($t:ty; $n:expr) => {
        (0..$n).map(|_| get_v!($t)).collect::<Vec<_>>()
    };
}

fn main() {
    let n = get!(usize);
    let v = get_v!(usize; 2);

    let mut result = 0;
    for i in 0..n {
        let mut temp = 0;
        for j in 0..n {
            if i <= j {
                if i == j {
                    temp += v[0][j];
                }
                temp += v[1][j];
            } else {
                temp += v[0][j];
            }
        }
        //eprintln!("i: {}, temp: {}",i, temp);
        if result <= temp {
            result = temp;
        }
    }
    println!("{}", result);
}


Measured memory_bytes: 4352
#include <algorithm>
#include <iostream>

using namespace std;

const int MD = 1000000007;

int main() {
	long long n, k; cin >> n >> k;
	long long x = n - (k - 1) + 1, ans = (x * x * n * 3 + x * x * 6 - x * x * k * 6 + x * k * n * 6 - x * n * 3 - x * k * k * 6 + x * k * 12 - x * x * x * 2 + x * 2) / 6 % MD;
	if (ans < 0)
		ans += MD;
	cout << ans << '\n';
	return 0;
}


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

int main() {
  long long x;
  cin >> x;
  for (long long i = -200; i < 200; i++) {
    for (long long j = i + 1; j < 200; j++) {
      long long d =
          (long long)(j * j * j * j * j) - (long long)(i * i * i * i * i);
      if (d == x) {
        cout << j << " " << i << endl;
        return 0;
      }
    }
  }
  return 0;
}

Measured memory_bytes: 3636
import sys
import itertools
n=input()
n2=int(n)
num=['3','5','7']
cnt=0
if n2<357:
    print(0)
    sys.exit()
for i in range(3,len(n)+2):
    for j in itertools.product(num,repeat=i):
        if len(set(j))==3 and int("".join(j))<=n2:
            cnt+=1
print(cnt)


Measured memory_bytes: 3060
#include<stdio.h>
#include<algorithm>
using namespace std;
#define maxn 100010
int n;
typedef long long ll;
ll a,b,h[maxn];
bool test(ll mid){
	ll ans=0;
	for(int i=0;i<n;i++){
		ll c=h[i]-mid*b;
		if(c>0){
			if(c%(a-b)==0)
				ans+=c/(a-b);
			else
				ans+=c/(a-b)+1;
		}
	}
	return ans<=mid;
}
int main(){
	ll maxh=0;
	scanf("%d%lld%lld",&n,&a,&b);
	for(int i=0;i<n;i++){
		scanf("%lld",&h[i]);
		maxh=max(maxh,h[i]);
	}
	ll l=0,r=maxh/b+1;
	while(l<r){
		ll mid=(l+r)/2;
		if(test(mid))
			r=mid;
		else
			l=mid+1;
	}
	printf("%lld\n",l);
	return 0;
}

Measured memory_bytes: 896
import sys
# input関係の定義
sys.setrecursionlimit(200000)
input = sys.stdin.readline
def ii(): return int(input())
def mi(): return map(int, input().rstrip().split())
def lmi(): return list(map(int, input().rstrip().split()))
def fi(): return float(input())
def mfi(): return map(float, input().rstrip().split())
def lmfi(): return list(map(float, input().rstrip().split()))
def li(): return list(input().rstrip())
def si(): return input().rstrip()
def debug(*args, sep=" ", end="\n"): print("debug:", *args, file=sys.stderr, sep=sep, end=end) if not __debug__ else None
def exit(*arg): print(*arg); sys.exit()
# template

# BEGIN CUT HERE
class RollingHash():
    """ロリハ。容易に衝突するので注意。"""
    BASE1 = 1007
    BASE2 = 2009
    MOD1 = 1000000007
    MOD2 = 1000000009

    def __init__(self, s, opt=2):
        self.n = len(s)
        self.opt = opt
        self.hash1 = [0] * (self.n + 1)
        self.power1 = [1] * (self.n + 1)
        if opt == 2:  # rollinghash by 2 mod
            self.hash2 = [0] * (self.n + 1)
            self.power2 = [1] * (self.n + 1)

        for i, e in enumerate(s):
            self.hash1[i + 1] = (self.hash1[i] * self.__class__.BASE1 + ord(e)) % self.__class__.MOD1
            self.power1[i + 1] = (self.power1[i] * self.__class__.BASE1) % self.__class__.MOD1
        if opt == 2:  # rollinghash by 2 mod
            for i, e in enumerate(s):
                self.hash2[i + 1] = (self.hash2[i] * self.__class__.BASE2 + ord(e)) % self.__class__.MOD2
                self.power2[i + 1] = (self.power2[i] * self.__class__.BASE2) % self.__class__.MOD2

    def get(self, l: int, r: int):
        res1 = self.hash1[r] - self.hash1[l] * self.power1[r - l] % self.__class__.MOD1
        if(res1 < 0):
            res1 += self.__class__.MOD1
        if self.opt == 2:
            res2 = self.hash2[r] - self.hash2[l] * self.power2[r - l] % self.__class__.MOD2
            if(res2 < 0):
                res2 += self.__class__.MOD2

        if self.opt == 2:
            return (res1, res2)
        else:
            return res1
# END CUT HERE
if not __debug__:
    import io
    import random
    class MyStdin(io.TextIOWrapper):
        @classmethod
        def readline(cls):
            N = 1000000
            yield "{}\n".format(N)
            yield "{}\n".format(''.join([chr(random.randint(0, 25) + ord("a")) for i in range(N // 5)] * 5))
    input = MyStdin.readline().__next__

def ABC131E():
    N = ii()
    S = si()
    rh = RollingHash(S)
    def check(n: int):
        d = dict()
        for i in range(N - n + 1):
            p = rh.get(i, i + n)
            if p in d:
                if(i - d[p] >= n):
                    return True
            else:
                d[p] = i
        return False
    ok, ng = 0, N // 2 + 1
    while ng - ok > 1:
        mid = (ok + ng) // 2
        if check(mid):
            ok = mid
        else:
            ng = mid
    print(ok)



if __name__ == '__main__':
    if not __debug__:
        import cProfile
        cProfile.run('ABC131E()', sort=1)
    else:
        ABC131E()


Measured memory_bytes: 45168
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")

#include <bits/stdc++.h>

using namespace std;

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
#define ll long long int

ll mod=1e9+7;

int main(){
    int n;
    cin>>n;
    vector<vector<int>> tree(n);
    int u,v;
    for(int i=1;i<n;i++){
        cin>>u>>v;
        u--,v--;
        tree[u].push_back(v);
        tree[v].push_back(u);
    }

    vector<ll> bl(n);
    vector<ll> wh(n);

    function<void(int,int)> dfs_exp=[&](int node,int parent){ 
        int cnt=0;
        for(auto v:tree[node]){
            if(v!=parent){
                dfs_exp(v,node);
                cnt++;
            }
        }
        ll wh_ways=1;
        ll bl_ways=1;
        for(auto v:tree[node]){
            if(v!=parent){
                bl_ways*=wh[v];
                wh_ways*=bl[v];
            }
            bl_ways%=mod;
            wh_ways%=mod;
        }
        bl[node]=bl_ways;
        wh[node]=(bl_ways+wh_ways)%mod;
    };
    dfs_exp(0,-1);
    debug(bl);
    debug(wh);
    cout<<wh[0]<<"\n";
    return 0;
}

Measured memory_bytes: 22572
#include <bits/stdc++.h>
#define DUMP(x)  cout << #x << " = " << (x) << endl;
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define IFOR(i, m, n) for(int i = n - 1; i >= m; i-- )
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
#define FOREACH(x,a) for(auto& (x) : (a) )
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
const ll INF = 1e18;
/* テンプレートここまで */
void yes(){
  cout << "Yes" << endl;
  exit(0);
}

void no(){
  cout << "No" << endl;
  exit(0);
}

int main() {
  string s; cin >> s;
  if(s[0] == '9' || s[1] == '9') yes();
  else no();
} 

Measured memory_bytes: 256
n,m=gets.split.map(&:to_i)
hash={}
m.times do |i|
    p,s=gets.split
    if hash[p]==nil
        hash[p]=[s]
    else
        hash[p]<<s
    end
end

ac=0
penalty=0
hash.each_value do |s|
    wa=0
    s.each do |i|
        if i=="AC"
            ac+=1
            penalty+=wa
            break
        else
            wa+=1
        end
    end
end

puts "#{ac} #{penalty}"


Measured memory_bytes: 41464
#include <bits/stdc++.h>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#include <boost/integer/common_factor.hpp>
#include <boost/integer/common_factor_rt.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>

using std::string;
using std::vector;
using std::set;
using std::multiset;
using std::unordered_set;
using std::map;
using std::multimap;
using std::unordered_map;
using std::pair;
using std::cin;
using std::cout;

typedef uintmax_t    ull;
typedef intmax_t     ll;
typedef uint64_t     ul;
typedef uint32_t     ui;
typedef uint8_t      uc;

typedef boost::multiprecision::number<boost::multiprecision::cpp_dec_float<1000>> cpp_dec_float_1000;

constexpr char CRLF  = '\n';
constexpr char SPACE = ' ';
constexpr char VECTOR_COUT_SEPARATOR = SPACE;
constexpr ll INF = 1000'000'007;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> std::ostream& operator<< (std::ostream& os, const std::vector<T>& vc) { for(auto it = vc.begin(); it != vc.end(); ++it) { if (std::next(it) == vc.end()) os << *it; else os << *it << VECTOR_COUT_SEPARATOR; } return os; }
template<class T1, class T2> inline std::ostream & operator<< (std::ostream & os, const std::pair<T1, T2> & p) { return os << p.first << ' ' << p.second; }

void solve(void)
{
  int64_t a, b; cin >> a >> b;
  auto c = boost::integer::gcd(a, b);
  ull ans{1};
  for(int64_t i = 2; i*i <= c; ++i){
    if(c % i != 0){
      continue;
    }
    ++ans;
    while (c % i == 0){
      c /= i;
    }
  }
  if(c != 1) ++ans;
  cout << ans << CRLF;
  return;
}

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

  solve();

  return 0;
}


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

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


int main()
{

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

	// ios_base::sync_with_stdio(false);
	// cin.tie(0);
	// int t;
	// cin >> t;
	// while (t--)
	// {
		int a, b;
		cin >> a >> b;
		cout << a * b << "\n";
	// }

	return 0;
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<long long, long long> P;
struct edge{long long to,cost;};
const int inf = 1 << 27;
const long long INF = 1LL << 60;
const int COMBMAX = 1001001;
const long long MOD = 1000000007;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define eachdo(v, e) for(const auto& e : (v))
#define all(v) (v).begin(), (v).end()
#define lower_index(v, e) (long long)distance((v).begin(), lower_bound((v).begin(), (v).end(), e))
#define upper_index(v, e) (long long)distance((v).begin(), upper_bound((v).begin(), (v).end(), e))
long long mpow(long long a, long long n, long long mod = MOD){long long res = 1; while(n > 0){if(n & 1)res = res * a % mod; a = a * a % mod; n >>= 1;} return res;}
void yn(bool j){cout << (j ? "Yes" : "No") << endl; return;}
template<class Head> void pt(Head&& head){cout << head << endl; return;}
template<class Head, class... Tail> void pt(Head&& head, Tail&&... tail){cout << head << " "; pt(forward<Tail>(tail)...);}
template<class T> void debug(T v){rep(i, v.size()) cout << v[i] << " " ; cout << endl;}
template<class T> void debug2(T v){rep(i, v.size()){rep(j, v[i].size()) cout << v[i][j] << " " ; cout << endl;}}
template<class T1, class T2> long long bcount(T1 v, T2 a){return upper_index(v, a) - lower_index(v, a);} 
template<class T1, class T2> inline bool chmin(T1 &a, T2 b){if(a > b){a = b; return true;} return false;}
template<class T1, class T2> inline bool chmax(T1 &a, T2 b){if(a < b){a = b; return true;} return false;}
template<class T1, class T2> void sortTwoVecter(vector<T1> &f, vector<T2> &s, bool isReverse = false){
    vector<pair<T1, T2>> p;
    rep(i, f.size()) p.emplace_back(make_pair(f[i], s[i]));
    if (!isReverse) sort(p.begin(), p.end());
    else sort(p.rbegin(), p.rend());
    rep(i, f.size()) tie(f[i], s[i]) = p[i];
    return;
}

int main(){
    ll N; cin >> N;
    string S; cin >> S;
    ll ans = 0;
    vector<ll> r(N + 1, 0), b(N + 1, 0), g(N + 1, 0);
    rep(i, N){
        r[i + 1] += r[i];
        b[i + 1] += b[i];
        g[i + 1] += g[i];
        if (S[i] == 'R') ++r[i + 1];
        if (S[i] == 'B') ++b[i + 1];
        if (S[i] == 'G') ++g[i + 1];
    }
    for(int j = 1; j < N; j++){
        rep(i, j){
            if ((S[i] == 'R' && S[j] == 'G') || (S[i] == 'G' && S[j] == 'R')){
                ans += b[N] - b[j + 1];
                if (j * 2 - i < N && S[j * 2 - i] == 'B') ans--;
            }
            else if ((S[i] == 'G' && S[j] == 'B') || (S[i] == 'B' && S[j] == 'G'))
            {
                ans += r[N] - r[j + 1];
                if (j * 2 - i < N && S[j * 2 - i] == 'R') ans--;
            }
            else if ((S[i] == 'R' && S[j] == 'B') || (S[i] == 'B' && S[j] == 'R'))
            {
                ans += g[N] - g[j + 1];
                if (j * 2 - i < N && S[j * 2 - i] == 'G') ans--;
            }
        }
    }
    pt(ans);
}
 

Measured memory_bytes: 3692
//IN THE NAME OF GOD;
//Test By Dev-C++5.11
#include<bits/stdc++.h>
#define ll  long long
#define isc ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define ld long double
#define ss string
#define ww while
#define vl vector<ll>
#define pb push_back
#define in insert
#define itr iterator
#define gt goto
#define rep(i,n,j) for(ll i=n;i<j;i++)
#define tep(i,n,j) for(ll i=n;i>=j;i--)
#define co(n) cout << n ;
#define pll pair<ll,ll>
#define bft bool f=true
#define bff bool f=false
using namespace std;

ll bmm(ll a, ll b) {
	if (b == 0) return a;
	else return bmm(b, a%b);
}
ll kmm(ll a, ll b) {
	return(a*b) / bmm(a, b);
}


const ll mod = 1e9 + 7;
const ll MAXN = 3e5+5;

ll n,a[MAXN],b[MAXN];
int main() {
	isc;
	cin >> n;
	rep(i,0,n){
		cin >> a[i];
		b[a[i]]=i+1;
	}
	rep(i,1,n+1)
		cout << b[i] << " ";
	return 0;
}


Measured memory_bytes: 3712
#include <iostream>
#include <cassert>
#include <vector>

using namespace std;

void solve(int n, vector<int>&v, vector<int>&c){
  int sum = 0;
  int diff = 0;
  for(int i = 0; i < n; i++ ){
    diff = v[i] - c[i];
    if(diff > 0) sum += diff;
  }
  cout << sum;
}

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

  cin >> n;

  vector<int> c, v;

  // cout << "Test Num " << t << endl;

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

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

  solve(n, v, c);

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define mp make_pair
#define pb push_back
#define pll pair<ll,ll>
ll INF = 1000000007;

/***************/
 #define amin main
/***************/

ll exp(ll x, ll n)
{if(n==0) return 1;if(n==1) return x%INF;if(n%2==0) return exp((x*x)%INF,n/2); else return(x*exp((x*x)%INF,n/2))%INF;}


int amin()
{
	
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll t,i,j;
	ll n;
	cin>>n;
	ll a=0,b=0,c=0,d = 0;
	for(i=0;i<n;i++)
	{
		string s;
		cin>>s;
		if(s[0]=='A')
			a++;
		else if(s[0]=='W')
			b++;
		else if(s[0]=='T')
			c++;
		else
			d++;
	}
	cout<<"AC x "<<a<<endl;
	cout<<"WA x "<<b<<endl;
	cout<<"TLE x "<<c<<endl;
	cout<<"RE x "<<d<<endl;


	//cout<<a<<endl;


	


	
	

	
	


	
	return 0;
}

Measured memory_bytes: 3644
#include <bits/stdc++.h>
#define REP(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, m, n) for(ll i = m;i < n;i++)
#define VSORT(v) sort(v.begin(), v.end());
#define VREV(v) reverse(v.begin(), v.end());
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vdouble = vector<double>;

int gcd(int a, int b) {
    if (b==0) return a;
   	else return gcd(b, a%b);
}
int lcm(int a, int b) {
    return a * b / gcd(a, b);
}



int main(){
	ll N,M;
	cin>>N>>M;
	
	if(N==M)cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll                  long long
#define dl                 long double
#define pb                push_back
#define F                  first
#define S                  second
//#define endl              "\n"
#define rep(i,a,b)       for(i=a;i<b;i++)
#define all(v)             v.begin(),v.end()
#define allr(v)            v.rbegin(),v.rend()
#define mod              1000000007LL
#define CIN(V,s,n)      for(int i=s;i<n;i++){cin >> V[i];}
#define COUT(V,s,n)   {for(int i=s;i<n;i++){cout <<  V[i] << " "  ;} cout << endl;}
#define fast               ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define CLEAR(V);      for(ll i=0;i<V.size();i++) V[i] = 0;
#define N                  101LL
#define tmod             998244353LL
using namespace std;

bool sBs(const pair<int,int> &a,const pair<int,int> &b)
{   return (a.second < b.second);   }

ll Powb(ll b,ll n,ll m);
ll BS(vector<pair< ll ,ll > > &PS,ll s,ll e,ll ser);
ll MI(ll a, ll m);
ll P[N+1];
void Sieve(int n=N);

int main()
{
fast;
ll q=1,t;
//cin >> q; t = q;
while(q--)
{
    ll i,j,n,m,k,l=0,r=0,a=0,b=0,c=0,d=0,e,g=1,p,u,v,w,x,y,flag=0;
    //n=m=k=i=j=l=r=a=b=c=d=u=v=w=p=x=y=0;
    string s;
    cin >> s;
    if(s=="SUN") cout << 7;
    else if(s=="MON") cout << 6;
    else if(s=="TUE") cout << 5;
    else if(s=="WED") cout << 4;
    else if(s=="THU") cout << 3;
    else if(s=="FRI") cout << 2;
    else if(s=="SAT") cout << 1;
    }
    return 0;
}

//*****************************************************************************************************************************************

ll Powb(ll b,ll n,ll m)
{
    if(n==0) return 1LL;
    if(n==1) return b;
    ll temp = Powb(b,n/2,m);
    if(n%2==0){return (temp*temp)%m;}
    else{return (b*((temp*temp)%m))%m;}
}

ll BS(vector<pair<ll,ll> > &PS,ll s,ll e,ll ser)
{
    if(s>e)
        return s;
    ll mid = (s+e)/2;
    if(PS[mid].F==ser)
    {
        return mid;
    }
    else if(PS[mid].F > ser)
    {
        return BS(PS,s,mid-1,ser);
    }
    else
        return BS(PS,mid+1,e,ser);
}
ll MI(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;
}

void Sieve(int n)
{
    //memset(P,true,sizeof(P));
    //P[0] = false;
    //P[1]= false;
    for(int i=1;i<=n;i++) P[i] = i;
    for(ll i=2;i*i<=n;i++)
    {
        if(P[i]==i)
        {
            for(ll j=i*i;j<=n;j+=i)
            {
                if(P[j]==j)
                    P[j]=i;
            }
        }
    }

}



Measured memory_bytes: 3612
M, D = map(str, input().split())
M = int(M)

cnt = 0
for i in range(1, M+1):
    for j in range(1, int(D)+1):
        j = str(j)
        if len(j) == 2:
            if int(j[0]) >= 2 and int(j[1]) >= 2 and i == (int(j[0]) * int(j[1])):
                cnt += 1

print(cnt)

Measured memory_bytes: 3060
import collections

N = int(input())
A = list(map(int, input().split()))
Q = int(input())
counter = collections.Counter(A)
total = 0
for k, v in counter.items():
    total += k * v
for i in range(Q):
    B, C = map(int, input().split())
    if counter.get(B) != None:
        count = counter.pop(B)
        counter[C] = counter.get(C, 0) + count
        total -= count * B
        total += count * C
    print(total)


Measured memory_bytes: 21352
N, K = map(int,input().split())
H = list(map(int,input().split()))

inf = float('inf')

dp = [inf]*(10**5+10)
dp[0] = 0

for i in range(N):
    for j in range(1, K+1):
        if i+j >= N:
            break
        dp[i+j] = min(dp[i+j], dp[i] + abs(H[i+j] - H[i]))

print(dp[N-1])


Measured memory_bytes: 55008
n = int(input())
a = list(map(int,input().split()))
c = 0
while True:
    b = []
    for i in a:
        if not(i%2):
            b.append(int(i/2))
    if(len(b)!=len(a)):
        break
    a = list(b)
    c+=1
print(c)

Measured memory_bytes: 3188
#include <iostream>
using namespace std;
int main(void){
    
    int a,b,x,k=0;
    cin>>a>>b>>x;
    
     if(x % 500 != 0 && a>=b &&x%1000<=500){
        k=k+b;
        x=x-x%1000;
    }
    else if(x%500!=0&&  a >= 2 * b&& x%1000>500){
        k=k+2*b;
        x=x-x%1000;
    }
    else if (x%500!=0&&a<=2*b&&x%1000>500){
        k=k+a;
        x=x-x%1000;
    }
    else if(x%500!=0&&a<=b&&x%1000<=500){
        k=k+a;
        x=x-x%1000;
    }
    
    if(a<2*b&&a>b){
        k=k+x/1000*a+x%1000/500*b;
    }
    
 
    if(a>=2*b&&a>b){
        k=k+x/500*b;
    }
    else if(a<b&&x==500){
        k=k+x/500*a;
    }
    else if(a<=b&&x%1000==0){
        k=k+x/1000*a;
    }
   
    cout<<k<<endl;
    
}




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

const int MAXN = 200010;
typedef std::vector<int> VI;
VI out[MAXN];
int A[MAXN], n, fa[MAXN], ins[MAXN], bak;
int find(int x) { return x == fa[x] ? x : fa[x] = find(fa[x]); }
int dfs(int u) {
	std::set<int> S;
	for (auto i : out[u]) if (!ins[i]) S.insert(dfs(i));
	int now = 0; while (S.count(now)) ++now;
	return now;
}
bool f[MAXN][2];
int main() {
	std::ios_base::sync_with_stdio(false), std::cin.tie(0);
	std::cin >> n;
	for (int i = 1; i <= n; ++i) std::cin >> A[i], out[A[i]].push_back(fa[i] = i);
	for (int i = 1; i <= n; ++i) if (find(i) == find(A[i])) {
		memset(fa, 0, n + 1 << 2);
		int now = i;
		do ins[fa[++bak] = now] = true, now = A[now]; while (now != i);
		break;
	} else fa[find(i)] = find(A[i]);
	for (int i = 1; i <= bak; ++i) A[i] = dfs(fa[i]);
	int ans = false; n = bak;
	for (int T = 0; T != 2; ++T) {
		memset(f, 0, sizeof f);
		f[1][T] = true;
		for (int j = 2; j <= n; ++j) {
			for (int k = 0; k < 2; ++k) {
				f[j][0] |= f[j - 1][k] && A[j - 1] + k != A[j];
				f[j][1] |= f[j - 1][k] && A[j - 1] + k == A[j];
			}
		}
		for (int k = 0; k < 2; ++k) {
			if (T == 0) ans |= f[n][k] && A[n] + k != A[1];
			if (T == 1) ans |= f[n][k] && A[n] + k == A[1];
		}
	}
	std::cout << (ans ? "POSSIBLE" : "IMPOSSIBLE") << '\n';
	return 0;
}


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

int main(){
    int N, K;
    cin >> N >> K;
    double ans = 0;
    for(int i=1; i <= N; i++){
      double per=1;
      if(i < K){
          int j;
          j = i;
        while(j < K){
          j *= 2;
          per /= 2;
        }
      }
      per /= N;
      ans += per;
    }
    cout << fixed << setprecision(12) << ans << endl;
    return 0;
    }

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

int main() {
	int N;
	cin >> N;
	string S[N];
	for (int i = 0; i < N; i++) {
		cin >> S[i];
	}
	sort(S, S + N);
	int ans = 1;
	for (int i = 1; i < N; i++) {
		if (S[i - 1] != S[i]) ans++;
	}
	cout << ans << endl;
return 0;
}

Measured memory_bytes: 9860
from collections import deque

def get_adj(pos):
    return [(pos[0]-1, pos[1]),
            (pos[0]+1, pos[1]),
            (pos[0], pos[1]-1),
            (pos[0], pos[1]+1),
            ]

def can_go(pos, adj, walls):
    if (pos, adj) not in walls:
        return False
    if walls[(pos, adj)] == 0:
        return True
    return False

def solve(W, H):
    walls = {}
    for r in range(2*H - 1):
        l = list(map(int, input().split()))
        if r % 2 == 0:
            for c in range(len(l)):
                left = (r//2, c)
                right = (r//2, c+1)
                walls[(left, right)] = l[c]
                walls[(right, left)] = l[c]
        else:
            for c in range(len(l)):
                up = (r//2, c)
                down = (r//2 + 1, c)
                walls[(up, down)] = l[c]
                walls[(down, up)] = l[c]
    start = (0, 0)
    goal = (H-1, W-1)
    q = deque()
    q.append((start, 0))
    visited = set()
    while q:
        pos, dist = q.popleft()
        if pos in visited:
            continue
        if pos == goal:
            print(dist + 1)
            return
        visited.add(pos)
        for adj in get_adj(pos):
            if can_go(pos, adj, walls):
                q.append((adj, dist+1))

    print(0)
    return

while True:
    W, H = map(int, input().split())
    if W == 0 and H == 0:
        break
    solve(W, H)




Measured memory_bytes: 6676
#include <iostream> // cin, cout, cerr
#include <algorithm> // minmax, sort, swap
#include <numeric> // iota
#include <cstdio> // printf, scanf
#include <string> // string, stoi, to_string
#include <vector> // vector
#include <queue> // queue, priority_queue
#include <deque> // deque
#include <map> // key-value pairs sorted by keys
#include <set> // set
#include <iomanip> // cout<<setprecision(n)
#include <functional> // function<void(int)>
#include <cmath>
#include <cassert>
#include <bitset>
#include <stack>

#ifdef DEBUG
#include "debug.hpp"
#else
#define debug(...)
#endif

#define int long long // at least int64 > 9*10^18
#define EL '\n'
#define rep(i,n) for(int i = 0; i < (n); i++)
#define print(i) std::cout << (i) << '\n'
#define all(v) (v).begin(), (v).end()
using Graph = std::vector<std::vector<int> >;
const int INF = 1e17;
/* libraries */

signed main() {
	int n,z,w;
	std::cin >> n >> z >> w;
	std::vector<int> a(n);
	rep(i,n) std::cin >> a[i];
	if(n==1) {
		print(std::abs(w-a[0]));
		return 0;
	}
	int x=std::abs(a[n-1]-a[n-2]);
	print(std::max(std::abs(w-a[n-1]),x));
	return 0;
}


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

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

    vector<int> cnts(n + 1, n + 1);
    cnts[0] = 0;
    for (int i = 1; i <= n; i++)
    {
        for (int p = 1; i - p >= 0; p *= 6)
        {
            int c = 1 + cnts[i - p];
            if (c < cnts[i]) 
            {
                cnts[i] = c;
            }
        }

         for (int p = 1; i - p >= 0; p *= 9)
        {
            int c = 1 + cnts[i - p];
            if (c < cnts[i]) 
            {
                cnts[i] = c;
            }
        }
    }

    cout << cnts[n] << endl;
}

Measured memory_bytes: 640
#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
using namespace std;
#define Ma_PI 3.141592653589793
#define eps 0.00000001
#define LONG_INF 3000000000000000000
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define MOD 998244353
#define REP(i,n) for(long long i = 0;i < n;++i)    
#define seg_size 524288
double dot(complex<double> a, complex<double> b) {
	return a.real() * b.real() + a.imag() * b.imag();
}
double gyaku_dot(complex<double> a, complex<double> b) {
	return a.real() * b.imag() - a.imag() * b.real();
}
double leng(complex<double> a) {
	return sqrt(a.real() * a.real() + a.imag() * a.imag());
}
double angles(complex<double> a, complex<double> b) {
	double cosine = dot(a, b) / (leng(a) * leng(b));
	double sine = gyaku_dot(a, b) / (leng(a) * leng(b));
	double kaku = acos(cosine);
	if (sine <= 0) {
		kaku = 2 * Ma_PI - kaku;
	}
	return kaku;
}
vector<int> convex_hull(vector<complex<double>> a) {
	vector<int> ans;
	double now_minnest = a[0].real();
	int now_itr = 0;
	REP(i, a.size()) {
		if (now_minnest > a[i].real()) {
			now_minnest = a[i].real();
			now_itr = i;
		}
	}
	ans.push_back(now_itr);
	complex<double> ba(0, 1);
	while (true) {
		int now_go = 0;
		double now_min = 0;
		int starter = ans[ans.size() - 1];
		for (int i = 0; i < a.size(); ++i) {
			if (i != starter) {
				double goa = angles(ba, a[i] - a[starter]);
				if (goa > now_min) {
					now_min = goa;
					now_go = i;
				}
			}
		}
		if (now_go == ans[0]) break;
		ans.push_back(now_go);
		ba = complex<double>(a[now_go] - a[starter]);
	}
	return ans;
}
long long gcd(long long a, long long b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}
int main() {
	int n;
	cin >> n;
	int ans = 1000;
	REP(i, n) {
		int a;
		cin >> a;
		int q = 0;
		for (; a % 2 == 0; ++q) {
			a /= 2;
		}
		ans = min(ans, q);
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#pragma warning(disable : 4996)
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<unordered_map>
#include<unordered_set>
#include<time.h>
#include<random>
#include<array>
#include <regex>
using namespace std;
int main(void){   
	string s;
	cin >> s;
	if (s[2] == s[3] && s[4] == s[5]) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void){
	int n,i,p,c=1;
	scanf("%d",&n);
	int a[n];
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
	}
	i=0;
	while(c==1){
		c=0;
		for(i=0;i<n;i++){
			if(c==1){
				a[i]*=3;
			}else{
				if(a[i]%2==0){
					a[i]/=2;
					c=1;
				}else{
					a[i]*=3;
				}
			}
		}
		if(c==1){
			p++;
		}
	}
	printf("%d",p);
	return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) ((int)(x).size())
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, n) for (int i = (int)(n)-1; i >= 0; i--)
#define repf(i, x, n) for (int i = (int)(x); i < (int)(n); i++)
#define repfr(i, x, n) for (int i = (int)(x)-1; i >= (int)(n); i--)
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;
}
#define inf 1e9
using ll = int64_t;
#define waru 1000000007

void Main() {
  ll n;
  std::cin >> n;
  std::vector<pair<ll, ll>> p(n);
  for (auto &x : p) {
    std::cin >> x.first >> x.second;
  }

  ll ans = 0;

  for (auto &x : p) {
    ans += x.second - x.first + 1;
  }

  std::cout << ans << '\n';

  return;
}

int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(15);
  Main();
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(k,i,n) for(ll i=k;i<n;++i)
int main(void){
    ll n,ans=0,c=0;
    cin>>n;
    string s;
    cin>>s;
    rep(0,i,n){
        if(s[i]=='W')++c;
        else{
            ans+=c;
            c=0;
        }
    }
    ll wc=0;
    bool t=false;
    rep(0,i,ans+c){
        ll ni=n-1-i;
        if(s[ni]=='R')t=true;
        if(t&&s[ni]=='W')++wc;
    }
    ans-=wc;
    cout<<ans;
}

Measured memory_bytes: 3756
#include <iostream>
#include <math.h>
#include <unordered_map>
#include <vector>
using namespace std;
using ll = long long;
using ull = unsigned long long;

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

  vector<string> s(n);
  vector<ull> t(n);

  for (int i = 0; i < n; i++) {
    cin >> s[i] >> t[i];
  }

  string x;
  cin >> x;

  ull i;
  for (i = 0; i < n; i++) {
    if (s[i] == x) break;
  }

  i++;
  ull total = 0;
  for (; i < n; i++) {
    total += t[i];
  }

  cout << total << endl;
}


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

typedef long long ll;

priority_queue<ll, vector<ll>, greater<ll> > pq1;
priority_queue<ll> pq2;
ll a[333333], left[333333], right[333333];

int main(void)
{
    ll n, i;

	scanf("%lld" ,&n);
	for (i = 1; i <= 3 * n; i++)
		scanf("%lld" ,&a[i]);

	for (i = 1; i <= 2 * n; i++)
	{
		pq1.push(a[i]);
		left[i] = left[i - 1] + a[i];

		if (i > n)
		{
			left[i] -= pq1.top();
			pq1.pop();
		}
	}

    for (i = n * 3; i >= n + 1; i--)
	{
		pq2.push(a[i]);
		right[i] = right[i + 1] + a[i];

		if (i < 2 * n + 1)
		{
			right[i] -= pq2.top();
			pq2.pop();
		}
	}

	ll ans = -(1LL << 60);
    for (i = n; i <= 2 * n; i++)
        ans = max(ans, left[i] - right[i + 1]);

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

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

int main(void){
   
    int a,b;
    cin >> a >> b;
    if(a > b){
        for(int i=b;i<=a;i++){
            if(abs(a - i) == abs(b - i)){
                cout << i << endl;
                break;
            }
            if(i == a) cout << "IMPOSSIBLE" <<endl;
        }
    }
    else{
         for(int i=a;i<=b;i++){
            if(abs(a - i) == abs(b - i)){
                cout << i << endl;
                break;
            }
             if(i == b) cout << "IMPOSSIBLE" <<endl;
        }
    }
    
}

Measured memory_bytes: 3628
#include<bits/stdc++.h>
#define rep(i,a,...) for(int i = (a)*(strlen(#__VA_ARGS__)!=0);i<(int)(strlen(#__VA_ARGS__)?__VA_ARGS__:(a));++i)
#define per(i,a,...) for(int i = (strlen(#__VA_ARGS__)?__VA_ARGS__:(a))-1;i>=(int)(strlen(#__VA_ARGS__)?(a):0);--i)
#define foreach(i, n) for(auto &i:(n))
#define pii pair<int, int>
#define pll pair<long long, long long>
#define all(x) (x).begin(), (x).end()
#define bit(x) (1ll << (x))
using ll = long long;
//const ll MOD = (ll)1e9+7;
const ll MOD = 998244353;
const int INF = (ll)1e9+7;
const ll INFLL = (ll)1e18;
using namespace std;
template<class t>
using vvector = vector<vector<t>>;
template<class t>
using vvvector = vector<vector<vector<t>>>;
template<class t>
using priority_queuer = priority_queue<t, vector<t>, greater<t>>;
template<class t, class u> bool chmax(t &a, u b){if(a<b){a=b;return true;}return false;}
template<class t, class u> bool chmin(t &a, u b){if(a>b){a=b;return true;}return false;}
#ifdef DEBUG
#define debug(x) cout<<"LINE "<<__LINE__<<": "<<#x<<" = "<<x<<endl;
#else
#define debug(x) (void)0
#endif

namespace templates{
  ll modpow(ll x, ll b){
    ll res = 1;
    while(b){
      if(b&1)res = res * x % MOD;
      x = x * x % MOD;
      b>>=1;
    }
    return res;
  }

  ll modinv(ll x){
    return modpow(x, MOD-2);
  }

  bool was_output = false;
  template<class t>
  void output(t a){
    if(was_output)cout << " ";
    cout << a;
    was_output = true;
  }
  void outendl(){
    was_output = false;
    cout << endl;
  }
  ll in(){
    ll res;
    scanf("%lld", &res);
    return res;
  }

  template<class t>
  istream& operator>>(istream&is, vector<t>&x){
    for(auto &i:x)is >> i;
    return is;
  }

  template<class t, class u>
  istream& operator>>(istream&is, pair<t, u>&x){
    is >> x.first >> x.second;
    return is;
  }

  template<class t>
  void in(t&x){
    cin >> x;
  }

  template<class t>
  t in(){
    t res; cin >> res; return res;
  }

  template<class t>
  void out(t x){
    cout << x;
  }

  template<class t>
  vector<t> sorted(vector<t> line,function<bool(t,t)> comp=[](t a,t b){return a<b;}){
    sort(line.begin(),line.end(),comp);
    return line;
  }

  template<class t>
  vector<t> reversed(vector<t> line){
    reverse(line.begin(),line.end());
    return line;
  }
}

using namespace templates;

int main(){
  cout << in() * in() << endl;

  return 0;
}


Measured memory_bytes: 3808