akhauriyash/Code-Regression huggingface dataset:
# include"stdio.h"
int main(){
    int x,a,b;
    scanf("%d %d %d",&x,&a,&b);
    if(b-a<=0)  printf("delicious\n");
    else if(b-a>0){
        if(b-a<=x)
            printf("safe\n");
        if(b-a>x)
            printf("dangerous\n");
    }
}


Measured memory_bytes: 1628
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
	private static FastScanner sc = new FastScanner();

	public static void main(String[] args) {
		int n = sc.nextInt();
		int cnt = 0;
		
		for(int i=1; i<=n; i++){
			int x = sc.nextInt();
			if(x == 2){
				cnt++;
			} else if(x%2 == 1){
				boolean flag = true;
				for(int j=3; j<=Math.sqrt(x); j+=2) {
					if(x%j == 0){
						flag = false;
						break;
					}
				}
				if(flag){
					cnt++;
				}
			}
		}
		System.out.println(cnt);

	}

	static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException  e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

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

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
	
}

Measured memory_bytes: 31616
input_a = gets.split.map(&:to_i)
input_b = gets.split.map(&:to_i)

up_s = input_a[0] * input_a[1]
tai_w = (input_a[0] * input_b[1]) + (input_a[1] * input_b[0])
do_s = input_b[0] * input_b[1]
puts up_s - (tai_w - do_s)



Measured memory_bytes: 1788
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll,ll>;
using vl = vector<ll>;
using Map = map<ll,ll>;
using T = tuple<ll,ll,ll>;
using vvl = vector<vector<ll>>;
#define all(v) v.begin(), v.end()
#define prt(v) cout<<(v)<<"\n";
#define fi(v) get<0>(v)
#define se(v) get<1>(v)
#define th(v) get<2>(v)
#define endl "\n"
template <typename T> bool chmax(T &a, const T &b){if (a<b){a=b;return 1;}return 0;}
template <typename T> bool chmin(T &a, const T &b){if (a>b){a=b;return 1;}return 0;}
const ll INF=1LL<<60;
const ll MOD=1000000007;


signed main(void){
    cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);
    ll A;
    cin >> A;
    ll B;
    cin >> B;
    prt(A*B)
    
    return 0;
}


Measured memory_bytes: 3648
#include <algorithm>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <vector>

const int MOD = 1e9 + 7;
const int iINF = 2147483647 / 2;
const long long int llINF = 9223372036854775807 / 2;

using namespace std;
using ll = long long int;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vvvl = vector<vector<vector<ll>>>;

typedef pair<ll, ll> pll;
bool paircomp(const pll &a, const pll &b) {
  if (a.first == b.first)
    return a.second < b.second;
  return a.first < b.first;
}

#define REP(i, n) for (ll i = 0; i < (n); i++)
#define RREP(i, n) for (ll i = (n)-1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define AUTO(i, m) for (auto &i : m)
#define ALL(a) (a).begin(), (a).end()
#define MAX(vec) *std::max_element(vec.begin(), vec.end())
#define MIN(vec) *std::min_element(vec.begin(), vec.end())
#define ARGMAX(vec)                                                            \
  std::distance(vec.begin(), std::max_element(vec.begin(), vec.end()))
#define ARGMIN(vec)                                                            \
  std::distance(vec.begin(), std::min_element(vec.begin(), vec.end()))
#define REV(T) greater<T>()
#define PQ(T) priority_queue<T, vector<T>, greater<T>>
#define VVL(a, b, c) vector<vector<ll>>(a, vector<ll>(b, c))
#define VV(T, a, b, c) vector<vector<T>>(a, vector<T>(b, c))
#define VVVL(a, b, c, d)                                                       \
  vector<vector<vector<ll>>>(a, vector<vector<ll>>(b, vector<ll>(c, d)))
#define VVV(T, a, b, c, d)                                                     \
  vector<vector<vector<T>>>(a, vector<vector<T>>(b, vector<T>(c, d)))
#define SP(a) setprecision(a)
#define SQRT(a) sqrt((long double)(a))
#define DPOW(a, b) pow((long double)(a), (long double)(b))
#define UNIQUE(vec)                                                            \
  do {                                                                         \
    sort(ALL((vec)));                                                          \
    (vec).erase(std::unique(ALL((vec))), (vec).end());                         \
  } while (0)

ll POW(ll n, ll m) {
  if (m == 0) {
    return 1;
  } else if (m % 2 == 0) {
    ll tmp = POW(n, m / 2);
    return (tmp * tmp);
  } else {
    return (n * POW(n, m - 1));
  }
}

int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll X;
  cin >> X;
  if (X >= 30)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;

  return 0;
}


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

int main()
{
	int N, M, C;
	int ans = 0;
	cin >> N >> M >> C;

	vector<int> B(M);
	for (int i = 0; i < M; i++) {
		cin >> B[i];
	}
	vector<vector<int> > A(N, vector<int>(M));
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < M; j++) {
			cin >> A[i][j];
		}
	}



	for (int i = 0; i < N; i++) {
		int sum = 0;
		for (int j = 0; j < M; j++) {
			sum += A[i][j] * B[j];
		}
		sum += C;
		if (sum > 0) ans++;
	}

	cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FAST_IO                \
  \   
  ios::sync_with_stdio(false); \
  cin.tie(0);
#define DEBUG
#ifdef DEBUG
#define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
#else
#define debug(...)
#endif
#define trace(c, x) for (auto& x : c)

int main() {
  FAST_IO
  int x;
  cin >> x;
  if (x == 0) {
    cout << 1 << endl;
  } else {
    cout << 0 << endl;
  }
  return 0;
}

Measured memory_bytes: 3636
#include <cstdio>
#include <iostream>
#include <string>
#include <sstream>
#include <stack>
#include <algorithm>
#include <cmath>
#include <queue>
#include <map>
#include <set>
#include <cstdlib>
#include <bitset>
#include <tuple>
#include <assert.h>
#include <deque>
#include <bitset>
#include <iomanip>
#include <limits>
#include <chrono>
#include <random>
#include <array>
#include <unordered_map>
#include <functional>
#include <complex>
#include <numeric>
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; }
//constexpr long long MAX = 5100000;
constexpr long long INF = 1LL << 60;
constexpr int inf = 1000000007;
constexpr long long mod = 1000000007LL;
//constexpr long long mod = 998244353LL;
const long double PI = acos((long double)(-1));

using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;

using Real = long double;
using Point = complex<Real>;
const Real EPS = 1e-8;

struct Circle {
    Point p;
    Real r;
    Circle() :p(Point(0, 0)), r(0) {}
    Circle(Point _p, Real _r) :p(_p), r(_r) {}
};

using Points = vector<Point>;
using Circles = vector<Circle>;

bool eq(Real a, Real b) { return abs(a - b) < EPS; }

int intersect(Circle c1, Circle c2) {
    if (c1.r < c2.r) swap(c1, c2);
    Real d = abs(c1.p - c2.p);
    if (c1.r + c2.r < d) return 4;
    if (eq(c1.r + c2.r, d)) return 3;
    if (c1.r - c2.r < d) return 2;
    if (eq(c1.r - c2.r, d)) return 1;
    return 0;
}

pair<Point, Point> crosspoint(Circle& c1, Circle& c2) {
    Real d = abs(c1.p - c2.p);
    Real a = acos((c1.r * c1.r + d * d - c2.r * c2.r) / (2 * c1.r * d));
    Real t = arg(c2.p - c1.p);
    Point p1 = c1.p + polar(c1.r, t + a);
    Point p2 = c1.p + polar(c1.r, t - a);
    return { p1, p2 };
}

Real scan() {
    int x; scanf("%d", &x);
    return (Real)x;
}

void solve() {
    int r; scanf("%d", &r);
    int n; scanf("%d", &n); if (r == 0 and n == 0) exit(0);
    if (n == 0) {
        puts("0.000");
        return;
    }
    int offset = 20;
    Real h[41][41] = {}; for (int i = 0; i <= 40; i++)for (int j = 0; j <= 40; j++) h[i][j] = 0;
    for (int i = 0; i < n; i++) {
        int l, r, th; scanf("%d %d %d", &l, &r, &th);
        for (int i = l; i < r; i++) {
            chmax(h[i + offset][i + 1 + offset], (Real)th);
        }
    }
    Real step = 0.0001;
    Real cur = 0;
    Point center(0.0, -(Real)r);
    while (1) {
        cur += step;
        center += Point(0, step);
        for (int i = -r; i < r; i++) {
            Real H = h[i + offset][i + 1 + offset];
            Real x[2] = { i + 1 - EPS, i + EPS };
            for (int i = 0; i < 2; i++) {
                Real t = sqrt(r * r - x[i] * x[i]) + center.imag();
                if (t > H ) {
                    cout << fixed << setprecision(4) << cur << "\n";
                    return;
                }

            }
        }
    }
}
int main()
{
    /*
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    */
    int kkt = 89;
    while (kkt) {
        solve();
    }
    return 0;
}


Measured memory_bytes: 3328
#include<stdio.h>

int main(void){
    long int n,i,B[200003];
    long int ans=0,sum=0;
    scanf("%ld",&n);
    long int A[n+1];
    for(i=1;i<200003;i++){
        B[i] = 0;
    }
    
    for(i=1;i<n+1;i++){
        scanf("%ld",&A[i]);
        B[A[i]]++;
    }
    
    for(i=1;i<200003;i++){
        if(B[i]>1){
            sum+= (B[i]*(B[i]-1))/2;
        }
    }
    
    for(i=1;i<n+1;i++){
        ans = sum - B[A[i]] + 1;
        printf("%ld\n",ans);
    }
    return 0;
}


Measured memory_bytes: 5632
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(int)(n); i++)

using namespace std;
typedef long long LL;

int main(){
  int sx, sy, tx, ty;
  cin >> sx >> sy >> tx >> ty;
  int dx=tx-sx, dy=ty-sy;
  string ans;
  ans+='L';
  rep(i,dy+1) ans+='U';
  rep(i,dx+1) ans+='R';
  ans+="DR";
  rep(i,dy+1) ans+='D';
  rep(i,dx+1) ans+='L';
  ans+='U';
  rep(i,dy) ans+='U';
  rep(i,dx) ans+='R';
  rep(i,dy) ans+='D';
  rep(i,dx) ans+='L';
  cout << ans << endl;

  return 0;
}


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

int main(){
	int h, w;
	scanf(" %d %d", &h, &w);
	char image[h][w];
	int i, j;
	for(i = 0; i < h; i++){
		for(j = 0; j < w; j++){
			scanf(" %c", &image[i][j]);
		}
	}
	for(i = 0; i < 2*h; i++){
		for(j = 0; j < w; j++){
			printf("%c", image[i/2][j]);
		}
		printf("\n");
	}
	return 0;
}


Measured memory_bytes: 256
K,N = gets.split.map(&:to_i)
A = gets.split.map(&:to_i)

# i番目とi-1番目の家の距離の差の最大値を取る（1番目はN番目との差）
max = A[0]+K-A[N-1]
for i in 1..N-1 do
  if (A[i]-A[i-1])>max
    max = A[i]-A[i-1]
  end
end

puts K-max


Measured memory_bytes: 15364
#include<bits/stdc++.h>
using namespace std;
# define pb push_back
# define FOR(i,a,n) for(int i=a;i<n;i++)
# define mp make_pair
# define RFOR(i,a,n) for(int i=n;i>a;i--)
# define pii pair<long long int,long long int>
#define ub upper_bound
#define lb lower_bound
#define MOD 1000000007
typedef long long int ll;
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	vector<ll> vec;
	ll k,n;
	ll a;
	cin>>n>>k;
	bool dp[k+1];
	for(int i=0;i<k+1;i++)
	dp[i]=false;
	FOR(i,0,n)
	{
		cin>>a;
		vec.pb(a);
	}
	for(int i=1;i<=k;i++)
	{
		for(int j=0;j<vec.size();j++)
		{
			if(i>=vec[j])
			{
				//cout<<i<<" "<<vec[j]<<endl;
				if(dp[i-vec[j]]==false)
				{
					dp[i]=true;
				}
				
			}
		}
	}
	if(dp[k]==true)
	cout<<"First"<<endl;
	else
	cout<<"Second"<<endl;
}

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

template<typename T_char>
T_char ToUpper(T_char cX){return toupper(cX);}

int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  for(int i=0; i<n; ++i) cin >> a[i];

  int num = 1, num1 = 1;
  for(int i=0; i<n; ++i){
    num *=  3;
    if(a[i]%2 == 0) num1 *= 2;
  }

  cout << num - num1 << endl;
}

Measured memory_bytes: 3596
class Node
  attr_accessor :id, :parent, :left, :right, :sibling, :degree, :height

  def initialize()
    @parent = -1
    @sibling = -1
  end

  def set_info(id, left, right)
    @id = id
    @left = left
    @right = right
    @degree = [@left, @right].select {|c| c != -1}.count
  end

  def set_parent(parent_id)
    @parent = parent_id
  end

  def set_sibling(sibling)
    @sibling = sibling
  end

  def type?
    if @parent == -1
      return 'root'
    elsif @left == -1 && @right == -1
      return 'leaf'
    else
      return 'internal node'
    end
  end

end

n = gets.to_i
$nodes = Array.new(n).map{ Node.new() }
$depth = Array.new(n)
$height = Array.new(n, 0)
n.times do
  id, left, right = gets.split.map(&:to_i)
  $nodes[id].set_info(id, left, right)
  if left != -1
    $nodes[left].set_parent(id)
    $nodes[left].set_sibling(right)
  end
  if right != -1
    $nodes[right].set_parent(id)
    $nodes[right].set_sibling(left)
  end
end

def setDepth(u, d)
  $depth[u] = d

  if $nodes[u].right != -1
    setDepth($nodes[u].right, d + 1)
  end

  if $nodes[u].left != -1
    setDepth($nodes[u].left, d + 1)
  end
end

def setHeight(u)
  h1, h2 = 0, 0
  if $nodes[u].right != -1
    h1 = setHeight($nodes[u].right) + 1
  end

  if $nodes[u].left != -1
    h2 = setHeight($nodes[u].left) + 1
  end
  $height[u] = [h1, h2].max
  return [h1, h2].max
end

c = 0
while $depth.include?(nil)
  setDepth(c, 0)
  c += 1
end
setHeight(c - 1)

$nodes.each do |e|
  puts "node #{e.id}: parent = #{e.parent}, sibling = #{e.sibling}, degree = #{e.degree}, depth = #{$depth[e.id]}, height = #{$height[e.id]}, #{e.type?}"
end



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

using namespace std;

void solve() {
    string N;
    cin >> N;
    vector<vector<vector<vector<int>>>> dp(N.size() + 1, vector<vector<vector<int>>>(8, vector<vector<int>>(2, vector<int>(2))));
    
    dp[0][0][0][0] = 1;
    int dig[] = {3, 5, 7};

    for(int i = 0; i < N.size(); i++) {
        for(int j = 0; j < 8; j++) {
            for(int l = 0; l < 2; l++) {
                for(int k = 0; k < 3 && dig[k] <= N[i] - '0'; k++) {
                    dp[i + 1][j | (1 << k)][(N[i] - '0') != dig[k]][1] += dp[i][j][0][l];
                }
                for(int k = 0; k < 3; k++) {
                    dp[i + 1][j | (1 << k)][1][1] += dp[i][j][1][l];
                }
                if (!l) {
                    dp[i + 1][j][1][0] += dp[i][j][0][0];
                    dp[i + 1][j][1][0] += dp[i][j][1][0];
                }
            }
            
        }
    }

    int ans = 0;
    for (int k = 0; k < 2; k++) {
        for (int l = 0; l < 2; l++) {
            ans += dp[N.size()][7][k][l];
        }
    }

    cout << ans << endl;
}

int main() {
    solve();
    return 0;
}

Measured memory_bytes: 256
#with open('random_pm00.txt') as f:
    #n, k = map(int, f.readline().split())
    #a = list(map(int, f.readline().split()))
n, k = map(int, input().split())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7

mia, pla = [], []
for ai in a:
    if ai < 0:
        mia.append(ai)
    elif ai >= 0:
        pla.append(ai)
mia.sort(reverse=True)
pla.sort()

cnt = 1
if len(pla) == 0 and k % 2 == 1:
    for i in mia[:k]:
        cnt = cnt * i % mod
else:
    while k > 0:
        if k == 1 or len(mia) <= 1:
            if len(pla) == 0:
                cnt = cnt * mia.pop() % mod
            elif len(pla) > 0:
                cnt = cnt * pla.pop() % mod
            k -= 1
        elif len(pla) <= 1:
            if k == 1:
                cnt = cnt * pla.pop() % mod
                k -= 1
            elif k > 1:
                cnt = cnt * mia.pop() * mia.pop() % mod
                k -= 2
        elif len(pla) >= 2 and len(mia) >= 2:
            if pla[-1] * pla[-2] > mia[-1] * mia[-2]:
                cnt = cnt * pla.pop() % mod
                k -= 1
            elif pla[-1] * pla[-2] <= mia[-1] * mia[-2]:
                cnt = cnt * mia.pop() * mia.pop() % mod
                k -= 2
print(cnt)


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

using namespace std;
int n;
int main (){
    cin >> n;
    int mn = 1e9;
    for(int i = 1; i < n; i++){
        int j = n - i;
        int j2 = i;
        int sum = 0;
        while(j > 0){
            sum += j % 10;
            j /= 10;
        }
        while(j2 > 0){
            sum += j2 % 10;
            j2 /= 10;
        }
        mn = min(sum, mn);
    }
    cout << mn;
}


Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<fstream>
#include<cmath>
#include<cstring>
#include<algorithm>
using namespace std;
#define Set(a) memset(a,0,sizeof(a))
#define F(i,a,b) for(register int i=a,i##end=b;i<=i##end;++i)
#define UF(i,a,b) for(register int i=a,i##end=b;i>=i##end;--i)
#define openf(a) freopen(#a".in","r",stdin);freopen(#a".out","w",stdout)
#define re register
#define ri re int
#define il inline
typedef long long ll;
typedef unsigned long long ull;
template<typename T> inline T rd(T& x)
{
	T f=1;x=0;char c=getchar();
	for(;!isdigit(c);c=getchar()) if(c=='-') f=-1;
	for(; isdigit(c);c=getchar()) x=(x<<3)+(x<<1)+(T)(c-'0');
	x*=f;
	return x;
}
ll rd(){ll x;rd(x);return x;}
const int inf=1<<30;

int a[105];
int main()
{
	int n=rd();
	int k=rd();
	while(k--) {int d=rd();while(d--) a[rd()]=1;}
	int ans=0;F(i,1,n) ans+=1-a[i];
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 3632
def resolve():
    a, b, c, d = map(int, input().split())
    ans = int()
    if c < a:
        if d <= a:
            ans = 0
        elif a < d and d <= b:
            ans = d-a
        elif b < d:
            ans = b-a
    elif a <= c:
        if d <= b:
            ans = d-c
        elif b < d:
            ans = b-c
    if b <= c:
        ans = 0
    print(ans)
resolve()

Measured memory_bytes: 9124
N, M, Q = map(int, input().split() )

N_LR = [[0 for i in range(N+1)] for j in range(N+1)]

for i in range(M):
  l, r = map(int, input().split() )
  N_LR[l][r] += 1

#S_LR = [[0 for i in range(N+1)] for j in range(N+1)]
for i in range(1,N+1):
  for j in range(1,N+1):
    N_LR[i][j] += N_LR[i-1][j] + N_LR[i][j-1] - N_LR[i-1][j-1]

for i in range(Q):
  x,y = map(int, input().split() )
  ans = N_LR[y][y] - N_LR[x-1][y] - N_LR[y][x-1] + N_LR[x-1][x-1]
  print(ans)

Measured memory_bytes: 13424
#include <bits/stdc++.h>
#include <sys/types.h>
#include <unistd.h>

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}

using ll=long long;
using R=long double;
const R EPS=1e-9L; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r){return(r > EPS)-(r < -EPS);}
inline R sq(R x){return sqrt(max(x,0.0L));}

void output(bool ok){
	cout << (ok ? "Yes" : "No") << endl;
	exit(0);
}

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

	map<int, int> val;
	set<int> s;

	rep(i, n){
		int a;
		cin >> a;
		s.insert(a);
		val[a]++;
	}

	vector<int> b;
	for(auto &elem: s) b.push_back(elem);

	if(b.size() == 1 and b[0] == 0) output(true);

	if(n % 3 != 0) output(false);

	if(b.size() == 3) {
		bool same = true;
		rep(i, 3) if(val[b[i]] != val[b[0]]) same = false;
		if(same == false) output(false);
		if(( b[0]^b[1] ) != b[2]) output(false);
		output(true);
	} else if(b.size() == 2) {
		if (b[0] != 0) output(false);
		if (val[b[0]] * 2 != val[b[1]] and val[b[0]] != val[b[1]] * 2) output(false);
		output(true);
	} else {
		output(false);
	}

	return 0;
}

Measured memory_bytes: 8188
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cctype>

#include <algorithm>
#include <random>
#include <bitset>
#include <queue>
#include <functional>
#include <set>
#include <map>
#include <vector>
#include <chrono>
#include <iostream>
#include <limits>
#include <numeric>

#define LOG(FMT...) fprintf(stderr, FMT)

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

// mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

template <class T>
istream& operator>>(istream& is, vector<T>& v) {
  for (T& x : v)
    is >> x;
  return is;
}

ostream& operator<<(ostream& os, const pair<char, int>& unit) {
  return os << unit.first << "^" << unit.second;
}

template <class T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  if (!v.empty()) {
    os << v.front();
    for (int i = 1; i < v.size(); ++i)
      os << ' ' << v[i];
  }
  return os;
}

typedef vector<int> vi;

int norm(int x, int m) {
  x %= m;
  if (x < 0) x += m;
  return x;
}

vi power(const vi& p, int k) {
  int n = p.size();
  vector<bool> vis(n);
  vi ret(n);
  for (int i = 0; i < n; ++i)
    if (!vis[i]) {
      vector<int> cycle;
      int x = i;
      while (!vis[x]) {
        cycle.push_back(x);
        vis[x] = true;
        x = p[x];
      }
      for (int i = 0; i < cycle.size(); ++i)
        ret[cycle[i]] = cycle[norm(i + k, cycle.size())];
    }
  return ret;
}

vi inverse(const vi& p) { return power(p, -1); }

vi mult(const vi& p, const vi& q) {
  int n = p.size();
  vi ret(n);
  for (int i = 0; i < n; ++i)
    ret[i] = p[q[i]];
  return ret;
}

template <class T, class... Args>
vi mult(const T& first, const Args&... args...) {
  return mult(first, mult(args...));
}

int main() {
#ifdef LBT
  freopen("test.in", "r", stdin);
  int nol_cl = clock();
#endif
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  
  int n, k;
  cin >> n >> k;
  --k;
  vi p(n), q(n);
  cin >> p >> q;
  for (int& v : p) --v;
  for (int& v : q) --v;
  vi ip = inverse(p), iq = inverse(q), w = mult(q, ip, iq, p);
  int m = k / 6;
  static vi little[6];
  little[0] = mult(power(w, m), q, p, iq, power(w, 1 - m));
  little[1] = mult(power(w, m), q, power(w, -m));
  int r = k % 6;
  for (int i = 2; i <= r; ++i)
    little[i] = mult(little[i - 1], inverse(little[i - 2]));
  vi ans = little[r];
  for (int& v : ans) ++v;
  cout << ans << '\n';

#ifdef LBT
  LOG("Time: %dms\n", int ((clock()
          -nol_cl) / (double)CLOCKS_PER_SEC * 1000));
#endif
  return 0;
}


Measured memory_bytes: 5256
object Main extends App {
  import scala.annotation.tailrec

  @tailrec
  def loop() {
    val line = scala.io.StdIn.readLine()
    if (line == null) return
    else {
      val n = line.split(' ').map(_.toInt).sum
      println(n)
      loop()
    }
  }

  loop()
}

Measured memory_bytes: 43812
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T> V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> > Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T> mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }

/*
 <url:https://onlinejudge.u-aizu.ac.jp/challenges/sources/JAG/Summer/2440>
 問題文============================================================
 =================================================================
 解説=============================================================
 ================================================================
 */
void solve(){
    int N; cin >> N;
    map<string,int> mp;
    set<string> s;
    for(int i = 0; i < N;i++) { string U; cin >> U; mp[U] = 0; s.insert(U);}
    int M; cin >> M;
    bool state = false;
    for(int i = 0; i < M;i++){
        string T; cin >> T;
        if(s.find(T) == s.end()){
            cout << "Unknown " << T << endl;
        }else{
            if(state == 0){
                state = 1;
                cout << "Opened by " << T << endl;
            }else{
                state = 0;
                cout << "Closed by " << T << endl;
            }
        }
    }
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    solve();
    return 0;
}



Measured memory_bytes: 3288
#include <bits/stdc++.h>
#define ss second
#define ff first
#define all(x) x.begin(), x.end()
 
using namespace std;
using ll = long long;
using pii = pair<int, int>;
 
const int oo = 1e9 + 7;
const int mod = 1e9 + 7, maxn = 100100;
const long double PI = acos(-1);
 
int main (){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    ll n, t;
    cin >> n >> t;

    vector<ll> v(n);

    for (auto& x: v) cin >> x;

    ll carry = 0;
    for (int i=0; i<n-1; i++){
        v[i+1] -= carry;
        if (v[i+1] - v[i] > t){
            carry += v[i+1] - v[i] - t;
            v[i+1] = v[i]+ t;
        }
    }

    cout << v[n-1] + t << endl;
    return 0;
}

Measured memory_bytes: 1792
#pragma GCC optimize("O2")
#include <bits/stdc++.h>
// #include <iostream>
// #include <array>
// #include <cmath>
// #include <array>
// #include <vector>
// #include <set>
// #include <algorithm>
// #include <functional>
// #include <numeric>
// #include <map>
// #include <unordered_map>
// #include <queue>
using namespace std;
// #define MOD  998244353
// #define MOD ll(1e9) + 7
#define ll long long
const double PI = atan(1.0) * 4;
// const int N = 1e5 + 5 ;
// const ll INF = (int)1e9 ;
const int dx[4] = { -1, 0, 1, 0} ;
const int dy[4] = {0, -1, 0, 1} ;
// const ll INF = (ll)2e18 + 50;
const ll INF = 1e9 ;
const ll MOD = 1e9 + 7 ;

ll power(ll a , ll e) {
	ll res = 1LL ;
	while (e > 0) {
		if (e % 2 == 1) res = res * a % MOD ;
		a =  a * a % MOD ;
		e /= 2 ;
	}
	return res ;
}
vector<int> complement(const vector<int> &vec) {
	int n = vec.size() ;
	vector<bool> occur(n + 1 , true) ;
	vector<int> ans ;
	for (int i = 0 ; i < (int)vec.size() ; i++) {
		occur[vec[i]] = false ;
	}
	for (int i = 1 ; i <= n ; i++) {
		if (occur[i]) ans.push_back(i) ;
	}
	return ans ;
}

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

	// int t ;
	// cin >> t;
	// while (t--) {
	int x , y ;
	cin >> x >> y ;
	if (y >= 2 * x && y <= 4 * x && y % 2 == 0) {
		cout << "Yes\n";
	}
	else {
		cout << "No\n";
	}

	// }
	return 0;
}


Measured memory_bytes: 3656
def main():
    import sys
    from collections import defaultdict
    input = sys.stdin.readline
    H, W, M = [int(x) for x in input().strip().split()]
    HM = [[i, 0] for i in range(H)]
    WM = [[i, 0] for i in range(W)]
    dic = defaultdict(int)
    for m in range(M):
        h, w = [int(x)-1 for x in input().strip().split()]
        dic[(h, w)] = 1
        HM[h][1] += 1
        WM[w][1] += 1
    HM.sort(reverse=True, key=lambda x: x[1])
    WM.sort(reverse=True, key=lambda x: x[1])
    # print(HM)
    # print(WM)
    maxh = HM[0][1]
    maxw = WM[0][1]
    ans = HM[0][1] + WM[0][1] - 1
    for h in range(H):
        if HM[h][1] != maxh:
            break
        for w in range(W):
            if WM[w][1] != maxw:
                break
            if dic[(HM[h][0], WM[w][0])] == 0:
                print(ans+1)
                return True
    print(ans)

if __name__ == '__main__':
    main()

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


int main(){
  int n=0,i=0,d=0,x=1,y=1,z=1;
  char s[500];
  
  scanf("%d",&n);
  

  for(i=1;i<=n;i++){
    for(x=1;x<100;x++){
      for(y=1;y<100;y++){
	for(z=1;z<100;z++){
	  if(x*x+y*y+z*z+x*y+y*z+z*x>i)
	    break;
	  else if(x*x+y*y+z*z+x*y+y*z+z*x==i){
	    
	    d++;
	    break;
	  }
	  
	}
      }
    }
    printf("%d\n",d);
    d=0;
  }

  
  
  return 0;
}


Measured memory_bytes: 1680
#include <bits/stdc++.h>
#define pb push_back
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,n,s) for(int i=(s);i<(n);i++)
#define rrep(i,n) for(int i=(n-1);i>=0;i--)
#define rreps(i,n,s) for(int i=s;i>=n;i--)
#define MOD 1000000007
using ll = long long;
using namespace std;
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 (a>b) { a=b; return 1; } return 0; }

int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int n,m;
cin>>n>>m;
map<int,vector<int>> d;
int s,c;
string ans="";
rep(i,m){
    cin>>s>>c;
    s--;
    if((d.count(s)&&d[s][0]!=c)||(n>1 && s==0&&c==0)){
        ans="-1";
        break;
    }
    d[s].pb(c);
}
if(ans!="-1"){
    rep(i,n){
        if(d.count(i)){
            ans +=to_string(d[i][0]);
        }
        else if(i==0&&n>1){
            ans+="1";
        }
        else{
             ans+="0";
        }
    }
}
cout<<ans<<endl;
//system("pause");
return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifndef ONLINE_JUDGE
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
int main() {
	int n;
	cin>>n;
	vector<int> h(n);
	for(int i=0;i<n;i++) {
		cin>>h[i];
	}
	vector<int> dp(n,0);
	dp[0] = 0;
	dp[1] = abs(h[0] - h[1]);
	for(int i=2;i<n;i++) {
		dp[i] = min(dp[i-1] + abs(h[i] - h[i-1]), dp[i-2] + abs(h[i-2]-h[i]));
	}
	cout<<dp[n-1]<<"\n";
	
}



Measured memory_bytes: 4048
import sys
input = sys.stdin.readline
import bisect

N = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a.sort()
b.sort()
c.sort()
ans = 0
for i in range(N):
    atmp = bisect.bisect_right(a, b[i] - 1)
    ctmp = bisect.bisect_left(c, b[i] + 1)

    ans += atmp * (N - ctmp)

print(ans)

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

int main(){
    int a,b,num = 0;
    cin >> a >> b;
    for(int i = a; i <= b; i++){
        bool can = true;
        string s = std::to_string(i);
        for(int j = 0; j < s.size()/2; j++){
            if(s[j] != s[s.size()-j-1]) can = false;
        }
        if(can) num++;
    }
    cout << num << endl;
    return 0;
}

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

typedef long long ll;
typedef pair <int, int> pii;

const int MAXN = 1e3 + 5;
const ll INF = 1e18;

int N;
int a[MAXN];

void load() {
	scanf("%d", &N);
	for (int i = 0; i < N; i++)
		scanf("%d", a + i);
}

void solve() {
	ll sol = -INF;
	vector <int> opt;
	for (int k = 0; k < 2; k++) {
		vector <pii> v;
		for (int i = k; i < N; i += 2)
			v.push_back({a[i], i});
		sort(v.begin(), v.end(), greater <pii> ());
		ll sum = 0;
		vector <int> pref;
		for (auto it : v) {
			sum += it.first;
			pref.push_back(it.second);
			if (sum > sol) {
				opt = pref;
				sol = sum;
			}
		}
	}
	
	sort(opt.begin(), opt.end());
	
	vector <int> ans; 
	for (int i = 0; i < opt[0]; i++) 
		ans.push_back(0);
	
	for (int i = 0; i < N - opt.back() - 1; i++)
		ans.push_back(N - opt[0] - i - 1);
	
	for (int i = 1; i < opt.size(); i++)
		for (int j = (opt[i] - opt[i - 1]) / 2; j; j--)
			ans.push_back(j);
			
	printf("%lld\n%d\n", sol, ans.size());
	for (auto it : ans)
		printf("%d\n", it + 1);
}

int main() {
	load();
	solve();
	return 0;
}

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

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

int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  REP(i,N) cin >> a[i];
  sort(a.begin(), a.end(), greater<int>());
  int ans = 0;
  REP(i,N) i%2 ? ans -= a[i] : ans += a[i];
  cout << ans << endl;;
}

Measured memory_bytes: 256
n,m=map(int,input().split())
a=[[int(i) for i in input().split()] for i in range(n)]
a.sort()
price=0
cnt=0
for i in range(n):
    if cnt+a[i][1]==m:
        cnt+=a[i][1]
        price+=a[i][0]*a[i][1]
        break
    elif cnt+a[i][1]<m:
        cnt+=a[i][1]
        price+=a[i][0]*a[i][1]
    else:
        price+=a[i][0]*(m-cnt)
        break
print(price)

Measured memory_bytes: 21604
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String input = sc.next();
        String last = "";
        boolean isBad = false;
        for (int i = 0; i < input.length(); i++) {
            String newStr = input.substring(i, i + 1);
            if (last.equals(newStr)) {
                System.out.println("Bad");
                isBad = true;
                break;
            }
            last = newStr;
        }
        if (!isBad) {
            System.out.println("Good");
        }
    }
}

Measured memory_bytes: 23892
#include <iostream>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <limits>
#include <bitset>
#include <functional>
#include <type_traits>
#include <queue>
#include <stack>
#include <array>
#include <random>
#include <utility>
#include <cstdlib>
#include <ctime>

using namespace std;

#define rep(i, n) for (int i=0; i < (int)n; i++)
#define rep2(i, begin_i, end_i) for (int i = (int)begin_i; i < (int)end_i; i++)
#define n (20)
int main()
{
    int N;
    cin>>N;
    cout<<pow(N,3)<<endl;
    return 0;
}


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

int main() {
	// your code goes here
	int k,n,i;
	char s[100];
	cin >> n >> k >> s;
	if(s[k-1]=='A') s[k-1]='a';
	if(s[k-1]=='B') s[k-1]='b';
	if(s[k-1]=='C') s[k-1]='c';
	cout << s << endl;
	return 0;
}

Measured memory_bytes: 256
#ifndef BZ
#pragma GCC optimize "-O3"
#endif
#include <bits/stdc++.h>

#define FASTIO
#define ALL(v) (v).begin(), (v).end()
#define rep(i, l, r) for (int i = (l); i < (r); ++i)

#ifdef FASTIO
#define scanf abacaba
#define printf abacaba
#endif

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

using namespace std;


/*
ll pw(ll a, ll b) {
	ll ans = 1; while (b) {
		while (!(b & 1)) b >>= 1, a = (a * a) % MOD;
		ans = (ans * a) % MOD, --b;
	} return ans;
}
*/

const int MAXN = 210000;

int n;
int a[MAXN];

int main() {
#ifdef FASTIO
	ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#endif
	cin >> n;
	for (int i = 0; i < n; ++i)
		cin >> a[i];
	ll ans = 0;
	int now = 0;
	ll sum = 0;
	for (int i = 0; i < n; ++i) {
		while (now < n && (sum ^ a[now]) == (sum + a[now]))
			sum += a[now], ++now;
		ans += now - i;
		sum -= a[i];
	}
	cout << ans << "\n";
	return 0;
}




Measured memory_bytes: 1024
package main

import "fmt"

func main() {
	var d int
	fmt.Scan(&d)
	ans := ""
	switch d {
	case 25:
		ans = "Christmas"
	case 24:
		ans = "Christmas Eve"
	case 23:
		ans = "Christmas Eve Eve"
	case 22:
		ans = "Christmas Eve Eve Eve"
	}
	fmt.Println(ans)
}


Measured memory_bytes: 512
#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <algorithm>
#define int long long
#define rep(x, a, b) for(int x = (a); x <= (b); ++x)
#define rop(x, a, b) for(int x = (a); x < (b); ++x)
#define per(x, a, b) for(int x = (a); x >= (b); --x)
using namespace std;
typedef long long LL;
typedef double DB;
const long double pi = 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679;
struct node {
	int x, y;
}a[200005];
bool operator < (const node & a, const node & b) {
	if(a.x != b.x) return a.x < b.x;
	return a.y < b.y;
}
bool operator == (const node & a, const node & b) {
	return a.x == b.x && a.y == b.y;
}
const int INF = 2000000000;
int x_1, x_2, y_1, y_2;
int n;
int f[200005];
main() {
	scanf("%lld%lld%lld%lld", &x_1, &y_1, &x_2, &y_2);
	int bj = 1;
	if(x_1 > x_2) swap(x_1, x_2), bj *= -1;
	if(y_1 > y_2) swap(y_1, y_2), bj *= -1;
	scanf("%lld", &n);
	rep(i, 1, n) {
		scanf("%lld%lld", &a[i].x, &a[i].y);
		if(a[i].x < x_1) a[i].x = INF, a[i].y = INF;
		else if(a[i].x > x_2) a[i].x = INF, a[i].y = INF;
		else if(a[i].y < y_1) a[i].x = INF, a[i].y = INF;
		else if(a[i].y > y_2) a[i].x = INF, a[i].y = INF;
		else a[i].x *= bj;
	}
	sort(a + 1, a + 1 + n);
	while(a[n].x == INF) --n;
	int as = 0;
	rep(i, 1, n) {
		if(as == 0) f[++as] = a[i].y;
		else {
			int k = upper_bound(f + 1, f + 1 + as, a[i].y) - f;
			while(k <= as && f[k] < a[i].y) ++k;
			f[k] = a[i].y;
			as = max(as, k);
		}
	}
	printf("%0.15f", (DB) (((LL) x_2 - x_1 + y_2 - y_1) * 100.0 - (20 - 5 * pi) * as + ((as == min(x_2 - x_1 + 1, y_2 - y_1 + 1)) ? 5.0 * pi : 0)));
	return 0;
}

Measured memory_bytes: 4992
#include<cstdio>
#include<cmath>
int main(){
    double a[6];
    double x,y;
    for(;;){
        for(int i=0;i<6;i++){
            if(scanf("%lf",&a[i])==-1)return 0;
        }
        if(a[0]==0){
            y=a[2]/a[1];
            x=(a[5]-a[4]*y)/a[3];
        }else if(a[1]==0){
            x=a[2]/a[0];
            y=(a[5]-a[3]*x)/a[4];
        }else if(a[3]==0){
            y=a[5]/a[4];
            x=(a[2]-a[1]*y)/a[0];
        }else if(a[4]==0){
            x=a[5]/a[3];
            y=(a[2]-a[0]*x)/a[1];
        }else{
            y=(a[2]-(a[5]*(a[0]/a[3])))/(a[1]-(a[4]*(a[0]/a[3])));
            x=(a[2]-a[1]*y)/a[0];
        }
        printf("%.3lf %.3lf\n",rint(x*1000)/1000.0,rint(y*1000)/1000.0);
    }
}

Measured memory_bytes: 0
import sys
from itertools import combinations
input = sys.stdin.readline

def main():
    h, w, n = map(int, input().split())
    grid = [0]*n
    mod = 10**9
    judge = dict()
    for _ in range(n):
        a, b = map(int, input().split())
        for i in range(-1, 2):
            for j in range(-1, 2):
                if a+i <= 1 or a+i >= h or b+j <= 1 or b+j >= w:
                    continue
                if (a+i, b+j) in judge:
                    judge[(a+i, b+j)] += 1
                else:
                    judge[(a+i, b+j)] = 1
   
    ans = [0]*10
    
    for v in judge.values():
        ans[v] += 1
    ans[0] = (h-2)*(w-2)-sum(ans[1:])
    
    for a in ans:
        print(a)

    
if __name__ == "__main__":
    main()


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

using namespace std;

#define REP(i,n) for(int i=0;i<(n);i++)
#define REP1(i,n) for(int i=1;i<(n);i++)
#define ALL(a)  (a).begin(),(a).end()
using ll = long long;
using ld = long double;
using Pint = pair<int, int>;
const ll mod = 1e9+7;

int main(int argc, char const* argv[])
{
  string s, t;
  cin>>s>>t;

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

  map<string, int> m;
  m[s] = a;
  m[t] = b;

  string u;
  cin>>u;
  m[u]--;

  printf("%d %d\n", m[s], m[t]);

  return 0;
}

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

#define ALL(a) begin(a), end(a)
#define TPL template
#define TNM typename

using ll = long long;
using ull = unsigned long long;

TPL<TNM T> using vec = vector<T>;
TPL<TNM T> using vec2 = vec<vec<T>>;
TPL<TNM T> using vec3 = vec<vec2<T>>;
TPL<TNM T> using vec4 = vec<vec3<T>>;
TPL<TNM T> using vec5 = vec<vec4<T>>;

TPL<TNM T> inline istream& operator >> (istream& is, vector<T>& vec) { for (T& x : vec) is >> x; return is; }
TPL<TNM V, TNM H> void resize(vector<V>& _v, const H _h) { _v.resize(_h); }
TPL<TNM V, TNM H, TNM ... T> void resize(vector<V>& _v, const H& _h, const T& ... _t) { _v.resize(_h); for (auto& __v : _v) resize(__v, _t ...); }
TPL<TNM V, TNM T> TNM enable_if<!is_class<V>::value>::type fill(vector<V>& _v, const T& _t) { std::fill(ALL(_v), _t); }
TPL<TNM V, TNM T> TNM enable_if<is_class<V>::value>::type fill(vector<V>& _v, const T& _t) { for (auto& _e : _v) fill(_e, _t); }
TPL<TNM T> inline void UNIQUE(vector<T>& _v) { sort(ALL(_v)); _v.erase(unique(ALL(_v)), _v.end()); }
struct pre_ { pre_() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(6); } } pre__;


using Int = ll;
Int gcd(Int a, Int b) {
	return b != 0 ? gcd(b, a % b) : a;
}

Int lcm(Int a, Int b) {
	return a / gcd(a, b) * b;
}


int main(void) {
	ll A, B, C, D;
	cin >> A >> B >> C >> D;
	ll a1 = B / C - (A + C -1) / C;
	ll a2 = B / D - (A + D -1) / D;
	ll a3 = B / lcm(C, D) - (A + lcm(C, D) - 1) / lcm(C, D);
	cout << B - A - a1 - a2 + a3 << endl;
	return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            long[] abc = Console.ReadLine().Split().Select(long.Parse).ToArray();
            long x = abc[2] - abc[0] - abc[1];


            Console.WriteLine(x > 0 && 4 * abc[0] * abc[1] < x * x ? "Yes" : "No");
        }
    }
}


Measured memory_bytes: 13396
#include<stdio.h>
#define MOD 1000000007
int main(void){
  char s[100000];
  int ans=0,cnt=2;
  int c;
  while((c=getchar())!=EOF){
    if(c!='0' && c!='1'){
      continue;
    }
    ans=((ans*2)%MOD+ans+2)%MOD;
    if(c=='1'){
      cnt=(cnt*2)%MOD;
    }else{
      ans=(ans+MOD-cnt)%MOD;
    }
  }
  printf("%d\n",(ans+1)%MOD);
  return 0;
}

Measured memory_bytes: 128
#include <iostream>
    #include <bits/stdc++.h>
    #include <boost/multiprecision/cpp_int.hpp> 
    using namespace boost::multiprecision;
    using namespace std;
    typedef long long int ll;
    vector <vector <ll>> dp;
    ll solve(const vector <ll> &pre,ll s,ll e){
    	if(s==e){
    		return 0;
    	}
    	if(dp[s][e]!=-1){
    		return dp[s][e];
    	}
    	ll ans = LONG_MAX;
    	for(ll i=s;i<e;i++){
    		if(s!=0)
    			ans = min(ans,pre[e]-pre[s-1]+solve(pre,s,i)+solve(pre,i+1,e));
    		else
    			ans = min(ans,pre[e]+solve(pre,s,i)+solve(pre,i+1,e));
    	}
    	return dp[s][e]=ans;
    }
    int main() {
    	ll n;
    	cin>>n;
    	vector <ll> a(n);
    	vector <ll> pre(n,0);
    	dp.assign(n,vector <ll> (n,-1));
    	for(ll i=0;i<n;i++){
    		cin>>a[i];
    		if(i==0){
    			pre[i]=a[i];
    		}
    		else{
    			pre[i]=a[i]+pre[i-1];
    		}
    	}
    	cout<<solve(pre,0,n-1)<<endl;
    	return 0;
    }

Measured memory_bytes: 1536
//Name: Keitai Message
//Level: 1
//Category: シミュレーション,やるだけ
//Note: 

/**
 * やるだけ。
 */
#include <iostream>
#include <string>

using namespace std;

const string tbl[10] = {
    "",
    ".,!? ",
    "abc",
    "def",
    "ghi",
    "jkl",
    "mno",
    "pqrs",
    "tuv",
    "wxyz"
};
bool solve(bool first) {
    string cmd;
    string ans;
    cin >> cmd;
    int row = 0, col = -1;
    for(char c : cmd) {
        if(c == '0') {
            if(col >= 0) ans += tbl[row][col % tbl[row].size()];
            col = -1;
        } else {
            row = c - '0';
            ++col;
        }
    }
    cout << ans << endl;
    return true;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout.setf(ios::fixed);
    cout.precision(10);

    int N;
    cin >> N;
    bool first = true;
    while(N--) {
        solve(first);
        first = false;
    }
    return 0;
}

Measured memory_bytes: 1216
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
typedef long long ll;
using namespace std;
const ll mod=998244353, INF=mod*mod*3LL;
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;

ll fac[200007],finv[200007],inv[200007];
void cominit(){
    fac[0]=fac[1]=1;
    finv[0]=finv[1]=1;
    inv[1]=1;
    for(int i=2;i<200007;i++){
        fac[i]=fac[i-1]*i%mod;
        inv[i]=mod-inv[mod%i]*(mod/i)%mod;
        finv[i]=finv[i-1]*inv[i]%mod;
    }
}
ll com(ll n,ll k){
    if(n<k)return 0;
    if(n<0 || k<0)return 0;
    return fac[n]*(finv[k]*finv[n-k]%mod)%mod;
}

long long modpow(long long a, long long n) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
int main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    cominit();
    ll n, m, k;

    cin >> n >> m >> k;
    ll ans = modpow(m, n);

    for(ll i=k+1;i<n;i++){
    	ll num = m;
    	num *= com(n-1, i);
    	num %= mod;
    	num *= modpow(m-1, n-i-1);
    	ans -= num;
    	ans %= mod;
    }
    ans += mod;
    ans %= mod;
    cout << ans << endl;
    return 0;
}


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

int main() {
    int N, a;
    cin >> N;

    int cnt = 0, cnt2 = 0;
    rep(i, N) {
        cin >> a;
        if (a % 4 == 0)
            cnt++;
        else if (a % 2 == 0)
            cnt2++;
    }
    if (N / 2 - cnt <= 0)
        cout << "Yes";
    else if (N - cnt2 - 2 * cnt <= 0)
        cout << "Yes";
    else
        cout << "No";

    cout << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll,ll> l_l;
const int INF=1001001000;
const int mINF=-1001001000;
const ll LINF=1010010010010010000;
int main(){
    int a,b;cin >> a >> b;
    for(double i=1;i<=1000;i++){
        if(floor(i*0.08)==a&&floor(i*0.1)==b){
            cout << i << endl;
            return 0;
        }
    }
    cout << -1 << endl;
    return 0;
}

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

int main(){
    ll ans = 0;
    ll n; cin >> n;
    rep(i, 0, n){
        ll a; cin >> a;
        ans += (a-1);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)x.size()
#define D(x) cerr << #x << " = " << (x) << '\n'
using ll = long long;

const int inf = 1e9;

const int maxn = 100123;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	int n, m;
	cin >> n >> m;
	vector<vector<int>> G;
	vector<int> dist(n, inf), par(n);
	vector<bool> vis(n);
	G.resize(n);
	for(int i = 0; i < m; ++ i) {
		int u, v;
		cin >> u >> v;
		--u, --v;
		G[u].push_back(v);
		G[v].push_back(u);
	};
	queue<int> Q;
	Q.push(0);
	dist[0] = 0;
	while(Q.size()) {
		int u = Q.front(); Q.pop();
		if(vis[u]) continue;
		vis[u] = true;
		for(auto v:G[u]) {
			if(dist[v] > dist[u] + 1) {
				dist[v] = dist[u] + 1;
				par[v] = u;
				Q.push(v);
			}
		}
	}
	for(int i = 0; i < n; ++ i) if(!vis[i]) return cout << "No\n", 0;
	cout << "Yes\n";
	for(int i = 1; i < n; ++ i) cout << par[i] + 1 << '\n';
}


Measured memory_bytes: 10652