akhauriyash/Code-Regression huggingface dataset:
N = int(input())
S1 = input()
S2 = input()
data = []
i = 0
while i < N:
    try:
        if S1[i] == S1[i + 1]:
            data.append(2)
            i += 2
        else:
            data.append(1)
            i += 1
    except IndexError:
        data.append(1)
        break
ans = 6 if data[0] == 2 else 3
for j in range(len(data[1:])):
    if data[j] == 1:
        ans *= 2
    elif data[j + 1] == 2:
        ans *= 3
    ans %= 1000000007
print(ans)


Measured memory_bytes: 3064
#include <iostream>
#include <string>
#include <vector>
#include <numeric>
#include <queue>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <sstream>
#include <stack>
#include <map>
#include <set>
#include <ios>
#include <cctype>
#include <cstdio>
#include <functional>
#include <cassert>

#define REP(i,a) for(int i = 0;i < (a);++i)
#define FOR(i,a,b) for(int i = (a);i < (b); ++i)
#define FORR(i,a,b) for(int i = (a) - 1;i >=(b);--i)
#define ALL(obj) (obj).begin(),(obj).end()
#define SIZE(obj) (int)(obj).sizeT()
#define YESNO(cond,yes,no){cout <<((cond)?(yes):(no))<<endl; }
#define SORT(list) sort(ALL((list)));
#define RSORT(list) sort((list).rbegin(),(list).rend())
#define ASSERT(cond,mes) assert(cond && mes)

using namespace std;
using ll = long long;

constexpr int MOD = 1'000'000'007;
constexpr int INF = 1'050'000'000;

template<typename T>
T round_up(const T& a, const T& b) {
    return (a + (b - 1)) / b;
}

template <typename T1, typename T2>
istream& operator>>(istream& is, pair<T1, T2>& p) {
    is >> p.first >> p.second;
    return is;
}

template <typename T1, typename T2>
ostream& operator<<(ostream& os, pair<T1, T2>& p) {
    os << p.first << p.second;
    return os;
}

template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
    REP(i, (int)v.size())is >> v[i];
    return is;
}

template <typename T>
ostream& operator<<(ostream& os, vector<T>& v) {
    REP(i, (int)v.size())os << v[i] << endl;
    return os;
}

template <typename T>
T clamp(T& n, T a, T b) {
    if (n < a)n = a;
    if (n > b)n = b;
    return n;
}

template <typename T>
static T GCD(T u, T v) {
    T r;
    while (v != 0) {
        r = u % v;
        u = v;
        v = r;
    }
    return u;
}

template <typename T>
static T LCM(T u, T v) {
    return u / GCD(u, v) * v;
}

std::vector<int> enum_div(int n) {
    std::vector<int> ret;
    for (int i = 1; i*i <= n; ++i) {
        if (n%i == 0) {
            ret.push_back(i);
            if (i != 1 && i*i != n) {
                ret.push_back(n / i);
            }
        }
    }
    return ret;
}

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

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



int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    std::cout << fixed << setprecision(20);

    int N, K;
    cin >> N >> K;
    vector<int> H(N);
    cin >> H;

    vector<int> dp(N, INF);
    dp[0] = 0;
    FOR(i, 1, N) {
        REP(j, K + 1) {
            if (i - j < 0 || i - j >= N)continue;
            chmin(dp[i], dp[i - j] + abs(H[i] - H[i - j]));
        }
    }

    cout << dp[N - 1] << endl;
    return 0;
}

Measured memory_bytes: 1152
from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson, minimum_spanning_tree
from scipy.sparse import csr_matrix, coo_matrix, lil_matrix
import numpy as np
from collections import deque, Counter, defaultdict
from itertools import product, permutations,combinations
from operator import itemgetter
from heapq import heappop, heappush, heapify
from bisect import bisect_left, bisect_right, bisect
from fractions import gcd
from math import ceil,floor, sqrt, cos, sin, pi, factorial
from functools import reduce
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7
def lcm_base(a, b):
    return (a * b) // gcd(a, b)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


def main():
  n = input()
  if '7' in n:
    print('Yes')
  else:
    print('No')
  
  
if __name__ == '__main__':
  main()

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

typedef long long int lli;

int pos(vector<lli>& v, lli n) {
    int l = 0, r = v.size();
    while (l + 1 < r) {
	int m = (l + r) / 2;
	if (v[m] <= n) l = m;
	else r = m;
    }

    return l;
}

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

    vector<lli> s(A + 1);
    vector<lli> t(B + 1);
    for (int i = 1; i <= A; i++) cin >> s[i];
    for (int i = 1; i <= B; i++) cin >> t[i];

    while (Q--) {
	lli x;
    	cin >> x;
    	lli ans = 1LL << 40;

	int ps = pos(s, x);
	if (ps > 0) {
	    int pt = pos(t, s[ps]);
	    if (pt > 0) ans = min(ans, abs(x - s[ps]) + abs(t[pt] - s[ps]));
	    if (pt + 1 < t.size()) ans = min(ans, abs(x - s[ps]) + abs(t[pt + 1] - s[ps]));
	}

	if (ps + 1 < s.size()) {
	    int pt = pos(t, s[ps + 1]);
	    if (pt > 0) ans = min(ans, abs(x - s[ps + 1]) + abs(t[pt] - s[ps + 1]));
	    if (pt + 1 < t.size()) ans = min(ans, abs(x - s[ps + 1]) + abs(t[pt + 1] - s[ps + 1]));
	}

	int pt = pos(t, x);
	if (pt > 0) {
	    int ps = pos(s, t[pt]);
	    if (ps > 0) ans = min(ans, abs(x - t[pt]) + abs(t[pt] - s[ps]));
	    if (ps + 1 < s.size()) ans = min(ans, abs(x - t[pt]) + abs(t[pt] - s[ps + 1]));
	}

	if (pt + 1 < t.size()) {
	    int ps = pos(s, t[pt + 1]);
	    if (ps > 0) ans = min(ans, abs(x - t[pt + 1]) + abs(t[pt + 1] - s[ps]));
	    if (ps + 1 < s.size()) ans = min(ans, abs(x - t[pt + 1]) + abs(t[pt + 1] - s[ps + 1]));
	}

	cout << ans << endl;
    }

    return 0;
}

Measured memory_bytes: 2944
import java.io.File;
import java.io.FileInputStream;
import java.util.Scanner;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.NoSuchElementException;

public class Main {
	
	public static void main(String[] args) throws IOException {
		FastScanner sc = new FastScanner(System.in);
		
		int N = sc.nextInt();
		int K = sc.nextInt();
		long ans1 = 0;
		long ans2 = 0;
		
		for(int i = 1; i <= N; i++){
			if(i % K == 0) ans1++;
			else if(K % 2 == 0 && i % K == (K / 2)) ans2++;
		}
		System.out.println(ans1 * ans1 * ans1 + ans2 * ans2 * ans2);
	}
}

class FastScanner {
    private InputStream in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    public FastScanner(InputStream in) {
		this.in = in;
	}
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() {
    	if (hasNextByte()) return buffer[ptr++];
    	else return -1;
    }
    private static boolean isPrintableChar(int c){
    	return 33 <= c && c <= 126;
    }
    public boolean hasNext() {
    	while(hasNextByte() && !isPrintableChar(buffer[ptr]))
    		ptr++; return hasNextByte();
    }
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() {
    	return Double.parseDouble(next());
    }
}

Measured memory_bytes: 22612
#include<iostream>
using namespace std;
int main()
{
	int a,b;
    cin>>a>>b;
    if(a==1 || a==3 || a==5 || a==7 || a==8 || a==10 || a==12)
    {
    	if(b==1 || b==3 || b==5 || b==7 || b==8 || b==10 || b==12)
    	{
    		cout<<"Yes";
		}
		else
		{
			cout<<"No";
		}
	}
	if(a==2)
	{
		if(b==2)
		{
			cout<<"Yes";
		}
		else
		{
			cout<<"No";
		}
	}
	if(a==4 || a==6 || a==9 || a==11)
	{
		if(b==4 || b==6 || b==9 || b==11)
		{
			cout<<"Yes";
		}
		else
		{
			cout<<"No";
		}
	}
	cout<<endl;
	return 0;
 }

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(long long int i = 0; i < n; i++)
#define print(n) std::cout << n << std::endl
#define _print(n) std::cout << n
using namespace std;
typedef long long ll;
const int N = 1000000;

int main() {
    int k; cin >> k;
    if(k == 1 || k == 2 || k == 3 || k == 5 || k == 7 || k == 11 || k == 13 || k == 15 || k == 17 ||k == 19 ||k == 23 ||k == 29 ||k == 31)print(1);
    if(k == 4 ||k == 6 ||k == 9 ||k == 10 ||k == 14 ||k == 21 ||k == 22 ||k == 25 ||k == 26)print(2);
    if(k == 28 ||k == 30)print(4);
    if(k == 8 ||k == 12 ||k == 18 ||k == 20 ||k == 27)print(5);
    if(k == 16)print(14);
    if(k == 24)print(15);
    if(k == 32)print(51);
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <cctype>
#include <algorithm>
#include <set>
#include <cmath>
#include <cassert>

using namespace std;
string Kanglish[38];
string get_string(int &cur,string line){
  while(line[cur] == ' ') ++cur;

  string str;
  for(int j = 26;j < 38;j++){
	if(line[cur] == Kanglish[j][0] && line[cur+1] == Kanglish[j][1]){
	  cur+=2;
	  return Kanglish[j];
	}
  }
  for(int i = 0;i < 26;i++){
	if(line[cur] == Kanglish[i][0]){
	  cur++;
	  return Kanglish[i];
	}
  }	
  return " " ;
}


int main(){
  char tmp = 'a';
  for(int i = 0;i < 26;i++){
	Kanglish[i] = tmp++;
  }
  Kanglish[26]="ld";
  Kanglish[27]="mb";
  Kanglish[28]="mp";
  Kanglish[29]="nc";
  Kanglish[30]="nd";
  Kanglish[31]="ng";
  Kanglish[32]="nt";
  Kanglish[33]="nw";
  Kanglish[34]="ps";
  Kanglish[35]="qu";
  Kanglish[36]="cw";
  Kanglish[37]="ts";
  int n;
  cin >>n;
  cin.ignore();
  vector<map<string,int> > vec(38);
  for(int i =0;i < n;i++){
	string line;
	getline(cin,line);
	int cur = 0;
	string current = get_string(cur,line);
	const int len = line.size();
	line += "#";

	while(cur < len){
	  if(line[cur] == ' ') {
		current = get_string(cur, line);
		continue;
	  }
	  
	  string next = get_string(cur, line);
	  
	  for(int i =0 ;i < 38;i++){
		if(Kanglish[i] == current){
		  vec[i][next]++;
		  break;
		}
	  }
	
	  current = move(next);
	}
  }

  for(int i = 0;i < 38;i++){
	int max_number = 0;
	string max_str = "a";
	for(const auto &e:vec[i]){
	  if(e.second > max_number && e.first != " "){
		max_number = e.second;
		max_str = e.first;
	  }
	}
	cout << Kanglish[i] << " " << max_str << " " << max_number << endl;
  }
  
  
  return 0;
}

Measured memory_bytes: 1284
package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	sc.Split(bufio.ScanWords)
	n := nextInt()
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = nextInt()
	}

	// sum := make([]uint64, n-1)
	ans := a[0]
	for i := 1; i < n; i++ {
		ans = ans ^ a[i]
	}

	if ans == 0 {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


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

#define loop(i,a,b) for(int i=a ;i < b ; i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int main(void){
	int a[5];
	
	rep(i,5)cin>>a[i];
	
	sort(a,a+5,greater<int>());
	
	cout<<a[0];
	
	loop(i,1,5)cout<<" "<<a[i];
	
	cout<<endl;
	
	return 0;
}

Measured memory_bytes: 1176
def gen(l):
    _runs = []
    for r in l:
        r = str(r)
        if r[-1] == '0':
            _runs.append(r+'1')
            _runs.append(r+'0')
        elif r[-1] == '9':
            _runs.append(r+'9')
            _runs.append(r+'8')
        else:
            _runs.append(r+str(int(r[-1])+1))
            _runs.append(r+str(int(r[-1])-1))
            _runs.append(r+r[-1])
    return _runs

def runrun(n):
    runs = [1, 2, 3, 4, 5, 6, 7, 8, 9]
    _runs = gen(runs)
    while len(runs) < n:
        runs.extend(_runs)
        _runs = gen(_runs)
    return sorted(map(lambda i: int(i),runs))

k = int(input())

print(runrun(k)[k-1])

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

string solve(string s) {
	map <string, vector<int>> m;
	m["hon"] = {2, 4, 5, 7, 9};
	m["pon"] = {0, 1, 6, 8};

	int oneplace = s[s.size()-1] - '0';
	if (oneplace == 3) return "bon";
	for (auto i : m) {
		for (auto w : i.second) {
			if (w == oneplace)
				return i.first;
		}
	}
	return "";
}

int main() {
	int n;
	cin >> n;
	string s = to_string(n);
	cout << solve(s);
	return 0;
}

Measured memory_bytes: 3700
from itertools import permutations

h,w = map(int,input().split())
nec = []
for i in range(h):
    s = input()
    for j in range(w):
        if s[j] == "#":
            nec.append([i,j])

if len(nec) == h+w-1:
    print("Possible")
else:
    print("Impossible")





Measured memory_bytes: 9060
#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"
#include "ext/rope"

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

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, a) for(int i = 0; i < (a); ++i)
#define pb push_back
#define mp make_pair
#define sz(x) (int)x.size()
#define f first
#define s second

template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

struct custom_hash 
{
    static uint64_t splitmix64(uint64_t x) 
    {
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const 
    {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
string s, t;
int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> s >> t;
    int res = 0;
    F0R(i, sz(s)) if(s[i] == t[i]) res++;
    cout << res;
    return 0;
}

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

using namespace std;
typedef unsigned int uint;
typedef long long int ll;
typedef unsigned long long int ull;

#define debugv(v) printf("L%d %s => ",__LINE__,#v);for(auto e:v){cout<<e<<" ";}cout<<endl;
#define debugm(m) printf("L%d %s is..\n",__LINE__,#m);for(auto v:m){for(auto e:v){cout<<e<<" ";}cout<<endl;}
#define debuga(m,w) printf("L%d %s is => ",__LINE__,#m);for(int x=0;x<(w);x++){cout<<(m)[x]<<" ";}cout<<endl;
#define debugaa(m,w,h) printf("L%d %s is..\n",__LINE__,#m);for(int y=0;y<(h);y++){for(int x=0;x<(w);x++){cout<<(m)[x][y]<<" ";}cout<<endl;}
#define ALL(v) (v).begin(),(v).end()
#define BIGINT 0x7FFFFFFF
#define E107 1000000007
void printbit(int u){if(u==0)cout<<0;else{int s=0,k=0;for(;0<u;u>>=1,k++)s=(s<<1)|(u&1);for(;0<k--;s>>=1)cout<<(s&1);}}

#define TIME chrono::system_clock::now()
#define MILLISEC(t) (chrono::duration_cast<chrono::milliseconds>(t).count())

template<typename T1,typename T2>
ostream& operator <<(ostream &o,const pair<T1,T2> p){o<<"("<<p.first<<":"<<p.second<<")";return o;}

int m,n;

int p[20010];

int a[20010];
int b[20010];

int main(){
    int i,j,k,l;
    
    cin >> n;
    
    for (i=1;i<=n;i++){
        scanf("%d",&k);
        p[k-1] = i;
    }
    
    a[0] = 1;
    b[0] = 0;
    
    for (i=1;i<n;i++){
        k = p[i]-p[i-1];
        if (0<k){ // 増える
            a[i] = a[i-1] + 1 + k;
            b[i] = b[i-1] - 1;
        }else{ // 減る
            a[i] = a[i-1] + 1;
            b[i] = b[i-1] - 1 + k;
        }
    }
    
    for (i=0;i<n-1;i++){
        printf("%d ",a[i]);
    }
    printf("%d\n",a[n-1]);
    
    k = 1 - b[n-1];
    for (i=0;i<n-1;i++){
        printf("%d ",b[i]+k);
    }
    printf("%d\n",b[n-1]+k);
    
    
    
    

    return 0;
}

Measured memory_bytes: 768
#include<bits/stdc++.h>
using namespace std;
using ull=unsigned long long;
#define mod 1000000007
#define mod2 998244353 
#define PI 3.14159265
#define ll long long
#define ld long double
#define pi pair<ll,ll>
#define pb push_back
#define vi vector<ll>
#define sz size()
#define setbits(x)  __builtin_popcount(x)
#define fi first
#define se second
#define lz length()
#define all(x) (x).begin(),(x).end()
#define scf(x) scanf("%lld",&x)
#define rep(i,n) for(ll i=0;i<n;i++)
const int INF = (int)1e9;
const ll IINF=1LL<<62;
const int maxn=10000005;

//int divr[maxn];
/**/
/*void divisor()
{for(int i=2;i<sqrt(maxn);i++)
     {
          if(!divr[i])
          {
               for(int j=i*i;j<maxn;j+=i)if(!divr[j])divr[j]=i;     
          }
     }
     for(int i=1;i<maxn;i++)if(!divr[i])divr[i]=i;
}*/
 
/*const int N=1000005;
ll n;
struct line {
    long long m, c;
    long long eval(long long x) { return m * x + c; }
    long double intersectX(line l) { return (long double) (c - l.c) / (l.m - m); }
};
vector<pair<pi,ll>> rect;
deque<line> dq;
*/
/*ll modexpo(ll a,ll b)
{
     ll ans=1LL;
     while(b>0)
     {
          if(b&1)ans=(ans*a)%mod;
          a=(a*a)%mod;
          b>>=1;
     }
     return ans;
}
*/
int main(){
     int n,t;
     cin>>n>>t;
     vector<pair<int,int>> vec(n);
     for(int i=0;i<n;i++){
          cin>>vec[i].fi>>vec[i].se;
     }
     sort(vec.begin(),vec.end());
     ;ll dp[t];
     ll ans=0;
     memset(dp,0,sizeof(dp));
     for(int i=0;i<n;i++){
          ans=max(ans,dp[t-1]+vec[i].se);
          for(int j=t-1;j>=vec[i].fi;j--){
               dp[j]=max(dp[j],dp[j-vec[i].fi]+vec[i].se);
          }
     }
     cout<<ans;

}
 
 
 
 
 

























Measured memory_bytes: 3680
x, k, d = gets.split(" ").map(&:to_i)
if x.abs >= k * d
  puts x.abs - (k * d)
  exit
end
before_0 = x / d 
if (k - before_0) % 2 == 0
  puts (x - (before_0 * d)).abs
else (k - before_0) % 2 != 0
  puts  (x - (before_0 * d) - d).abs
end

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

int main(void){
	
	int n;
	int num;
	
	cin >> n;
	long long ary[n];
	
	for(int i = 0; i<n; i++){
		cin >> ary[i];
	}
	num = ary[0]-1;
	for(int i = 1; i<n; i++){
		if(num <= ary[i]-1)num=ary[i]-1;
		else if(num <= ary[i])num = ary[i];
		else{
			cout << "No";
			return 0;
		}
	}
	
	cout << "Yes";
	
	return 0;
}

Measured memory_bytes: 1024
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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

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

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

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

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

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

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

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

#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{BinaryHeap, HashMap};

#[allow(dead_code)]
type Graph = Vec<Vec<usize>>;

fn main() {
    input! {
        n: usize, k: usize, q: usize,
        a: [usize1; q],
    }
    let mut score = vec![k as i64 - q as i64; n];
    for i in 0..q {
        score[a[i]] += 1;
    }
    for i in 0..n {
        if score[i] > 0 {
            println!("Yes");
        } else {
            println!("No");
        }
    }
}


Measured memory_bytes: 6780
<?php

fscanf(STDIN, "%d %d", $in_a, $in_b);

$coin = 0;

for($i = 0; $i < 2; $i++){
    if($in_a > $in_b) {
        $coin += $in_a;
        $in_a--;
    }else{
        $coin += $in_b;
        $in_b--;
    }
}

echo "$coin\n";

?>

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

const int MAX = 100100;
vector<int> G[MAX];
int id[MAX],pa[MAX],dp[MAX],used[MAX];

void dfs(int v,int d){
    dp[v] = d;                       //深さを更新
    for(int i=0;i<(int)G[v].size();i++){
        dfs(G[v][i],d+1);
        pa[G[v][i]] = v;
    }
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int n;                           //n : the number of node
    cin >> n;

    rep(i,n){
        int k;                       //k : the number of child which the node has  
        cin >> id[i] >> k;
        G[id[i]].resize(k);          //G : graph
        rep(j,k){
            cin >> G[ id[i] ][j];    //G[from][number] = to  G[親][番号] = 子
            used[ G[id[i]][j] ] = 1; //used[parent] 子がリストアップされていく
        }
    }
    memset(pa,-1,sizeof(pa));        //すべてのnodeを根にする
    rep(i,n){
        if(!used[i]) dfs(i,0);       //根なら（子じゃなかったら）dfs
    }

//---出力---//
    rep(i,n){
        cout << "node "       << i;
        cout << ": parent = " << pa[i];
        cout << ", depth = "  << dp[i];
        cout << ", ";
        if(pa[i]<0) cout << "root";
        else if(!G[i].size()) cout << "leaf";  //子を持ってなかったら葉
        else cout << "internal node";
        cout << ", [";
        rep(j,G[i].size()){
            if(j) cout << ", ";
            cout << G[i][j];
        }
        cout << "]" << endl;
    }

    return 0;
}



Measured memory_bytes: 7492
#include <bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
using namespace std;
using Graph = vector<vector<int>>;
typedef pair<int,int> P;
typedef long long ll;

int main(){
    ll a; long double b; cin >> a >> b;
    long double c = b/1;
    b = b-c;

    long double ans = a * b;
    ans = ans + a*c;
    
    ll res = ans/1;

    cout << res << endl;

}

Measured memory_bytes: 3736
#include <bits/stdc++.h>
using f32 = float;
using f64 = double;
using f80 = __float80;
using namespace std;
using LL = long long;
using ULL = unsigned long long;
using vi = vector<int>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvi = vector<vi>;
using vs = vector<string>;
using vl = vector<LL>;
using vvl = vector<vl>;
using P = pair<int, int>;
using T = tuple<int, int, int>;
using vp = vector<P>;
#define REP(i, n) for (LL i = 0; i < (int)(n); i++)
#define FOR(i, m, n) for (LL i = m; i < n; i++)
#define SORT(x) sort(x.begin(), x.end())
#define REVE(x) reverse(x.begin(), x.end())
#define all(x) (x).begin(), (x).end()
#define fst first
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define pob pop_back
#define sw swap
#define UP(x) transform(x.begin(), x.end(), x.begin(), ::toupper);
#define LOW(x) transform(x.begin(), x.end(), x.begin(), ::tolower);
#define int long long
struct initon
{
    initon()
    {
        cin.tie(0);
        ios::sync_with_stdio(false);
    };
};
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 (a > b)
    {
        a = b;
        return 1;
    }
    return 0;
}
signed main() {
int a,b,c,n;
string s;
cin >> a;
cout << a +pow(a,2)+pow(a,3);
}


Measured memory_bytes: 4176
//#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"

#define rep(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007
#define INF (1LL<<60LL)
typedef long long ll;

using namespace std;

int main() {
	string s; cin >> s;
	ll ans = 0;
	rep(i, s.size() - 1) {
		if (s[i] != s[i + 1]) ans += 1;
	}
	cout << ans << endl;
}

Measured memory_bytes: 512
S=input()

left=int(S[:2])
right=int(S[2:])

YYMM=True
MMYY=True
AMBIGUOUS=True
NA=True


if left<=0 or left>12:
  MMYY=False
  AMBIGUOUS=False
else:
  NA=False
  
if right<=0 or right>12:
  YYMM=False
  AMBIGUOUS=False
else:
  NA=False


if YYMM==True:
  if MMYY==True:
    print("AMBIGUOUS")
  else:
    print("YYMM")
else:
  if MMYY==True:
    print("MMYY")
  else:
    print("NA")

Measured memory_bytes: 3064
#include <bits/stdc++.h>  // clang-format off
using Int = long long;
#define REP_(i, a_, b_, a, b, ...) for (Int i = (a), lim##i = (b); i < lim##i; i++)
#define REP(i, ...) REP_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
struct SetupIO { SetupIO() { std::cin.tie(nullptr), std::ios::sync_with_stdio(false), std::cout << std::fixed << std::setprecision(13); } } setup_io;
#ifndef dump
#define dump(...)
#endif  // clang-format on

/**
 *    author:  knshnb
 *    created: Tue Apr 28 20:35:37 JST 2020
 **/

const Int K = 2019;
signed main() {
    std::string s;
    std::cin >> s;
    Int n = s.size();
    std::vector<Int> cnt(K);
    cnt[0] = 1;
    Int pow = 1, cur = 0, ans = 0;
    for (Int i = n - 1; i >= 0; i--) {
        (cur += (s[i] - '0') * pow) %= K;
        (pow *= 10) %= K;
        ans += cnt[cur];
        cnt[cur]++;
    }
    std::cout << ans << std::endl;
}


Measured memory_bytes: 3788
#include <bits/stdc++.h>
using namespace std;
#define rep0(i,n) for(ll (i) = 0; (i) < (n); ++(i))
#define rrep0(i,n) for(ll (i) = (n) - 1; (i) >= 0; --(i))
#define rep1(i,n) for(ll (i) = 1; (i) < (n); ++(i))
#define rrep1(i,n) for(ll (i) = (n) - 1; (i) >= 1; --(i))
#define nfor(i,a,b) for(ll (i) = (a); (i) < (b); ++(i))
#define ll long long
#define mod (1000000007)
#define YES cout << "YES" << endl;
#define Yes cout << "Yes" << endl;
#define yes cout << "yes" << endl;
#define NO cout << "NO" << endl;
#define No cout << "No" << endl;
#define no cout << "no" << endl;
#define all(x) (x).begin(),(x).end()

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

ll lcm(ll a,ll b){
    ll g = gcd(a,b);
    return a / g * b;
}

ll fac(ll n){
    ll t = 1;
    rep1(i, n + 1)t *= i;
    return t;
}

int main()
{
    ll n,l,r;
    cin >> n;
    vector<ll> a(n),b(n);
    rep0(i, n){
        cin >> a[i];
        b[i] = a[i];
    }
    sort(all(b));
    l = b[n/2 - 1];
    r = b[n/2];
    rep0(i, n){
        if (a[i] <= l) {
            cout << r << endl;
        }else{
            cout << l << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 5376
from collections import deque
import copy

h,w = map(int, input().split())
s = [["#"]*(w+2)]+[["#"]+list(input())+["#"] for i in range(h)]+[["#"]*(w+2)]
black = -(h+w) * 2 - 4
for i in s:
  black += i.count("#")
s[1][1] = 1
q = deque([(1,1)])
white = 1
while True:
  q2 = deque([])
  white += 1
  while len(q):
    a,b = q.popleft()
    if s[a-1][b] == ".":
      s[a-1][b] = white
      q2.append((a-1,b))
    if s[a+1][b] == ".":
      s[a+1][b] = white
      q2.append((a+1,b))
    if s[a][b-1] == ".":
      s[a][b-1] = white
      q2.append((a,b-1))
    if s[a][b+1] == ".":
      s[a][b+1] = white
      q2.append((a,b+1))   
  if s[h][w] != ".":
    print(h*w - white - black)
    break
  if len(q2):
    q = copy.copy(q2)
  else:
    print(-1)
    break
  

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

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

    for (int i = a; i <= b; i++) {
        if (i % k == 0) {
            cout << "OK" << endl;
            return 0;
        }
    }

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


Measured memory_bytes: 3640
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;
const int N=200005;
int n,l,p,v,a[N];
ll ans;
vector<pair<int,int> > b,t1,t2,t3;
vector<pair<pair<int,int>,pair<int,int> > > x,y;
ll calc(vector<pair<int,int> > &x){
	ll sum=0,res=0;
	for(unsigned i=l-1,j=0;i<x.size();i++,j++){
		sum+=x[j].first;
		res+=x[i].second*sum;
	}
	return res;
}
int main(){
	scanf("%d%d",&n,&l);
	for(int i=1;i<=n;i++){
		scanf("%d",&a[i]);
		b.push_back(make_pair(a[i],i));
	}
	sort(b.begin(),b.end());
	while(1){
		if(x.empty()){
			if(p==n){
				break;
			}else{
				v=b[p].first;
			}
		}else{
			v++;
		}
		while(p<n&&b[p].first==v){
			x.push_back(make_pair(make_pair(b[p].second,b[p].second),make_pair(1,1)));
			p++;
		}
		y.clear();
		sort(x.begin(),x.end());
		for(unsigned i=0,j;i<x.size();i=j+1){
			j=i;
			while(j+1<x.size()&&x[j+1].first.first==x[j].first.second+1){
				j++;
			}
			int len=j-i+1,tot=len/l;
			if(tot){
				t1.clear();
				for(unsigned k=i;k<=j;k++){
					t1.push_back(x[k].second);
				}
				ans+=calc(t1);
				t2.clear();
				t3.clear();
				for(int k=1;k<=tot;k++){
					t2.push_back(make_pair(x[i].first.first+k-1,k==tot?x[j].first.second:x[i].first.first+k-1));
					t3.push_back(make_pair(0,0));
				}
				for(unsigned k=i;k<=j;k++){
					int l1=k-i+1,l2=j-k+1;
					if(l1>=l){
						t3[l1/l-1].second+=x[k].second.second;
					}
					if(l2>=l){
						t3[tot-l2/l].first+=x[k].second.first;
					}
				}
				ans-=calc(t3);
				for(int k=0;k<tot;k++){
					y.push_back(make_pair(t2[k],t3[k]));
				}
			}
		}
		x=y;
	}
	printf("%lld\n",ans+n);
	return 0;
}

Measured memory_bytes: 10476
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int a = stdIn.nextInt();
		int b = stdIn.nextInt();
		
		if(a*b%2==0) {
			System.out.println("Even");
		}else {
			System.out.println("Odd");
		}
		
		
	}

}


Measured memory_bytes: 22996
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    n,d,a = map(int, input().split())
    xh = [list(map(int, input().split())) for _ in range(n)]
    xh.sort(key=lambda a: a[0])
    x = []
    for i in range(n):
        x.append(xh[i][0])
    res = 0
    hp = [0]*n
    for i in range(n):
        if i != 0:
            hp[i] += hp[i-1]
        if hp[i]>=xh[i][1]:
            continue
        res += (xh[i][1]-hp[i]-1) // a + 1
        attack = ((xh[i][1]-hp[i]-1) // a + 1) * a
        hp[i] += attack
        genkai = x[i] + 2 * d
        migi = bisect_right(x, genkai)
        if migi <= n - 1:
            hp[migi] -= attack

    print(res)

if __name__ == '__main__':
    main()

Measured memory_bytes: 96604
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
#define VL vector<ll>
//cout << std::fixed << std::setprecision(15) << y << endl;

int main(){
    ll N;
    cin >> N;
    VL L(N);
    rep(i,0,N) cin >> L[i];
    sort(L.begin(), L.end());

    ll ans = 0;
    rep(i,0,N){
        if(i == N-2) break;
        rep(j,i+1,N){
            rep(k,j+1,N){
                if(L[i] + L[j] <= L[k]) break;
                if(L[i] == L[j] || L[i] == L[k] || L[j] == L[k]) continue;
                ans++;
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3624
#include<iostream>
#include<algorithm>
#include<cstring>
#include<set>
#include<vector>
#include<queue>
#include<cmath>
#include<memory.h>
#include<ctime>
#include<cstdio>
#include<map>
#include<stack>

using namespace std;

int main()
{
	int n,a,b;
	cin>>n>>a>>b;
	if((b-a)%2==0)
	{
		cout<<"Alice"<<endl;
	}
	else
	{
		cout<<"Borys"<<endl;
	}
	return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int count = 0;
		if(a == b){
			count++;
		}
		if(b == c){
			count++;
		}
		if(c == a){
			count++;
		}
		System.out.println(count == 1 ? "Yes" : "No");
	}
}


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

using namespace std;


class UF{
  private:
    int n;
    vector<int> r, p;
  public:
    UF(int num){
      n = num;
      for(int i=0;i<n;i++){
        r.push_back(1);
        p.push_back(i);
      }
    }
    int find(int x){
      if(x == p[x])return x;
      return p[x] = find(p[x]);
    }
    bool same(int x, int y){
      return find(x) == find(y);
    }
    void unite(int x, int y){
      x = find(x), y = find(y);
      if(x==y)return;
      if(r[x]<r[y])swap(x, y);
      r[x] += r[y];
      p[y] = x;
      n--;
    }
    int size(int x){
      return r[find(x)];
    }
    int cnt(){
      return n;
    }
};

int main(){
  int n, m;
  cin >> n >> m;
  UF uf=UF(n);
  for(int i=0;i<m;i++){
    int x, y, z;
    cin >> x >> y >> z;
    x--;y--;
    uf.unite(x, y);
  }
  cout << uf.cnt() << endl;
}



Measured memory_bytes: 1276
// Template from https://techracho.bpsinc.jp/jhonda/2019_08_05/78537

// input macro for competive-programming from https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

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

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

#[allow(unused_macros)]
macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

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

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

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

    ($iter:expr, bytes) => {
        read_value!($iter, String).into_bytes()
    };

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

fn main() {
    use std::io::Read;
    let mut s = String::new();
    std::io::stdin().read_to_string(&mut s).unwrap();

    println!("{}", solve(&s));
}

macro_rules! test {
    ($($input:expr => $output:expr),* $(,)*) => {
        #[test]
        fn solve_test() {
            $(
                assert_eq!(solve($input), $output);
            )*
        }
    };
}

test! {
r#"22"# => r#"Christmas Eve Eve Eve"#,
r#"23"# => r#"Christmas Eve Eve"#,
r#"24"# => r#"Christmas Eve"#,
r#"25"# => r#"Christmas"#,
}

fn solve(src: &str) -> String {
    input! {
        source = src,
        d: isize,
    }

    let mut ans = "Christmas".to_string();
    for _ in 0..25 - d {
        ans.push_str(" Eve");
    }

    ans
}

Measured memory_bytes: 4352
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <iostream>
#include <set>
#include <map>
#include <queue>

using namespace std;

typedef long long ll;

const int INF = 2139062143;

#define DEBUG(x) std::cerr << #x << " = " << x << std::endl

inline ll read() {
    ll f = 1, x = 0;char ch;
    do {ch = getchar();if (ch == '-')f = -1;} while (ch > '9' || ch < '0');
    do {x = x * 10 + ch - '0';ch = getchar();} while (ch >= '0' && ch <= '9');
    return f * x;
}

#define int ll

const int MAX_N = 2 * 1e5 + 7;

ll n, ans, a[MAX_N], s1[MAX_N], s2[MAX_N];

signed main() {
	n = read ();
	for (int i = 1; i <= n; i ++ ) a[i] = read (), s1[i] = s1[i - 1] + a[i], s2[i] = s2[i - 1] ^ a[i];
	int l = 1;
	for (int r = 1; r <= n; r ++ ) {
		while ((s1[r] - s1[l - 1]) != (s2[r] ^ s2[l - 1])) l ++ ;
		ans += r - l + 1;
	}
	cout << ans << endl;
	return 0;
}



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

using namespace std;
using LL = long long;
using P = pair<int, int>;

#define FOR(i, a, n) for(int i = (int)(a); i < (int)(n); ++i)
#define REP(i, n) FOR(i, 0, n)

#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()

const int INF = (int)1e9;
const LL INFL = (LL)1e19;
const int MOD = 1e9 + 7;

signed main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int m, k;
    cin >> m >> k;
    if(k == 0)
    {
        REP(i, 1 << m) cout << i << " " << i << " \n"[i == ((1 << m) - 1)];
        return 0;
    }

    int sum = 0;
    REP(i, 1 << m)
    {
        if(i != k) sum = sum ^ i;
    }
    if(sum == k)
    {
        cout << k << " ";
        REP(i, 1 << m) if(i != k) cout << i << "  "[i == ((1 << m) - 1)];
        cout << k << " ";
        REP(i, 1 << m) if((1 << m) - i - 1 != k) cout << (1 << m) - i - 1 << "  "[i == ((1 << m) - 1)];
        cout << endl;
    }
    else cout << -1 << endl;
}

Measured memory_bytes: 1792
#include <stdio.h>
#include <string.h>

char j[102][102];

int search(int c,int d,int e);

int main(void){
    while(1){
    int H,W,i,t,a,b=0;
    memset(j,0,sizeof(j));
    scanf("%d %d",&H,&W);
    if((H==0)&&(W==0))break;
    for(i=1;i<=H;i++){
            scanf("%s",&j[i][1]);
    };
    
    for(i=1;i<=H;i++){
        for(t=1;t<=W;t++){
            if(j[i][t]!=0){
                a=j[i][t];
                search(i,t,a);
                b++;
            };
        };
    };
    printf("%d\n",b);
        
    };
    return 0;
}

int search(int c,int d,int e){
    j[c][d]=0;
         if(j[c][d+1]==e){search(c,d+1,e);};
         if(j[c][d-1]==e){search(c,d-1,e);};
         if(j[c+1][d]==e){search(c+1,d,e);};
         if(j[c-1][d]==e){search(c-1,d,e);};
        return(0);
    };


Measured memory_bytes: 2160
#include <algorithm>
#include <iterator>
#include <iostream>
#include <iomanip>
#include <cassert>
#include <utility>
#include <string>
#include <vector>
#include <limits>
#include <queue>
#include <cmath>
#include <map>
#include <set>

using namespace std;

using ll = long long;

int main()
{
    ll S;
    cin >> S;

    ll val = 1e9;

    ll rem = (S % val);
    ll x = (val - rem) % val;
    ll y = (S + x) / val;

    cout << "0 0 1000000000 1 " << x << " " << y << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb(x) push_back(x)
#define vi vector<int>
#define vs vector<string>
#define vll vector<long long>
#define vc vector<char>
#define vs vector<string>
#define pii pair<int, int>
#define pll pair<long long, long long>
#define pil pair<int, long long>
#define pli pair<long long, int>
#define pcc pair<char, char>
#define pdd pair<double, double>
#define mll map<long long, long long>
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(), (v).end()
#define flsh fflush(stdout)
#define gcd __gcd
#define clr(x) memset(x, 0, sizeof(x))
#define mod 1000000007LL
#define INF 1000000000007
 

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


void solve()
{
    string s;
    cin>>s;
    if(s[1]=='R'){
        s[1]='B';
    }
    else{
        s[1]='R';

    }
    cout<<s<<"\n";
}


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


if (fopen("input.txt","r" ))
  {
     freopen("input.txt", "r", stdin);
     freopen("output.txt", "w", stdout);
  }
cout<<setprecision(20);


ll t=1;


// cin>>t;


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


return 0;
}

Measured memory_bytes: 3660
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define For(i,n,k) for(int i=(n);i<(k);i++)
#define ALL(a)  (a).begin(),(a).end()
const ll MAX = 310000;
const ll MOD = 998244353;
ll fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
ll COM(ll n, ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
void Main(){
    ll n,a,b,k,ans = 0;
    cin >> n >> a >> b >> k;
    For(i,0,n+1){
        if((k-i*a)%b==0 && (k-i*a)/b>=0 && (k-i*a)/b<=n){
            ans += COM(n,i) * COM(n,(k-i*a)/b) % MOD;
            ans %= MOD;
        }
    }
    cout << ans << endl;
}
int main(){
    COMinit();
    Main();
    /*
    東方風神録は神が出てくるので当然神ゲー
    */
    return 0;
}

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

int main(){
    int x1,x2,y1,y2;
    cin>>x1>>y1>>x2>>y2;

    int Lx = x2-x1;
    int Ly = y2-y1;

    int x3 = x2 - Ly;
    int y3 = y2 + Lx;
    int x4 = x1 - Ly;
    int y4 = y1 + Lx;

    cout<<x3<<" "<<y3<<" "<<x4<<" "<<y4<<endl;
    return 0;
}

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

int main() {
 vector<int> x(5);
  for(int i = 0; i < 5; i++){
    cin >> x.at(i);
  }
  for(int i = 0; i < 5; i++){
    if(x.at(i) == 0){
      cout << i+1 << endl;}
  }
}
    
 

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

int mod = 1000000007;
int64_t large = 9223372036854775807;
double PI = 3.141592653589793;

int main()
{
    int N;
    cin >> N;
    vector<int>list;
    int sum = 0;
    for (int i = 0; i < N; i++)
    {
        int tmp;
        cin >> tmp;
        sum += tmp;
        if (tmp % 10 != 0)
            list.push_back(tmp);
    }
    sort(list.begin(), list.end());
    if (sum % 10 == 0)
    {
        if (list.size() != 0)
            sum -= list[0];
        else
            sum = 0;
    }
    cout << sum;
}

Measured memory_bytes: 256
from collections import Counter
N = int(input())
S  = []
for i in range(N):
  S.append(input())
cnt = Counter(S)
ans = []
max_vote = max(cnt.values())
for a,b in cnt.items():
  if max_vote==b:
    ans.append(a)
ans = sorted(ans)
print("\r\n".join(ans))


Measured memory_bytes: 38164
#include <bits/stdc++.h>
using namespace std;
#define ll long long 
#define all(v) v.begin(),v.end()
#define boost ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
	*this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
int gcd(int a,int b){
	if(b==0)return a;
	
	return gcd(b,a%b);
	}
void solve() {
	int n;cin>>n;
	vector<pair<int,int>>v(n);for(int i = 0;i<n;i++){cin>>v[i].first>>v[i].second;}
	
	int cnt = 0;bool ok = 0;
	for(auto i:v){
		if(i.first==i.second)++cnt;else{if(cnt>=3){ok = 1;break;}cnt = 0;}
		}
		
		if(ok||cnt>=3)cout<<"Yes";
		else{cout<<"No";}
		cout<<endl;
}
int main()
{boost;
int t;t= 1;//cin>>t;
while(t--){solve();}
}


Measured memory_bytes: 3612
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <limits>
#include <numeric>
#include <cmath>

using namespace std;
using ll = long long;

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

    vector<ll> v(5);
    for (auto&& vi : v) {
        cin >> vi;
    }

    auto it = min_element(begin(v), end(v));
    ll min_val = *it;

    ll ans = 4 + ceil(static_cast<double>(N) / min_val);

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#import numpy as np
#import math
#from decimal import *
#from numba import njit

#@njit
def main():
    N,K = map(int, input().split())
    MOD = 10**9+7

    count = 0
    for k in range(K,N+2):
        count += ((2*N-k+1)*k//2 - (k-1)*k//2 + 1)%MOD
    print(count%MOD)
main()


Measured memory_bytes: 9040
/*
Vim: :pc -> close scratch window
How to lambda 
  ex) sort(begin(cont),end(cont),[](dat a,dat b) {return a.l<b.l;});
  XXX:lambda different from fun obj
lower_bound/upper_bound
  1 2 2 2 3 3
    ^lb   ^ub
*/
#include <bits/stdc++.h>
#define REP(i,n) for(int (i)=0;(i)<(n);++(i))
#define FORR(it,cont) for(auto it=rbegin(cont);it!=rend(cont);++it)
#define FOR(it,cont) for(auto it=begin(cont);it!=end(cont);++it)
#define ALL(cont) begin(cont), end(cont)
#define LB(b,e,v) lower_bound(b,e,v)
#define UB(b,e,v) upper_bound(b,e,v)
#define AS_MOD(a,b) ((((a) % (b) ) + (b)) % (b))
#define MODDING(a,b) (a) = AS_MOD(a,b)
#define fi first
#define se second
#define pb push_back
#define rb reserve
using namespace std;
typedef long long ll;
typedef long double ld;
template<class T>struct DPS{int a,b,c;vector<T> S;
DPS(int A,int B,int C,T s){a=A;b=B;c=C;S.resize(a*b*c,s);}
T& operator()(int A,int B,int C) {return S[A*b*c+B*c+C];}};
int n;
vector<int> numv;
vector<int> vs[2];
int main(int argc, char **argv, char **envp) {
  cin >> n;
  vs[0].resize(n/2);
  vs[1].resize(n/2);
  REP(i,n) scanf("%d", &vs[i%2][i/2]);
  int mv[2];
  int ans=0;
  int t[2][2];
  REP(i,2) {
    numv.resize(100010);
    fill(ALL(numv),0);
    FOR(it,vs[i])numv[*it]++;
    mv[i] = max_element(ALL(numv)) - numv.begin();
    t[i][0] = *max_element(ALL(numv));
    numv.erase(max_element(ALL(numv)));
    t[i][1] = *max_element(ALL(numv));
  }
  if (mv[0]==mv[1]) {
    ans =n- max(t[0][0]+t[1][1],t[0][1]+t[1][0]);
  } else {
    ans=n-(t[0][0]+t[1][0]);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1024