akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <string.h>
#define HASHTABLE_SIZE 2000
#define SPELL_LENGTH 191
#define NULL_INDEX -1

char hashtable[HASHTABLE_SIZE][SPELL_LENGTH+1]; /* 配列から取り出せる全ての文字列 */
int flag[HASHTABLE_SIZE];
int maxl, maxi;

/* 文字列の最初の2文字からハッシュ値を求める */
int hash(const char* s) {
	int i, h = 0, a = 3141, b = 2718;
	for (i = 0; s[i] != '\0' && i < 2; i++, a = a * b % (HASHTABLE_SIZE - 1)) h = (a * h + s[i]) % HASHTABLE_SIZE;
	return h;
}

/* ハッシュ表を初期化する */
void init() {
	int i;
	for (i = 0; i < HASHTABLE_SIZE; i++) flag[i] = 0;
	maxl = 0;
}

int add(const char* s) {
	int i, j;
	/* これまでに追加した文字列と比較する */
	for (i = hash(s); flag[i]; i = (i + 1) % HASHTABLE_SIZE) {
		for (j = 0; s[j] != '\0' && hashtable[i][j] != '\0' && s[j] == hashtable[i][j]; j++);
		if (j > maxl) {
			/* 最も長い文字列 */
			maxl = j;
			maxi = i;
		} else if (j == maxl) {
			/* 長さが等しい場合は辞書順で最も若い文字列 */
			if (strncmp(s, hashtable[maxi], maxl) < 0) maxi = i;
		}
	}
	/* 新しい文字列を追加する */
	strncpy(hashtable[i], s, SPELL_LENGTH + 1);
	flag[i] = 1;
	return i;
}

int VECTOR[8][2] = {{0, 1}, {1, 1}, {1, 0}, {1, -1}, {0, -1}, {-1, -1}, {-1, 0}, {-1, 1}};

int main(void) {
	int h, w; /* 文字配列の大きさ */
	char data[10][20];
	int i, j, k;

	/* データセット毎の処理 */
	while (scanf("%d%d\n", &h, &w) == 2 && h >= 3 && h <= 10 && w >= 3 && w <= 20) {
		/* 文字配列を読み込む */
		for (i = 0; i < h; i++) for (j = 0; j < w; j++) {
			scanf("%c\n", &data[i][j]);
		}

		init(); /* 初期化 */

		/* 配列から取り出せる全ての文字列を探索する */
		for (i = 0; i < h; i++) for (j = 0; j < w; j++) /* 始点 */ for (k = 0; k < 8; k++) /* 方向 */ {
			/* 文字列を取り出す */
			int used[10*20] = {}; /* 配列中のある文字を使ったか */
			int ii = i, jj = j; /* 現在の参照位置 */
			char s[SPELL_LENGTH] = {}; /* 取り出した文字列 */
			int l; /* 長さ */
			for (l = 0; used[w*ii+jj] == 0; l++, ii = (h + ii + VECTOR[k][0]) % h, jj = (w + jj + VECTOR[k][1]) % w) {
				used[w*ii+jj] = 1;
				s[l] = data[ii][jj]; /* 1文字加える */
			}
			/* これまでに取り出した文字列と比較する */
			add(s);
		}

		/* 出力 */
		if (maxl < 2) {
			printf("0\n");
		} else {
			hashtable[maxi][maxl] = '\0';
			printf("%s\n", hashtable[maxi]);
		}
	}

	return 0;
}

Measured memory_bytes: 992
use std::io::{stdin, Read, StdinLock};
use std::str::FromStr;
use std::vec::Vec;
use std::{vec, cmp, num};


struct Scanner<'a> {
    cin: StdinLock<'a>,
}

impl<'a> Scanner<'a> {
    fn new(cin: StdinLock<'a>) -> Scanner<'a> {
        Scanner {cin: cin}
    }

    fn read1<T: FromStr>(&mut self) -> Option<T> {
        let token = self.cin.by_ref().bytes().map(|c| c.unwrap() as char)
                    .skip_while(|c| c.is_whitespace())
                    .take_while(|c| !c.is_whitespace())
                    .collect::<String>();
        token.parse::<T>().ok()
    }

    fn read<T: FromStr>(&mut self) -> T {
        self.read1().unwrap()
    }
}

// create Vec<char> from String
#[allow(dead_code)]
fn to_chars(s: String) -> vec::Vec<char> {
    let mut cs = s.chars();
    let mut res = vec::Vec::new();
    while let Some(c) = cs.next() {
        res.push(c);
    }
    res
}

fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin);
    let a: i32 = sc.read();
    let b: i32 = sc.read();
    println!("{}", (a + b + 1) / 2);
}

Measured memory_bytes: 4352
N=int(input())
li=list(map(int,input().split()))
ans_odd=[]
ans_even=[]
if N%2==0:
    ans_normal=li[::2]
    ans_rev=li[1::2]
else:
    ans_rev=li[::2]
    ans_normal=li[1::2]  
ans_rev.reverse()
ans=ans_rev+ans_normal
for n in range(N):
    ans[n]=str(ans[n])
print(' '.join(ans))


Measured memory_bytes: 121972
s=list(input())
n=len(s)
dic={"0":"1","1":"0"}

temp=[]
temp.append(s[0])
ans=0
for i in range(1,n):
    temp.append(dic[temp[i-1]])

for i in range(n):
    if temp[i]!=s[i]:
        ans+=1
print(ans) 

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

using namespace std;

typedef long long ll;


ll gcd(ll a, ll b) {
while(true) {
if (a < b) swap(a, b);
if (!b) break;
a %= b;
}
return a;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(15);
    ll N, X;
    cin >> N >> X;
    vector<ll> x(N);
    cin >> x[0];
    x[0] -= X;
    for (int i = 1; i < N; ++i) {
        cin >> x[i];
        x[i] -= X;
    }
    if (N == 1) {
        cout << abs(x[0]) << endl;
        return 0;
    }
    ll div(gcd(abs(x[0]), abs(x[1])));
    for (int i = 2; i < N; ++i) {
        div = gcd(div, abs(x[i]));
    }
    cout << div << endl;;
}



Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#define rep(i,n) for(int i = 0; i < n; i++)
#define ll long long
#define INF 100000000
#define uint unsigned int
using namespace std;


int main() {
	int a, b, c, d, e, k;
	cin >> a >> b >> c >> d >> e >> k;
	if (e - a > k) {
		cout << ":(" << endl;
	}
	else {
		cout << "Yay!" << endl;
	}
}


Measured memory_bytes: 256
#include <iostream>
#include<cstring>
#include<string>
using namespace std;
string s1,s2;
void cdu()
{
	for(int i=0;i<s2.size();i++)
	{
		if(s1[0]==s2[i])
		{
			string s3;
			for(int j=0;j<s1.size();j++)
			{
				s3+=s2[(i+j>=s2.size())?i+j-s2.size():i+j];
			}
			if(s3==s1)
			{
				cout<<"Yes"<<endl;return;
			}
		}
	}
	cout<<"No"<<endl;return;
}
int main ()
{
	cin>>s1>>s2;
	cdu();
}


Measured memory_bytes: 256
import java.util.*;
public class Main{
    Scanner sc=new Scanner(System.in);
    int n,q;
    int C=0;
    int[] S,T;
    int left,mid,right;
    public void input(){
        n=sc.nextInt();
        S=new int[n];
        for(int i=0;i<n;i++) S[i]=sc.nextInt();
        q=sc.nextInt();
        T=new int[q];
        for(int i=0;i<q;i++) T[i]=sc.nextInt();
    }
    public void search(){
        for(int i=0;i<q;i++){
            left=0;
            right=S.length;
            while(left<right){
                mid=(left+right)/2;
                if(T[i]==S[mid]){
                    C++;
                    break;
                }else if(T[i]>S[mid]){
                    left=mid+1;
                }else{
                    right=mid;
                }
            }
        }
        System.out.println(C);
    }
    public static void main(String[] args) {
        Main bs=new Main();
        bs.input();
        bs.search();
    }
}


Measured memory_bytes: 69196
#include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <cstring>
#include <cmath>
#include <climits>
#include <ctime>
#include <fstream>
#include <functional>
#define endl '\n'
#define ll long long
#define mod 1000000007
#define NCONS 1000000000
//#define NCONS 100001
//#define NCONS 1001
//#define NCONS 101
#define MCONS 2001
#define LIMIT 1000000000
#define TRUE 1
#define FALSE 0
#define toRadian(degree) ((degree) * (M_PI / 180.))
#define toDegree(radian) ((radian) * (180. / M_PI))
using namespace std;
struct Point{int x; int y;};
struct PPoint{Point x; Point y;};
inline ll gcd(ll a, ll b) { if(a < b) swap(a, b); if(b <= 0) return a; return gcd(b, a % b); }


int main(void)
{
    cin.tie(NULL); ios_base::sync_with_stdio(false);
    int A, P; cin >> A >> P;
    
    A *= 3;
    A += P;
    cout << A / 2 << endl;
   
    return 0;
}


Measured memory_bytes: 892
#include <iostream>
#include <algorithm>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <vector>
#include <queue>
#include <cmath>
#include <bitset>
#include <complex>
#include <functional>
#include <numeric>
#include <iomanip>

// output
#define SPBR(w, n) std::cout<<(w + 1 == n ? '\n' : ' ');
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
// utility
#define ALL(i) (i).begin(), (i).end()
#define FOR(i, a, n) for(int i=(a);i<(n);++i)
#define RFOR(i, a, n) for(int i=(n)-1;i>=(a);--i)
#define REP(i, n) for(int i=0;i<int(n);++i)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define IN(a, x, b) (a<=x && x<b)
#define OUT(a, x, b) (x<a || b<=x)
template<class T> inline T chmax(T & a, const T b) { return a = (a < b) ? b : a; }
template<class T> inline T chmin(T& a, const T b) { return a = (a > b) ? b : a; }

// type/const
#define int ll
using ll = long long;
using ull = unsigned long long;
using ld = long double;
const int MOD = 1000000007;
/* const int MOD = 998244353; */
const int INF = 1e18;
const double PI = acos(-1);

using namespace std;
struct INIT { INIT(){
  cin.tie(0); ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
}}INIT;


signed main() {
  int H, W, A, B; 
  cin >> H >> W >> A >> B;

  REP(i, H){
    REP(j, W){
      if((i < B && j < A) || (i >= B && j >= A)) cout << 1;
      else cout << 0;
    }
    cout << "\n";
  }

  return 0;
}

Measured memory_bytes: 1280
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
const double PI = 4*atan(1);
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3f;
const double EPS = 1e-9;
const string YES = "Possible";
const string NO = "Impossible";
#define pb push_back
#define mp make_pair

int S, W;

void solve()
{
	if(W >= S) cout << "unsafe\n";
	else cout << "safe\n";
}

int main()
{
	ios::sync_with_stdio(false);
	cin >> S >> W;
	solve();
	return 0;
}

Measured memory_bytes: 3652
a=[2, 1, 3, 4, 7, 11, 18, 29, 47, 76, 123, 199, 322, 521, 843, 1364, 2207, 3571, 5778, 9349, 15127, 24476, 39603, 64079, 103682, 167761, 271443, 439204, 710647, 1149851, 1860498, 3010349, 4870847, 7881196, 12752043, 20633239, 33385282, 54018521, 87403803, 141422324, 228826127, 370248451, 599074578, 969323029, 1568397607, 2537720636, 4106118243, 6643838879, 10749957122, 17393796001, 28143753123, 45537549124, 73681302247, 119218851371, 192900153618, 312119004989, 505019158607, 817138163596, 
1322157322203, 2139295485799, 3461452808002, 5600748293801, 9062201101803, 14662949395604, 23725150497407, 38388099893011, 62113250390418, 100501350283429, 162614600673847, 263115950957276, 425730551631123, 688846502588399, 1114577054219522, 1803423556807921, 2918000611027443, 4721424167835364, 7639424778862807, 12360848946698171, 20000273725560978, 32361122672259149, 52361396397820127, 84722519070079276, 137083915467899403, 221806434537978679, 358890350005878082, 580696784543856761, 939587134549734843, 1520283919093591604]
print(a[int(input())])

Measured memory_bytes: 9240
#include<stdio.h>
#include<iostream>
#include<bitset>
#include<vector>

///using namespace std;


int main(void) {
	std::string s;
	std::cin >> s;
	int index_a, index_z;

	//search A
	for (int i = 0; i < s.length(); i++)
		if (s[i] == 'A') {
			index_a = i;
			break;
		}
	//serch Z
	for(int i = s.length() -1;i >= 0;i--)
		if (s[i] == 'Z') {
			index_z = i;
			break;
		}

	std::cout << (index_z - index_a + 1) << std::endl;
	
	system("pause");
}



Measured memory_bytes: 764
#include<bits/stdc++.h>
using namespace std;
int n,m,ans,sz;
vector<int> g[200005];
bool vis[200005];
void dfs(int x){
    vis[x]=1;
    sz++;
    for(int &y:g[x])if(!vis[y]){
        dfs(y);
    }
}
signed main(void){
	cin>>n>>m;
    for(int i=1;i<=m;i++){
        static int u,v;
        cin>>u>>v;
        g[u].emplace_back(v);
        g[v].emplace_back(u);
    }
    for(int i=1;i<=n;i++)if(!vis[i]){
        sz=0;
        dfs(i);
        ans=max(ans,sz);
    }
    cout<<ans<<endl;
	return 0;
}

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

Measured memory_bytes: 1728
#include <stdlib.h>
#include <assert.h> //assert
#include <iostream>
#include <algorithm>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <string.h>
#include <string>
#include <queue>
#include <sstream>
#include <iomanip> //precision
using namespace std;
#define precision(x) setprecision(x) << fixed
typedef pair<int, int> pii;
typedef long long ll;
typedef vector<vector<ll > > matrix;
const ll mod = 1000000007LL;

const int MAX_N = 1001;

int a, b;


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

	cin >> a >> b;
	if (a >= 13) cout << b;
	else if (a >= 6) cout << b / 2;
	else cout << 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin>>n;
	int t=0;
	bool k=true;
	for(int i=0;;i++)	
	{
		for(int j=2;j<=sqrt(n+i);j++)
		{
			if((n+i)%j==0)
			{
				k=false;
				break;
			}	
	    }
		if(k==true)
		{
			cout<<n+i;
			return 0;
		}
		k=true;
	}
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<stdio.h>
#include<algorithm>
#include<math.h>
using namespace std;
int main() {
	int n, r;
	cin >> n >> r;
	if (10 <= n) {
		cout << r << endl;
	}
	else {
		cout << r + 100 * (10 - n) << endl;
	}
	return 0;
}

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

using namespace std;
using ll = long long;

int main() {
    int n;
    cin>>n;
    map<int,int> st;
    vector<vector<int>> v(n);
    for(int i = 0;i < n;++i) {
        int a,b,c;
        cin>>a>>b>>c;
        v[i].emplace_back(a);
        v[i].emplace_back(b);
        v[i].emplace_back(c);
    }
    vector<int> ans(n,0);
    for(int k = 0;k < 3;++k) {
        st.clear();
        for(int i = 0;i < n;++i) {
            st[v[i][k]]++;
        }
        for(int i = 0;i < n;++i) {
            if(st[v[i][k]]==1)ans[i]+=v[i][k];
        }
    }
    for(int i = 0;i < n;++i) {
        cout<<ans[i]<<endl;
    }
    return 0;
}



Measured memory_bytes: 3128
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;

int main()
{
    long long X;
    cin >> X;
    long long cur = 100;
    long long year = 0;
    while (true)
    {
        ++year;
        cur += cur / 100;
        if (cur >= X) break;
    }
    cout << year << endl;
    return 0;
}


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

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

    ll int ara[T][2];
    ll int ans=0,add=0;
    for(int i=0; i<T; i++) {
        cin>>ara[i][0]>>ara[i][1];
    }
    for(int i=T-1; i>=0; i--) {
        ll int a=ara[i][0]+add+ara[i][1]-1;
        ll int b=a/ara[i][1];
        b*=ara[i][1];
        add+=b-ara[i][0]-add;

    }
    cout<<add<<"\n";
}


Measured memory_bytes: 1792
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))

ans = B[A[0]-1]
for k in range(1,N):
    ans += B[A[k]-1]
    if A[k-1]+1 == A[k]:
        ans += C[A[k-1]-1]
print(ans)


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

int main() {
    int N;
    cin >> N;
    if (N % 3 == 0) {
        for (int i = 0; i < N; ++i) {
            for (int j = 0; j < N; ++j) {
                if ((i % 3 == 0 && j % 3 != 0) || (j % 3 == 0 && i % 3 != 0)) cout << 'a';
                else cout << '.';
            }
            cout << '\n';
        }
    }
    else if (N > 3) {
        string b[4] = { "", ".", "..", "..." };
        string s[4][7] = { { "aacd", "ddcd", "bcaa", "bcdd" }, 
        { "aabba", "bcc.a", "b..cb", "a..cb", "abbaa" },
        { "aabc..", "ddbc.. ", "..aabc", "..ddbc", "bc..aa", "bc..dd" },
        { "aabbcc.", "dd.dd.a", "..d..da", "..d..db", "dd.dd.b", "..d..dc", "..d..dc" }};
        int d = N % 4;
        for (int i = 0; i < 4 * (N / 4 - 1); ++i) {
            for (int j = 0; j < N / 4; ++j) {
                if (i / 4 == j) cout << s[0][i % 4];
                else cout << "....";
            }
            cout << b[d] << '\n';
        }
        for (int i = 0; i < 4 + d; ++i) {
            for (int j = 0; j < N - d - 4; ++j) cout << '.';
            cout << s[d][i] << '\n';
        }
    }
    else {
        cout << -1 << '\n';
    }
}

Measured memory_bytes: 1280
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const int N = (int)1e3 + 34;
const ld EPS = 1e-8;

vector<int> es[N];
bool ue[N][N];
int col[N];
vector<int> sz[2] = {{0}, {0}};
bool fail;

void dfs(int v, int cl) {
    if (col[v] != -1 && col[v] != cl) {
        fail = true;
        return;
    }
    if (col[v] != -1) return;
    col[v] = cl;
    sz[cl].back()++;

    for (int w: es[v]) {
        dfs(w, 1 - cl);
    }
}

void solve() {
    fail = false;
    sz[0].clear();
    sz[1].clear();
    for (int i = 0; i < N; i++) {
        col[i] = -1;
        es[i].clear();
        for (int j = 0; j < N; j++) {
            ue[i][j] = false;
        }
    }
    int n, m, v1, v2;
    cin >> n >> m;
    for (int i = 0; i < m; i++) {
        cin >> v1 >> v2;
        v1--;
        v2--;
        ue[v1][v2] = ue[v2][v1] = true;
    }
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if (i != j && !ue[i][j]) {
                es[i].push_back(j);
            }
        }
    }
    for (int i = 0; i < n; i++) {
        if (col[i] != -1) continue;
        sz[0].push_back(0);
        sz[1].push_back(0);
        dfs(i, 0);
    }

    if (fail) {
        cout << -1 << "\n";
        return;
    }

    vector<bool> dp(N, false);
    int mn = 0;
    for (int i = 0; i < (int)sz[0].size(); i++) {
        mn += min(sz[0][i], sz[1][i]);
    }
    dp[mn] = true;

    for (int i = 0; i < (int)sz[0].size(); i++) {
        int a = sz[0][i];
        int b = sz[1][i];
        int d = max(a, b) - min(a, b);
        for (int j = N - 1; j >= 0; j--) {
            if (j - d >= 0 && dp[j - d]) dp[j] = true;
        }
    }

    int ans = n * n * 2;
    for (int i = 0; i < N; i++) {
        if (dp[i]) ans = min(ans, i * (i - 1) + (n - i) * (n - i - 1));
    }

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

int main() {
#ifdef SERT
    freopen("a.in", "r", stdin);
    solve();
    solve();
    solve();
#endif
    solve();
    return 0;
}

Measured memory_bytes: 4096
#include<bits/stdc++.h>
using namespace std;
int main(){
    string S;
    while(1){
        cin>>S;
        if(S=="-") break;
        int n;
        cin>>n;
        for(int i=0;i<n;i++){
            int k;
            cin>>k;
            string take=S.substr(0,k);
            S.erase(0,k);
            S=S+take;
        }
        cout<<S<<endl;
    }
}


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

using namespace std;

int main()
{
	string S;
	cin >> S;

	string res = "Good";
	for (int i = 0; i < 3; i++)
	{
		if (S[i] == S[i + 1])
		{
			res = "Bad";
		}
	}

	cout << res << endl;
}



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

int main(){
  int n;cin>>n;
  vector<double> v(n);for(int i=0;i<n;i++){cin>>v.at(i);}
  sort(v.begin(),v.end());
  double ans=v.at(0);
  for(int i=1;i<n;++i){
    ans=(ans+v.at(i))/2;
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();// 几个500
		int B = sc.nextInt();// 几个100
		int C = sc.nextInt();// 几个50
		int X = sc.nextInt();
		int ans = 0;
		int i,j,k;
		for (i = 0; i <= A; i++) {
			for (j = 0; j <= B; j++) {
				for (k = 0; k <= C; k++) {
					if (500 * i + 100 * j + 50 * k == X)
						ans+=1;
				}
			}
		}
		System.out.println(ans);

		
	}
}

Measured memory_bytes: 21460
function Main(input){
  var arr = input.split(" ").map(x => parseInt(x,10));
  var a = Math.max.apply(null,arr);
  var b = Math.min.apply(null,arr);
  console.log(a - b);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7500
#include <vector>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>
#include <tuple>
#include <set>
#include <map>
#include <unordered_map>
#include <complex>
#include <iomanip>
#include <cmath>
using namespace std;
typedef long long ll;

int main()
{
  char x, y;
  cin >> x >> y;
  if (x > y) cout << ">" << endl;
  else if (x == y) cout << "=" << endl;
  else cout << "<" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define eb emplace_back
#define mod (1000000007)
 
// vector<long long int> temp(40002);//long int vis[1000002] = {0};
  // vector<long int> g[1000002];
int main() {
 
  long long int t = 1;
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
 
 //cin >> t;
  while(t--){
 
  long long int n,m,x = 0,y = 0,start = 0,end = 0,index = 0,z;

      cin >> n;
      long int arr[n];

      for(int i = 0;i<n;i++)
       cin >> arr[i];

      long int b[n];
      b[0] = 0;b[1] = abs(arr[1]-arr[0]);
     
      for(int i = 2;i<n;i++)
      {
          b[i] = min(b[i-1]+abs(arr[i]-arr[i-1]),b[i-2]+abs(arr[i]-arr[i-2]));
      }

      
      cout << b[n-1] << endl;
  } 
}


Measured memory_bytes: 5188
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <bitset>
#include<vector>
#include<cstdlib>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
const ll MOD = 1e9 + 7;
#define rep(i,k) for(int i=0;i<k;i++)
ll n, m, i, j, k, o, p, l, z,q,x,y;
ll a[100005], b[100005], inf = 1000000000000;
vector<vector<ll>> den(105);
ll s[100005], t[100005], xx[100005] = {};
ll facto[10000001];
const int MAX = 1000003;
long long fac[MAX], finv[MAX], inv[MAX];
ll combination(ll n, ll r) {
	if (n == r)
		return(1);
	else if (r == 0)
		return(1);
	else if (r == 1)
		return(n);
	else
		return((combination(n - 1, r - 1) + combination(n - 1, r))%MOD);
}
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

// 二項係数計算
long long COM(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}


int main() {
	cin >>x>>y ;

	n = (x + y) / 3;
	if ((x + y) % 3 != 0 ) {
		cout << 0;
		return 0;
	}
	o = x-n;
	p = n-o;
	if(o<0 || p<0) {
		cout << 0;
		return 0;
	}
	COMinit();

	cout << COM(n,o);

	return 0;
}


Measured memory_bytes: 26880
import java.util.Scanner;

public class Main {

	static int n;
	static int a[] = new int[20];
	static int b[] = new int[20];
	static int c[] = new int[20];

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextInt();
		}
		for (int i = 0; i < n; i++) {
			b[i] = sc.nextInt();
		}
		for (int i = 0; i < n - 1; i++) {
			c[i] = sc.nextInt();
		}

		int manzokudo = 0;
		manzokudo += b[a[0] - 1];
		for (int i = 1; i < n; i++) {
			manzokudo += b[a[i] - 1];
			if (a[i] == a[i - 1] + 1)
				manzokudo += c[a[i - 1] - 1];
		}
		System.out.println(manzokudo);

	}

}


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


void solve(long long N, long long D, long long A, std::vector<long long> X, std::vector<long long> H){
    vector<pair<long long,long long>> pairs(N);
    for(int i=0;i<N;i++){
        pairs[i] = make_pair(X[i],H[i]);
    }
    sort(pairs.begin(),pairs.end());
    sort(X.begin(),X.end());
    long long ans =0;
    vector<ll> field(N,0);
    for(int i=0;i<N;i++){
        if(i>0){
            field[i] += field[i-1];
        }
        pairs[i].second -=field[i];
        if(pairs[i].second>0){
            int count = (pairs[i].second+A-1)/A;
            // cerr <<"i="<<i<<"count="<<count  << endl;
            ans+=count;
            field[i] += (count*A);
            auto itr =upper_bound(X.begin(),X.end(),X[i]+2*D);
            if(itr!=X.end()){
                field[itr-X.begin()] -=(count*A);
                cerr << itr-X.begin() << endl;
            }
        }
    }
    cout << ans << endl;

}

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


Measured memory_bytes: 8064
#include <iostream>
#include <vector>

using namespace std;

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

    int ans = 0;
    for(int i=1; i<n-1; i++) {
        if((p[i]-p[i-1]) * (p[i+1]-p[i]) > 0) {
            ++ans;
        }
    }

    cout << ans << endl;
    return 0;
}


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

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

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

const int N = 2010;
const ll mod = 924844033;

ll fact[N], invf[N];

ll add(ll x, ll y){
    return (x+y)%mod;
}

ll mul(ll x, ll y){
    return (x%mod)*(y%mod)%mod;
}

ll powll(ll x, ll y){
    ll res = 1LL;
    while(y){
        if (y & 1LL)
            res *= x;
        res %= mod;
        x = (x*x) % mod;
        y >>= 1LL;
    }
    return res;
}

ll divll(ll x, ll y){
    return (x * powll(y,mod-2)) % mod;
}

ll nPr(ll n, ll r){
    if (n < r || r < 0) return 0;
    return mul(fact[n], invf[n-r]);
}

ll nCr(ll n, ll r){
    if (n < r || r < 0) return 0;
    return mul(mul(fact[n], invf[r]), invf[n-r]);
}



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

    fact[0] = invf[0] = 1;
    FOR(i,1,N-1){
        fact[i] = (fact[i-1] * i) % mod;
        invf[i] = divll(invf[i-1], i);
    }

    VL dp(n+1);
    dp[0] = 1;

    REP(i,k){
        ll l = (n - i - 1) / k;
        if (l <= 0) break;
        VL dpo(dp);
        dp.assign(n+1, 0);
        REP(i,n+1){
            REP(j,(l+1)/2+1){
                if (i + j > n) continue;
                dp[i+j] = (dp[i+j] + dpo[i] * nCr(l+1-j,j)) % mod;
            }
        }
    }
    REP(i,k){
        ll l = (n - i - 1) / k;
        if (l <= 0) break;
        VL dpo(dp);
        dp.assign(n+1, 0);
        REP(i,n+1){
            REP(j,(l+1)/2+1){
                if (i + j > n) continue;
                dp[i+j] = (dp[i+j] + dpo[i] * nCr(l+1-j,j)) % mod;
            }
        }
    }

    // REP(i,n+1) cout << dp[i] << endl;

    ll ans = 0;
    REP(i,n+1){
        if (i % 2 == 0){
            ans = (ans + dp[i] * fact[n - i]) % mod;
        }else{
            ans = (ans - dp[i] * fact[n - i]) % mod;
            ans = (ans + mod) % mod;
        }
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi,factorial
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

n,k=MI()
lis=LI()
dp=[[0]*(k+1) for i in range(n+1)]
dp[0][0]=1
for i in range(n):
    sm=0
    for j in range(lis[i]+1):
        sm+=dp[i][j]
        dp[i+1][j]=sm%mod
    for j in range(lis[i]+1,k+1):
        sm+=dp[i][j]
        sm-=dp[i][j-lis[i]-1]
        dp[i+1][j]=sm%mod
print(dp[-1][-1]%mod)            
        
    


Measured memory_bytes: 147092
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
const int INF = 1001001001;
const int MOD = 1000000007;
typedef long long ll;

int dp[210][210][210];


int gcd(vector<int> v)
{
    int ret = v[0];
    for (int i = 0; i < v.size(); i++)
    {
        ret = __gcd(ret, v[i]);
    }
    return ret;
}


int main(){
    int K;
    cin >> K;
    ll total = 0;
    rep(i, 210){
        rep(j, 210){
            rep(k, 210){
                dp[i][j][k] = -1;
            }
        }
    }
    for(int i = 1; i <= K; i++){
        for(int j = 1; j <= K; j++){
            for(int k = 1; k <= K; k++){
                vector<int> v(3);
                v[0] = i;
                v[1] = j;
                v[2] = k;
                sort(v.begin(), v.end());
                if(dp[v[0]][v[1]][v[2]] != -1){
                    total += dp[v[0]][v[1]][v[2]];
                }else{
                    int num;
                    if(v[0] == 1){
                        total += 1;
                        dp[v[0]][v[1]][v[2]] = 1;
                    }else {
                        num = gcd(v);
                        total += num;
                        dp[v[0]][v[1]][v[2]] = num;
                    }
                }
            }
        }
    }
    cout << total << endl;
    return 0;

}


Measured memory_bytes: 39808
#入力
N = int(input())
a_i = list(map(int, input().split()))


#順番にリスト内の最大値を抜き出し、それぞれのリストに順に格納

#それぞれのリストを作成
Alice_list = []
Bob_list = []

while True:

    #最大値を特定し要素番号を抜き出す
    max_idx = a_i.index(max(a_i))

    #最大値の値を抜き出し、リストからその値を削除
    Alice_list.append(a_i[max_idx])
    a_i.remove(a_i[max_idx])

    #リスト内が空になったら処理終了
    if len(a_i)==0:
        break
        
        
    #最大値を特定し要素番号を抜き出す
    max_idx = a_i.index(max(a_i))

    #最大値の値を抜き出し、リストからその値を削除
    Bob_list.append(a_i[max_idx])
    a_i.remove(a_i[max_idx])

    #リスト内が空になったら処理終了
    if len(a_i)==0:
        break
    
#Aliceの合計
Alice_sum = sum(Alice_list)

#Bobの合計
Bob_sum = sum(Bob_list)

#2人の差
Alice_Bob = Alice_sum - Bob_sum

#出力
print(Alice_Bob)

Measured memory_bytes: 3064
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include <deque>
using namespace std;
class Point {
public:
	int x = 0;
	int y = 0;
	Point(int x, int y) {
		this->x = x;
		this->y = y;
	}

};
int main()
{
	int H, W;
	cin >> H >> W;
	int C[2];
	int D[2];
	cin >> C[1] >> C[0] >> D[1] >> D[0];
	C[0] = C[0] - 1;
	C[1] = C[1] - 1;
	D[0] = D[0] - 1;
	D[1] = D[1] - 1;
	vector<vector<int>>S(W, vector<int>(H));
	for (int y = 0; y < H; y++) {
		for (int x = 0; x < W; x++) {
			char c;
			cin >> c;
			if (c == '.') {
				S[x][y] = 1;
			}
			else {
				S[x][y] = 0;
			}
		}
	}
	vector<Point>stack;
	vector<Point>stack2;

	Point a(C[0], C[1]);
	S[a.x][a.y] = 4;

	int result = 0;
	while (true) {
		while (true) {
			stack2.push_back(a);
			bool frag = false;
			if (a.y + 1 < H&&S[a.x][a.y + 1] == 1) {
				stack.push_back(a);
				S[a.x][a.y + 1] = 4;
				a.y++;
				continue;
			}
			if (a.y - 1 >= 0 && S[a.x][a.y - 1] == 1) {
				stack.push_back(a);
				S[a.x][a.y - 1] = 4;
				a.y--;
				frag = true;
				continue;
			}
			if (a.x + 1 < W&&S[a.x + 1][a.y] == 1) {
				stack.push_back(a);
				S[a.x + 1][a.y] = 4;
				a.x++;
				continue;
			}
			if (a.x - 1 >= 0 && S[a.x - 1][a.y] == 1) {
				S[a.x - 1][a.y] = 4;
				a.x--;
				continue;
			}


			if (stack.size() == 0) {
				break;
			}
			a = stack[stack.size() - 1];
			stack.pop_back();
		}
		if (S[D[0]][D[1]] == 2 || S[D[0]][D[1]] == 4) {
			cout << result;
			return 0;
		}
		bool frag = false;
		for (int i = 0; i < stack2.size(); i++) {
			int x = stack2[i].x;
			int y = stack2[i].y;
			for (int xx = -2; xx < 3; xx++) {
				for (int yy = -2; yy < 3; yy++) {
					if (xx + x >= 0 && xx + x < W&&yy + y >= 0 && yy + y < H&&S[x + xx][y + yy] == 1) {
						S[x + xx][y + yy] = 4;
						stack.push_back(Point(x+xx, y+yy));

						frag = true;
					}
				}
			}
		}
		stack2 = vector<Point>();
		if (!frag) {
			cout << -1;
			return 0;
		}
		a = stack[stack.size() - 1];
		stack.pop_back();
		result++;

	}

}

Measured memory_bytes: 7712
// clang-format off
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define stoi stoll
using pii = pair<int,int>;
using vi = vector<int>;
using vvi = vector<vi>;
#define all(c) begin(c), end(c)
#define rall(c) rbegin(c), rend(c)
#define fore(x, c) for(auto &&x : c)
#define rep(i, a, n) for(int i = a, i##len = (int)(n); i < i##len; ++i)
#define rrep(i, a, n) for(int i = (int)(n - 1); i >= a; --i)
#define sz(c) ((int)c.size())
#define contains(c, x) (c.find(x) != end(c))
#define inseg(l, x, r) ((l) <= (x) && (x) < (r))
#define dump(...)
#define pb push_back
#define eb emplace_back
#define _ 0
const signed INF_ = 1001001001; const long long INF = 1001001001001001001LL;
const int DX[9] = {0,1,0,-1,1,1,-1,-1,0}, DY[9] = {-1,0,1,0,-1,1,1,-1,0};
template<class T> ostream& operator<<(ostream &os, const vector<T> &v) {
  for (auto i = begin(v); i != end(v); i++) os<<*i<<(i==end(v)-1?"":" ");return os;}
template<class T> istream& operator>>(istream &is, vector<T> &v) {
  for (auto i = begin(v); i != end(v); i++) is>>*i;return is;}
template<class T,class U> istream& operator>>(istream &is, pair<T,U> &p) {
  is>>p.first>>p.second;return is;}
template<class T, class U> bool chmax(T &a, const U &b){return a<b?a=b,1:0;}
template<class T, class U> bool chmin(T &a, const U &b){return a>b?a=b,1:0;}
template <class T> void psum(T& c) {partial_sum(begin(c), end(c), begin(c));}
template<class T> using heap = priority_queue<T, deque<T>, greater<T>>;
struct before_main_function {
  before_main_function() {
      cin.tie(nullptr); ios::sync_with_stdio(0);
      cout << setprecision(15) << fixed;
  }
} before_main_function;
// clang-format on
//------------------8<------------------------------------8<--------------------

signed main() {
  int H, N;
  cin >> H >> N;
  vi A(N);
  cin >> A;
  cout << ((accumulate(all(A), 0LL) >= H) ? "Yes" : "No") << endl;
  return (0 ^ _ ^ 0);
}



Measured memory_bytes: 1024
a = input()
num = input()
num_1 = num.split()
s = 0
cnt = 0
for i in range(len(num_1)):
    s += int(num_1[cnt])
    cnt += 1

b = []
cnt = 0
for i in range(len(num_1)):
    b.append(int(num_1[cnt]))
    cnt += 1

print(min(b),max(b),s)

Measured memory_bytes: 8716
N = int(input())
H = [0]
H += list(map(int, input().split()))

ans = 0

for i in range(1, N + 1) :
    judge = True
    for j in range(i) :
        if H[i] < H[j] :
            judge = False
            break
    if judge :
        ans += 1

print(ans)


Measured memory_bytes: 2940
#include <bits/stdc++.h>
#define int long long int
#define mod(x) ((x % MOD) + MOD) % MOD
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);--i)
#define RFORE(i,a,b) for(int i=(b);i>=(a);--i)
#define REP(i,n) FOR(i,0,n)
#define ALL(c) (c).begin(),(c).end()
#define RALL(c) (c).rbegin(),(c).rend()
#define SORT(c) sort(ALL(c))
#define RSORT(c) sort(RALL(c))
#define SZ(c) (int)((c).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define LB(c,x) (int)(lower_bound(ALL(c),x)-(c).begin())
#define UB(c,x) (int)(upper_bound(ALL(c),x)-(c).begin())
#define COUNT(c,x) (UB(c,x)-LB(c,x))
#define UNIQUE(c) SORT(c); (c).erase(unique(ALL(c)),(c).end());
#define COPY(c1,c2) copy(ALL(c1),(c2).begin())
#define EXIST(s,e) (bool)((s).find(e)!=(s).end())
#define PB push_back
#define MP make_pair
#define DUMP(x)  cerr << #x << " = " << (x) << endl;
using namespace std;
template<typename T1, typename T2> using P = pair<T1,T2>;
template<typename T> using V = vector<T>;
struct edge { int from, to; int cost; };
bool operator< (const edge &edge1, const edge &edge2) { return edge1.cost < edge2.cost; };
const int INF = 1e18;
const int MOD = 1e9+7;

template<typename T> ostream& operator << (ostream& s, const V<T>& v) {
   s << "[";
   for (int i = 0; i < v.size(); i++) { s << v[i]; if (i < v.size() - 1) s << " "; }
   s << "]";
   return s;
}

signed main()
{
   int A, B; cin >> A >> B;
   const int MAX_S = 100;
   int S[MAX_S][MAX_S];
   REP(i, MAX_S/2) REP(j, MAX_S) S[i][j] = 1;
   REP(i, MAX_S/2) REP(j, MAX_S) S[MAX_S-1-i][j] = 0;

   for (int i = 0; i < MAX_S/2; i += 2) {
      for (int j = 0; j < MAX_S && A > 1; j += 2) {
         S[i][j] = 0; --A;
      }
   }

   for (int i = 0; i < MAX_S/2; i += 2) {
      for (int j = 0; j < MAX_S && B > 1; j += 2) {
         S[MAX_S-1-i][MAX_S-1-j] = 1; --B;
      }
   }

   cout << MAX_S << " " << MAX_S << endl;
   REP(i, MAX_S) {
      REP(j, MAX_S) cout << (S[i][j] ? "#" : ".");
      cout << endl;
   }

   return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define inf 1000000000 //1E+9
#define mod 1000000007
using namespace std;

int main(){
	int n,m;cin>>n>>m;
	int a[n];for(int i=0;i<n;i++)cin>>a[i];
	map<int,vector<int>> key;
	int buf=0;
	for(int i=0;i<n;i++){
		buf+=a[i];buf=buf%m;
		if(key.find(buf)==key.end())key[buf]=vector<int>(1,i);
		else key[buf].push_back(i);
	}

	long long ans=0; buf=0;
	for(int i=0;i<n;i++){	
		while(key.find(buf) != key.end())if(key[buf].size() && key[buf][0]<i)key[buf].erase(key[buf].begin());else break;
		if(key.find(buf) != key.end())ans += key[buf].size();
		buf+=a[i];buf=buf%m;
	}

	cout<<ans<<endl;
	return 0;
}



Measured memory_bytes: 7552
#include<iostream>
using namespace std;
int main()
{
	int n;cin>>n;
	int min=2147483647,maxdiv=-2147483648;
	for(int a,i=0;i<n;i++)
	{
		cin>>a;
		if(maxdiv<a-min)maxdiv=a-min;
		if(a<min)min=a;
	}
	cout<<maxdiv<<endl;
	return 0;
}

Measured memory_bytes: 3044
s=input()
k=int(input())

renzoku=0 #1が左端からどれだけ連続するか
for i in s:
  if i=="1":
    renzoku+=1
  else:
    break

if renzoku==0:
  print(s[0])
else:
  if k<=renzoku:
    print(1)
  else:
    print(s[renzoku])

Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
using lint = int64_t;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define all(v)    begin(v), end(v)
#define in        []{lint n; cin>>n; return n;}()
 
int main() { cin.tie(0); ios::sync_with_stdio(false);
    string S; cin >> S;
 
    int ans = INT_MAX;
    for( char c='a'; c<='z'; c++ ) {
        int maximum = INT_MIN;
        int count = 0;
        for( char s : S ) {
            if( s == c ) { count = 0; }
            else { count ++; }
            maximum = max( maximum, count );
        }
        ans = min( ans, maximum );
    }
 
    cout << ans << "\n";
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <numeric>
#include <iostream>

using namespace std;

#define FOR(i, a, b)   for(int i = (a); i < (b); ++i)
#define RFOR(i, a, b)  for(int i = (a); i > (b); --i)
#define rep(i, n)      for(int i = 0; i < (n); ++i)
#define all(c)         begin(c), end(c)
#define rall(c)        rbegin(c), rend(c)
#define SZ(a)          ((ll) a.size())

typedef long long ll;
typedef unsigned long long ull;

int main(){
	int N,A,B;
	cin >>  N >> A >> B;
	if((B-A)%2==1) cout << "Borys";
	else cout << "Alice";
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
		public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String w = scan.next();
		char[] c = new char[w.length()];
		for (int i = 0; i < w.length(); i++) {
			c[i] = w.charAt(i);
		}
		int[] a = new int[1000];
		for (int i = 0; i < w.length(); i++) {
			a[c[i]]++;
		}
		boolean flag = true;
		for (int i = 0; i < 1000; i++) {
			if (a[i]%2==1) {
				flag = false;
				break;
			}
		}
		if (flag) {
			System.out.println("Yes");			
		}
		else {
			System.out.println("No");
		}
	}
}


Measured memory_bytes: 23124
//#include <bits/stdc++.h>
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
//#include "boost/multiprecision/cpp_int.hpp"
//typedef boost::multiprecision::cpp_int ll;
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
typedef pair<dd,dd> d_d;
ll inf=(ll)1E16;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fi first
#define se second
#define endl "\n"
///////////////////////////

#define N 1005
ll n;
bool used[N];
ll a[N];
ll num(ll p){
    ll sum=0;
    rep(i,1,p-1)if(used[i])sum++;
    return p-sum;
}
ll calv(vector<ll>v){
    ll res=0;
    for(auto x:v){
        if(x>0)res+=x;
    }
    return res;
}
bool nega(){
    rep(i,1,n){
        if(a[i]>0)return false;
    }
    return true;
}

int main(){fastio
    cin>>n;
    vector<ll>v1,v2;
    rep(i,1,n){
        cin>>a[i];
        if(i%2==1)v1.pb(a[i]);
        else v2.pb(a[i]);
    }
    vector<ll>ans;
    if(nega()){
        ll mx=1;
        rep(i,1,n){
            if(a[i]>a[mx])mx=i;
        }
        for(ll i=n;i>=mx+1;i--){
            ans.pb(i);
        }
        for(ll i=1;i<=mx-1;i++){
            ans.pb(1);
        }
        cout<<a[mx]<<endl;
        cout<<ans.size()<<endl;
        for(auto x:ans)cout<<x<<endl;
        return 0;
    }
    ll sum1=calv(v1),sum2=calv(v2);
    
    if(sum2>sum1){
        ans.pb(1);
        n--;
        rep(i,1,n)a[i]=a[i+1];
    }
    cout<<max(sum2,sum1)<<endl;
    vector<ll>v;
    for(ll i=1;i<=n;i+=2){
        if(a[i]>0)v.pb(i);
    }
    rep(i,1,v[0]-1){
        ans.pb(num(i));
        used[i]=true;
    }
    ll vs=v.size();
    for(ll i=n;i>=v[vs-1]+1;i--){
        ans.pb(num(i));
        used[i]=true;
    }
    vector<l_l>b;
    rep(i,v[0],v[vs-1]){
        b.pb({i,a[i]});
    }
    while(b.size()>=2){
        if(b.size()==2){
            ans.pb(2);
            break;
        }
        if(b[2].se>0){
            ans.pb(2);
            b.erase(b.begin()+1);
            b.erase(b.begin()+1);
        }else{
            ans.pb(3);
            b.erase(b.begin()+2);
            b.erase(b.begin()+1);
        }
    }
    cout<<ans.size()<<endl;
    for(auto x:ans)cout<<x<<endl;
    
    
    return 0;
}


Measured memory_bytes: 384
#include <iostream>

using namespace std;



int main() {

	int N = 0;	//??\???

	int x, y, b, p; //??\???

	int max = 0;	//????????¶???????????????????????£?????´????????£???

	int wari = 0;	//??????????????£???

	

	int i = 0;	//????????????



	cin >> N;



	while (1) {

		cin >> x;

		cin >> y;

		cin >> b;

		cin >> p;



		max = ((x * b) + (y * p));





		//?????\???????????°??????????????¨????????????????????§???????????????

		if (b < 5){

			b = 5;

		}



		if (p < 2){

			p = 2;

		}

		

		//??????????????£???(???????????????????????¨????????´???????????????)

		wari = ((x * b) + (y * p)) * 0.8;

		

		//??????

		if (max < wari) {

			cout << max << "\n";

		} else {

			cout << wari << "\n";

		}



		if(b == 0 && p == 0){

			cout << 0 << "\n";

		}



		i++;		//??????????????¢??????



		max = 0;	//?????????

		wari = 0;



		if(i == N) {

			return 0;

		}

	}

}

Measured memory_bytes: 3100
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            long a = Long.parseLong(in.next());
            long b = Long.parseLong(in.next());
            long c = Long.parseLong(in.next());

            if ((c - a - b) > 0 && 4 * a * b < (c - a - b) * (c - a - b)) {
                out.println("Yes");
            } else {
                out.println("No");
            }

        }

    }
}



Measured memory_bytes: 23124
{-
URL: http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0168
?????????: Kannondou
??°?????£?????¨??????:???1??\???10???????????????????£???°???????????°??£???
-}
import Control.Applicative
import Control.Monad

main = do
 n <- fmap read getLine
 when (n>0) $ do
  print $ (f n + 3649) `div` 3650
  main

f :: Integer -> Integer
f 0 = 1
f 1 = f 0
f 2 = f 0 + f 1
f 18 = 35890
f 19 = 66012
f 20 = 121415
f n = f (n-1) + f (n-2) + f (n-3)

Measured memory_bytes: 4060
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace AtCoder
{
    class Program
    {
        
        static void Main()
        {
            //ここから

            int[] vs = ReadLineToIntArray();
            int ans = vs[0] + vs[1] / 2;

            //ここまで
            Console.WriteLine(ans);
            Console.ReadKey();
        }


        static public void Swap<T>(ref T a,ref T b) { T temp = a;a = b;b = temp; }
        static public long GCD(int a, int b){ return b != 0 ? GCD(b, a % b) : a;}
        static public long LCM(int a, int b){ return (long)a * b / GCD(a, b); }
        static public int Factorial(int a) { return a == 1 ? a : a * Factorial(a - 1); }
        static public int Conbin(int n,int m) { return Factorial(n) / (Factorial(n - m) * Factorial(m)); }


        
        static public string ReadLineToString(){return Console.ReadLine();}
        static public int ReadLineToInt(){return int.Parse(Console.ReadLine());}
        static public long ReadLineToLong() { return long.Parse(Console.ReadLine()); }
        static public string[] ReadLineToStringArray(){return Console.ReadLine().Split(' ').ToArray();}
        static public int[] ReadLineToIntArray(){return Console.ReadLine().Split(' ').Select(int.Parse).ToArray();}
        static public long[] ReadLineToLongArray() { return Console.ReadLine().Split(' ').Select(long.Parse).ToArray(); }
        static public List<string> ReadLineToStringList(){return Console.ReadLine().Split(' ').ToList();}
        static public List<int> ReadLineToIntList(){return Console.ReadLine().Split(' ').Select(int.Parse).ToList();}
        static public List<long> ReadLineToLongList() { return Console.ReadLine().Split(' ').Select(long.Parse).ToList(); }
    }
    
}


Measured memory_bytes: 13268
n, x = gets.chomp.split.map(&:to_i)
xs = gets.chomp.split.map(&:to_i)

xxs = xs.map{|i| (i - x).abs}

def gcd(a,b)
  while b > 0
      a,b = b,a%b
  end
  return a
end

start = xxs[0]
tail = xxs[1..n-1]

newgcd = start
tail.each do |j|
  newgcd = gcd(newgcd, j)
end

puts newgcd


Measured memory_bytes: 10244
fun main(args: Array<String>) {
    val x = readLine()!!.toLong()
    //val (a,b) = readLine()!!.split(' ').map { s -> s.toInt() }
    var yokin = 100L
    var cnt = 0L
    while (x > yokin) {
        yokin = yokin + (yokin * 0.01).toLong()
        cnt += 1L
    }
    println( cnt )
}

Measured memory_bytes: 34324
#include <stdio.h>
#include <string.h>

int main(){
	
	char st[105];
	scanf ("%s",&st);
	getchar();
	int arr[30];
	for (int a=0;a<30;a++){
		arr[a] = 0;
	}
	
	int len = strlen(st);
	for (int a=0;a<len;a++){
		char c = st[a];
		arr[c-'a']++;
	}
	
	bool check = false;
	for (int a=0;a<30;a++){
		if (arr[a]%2==0){
			check=true;
		}else{
			check =false;
			break;
		}
	}
	
	if (check==true){
		printf ("Yes\n");
	}
	else{
		printf ("No\n");
	}
	//printf ("%d\n",n-i+1);
	
	return 0;
}

Measured memory_bytes: 128