akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cstdio>
using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7;
const ll N = 200010;
ll n, k, ans;
ll presum[N], sufsum[N];
int main() {
    cin >> n >> k;
    for (ll i = 0; i <= n; i++) {
        presum[i] = presum[i - 1] + i;
    }
    for (ll i = n; i >= 0; i--) {
        sufsum[i] = sufsum[i + 1] + i;
    }
    for (ll i = k; i <= n + 1; i++) {
        ans = (ans + (sufsum[n - i + 1] - presum[i - 1] + 1)) % mod;
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 6756
#include<bits/stdc++.h>
#define Fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define Freed freopen ("0in.txt","r",stdin);
#define Fout freopen ("0out.txt","w",stdout);
#define ll long long int
#define pb push_back
#define mp make_pair
#define pi acos(-1.0)
#define Mod 1000000007
#define limit 1000008
using namespace std;

void solve(int t)
{
    ll a,b,c,d;
    cin >> a >> b >> c >> d;
    cout <<max(a*c,max(a*d,max(b*d,b*c)));

    return ;
}
int  main()
{
//    Fast
//    Freed
//    Fout
    int t,tt=1;
    //cin >> tt;
    for(t=1; t<=tt; t++)
        solve(t);
    return 0;
}



Measured memory_bytes: 3636
import numpy as np
 
n = int(input())
arr = np.array([int(i) for i in input().split()])
mod = 10 ** 9 + 7
s = 0

for i in range(60):
    assert np.count_nonzero(arr & 1) == np.sum(arr & 1)
    c1 = np.count_nonzero(arr & 1)
    s += 2 ** i * c1 * (n - c1)
    arr >>= 1
print(s % mod)

Measured memory_bytes: 48848
import java.util.Scanner;

public class Main {
	
	public String judgeTriangle(int a, int b, int c){
		if(a < 1 || a > 100 || b < 1 || b > 100 || c < 1 || c > 100) return "No";
		if(a != c || b != c) return "No";
		
		if(a + b > c && a + c > b && b + c > a) return "Yes";
		else return "No";
	}
	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// get integers
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		
		Main obj = new Main();
		
		System.out.println(obj.judgeTriangle(a, b, c));
	}
}


Measured memory_bytes: 23764
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define repr(i, n) for (int i = (int)n - 1; i >= 0; --i)
#define ALL(a) (a).begin(), (a).end()
using ll = long long;
using Graph = vector<vector<int>>;
const ll MOD = 1e9 + 7;
const ll INF = 1e9;
const ll LINF = 1LL << 60;

int main() {
  ll x, sum = 100, ans = 0;
  cin >> x;
  while (sum < x) {
    ans++;
    sum *= 1.01;
  }
  cout << ans << endl;
  return 0;
}


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

#define ll long long

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

inline void chkmin( int &a, int b ) { if(a > b) a = b; }

inline void chkmax( int &a, int b ) { if(a < b) a = b; }

#define _ read()

#define ln endl

int main()
{
	int n = _;
	for( int i = 1; i <= 9; i++ ) 
		if(n % i == 0 && n / i <= 9)
			return puts("Yes"), 0;
	puts("No");
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define inf 0x7fffffff
#define eps 1e-6
using namespace std;
typedef long long ll;
const ll mod = 998244353;
//const double pi = acos(-1);
inline ll read(){
    ll x=0,f=1;char ch=getchar();
    while(ch>'9'||ch<'0'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
int n,p;
int num[5];
int main(){
    int i,j;
    n=read();
    char ch[5];
    while(n--){
    	scanf("%s",ch+1);
    	if(ch[1]=='A') num[0]++;
    	if(ch[1]=='W') num[1]++;
    	if(ch[1]=='T') num[2]++;
    	if(ch[1]=='R') num[3]++;
    }
    printf("AC x %d\n",num[0]);
    printf("WA x %d\n",num[1]);
    printf("TLE x %d\n",num[2]);
    printf("RE x %d\n",num[3]);
    return 0;
}

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

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"

using namespace std;
using ll = long long;

const ll MOD = 1000000007LL; // = 10^9 + 7
const double PI = 3.14159265358979;

// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}


void solve()
{
	int n, m, input;
	cin >> n >> m;
	vector<bool> a(n, true);
	for(int i = 0; i < m; ++i)
	{
		cin >> input;
		a[input] = false;
	}

	vector<mint> dp(n + 1, 0);
	dp[0] = 1;
	dp[1] = a[1] ? 1 : 0;
	for(int i = 2; i <= n; ++i)
	{
		if(a[i]) dp[i] = dp[i-2] + dp[i-1];
	}
	cout << dp[n];
}

int main()
{
	fastio;
	solve();

	return 0;
}

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

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

int main()
{
  int cash, book[9], i;

  while (cin >> cash, cash){
    REP(i, 9){
      cin >> book[i];
      cash -= book[i];
    }
    cout << cash << endl;
  }
}

Measured memory_bytes: 1160
const main = (N,A,B) =>  {
    count = 0
    for(var i = 0;i<N;i++) {
        diff = Math.min(A[i],B[i])
        count+=diff
        A[i] -= diff
        B[i] -= diff
        diff = Math.min(A[i+1],B[i])
        count+=diff
        A[i+1] -= diff
        B[i] -= diff
    }

    return count 

}


const input = require('fs').readFileSync('/dev/stdin','utf8').split("\n")
const N = Number(input[0])
const A = input[1].split(" ").map( x => Number(x))
const B = input[2].split(" ").map(x => Number(x))
console.log(main(N,A,B))

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

int main() {
  int N, Q;
  cin >> N >> Q;
  vector<vector<int>> G(N);
  for (int i = 0; i < N - 1; i++) {
    int a, b;
    cin >> a >> b;
    a--, b--;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  vector<int> C(N);
  for (int i = 0; i < Q; i++) {
    int p, x;
    cin >> p >> x;
    p--;
    C[p] += x;
  }
  vector<bool> visited(N);
  vector<int> ans(N);
  queue<pair<int, int>> que;
  que.push(make_pair(0, 0));
  while (!que.empty()) {
    int node = que.front().first;
    int cost = que.front().second;
    que.pop();
    ans[node] = cost + C[node];
    visited[node] = true;
    for (int i = 0; i < G[node].size(); i++) {
      if (!visited[G[node][i]]) {
        que.push(make_pair(G[node][i], ans[node]));
      }
    }
  }
  for (int i = 0; i < N; i++) cout << ans[i] << " ";
  cout << endl;
}


Measured memory_bytes: 17140
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()



int main() {
  ll a, b, cnt = 0;
  cin >> a >> b;
  while (a <= b) {
    a *= 2;
    cnt++;
  }
  cout << cnt << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
//#include <atcoder/all>
using namespace std;
//using namespace atcoder;
#define ll long long
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define rep1(i, n) FOR(i, 1, n+1)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; --i)
#define whole(x) (x).begin(),(x).end()
#define rwhole(x) (x).rbegin(), (x).rend()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
#define P pair<int, int>
#define debug(var) cerr << "[" << #var << "] " << var << endl
template<typename T1, typename T2>
bool chmax(T1 &a,T2 b){if(a<b){a=b;return true;}else return false;}
template<typename T1, typename T2>
bool chmin(T1 &a,T2 b){if(a>b){a=b;return true;}else return false;}
#define vi vector<int>
#define vl vector<ll>
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define pr(s) cout << (s) << '\n'
const ll mod = 1000000007;
const int dx[] = {-1,0,1,0};
const int dy[] = {0,-1,0,1};
const int INF = 1001001001;
const ll INFll = 1E+18;


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n, q;
    cin >> n >> q;
    ll ans = (ll)(n-2)*(n-2);
    int nx = n-1;
    int ny = n-1;
    vector<int> ix(n-1, -1);
    vector<int> iy(n-1, -1);
    rep(qi, q) {
        int id, x;
        cin >> id >> x;
        x--;
        if (id==2) {
            swap(nx, ny);
            swap(ix, iy);
        }
        for (int i=x; i<ny; i++) {
            iy[i] = nx;
        }
        ans -= iy[x] - 1;
        chmin(ny, x);
        
        if (id==2) {
            swap(nx, ny);
            swap(ix, iy);
        }
    }
    
    
    pr(ans);
    return 0;
}


Measured memory_bytes: 4724
#include <bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
 
#define pi 3.1415926535

int main()
{
  int d, t, s;

  cin >> d >> t >> s;

  if(t * s >= d){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }

  return 0; 
}

Measured memory_bytes: 3632
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

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

        int n = sc.nextInt();
        String a = sc.next();
        String b = sc.next();
        String c = sc.next();

        int total = 0;

        for (int i = 0; i < n; i++) {
            if (a.charAt(i) == b.charAt(i) && b.charAt(i) == c.charAt(i)) {
                ;
            } else if (a.charAt(i) != b.charAt(i) && b.charAt(i) != c.charAt(i) && a.charAt(i) != c.charAt(i)) {
                total = total + 2;
            } else {
                total++;
            }
        }

        System.out.println(total);


    }

}







Measured memory_bytes: 22996
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef pair<int, int> P;
typedef long long ll;
int main(){
    int n;
    int m;
    cin >> n;
    cin >> m;
    vector<int> a(n,-1);
    rep(i,m){
        int s,c;
        cin >> s >> c;
        if(a[s-1]<0){
            a[s-1] = c;
        }
        else{
            if(a[s-1]!=c){
                cout << -1 << endl;
                return 0;
            }
        }
    }
    if(n==1 && a[0]<=0){
        cout << 0 << endl;
        return 0;
    }
    if(a[0]==0){
        cout << -1 << endl;
        return 0;
    }
    if(a[0]==-1){
        a[0] = 1;
    }
    for(int i = 1;i<n;i++){
        if(a[i]<0){
            a[i] = 0;
        }
    }
    rep(i,n){
        cout << a[i];
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
#include <iomanip>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<long double> VD;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef vector<VD> VVD;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

template<typename T> void chmin(T &a, T b) { if (a > b) a = b; }
template<typename T> void chmax(T &a, T b) { if (a < b) a = b; }

int in() { int x; scanf("%d", &x); return x; }
ll lin() { ll x; scanf("%lld", &x); return x; }
#define INF 1LL<<60

int timestamp = 1;

void dfs(int from, vector< vector<int> >& edges, vector<int>& d, vector<int>& f) {
    if(d[from] > 0) return;
    d[from] = timestamp++;
    for(int next: edges[from]) {
        if(d[next] == 0)
            dfs(next, edges, d, f);
    }
    f[from] = timestamp++;
}

int main() {
    int N;
    cin >> N;
    vector<vector<int> > edges(N+1);
    REP(i, N) {
        int u, k;
        cin >> u >> k;
        edges[u].resize(k);
        REP(j, k) cin >> edges[u][j];
        sort(ALL(edges[u]));
    }

    vector<int> d(N+1), f(N+1);
    FOR(i, 1, N)
        dfs(i, edges, d, f);
    FOR(i, 1, N) {
        cout << i << " " << d[i] << " " << f[i] << endl;
    }
    return 0;
}


Measured memory_bytes: 3104
#include<stdio.h>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<vector>
#define ll long long
#define inf 0x3f3f3f3f
#define maxn 200005
using namespace std;
int N;
vector<int>G1[maxn],G2[maxn];
int v1[maxn],v2[maxn],fa1[maxn],fa2[maxn];
int rt1,rt2;
int Last[maxn],Next[maxn],End[maxn],o;
int st[maxn],top,num[maxn];
bool vis[maxn];
void ins(int a,int b){
	Next[++o]=Last[a],Last[a]=o;
	End[o]=b;
}
void inss(int a,int b){
	ins(a,b),ins(b,a);
}
void dfs1(int u){
	for(int i=0,v;i<G1[u].size();++i){
		v=G1[u][i];
		dfs1(v);
	}
	if(v1[u])st[++top]=u;
	while(top>=2){
		inss(st[top],st[top-1]);
		top-=2;
	}
}
void dfs2(int u){
	for(int i=0,v;i<G2[u].size();++i){
		v=G2[u][i];
		dfs2(v);
	}
	if(v2[u])st[++top]=u;
	while(top>=2){
		inss(st[top],st[top-1]);
		top-=2;
	}
}
void dfs(int u,int val){
	vis[u]=1,num[u]=val;
	for(int i=Last[u],v;i;i=Next[i]){
		v=End[i];
		if(!vis[v])dfs(v,-val);
	}
}
int main(){
	scanf("%d",&N);
	for(int i=1;i<=N;++i)v1[i]=v2[i]=1;
	for(int i=1;i<=N;++i){
		scanf("%d",&fa1[i]);
		if(fa1[i]==-1)rt1=i;
		else G1[fa1[i]].push_back(i),v1[fa1[i]]^=1;
	}
	for(int i=1;i<=N;++i){
		scanf("%d",&fa2[i]);
		if(fa2[i]==-1)rt2=i;
		else G2[fa2[i]].push_back(i),v2[fa2[i]]^=1;
	}
	for(int i=1;i<=N;++i){
		if(v1[i]!=v2[i]){
			puts("IMPOSSIBLE");
			return 0;
		}
	}
	puts("POSSIBLE");
	top=0,dfs1(rt1);
	top=0,dfs2(rt2);
	for(int i=1;i<=N;++i){
		if(!vis[i])dfs(i,1);
	}
	for(int i=1;i<=N;++i){
		if(!v1[i])printf("0 ");
		else printf("%d ",num[i]);
	}
	return 0;
}

Measured memory_bytes: 20736
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <time.h>
#include <vector>

using namespace std;
typedef long long ll;
template <class T = ll>
T in() {
    T x;
    cin >> x;
    return (x);
}
template <class T>
void print(T &x) {
    cout << x << "\n";
}
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define reps(x, c) for (auto x : c)
#define all(x) begin(x), end(x)
#define pb(a) emplace_back(a)
#define mp(a, b) make_pair((a), (b))
#define pl pair<ll, ll>
#define INF 2147483600
#define MOD 1000000007
#define fi first
#define se second
#define dbg(x) cerr << #x "=" << (x) << "\n"
#define dbgv(x) \
    cerr << #x << "\n"; \
    reps(y, x) { cerr << y << " "; } \
    cerr << "\n"

int main() {
    int y, m, d;
    scanf("%d/%d/%d", &y, &m, &d);
    if (m <= 4) {
        print("Heisei");
    }
    else {
        print("TBD");
    }
    return 0;
}

Measured memory_bytes: 760
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define P pair<int,int>
using ll=int64_t;
using namespace std;
#define ketasuu(n) fixed<<setprecision(n)
#define btoe(p) p.begin(),p.end()
#define etob(p) p.rbegin(),p.rend()




int main(){
    int n,t;
    cin>>n>>t;
    int ans=100000;
    rep(i,n){
        int a,b;
        cin>>a>>b;
        if(b<=t) ans=min(ans,a);
    }
    if(ans==100000) cout<<"TLE"<<endl;
    else cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
using namespace std;
#define ll long long

ll n;

int zs(ll x)
{
	if(x==1) return 0;
	for(ll i=2;i*i<=x;i++)
		if(x%i==0) return 0;
	return 1;
}

int f(int n)
{
	int sum=0;
	while(n)
		n/=10,sum++;
	return sum;
}

int main()
{
	cin>>n;
	if(zs(n)) {
		int ans=f(n);
		cout<<ans<<endl;
		return 0;
	}
	for(int i=sqrt(n);i>=1;i--)
		if(n%i==0) {
			cout<<max(f(i),f(n/i))<<endl;
			return 0;
		}
	return 0;
}

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

int main() {
	int h, w, n;
	cin >> h >> w >> n;
	int grid[110][110], a[1000000];
	for (int i = 0;i < n;i++)cin >> a[i];
	int now = 0, hh = 0, ww = 0;
	while (now < n) {
		if (a[now] == 0) {
			now++;
			continue;
		}
		if (hh % 2 == 0) {
			grid[hh][ww] = now + 1;
		}
		else {
			grid[hh][w - ww - 1] = now + 1;
		}
		a[now]--;
		ww++;
		if (ww == w) {
			hh++;
			ww = 0;
		}
	}
	for (int i = 0;i < h;i++) {
		for (int j = 0;j < w;j++) {
			cout << grid[i][j] << ' ';
		}
		cout << endl;
	}
}

Measured memory_bytes: 2304
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define zero_pad(num) setfill('0') << std::right << setw(num)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;

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

	map<char, char> m1, m2;
	for (char c = 'a'; c <= 'z'; c++) {
		m1[c] = c;
		m2[c] = c;
	}

	rep(i, s.size()) {
		m1[s[i]] = t[i];
		m2[t[i]] = s[i];
	}

	rep(i, s.size()) {
		if (m1[s[i]] != t[i] || m2[t[i]] != s[i]) {
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
}

Measured memory_bytes: 776
/*Bismillahir Rahmanir Rahim*///{
#include <bits/stdc++.h>
#include <ext/numeric>
using namespace std; using __gnu_cxx::power;
using ll = long long; using ull = unsigned long long; using ld = long double;
const ll llinf = (1ll<<61)-1; const double eps = 1e-6, ldeps = 1e-9;
struct Dbg { static constexpr auto &os = cout;   // replace by cerr in interactive.
template<class C> static auto dud(C *x)->decltype(os << *x, 0);
template<class C> static char dud(...);
template<class C> typename enable_if<sizeof dud<C>(0)!=1,Dbg&>::type operator<<(const C &x) {os<<x; return *this;}
template<class C> Dbg &dump(C b, C e) {
    for (struct{C i;int j;} i={(*this<<"\n[",b),0}; i.i!=e and i.j<26; i.i++, i.j++) *this<<", "+2*(i.i==b)<<*i.i;
    return *this << ']';
}
template<class C> typename enable_if<sizeof dud<C>(0)==1, Dbg&>::type operator<<(const C &x) {
    return dump(begin(x), end(x));
}
template<class C, size_t X> typename enable_if<!is_same<C, const char>::value, Dbg&>::type operator<<(C (&x)[X]) {
    return dump(begin(x), end(x));
}
template<class B, class C> Dbg &operator<<(const pair<B, C> &x) {return *this<<'{'<<x.first<<", "<<x.second<<'}';}
Dbg &operator<<(ostream&(*x)(std::ostream&)) { os << x; return *this; }
} dbg;
void err(istringstream *iss) { delete iss; }
template<class C, class... Args> void err(istringstream *iss, const C &val, const Args &... args) {
    string name; *iss >> name; if (name.back()==',') name.pop_back();
    dbg << name << " = " << val << "; ", err(iss, args...);
}
#define bug(args...) dbg << __LINE__ << ": ", err(new istringstream(#args), args), dbg << endl
#define cbug(a, args...) if (a) bug(args);
#define ASSERT(a, o, b, args...) if (!((a)o(b))) bug(a, b, ##args), assert((a)o(b));
#define sl(a) int(strlen(a))
#define sz(a) int(a.size())
int T, Q, cn;//}
const int inf = 1000000007, mxn = -1;

signed main() { cin.tie(0)->sync_with_stdio(0); cin.exceptions(cin.failbit); cout.precision(11), cout.setf(ios::fixed);
    ll a;
    char s[10];
    cin >> a >> s;
    int n = sl(s), b = 0;
    for (int i = 0; i < n; i++) {
        if (s[i] != '.') b = b*10+(s[i]-'0');
    }
    cout << (a*b)/100 << '\n';
}

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

int main(){
	cin.tie(0),ios::sync_with_stdio(false);
	int n,t; cin>>n>>t;
	int ans=1e9;
	for(int i=0;i<n;++i){
		int C,T; cin>>C>>T;
		if(T<=t)ans=min(ans,C);
	}
	if(ans==1e9)cout<<"TLE"s;
	else cout<<ans;
	cout<<"\n"s;
}

Measured memory_bytes: 256
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    
    if(b-a == c-b){
      System.out.println("YES");
    }else{
      System.out.println("NO");
    }
    
  }
}

Measured memory_bytes: 21844
#include <iostream>
using namespace std;
#define MAX 100000
#define MAX_ 50000

void merge_sort(int x[],int left,int right){
    int mid,i,j;
    int temp[MAX];
    
    if(left >= right)
        return;
    
    mid = (left + right) / 2;
    merge_sort(x, left ,mid);
    merge_sort(x, mid + 1,right);
    
    for(int i = left;i <= mid; i++){
        temp[i] = x[i];
    }
    
    for(int i = mid + 1,j = right; i <= right; i++,j--){
        temp[i] = x[j];
    }
    
    i = left;
    j = right;
    
    for(int k = left; k <= right; k++){
        if(temp[i] <= temp[j]) x[k] = temp[i++];
        else x[k] = temp[j--];
    }
}


int main(){
    int n,S[MAX],q,T[MAX_],cnt=0;
    
    cin >> n;
    for(int i = 0;i < n; i++) cin >> S[i];
    
    cin >> q;
    for(int j = 0;j < q; j++) cin >> T[j];
    
    merge_sort(S, 0, n-1);
    merge_sort(T, 0, q-1);
    
    
    for(int i = 0,j = 0;i < n && j < q ; ){
        if(S[i]==T[j]) cnt++,i++,j++;
        else if(S[i] < T[j]) i++;
        else if(S[i] > T[j]) j++;
        
    }
    
    cout << cnt << endl;
    
    return 0;
}

Measured memory_bytes: 8384
#include <iostream>
#include <algorithm>
#include <string>
#include <map>
 
using namespace std;
 
typedef long long ll;
 
int mod;
int sub(int i, int j) { return ((i -= j) < 0 ? i += mod : i); }
int add(int i, int j) { return ((i += j) < mod ? i : i -= mod); }
int mult(int i, int j) { return (ll) i * j % mod; }
 
int A[200000];
int box[100000];
 
int main() {
    cin.tie(NULL) -> sync_with_stdio(false);
    int n; cin >> n >> mod;
    string line; cin >> line;
    reverse(line.begin(), line.end());
    for(char& c : line)
        c -= 48;
    
    if(mod == 2 || mod == 5) {
        ll mx = 0;
        for(int i = 0; i < n; ++i)
            if(line[i] % mod == 0)
                mx += n - i;
                
        cout << mx;
        return 0;
    }
     
    int r = 1;
    A[0] = line[0] % mod;
    for(int i = 1; i < n; ++i) {
        r = mult(r, 10);
        A[i] = add(mult(r, line[i]), A[i - 1]);
    }
    
    for(int i = 0; i < n; ++i)
        box[A[i]] += 1;
    
    int rx = 0;
    r = 1;
    ll res = box[0];
    for(int i = 0; i < mod; ++i)
        res += (ll) box[i] * (box[i] - 1) / 2;
    
    cout << res;
    return 0;
}

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

int main(){
  int n, len;
  cin >> n;
  int x[n];
  rep(i,n) cin >> x[i];
  cin >> len;
  int p = 1;
  int s = 0;
  while(p <= n) {
    p *= 2;
    s++;
  }
  vector<vector<int>> dp(n+1,vector<int>(s));
  rep(i,n) {
    int c = upper_bound(x,x+n,x[i]+len) - x;
    dp[i][0] = c-1;
  }
  rep(i,s) dp[n][i] = n;
  for(int i = 1; i < s; i++) {
    rep(j,n) {
      dp[j][i] = dp[dp[j][i-1]][i-1];
    } 
  }
  int q;
  cin >> q;
  int ans[q];
  rep(i,q) {
    int a, b;
    cin >> a >> b;
    a--; b--;
    if(a > b) swap(a,b);
    int l = 0, r = n;
    while(r - l > 1) {
      int m = (l + r) / 2;
      int p = a;
      rep(k,s) {
        if(m & (1<<k)) {
          p = dp[p][k];
        }
      }
      if(p >= b) r = m;
      else l = m;
    }
    ans[i] = r;
  }
  for(auto x : ans) cout << x << endl;
  return 0;
}

Measured memory_bytes: 11776
import java.util.*;

public class Main {
	public static void main(String args[]){
		HashMap<Integer,Integer> ticket = new HashMap<Integer,Integer>();
		ticket.put(1,6000);
		ticket.put(2,4000);
		ticket.put(3,3000);
		ticket.put(4,2000);
		Scanner sc = new Scanner(System.in);
		for(int i=0;i<4;i++){
			System.out.println(ticket.get(sc.nextInt())*sc.nextInt());
		}
	}
}

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

int main(){
  string s;
  cin>>s;
  if((s[0]==s[1])&&(s[1]==s[2])&&(s[2]==s[3]))cout<<"No";
  else if((s[0]==s[1] && s[2]==s[3])||(s[0]==s[2] && s[1]==s[3])||(s[0]==s[3] && s[1]==s[2]))cout<<"Yes";
  else cout<<"No";
}


Measured memory_bytes: 256
N,M,C = map(int,input().split())
B = list(map(int,input().split()))
A = [0]*N
for i in range(N):
    A[i] = list(map(int,input().split()))

ans = 0
for i in range(N):
    s = C
    for j in range(M):
        s += A[i][j]*B[j]
    if s>0:
        ans += 1
print(ans)

Measured memory_bytes: 3064
#include <iostream> 
using namespace std; 
typedef long long int ll;
const ll mod = 1e9 + 7;

ll mul_inv(ll a, ll b = mod) {
	ll t1 = a, t2 = b, t3;
	ll v1 = 1, v2 = 0, v3;
	while (t2 != 1) {
		ll x = t1 / t2;
		t3 = t1 - x*t2;
		v3 = v1 - x*v2;
		t1 = t2, t2 = t3;
		v1 = v2, v2 = v3;
	}
	return (v2 + b) % b;
}
// required function 
ll findProductSum(ll A[], int n) 
{ 
    // calculating array sum (a1 + a2  ... + an) 
    ll array_sum = 0; 
    for (int i = 0; i < n; i++) 
        array_sum = (array_sum + A[i]) % mod; 
  
    // calcualting square of array sum 
    // (a1 + a2 + ... + an)^2 
    ll array_sum_square = (array_sum * array_sum) % mod; 
    
  
    // calcualting a1^2 + a2^2 + ... + an^2 
    ll individual_square_sum = 0; 
    for (int i = 0; i < n; i++) 
        individual_square_sum = (individual_square_sum + A[i]*A[i]) % mod; 
  
    // required sum is (array_sum_square - 
    // individual_square_sum) / 2 
    ll ans = 0;
    if(array_sum_square - individual_square_sum < 0) ans = array_sum_square - individual_square_sum + mod; 
    else ans = array_sum_square - individual_square_sum;
    ans = ans * mul_inv(2ll,mod);
    ans %=mod;
    if(ans < 0) ans += mod;
    return ans;
} 
  
// Driver code 
int main() 
{ 
	int n;
	cin >> n;
    ll A[n];
    for(int i = 0; i <n; i++) cin >> A[i];
    cout << (findProductSum(A,n));
    return 0; 
} 

Measured memory_bytes: 5184
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<math.h>


using namespace std;
#define out(s) cout<<(s)<<endl;
using ll = long long;

ll result=0;
string S;
void search(ll current, int index,ll sum) {
	if (index==S.size()-1)
	{
		current = current * 10 + S[index] - '0';
		sum += current;
		result += sum;
		return;
	}
	current= current * 10 + S[index] - '0';
	search(current, index + 1, sum);
	search(0, index + 1, sum + current);
}

int main()
{
	cin >> S;
	search(0, 0, 0);
	out(result);
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;cin>>n;
vector<int> arr(n);
for(int i=0;i<n;++i)cin>>arr[i];
int result = 0;
int tmp = 0;
for(int i=0;i<n-1;++i){
	if(arr[i]>=arr[i+1]){
		tmp++;
		result = max(tmp,result);
	}else{
		tmp=0;
	}
}
cout<<result<<endl;
return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define lp(i, x, n) for (int i = x; i < (int)n; ++i)
#define all(v) (v).begin(), (v).end()
#define sz(v) (int)(v).size()
#define ll long long
#define N 123451

int h, w;
ll bst = 1e18;

int main() {
        cin >> h>> w;
        for (ll j = 0; j < 2; j++) {
                for (ll i = 1; i < h; i++) {
                        ll h1 = (h - i) / 2;
                        ll h2 = ceil((h - i)*1.0 / 2.0);
                        ll mnn = min(h1, min(h2, i*1ll)) * w;
                        ll mxx = max(h1, max(h2, i*1ll)) * w;

                        bst = min(bst, mxx - mnn);
                }
                swap(h, w);
        }
        for (ll j = 0; j < 2; j++) {
                for (ll i = 1; i < h; i++) {
                        ll h1 = (h - i);
                        ll w1 = w / 2;
                        ll w2 = ceil(w*1.0 / 2*1.0);
                        ll mnn = min((i * w * 1ll), min(h1 * w1, h1 * w2));
                        ll mxx = max((i * w * 1ll), max(h1 * w1, h1 * w2));
                        bst = min(bst, mxx - mnn);
                }
                swap(h, w);
        }
        cout << bst;
        return 0;
}


/*
long long
constrain N
*/


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

using namespace std;

int main() {
	int n;
	double k;
	int a[6] = {0};
	
	cin >> n;

	for (int i = 0; i < n; i++) {
		cin >> k;
		if (k < 165.0) {
			a[0]++;
		} else if (k < 170.0) {
			a[1]++;
		} else if (k < 175.0) {
			a[2]++;
		} else if (k < 180.0) {
			a[3]++;
		} else if (k < 185.0) {
			a[4]++;
		} else {
			a[5]++;
		}
	}

	for (int i = 0; i < 6; i++) {
		cout << i+1 << ":";
		for (int j = 0; j < a[i]; j++) {
			cout << "*";
		}
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 1232
#include<iostream>
using namespace std;
int main(){
    int n;
    cin>>n;
    int cnt=0;
    for(int i=1;i<=n;i++){
        int a,b;
        cin>>a>>b;
        if(a==b)
            cnt++;
        else
        {
            cnt=0;
        }
        
        if(cnt==3)
            return cout<<"Yes",0;
        
    }
    return cout<<"No",0;
}

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

int main() {
	int A, B;
	cin >> A >> B;
	int s[3];
	s[0] = A + B; s[1] = A - B; s[2] = A * B;
	sort(s, s + 3);
	cout << s[2] << endl;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<climits>
#include<iostream>
#include<sstream>
#include<utility>
#include<map>
#include<vector>
#include<queue>
#include<algorithm>
#include<set>
#include<stack>
using namespace std;
typedef long long ll;
typedef pair<int,int>P;
int H,W;
vector<string> S;

bool ch(int h,int w)
{
	bool wf=false,hf=false;
	for(int i=0;i<H;i++)
		if(S[i][w]=='#')
			hf=true;
	for(int i=0;i<W;i++)
		if(S[h][i]=='#')
			wf=true;
	return hf&&wf;
}

int main()
{
	cin>>H>>W;
	for(int i=0;i<H;i++)
	{
		string ss;
		cin>>ss;
		S.push_back(ss);
	}

	for(int i=0;i<H;i++)
	{
		bool br=false;
		for(int j=0;j<W;j++)
		{
			if(ch(i,j))
			{
				putchar(S[i][j]);
				br=true;
			}
		}
		if(br)
			puts("");
	}
}


Measured memory_bytes: 256
main :: IO()
main = do
    s <- getLine
    let f = read $ take 2 s
    let b = read $ drop 2 s
    if 1 <= f && f <=12
        then do
            if 1 <= b && b <= 12
                then do
                    putStr "AMBIGUOUS"
            else do
                putStr "MMYY"
    else do
        if 1 <= b && b <= 12
            then do
                putStr "YYMM"
        else do
            putStr "NA"

Measured memory_bytes: 508
/*

                              Jai Shree Krishna !!
                                 Radhe Radhe !!
                                 
             उद्यमेन हि सिद्ध्यन्ति कार्याणि न मनोरथैः। नहि सुप्तस्य सिंहस्य मुखे प्रविशन्ति मृगाः।।
             
*/
   
   
#include <bits/stdc++.h>
using namespace std;
 
#define int long long
typedef long long ll;
#define loop(i,n)  for(int i=0;i<n;i++)
#define read(a) int a; cin >>a;
#define readarr(a,n) int a[n] ; for(int i=0;i<n;i++) cin >> a[i];
#define readmat(a,n,m) int a[n][m]; for(int i=0;i<n;i++) for(int j=0;j<m;j++) cin >> a[i][j];
#define pb push_back
#define ff first
#define ss second
#define vi vector<int>
#define pi pair<int,int>
#define vvi vector<vector<int>>
#define sti set<int>
#define vpi vector<pair<int,int>>
#define print(a,n) for(int i=0;i<n;i++) cout<<a[i]<<" "; cout<<endl;
#define printmat(a,n,m) for(int i=0;i<n;i++) {for(int j=0;j<m;j++) cout<<a[i][j]<<" "; cout<<endl;}
#define fast ios_base::sync_with_stdio(false);  cin.tie(NULL);
#define endl "\n"
#define mp make_pair
#define ins insert
#define rep(i,s,e) int i; for(int i=s;i<=e;i++)
#define repd(i,s,e) int i; for(int i=e;i>=s;i--)
#define vb vector<bool>
#define read2(n,m) int n,m; cin >> n >> m;
#define range(v) v.begin(),v.end()
#define sortd(v) sort(v.begin(),v.end(),greater<int>())
#define sorti(v) sort(v.begin(),v.end())

const ll inf = 1e18;
const ll mod = 1e9 + 7;
 
 


signed main()
{
 
    fast;
    read(n);
    if(n%2==1) cout<<0<<endl;
    else
    {
    	int s=0,x=n,f=n,d=0,r=10;
    	while(r<=n){
    		x=n/r;
    		s+=x;
    		r*=5;
    	}
    	r=2;
    	while(n/r!=0){
    		x=n/r;
    		d+=x;
    		r*=2;
    	}
    	
    	int k=0;
    	r=10;
    	while(n/r!=0){
    		x=n/r;
    		k+=x;
    		r*=10;
    	}
    	
    	 cout<<s<<endl;
    	
    }
    return 0;
}

/* Pooja Yadav */

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
typedef long long LL;
int N,C;
int s[100001];
int t[100001];
int c[100001];
typedef pair<int,int> P;
vector<int>v[100001];
bool used[100001];

int ti[70];
int num[70];

bool check(int x){
     REP(i,x){
         ti[i]=-1;
         num[i]=-1;
     }
     
     REP(i,100001){
         REP(j,v[i].size()){
             used[j]=false;
         }
         REP(j,v[i].size()){
             REP(k,x){
                 int now=v[i][j];
                 if(num[k]==c[now]){
                    ti[k]=t[now];
                    used[j]=true;
                    break;
                 }
             }
         }
         REP(j,v[i].size()){
             if(used[j]==false){
                bool check=false;
                REP(k,x){
                    int now=v[i][j];
                    if(ti[k]<s[now]){
                       ti[k]=t[now];
                       num[k]=c[now];
                       used[j]=true;
                       check=true;
                       break;
                    }
                }
                if(check==false)return false;
             }
         }
     }
     return true;
     /*
     
     
     REP(i,N){
         bool cc=false;
         int ss=v[i].first;
         int ind=v[i].second;
         int cha=c[ind];
         int tt=t[ind];
         //同じ番組
         REP(j,x){
            if(num[j]==cha){
               ti[j]=tt;
               cc=true;
               break;
            } 
         }
         
         if(cc==false){
            REP(j,x){
               if(ti[j]<ss){
                  ti[j]=tt;
                  num[j]=cha;
                  cc=true;
                  break;
               }
            }
         }
         /* cout<<"-----------"<<endl;
         REP(j,x){
             cout<<ti[j]<<endl;
         }
                  cout<<"-----------"<<endl;
         
         if(cc==false)return false;
     }
     return true;
     */
}

int binary_search(){
    int lb=0;
    int ub=61;
    while(ub-lb>1){
       int mid=(ub+lb)/2;
       if(check(mid)){
          ub=mid;
       }else{
          lb=mid;
       }
    }
    return ub;
}

int main(){
    cin>>N>>C;
    REP(i,N){
        cin>>s[i]>>t[i]>>c[i];
        v[s[i]].push_back(i);
    }
    //sort(v.begin(),v.end());
   // check(5);
    cout<<binary_search()<<endl;
    
    return(0);
}

Measured memory_bytes: 6912
#include<iostream>
#include<cstdio>
using namespace std;
int main(){
  int n,k;
  cin >> n >> k;
  char tmp;
  for(int i=0;i<n;i++){
    cin >> tmp;
   if(i==k-1){ switch(tmp){
      case 'A': tmp='a'; break;
      case 'B': tmp='b'; break;
      case 'C': tmp='c'; break;
    }
   }
    printf("%c",tmp);
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define IREP(i, n) IFOR(i,0,n)
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define all(v) v.begin(),v.end()
#define SZ(v) ((int)v.size())
#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))
#define Max(a, b) a = max(a, b)
#define Min(a, b) a = min(a, b)
#define bit(n) (1LL<<(n))
#define bit_exist(x, n) ((x >> n) & 1)
#define debug(x) cout << #x << "=" << x << endl;
#define vdebug(v) cout << #v << "=" << endl; REP(i_debug, v.size()){ cout << v[i_debug] << ","; } cout << endl;
#define mdebug(m) cout << #m << "=" << endl; REP(i_debug, m.size()){ REP(j_debug, m[i_debug].size()){ cout << m[i_debug][j_debug] << ","; } cout << endl;}
#define pb push_back
#define f first
#define s second
#define int long long
#define INF 1000000000000000000
template<typename T> istream &operator>>(istream &is, vector<T> &v){ for (auto &x : v) is >> x; return is; }
template<typename T> ostream &operator<<(ostream &os, vector<T> &v){ for(int i = 0; i < v.size(); i++) { cout << v[i]; if(i != v.size() - 1) cout << endl; }; return os; }
template<typename T> void Out(T x) { cout << x << endl; }
template<typename T1, typename T2> void Ans(bool f, T1 y, T2 n) { if(f) Out(y); else Out(n); }

using vec = vector<int>;
using mat = vector<vec>;
using Pii = pair<int, int>;
using PiP = pair<int, Pii>;
using PPi = pair<Pii, int>;
using bools = vector<bool>;
using pairs = vector<Pii>;

//int dx[4] = {1,0,-1,0};
//int dy[4] = {0,1,0,-1};
//char d[4] = {'D','R','U','L'};

const int mod = 1000000007;
//const int mod = 998244353;
#define Add(x, y) x = (x + (y)) % mod
#define Mult(x, y) x = (x * (y)) % mod

int calcans(int N, vector<string> &a){
    int n = 0, m = 0;
    REP(i, N){
        int cnt = 0;
        REP(j, N) if(a[i][j] == '#') cnt++;
        if(cnt == N) n++;
    }
    REP(j, N){
        int cnt = 0;
        REP(i, N) if(a[i][j] == '#') cnt++;
        if(cnt == N) m++;
    }
    if(n) return N - m;

    int ans = INF;
    REP(i, N){
        bool f = false;
        int tmp = 0;
        REP(j, N) if(a[j][i] == '#') f = true;
        
        if(!f) tmp = 1;
        REP(j, N) if(a[i][j] == '.') tmp++;
        Min(ans, N + tmp - m);
    }
    return ans;
}

signed main(){

    int N; cin >> N;
    vector<string> a(N); cin >> a;

    bool f = false;
    REP(i, N) REP(j, N) if(a[i][j] == '#') f = true;
    if(!f){
        Out(-1);
        return 0;
    }

    int ans = calcans(N, a);
    Out(ans);

    return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;

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

#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)

#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()

const int MOD = 1000000007;
const ll INF = 1e18;
const int MX = 100001; //check the limits, dummy

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

    string S; cin >> S;
    int counts[26]; F0R(i, 26) counts[i] = 0;
    F0R(i, 4) {
        counts[S[i]-'A']++;
    }
    int sum = 0;
    F0R(i, 26) {
        if (counts[i] == 2) sum++;
    }

    string ans = sum == 2 ? "Yes" : "No";
    cout << ans << endl;

    return 0;
}

// read the question correctly (ll vs int)
// template by bqi343

Measured memory_bytes: 256
//競技プログラミング用のテンプレート
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <string>
#include <math.h>
#include <stack>

#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define repr(i, n) for(int i = n - 1; i >= 0; i--)

using namespace std;
using ll = long long int;
using p = pair<int, int>;
using pl = pair<ll, ll>;
using v = vector<int>;
using vd = vector<double>;
using vs = vector<string>;
using vl = vector<ll>;


template <typename number>
pair<number, number> extended_euclid(number a, number b)
{
  number r0, r1, a0, a1, b0, b1;
  r0 = a; r1 = b;
  a0 = 1; a1 = 0;
  b0 = 0; b1 = 1;
  while (r1>0) {
    number q1 = r0 / r1;
    number r2 = r0 % r1;
    number a2 = a0 - q1 * a1;
    number b2 = b0 - q1 * b1;
    r0 = r1 ; r1 = r2;
    a0 = a1 ; a1 = a2;
    b0 = b1 ; b1 = b2;
  }
  number c = r0;
  a = a0; //x
  b = b0; //y
  return  {a, c};
}

int main()
{
  int k;
  cin >> k;
  ll result = 0;
  for(int i = 1; i <= k; i++)
  {
    for(int j = 1; j <= k; j++)
    {
      for(int l = 1; l <= k; l++)
      {
        if(i == 1 || j == 1 || l == 1){
          result++;
        }else{
          int temp = extended_euclid(i, j).second;
          temp = extended_euclid(temp, l).second;
          result += temp;
        }
      }
    }
  }
  cout << result << endl;
}


Measured memory_bytes: 3624
program therefore
  implicit none
  integer :: n
  read(*,*) n
  select case(mod(n,10))
  case (3)
    write(*,'(a)') 'bon'
  case (0, 1, 6, 8)
    write(*,'(a)') 'pon'
  case default
    write(*,'(a)') 'hon'
  end select
end program therefore

Measured memory_bytes: 2928
package main

import (
	"fmt"
	"sort"
)

func main() {
	arr := scanNums(2)
	pa := scanNums(arr[0])
	MySort(pa)
	sum := 0
	for i := 0; i < arr[1]; i++ {
		sum += pa[i]
	}
	fmt.Print(sum)
}
func MySort(a []int) {
	sort.Slice(a, func(i, j int) bool { return a[i] < a[j] })

}
func SortedBinaryAppend(sortedArr []int, targetValue int) []int {
	return []int{}
}
func SortedBinaryDelete(sortedArr []int, targetValue int) []int {
	return []int{}
}
func SortedBinarySearch(sortedArr []int, targetValue int) int {
	post := len(sortedArr) - 1
	pre := 0
	for {
		div := (post + pre) / 2
		tim := sortedArr[div]
		if tim == targetValue {
			return pre + div
		} else if tim > targetValue {
			post = tim
		} else {
			pre = tim
		}
		if pre == post {
			return -1
		}
	}
}
func Abs(i int) int {
	if i < 0 {
		return -1 * i
	}
	return i
}
func Min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func Max(a, b int) int {
	if a > b {
		return a
	}
	return b
}
func CalcNum(tate int, yoko int, A int, B int, dp *map[[2]int]int) int {
	if (*dp)[[2]int{tate, yoko}] != 0 {
		return (*dp)[[2]int{tate, yoko}]
	}
	return yoko*CalcNum(tate-1, yoko, A, B, dp) + tate*CalcNum(tate, yoko-1, A, B, dp)
}
func scanNums(len int) (nums []int) {
	var num int
	for i := 0; i < len; i++ {
		fmt.Scan(&num)
		nums = append(nums, num)
	}
	return
}
func scanStrings(len int) (strings []string) {
	var str string
	for i := 0; i < len; i++ {
		fmt.Scanf("%s", &str)
		strings = append(strings, str)
	}
	return
}


Measured memory_bytes: 1916
import sys
sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline
from itertools import permutations,  combinations, accumulate
from functools import *
from collections import deque, defaultdict, Counter
from heapq import heapify, heappop, heappush, heappushpop

INF = float('inf')
NIL = - 1

""" Input
N, A, B = map(int, input().split())
A = list(map(int, input().split()))
A = np.array(input().split(), dtype=np.float64)
D = [int(input()) for _ in range(N)]
AB = [[int(x) for x in input().split()] for _ in range(N)]
PX = [[int(x) for x in input().split()] for _ in range(Q)]
"""

S = input().rstrip()
flag = False
for i in range(len(S) - 1):
    if S[i] == S[i+1]:
        flag = True

print('Bad' if flag else 'Good')




# def main():

# if __name__ == '__main__':
#     main()


Measured memory_bytes: 3568
#include<stdio.h>
#define N 200000

int main(){

  int i,n,maxv,minv;
  int arr[N];
  
  scanf("%d",&n);
  
  for(i=0;i<n;i++){
    scanf("%d",&arr[i]);
  }
  
  maxv = arr[1] - arr[0];
  minv = arr[0];
  
  for(i=1;i<n;i++){
    if(maxv<arr[i]-minv){  
    maxv = arr[i]-minv;
    }
    if(minv>arr[i]){
      minv = arr[i];
    }
  }
    
  printf("%d\n",maxv);

  return 0;
}

Measured memory_bytes: 1376
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,i,j,ans;
  cin >> n;
  ans=n;
  vector<string> S(n);
  for(i=0;i<n;i++)
  {
cin >> S.at(i);
  }
  sort(S.begin(),S.end());
  for(i=0;i<n-1;i++)
  {
    //cout << S.at(i) << endl;
    if(S.at(i)==S.at(i+1)) ans--;
      
  }
  cout << ans << endl;
  
}
    

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

using namespace std;

int main(){
  int N;
  cin >> N;
  
  vector<int> A(N), B(N);
  for(int i = 0; i < N; i++){
    cin >> A[i] >> B[i];
  }
  
  if(N % 2){
    int n = (N + 1) / 2;
    int ng;
    
    int left = 1e9 + 1;
    ng = 0;
    while(left - ng > 1){
      int mid = (left + ng) / 2;
      int count = 0;
      for(int i = 0; i < N; i++){
        if(mid >= A[i]) ++count;
      }
      
      (count >= n ? left : ng) = mid;
    }
    
    int right = 0;
    ng = 1e9 + 1;
    while(ng - right > 1){
      int mid = (right + ng) / 2;
      int count = 0;
      for(int i = 0; i < N; i++){
        if(mid <= B[i]) ++count;
      }
      
      (count >= n ? right : ng) = mid;
    }
    
    cout << right - left + 1 << endl;
  }else{
    int n = N / 2;
    int ng;
    
    int left1 = 1e9 + 1;
    ng = 0;
    while(left1 - ng > 1){
      int mid = (left1 + ng) / 2;
      int count = 0;
      for(int i = 0; i < N; i++){
        if(mid >= A[i]) ++count;
      }
      
      (count >= n ? left1 : ng) = mid;
    }
    
    int left2 = 1e9 + 1;
    ng = 0;
    while(left2 - ng > 1){
      int mid = (left2 + ng) / 2;
      int count = 0;
      for(int i = 0; i < N; i++){
        if(mid >= A[i]) ++count;
      }
      
      (count >= (n + 1) ? left2 : ng) = mid;
    }
    
    int right1 = 0;
    ng = 1e9 + 1;
    while(ng - right1 > 1){
      int mid = (right1 + ng) / 2;
      int count = 0;
      for(int i = 0; i < N; i++){
        if(mid <= B[i]) ++count;
      }
      
      (count >= n ? right1 : ng) = mid;
    }
    
    int right2 = 0;
    ng = 1e9 + 1;
    while(ng - right2 > 1){
      int mid = (right2 + ng) / 2;
      int count = 0;
      for(int i = 0; i < N; i++){
        if(mid <= B[i]) ++count;
      }
      
      (count >= (n + 1) ? right2 : ng) = mid;
    }
    
    
    long long r = (right1 + right2);
    long long l = (left1 + left2);
    cout << r - l + 1 << endl;
  }
  
  return 0;
}

Measured memory_bytes: 4804
#include <stdio.h>

#define INF 2000000

int Min(int,int);
void MatrixChain(int);

int a[1000][1000],p[1000];

int main(){
    int num,i;
    scanf("%d",&num);
    
    for(i = 1; i <= num; i++)
        scanf("%d %d",&p[i-1],&p[i]);

    MatrixChain(num);
    printf("%d\n",a[1][num]);
    
    return 0;
}

int Min(int x,int y){
    if(x > y)return y;
    else return x;
}

void MatrixChain(int num){
    int i,j,l,k;
    for(i = 1; i <= num; i++)
        a[i][i] = 0;
    
    for(l = 2; l <= num; l++){
        for(i = 1; i <=num; i++){
            j = i + l - 1;
            a[i][j] = INF;
            for(k = i; k <= j; k++){
                a[i][j] = Min(a[i][j], a[i][k] + a[k+1][j] + p[i-1]*p[k]*p[j]);
            }
        }
    }
}

Measured memory_bytes: 976
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;

int main(void)
{
	int n;
	scanf("%d", &n);
	n <<= 1;
	vector<int> a(n);
	for(int i = 0;i < n;i++) scanf("%d", &a[i]);
	sort(a.begin(), a.end());
	int res = 0;
	for(int i = 0;i < n;i += 2) res += a[i];
	printf("%d\n", res);
}

Measured memory_bytes: 256
N = int(input())
A = list(map(int,input().split(" ")))

A.sort(reverse=True)
l = len(A)

if l % 2 == 1:
	if A[-1] != 0:
		print(0)
	else:
		num = (N-1)
		for i in range(0,N-1,2):
			if not (A[i] == A[i+1] == num):
				print(0)
				exit(0)
			num -= 2

		print((2 ** ((N-1)//2)) % ((10 ** 9)+7))
else:
	num = (N-1)
	for i in range(0,N,2):
		if not (A[i] == A[i+1] == num):
			print(0)
			exit(0)
		num -= 2

	print((2 ** ((N)//2)) % ((10 ** 9)+7))


Measured memory_bytes: 14004