akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>
#include<algorithm>
#include<iostream>
#include<queue>
#include<cmath>
#include<string.h>
#include<set>
#include<map>
#define LL long long
#define pr pair<int,int>
#define fr first
#define sc second
//#define mp make_pair
using namespace std;
LL read( ){LL sum=0;char c=getchar( );bool f=0;while(c<'0' || c>'9') {if(c=='-') f=1;c=getchar( );}while(c>='0' && c<='9') {sum=sum*10+c-'0';c=getchar( );}if(f) return -sum;return sum;}
void read(int &sum){sum=0;char c=getchar( );bool f=0;while(c<'0' || c>'9') {if(c=='-') f=1;c=getchar( );}while(c>='0' && c<='9') {sum=sum*10+c-'0';c=getchar( );}if(f) sum=-sum;}
void read(LL &sum){sum=0;char c=getchar( );bool f=0;while(c<'0' || c>'9') {if(c=='-') f=1;c=getchar( );}while(c>='0' && c<='9') {sum=sum*10+c-'0';c=getchar( );}if(f) sum=-sum;}
const int N=300005;
int n;
multiset<int>S;
int m,t,G[N];
int main( )
{
  int i,x;
  read(n);n=(1<<n);
  for(i=1;i<=n;i++)
    S.insert(-read( ));
  G[m=1]=*S.begin( );
  S.erase(S.begin( ));
  multiset<int>::iterator it;
  while(!S.empty( ))
    {
      t=m;
      for(i=1;i<=m;i++)
	{
	  it=S.upper_bound(G[i]);
	  if(it==S.end( )) {puts("No");return 0;}
	  G[++t]=*it;S.erase(it);
	}
      m=t;
    }
  puts("Yes");
  return 0;
}
      


Measured memory_bytes: 13568
#include <iostream>
#include <sstream>
using namespace std;
#include <bits/stdc++.h>
#include<utility>
#include <algorithm>
#include<iterator>
#define  go return 0
#define rep(i,n) for(int i=0;i<n;++i)
#define rep(j,m) for(int j=0;j<m;++j)
#define REP(i,n) for(int i=1;i<=n;++i)
#define all(v)   ((v).begin()), ((v).end())
#define len(s)   ((int)s.size())
#define F first
#define S second
#define pb push_back
#define pf push_front
#define mp make_pair
typedef long long ll;
typedef double db;
typedef vector<int> ve;
typedef vector< vector < int> > vee;
typedef vector<pair<ll,ll> > vepa;
typedef set<char>se;
typedef map<ll,ll> mpp;
const ll N=1e5+5;
ll arr[N],A[N],cnt[N];
bool visited[N];
bool f,ff;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
   double n;
   cin>>n;
    //cout << fixed << showpoint;
     //cout << setprecision(2);
    cout<< n*3.14*2.;
go;
}


Measured memory_bytes: 3792
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define rep2(i, s, n) for (ll i = s; i < (ll)(n); i++)
#define repr(i, n) for (ll i = n; i >= 0; i--)
#define pb push_back
#define COUT(x) cout << (x) << endl
#define COUTF(x) cout << setprecision(15) << (x) << endl
#define ENDL cout << endl
#define DF(x) x.erase(x.begin())  // 先頭文字削除
#define ALL(x) x.begin(), x.end()
#define SORT(x) sort(ALL(x))
#define REVERSE(x) reverse(ALL(x))
#ifdef _DEBUG
#define debug(x) cout << "[debug] " << #x << ": " << x << endl
#else
#define debug(x)
#endif
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using P = pair<ll, ll>;
constexpr ll INF = 0x3f3f3f3f3f3f3f3f;
constexpr double PI = 3.141592653589793238462643383279;
ll getDigit(ll x) {
  return x == 0 ? 1 : log10(x) + 1;
}

ll gcd(ll x, ll y) {
  return y ? gcd(y, x % y) : x;
}

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

vector<P> factorize(ll n) {
  vector<P> result;
  for (ll i = 2; i * i <= n; ++i) {
    if (n % i == 0) {
      result.pb({i, 0});
      while (n % i == 0) {
        n /= i;
        result.back().second++;
      }
    }
  }
  if (n != 1) {
    result.pb({n, 1});
  }
  return result;
}

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

signed main() {
  ll K;
  cin >> K;

  queue<ll> q;
  q.push(1);
  q.push(2);
  q.push(3);
  q.push(4);
  q.push(5);
  q.push(6);
  q.push(7);
  q.push(8);
  q.push(9);

  ll count = 0;
  ll num = 0;
  while (1) {
    num = q.front();
    q.pop();
    count++;
    if (count == K) {
      break;
    }
    if (num % 10 != 0) {
      q.push(10 * num + num % 10 - 1);
    }
    q.push(10 * num + num % 10);
    if (num % 10 != 9) {
      q.push(10 * num + num % 10 + 1);
    }
  }
  COUT(num);
  return 0;
}

Measured memory_bytes: 5132
#include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) for(int i = 0; i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define show(x)  cerr << #x << " = " << (x) << endl;
using namespace std;

int main(){
    int a,b,c;
    cin >> a >> b >> c;
    cout << ((b * 10 + c) % 4 == 0 ? "YES" : "NO") << endl;
}


Measured memory_bytes: 256
s = input()
A = [0] * (len(s) + 1)
for i, c in enumerate(s):
	if c == '<':
		A[i+1] = A[i] + 1
for i, c in enumerate(s[::-1]):
	if c == '>':
		x = len(s) - i
		A[x-1] = max(A[x-1], A[x] + 1)
print(sum(A))

Measured memory_bytes: 49992
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <cstdio>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <cmath>
#include <string>
#include <cstring>

using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	
	string in;
	cin>>in;
	map<char,int> all;
	for(int i=0;i<in.length();i++)
		all[in[i]]=1;
	if(all['a']+all['b']+all['c']==3)
		cout<<"Yes"<<endl;
	else
		cout<<"No"<<endl;
	
	return 0;
}

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

using namespace std;

int main(void)
{
  int n;

  cin>>n;

  if(n>99)
  {
    n=n%100;
    n=n%10;
  }
  else if(n>9)
  {
    n=n%10;
  }

  switch (n)
  {
  case 2:
  case 4:
  case 5:
  case 7:
  case 9:
  cout<<"hon"<<endl;
  break;
  case 0:
  case 1:
  case 6:
  case 8:
  cout<<"pon"<<endl;
  break;
  case 3:
  cout<<"bon"<<endl;
  break;
  }
  
}


Measured memory_bytes: 3636
import java.util.*;
import java.io.*;
import java.math.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        BigInteger max = new BigInteger("1000000000000000000");
        FastScanner sc = new FastScanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int n = sc.nextInt();
        String[] s = new String[n];
        for(int i = 0; i < n; i++){
            String b = sc.next();
            if(b.equals("0")){
                System.out.println(0);
                return;
            }
            s[i] = b;
        }
        BigInteger bi = new BigInteger("1");
        for(String b : s){
            BigInteger res = bi.multiply(new BigInteger(b));
            if(res.compareTo(max) > 0){
                System.out.println(-1);
                return;
            }
            bi = res;
        }
        out.println(bi);
        out.close();
    }
}

class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;
    public FastScanner(InputStream in) {
        reader = new BufferedReader(new InputStreamReader(in));
        tokenizer = null;
    }

    public String next() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public String nextLine() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken("\n");
    }

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

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

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

    public int[] nextIntArray(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = nextInt();
        return a;
    }

    public long[] nextLongArray(int n) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++)
            a[i] = nextLong();
        return a;
    } 
}

Measured memory_bytes: 51144
import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int N = in.nextInt(), X = in.nextInt(), T = in.nextInt();
        if(N % X == 0){
            System.out.println(N / X * T);
        }else{
            System.out.println((N / X + 1) * T);
        }
    }
}


Measured memory_bytes: 35656
import java.util.Scanner;

public class Main{
	public static void main(String[]args){
		//????????£????????????
		Scanner sc = new Scanner(System.in);
		//??\??????????????? W
		int W = sc.nextInt();
		//??\??????????????? H
		int H = sc.nextInt();
		//??\??????????????? x
		int x = sc.nextInt();
		//??\??????????????? y
		int y = sc.nextInt();
		//??\??????????????? ??????r
		int r = sc.nextInt();


		//x??¨r??????W????¶?????????????H????¶?????????????
		if(0 < (x+r)&& (x+r) <= W && 0 < (x+r) && (x+r) <= H){
			//y??¨r??????W????¶?????????????H????¶?????????????
			if(0 < (y+r)&& (y+r) <= W && 0 < (y+r) && (y+r) <= H){
				System.out.println("Yes");
			}else{
				System.out.println("No");
			}
		}else{
			System.out.println("No");
		}
	}
}

Measured memory_bytes: 26236
#include <stdio.h>
#include <vector>
#include <iostream>
#include <queue>
#include <bits/stdc++.h>
 
#define rep(i,n) for (int i=0;i<(n);++i)
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<double> vd;
typedef pair<int, int> pi;


int main() {
  string s;
  cin >> s;
  rep(i, s.size()) cout << "x";
  cout << endl;
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bitset>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<list>
#include<iomanip>
#include<cmath>
#include<cstring>
#include<functional>
using namespace std;

#define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repr(i, 0, n)
#define INF 2e9
#define MOD 1000000007
//#define MOD 998244353
#define LINF (long long)4e18
#define jck 3.141592

using ll = long long;
using Pi = pair<int,int>;
using Pl = pair<ll,ll>;

#define MAX 200000
ll fac[MAX];
ll finv[MAX];
ll inv[MAX];

void COMinit(){
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    repr(i,2,MAX){
        fac[i] = fac[i-1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD/i) % MOD;
        finv[i] = finv[i-1] * inv[i] % MOD;
    }
}



int main(){
    COMinit();
    int N; cin >> N;
    string S; cin >> S;
    int cntl = 0;
    int cntr = 0;
    ll ans = 1;
    rep(i,2*N){
        if((cntl-cntr) % 2 != 0){
            if(S[i] == 'W') cntl++;
            else{
                ans *= (cntl-cntr);
                ans %= MOD;
                cntr++;
            }
        }
        else{
            if(S[i] == 'B') cntl++;
            else{
                ans *= (cntl-cntr);
                ans %= MOD;
                cntr++;
            }
        }
        if(cntl < cntr){
            cout << 0 << endl;
            return 0;
        }
    }
    ans *= fac[N];
    ans %= MOD;
    if(cntl != cntr) cout << 0 << endl;
    else cout << ans << endl;
}

Measured memory_bytes: 5252
#define f(I)(p[I]+h[I]*(h[I]-2*h[i]))
long C,h[2<<17],p[2<<17],X,a;
P[2<<17];
s,t,x,y;
main(i){
	for(scanf("%*d%ld%ld",&C,h);~scanf("%ld",&a);){
		h[i]=a;
		for(;X=f(P[s]),s<t&&X>=f(P[s+1]);s++);
		p[i++]=X+=a*a+C;
		for(;s<t&&(h[y=P[t]]-h[x=P[t-1]])*(f(y)-f(i-1))>=(a-h[y])*(f(x)-f(y));t--);
		P[++t]=i-1;
	}
	printf("%ld",X);
}

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

int main() {
    int N, K;
    cin >> N >> K;
    
    unsigned long c = 0;
    unsigned long v0 = K;

    do{
        c += v0 * (N + 1 - v0) + 1;
    }while(++v0 <= N + 1);

    cout << c % 1000000007L << endl;
}

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

#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;




    int main(){
        long long a, b;
        std::cin >> a >> b;
        for (int i = 1; i <= b; ++i)
        {
            if ((a*i)%b == 0)
            {
                std::cout << a * i << "\n";
                break;
            }
        }
        return 0;
    }


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

int main() {
  int a;
  cin >> a;
  int res;
  if (a%1000!=0) res=(a/1000+1)*1000-a;
  if (a%1000==0) res=(a/1000)*1000-a;
  cout << res << endl;
  return 0;
}


Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using PII = pair<int, int>;
using VI = vector<int>;

const int N = 4005;
const ll mod = 1e9 + 7;
ll choose[N][N];

ll part(int n, int p) {
  if (n < 0) return 0;
  return choose[n + p - 1][p - 1];
}

int main() {
#ifdef LOCAL_EXEC
//	freopen("sample.in", "r", stdin);
//	freopen("sample.out", "w", stdout);
#else
  ios_base::sync_with_stdio(false); cin.tie(NULL);
#endif

  for (int n = 0; n < N; n++) {
    choose[n][0] = choose[n][n] = 1;
    for (int r = 1; r < n; r++) {
      choose[n][r] = (choose[n - 1][r] + choose[n - 1][r - 1]) % mod;
    }
  }

  int n, k; cin >> n >> k;
  int R = n - k, B = k;
  for (int i = 1; i <= k; i++) {
    ll ans = part(R - (i - 1), i + 1) * part(B - i, i) % mod;
    cout << ans << '\n';
  }

  return 0;
}


Measured memory_bytes: 81244
#include<stdio.h>


int main(){
 int N=0,num=0,i,j;
 int card[4][13];
 char M;


for(i=0;i<4;i++){
    for(j=0;j<13;j++)
        card[i][j]=0;
}

 scanf("%d",&num);
 for(i=0;i<num;i++){
    scanf(" %c %d",&M,&N);
 if(M=='S')
    card[0][N-1]=1;
 else if(M=='H')
    card[1][N-1]=1;
 else if(M=='C')
    card[2][N-1]=1;
 else if(M=='D')
    card[3][N-1]=1;
 }

for(i=0;i<4;i++){
    for(j=0;j<13;j++){
        if(card[i][j]==0){
            if(i==0)
                printf("S %d\n",j+1);
            else if(i==1)
                printf("H %d\n",j+1);
            else if(i==2)
                printf("C %d\n",j+1);
            else if(i==3)
                printf("D %d\n",j+1);
        }
    }
}


return 0;
}

Measured memory_bytes: 596
#include <bits/stdc++.h>
#define range(i, a, b) for(int i = (a); i < (b); i++)
#define rep(i, a) range(i, 0, a)
using namespace std;

int main() {
    int N, K;
    cin >> N >> K;
    vector <long long> t(N), diff;
    rep (i, N) {
        cin >> t[i];
        if (i != 0 && t[i] - t[i - 1] != 1) diff.push_back(t[i] - t[i - 1] - 1);
    }

    sort(diff.begin(), diff.end());

    long long ans = N;
    rep (i, (int)diff.size() - (K - 1)) ans += diff[i];
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 4736
n, a, b = map(int, input().split())

if (a - b) % 2 == 0:
    print(abs(a - b) // 2)
else:
    a, b = min(a, b), max(a, b)
    t = a + (b - a - 1) // 2
    k = (n - b + 1) + (- a + b - 1) // 2
    print(min(t, k))

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define FORR(i,b,e) for (common_type_t <decltype (b), decltype (e)> i = (e), i ## __begin = (b); i -- > i ## __begin;)
#define FOR_(i,b,e) for (common_type_t <decltype (b), decltype (e)> i = (b), i ## __end = (e); i < i ## __end; ++ i)
#define FOR(...) FOR_(__VA_ARGS__)
#define rep(i,n) for (decay_t <decltype (n)> i = 0, i ## __len = (n); i < i ## __len; ++ i)
#define ALL(x) begin (x), end (x)
#define TAIL(x) next (begin (x)), end (x)
using namespace std;

template <typename T = int64_t>
static constexpr auto inf = static_cast <T> (0x0de0b6b43b9aca00);

template <typename Iterator>
inline auto solve_impl (Iterator first, Iterator last, int64_t x)
{
  auto ite = lower_bound (first, last, x);
  auto res = inf <>;
  if (ite != last) res = min (res, abs (x - * ite));
  if (ite != first) res = min (res, abs (x - * prev (ite)));
  return res;
}

template <typename Iterator, typename Iterator2>
inline auto solve (Iterator first, Iterator last, Iterator2 first2, Iterator2 last2, int64_t x)
{
  auto ite = lower_bound (first, last, x);
  auto res = inf <>;
  if (ite != last) res = min (res, abs (x - * ite) + solve_impl (first2, last2, * ite));
  if (ite != first) res = min (res, abs (x - * prev (ite)) + solve_impl (first2, last2, * prev (ite)));
  return res;
}

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

  size_t A, B, Q;
  cin >> A >> B >> Q;

  vector <int64_t> s (A);
  rep (i, A) cin >> s [i];

  vector <int64_t> t (B);
  rep (i, B) cin >> t [i];

  rep (i, Q)
  {
    int64_t x;
    cin >> x;
    cout << min (solve (ALL (s), ALL (t), x), solve (ALL (t), ALL (s), x)) << endl;
  }
}


Measured memory_bytes: 2944
#include<iostream>
using namespace std;
int main()
{
    int K,A,B,i,j,flag=0;
    cin>>K>>A>>B;
    for(i=A;i<=B;i++)
    {
        if(i%K==0)
        {
             flag=1;
             break;
        }

    }
    if(flag==1)
        cout<<"OK"<<endl;
    else
        cout<<"NG"<<endl;
}


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

#define int long long
typedef pair<int, int> P;
#define mod 1000000007
#define INF (1LL<<60)
 
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define repi(itr, ds) for (auto itr = ds.begin(); itr != ds.end(); itr++)
#define YES puts("YES")
#define Yes puts("Yes")
#define NO  puts("NO")
#define No  puts("No")
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
 
const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };
 
 
#if 1
//-------------
// DUMPマクロ
// https://www.creativ.xyz/dump-cpp-652/
 
// vector
template <typename T>
istream& operator>>(istream& is, vector<T>& vec) {
    for (T& x : vec) is >> x;
    return is;
}
// pair
template <typename T, typename U>
ostream& operator<<(ostream& os, pair<T, U>& pair_var) {
    os << "(" << pair_var.first << ", " << pair_var.second << ")";
    return os;
}
// vector
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& vec) {
    os << "{";
    for (int i = 0; i < vec.size(); i++) {
        os << vec[i] << (i + 1 == vec.size() ? "" : ", ");
    }
    os << "}";
    return os;
}
// map
template <typename T, typename U>
ostream& operator<<(ostream& os, map<T, U>& map_var) {
    os << "{";
    repi(itr, map_var) {
        os << *itr;
        itr++;
        if (itr != map_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
// set
template <typename T>
ostream& operator<<(ostream& os, set<T>& set_var) {
    os << "{";
    repi(itr, set_var) {
        os << *itr;
        itr++;
        if (itr != set_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
 
#define DUMPOUT cerr
 
void dump_func() {
    DUMPOUT << endl;
}
template <class Head, class... Tail>
void dump_func(Head&& head, Tail&& ... tail) {
    DUMPOUT << head;
    if (sizeof...(Tail) > 0) {
        DUMPOUT << ", ";
    }
    dump_func(std::move(tail)...);
}
#ifdef _DEBUG
#define DEB
#define dump(...)                                                              \
    DUMPOUT << "  " << string(#__VA_ARGS__) << ": "                            \
            << "[" << to_string(__LINE__) << ":" << __FUNCTION__ << "]"        \
            << endl                                                            \
            << "    ",                                                         \
        dump_func(__VA_ARGS__)
#else
#define DEB if (false)
#define dump(...)
#endif
#endif



signed main() {

    int N;
    cin>>N;
    
    rep(i,N){
        char c; cin>>c;
        if(c=='Y'){cout << "Four"<<endl; return 0;}
    }
    cout<<"Three"<<endl;
    
    return 0;
}


Measured memory_bytes: 256
// D - Caracal vs Monster
// https://atcoder.jp/contests/abc153/tasks/abc153_d
#include <bits/stdc++.h>
#define lli long long int
#define uli unsigned long long int
#define rep(i, m, n) for (lli i = m; i < (n); i++)
#define repe(i, m, n) for (lli i = m; i <= (n); i++)
#define ALL(x) (x).begin(), (x).end()
#define SIZE(x) ((lli)(x).size())
#define MAX(x) *max_element(ALL(x))
const lli INF = 2147483647;
const lli MINF = -2147483648;
const lli LINF = 9223372036854775807;
const lli MOD = 1000000007; //10^9+7
const long double PI = acos(-1);
#define SORT(n) sort(n.begin(), n.end())
#define SORTR(n) sort(n.begin(), n.end(), greater<int>())
#define REV(n) reverse(n.begin(), n.end())
#define Vec(K, L, N, S) vector<L> K(N, S)
#define rt sqrt
#define pb push_back
#define eb emplace_back
#pragma GCC optimize("Ofast")
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vlli = vector<lli>;
using P = pair<lli, lli>;
// vector<P> vp;
// vp.emplace_back(a[i], b[i]);
using vs = vector<string>;
using ll = long long;
// vector入力
template <typename T>
istream &operator>>(istream &is, vector<T> &vec)
{
  for (T &x : vec)
    is >> x;
  return is;
}
// vector出力
template <typename T>
ostream &operator<<(ostream &os, vector<T> &vec)
{
  // os << '{';
  for (int i = 0; i < vec.size(); i++)
  {
    os << vec[i] << (i + 1 == vec.size() ? "" : "");
  }
  // os << '}';
  return os;
}

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  lli a, b, c, h, k, n, w, ans = 0, count = 0;
  string s, t;
  cin >> n;
  rep(i, 1, 100)
  {
    if (n >= pow(2, i - 1) && n <= pow(2, i))
    {
      ans = pow(2, i) - 1;
    }
  }

  cout << ans << "\n";
}

Measured memory_bytes: 384
using System;
using System.Linq;
using System.IO;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder {
    public class Program {
        static int[] getKeys(char delimiter) {
            var Keys = Console.ReadLine().Split(' ');
            int[] Ns = new int[Keys.Length];
            for (int i = 0; i < Keys.Length; i++) {
                Ns[i] = int.Parse(Keys[i]);
            }
            return Ns;
        }

        static void Main() {
            int N = int.Parse(Console.ReadLine());
            int Sum = 0;
            int Max = 0;
            for (int i = 0; i < N; i++) {
                int p = int.Parse(Console.ReadLine());
                Sum += p;
                Max = Math.Max(Max, p);
            }
            Console.WriteLine(Sum - Max / 2);
        }
    }
}


Measured memory_bytes: 11092
#include<iostream>
#include<algorithm>
#include <vector>

using namespace std;

int main() {
	int time[5];
	int timep[5];
	int sum=0;
	int pm = 1000;
	bool pf = false;
	vector<pair<int, int>> p;
	for (int i = 0; i < 5; i++)
	{
		cin >> time[i];
		if (time[i] % 10 != 0)
		{
			pf = true;
			if (pm > time[i] % 10)
			{
				pm = time[i] % 10;
			}
			time[i] -= time[i] % 10;
			time[i] += 10;
			
		}
		sum += time[i];
		//cout << sum << endl;
	}
	if(pf)
	{
		//cout << pm << endl;
			cout << sum - 10 + pm;
	}
	else
	{
		cout << sum;
	}
}

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

using namespace std;

const double PI = acos(-1);

int main()
{
  int a, b, c;
  cin >> a >> b >> c;
  double s, l, h;
  s = a * b * sin(c * PI / 180) / 2;
  l = a * 1. + b * 1. + sqrt(a * a + b * b - 2 * a * b * cos(c * PI / 180));
  h = s * 2. / a;
  cout << fixed << setprecision(20) << s << endl << l << endl << h << endl;
}



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

int main(){
  int n,q,l,r,count;
  vector<int> v;
  string s;
  cin >> n >> q >> s;
  int a[n];
  r(i,n-1){
    a[i+1]=a[i]+(s.at(i)=='A'&&s.at(i+1)=='C');
  }
  while(q--){
    cin >> l >> r;
    cout << a[r-1]-a[l-1] << endl;
    count=0;
  }
}


Measured memory_bytes: 1408
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
#include <map>
#include <queue>
#include <cassert>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define ALL(a) (a).begin(), (a).end()
#define rALL(a) (a).rbegin(), (a).rend()
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int iINF = 1001001001;
const long long llINF = 1LL << 60;
vector<ll> divisor(ll n)
{
    vector<ll> ret;
    for (ll i = 1; i * i <= n; ++i) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i * i != n)	ret.push_back(n / i);
        }
    }
    return ret;
}
int main()
{
    /*int a, b; cin >> a >> b;
    if (a < 10 && b < 10) cout << a * b << endl;
    else cout << -1 << endl;
    */

    /*int n; cin >> n;
    rep(i, 10) rep(j, 10) {
        if (n == i * j) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
    */

    ll n; cin >> n;
    vector<ll> d;
    d = divisor(n);
    sort(ALL(d));
    ll ans = 0;
    if (d.size() % 2 == 1) {
        ans += d[d.size() / 2] - 1;
        ans += d[d.size() / 2] - 1;
    }
    else {
        ans += d[d.size() / 2] - 1;
        ans += d[d.size() / 2 - 1] - 1;
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3624
#include <iostream>
#include <cmath>
#include <iomanip>
#include <cstdio>
#include <cstdlib>

using namespace std;

typedef unsigned long long int ulli;
typedef long long int lli;

#define MAX(x, y) ((x) < (y) ? (y) : (x))
#define MIN(x, y) ((x) > (y) ? (y) : (x))

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

    int A, P;
    cin >> A >> P;

    cout << (A * 3 + P) / 2 << "\n";

    return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,c,d,e,x,y;
	cin>>a>>b>>c>>d>>e;
	x=(c-a)*60;
	y=d-b;
	int ans=x+y-e;
	cout<<ans<<endl;
	return 0;
}


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

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

const int Max = 2e6 + 10;
const int Mod = 1e9 + 7;
const ll Inf = 1LL << 62;

int main() {
#ifdef Mr_Emrul
	freopen("inputf.in", "r", stdin);
#endif /// Mr_Emrul

	long double n, k;
	cin >> n >> k;
	long double ans = 0;
	for(int i = 1; i <= n; i++) {
		ll cur = i;
		int cnt = 0;
		while(cur < k) {
			cur *= 2LL;
			cnt += 1;
		}
		ans += (1 / n) * pow(0.5, cnt);
	}
	cout << setprecision(10) << fixed << ans << endl;
	return 0;
}

Measured memory_bytes: 512
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#define len(X) ((int)(X).size())

#ifdef __LOCAL
#define DBG(X) cout << #X << "=" << (X) << '\n';
#define SAY(X) cout << (X) << '\n';
#else
#define DBG(X)
#define SAY(X)
#endif

#define M_PI       3.14159265358979323846

using namespace std;

using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

const int INT_INF = (int)(2e9);
const ll  LL_INF = (ll)(2e18);

const int NIL = -1;
static mt19937 _g(time(nullptr));

inline ll randint(ll a, ll b) { ll w = (_g() << 31LL) ^ _g(); return a + w % (b - a + 1); }
inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T> inline T sign(T x) { return T(x > 0) - T(x < 0); }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline T fetch() { T ret; cin >> ret; return ret; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for (auto& elem : ret) cin >> elem; return ret; }

void solve()
{
    int N;

    std::cin >> N;

    string s;

    std::cin >> s;

    if (s.length() % 2 != 0)
    {
        std::cout << "No" << endl;
        return;
    }
    else
    {
        int mid = s.length() / 2;

        for (int i = 0; i < mid; ++i)
        {
            if (s[i] != s[mid + i])
            {
                std::cout << "No" << endl;
                return;
            }
        }
    }

    std::cout << "Yes" << endl;
    return;
}

int main()
{
    solve();

    return 0;
}

Measured memory_bytes: 256
Module Module1

sub Main(ByVal args() as String)
    dim N as integer = Console.ReadLine()
    dim arr() as string = Split(Console.ReadLine())
    dim a(N) as integer
    for i as integer = 0 to N-1 step 1
        a(i) = arr(i)
    next i
    Array.Sort(a)
    Array.Reverse(a)

    dim sumAlice as integer = 0
    dim sumBob as integer = 0
    for i as integer = 0 to N-1 step 1
        if i mod 2 = 0 then
            sumAlice += a(i)
        else
            sumBob += a(i)
        end if
    next i
    Console.WriteLine(sumAlice-sumBob)
end sub

end Module

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

using namespace std;

const int N = 200005;

struct vec {
	int x, y;
	int operator*(const vec &o) const {
		return x * o.x + y * o.y;
	}
	int dist(const vec &o) const {
		return abs(x - o.x) + abs(y - o.y);
	}
} pt[N];

int n;

int main() {
	scanf("%d", &n);
	
	for(int i = 0; i < n; i++) {
		scanf("%d %d", &pt[i].x, &pt[i].y);
	}

	array<vec, 4> best{pt[0], pt[0], pt[0], pt[0]};

	for(int i = 0; i < n; i++) {
		int id = 0;
		for(int j : {-1, 1}) for(int k : {-1, 1}) {
			vec tmp{j, k};
			if(tmp * pt[i] > tmp * best[id]) best[id] = pt[i];
			id++;
		}
	}

	int ans = 0;
	for(int i = 0; i < 4; i++) for(int j = i + 1; j < 4; j++) {
		ans = max(ans, best[i].dist(best[j]));
	}

	printf("%d\n", ans);
}


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

const int maxn = 100000 + 10;
int a[maxn][3];
int dp[maxn][3];

int main() {
	int n;
	scanf("%d", &n);
	for(int i = 0; i < n; i++)
		for(int j = 0; j < 3; j++)
			scanf("%d", &a[i][j]);

	for(int i = 0; i < 3; i++)
		dp[0][i] = a[0][i];

	for(int i = 1; i < n; i++) {
		for(int j = 0; j < 3; j++) {
			for(int k = 0; k < 3; k++) {
				if(j != k)
					dp[i][j] = max(dp[i][j], dp[i-1][k] + a[i][j]);
			}
		}
	}

	cout << *max_element(dp[n-1], dp[n-1] + 3) << endl;
}

Measured memory_bytes: 2560
#include<iostream>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<algorithm>

using namespace std;

#define int long long
#define rep(i,n) for(int i = 0; i < (n); i++)
#define INF ((long long)1e18)
#define EPS (1e-5)
#define MOD ((int)1e9+7)
#define endl "\n"

#define yn(f) ((f)?"Yes":"No")
#define YN(f) ((f)?"YES":"NO")


int used[10];
int hoge[10];



signed main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(10);
	
	int a, b, c;
	
	for(int i = 0; i < 3; i++){
		cin>>a>>b;
		used[a]++;
		used[b]++;
	}
	for(int i = 1; i <= 4; i++){
		hoge[used[i]]++;
	}
	
	cout<<YN(hoge[1] == 2 && hoge[2] == 2)<<endl;

	return 0;
}

Measured memory_bytes: 256
#!/usr/bin/env python3

# from numba import njit

# input = stdin.readline



# @njit
def solve(n,a,b):
  res = 0

  for i in range(n):
    res += (-a[i]-res) % b[i]

  return res



def main():
  N = int(input())
  a = [0]*N
  b = [0]*N
  for i in range(N):
    a[i],b[i] = map(int,input().split())
  print(solve(N,a[::-1],b[::-1]))
  return

if __name__ == '__main__':
  main()


Measured memory_bytes: 18352
#include <cstdio>

int main(){
	while(1){
		int h, w;
		scanf(" %d %d", &h, &w);
		if(h==0 && w==0) break;
		
		for(int i=0; i<h; ++i){
			for(int j=0; j<w; ++j){
				if( (i+j)%2==0 ) printf("#");
				else printf(".");
			}
			printf("\n");
		}
		printf("\n");

	}
	return 0;
}



Measured memory_bytes: 2700
#include <stdio.h>
#include <math.h>
int main()
{
long N;
  long m[10000000];
  for(long i=0; i<10000000;i++ ) m[i] = 1000000000000;
  long min = 0;
  long a=0;
scanf("%ld",&N);
  for(long i=1;i<=(long)sqrt(N);i++)
  {
if(N%i==0)
{long j=N/i;
   
   a++;
       m[a]=i+j-2;
      if (m[a]<=m[a-1])
      {
      min=m[a];
      }
   }
  }
  
  printf("%ld",min);
  return 0;
}


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

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;

  if (A+B > C+D) {
    cout << "Left" << endl;
  }
  else if (A+B == C+D){
    cout << "Balanced" << endl;
  }
  else if (A+B < C+D){
    cout << "Right" << endl;
  }
}

Measured memory_bytes: 256
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

using namespace std;

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

void intarrayinput(int sz,int a[]){for(int ___=0;___<sz;++___)scanf("%d",a+___);}
template<class T>T emin(T t1,T t2){if(t1>t2)return t1=t2;else return t1;}
template<class T>T emax(T t1,T t2){if(t1<t2)return t1=t2;else return t1;}
template<class T1,class T2>ostream& operator<<(ostream& out,pair<T1,T2> _p){out<<_p.first<<" "<<_p.second;return out;}
template<class T>ostream& operator<<(ostream& out,vector<T> _v){for(int i=0;i<_v.size();++i)out<<_v[i]<<' ';}
template<class T>void byebye(T t){cout<<t<<endl;exit(0);}
int n,k;
vector<int> nei[100005];
int d[100005];
priority_queue<pii, vector<pii>, greater<pii> > pq;
int a[100005];
int b[100005];
int main(){
	memset(d,-1,sizeof(d));
	scanf("%d",&n);
	for(int i=0;i<n-1;++i){
		scanf("%d%d",&a[i],&b[i]);
		--a[i],--b[i];
		nei[a[i]].push_back(b[i]);
		nei[b[i]].push_back(a[i]);
	}
	scanf("%d",&k);
	for(int i=0;i<k;++i){
		int v,p;
		scanf("%d%d",&v,&p);
		--v;
		d[v]=p;
		pq.push(pii(p,v));
	}
	while(!pq.empty()){
		pii p=pq.top();
		pq.pop();
		int v=p.second;
		for(int i=0;i<nei[v].size();++i){
			int u=nei[v][i];
			if(d[u]==-1){
				d[u]=d[v]+1;
				pq.push(pii(d[u],u));
			}
		}
	} 
	for(int i=0;i<n-1;++i){
		if(abs(d[a[i]]-d[b[i]])!=1)byebye("No");
	}
	puts("Yes");
	for(int i=0;i<n;++i)printf("%d\n",d[i]);
	return 0;
}




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

namespace ConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            var ss = Console.ReadLine().Split();
            var N = int.Parse(ss[0]);
            var L = int.Parse(ss[1]);

            var sum = 0;
            var absMin = int.MaxValue;
            var absMinVal = int.MaxValue;
            for (int i = 0; i < N; i++)
            {
                var current = L + i;
                sum += current;
                if (Math.Abs(current) < absMin)
                { 
                    absMin = Math.Abs(current);
                    absMinVal = current;
                }
            }

            Console.WriteLine(sum - absMinVal);
        }
    }
}

Measured memory_bytes: 13140
def inpl(): return [int(i) for i in input().split()]

N = int(input())
A, B = inpl()
P = inpl()

ctr1, ctr2, ctr3 = 0, 0, 0

for i in P:
    if i <= A:
        ctr1 += 1
    elif i <= B:
        ctr2 += 1
    else:
        ctr3 += 1
print(min(ctr1, ctr2, ctr3))

Measured memory_bytes: 3060
use proconio::input;

fn main() {
        input!{
                n: i64,
                m: i64,
                h: [i64; n]
        }

        let mut is_good = vec![true; n as usize];

        for _ in 0..m {
                input!{
                        a: usize,
                        b: usize,
                }
                match h[a - 1].cmp(&h[b - 1]) {
                        std::cmp::Ordering::Greater => is_good[b - 1] = false,
                        std::cmp::Ordering::Less => is_good[a - 1] = false,
                        std::cmp::Ordering::Equal => {is_good[a - 1] = false; is_good[b - 1] = false},
                }
        }

        let ans = is_good.iter().filter(|&&x| x).count();
        println!("{}", ans);
}

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

int main() {
  int n;
  cin >> n;
  int sum = 0;
  for(int i = 0; i < n; i++){
    int a;
    cin >> a;
    sum += a - 1;
  }

  cout << sum << endl;
  
}


Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
    int a, b;
    
    scanf("%d %d", &a, &b);
    
    if(a < b){
        printf("a < b\n");
    }
    else if(a > b){
        printf("a > b\n");
    }
    else{
        printf("a == b\n");
    }
    return 0;
}


Measured memory_bytes: 2120
#include <bits/stdc++.h>
using namespace std;
 
// 型名の省略
typedef unsigned int uint;
typedef long long lint;
typedef unsigned long long ulint;
 
const int MOD = 1000000007;
const lint INF = 1LL << 60;
const double PI=acos(-1.0);
 
// cinとcoutの高速化
#define endl "\n"
struct cinacc{cinacc(){cin.tie(0);ios::sync_with_stdio(false);}}cinaccc;
struct coutacc{coutacc(){cout.setf(ios::fixed);cout.precision(12);}}coutaccc;
 
// 繰り返し
#define rep(i,n) for(lint i=0;i<(lint)(n);i++)
#define reps(i,n) for(lint i=0;i<=(lint)(n);i++)
#define rrep(i,n) for(lint i=(lint)(n)-1;i>0;i--)
#define rreps(i,n) for(lint i=(lint)(n)-1;i>=0;i--)

#define pb push_back

#define ALL(s) (s.begin(), s.end())
#define SZ(s) (s.size())

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

// Union-Find-Tree
class UnionFind {
    vector<int> par;
    UnionFind(int n):par(n){rep(i,n)par[i]=i;}
    int root(int x){if(par[x]==x)return x;return par[x]=root(par[x]);}
    void unite(int x,int y){int rx=root(x);int ry=root(y);if(rx==ry)return;par[rx]=ry;}
    bool same(int x,int y){return root(x)==root(y);}
};

// Final Weapon!
// #define int lint

int main(void) {
    int k, n, total = 0, max = -1, a, b, f;
    cin >> k >> n;
    cin >> b;
    f = b;
    rep(i, n) {
        cin >> a;
        total += a - b;
        chmax(max, a - b);
        b = a;
    }
    total += k - a + f;
    chmax(max, k - a + f);
    
    cout << total - max;
    
    return 0;
}


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

using namespace std;

#define int long long
#define ar array
#define vt vector
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define sz(x) (int)(x).size()

#define F_OR(i, a, b, s) for (int i=(a); (s)>0?i<(b):i>(b); i+=(s))
#define F_OR1(e) F_OR(i, 0, e, 1)
#define F_OR2(i, e) F_OR(i, 0, e, 1)
#define F_OR3(i, b, e) F_OR(i, b, e, 1)
#define F_OR4(i, b, e, s) F_OR(i, b, e, s)
#define GET5(a, b, c, d, e, ...) e
#define F_ORC(...) GET5(__VA_ARGS__, F_OR4, F_OR3, F_OR2, F_OR1)
#define FOR(...) F_ORC(__VA_ARGS__)(__VA_ARGS__)
#define EACH(x, a) for (auto& x: a)

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

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

template<class A>
void read(vt<A> &v);

template<class A, size_t S>
void read(ar<A, S> &a);

template<class T>
void read(T &x) {
    cin >> x;
}

void read(double &d) {
    string t;
    read(t);
    d = stod(t);
}

void read(long double &d) {
    string t;
    read(t);
    d = stold(t);
}

template<class H, class... T>
void read(H &h, T &... t) {
    read(h);
    read(t...);
}

template<class A>
void read(vt<A> &x) {
    EACH(a, x)read(a);
}

template<class A, size_t S>
void read(array<A, S> &x) {
    EACH(a, x)read(a);
}

string to_string(char c) {
    return string(1, c);
}

string to_string(bool b) {
    return b ? "true" : "false";
}

string to_string(const char *s) {
    return string(s);
}

string to_string(string s) {
    return s;
}

string to_string(vt<bool> v) {
    string res;
    FOR(sz(v))res += char('0' + v[i]);
    return res;
}

template<size_t S>
string to_string(bitset<S> b) {
    string res;
    FOR(S)res += char('0' + b[i]);
    return res;
}

template<class T>
string to_string(T v) {
    bool f = 1;
    string res;
    EACH(x, v) {
        if (!f)
            res += ' ';
        f = 0;
        res += to_string(x);
    }
    return res;
}

template<class A>
void write(A x) {
    cout << to_string(x);
}

template<class H, class... T>
void write(const H &h, const T &... t) {
    write(h);
    write(t...);
}

void print() {
    write("\n");
}

template<class H, class... T>
void print(const H &h, const T &... t) {
    write(h);
    if (sizeof...(t))
        write(' ');
    print(t...);
}

template<class T, class U>
void vti(vt<T> &v, U x, size_t n) {
    v = vt<T>(n, x);
}

template<class T, class U>
void vti(vt<T> &v, U x, size_t n, size_t m...) {
    v = vt<T>(n);
    EACH(a, v)vti(a, x, m);
}


void solve() {
    int x, y;
    read(x, y);
    
    if (abs(x - y) <= 1) {
        print("Brown");
    }
    else{
        print("Alice");
    }
}

int32_t main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    
    int tt = 1;
    //read(tt);
    FOR(tt) {
        
        solve();
        
    }
    
}



Measured memory_bytes: 3640
# frozen_string_literal: true

n = gets.to_i
xy = n.times.map { gets.split.map(&:to_i) }

def dist(x0, y0, x1, y1)
  Math.sqrt((x0 - x1)**2 + (y0 - y1)**2)
end

total = 0
p = (0..(n - 1)).to_a.permutation(n)
p.each do |r|
  sum = 0
  1.upto(n - 1) do |i|
    sum += dist(xy[r[i]][0], xy[r[i]][1], xy[r[i - 1]][0], xy[r[i - 1]][1])
  end
  total += sum
end
puts total / p.size


Measured memory_bytes: 2172
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<stack>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<numeric>
#include<map>
#include<iostream>
using namespace std;
#define rep(i,n) for(int i = 0;i<((int)(n));i++)
#define reg(i,a,b) for(int i = ((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i = ((int)(n)-1);i>=0;i--)
#define ireg(i,a,b) for(int i = ((int)(b));i>=((int)(a));i--)
typedef long long ll;
typedef pair<ll, ll> mp;
ll mod = 1e9+7;
ll inf = 1e13+7;
//LLONG_MIN

//WA

int main(void){
	ll N,A,x[100010],dp[100010]={},dp2[100010]={};
	cin>>N>>A;
	rep(i,N){
		cin>>x[i];
		x[i]-=A;
	}
	dp[0+10000]=1;
	rep(i,N){
		reg(j,50,20000)dp2[j]=dp[j];
		reg(j,50,20000)dp[j+x[i]]+=dp2[j];
	}
	cout<<dp[10000]-1<<endl;
	return 0;
}

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

int main(){
	while(1){
		int n, w, bar[11];
		int mv=0; //maximum value
		for(int i=0; i<=10; ++i) bar[i]=0;
		
		scanf(" %d %d", &n, &w);
		if(n==0) break;
		for(int i=0; i<n; ++i){
			int v;
			scanf(" %d", &v);	
			bar[v/w]++;
			if(v>mv) mv=v;
		}
		
		int mw=mv/w; //max width
		int mb=0; //max bar
		for(int i=0; i<=10; ++i){
			if(bar[i]>mb) mb=bar[i];	
		}
		
		
		double ans=0.01;
		for(int i=0; i<=mw; ++i)
			ans+=( (double)(mw-i)/mw ) * ( (double)bar[i]/mb );
		printf("%.10lf\n", ans);
	}
}

Measured memory_bytes: 1224
#include<stdio.h>
int main(){
	int a[11]={},z[6]={};
	int i,j;
	int aiko,win,lose;
	while(1){
		
		for(i=0;i<5;i++){
			scanf("%d",&a[i]);
			if(a[i]==0) break;
			a[i+5]=a[i];
		}
		if(i!=5) break;
		for(i=0;i<5;i++){
			aiko=0; win=0; lose=0;
			for(j=i+1;j<5+i;j++){
				if(a[i]==1){
					if(a[i]+a[j]==2) aiko++;
					else if(a[i]+a[j]==3) win++;
					else if(a[i]+a[j]==4) lose++;
				}
				else if(a[i]==2){
					if(a[i]+a[j]==4) aiko++;
					else if(a[i]+a[j]==5) win++;
					else if(a[i]+a[j]==3) lose++;
				}
				else if(a[i]==3){
					if(a[i]+a[j]==6) aiko++;
					else if(a[i]+a[j]==5) lose++;
					else if(a[i]+a[j]==4) win++;
				}
			}
			if(win>=1 && lose>=1  || aiko==4) z[i]=3;
			else if(lose==0) z[i]=1;
			else if(win==0) z[i]=2;
		}
		for(j=0;j<5;j++) printf("%d\n",z[j]);
	}
return 0;
}

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

X = ["x"]*N
flag = True

for i in range(M):
    s, c = map(int, input().split())
    if X[s-1] == "x":
        X[s-1] = c
    elif X[s-1] != c:
        flag = False
        break

if N > 1 and X[0] == 0:
    flag = False

if N > 1 and X[0] == "x":
    X[0] = 1

if flag:
    for i in X:
        if i == "x":
            print(0 ,end="")
        else:
            print(i ,end="")
else:
    print(-1)

Measured memory_bytes: 3064
//----------------------------おまじない
#pragma GCC optimize ("O3")
#pragma GCC target ("tune=native")
#pragma GCC target ("avx")
//----------------------------
#define FOR(i,j,n) for (int i=(j);i<(n);i++)
#define REP(i,n) for (int i=0;i<(n);i++)
#define REPN(i,n) for (int i=(n);i>=0;i--)
#define I(n) scanf("%d", &(n))
#define LL(n) scanf("%lld", &(n))
#define pb(n) push_back((n))
#define mp(i,j) make_pair((i),(j))
#define eb(i,j) emplace_back((i),(j))
#include <bits/stdc++.h>
using namespace std;

int N,p[100010],ret;

int main(){
    I(N);
    REP(i,N) { I(p[i]); p[i]--; }
    bool flag = (p[0]==0);
    FOR(i,1,N){
        if(flag) {
            swap(p[i],p[i-1]);
            ret++;
            flag = false;
        } else {
            flag = (p[i]==i);
        }
    }
    cout << ret + flag << endl;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
const int SIZE = 1e5+9;

int n;
map<ll, int> a;

void No() {
    cout << "No" << endl;
    exit(0);
}

void Yes() {
    cout << "Yes" << endl;
    exit(0);
}


int main() {
    cin >> n;
    for(int i = 0; i < n; i++) {
        ll tmp;
        cin >> tmp;
        a[tmp]++;
    }
    int sz = a.size();

    if(a[0] != 0) {
        if(sz == 1)   Yes();
        if(sz != 2)   No();
        if(a[0]*3 != n && a[0]*3 - 1 != n && a[0]*3 + 1 != n)   No();
        Yes();
    }

    if(sz != 3)   No();
    for(auto x : a) {
        if(x.first == 0)    continue;
        if(x.second * 3 != n)   No();
    }

    vector<ll> a3;
    for(auto x : a) {
        if(x.first == 0)    continue;
        a3.push_back(x.first);
    }
    if( (a3[0] ^ a3[1]) == a3[2] || (a3[0] ^ a3[2]) == a3[1]) {
        Yes();
    }
    No();
}

Measured memory_bytes: 5120
#include<bits/stdc++.h>
using namespace std;
main(){
  char a[50][50];
  int w,h,f=0;
  cin>>h>>w;
  for(int i=0;i<h;i++)
    for(int j=0;j<w;j++)cin>>a[i][j];
  
  for(int i=0;i<h;i++)
    for(int j=0;j<w;j++)
      if(a[i][j]=='#'&& (a[i+1][j]=='.'&& a[i-1][j]=='.'&& a[i][j+1]=='.'&& a[i][j-1]=='.')){
	f=1;
	break;
      }
  if(f==1)cout<<"No"<<endl;
  else cout<<"Yes"<<endl;
}

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

vector<pair<ll,ll> > p;
int main(){
  ll h,w;
  cin >> h >> w;
  if(h==1 || w==1){
    cout << 1 << endl;
    return 0;
  }
  ll k= (h*w+2-1)/2;
  cout << k << endl;
  return 0;
}


Measured memory_bytes: 256