akhauriyash/Code-Regression huggingface dataset:
# include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pii pair<int,int>
typedef long long ll;
int n,byk[200005],bil;;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    cin>>n;
    for(int i=1;i<n;i++){
        cin>>bil;
        byk[bil]++;
    }
    for(int i=1;i<=n;i++){
        cout<<byk[i]<<endl;
    }
}

Measured memory_bytes: 4296
# -*- coding: utf-8 -*-
import sys 
from collections import Counter
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
cnt = Counter()

for i in range(N):
    cnt_2 = 0
    cnt_5 = 0
    a = float(readline())
    a = round(a*10**9)
    # a = int(a * (10**9))
    # print(a)
    while a % 2 == 0:
        a //= 2
        cnt_2 += 1
    while a % 5 == 0:
        a //= 5
        cnt_5 += 1
    cnt[(cnt_2-9,cnt_5-9)] += 1
    
ans = 0
for (x1,y1),c1 in cnt.items():
    for (x2,y2),c2 in cnt.items():
        if x1+x2 >= 0 and y1+y2 >= 0:
            if x1 == x2 and y1 == y2:
                ans += c1*(c1-1)
            else:
                ans += c1*c2

print(ans//2)

Measured memory_bytes: 75216
#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 VVVL(a, b, c, d)                                                       \
  vector<vector<vector<ll>>>(a, vector<vector<ll>>(b, vector<ll>(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);
  string S;
  cin >> S;
  if (S == "Sunny")
    cout << "Cloudy" << endl;
  else if (S == "Cloudy")
    cout << "Rainy" << endl;
  else
    cout << "Sunny" << endl;
  return 0;
}


Measured memory_bytes: 760
import sys

# import bisect
# from collections import Counter, deque, defaultdict

# import copy
# from heapq import heappush, heappop, heapify
# from fractions import gcd
import itertools
# from operator import attrgetter, itemgetter
# import math

# import numpy as np

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    n = int(input())
    nl = len(str(n))
    nums = [3, 5, 7]
    ans = 0



    for i in range(3, nl+1):
        a = itertools.product(nums, repeat=i)
        for elem in a:
            if len(set(elem)) == 3:
                x = ""
                for num in elem:
                    x += str(num)
                x = int(x)
                if x <= n:
                    ans += 1

    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 44396
#include <iostream>
#include <vector>
#define REP(i, n) for(int i = 0; i < (n); i++)

using namespace std;

vector<int> a;
int N;
int changeQ(int i)
{
  if (i >= N || a[i] == a[i + 1]) return 0;
  if (a[i] < a[i + 1]) return 1;
  else return -1;
}

int main()
{
  cin >> N;
  a.resize(N);
  REP(i, N) cin >> a[i];

  int q = changeQ(0);
  int ans = 0;
  REP(i, N - 1) {
    if (q == 0) q = changeQ(i);
    if (q == 1 && a[i] > a[i + 1]) {
      ans++;
      q = changeQ(i + 1);
    } else if (q == -1 && a[i] < a[i + 1]) {
      ans++;
      q = changeQ(i + 1);
    }
  }
  cout << (ans + 1) << endl;

  return 0;
}


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

using namespace std;
int cnt[27], n;
long long ans;
string s;
int main(){
    cin >> s;
    n = (int)s.size();
    for(int i = 0; i < n; i++){
        cnt[(int)s[i] - 'a']++;
    }
    ans = n * 1ll * (n - 1) / 2;
    for(int i = 0; i < n; i++){
        int c = (int)s[i] - 'a';
        cnt[c]--;
        ans -= cnt[c];
    }
    cout << ans + 1;
}


Measured memory_bytes: 640
import numpy,math

a = int(input())
moda = a % 10

if(moda == 2 or moda == 4 or moda == 5 or moda == 7 or moda == 9):
    print("hon")
if(moda == 0 or moda == 1 or moda == 6 or moda == 8):
    print("pon")
if(moda == 3):
    print("bon")

Measured memory_bytes: 27128
n, c, k = map(int, input().split())
t = sorted([int(input()) for _ in range(n)])
ans = 1
passenger = 0
limit = t[0] + k
 
for p in t:
    if passenger < c and p <= limit:
        passenger += 1
    else:
        ans += 1
        passenger = 1
        limit = p + k
print(ans)

Measured memory_bytes: 13996
#include <cstdio>
using namespace std;

char a[3];

inline int read()
{
	int x=0;char ch=getchar();bool f=false;
	while (ch<'0'||ch>'9'){if (ch=='-') f=true;ch=getchar();}
	while (ch>='0'&&ch<='9') x=(x<<3)+(x<<1)+ch-'0',ch=getchar();
	return f?-x:x;
}

int main()
{
	scanf("%s",a);
	for (int i=0;i<3;i++)
	{
		if (a[i]=='9') a[i]='1';
		else if (a[i]=='1') a[i]='9';
	}
	puts(a);
	return 0;
}

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

class dice {
    public:
    int top;
    int bottom;
    int north;
    int east;
    int south;
    int west;
    
    dice(int tin, int sin, int ein, int win, int nin, int bin) {
        top = tin;
        bottom = bin;
        north = nin;
        east = ein;
        south = sin;
        west = win;
    }
    
    void N() {
        int np = north;
        int tp = top;
        int sp = south;
        int bp = bottom;
        north = tp;
        top = sp;
        south = bp;
        bottom = np;
    }
    
    void S() {
        int np = north;
        int tp = top;
        int sp = south;
        int bp = bottom;
        north = bp;
        top = np;
        south = tp;
        bottom = sp;
    }
    
    void E() {
        int ep = east;
        int bp = bottom;
        int wp = west;
        int tp = top;
        east = tp;
        bottom = ep;
        west = bp;
        top = wp;
    }
    
    void W() {
        int ep = east;
        int bp = bottom;
        int wp = west;
        int tp = top;
        east = bp;
        bottom = wp;
        west = tp;
        top = ep;
    }
    
};


int main() {
  dice dice1(0, 0, 0, 0, 0, 0);
  cin >> dice1.top >> dice1.south >> dice1.east >> dice1.west >> dice1.north >> dice1.bottom;
  
  string X;
  cin >> X;
  int size = X.size();
  for (int i = 0; i<size; i++) {
      switch (X.at(i)) {
          case 'E': 
          dice1.E();
          break;
          case 'W':
          dice1.W();
          break;
          case 'N':
          dice1.N();
          break;
          case 'S':
          dice1.S();
          break;
      }
  }
  
  cout << dice1.top << endl;
  
  return 0;
}




Measured memory_bytes: 3180
N = int(input())
a_arr = input().split(' ')

for i in range(len(a_arr)):
    a_arr[i] = int(a_arr[i])

counter = {
        "two": 0,
        "for": 0,
        "one": 0
}

for j in range(len(a_arr)):
    if a_arr[j] % 4 == 0:
        counter['for'] += 1
    elif a_arr[j] % 2 == 0:
        counter['two'] += 1
    else:
        counter['one'] += 1

indicator = N - counter['two']/2

if counter['two'] % 2 != 0:
    counter['one'] += 1
    
if counter['one'] - counter['for'] <= 1:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 11100
#include <bits/stdc++.h>
#define FOR(i, a, b) for(int i=(a); i<(b); i++)
#define REP(i, n) FOR(i, 0, n)
#define all(x) (x).begin(), (x).end()
#define bit(x) (1L << (x))
using ll = long long;
using namespace std;

template<typename T>
vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
 
template<typename... Ts>
auto make_v(size_t a,Ts... ts){
    return vector<decltype(make_v(ts...))>(a,make_v(ts...));
}

int solve(int h, int w, const auto& g) {
    using p = pair<int, int>;
    int dy[] = {-1, 0, 1, 0}, dx[] = {0, -1, 0, 1};
    auto v = make_v(h, w, false);

    auto in = [&](int i, int j) {
        return 0 <= i && i < h && 0<= j && j < w;
    };

    function<void(int, int)> rec = [&](int y, int x) {
        v[y][x] = true; 

        REP(i, 4) {
            int ny = y + dy[i], nx = x + dx[i];
            if (in(ny, nx) && !v[ny][nx] && g[y][x] == g[ny][nx]) {
                rec(ny, nx);
            }
        }
    };

    int cnt = 0;
    REP(i, h)REP(j, w) {
        if (!v[i][j]) {
            rec(i, j);
            cnt++;
        }
    }

    return cnt;
}

int main() {
    int h, w;
    while (cin >> h >> w, h && w) {
        auto g = make_v(h, w, '0');
        REP(i, h)REP(j, w) cin >> g[i][j];

        cout << solve(h, w, g) << endl;
    }

    return 0;
}



Measured memory_bytes: 3796
program panasonic2020A
    implicit none
    integer(8)::L(32),K
    L=(/1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51/)
    read*,K
    print'(i0)',L(K)
end program panasonic2020A

Measured memory_bytes: 256
// {{{
#include <iostream>
#include <iomanip>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <complex>
#include <vector>
#include <list>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <string>
#include <algorithm>
#include <numeric>
using namespace std;

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define FOR(i, a, b) for(ll i = static_cast<ll>(a); i < static_cast<ll>(b); i++)
#define FORR(i, a, b) for(ll i = static_cast<ll>(a); i >= static_cast<ll>(b); i--)
#define REP(i, n) for(ll i = 0ll; i < static_cast<ll>(n); i++)
#define REPR(i, n) for(ll i = static_cast<ll>(n); i >= 0ll; i--)
#define ALL(x) (x).begin(), (x).end()

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> IP;
typedef pair<ll, LP> LLP;

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

constexpr int INF = 100000000;
constexpr ll LINF = 10000000000000000ll;
constexpr int MOD = static_cast<int>(1e9 + 7);
constexpr double EPS = 1e-9;
// }}}

ll r, d, x;

void solve()
{
    REP(i, 10){
        x = r * x - d;
        cout << x << endl;
    }
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> r >> d >> x;
    solve();
    return 0;
}

// vim:set foldmethod=marker:


Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
    int time;
    int hour, mintue, second, remain;

    scanf("%d", &time);
    
    hour = time / 3600;
    remain = time % 3600;
    mintue = remain / 60;
    remain = remain % 60;
    second = remain;

    printf("%d:%d:%d\n", hour, mintue, second);


    return 0;

}

Measured memory_bytes: 592
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N):
    read_all = [tuple(map(int, input().split())) for _ in range(N)]
    return map(list,zip(*read_all))

#################

from bisect import bisect_right

N,M = II()

a = []
b = []
for i in range(M):
    a0,b0 = II()
    a.append([a0-1,i])
    b.append([b0-2,i])

a.sort(key=lambda x:x[0])
b.sort(key=lambda x:x[0])
left = [a[i][0] for i in range(M)]
used = [False]*M

ans = 0
pb = 0
for r in b:
    if used[r[1]] == False:
        p = bisect_right(left,r[0])
        for i in range(pb,min(M,p)):
            used[a[i][1]] = True
        pb = p
        ans += 1
    else:
        continue

print(ans)

Measured memory_bytes: 80732
#include <bits/stdc++.h>
using namespace std;
int main()
{
    string s,t;
    cin>>s>>t;
    long long n=s.size(),flag=0,i;
    for(i=0;i<n;i++)
    {
        if(s[i]!=t[i])
        {
            flag=1;
            break;
        }
    }
    if(flag==0)
    {
        cout<<"Yes"<<endl;
    }
    else
    {
        cout<<"No"<<endl;
    }
    return 0;
}


Measured memory_bytes: 3624
#include <stdio.h>
#include <iostream>
#include <vector>
using namespace std;
int num[111111];
int nxt[111111];
int n, k, ans;
vector<int> edge[111111];

int dfs(int root)
{
	int ret=0;
	for(int i=0 ; i<edge[root].size() ; i++)
	{
		int add=dfs(edge[root][i]);
		if(root!=1 && add>=k-1)
		{
			ans++;
		}
		else
		{
			ret=max(ret,add+1);
		}
	}
	return ret;
}

int main(void)
{
	cin>>n>>k>>nxt[1];
	int i;
	if(nxt[1]!=1)
	{
		ans++;
		nxt[1]=1;
	}
	for(i=2 ; i<=n ; i++)
	{
		scanf("%d",&nxt[i]);
		edge[nxt[i]].push_back(i);
	}
	dfs(1);
	printf("%d",ans);
}

Measured memory_bytes: 11008
#include<stdio.h>

int main(){
  
  int A,B;
  scanf("%d %d\n",&A,&B);
  
  if(A+B==3)
    printf("3\n");
  else if(A+B==4)
    printf("2\n");
  else
    printf("1\n");
  
  return 0;
}

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

#define dump(...) do{print_vars(cout<<"# "<<#__VA_ARGS__<<'=',__VA_ARGS__);cout<<endl;}while(0)
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define peri(i,a,b) for(int i=int(b);i-->int(a);)
#define rep(i,n) repi(i,0,n)
#define per(i,n) peri(i,0,n)
#define all(c) begin(c),end(c)
#define mp make_pair
#define mt make_tuple

using uint=unsigned;
using ll=long long;
using ull=unsigned long long;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using vd=vector<double>;
using vvd=vector<vd>;
using vs=vector<string>;

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

void print_vars(ostream&){}
template<typename Car,typename... Cdr>
void print_vars(ostream& os,const Car& car,const Cdr&... cdr){
	print_vars(os<<car<<(sizeof...(cdr)?",":""),cdr...);
}

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

template<int I,typename Tuple>
void print_tuple(ostream&,const Tuple&){}
template<int I,typename Car,typename... Cdr,typename Tuple>
void print_tuple(ostream& os,const Tuple& t){
	os<<get<I>(t)<<(sizeof...(Cdr)?",":"");
	print_tuple<I+1,Cdr...>(os,t);
}
template<typename... Args>
ostream& operator<<(ostream& os,const tuple<Args...>& t){
	print_tuple<0,Args...>(os<<'(',t);
	return os<<')';
}

template<typename Ch,typename Tr,typename C>
basic_ostream<Ch,Tr>& operator<<(basic_ostream<Ch,Tr>& os,const C& c){
	os<<'[';
	for(auto i=begin(c);i!=end(c);++i)
		os<<(i==begin(c)?"":" ")<<*i;
	return os<<']';
}

constexpr int INF=1e9;
constexpr int MOD=1e9+7;
constexpr double EPS=1e-9;

int main()
{
	#ifndef _GLIBCXX_DEBUG
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	constexpr char endl='\n';
	#endif

	for(int n,k;cin>>n>>k&&n|k;){
		vi a(n);
		rep(i,n) cin>>a[i];

		map<int,int> f;
		for(int x:a) f[x]++;

		vi b;
		for(auto p:f) b.push_back(p.second);
		sort(all(b));

		int sum=0;
		rep(i,(int)b.size()-k) sum+=b[i];
		cout<<sum<<endl;
	}
}


Measured memory_bytes: 11640
#include <iostream>
#include <map>
#include <vector>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>
#include <climits>
#include <stack>
#include <queue>
#include <set>
#include <cctype>
#include <bitset>
#include <type_traits>

#include <list>
using namespace std;

#define REP(i, n) for (int i = 0; i < (n); ++i)
#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define YES(j) cout << (j ? "YES" : "NO") << endl;
#define Yes(j) std::cout << (j ? "Yes" : "No") << endl;
#define yes(j) std::cout << (j ? "yes" : "no") << endl;

int main(void)
{
    int n;
    cin >> n;
    vector<int> a, b, c;
    long long ans = 0;
    REP(i, n)
    {
        int t;
        cin >> t;
        a.push_back(t);
    }
    sort(a.begin(), a.end());
    REP(i, n)
    {
        int t;
        cin >> t;
        b.push_back(t);
    }
    sort(b.begin(), b.end());
    REP(i, n)
    {
        int t;
        cin >> t;
        c.push_back(t);
    }
    sort(c.begin(), c.end());

    REP(i, n)
    {
        int t = b[i];
        auto pos1 = lower_bound(a.begin(), a.end(), t);
        auto pos2 = upper_bound(c.begin(), c.end(), t);
        //cout << (pos1 - a.begin()) * (c.end() - pos2) << endl;
        ans += (pos1 - a.begin()) * (c.end() - pos2);
    }
    cout << ans << endl;
}


Measured memory_bytes: 1784
#include <bits/stdc++.h>
using namespace std;
int main ()
{
  int R;
  cin >> R;
  if ( R < 1200 )
  {
    cout <<"ABC" << endl;
  }
  else if ( R < 2800 )
  {
    cout << "ARC" << endl;
  }
  else
  {
    cout << "AGC" << endl;
  }
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <map>
#include <set>
#include <queue>
#include <stack>
using namespace std;
#define lowbit(x) (x&(-x))
#define max(x,y) (x>y?x:y)
#define min(x,y) (x<y?x:y)
#define MAX 100000000000000000
#define MOD 1000000007
#define pi acos(-1.0)
#define ei exp(1)
#define PI 3.141592653589793238462
#define INF 0x3f3f3f3f3f
#define mem(a) (memset(a,0,sizeof(a)))
typedef long long ll;
ll gcd(ll a,ll b){
    return b?gcd(b,a%b):a;
}
bool cmp(int x,int y)
{
    return x>y;
}
const int N=10005;
const int mod=1e9+7;
int main()
{
    std::ios::sync_with_stdio(false);
    string a;
    cin>>a;
    int len=a.length();
    stack <char> q ;
    for(int i=0;i<len;i++){
        if(a[i]=='1'){
            q.push('1');
        }
        else if(a[i]=='0'){
            q.push('0');
        }
        else if(a[i]=='B'){
            if(q.size()>0)
                q.pop();
        }
    }
    char b[20];
    int t=0;
    while(q.size()>0){
        b[t++]=q.top();
        q.pop();
    }
    int i;
    for(i=t-1;i>=0;i--){
        cout<<b[i];
    }
    cout<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define MEMSET(v, h) memset((v), h, sizeof(v))
#define pb push_back
#define mp make_pair
#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
using namespace std;

int main(){
  ll N,start;
  cin >> N >> start;
  ll x[N];
  vector<ll> sub;
  rep(i,N) cin >> x[i];
  
  rep(i,N){
    ll temp = abs(start-x[i]);
    sub.push_back(temp);
  }
  
  ll current_gcd = sub[0];
  for(int i=1;i<N;i++){
    current_gcd = __gcd(current_gcd, sub[i]);
  }
  
  cout << current_gcd << endl;



  return 0;
}


Measured memory_bytes: 2168
#include <stdio.h>

int main() {
    int a, b;
    scanf("%d %d", &a, &b);

    if (a == b) {
        printf("Draw\n");
        return 0;
    }
    if (a == 1) {
        a = 14;
    }
    if (b == 1) {
        b = 14;
    }

    if (a > b) {
        printf("Alice\n");
    } else {
        printf("Bob\n");
    }

    return 0;
}

Measured memory_bytes: 128
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <queue>
#include <vector>
#include <map>
#include <set>
#define MAXN 100005
#define P 998244353
#define G 3
#define INF 0x3f3f3f3f
#define rint register int
#define LL long long
#define LD long double
#define fuck printf("FUCK!!\n");
using namespace std;

int n, m, S, T, cnt, deg[MAXN], head[MAXN], vis[MAXN];

struct Edge {int next, to;} edge[MAXN*2];

queue<int> q;

void addedge(int from, int to)
{
    edge[++cnt].next=head[from];
    edge[cnt].to=to;
    deg[to]++;
    head[from]=cnt;
}

int main()
{
    scanf("%d%d", &n, &m);
    for(rint i=1, x, y; i<=m; ++i)
    {
        scanf("%d%d", &x, &y);
        addedge(x, y);
        addedge(y, x);
    }
    int num=0, flag=0;
    for(rint i=1; i<=n; ++i)
    {
        if(deg[i]&1) {printf("No\n"); return 0;}
        if(deg[i]>=6) flag=1;
        if(deg[i]==4) num++;
    }
    if(flag) {printf("Yes\n"); return 0;}
    if(num>=3) {printf("Yes\n"); return 0;}
    if(num<=1) {printf("No\n"); return 0;}
    num=0;
    for(rint i=1; i<=n; ++i)
        if(deg[i]==4)
        {
            if(S==0) S=i;
            T=i;
        }
    q.push(S);
    while(!q.empty())
    {
        int x=q.front(); q.pop();
        vis[x]=1;
        if(x==T) {num++; continue;}
        for(rint i=head[x]; i; i=edge[i].next)
        {
            int to=edge[i].to;
            if(vis[to])
            {
                if(to==T) num++;
                continue;
            }
            q.push(to);
        }
    }
    if(num==4) printf("No\n");
    else printf("Yes\n");
    return 0;
}

Measured memory_bytes: 2944
#include<cstdio>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<cstring>
#include<map>
int main(){
    int a,b,c;
    scanf("%d %d %d",&a,&b,&c);
    if(a <= c && c <= b)
        printf("Yes");
    else
        printf("No");
}


Measured memory_bytes: 256
#include<stdio.h>
#include<algorithm>
#include<queue>
using namespace std;
int dx[2][3]={{-1,1,0},{1,-1,0}};
int dy[2][3]={{0,0,1},{0,0,-1}};
int dd[2][3]={{1,2,0},{2,1,0}};
int dv[20][3]={
{4,1,5},
{0,2,6},
{1,3,7},
{2,4,8},
{3,0,9},
{11,10,0},
{12,11,1},
{13,12,2},
{14,13,3},
{10,14,4},
{9,5,15},
{5,6,16},
{6,7,17},
{7,8,18},
{8,9,19},
{16,19,10},
{17,15,11},
{18,16,12},
{19,17,13},
{15,18,14},
};
int bfs[230][230][21][3];
int ABS(int a){return max(a,-a);}
int main(){
	int a,b,c;
		int T=110;
		for(int i=0;i<230;i++)for(int j=0;j<230;j++)
			for(int k=0;k<21;k++)for(int l=0;l<3;l++)
				bfs[i][j][k][l]=-1;
		queue<pair<pair<int,int>,pair<int,int> >  >Q;
		Q.push(make_pair(make_pair(0,0),make_pair(0,0)));
		bfs[T][T][0][0]=0;
		while(Q.size()){
			int x=Q.front().first.first;
			int y=Q.front().first.second;
			int st=Q.front().second.first;
			int rot=Q.front().second.second;
			Q.pop();
		//	if(bfs[x+T][y+T][st][rot]<=5)printf("%d %d %d %d: %d\n",x,y,st,rot,bfs[x+T][y+T][st][rot]);
				
			int t=ABS(x+y)%2;
			for(int i=0;i<3;i++){
				int nx=x+dx[t][i];
				int ny=y+dy[t][i];
				int ns=dv[st][(rot+i)%3];
				int nd;
				for(int j=0;j<3;j++)if(dv[ns][j]==st){nd=(j+3-i)%3;break;}
				if(nx<-T||nx>T||ny<-T||ny>T)continue;
				if(!~bfs[nx+T][ny+T][ns][nd]){
					bfs[nx+T][ny+T][ns][nd]=bfs[x+T][y+T][st][rot]+1;
					Q.push(make_pair(make_pair(nx,ny),make_pair(ns,nd)));
				}
			}
		}
		
	while(scanf("%d%d%d",&a,&b,&c),a||b||c){
		int ret=99999999;
		for(int i=0;i<3;i++)if(~bfs[a+T][b+T][c][i])ret=min(ret,bfs[a+T][b+T][c][i]);
		printf("%d\n",ret);
	}
}

Measured memory_bytes: 14276
#include <iostream>
#include <vector>
using namespace std;
int main(){
    int N;
    cin >> N;
    vector<int> a(N + 1);
    for(int i = 1; i < N + 1; i++) cin >> a[i];
    vector<int> ko(N + 1, 0);
    int cnt = 0;
    for(int i = N; i > 0; i--){
        int t = 0;
        for(int j = i; j <= N; j += i){
            t += ko[j];
        }
        if(t % 2 != a[i]) {
            ko[i]++;
            cnt++;
        }
    }
    cout << cnt << endl;
    for(int i = 1; i <= N; i++){
        if(ko[i] == 1){
            cout << i << endl;
        }
    }
}

Measured memory_bytes: 4664
n = int(input())


def check(n, k):
    while n % k == 0:
        n = n // k
    if n >= k:
        n = n - k * (n // k)
    return n


def count(n):
    total = 0
    cands = set([n, n-1])
    for i in range(2, int(n ** 0.5) + 1):
        if n % i == 0:
            cands.add(i)
            cands.add(n // i)
    for i in range(2, int(n ** 0.5) + 1):
        if (n-1) % i == 0:
            cands.add(i)
            cands.add((n - 1) // i)
    for k in cands:
        if k == 1:
            continue
        if check(n, k) == 1:
            total += 1
    return total


print(count(n))

Measured memory_bytes: 41324
#include<bits/stdc++.h>
#define gc getchar()
using namespace std;
typedef long long ll;

template<class o> void read(o&x) {
	char c=gc; x=0; int f=1;
	while(!isdigit(c)){if(c=='-')f=-1; c=gc;}
	while(isdigit(c))x=x*10+c-'0',c=gc;
	x*=f;
}

int T;
ll n,a,b,c,d;
map<ll,ll> s;

ll f(ll n) {
	if(s.count(n)) return s[n];
	ll res=n<1e18/d?n*d:(ll)1e18;
	ll l1=(n/2)*2,r1=((n+1)/2)*2;
	ll l2=(n/3)*3,r2=((n+2)/3)*3;
	ll l3=(n/5)*5,r3=((n+4)/5)*5;
	res=min(res,(n-l1)*d+f(l1/2)+a);
	res=min(res,(r1-n)*d+f(r1/2)+a);
	res=min(res,(n-l2)*d+f(l2/3)+b);
	res=min(res,(r2-n)*d+f(r2/3)+b);
	res=min(res,(n-l3)*d+f(l3/5)+c);
	res=min(res,(r3-n)*d+f(r3/5)+c);
	return s[n]=res;
}

int main() {
	read(T); while(T--)
	 {
		read(n); read(a); read(b); read(c); read(d);
		s.clear(); s[0]=0; s[1]=d; printf("%lld\n",f(n));
	}
	return 0;
}

Measured memory_bytes: 4512
(R,),_,*A=$<.map{|l|l.split.map &:to_i}
e,*v={}
A.map{|y,x,a|(e[y]||=[])<<[a,x+=R];(e[x]||=[])<<[a,y]}
R.times{|z|q=[[z+1,0,c=[],d=[9e9]]]
(z,b,c,d=z
v[z]?v[z]==b||c<<-9e9:e[z]&.map{|a,w|q<<[w,a-b,d,c]}
c<<v[z]=b)while z=q.pop
c.min<-d.min&&$><<:No<<exit}
puts:Yes

Measured memory_bytes: 62596
# import sys
# import math #sqrt,gcd,pi
# import decimal
# import queue # queue
# import bisect
# import heapq # priolity-queue
# import time
# from itertools import product,permutations,\
#     combinations,combinations_with_replacement
# 重複あり順列、順列、組み合わせ、重複あり組み合わせ
# import collections # deque
# from operator import itemgetter,mul
# from fractions import Fraction
# from functools import reduce

mod = int(1e9+7)
INF = 1<<29
lINF = 1<<35

def readInt():
    return list(map(int,input().split()))

def main():
    n = int(input())
    s = set()
    for i in range(n):
        s.add(input())
    print(len(s))
    return

if __name__=='__main__':
    main()

Measured memory_bytes: 31072
#include <iostream>
using namespace std;
int main ()
{
    int A,B,z;
    cin >> A >>B ;
    if((A>=1&&A<=100)&&(B>=1&&B<=100) ){
           z= A-(2*B) ;
if((z)<=0){cout<<"0"<<endl;}
else{cout<<z<<endl;}
    }

    else if((A<=1||A>=100)||(B<=1||B>=100))
        {cout <<"error"<<endl;}


    return 0 ;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i = (m); i <= (n); i++)
#define zep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define printa(x,m,n) for(ll i = (m); i <= n; i++){cout << (x[i]) << " ";} cout<<endl;

ll base[2] = {10007, 10009};
ll mod[2] = {1000000007, 1000000009};
ll n, a[200008], b[200008], aa[200008][40], bb[200008][40], fb[2][200008], x[200008];
bool ans[200008], flag[200008];

int main(){
	cin.tie(0); ios::sync_with_stdio(false);
	
	cin >> n;
	zep(i, 0, n){cin >> a[i];}
	zep(i, 0, n){cin >> b[i];}
	zep(i, 0, n){
		zep(d, 0, 31){
			aa[i][d] = (a[i] & (1LL << d))? 1 : 0;	
			bb[i][d] = (b[i] & (1LL << d))? 1 : 0;	
		}
	}
	
	fb[0][0] = 1;
	fb[1][0] = 1;
	zep(i, 1, n){
		zep(j, 0, 1){
			fb[j][i] = (fb[j][i-1]*base[j])%mod[j];
		}
	}
	
	
	zep(k, 0, n){ans[k] = true;}
	memset(x, 0, sizeof(x));
	
	zep(d, 0, 31){
		ll hash[2] = {0, 0};

		zep(i, 0, n){
			zep(j, 0, 1){
				hash[j] += ((bb[i][d]+1)*fb[j][n-1-i])%mod[j];
				hash[j] %= mod[j];
			}
		}
		
		memset(flag, 0, sizeof(flag));
		
		//0^
		ll tmp[2] = {0, 0};
		zep(i, 0, n){
			zep(j, 0, 1){
				tmp[j] += ((aa[i][d]+1)*fb[j][n-1-i])%mod[j];
				tmp[j] %= mod[j];
			}
		}
		
		rep(k, 0, n){
			if(tmp[0] == hash[0] && tmp[1] == hash[1]){
				flag[k] = true;
			}
			
			zep(j, 0, 1){
				tmp[j] += mod[j]-(fb[j][n-1]*(aa[k][d]+1))%mod[j];
				tmp[j] %= mod[j];
				tmp[j] *= base[j];
				tmp[j] %= mod[j];
				tmp[j] += aa[k][d]+1;
				tmp[j] %= mod[j];
			}
		}
		
		//1^
		tmp[0] = 0;
		tmp[1] = 0;
		zep(i, 0, n){
			zep(j, 0, 1){
				tmp[j] += ((2-aa[i][d])*fb[j][n-1-i])%mod[j];
				tmp[j] %= mod[j];
			}
		}
		
		rep(k, 0, n){
			if(tmp[0] == hash[0] && tmp[1] == hash[1]){
				flag[k] = true;
				x[k] |= (1LL << d);
			}
			zep(j, 0, 1){
				tmp[j] += mod[j]-(fb[j][n-1]*(2-aa[k][d]))%mod[j];
				tmp[j] %= mod[j];
				tmp[j] *= base[j];
				tmp[j] %= mod[j];
				tmp[j] += 2-aa[k][d];
				tmp[j] %= mod[j];
			}
		}
		
		zep(i, 0, n){
			if(!flag[i]){
				ans[i] = false;
			}
		}
	}
	
	zep(k, 0, n){
		if(ans[k]){
			cout << k << " " << x[k] << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 136704
import math
n, d = map(int, input().split())
x = []
ans=0
for i in range(n):
        o = list(map(int, input().split()))
        x += [o]
for i in range(n):
        for j in range(i+1,n):
                dis_net = 0
                dis=0
                for u in range(d):
                        dis += (x[i][u] - x[j][u])** 2
                dis_net = math.sqrt(dis)
                if dis_net % 1 == 0 and dis_net>=1:
                        ans += 1
print(ans)

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

int main() {
  ll n, a, b;
  cin >> n >> a >> b;
  if ((b - a) % 2 == 0) {
    ll ans = (b - a) / 2;
    cout << ans << '\n';
  } else {
    ll ans = min(a - 1, n - b) + 1 + (b - a - 1) / 2;
    cout << ans << '\n';
  }
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back 
#define eb emplace_back
#define fn for(int i =0 ;i <n;i++)
#define fn1 for( int i =1;i<=n;i++)
#define fm for(int j =0 ;j <m;j++)
#define fm1 for(int j =1;j<=m;j++)
#define fi first
#define se second
#define endl '\n'
# define PI  3.14159265358979323846
#define MOD 1000000007
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
const int N = 2e6+5;
const int INF = 1e18L;
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << ": " << arg1 << 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...);
}
int ar[N];
int dp[N];
signed main(){
	// #ifndef ONLINE_JUDGE
	// freopen("input.txt","r",stdin);
	// freopen("output.txt","w",stdout);
	// #endif
	IOS;
	int T=1;
	// cin >> T;
	while(T--){
		int n,m;
		cin >> n >> m ;
		int tot= 0;
		fn1{
			cin >> ar[i];
			tot+=ar[i];
		}
		int cnt =0;
		fn1{
			if(tot<=ar[i]*4*m)cnt++;
		}
		cout <<(cnt<m?"No":"Yes");

	
	
	}
	cerr << "Time Taken : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
	return 0;
}

Measured memory_bytes: 2304
n,d = map(int,input().split())
a_list=[list(map(int,input().split())) for _ in range(n)]

count = 0
for i in range(n):
    if a_list[i][0] ** 2 + a_list[i][1] ** 2 <= d * d:
        count += 1

print(count)

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



int main() {
  int a, b, c, k;
  cin >> a >> b >> c >> k;
  if (k <= a) cout << k << endl;
  else if (k <= a+b) cout << a << endl;
  else cout << a - (k-(a+b)) << endl;
  return 0;
}

Measured memory_bytes: 3616
#include <iostream>
using namespace std;
int main() {
	int h, n;
	cin >> h;
	cin >> n;
	for(int i=0;i<n;++i){
		int a;
		cin>>a;
		h-=a;
		if(h<=0){
			cout<<"Yes"<<endl;
			return 0;
		}
	}
	cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>
#include <iostream>
using namespace std;

#define EPS (1e-10)
#define equals(a, b) (fabs(a - b) < EPS)

class Point{
public:
    double x, y;

    Point(double x_ = 0, double y_ = 0){
        x = x_;
        y = y_;
    }

    Point operator+ (Point p){
        return Point(x + p.x, y + p.y);
    };

    Point operator- (Point p){
        return Point(x - p.x, y - p.y);
    };

    Point operator* (double k){
        return Point(x * k, y * k);
    }

    Point operator/ (double k){
        return Point(x / k, y / k);
    }

    double norm(){
        return x * x + y * y;
    }

    double abs(){
        return sqrt(norm());
    }

    bool operator == (const Point &p) const{
        return fabs(x - p.x) < EPS && fabs(y - p.y) < EPS;
    }
};

typedef Point Vector;

double dot(Vector a, Vector b){
    return a.x * b.x + a.y * b.y;
}

double cross(Vector a, Vector b){
    return a.x * b.y - a.y * b.x;
}

bool isParallel(Vector a, Vector b){
    return equals(cross(a, b), 0.0);
}

bool isOrthogonal(Vector a, Vector b){
    return equals(dot(a, b), 0.0);
}
;
double getCos(Vector a, Vector b){
    return dot(a, b) / (a.abs() * b.abs());
}

double dist(Point p1, Point p2){
    return sqrt(pow((p1.x - p2.x), 2) + pow((p1.y - p2.y), 2));
}

Point projection(Point p1, Point p2, Point p0){
    if(p1 == p0){
        return p0;
    }
    if(p2 == p0){
        return p0;
    }
    return p1 + (p2 - p1) / (p2 - p1).abs() * (p0 - p1).abs() * getCos(p2 - p1, p0 - p1);
}

int main(){
    int xp1, yp1, xp2, yp2;
    scanf("%d", &xp1);
    scanf("%d", &yp1);
    scanf("%d", &xp2);
    scanf("%d", &yp2);

    Point p1 = Point(xp1, yp1);
    Point p2 = Point(xp2, yp2);

    int q;
    scanf("%d", &q);

    for(int i = 0; i < q; i++){
        int xp0, yp0;
        scanf("%d", &xp0);
        scanf("%d", &yp0);

        Point p = projection(p1, p2, Point(xp0, yp0));
        printf("%.10f %.10f\n", p.x, p.y);
    }
}




Measured memory_bytes: 3224
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>

#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define repi(i,a,b) for(int i = (a); i < (b); i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};
//射影
//基本的な考えは(x1,y1)と(x2,y2)の線分lに対して点Qに(xq,rq)のlを対称軸として点Rを(xr,yr)と点Qの中点を取れば点Qから線lへの垂線との交点が求まる
int main(){
	double x1,y1,x2,y2,xq,yq;
	double m,x,y,c;
	scanf("%lf %lf %lf %lf",&x1,&y1,&x2,&y2);
	int q;
	cin>>q;
	for(int i =0;i < q;i++){
		scanf("%lf %lf",&xq,&yq);
		if(x2==x1){
			xq *=-1;
			printf("%.9f %.9f\n",xq,yq);
		}else{
			m = (y2-y1)/(x2-x1);
			c = y2-m*x2;
			x = (2*m*yq-xq*(m*m-1)-2*m*c)/(m*m+1);
			y = (2*m*xq+yq*(m*m-1)+2*c)/(m*m+1);
			printf("%.9f %.9f\n", x, y);
		}
	}
	return 0;
}

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

int jump(int& pos, const string s, const int len) {
  int stack = 1;
  while (stack > 0) {
    pos++;
    if (pos >= len) break;
    // cout << "pos: " << pos << ", stack: " << stack << endl;
    if (s[pos] == '(') {
      stack++;
    }
    else {
      stack--;
    }
  }
  // cout << "last:: pos: " << pos << ", stack: " << stack << endl;
  return stack;
}


int main() {
  int N;
  cin >> N;
  string s;
  cin >> s;
  int pos = 0;
  int lp = 0, rp = 0;
  while (pos < N) {
    // cout << "pos: " << pos << endl;
    if (s[pos] == '(') {
      rp = jump(pos, s, N);
    }
    else {
      lp++;
    }
    pos++;
  }
  // cout << "lp:" << lp << ", rp:" << rp << endl;
  for (int i = 0; i < lp; i++) {
    cout << '(';
  }
  cout << s;
  for (int i = 0; i < rp; i++) {
    cout << ')';
  }
}

Measured memory_bytes: 888
#include<bits/stdc++.h>
using namespace std;
int main(){
  while(1){
    int n,m=0;
    int cnt[19];
    char c[109];
    cin>>n;
    if(n==0)break;
    for(int i=0;i<=n;i++)cnt[i]=0;
    for(int i=0;i<100;i++){
      cin>>c[i];
    }
    for(int i=0;i<100;i++){
      if(c[i]=='M'){
	cnt[i%n]++;
      }
      else if(c[i]=='S'){
	cnt[i%n]++;
	m+=cnt[i%n];
	cnt[i%n]=0;
      }
      else if(c[i]=='L'){
	cnt[i%n]++;
	cnt[i%n]+=m;
	m=0;
      }
    }
    sort(cnt,cnt+n);
    for(int i=0;i<n;i++){
      cout<<cnt[i]<<' ';
    }
    cout<<m<<endl;
  }
  return(0);
}



Measured memory_bytes: 3148
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <stdio.h>
#include <iomanip>
#include <limits>
#include <list>
#include <string>
#include <queue>
#include <deque>
#include <tuple>
#include <map>
#include <sstream>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define FOR(i,a,b) for(int i=a; i<(int)(b); i++)
#define ALL(x) (x).begin(),(x).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SORT(c) sort(ALL(x))
#define CLR(a) memset((a), 0 ,sizeof(a))
#define PB push_back
#define MP make_pair
#define SP << " " <<
const int INF = 1001001001;
const ll LINF = 100100100100100100;
const double EPS = 1e-10;
const long double PI  = acos(-1.0L);
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
#define chmax(a,b) a = (((a)<(b))?(b):(a))
#define chmin(a,b) a = (((a)>(b))?(b):(a))

__attribute__((constructor))
void initial(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

signed main(){
	int a; cin>>a; string s; cin>>s;
	if(a>=3200) cout << s;
	else cout << "red";
  return 0;
}


Measured memory_bytes: 256
input = STDIN.read.chomp.split(" ").map{|a| a.to_i}

N = input[0]
A = input[1]
B = input[2]

a = [A,B].min
b = (((A + B) - N) < 0) ? 0 : ((A + B) - N).abs

puts a.to_s + " " + b.to_s

Measured memory_bytes: 1788
n,m = list(map(int, input().split()))
p = list(map(int, input().split()))

# parentsには根の要素番号（自身が根の場合は、要素数（マイナスの値））が入る
parents = [-1] * (n + 1)
def find(x):
    if parents[x] < 0:
        return x
    else:
        parents[x] = find(parents[x])
        return parents[x]

def union(x, y):
    x = find(x)
    y = find(y)

    if x == y:
        return

    if parents[x] > parents[y]:
        x, y = y, x

    parents[x] += parents[y]
    parents[y] = x

def same(x, y):
    return find(x) == find(y)

for _ in range(m):
    x,y = list(map(int, input().split()))
    union(x,y)

# 同じグループ内では好きに入れ替えられる
ans = 0
for i,P in enumerate(p, 1):
    if i == P or same(i, P):
        ans += 1

print(ans)

Measured memory_bytes: 20280
#include <iostream>
using namespace std;
int n, a, b, i, l;

int main()
{
    cin>>n;
    for(int i=1; i<=n; i++)
    {
        cin>>a>>b;
        if(a==b) l++;
        else if(l>=3)
            {
             cout<<"Yes";
             return 0;
            }
            else l=0;

    }
    if(l>=3)
    {
        cout<<"Yes";
        return 0;
    }
    cout<<"No";
    return 0;
}



Measured memory_bytes: 3620
while s = gets
  n = s.length

  26.times{
    if s.include?("the") || s.include?("this") || s.include?("that")
      puts s
      break
    end

    for i in 0...n
      if "a"[0] <= s[i] && s[i] <= "z"[0]
        s[i] += 1
        s[i] = 'a' if s[i] > "z"[0]
      end
    end
  }
end

Measured memory_bytes: 2328
//ABC086C
#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <numeric>
#include <math.h>
#include <stdio.h>
#include <climits>
#include <cfloat>
#include <string>
#include <unordered_map>
using namespace std;

int main(){
	int n, k;
	cin >> n >> k;
	vector<int> num(200000);
	set<int> x;
	for(int i=0;i<200000;i++){
		num.at(i) = 0;
	}
	for(int i=0;i<n;i++){
		int a;
		cin >> a;
		num.at(a-1)++;
		x.insert(a);
	}
	if(x.size() <= k){
		cout << 0 << endl;
		return 0;
	}else{
		sort(num.begin(),num.end());
		int i = 0;
		int count = 0;
		int ans = 0;
		while(count < x.size()-k){
			if(num.at(i) != 0){
				ans += num.at(i);
				count++;
			}
			i++;
		}
		cout << ans << endl;
		return 0;
	}
}

Measured memory_bytes: 10368
using System;

namespace ABC074C
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] bufs = Console.ReadLine().Split(' ');
            int A = int.Parse(bufs[0]);
            int B = int.Parse(bufs[1]);
            int C = int.Parse(bufs[2]);
            int D = int.Parse(bufs[3]);
            int E = int.Parse(bufs[4]);
            int F = int.Parse(bufs[5]);

            int[] dp = new int[F + 1];


            for (int a = 0; a <= F / (100 * A); a++)
            {
                int capacityA = a * A * E;
                int waterA = a * A * 100;

                for (int b = 0; b <= Math.Max((F - waterA) / (100 * B), 0); b++)
                {
                    int capacityB = capacityA + b * B * E;
                    int waterB = waterA + b * B * 100;

                    for (int c = 0; c <= capacityB / C; c++)
                    {
                        int capacityC = capacityB - c * C;

                        for (int d = 0; d <= Math.Max(capacityC / D, 0); d++)
                        {
                            int sugar = c * C + d * D;
                            int weightEnd = waterB + sugar;
                            if (weightEnd <= F && dp[weightEnd] < sugar)
                            {
                                dp[weightEnd] = sugar;
                            }
                        }
                    }
                }
            }

            int resSugar = 0;
            int resWeight = 100 * A;
            double max = 0;

            for (int i = resWeight + 1; i <= F; i++)
            {
                double thick = (double)dp[i] / i;
                if (max < thick)
                {
                    max = thick;
                    resWeight = i;
                    resSugar = dp[i];
                }
            }

            Console.WriteLine("{0} {1}", resWeight, resSugar);
        }
    }
}


Measured memory_bytes: 11220
package main

import "fmt"

func main() {
	var k, s int
	fmt.Scan(&k, &s)

	count := 0
	for x := 0; x <= k; x++ {
		for y := 0; y <= k; y++ {
			z := s - x - y
			if z >= 0 && z <= k {
				count++
			}
		}
	}
	fmt.Println(count)
}


Measured memory_bytes: 512
S = gets.chomp

$atgc = ["A", "T", "G", "C"].freeze

def atgc?(s)
  len = s.length
  (0..(len-1)).each { |i| return false unless $atgc.include?(s[i]) }
  true
end

max = 0
len = S.length

(0..(len-1)).each { |start_idx|
  (1..(len - start_idx)).each { |l|
    max = [max, l].max if atgc?(S.slice(start_idx, l))
  }
}

puts max


Measured memory_bytes: 1788
import sys

n = int(input())
w = [input() for i in range(n)]

y = set(w)

if n != len(y):
    print("No")
    sys.exit()

for i in range(n - 1):
    if not w[i].endswith(w[i + 1][0]):
        print("No")
        sys.exit()

print("Yes")


Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define MAXN 100100
#define pii pair<int, int>
#define pb push_back
#define fi first
#define se second
typedef long long ll;

using namespace std;

int pai[MAXN];

void init(int n){
	for(int i=1; i<=n; i++){
		pai[i]=i;
	}
}

int find(int i){
	if(pai[i]==i)return i;
	return pai[i]=find(pai[i]);
}

int join(int a, int b){
	a=find(a);
	b=find(b);
	pai[a]=pai[b];
}

int n;
ll ans = 0;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
    cin >> n;
    init(n);
    vector<pair<pii, int> > s, r;
    for(int i = 0; i < n; i++){
    	pii p;
    	cin >> p.fi >> p.se;
    	s.pb({p, i});
    	r.pb({{p.se, p.fi}, i});
    }
    sort(s.begin(), s.end());
    sort(r.begin(), r.end());
    vector<pair<int, pii> > edges;
    for(int i = 0; i < n - 1; i++){
    	edges.pb({s[i + 1].fi.fi - s[i].fi.fi, {s[i].se, s[i + 1].se}});
    	edges.pb({r[i + 1].fi.fi - r[i].fi.fi, {r[i].se, r[i + 1].se}});
    }
    sort(edges.begin(), edges.end());
    for(auto e : edges){
    	int a = e.se.fi, b = e.se.se;
    	if(find(a) == find(b)) continue;
    	join(a, b);
    	ans += e.fi;
    }
    cout << ans;
}

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

using namespace std;
#define int int64_t
#define rep(i, n) for (int i = 0; i < (n); i++)
#define reps(i, n) for (int i = 1; i <= (n); i++)
#define all(x) (x).begin(), (x).end()
#define gsort(x) sort((x).begin(), (x).end(), greater<int>())
#define rv(s) reverse((s).begin(), (s).end())
#define pii pair<int, int>
#define re(s) reverse((s).begin(), (s).end())
#define setout(n, x) setw(n) << setfill(x)
#define Fixed fixed << setprecision(10);
#define pb(x, a) (x).push_back(a)
#define fb(x, a) (x).flont_back(a)
constexpr int INF = 0x3f3f3f3f;
constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const long long mod = 1e9 + 7;

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

   int n, m, a, b, c, d, e, cnt = 0, ans = 0, wa, ac;
   string s, v, sv[10010];
   vector<int> x, y, z;
   priority_queue<int> pr;
   priority_queue<int, vector<int>, greater<int>> gpr;

   cin >> s;

   s[0] += ('2' - '1');
   cout << s << '\n';
}

Measured memory_bytes: 384
#include <cstdio>
#include <queue>
#include <algorithm>

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

using namespace std;

typedef pair<int, int> P;

const int inf = 1e9;

struct E{
	E(int t, int c): t(t), c(c){}
	int t, c;
};

int n, m, s;
vector<E> g[100000];
int d[100000];

int main(){
	scanf("%d%d%d", &n, &m, &s);
	rep(i, m){
		int a, b, c;
		scanf("%d%d%d", &a, &b, &c);
		g[a].push_back(E(b, c));
	}

	fill_n(d, n, inf);

	priority_queue<P, vector<P>, greater<P> > q;
	d[s] = 0;
	q.push(P(0, s));
	while(!q.empty()){
		P v = q.top();
		q.pop();
		if(v.first > d[v.second]){
			continue;
		}
		rep(i, g[v.second].size()){
			E e = g[v.second][i];
			if(d[e.t] > d[v.second] + e.c){
				d[e.t] = d[v.second] + e.c;
				q.push(P(d[e.t], e.t));
			}
		}
	}

	rep(i, n){
		if(d[i] != inf){
			printf("%d\n", d[i]);
		}
		else{
			puts("INF");
		}
	}
	return 0;
}

Measured memory_bytes: 11164
#include <iostream>
#include <vector>
#include <unordered_map>
#include <deque>
#include <list>
#include <set>
#include <random>
#include <deque>

using namespace std;
using ll = long long;
const int BIG = 100000007;


int main() {
    ll n;
    cin >> n;
    cout << (n >= 30 ? "Yes" : "No") << endl;
}




Measured memory_bytes: 3104
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int64_t i=0; i<(int64_t)(n); i++)
#define all(v) v.begin(), v.end()
//c
int main(){
  
  int N, M, X; cin >> N >> M >> X;
  vector<int> C(N);
  vector<vector<int>> A(N, vector<int> (M));
  rep(i, N){
    cin >> C[i];
    rep(j, M) cin >> A[i][j];
  }
  
  int ans=(1<<30);
  
  for (int tmp = 0; tmp < (1 << 12); tmp++) {
    
    vector<int> skill(M);
    int money=0;
    bitset<12> s(tmp);
    
    rep(i, N){
      if(s.test(i)){
        money += C[i];
        rep(j, M){
          skill[j] += A[i][j];
        }
      }
    }
    
    rep(i, M){
      if(skill[i]<X) goto skip;
    }
    if(money<ans) ans = money;
    
    skip: continue;
    
  }
  
  if(ans == (1 << 30)) ans = -1;

  cout << ans << endl;
  
}

Measured memory_bytes: 3636