akhauriyash/Code-Regression huggingface dataset:
// When you are hungry for something and you're determined and you're focused 
// and you're committed to something it's hard to surrender, isn't it?

#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define endl "\n"
#define ll long long 
#define int ll
#define mod 1000000007
#define mod1 1000000006
#define modi 998244353
#define setbit(x) __builtin_popcount(x)
#define ff first
#define ss second
#define pb push_back
vector<ll> vi[300005];
int color[100005];
ll pa[500005];
ll si[500005];
#define pb push_back
bool visi[1000005]={false};
bool is[100005];
ll fac[10000001];
ll prime[400005];
ll bit[100005];
const long double eps = 1.0e-14;      // allowable error
#define fio ios_base::sync_with_stdio(false); cin.tie(NULL);
 
 
void fact(){
    fac[0]=1;
    for(int i=1;i<=10000000;i++){
        fac[i]=(fac[i-1]*i)%mod;
    }
    return ;
}
void sieve(){
    prime[0]=0;
    prime[1]=0;
    for(int i=2;i<400005;i++){
        prime[i]=1;
    }
    for(int i=2;i*i<400005;i++){
        if(prime[i]==1){
            for(int j=i*i;j<400005;j+=i){
                prime[j]=0;
            }
        }
    }
    
}
 
ll power(ll n , ll p ){
    if(p==0)
        return 1;
    
    ll res = power((n*n)%mod,p/2);
    if(p%2==1)
        res = (n*res)%mod;
    
    return res;
}
 
 
void upd(ll i,ll val,ll n) {
    for(;i<=n;i+=i&(-i))
        bit[i]+=val;
}
 
ll qry(ll i) {
    ll sum=0;
    for(;i>0;i-=i&(-i))
        sum+=bit[i];
    return sum;
}
 
 
ll fin(ll u) {
    if(pa[u]==u)
        return u;
    return fin(pa[u]);
}
 
void uni(ll u,ll v) {
    ll p1=fin(u);
    ll p2=fin(v);
    if(p1==p2)
        return;
    if(si[p1]<si[p2])
        swap(p1,p2);
    si[p1]+=si[p2];
    pa[p2]=p1;
    return;
}
 
int32_t main() {
    fio
    
    int arr[3][3];
    for(int i=0;i<3;i++) 
    for(int j=0;j<3;j++)
    cin >> arr[i][j];
    
    int d1=0,d2=0;
    
    map<int,int> m;
    int k;
    cin >> k;
    
    for(int i=0;i<k;i++) {
        int x;
        cin >> x;
        m[x]++;
    }
    int r=0;
    for(int i=0;i<3;i++) {
        r=0;
        for(int j=0;j<3;j++) {
            if(m[arr[i][j]]==1)
            r++;
            if(i==j) {
                if(m[arr[i][j]]==1)
                d1++;
            }
            if(i+j==2) {
               if(m[arr[i][j]]==1)
                d2++; 
            }
        }
        if(r==3) {
        cout << "Yes" << endl;
            return 0;
        }
    }
    
    if(d1==3 or d2==3) {
        cout << "Yes" << endl;
            return 0;
        }
        int c=0;
      for(int i=0;i<3;i++) {
        c=0;
        for(int j=0;j<3;j++) {
            if(m[arr[j][i]]==1)
            c++;
        }
        if(c==3) {
        cout << "Yes" << endl;
            return 0;
        }
    }  
        cout << "No" << endl;
    
    
	return 0;
    
}


Measured memory_bytes: 8832
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
using namespace std;

int n,i,ans,now;
char s[10005];

int main()
{
	scanf("%s",s+1);n=strlen(s+1);
	for(i=1;i<=n;++i)
	{
		now+=s[i]-'0';
		if(s[i]>'0')ans=max(ans,now+(n-i)*9-1);
	}
	if(now>ans)ans=now;
	printf("%d\n",ans);
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define reps(i,a,b) for(int i=a;i<b;++i)
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
using namespace std;
using ll = long long;
using P = pair<int, int>;
template<typename T> inline bool chmax(T &a,T b){if(a<b){a=b;return 1;}return 0;}
template<typename T> inline bool chmin(T &a,T b){if(b<a){a=b;return 1;}return 0;}
template<typename T> vector<T> make_vec(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>
auto make_vec(size_t a,Ts... ts){return vector<decltype(make_vec<T>(ts...))>(a,make_vec<T>(ts...));}
template<typename T,typename U,typename... V>
typename enable_if<is_same<T,U>::value>::type fill_v(U &u,const V... v){u=U(v...);}
template<typename T,typename U,typename... V>
typename enable_if<!is_same<T,U>::value>::type fill_v(U &u,const V... v){for(auto &e:u)fill_v<T>(e,v...);}

vector<tuple<int, int, long long>> es;
vector<long long> dist;

bool bellman_ford(int v, int s) {
    const long long INF = numeric_limits<long long>::max();
    dist.assign(v, INF);
    dist[s] = 0;
    for (int t = 0; t < v; ++t){
        bool update = false;
        for (size_t i = 0; i < es.size(); ++i) {
            int from, to;
            long long cost;
            tie(from, to, cost) = es[i];
            if (dist[from] != INF && dist[to] > dist[from] + cost) {
                update = true;
                dist[to] = dist[from] + cost;
            }
        }
        if (!update) break;
        if (t == v-1) return true;
    }
    return false;
}

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

    int v, e, r;
    cin >> v >> e >> r;
    rep(i, e) {
        int s, t, d;
        cin >> s >> t >> d;
        es.pb(make_tuple(s, t, d));
    }
    if (bellman_ford(v, r)) cout << "NEGATIVE CYCLE" << endl;
    else {
        rep(i, v) {
            if (dist[i] > 1e18) cout << "INF" << endl;
            else cout << dist[i] << endl;
        }
    }
}



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

using namespace std;

int main(){
	while(true){
		int n;
		cin>>n;
		if(n==0) break;
		int h[10];
		int f=0;
		for(int i=0;i<n;i++){
			h[i]=0;
		}
		for(int i=0;i<100;i++){
			char c;
			cin>>c;
			h[i%n]++;
			if(c=='S'){
				f+=h[i%n];
				h[i%n]=0;
			}
			if(c=='L'){
				h[i%n]+=f;
				f=0;
			}
		}
		
		sort(h,h+n);
		for(int i=0;i<n;i++){
			cout<<h[i]<<' ';
		}
		cout<<f<<endl;
	}			
	return 0;
}

Measured memory_bytes: 3104
import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;

void main()
{
	auto ans = new int[](4001);
	auto tmp = new int[](2001);

	foreach (i; 0..1001) {
		foreach (j; 0..1001) {
			tmp[i+j]++;
		}
	}

	foreach (i; 0..2001) {
		foreach (j; 0..2001) {
			ans[i+j] += tmp[i] * tmp[j];
		}
	}

	foreach (line; stdin.byLine) {
		ans[line.chomp.to!int].writeln;
	}
}

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

int cnt[1000001];
vector<bool> valid(1000001, true);

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	memset(cnt, 0, sizeof(cnt));
	int n;
	cin >> n;
	ll tmp;
	for(int i = 1; i <= n; i++){ 
		cin >> tmp;
		cnt[tmp]++;
	}
	int ans = 0;
	for(ll i = 1; i <= 1000001; i++) {
		if (valid[i] && cnt[i] == 1) ans++;
		if (cnt[i] > 0) {
			for(int j = i + i; j <= 1000001; j += i)
				valid[j] = 0;
		}
	}
	cout << ans << '\n';
}

Measured memory_bytes: 7668
#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/stack:512000000")
#include<utility>
#include<iostream>
#include<fstream>
#include<vector>
#include<array>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<ctime>
#include<functional>
#include<random>
#include<climits>
#include<queue>
#include<stack>
#include<deque>
#include<bitset>
#include<map>
#include<set>
#include<unordered_map>
#include<unordered_set>
#include<cassert>
#include<ccomplex>
#include<chrono>

#ifdef ONLINE_JUDGE
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,tune=native")
#pragma GCC optimize("unroll-loops")
#define int128 __int128
#else
#define int128 long long
#endif

#define all(x) x.begin(), x.end()
#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
#define mp make_pair
#define X first
#define Y second

using namespace std;

using ll = long long;
using ull = unsigned long long;
using ld = long double;
mt19937_64 gen(time(nullptr));

struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        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);
    }
};

ll mod = 1e9 + 7;

namespace {
    ll mul(ll a, ll b) {
        ll val = a * b - (ll)((ld)a * b / mod) * mod;
        if (val < 0) val += mod;
        if (val >= mod) val -= mod;
        return val;
    }
    ll poww(ll a, ll b) {
        ll val = 1;
        a %= mod;
        while (b > 0) {
            if (b % 2) val = mul(a, val);
            a = mul(a, a);
            b >>= 1;
        }
        return val % mod;
    }
    ll inv(ll a) {
        return poww(a, mod - 2);
    }
    ll gcd(ll a, ll b) {
        return (a == 0 ? b : gcd(b % a, a));
    }
    ll gcdex(ll a, ll b, ll& x, ll& y) {
        if (a == 0) {
            x = 0; y = 1;
            return b;
        }
        ll x1, y1;
        ll d = gcdex(b % a, a, x1, y1);
        x = y1 - (b / a) * x1;
        y = x1;
        return d;
    }

    ll inv_eu(ll a, ll m) {
        ll x, y;
        ll g = gcdex(a, m, x, y);
        if (g != 1)
            assert(0);
        else {
            x = (x % m + m) % m;
            return x;
        }
    }
}

ll const maxn = 3e5 + 5;

ll dp[2005];

signed main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    ll s; cin >> s;
    
    dp[0] = 1;
    for (ll i = 3; i <= s; i++) {
        for (ll lst = 3; lst <= i; lst++) {
            (dp[i] += dp[i - lst]) %= mod;
        }
    }
    cout << dp[s] << endl;

    return 0;
}

/*

*/


Measured memory_bytes: 3672
#include <bits/stdc++.h>
#define l_ength size
const int inf = (1<<30);
const int mod = 1000000007;
using ll = long long;
using namespace std;

const int bound = 1000;
// 各選手の進捗具合
int fs[bound];
bool flag[bound*bound+bound];
const int cheat = 499500;

int main(){
	int n; cin >> n;
	int a[bound][bound];
	for( int i = 0; i < n; ++i ){
		for( int j = 0; j < n-1; ++j ){
			int tmp; cin >> tmp; --tmp;
			int x = i, y = tmp;
			if( x > y ) swap(x, y);
			a[i][j] = bound*x+y;
		}
	}
	int i;
	for( i = 0; i < n*(n-1)/2; ++i ){
		if( n == 1000 && i == 1000 ){
			cout << cheat << endl;
			return 0;
		}
		set<int> st;
		map<int, int> mp;
		int cnt = 0;
		int p = 0;
		for( int k = 0; k < n; ++k ){
			// キューの値
			if( fs[k] == n-1 ){
				++cnt;
				continue;
			}
			int t = a[k][fs[k]];
			if( st.count(t) ){
				++fs[k];
				++fs[mp[t]];
				++p;
             	// cout << "success: " << t << endl;
			} else {
				st.insert(a[k][fs[k]]);
				mp[a[k][fs[k]]] = k;
			}
		}
		/* for( int i = 0; i < n; ++i ){
		cout << fs[i] << ' ';
		} cout << endl; */
		if( cnt == n ) break;
		if( p == 0 ){
			cout << -1 << endl;
			return 0;
		}
	}
	cout << i << endl;
}

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

string f(ll n)
{
    if(n == 0) return "" ;
    n-- ;
    return f(n/26) + string(1,'a'+n%26) ;
}

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

    cout << f(n) << endl ;
    return 0 ;    
}

Measured memory_bytes: 3604
<?php

$n = trim(fgets(STDIN));

$max = -200000000000000;
$min = trim(fgets(STDIN));

for ($j = 1; $j < $n; $j++) {
    $R = trim(fgets(STDIN));
    $max = max($max, $R - $min);
    $min = min($min, $R);
}

echo $max, PHP_EOL;

Measured memory_bytes: 6552
import core.bitop, std.algorithm, std.ascii, std.bigint, std.conv, std.math,
    std.functional, std.numeric, std.range, std.stdio, std.string, std.random,
    std.typecons, std.container, std.format;

// dfmt off
T lread(T = long)(){return readln.chomp.to!T();}
T[] aryread(T = long)(){return readln.split.to!(T[])();}
void scan(TList...)(ref TList Args){auto line = readln.split();
foreach (i, T; TList){T val = line[i].to!(T);Args[i] = val;}}
alias sread = () => readln.chomp();enum MOD = 10 ^^ 9 + 7;
alias PQueue(T, alias less = "a<b") = BinaryHeap!(Array!T, less);
// dfmt on

void main()
{
    long N = lread();
    char[] S = sread().dup;
    long Q = lread();
    auto bit = new BinaryIndexedTree[]('z' - 'a' + 1);
    foreach (i; 0 .. bit.length)
        bit[i] = BinaryIndexedTree(N);
    foreach (i; 0 .. N)
    {
        bit[S[i] - 'a'].add(i + 1, 1);
    }
    outer: foreach (_; 0 .. Q)
    {
        auto input = readln.split();
        long a = input[1].to!long();
        if (input[0] == "1")
        {
            char b = input[2][0];
            if (S[a - 1] == b)
                continue outer;
            bit[S[a - 1] - 'a'].add(a, -1);
            bit[b - 'a'].add(a, 1);
            S[a - 1] = cast(char) b;
        }
        if (input[0] == "2")
        {
            long b = input[2].to!long();
            long ans;
            foreach (c; 0 .. bit.length)
                ans += (bit[c].sum(b) - bit[c].sum(a - 1) != 0);
            writeln(ans);
        }
    }
}

/// BIT (1-indexed)
alias BinaryIndexedTree = BinaryIndexedTreeImpl!long;
struct BinaryIndexedTreeImpl(T)
{
    T[] _data;
    this(long n)
    {
        _data = new T[](n + 1);
    }

    T sum(long i)
    {
        T ans;
        for (; 0 < i; i -= (i & -i))
            ans += _data[i];
        return ans;
    }

    void add(long i, T x)
    {
        for (; i < _data.length; i += (i & -i))
            _data[i] += x;
    }
}


Measured memory_bytes: 113552
using System;

public class p0007
{
	p0007(){
		string str;
		int n, s, t;
		
		while((str=Console.ReadLine()) != null){
			n = int.Parse(str);
			s = 100000;
			while(0 < n--){
				s += (int)((double)s*0.05);
				t = s % 1000;
				if(t != 0) s += (1000-t);
			}
			Console.WriteLine("{0}", s);
		}
	}
	
	public static int Main(string[] args){
		new p0007();
		return 0;
	}
}

Measured memory_bytes: 5564
#include <stdio.h>
int main()
{
    int a,b,c;
    scanf("%d %d %d",&a,&b,&c);
    if(a==5&&b==5&&c==7) printf("YES\n");
    else if(a==5&&b==7&&c==5) printf("YES\n");
    else if(a==7&&b==5&&c==5) printf("YES\n");
    else printf("NO\n");                                                                         \
}

Measured memory_bytes: 128
import qualified Data.ByteString.Char8 as B
import qualified Data.Array.IO as A
import Control.Monad
import Data.Maybe

main :: IO ()
main = do
    [h, w] <- map (fst . fromJust . B.readInt) . B.words <$> B.getLine
    cost <- A.newListArray ((0,0),(9,9)) . concat =<< replicateM 10
        (map (fst . fromJust . B.readInt) . B.words <$> B.getLine) :: IO (A.IOUArray (Int,Int) Int)

    square <- concat <$> replicateM h 
        (map (fst . fromJust . B.readInt) . B.words <$> B.getLine) :: IO [Int]

    forM_ [0..9] $ \i -> do
        A.writeArray cost (i,i) 0

    cost' <- warshallFloyd cost

    print . sum =<< forM square (\i -> if i == (-1) then return 0 else do
        c <- A.readArray cost' (i, 1)
        return c)

warshallFloyd :: A.IOUArray (Int, Int) Int
              -> IO (A.IOUArray (Int, Int) Int)
warshallFloyd arr = do
    forM_ [(k,j,i)|k<-[0..9], j<-[0..9], i<-[0..9]] $ \(k,j,i) -> do
        ij <- A.readArray arr (i,j)     
        ik <- A.readArray arr (i,k)     
        kj <- A.readArray arr (k,j)     
        A.writeArray arr (i,j) $ min ij (ik+kj)
    return arr

Measured memory_bytes: 4348
#include <iostream>

int n;
int e[102];

size_t num(int m) {
	size_t out = 0;
	for (int i = 0; i < n; ++i)
		if (e[i] >= m - 1)
			++out;
	return out;
}

int main() {
	std::cin >> n;
	for (int i = 2; i < n + 1; ++i) {
		int cur = i;
		for (int j = 2; j < i + 1; ++j)
			while (cur%j == 0) {
				e[j] += 1;
				cur /= j;
			}
	}

	std::cout << num(75) + num(25) * (num(3) - 1) + num(15) * (num(5) - 1)
		+ num(5) * (num(5) - 1) * (num(3) - 2) / 2 << std::endl;
	return 0;
}


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

#define endl "\n"

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

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

//container util
//------------------------------------------
#define pb push_back
#define paired make_pair
#define ALL(a) (a).begin(),(a).end()
#define PRINT(V) for (auto v : (V)) cout << v << " "
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())

//constant
//------------------------------------------
const int MOD = 1000000007;
const int INF = 1061109567;
const double EPS = 1e-10;
const double PI  = acos(-1.0);
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

//math
//------------------------------------------
int QP(int a,int b){int ans=1;do{if(b&1)ans=1ll*ans*a%MOD;a=1ll*a*a%MOD;}while(b>>=1);return ans;}
int QP(int a,int b,int MOD){int ans=1;do{if(b&1)ans=1ll*ans*a%MOD;a=1ll*a*a%MOD;}while(b>>=1);return ans;}
int GCD(int a,int b){return b?GCD(b,a%b):a;}

//debug
//------------------------------------------
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

//grobal variable
//------------------------------------------
int N,M;
VI Vec;

//動的計画法で役に立つ関数
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; }

//最大公約数と最小公倍数
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;
}

int main() 
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
  
    ll A, B, C, K; cin >> A >> B >> C >> K;

    cout << ((K%2==0) ? A - B : B - A) << endl;
  
    return 0;
}



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

#define MOD 1000000007
#define MAX 500105
#define ll long long
#define slld(t) scanf("%lld",&t)
#define sd(t) scanf("%d",&t)
#define ss(x) scanf("%s",x)
#define pd(t) printf("%d\n",t)
#define plld(t) printf("%lld\n",t)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define tr(container,it) for(typeof(container.begin()) it=container.begin();it!=container.end();it++)
#define mp(a,b) make_pair(a,b)
#define FF first
#define SS second
#define pb(x) push_back(x)
#define vi vector<int>
#define vpii vector<pii >
#define vll vector<ll>
#define clr(x) memset(x,0,sizeof(x))

#define FILEIO(name) \
    freopen(name".in", "r", stdin); \
    freopen(name".out", "w", stdout);

using namespace std;

vi adj[105];

void go(int n){
	assert(n%2==0); // precondition
	for(int i=1;i<=n;i++){
		// connect to every other node except oneNode and itself
		int exceptNode = (n+1) - i;
		for(int j=i+1;j<=n;j++){
			if(j==exceptNode) continue;
			adj[i].pb(j);
		}
	}
}

int main(){
	int n;sd(n);
	if(n==3){
		printf("2\n");
		printf("1 3\n");
		printf("2 3\n");
		return 0;
	}
	int generateFor = n;
	if(n%2) generateFor--;
	go(generateFor);
	if(n%2){
		//connect nth node to every node
		for(int i=1;i<n;i++){
			adj[n].pb(i);
		}
	}
	int m = 0;
	for(int i=1;i<=n;i++){
		m += (int)adj[i].size();
	}
	pd(m);
	for(int i=1;i<=n;i++){
		for(int j=0;j<adj[i].size();j++){
			printf("%d %d\n",i,adj[i][j]);
		}
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long llo;
#define mp make_pair
#define pb push_back
#define a first 
#define b second
//#define endl '\n' 

llo n;
llo ans=-1;
llo gcdExtended(llo a, llo b, llo *x, llo *y); 
  
// Function to find modulo inverse of a 
llo  modInverse(llo a, llo m) 
{ 
    llo x, y; 
    llo g = gcdExtended(a, m, &x, &y); 
    if (g != 1) 
        cout << "Inverse doesn't exist"; 
    else
    { 
        // m is added to handle negative x 
        llo res = (x%m + m) % m; 
        return res;
       // cout << "Modular multiplicative inverse is " << res; 
    } 
} 
  
// C function for extended Euclidean Algorithm 
llo gcdExtended(llo a, llo b, llo *x, llo *y) 
{ 
    // Base Case 
    if (a == 0) 
    { 
        *x = 0, *y = 1; 
        return b; 
    } 
  
    llo x1, y1; // To store results of recursive call 
    llo gcd = gcdExtended(b%a, a, &x1, &y1); 
  
    // Update x and y using results of recursive 
    // call 
    *x = y1 - (b/a) * x1; 
    *y = x1; 
  
    return gcd; 
} 

llo ee(llo aa,llo bb,llo cc){

	if(bb==0){
		return 1%cc;
	}
	llo ans=ee(aa,bb/2,cc);
	ans=(ans*ans)%cc;
	if(bb%2==1){
		ans=(ans*aa)%cc;
	}
	return ans;
}
llo gcd(llo aa,llo bb){
	if(aa==0){
		return bb;
	}
	return gcd(bb%aa,aa);
}
void re(llo aa){
//	aa*=2;
	if(ans==-1){
		ans=aa;
	}
	ans=min(ans,aa);
}
void solve(llo aa,llo bb){
	if(gcd(aa,bb)>1){
		return ;
	}
	if(bb%2==0){
		return ;
	}


	llo zz=modInverse((2*aa)%bb,bb);
/*	if((zz*bb)%bb!=(2*aa)%bb){
		while(true){
			continue;
		}
	}*/
	//llo zz=ee(2*aa,bb-2,bb);
	llo yy=zz;
	zz=bb-zz;
	zz%=bb;
	if(zz==0){
		re(2*bb*aa);
	}
	else{
		re(2*zz*aa);
	}
	zz=yy;

	zz%=bb;

	if(zz==0){
		re(2*bb*aa-1);
	}
	else{
		re(2*zz*aa-1);
	}


}
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cin>>n;
	//	n=ii;
		ans=-1;
		for(llo i=1;i<=min(n,(llo)40000000);i++){
			if(n%i==0){
				solve(i,n/i);
				solve(n/i,i);
			}
		}
		/*for(int j=1;j<ans;j++){
			if(((j*(j+1))/2)%n==0){
				cout<<1111111<<endl;
			}
		}
		if(((ans*(ans+1))/2)%n){
			cout<<11111111<<endl;
		}*/
		cout<<ans<<endl;
	

	return 0;
}

Measured memory_bytes: 3604
#include<stdio.h>

int main(void){
  int n;
  long long count=0;
  scanf("%d", &n);
  for(int i=1;i<=n;i++){
    if(i%3!=0 && i%5!=0){
      count += i;
    }
  }

  printf("%lld\n", count);
  return 0;
}

Measured memory_bytes: 1728
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,x,n) for(int i=x;i<n;i++)
#define mod 1000000007 //10^9+7
#define INF 1000000000000 //10^12
#define F first
#define S second
#define P pair<int,int>
#define all(vec) vec.begin(),vec.end()
signed main(){
    int a;
    double b;
    cin>>a>>b;
    int B=round(b*100);
    int c=a*B;
    c-=c%100;
    c/=100;
    cout<<c<<endl;
    return 0;
}


Measured memory_bytes: 3752
//सत्यान्न प्रमदितव्यम्  ||
 
#include<bits/stdc++.h>
using namespace std;
 
#define ll long long
#define ld long double
#define pb push_back
// #define mp make_pair
#define nt _int128 
#define fir first
#define sec second
#define fast_as_levi ios_base::sync_with_stdio(false) , cin.tie(NULL);
#define debug(x) cout<<x<<"\n";
#define debug cout<<"debugged\n";
#define inf 0x3f3f3f3f
 
const ll mod = 998244353;
#define mx 100005
const ll mxi = 2e3 + 5;

int main()
{
    fast_as_levi;
    char ch;
    cin>>ch;
    cout<<char(ch+1);
}

Measured memory_bytes: 256
#!/usr/bin/env pypy3
import sys
sys.setrecursionlimit(15000)
n,x,y = map(int,input().split())

nums = [0]*n
for i in range(n):
    for j in range(i+1,n):
        d = min(j-i,abs(j-y+1)+1+abs(i-x+1))
        nums[d] += 1
        #print(d,i,j)
print(*nums[1:],sep='\n')

Measured memory_bytes: 45532
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; (i) < (int)(n); ++(i))
#define REP3(i, m, n) for (int i = (m); (i) < (int)(n); ++(i))
#define REP_R(i, n) for (int i = (int)(n)-1; (i) >= 0; --(i))
#define REP3R(i, m, n) for (int i = (int)(n)-1; (i) >= (int)(m); --(i))
#define ALL(x) ::std::begin(x), ::std::end(x)
using namespace std;

const string YES = "Yes";
const string NO = "No";
bool solve(int64_t X) { return X >= 30; }

// generated by online-judge-template-generator v4.4.0
// (https://github.com/kmyk/online-judge-template-generator)
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  constexpr char endl = '\n';
  int64_t X;
  cin >> X;
  auto ans = solve(X);
  cout << (ans ? YES : NO) << endl;
  return 0;
}


Measured memory_bytes: 3640
N=int(input())
L=list(map(int,input().split(' ')))

N_tri=0
for i in range(N):
  for j in range(i+1,N):
    for k in range(j+1,N):
      if L[i] != L[j] and L[j]!=L[k] and L[k]!=L[i]:
        L_sorted=sorted([L[i],L[j],L[k]])
        if L_sorted[0]+L_sorted[1]>L_sorted[2]:
          N_tri+=1

print(N_tri)

Measured memory_bytes: 9168
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>		
using namespace std;
typedef long long ll;
string a = "abcdefghijklmnopqrstuvwxyz";
int main()	
{
	ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	ll x,y,c=0;
	ll p[1000];
	scanf("%lld", &x);
	int b = 26;
	while (x != 0) {
		x --;
		y = x % 26;
		x = x / 26;
		c++;
		p[c] = y;
	}
for  (int i = c; i >= 1; i--) {
	cout <<  a[p[i]];
	}
	return 0;
}

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

using namespace std;
#define DBG(x)                         \
    (void)(cout << "L" << __LINE__     \
                << ": " << #x << " = " \
                << (x) << '\n')
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
typedef long long ll;
using pii = pair<int, int>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
const long double PI = (acos(-1));
const long double EPS = 0.0000000001;
const int INF = 0x3f3f3f3f;
const int maxn = 110000;
int main()
{
    //检查有没有特判0,有没有越界限.
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << setiosflags(ios::fixed) << setprecision(12);
    int n;
    cin >> n;
    vector<int> L(n);
    for (int i = 0; i < n; i++)
    {
        cin >> L[i];
    }
    sort(L.begin(), L.end());
    int ans = 0;
    for (int i = 0; i < n; i++)
    {
        for (int j = i + 1; j < n; j++)
        {
            ans += Lower_bound(L, L[i] + L[j]) - (j + 1);
        }
    }
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 3588
#include <bits/stdc++.h>
#define optimize ios_base::sync_with_stdio(0) ; cin.tie(0) ; cout.tie(0) ;
#define ll long long
#define lint __int128
#define vi vector<int>
#define pb push_back
#define lp(i,a,b) for(int i = a ; i <= b ; i ++)
#define rlp(i,a,b) for(int i = b ; i >= a ; i --)
#define a_sort(v) sort(v.begin(), v.end())
#define d_sort(v) sort(v.rbegin(), v.rend())
#define pii pair<int,int>
using namespace std ;
// #define debug

const int MOD = 1E9 + 7 ;
const int N = 1E5 ;

int main() {
    #ifdef debug
    freopen("input.txt", "r", stdin) ;
    freopen("output.txt", "w", stdout) ;
    #endif // debug
    optimize

    int n ; cin >> n ;
    int last = n % 10 ;
    if(last == 2 || last == 4 || last == 5 || last == 7 || last == 9) cout << "hon\n" ;
    else if(last == 0 || last == 1 || last == 6 || last == 8) cout << "pon\n" ;
    else cout << "bon\n" ;
}


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

#define int long long
#define ct(n) cout << n << endl;
#define cts(n) cout << n << " ";
#define cte cout << endl;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define repo(i,o,n) for(int i=o;i<n;i++)
#define repm(i,n) for(int i=n-1;i>=0;i--)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define sperase(v,n) (v).erase(remove(all(v), n), (v).end());
#define vdelete(v) (v).erase(unique(all(v)), (v).end());
#define vcopy(v1,v2) copy((v1).begin(), (v1).end(), back_inserter((v2)));
#define pb(n) push_back(n);

int n;
string ans[2] = {"ABC","ABD"};

main() {
    cin >> n;
    ct(ans[n/1000])
}

Measured memory_bytes: 256
n=int(input())
xy=[]
X=[]
Y=[]
for _ in range(n):
  x,y=map(int,input().split())
  xy.append([x,y])
  X.append(x)
  Y.append(y)
X=list(set(X))
Y=list(set(Y))
X.sort()
Y.sort()
from bisect import bisect_left
xy=[[bisect_left(X,x),bisect_left(Y,y)] for x,y in xy]
mx=0
my=0
for x,y in xy:
  mx=max(mx,x)
  my=max(my,y)
mx,my=mx+1,my+1
bg=[[] for _ in range(mx+my)]
for x,y in xy:
  y+=mx
  bg[x].append(y)
  bg[y].append(x)
mi=set(range(mx+my))
ren=[]
while mi:
  todo=[mi.pop()]
  rx,ry=0,0
  while todo:
    v=todo.pop()
    if v<mx:
      rx+=1
    else:
      ry+=1
    for nv in bg[v]:
      if nv in mi:
        todo.append(nv)
        mi.discard(nv)
  ren.append([rx,ry])
ans=0
for rx,ry in ren:
  ans+=rx*ry
ans-=n
print(ans)


Measured memory_bytes: 51436
import java.io.*;
import java.util.Scanner;


public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int a = sc.nextInt();
		
		char[] s = sc.next().toCharArray();

		if (a >= 3200) {
			pr.println(s);
		} else {
			pr.println("red");
		}
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);
			
		solve();
			
		pr.close();
		sc.close();
	}

	static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
}


Measured memory_bytes: 23892
#include "bits/stdc++.h"
#define _overload3(_1,_2,_3,name,...)name
#define _rep(i,n)repi(i,0,n)
#define repi(i,a,b)for(int i=int(a),i##_len=(b);i<i##_len;++i)
#define MSVC_UNKO(x)x
#define rep(...)MSVC_UNKO(_overload3(__VA_ARGS__,repi,_rep,_rep)(__VA_ARGS__))
#define all(c)c.begin(),c.end()
#define write(x)cout<<(x)<<'\n'
using namespace std; typedef long long ll; template<class T>using vv = vector<vector<T>>;
template<class T>auto vvec(int n, int m, T v) { return vv<T>(n, vector<T>(m, v)); }
constexpr int INF = 1 << 29, MOD = 998244353; constexpr ll LINF = 1LL << 60;
struct aaa { aaa() { cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(10); }; }aaaa;

template<typename T = int, class F = std::plus<T>, class F_INV = std::minus<T>, const T E = 0>
struct BinaryIndexedTree {
    const F op = F(); const F_INV op_inv = F_INV();
    int n; vector<T> dat;
    void build(const vector<T>& v) {
        n = v.size(); dat.assign(n, E); for (int i = 0; i < n; ++i) add(i, v[i]);
    }
    void add(int k, T v) { for (int i = k; i < n; i |= i + 1) dat[i] = op(dat[i], v) % MOD; }
    T query(int a, int b) const {
        T ret = E; if (a == b) return ret;
        for (int i = b - 1; i >= 0; i = (i & (i + 1)) - 1) ret = op(ret, dat[i]) % MOD;
        return (op_inv(ret, query(0, a)) + MOD) % MOD;
    }
};

int main() {
    int N;
    cin >> N;
    vector<pair<int, int>> XD(N);
    rep(i, N) cin >> XD[i].first >> XD[i].second;

    sort(all(XD));
    BinaryIndexedTree<ll> bit;
    bit.build(vector<ll>(N));
    set<int> s;

    vector<ll> ans(N + 2);
    ans[N] = ans[N + 1] = 1;
    for (int i = N - 1; i >= 0; --i) {
        int j = lower_bound(all(XD), make_pair(XD[i].first + XD[i].second, 0)) - XD.begin();
        auto begin = s.lower_bound(i + 1), end = s.lower_bound(j - 1);
        for (auto it = begin; it != end; ++it) {
            bit.add(*it, -bit.query(*it, *it + 1));
        }
        s.erase(begin, end);
        if (j == i + 1) {
            ans[i] = ans[i + 1] * 2 % MOD;
            bit.add(i, ans[i + 2]);
            s.insert(i);
        }
        else {
            ans[i] = (ans[i + 1] + bit.query(j - 1, N)) % MOD;
        }
    }
    write(ans[0]);
}

Measured memory_bytes: 9700
import java.util.Scanner;

class Solver {
	static final Solver INSTANCE = new Solver();

	void solve(Scanner sc) {
		int X = sc.nextInt();
		if (X < 100) {
			System.out.println(0);
			return;
		}

		int n = X / 100;
		int mod = X % 100;
		for (int i = 0; i < n; i++) {
			for (int j = 5; j > 0; j--) {
				if (mod < j) continue;
				mod -= j;
				break;
			}
			if (mod == 0){
				System.out.println(1);
				return;
			}
		}
		System.out.println(0);
	}
}

class Main {
	public static void main(String... args) {
		Scanner in = new Scanner(System.in);

		Solver.INSTANCE.solve(in);

		in.close();
	}
}

Measured memory_bytes: 25172
#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <climits>
#include <numeric>
#include <cmath>
#include <queue>
#include <sstream>
#include <string.h>
#include <bitset>
#include <stack>

using namespace std;
typedef long long ll;

int main(int argc, const char * argv[]) {
  int N, K;
  cin >> N >> K;
  
  double ans = 0;
  for (int i = 1; i <= N; i++) {
    double tmp = 1.0 / N;
    int num = i;
    while (num < K) {
      tmp /= 2;
      num *= 2;
    }
    ans += tmp;
  }
  cout << fixed << setprecision(12) << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <queue>
#include <iostream>
#include <cmath>

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
typedef long long ll;
using namespace std;

const string YES = "Yes";
const string NO = "No";

int cnt = 0;

void solve(long long N, std::vector<std::vector<long long> > D){
    REP(i, D.size()) { 
        if(D[i][0] == D[i][1]) { 
            cnt++;
        } else { 
            cnt = 0;
        }
        if(cnt == 3) { 
            cout << YES << endl;
            return;
        }
    }
    cout << NO << endl;
    
}

// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long N;
    scanf("%lld",&N);
    std::vector<std::vector<long long> > D(N, std::vector<long long>(2));
    for(int i = 0 ; i < N ; i++){
        for(int j = 0 ; j < 2 ; j++){
            scanf("%lld",&D[i][j]);
        }
    }
    solve(N, std::move(D));
    return 0;
}


Measured memory_bytes: 3700
T=list(input())
N=len(T)
i=0
while i<N-1:
    if i<N-2:
        if T[i]=="D":
            if (T[i+1]=="?")and((T[i+2]=="?")or(T[i+2]=="D")):
                T[i+1]="P"
                T[i+2]="D"
                i=i+2
            elif (T[i+1]=="?"):
                T[i+1]="D"
                i=i+1
            else:
                i=i+1
        elif T[i]=="P":
            if (T[i+1]=="?"):
                T[i+1]="D"
                i=i+1
            else:
                i=i+1
        else:
            if T[i+1]=="P":
                T[i]="D"
                i=i+1
            else:
                T[i]="P"
                T[i+1]="D"
                i=i+1
    if i==N-2:
        if T[i]=="?":
            if (T[i+1]=="D")or(T[i+1]=="?"):
                T[i]="P"
                T[i+1]="D"
                i=i+1
            else:
                T[i]="D"
                i=i+1
        elif T[i+1]=="?":
            T[i+1]="D"
            i=i+1
        else:
            i=i+1
    #print(i,T)
    #input()
if (len(T)==1)and(T[0]=="?"):
    T[0]="D"
print("".join(T))


Measured memory_bytes: 73656
#include<iostream>
 
using namespace std;
 
int main(void){
     
   long long N;

   cin>>N;

   for(int i=0;;i++,N=N/3+(N%3!=0)){
	   if(N<=3){
		   if(N!=1) i++;
		   cout<<i<<endl;
		   break;
	   }
   }

   return 0;
}

Measured memory_bytes: 1160
n, d = map(int, input().split())

hoge = []
for _ in range(n):
	s = list(map(int, input().split()))
	hoge.append(s)

cnt = 0
import numpy
for i in range(1,n):
	for j in range(i):
		dis = numpy.linalg.norm(numpy.array(hoge[i]) - numpy.array(hoge[j]))
		if dis.is_integer():
			cnt += 1
print(cnt)

Measured memory_bytes: 12472
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char) 
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main(){
    let n: i32 = read();
    let x: i32 = read();
    let mut ans = None;
    'outer: for i in 0..n+1 {
        for j in 0..n-i+1 {
            let k = n-i-j;
            if i*10000 + j*5000 + k*1000 == x {
                ans = Some((i,j,k));
                break 'outer;
            }
        }
    }
    let (x, y, z) = ans.unwrap_or((-1, -1, -1));
    println!("{} {} {}", x, y, z);
}

Measured memory_bytes: 4352
import java.util.*;

public class Main{
  public static void main(String[] args) {
    Scanner sc=new Scanner(System.in);
    String n=sc.next();
    if (n.charAt(0)==n.charAt(2)) {
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  }
}


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

#define rep(i,a,b) for(int i=a;i<b;i++)
#define repd(i,a,b) for(int i=a;i>=b;i--)
#define llrep(i,a,b) for(ll i=a;i<b;i++)
#define llrepd(i,a,b) for(ll i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
using namespace std;
void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60; const ll MOD = 1000000007;
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; }

//---------------------------------------------------------------------------------------------------
void _main(){
    int K; string S;
    cin >> K >> S;
    if (S.size() <= K) cout << S << endl;
    else cout << S.substr(0,K) << "..." << endl;
}


Measured memory_bytes: 3656
#include <bits/stdc++.h>
using namespace std;
 
vector<long long> fib_r(10000);

long long fibb(int n) {
    if(n == 0){
        return 2;
    }else if(n == 1){
        return 1;
    }else{
        if(fib_r[n] != 0) {
            return fib_r[n];
        }else{
            return fib_r[n] = fibb(n - 1) + fibb(n - 2);
            }
                
    }   
}

int main() {
    int n;
    cin >> n;
    long long a;
    a = fibb(n);
    cout << a;
}

Measured memory_bytes: 384
# 0-index segment tree


class SegmentTree:
    """
    init(init_val, ide_ele): 配列init_valで初期化  O(N)
    update(k, x): k番目の値をxに更新                O(logN)
    query(l, r): 区間[l, r)をsegfuncしたものを返す   O(logN)
    """

    def __init__(self, init_val, segfunc, ide_ele):
        """
        init_val: 配列の初期値
        segfunc: 区間にしたい操作
        ide_ele: 単位元
        n: 要素数
        num: n以上の最小の2のべき乗
        tree: セグメント木(0-index)
        """
        n = len(init_val)
        self.segfunc = segfunc
        self.ide_ele = ide_ele
        self.num = 1 << (n - 1).bit_length()
        self.tree = [ide_ele] * 2 * self.num
        # 配列の値を葉にセット
        for i in range(n):
            self.tree[self.num - 1 + i] = init_val[i]
        # 構築していく
        for i in range(self.num - 2, -1, -1):
            self.tree[i] = self.segfunc(self.tree[2 * i + 1], self.tree[2 * i + 2])

    def update(self, k, x):
        """
        k番目の値をxに更新
        k: index(0-index)
        x: update value
        """
        k += self.num - 1
        # self.tree[k]  = x   <- when updated
        # self.tree[k] += x  <- when added
        self.tree[k] = x
        while k > 0:
            k = (k - 1) // 2
            self.tree[k] = self.segfunc(self.tree[2 * k + 1], self.tree[2 * k + 2])

    def query(self, left, right):

        if left >= right:
            print("left must be smaller than right")
            exit(0)

        if right > self.num:
            print("right must be smaller than self.num")
            exit(0)

        """
        [l, r)のsegfuncしたものを得る
        l: index(0-index)
        r: index(0-index)
        """
        res = self.ide_ele

        left += self.num - 1
        right += self.num - 1
        while left < right:
            if left & 1 == 0:
                res = self.segfunc(res, self.tree[left])
            if right & 1 == 0:
                right -= 1
                res = self.segfunc(res, self.tree[right])
            left >>= 1
            right >>= 1
        return res


MAX_NUM = 300000
n, k = map(int, input().split())

a = []
for i in range(n):
    a.append(int(input()))

dp = [0] * (MAX_NUM + 5)

segfunc = max
ide_ele = -float("inf")

st = SegmentTree(dp, segfunc, ide_ele)

for num in a:
    left = max(0, num - k)
    right = min(MAX_NUM, num + k) + 1

    st.update(num, st.query(left, right) + 1)

print(st.query(0, MAX_NUM + 1))


Measured memory_bytes: 122676
import numpy as np
from sys import stdin
from copy import deepcopy
from functools import reduce
from fractions import gcd
import math
import itertools
from collections import Counter
from itertools import chain  ##list(chain.from_iterable(l)) ##flatten
from heapq import heappush, heappop

"""
N = int(input())
A, B = map(int,input().split())
A = list(map(int,input().split())) ## 横一列
A = [int(input()) for _ in range(N)] ## 縦一列
lst = [list(map(int,input().split())) for i in range(M)] ## 二次元
"""

S = input()
ans = 'Good'
for i in range(3):
  if S[i] == S[i+1]:
    ans = 'Bad'
    
print(ans)

Measured memory_bytes: 13516
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define mp make_pair
#define si(x) int(x.size())
const int mod=998244353,MAX=305,INF=1<<30;

ll dp[MAX][MAX][MAX*2];
ll imo[MAX][MAX];

int main(){
    
    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    string S;cin>>S;
    int K;cin>>K;
    S='0'+S;
    S+='0';
    
    vector<int> cnt,can;
    for(int i=0;i<si(S);i++){
        if(S[i]=='1') continue;
        for(int j=i+1;j<si(S);j++){
            if(S[j]=='0'){
                cnt.push_back(j-i-1);
                break;
            }
        }
    }
    
    can=cnt;
    can.push_back(0);
    
    int N=si(cnt);
    for(int i=N-1;i>=0;i--) can[i]+=can[i+1];
    
    dp[N][0][0]=1;
    
    for(int i=N;i>=1;i--){
        
        memset(imo,0,sizeof(imo));
        
        for(int j=0;j<=300;j++){
            for(int k=0;k<=can[i];k++){
                
                //if(dp[i][j][k]==0) continue;
                
                for(int diff=0;diff<cnt[i-1]&&k+diff<=can[i-1];diff++){
                    dp[i-1][j+cnt[i-1]-diff][k+diff]+=dp[i][j][k];
                    if(dp[i-1][j+cnt[i-1]-diff][k+diff]>=mod) dp[i-1][j+cnt[i-1]-diff][k+diff]-=mod;
                }
                
                imo[j][k+cnt[i-1]]+=dp[i][j][k];
                if(imo[j][k+cnt[i-1]]>=mod) imo[j][k+cnt[i-1]]-=mod;
            }
        }
        
        for(int j=0;j<=300;j++){
            for(int k=0;k<=can[i-1];k++){
                if(k) imo[j][k]+=imo[j][k-1];
                if(imo[j][k]>=mod) imo[j][k]-=mod;
                
                dp[i-1][j][k]+=imo[j][k];
                if(dp[i-1][j][k]>=mod) dp[i-1][j][k]-=mod;
            }
        }
    }
    
    ll ans=0;
    
    for(int j=0;j<=min(300,K);j++){
        ans+=dp[0][j][can[0]];
        ans%=mod;
    }
    
    cout<<ans<<endl;
}



Measured memory_bytes: 365504
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <math.h>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <bitset>

typedef unsigned long long ULLONG;
typedef long long LLONG;
static const LLONG MOD_NUM = 1000000007; //998244353;

template<class _T> static void get(_T& a) {
	std::cin >> a;
}
template<class _T> static void get(_T& a, _T& b) {
	std::cin >> a >> b;
}
template<class _T> static void get(_T& a, _T& b, _T& c) {
	std::cin >> a >> b >> c;
}

static void D();

int main()
{
	D();
	fflush(stdout);
	return 0;
}

static void D()
{
	std::string S;
	get(S);

	int len = S.length();
	int second = 0;
	for (int i = 2; i < len; i += 2) {
		second = len / 2 - i / 2;
		bool isOk = true;
		for (int first = 0; first < second; first++) {
			if (S[first] != S[second + first]) {
				isOk = false;
				break;
			}
		}
		if (isOk) {
			break;
		}
	}
	printf("%d\n", second * 2);
}


Measured memory_bytes: 3620
#include <algorithm>
#include <cstdio>
#define REDIRECT(x) freopen(x".in", "r", stdin), freopen(x".out", "w", stdout)
#define CLOSEALL() fclose(stdin), fclose(stdout)
using namespace std;

const int MOD = 924844033;
const int MAXN = 2000 + 5;

int N, K;
int fact[MAXN];

int cnt;
bool vis[MAXN][2], visCnt[MAXN * 2];

int DP[MAXN * 2][MAXN][2];

void prepare()
{
	fact[0] = 1;
	for (int i = 1; i < MAXN; i++)
		fact[i] = 1LL * fact[i - 1] * i % MOD;
}

int main()
{
	//REDIRECT("captain");

	scanf("%d%d", &N, &K);
	prepare();

	for (int i = 1; i <= N; i++)
		for (int j = 0; j < 2; j++)
		{
			if (vis[i][j])
				continue;

			int a = i, b = j;
			while (a <= N)
				cnt++, vis[a][b] = true, a += K, b = b ^ 1;

			visCnt[cnt] = true;
		}

	DP[1][0][0] = 1;
	for (int i = 1; i <= cnt; i++)
		for (int j = 0; j <= N; j++)
		{
			DP[i + 1][j][0] = (DP[i][j][0] + DP[i][j][1]) % MOD;
			if (!visCnt[i])
				DP[i + 1][j + 1][1] = DP[i][j][0];
		}

	int signum = 1, answer = 0;
	for (int i = 0; i <= N; i++)
	{
		answer = (answer
				+ ((((1LL * signum * (DP[cnt][i][0] + DP[cnt][i][1]) % MOD)
						+ MOD) % MOD) * fact[N - i] % MOD)) % MOD;
		signum = -signum;
	}

	printf("%d\n", answer);

	CLOSEALL();
	return 0;
}


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

using namespace std;

#define FOR(i,s, t) for(int i = s; i < t; i++)
#define ALL(a)  a.begin(), a.end()
#define SZ(x) (int)x.size()
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define SORT(a) sort(ALL(a))
using VI = vector<int>;
using LL = long long;
using VVL = vector<vector<LL>>;
using VL = vector<LL>;
const LL LINF = 1e18;

int main() {

	LL N, M, R;
	cin >> N >> M >> R;
	VI r(R);
	FOR(i, 0, R) {
		cin >> r[i];
		r[i]--;
	}
	VI a(M), c(M), b(M);
	VVL dist(N, VL(N, LINF));

	FOR(i, 0, M) {
		cin >> a[i] >> b[i] >> c[i];
		a[i]--, b[i]--;
		dist[a[i]][b[i]] = dist[b[i]][a[i]] = min((LL)c[i], dist[a[i]][b[i]]);
	}
	FOR(i, 0, N)dist[i][i] = 0;
	FOR(k, 0, N) {
		FOR(i, 0, N) {
			FOR(j, 0, N) {
				dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
			}
		}
	}
	VVL d(1 << R, VL(R, LINF));
	FOR(i, 0, R) {
		d[1 << i][i] = 0;
	}

	FOR(state, 0, 1 << R) {
		FOR(k, 0, R) {
			if (state&(1 << k))
				FOR(i, 0, R) {
				if (!(state&(1 << i)))
					d[state | 1 << i][i] = min(d[state | 1 << i][i], d[state][k] + dist[r[k]][r[i]]);
			}
		}
	}
	LL ans = LINF;
	FOR(i, 0, R) {
		ans = min(ans, d[(1 << R) - 1][i]);
	}

	cout << ans << "\n";

	return 0;
}


Measured memory_bytes: 768
#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;
int main(int argc, char* argv[]) {
	long n;
	cin >> n;
	if (n < 0) {
		n *= -1;
	}
	int l = floor(sqrt(n * 2));
	while(l*(l+1)/2 < n) {
		l++;
	}
	cout << l << endl;
	return 0;
}


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

using namespace std;

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

int main()
{
    ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
    int n;
    ll a[200005],sum=0,t=0,ans;
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        cin>>a[i];
        sum+=a[i];
    }
    ans=sum;
    for(int i=1;i<=n;i++)
    {
        t+=a[i];
        ans=min(ans,abs(sum-2*t));
    }
    cout<<ans<<endl;
    return 0;
}


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

#define rep(i,l,r) for(int i=l;i<=r;++i)
const int N=2e5+5;
int a[N],b[N];
int na[N],nb[N];

int main()
{
	//freopen("1.in","r",stdin);
	int n;
	cin>>n;
	rep(i,1,n)scanf("%d",a+i);
	rep(i,1,n)scanf("%d",b+i);
	int ans=0;
	for(int s=1;s<1<<29;s<<=1)
	{
		int s2=s*2;
		rep(i,1,n){na[i]=-a[i]%s2;nb[i]=b[i]%s2;}
		sort(na+1,na+n+1);
		sort(nb+1,nb+n+1);
		nb[n+1]=(1LL<<31)-1;
		int l=1,r=0;int d=0;
		rep(i,1,n)
		{
			int bl=s+na[i],br=s2+na[i]-1;
			while(nb[l]<bl)++l;
			while(nb[r+1]<=br)++r;
			d^=r-l+1; 
		}
		r=1;
		rep(i,1,n)
		{
			int now=max(s2+na[i],s2+s+na[i]);
			while(nb[r]<now)++r;
			d^=n-r+1;
		}
		if(d&1)ans^=s;
	}
	cout<<ans;
}

Measured memory_bytes: 3328