akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n,a,b;
  cin >> n >> a >> b;
 
  int A = a-1;
  int B = n-b;


  int limit_a, limit_b;

/*  if((b-a)%2 == 0) {
    limit_a = A+(b-a-1)/2+1;
    limit_b = B+(b-a-1)/2;
  }
  else {
    limit_a = A+(b-a-1)/2;
    limit_b = B+(b-a-1)/2;
  }
  if(limit_a > limit_b) 
    cout << "Alice" << endl;
  else if(limit_a > limit_b) 
    cout << "Borys" << endl;
  else {
    if(limit_a == 0) 
      cout << "Borys" << endl;
    else 
      cout << "Draw" << endl;
  }*/
  if((b-a)%2 == 0) {
    cout << "Alice" << endl;
  }
  else {
    cout << "Borys" << endl;
  }

  return 0;
}


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

int main(){
	ll a,b,c;
	cin>>a>>b>>c;
	__int128 av = a;
	__int128 bv = b;
	__int128 cv = c;
	__int128 lhs = 4*av*bv;
	__int128 rhs = (cv-av-bv)*(cv-av-bv);
	if ((cv-av-bv)<0){
		cout<<"No"<<endl;
		return 0;
	}
	if (lhs<rhs){
		cout<<"Yes"<<endl;
	} else {
		cout<<"No"<<endl;
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <complex>
#include <iomanip>
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define fi first
#define se second
#define mp make_pair
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;

ll N,M,H,W,K,Q,A,B,C,L,R;
string S,T;
const ll MOD = (1e+9) + 7;
const ll INF = 1LL << 60;
const long double EPS = 1e-9;
typedef pair<ll,ll> P;

typedef vector<P> vp;
typedef vector<vp> matP;

int main() {
    cin>>S;
    N = S.size();
    bool yes = true;
    rep(i,N){
        if((i%2) == 0 && S[i] == 'L') yes = false;
        if((i%2) == 1 && S[i] == 'R') yes = false;
    }
    cout<<(yes ? "Yes" : "No")<<endl;
}

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 n, q;
    cin >> n >> q;

    string s;
    cin >> s;

    vector<int> l(q);
    vector<int> r(q);
    rep(i,q) {
        cin >> l[i];
        cin >> r[i];
    }

    vector<char> schar(s.length());
    rep(i,s.length()) {
        schar[i] = s[i];
    }

    vector<string> s_vec(s.length()-1, "");
    rep(i,s.length()-1) {
        // cout << s[i] << endl;
        // cout << s[i+1] << endl;
        string addstr = "";
        addstr += schar[i];
        addstr += schar[i+1];
        s_vec[i] = addstr;
    }

    // cout << "s_vecは" << endl;
    // rep(i, s.length()-1) {
    //     cout << s_vec[i] << endl;
    // }

    // 累積和
    vector<int> a(s.length()-1, 0);
    rep(i, s.length()-1) {
        if (s_vec[i] == "AC") a[i] = 1;
    }

    // rep(i, s.length()-1) {
    //     cout << a[i] << endl;
    // }

    vector<int> acc_a(s.length(), 0);
    rep(i, s.length()-1) acc_a[i+1] = acc_a[i] + a[i];

    // rep(i, s.length()) {
    //     cout << acc_a[i] << endl;
    // }

    rep(i, q) {
        cout << acc_a[r[i]-1] - acc_a[l[i]-1] << endl;
    }

    return 0;
}

Measured memory_bytes: 8064
#include <cstdio>
int n; char s[20][20];
int solve(int l, int r, int d) {
	if (r - l == 1) return s[l][d] - 48;
	int ret = (s[l][d] == '+' ? 0 : 1);
	int prev = -1;
	for (int i = l + 1; i < r; i++) {
		if (s[i][d + 1] != '.') {
			if (prev != -1) ret = (s[l][d] == '+' ? ret + solve(prev, i, d + 1) : ret * solve(prev, i, d + 1));
			prev = i;
		}
	}
	return (s[l][d] == '+' ? ret + solve(prev, r, d + 1) : ret * solve(prev, r, d + 1));
}
int main() {
	while (scanf("%d", &n), n) {
		for (int i = 0; i < n; i++) scanf("%s", s[i]);
		printf("%d\n", solve(0, n, 0));
	}
}

Measured memory_bytes: 2596
def main():
    s = input()

    if s[0] != 'A':
        print("WA")
        return

    margin = s[2:len(s) - 1]
    count = 0

    for i in margin:
        if i == "C":
            count += 1
        if count >= 2:
            print("WA")
            return

    if count != 1:
        print("WA")
        return
    s = s[1:]
    s = s[:s.find("C")] + s[s.find("C")+1:]
    if s.islower():
        print("AC")
        return
    else:
        print("WA")
        return


main()


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

template <class T> using V = vector<T>;

using ll = long long;
using db = double;
using st = string;
using ch = char;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;


#define FOR(i,a,b) for(ll i=(a);i<(ll)(b);i++)
#define rFOR(i,a,b) for(ll i=(b);i>(ll)(a);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(ll)(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) __lcm(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;



int main() {
  ll r,g,b;
  	ci(r>>g>>b);
  ll n;
  	ci(n);
  ll ans=0;
  
 FOR(i,0,n+1){
   FOR(j,0,n+1){
     ll now=(i*r+j*g);
    
     if((n-now)%b==0&&now<=n){
	ans++;
     }
     }
   }
 
  co(ans)
}

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

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

    str.erase(str.end() - 1);
    while(true){
        if(str.size() % 2 == 0){
            char tmp1[str.size() / 2] = {};
            char tmp2[str.size() / 2] = {};
            str.copy(tmp1, (str.size() / 2 - 1));
            str.copy(tmp2, str.size() / 2 - 1, str.size() / 2);
            //cout << "tmp1:" << tmp1 << endl;
            //cout << "tmp2:" << tmp2 << endl;
            string str1 = tmp1;
            string str2 = tmp2;
            //cout << "str1:" << str1 << endl;
            //cout << "str2:" << str2 << endl;
            if(str1 == str2){
                break;
            }
        }
        str.erase(str.end() - 1);
    }

    cout << str.size() << endl;

    return 0;
}

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

int main(void) {
	char c;
	char buf[128];

	fgets(buf, sizeof(buf), stdin);
	c = *strtok(buf, " ");

	if(c == 'a') {
		printf("vowel\n");
	} else if(c == 'e') {
		printf("vowel\n");
	} else if(c == 'i') {
		printf("vowel\n");
	} else if(c == 'o') {
		printf("vowel\n");
	} else if(c == 'u') {
		printf("vowel\n");
	} else {
		printf("consonant\n");
	}

	return 0;
}


Measured memory_bytes: 1920
#include "bits/stdc++.h"
using namespace std;

int main() {
	long long N, COUNT = 0;
	map<pair<long long, long long>, long long> mp;
	cin >> N;
	for (int i = 1; i <= N; i++) {
		if (i % 10 == 0) continue;
		long long X, Y;
		X = i % 10;
		long long I = i;
		while (I >= 10) I /= 10;
		Y = I;
		mp[{X, Y}]++;
	}
	for (int i = 1; i <= 9; i++) {
		for (int j = 1; j <= 9; j++) COUNT += mp[{i, j}] * mp[{j, i}];
	}
	cout << COUNT << endl;
}

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

using VS = vector<string>;    using LL = long long;
using VI = vector<int>;       using VVI = vector<VI>;
using PII = pair<int, int>;   using PLL = pair<LL, LL>;
using VL = vector<LL>;        using VVL = vector<VL>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
#define debug(x) cerr << #x << ": " << x << endl
const int INF = 1e9;                          const LL LINF = 1e16;
const LL MOD = 1000000007;                    const double PI = acos(-1.0);
int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };

/* -----  2018/03/03  Problem: 020_agc_b / Link: https://agc020.contest.atcoder.jp/tasks/agc020_b?lang=en  ----- */
/* ------問題------

スケートリンクで、一人の大人の司会と N 人の子供がゲームを行います。 ゲームは K ラウンドからなり、ラウンド i では司会が次のように言います。
Ai 人組を作って！
すると、まだ脱落していない子供たちは Ai 人からなるグループをできるだけ多く組みます。 一人につき一つのグループにしか入れません。 グループに入れなかった子供たちは脱落し、その他は次のラウンドに進みます。 ラウンドで誰も脱落しないこともありえます。
最後まで、つまりラウンド K のあとまで残ったのは 2 人で、彼らが勝者となりました。
あなたは A1, A2, ..., AK の値を聞き、N の値は知りませんが、推定してみたくなりました。
ゲームの開始前にいた子供たちの人数として考えられる最小の値と、最大の値を求めてください。もしくは、考えられる N の値は存在しないと判定してください。

-----問題ここまで----- */
/* -----解説等-----



----解説ここまで---- */

LL N;

LL ans = 0LL;

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

	cin >> N;
	VI a(N);
	FOR(i, 0, N) {
		cin >> a[i];
	}
	reverse(ALL(a));
	ans = 1;
	if (a.front() != 2)ans = 0;

	LL L = 2, R = 2;

	FOR(i, 0, N) {
		LL x = (L + a[i] - 1) / a[i] * a[i];
		if (x < L || R < x)ans = 0;
		L = x;
		R = (R / a[i])* a[i] + a[i] - 1;
	}
	if (!ans) {
		cout << -1 << endl;
	}
	else {
		cout << L << " " << R << "\n";
	}
	return 0;
}


Measured memory_bytes: 640
#include<iostream>
#include<string>
using namespace std;
string S,T,U,V;
bool solve(string a1,string a2){
	int H=0;
	for(int i=0;i<a2.size();i++){
		if(a1[H]==a2[i])H++;
		if(H==a1.size())return true;
	}
	return false;
}
int main(){
	cin>>S>>T;
	for(int i=0;i<S.size();i++){
		if(i%2==0)U+=S[i];
		if(i%2==1)V+=S[i];
	}
	bool OK=false;
	if(solve(U,T)==true || solve(V,T)==true)OK=true;
	if(OK==true)cout<<"Yes"<<endl;
	else{cout<<"No"<<endl;}
	return 0;
}

Measured memory_bytes: 3188
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
#define chmin(a, b) ((a)=min((a), (b)))
#define chmax(a, b) ((a)=max((a), (b)))
#define fs first
#define sc second
#define eb emplace_back
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;

const ll MOD=1e9+7;
const ll INF=1e18;
const double pi=acos(-1);
const double eps=1e-10;

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

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

    vector<ll> sum(n+1, 0);
    for(int i=0; i<n; i++) sum[i+1] = sum[i] + a[i];

    ll ans=INF;
    for(int mid=2; mid<=n-2; mid++){
        ll lsum = sum[mid];
        ll rsum = sum[n] - sum[mid];

        int l = lower_bound(sum.begin(), sum.end(), lsum / 2) - sum.begin();
        int r = lower_bound(sum.begin(), sum.end(), sum[mid] + rsum / 2) - sum.begin();

        ll pqgap = INF;
        ll P, Q;
        for(int i=-1; i<=1; i++){
            ll psum = sum[l+i];
            ll qsum = sum[mid] - psum;

            if(abs(psum - qsum) < pqgap){
                pqgap = abs(psum - qsum);
                P = psum;
                Q = qsum;
            }
        }

        ll rsgap = INF;
        ll R, S;
        for(int i=-1; i<=1; i++){
            ll rsum = sum[r+i] - sum[mid];
            ll ssum = sum[n] - sum[r+i];

            if(abs(rsum - ssum) < rsgap){
                rsgap = abs(rsum - ssum);
                R = rsum;
                S = ssum;
            }
        }

        ll ma = max({P, Q, R, S});
        ll mi = min({P, Q, R, S});

        chmin(ans, ma - mi);
    }

    cout << ans << endl;
}

Measured memory_bytes: 2688
use std::cmp::{max, min};
use std::fs;
use std::io::{stdin, Read};

macro_rules! parse {
    ($it: ident) => {
        $it.next().unwrap().parse().unwrap()
    };
    ($it: ident,2) => {
        (parse!($it), parse!($it))
    };
    ($it: ident,3) => {
        (parse!($it), parse!($it), parse!($it))
    };
    ($it: ident,4) => {
        (parse!($it), parse!($it), parse!($it), parse!($it))
    };
    ($it: ident, $n: expr) => {
        (&mut $it).take($n).map(|e| e.parse().unwrap()).collect();
    };
}

fn matmulmod(a: &Vec<Vec<usize>>, b: &Vec<Vec<usize>>, m: usize) -> Vec<Vec<usize>> {
    (0..a.len())
        .map(|i| {
            (0..b[0].len())
                .map(|j| {
                    (0..b.len())
                        .map(|k| ((a[i][k] % m) * (b[k][j] % m)))
                        .fold(0, |i, j| (i + j) % m)
                })
                .collect()
        })
        .collect()
}

fn matpowmod(a: &Vec<Vec<usize>>, n: usize, m: usize) -> Vec<Vec<usize>> {
    let mut n = n;
    let mut ret: Vec<Vec<usize>> = (0..a.len())
        .map(|i| {
            let mut a = vec![0; a.len()];
            a[i] = 1;
            a
        })
        .collect();
    let mut cur = a.clone();
    while n > 0 {
        if n & 1 == 1 {
            ret = matmulmod(&ret, &cur, m);
        }
        cur = matmulmod(&cur, &cur, m);
        n >>= 1;
    }
    ret
}

fn matvecmod(a: Vec<Vec<usize>>, x: Vec<usize>, m: usize) -> Vec<usize> {
    (0..a.len())
        .map(|i| {
            (0..x.len())
                .map(|j| a[i][j] * x[j])
                .fold(0, |i, j| (i + j) % m)
        })
        .collect()
}

fn solve(s: &str) {
    let mut it = s.split_whitespace();
    let (l, a, b, m) = parse!(it, 4);
    let fc = |d| {
        let x = (10usize.pow(d)).checked_sub(a).unwrap_or(0);
        let y = x % b == 0;
        min(x / b + if y { 0 } else { 1 }, l)
    };
    let cd: Vec<usize> = (0..19).map(|i| fc(i + 1) - fc(i)).collect();
    let mut x = vec![0, a, 1];
    for d in 0..19 {
        let c = vec![vec![10usize.pow(d + 1), 1, 0], vec![0, 1, b], vec![0, 0, 1]];
        let cpowd = matpowmod(&c, cd[d as usize], m);
        x = matvecmod(cpowd, x, m)
    }
    println!("{}", x[0] % m);
}

fn test() {
    let mut f = fs::File::open("foo.txt").unwrap();
    let mut s = String::new();
    f.read_to_string(&mut s).unwrap();
    solve(&s);
}

fn main() {
    let mut s = String::new();
    stdin().read_to_string(&mut s).unwrap();
    solve(&s);
}

#[cfg(test)]
mod tests {
    use super::*;
    #[test]
    fn test_main() {
        test();
    }
    #[test]
    fn test_input() {
        let s = "
        ";
        solve(s);
    }
}


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

using namespace std;

int main(){

    ios_base::sync_with_stdio(0);
    cin.tie(0);

    map<int,int> mp;

    int x;
    for(int i=0;i<3;++i){
        cin >> x;
        mp[x]++;
    }

    if(mp[5] == 2 and mp[7] == 1)
        cout << "YES\n";
    else cout << "NO\n";

    return 0;
}

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

int main() {
	set <int> s;
	int n;
	cin >> n;
	for (int i = 0;i < n;i++) {
		int d;
		cin >> d;
		s.insert(d);
	}
cout << s.size() << endl;
return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#pragma comment (linker, "/STACK:526000000")
#define  _CRT_SECURE_NO_WARNINGS

using namespace std;
typedef string::const_iterator State;
#define eps 1e-11L
#define MAX_MOD 1000000007LL
#define GYAKU 500000004LL

#define MOD 998244353LL
#define seg_size 262144*2LL
#define pb push_back
#define mp make_pair
typedef long long ll;
#define REP(a,b) for(long long (a) = 0;(a) < (b);++(a))
#define ALL(x) (x).begin(),(x).end()

void init() {
	iostream::sync_with_stdio(false);
	cout << fixed << setprecision(20);
}

void solve() {
	while (true) {
		int n, query;
		cin >> n >> query;
		if (n == 0) {
			return;
		}
		int cnt[100] = {};
		REP(i, n) {
			int a;
			cin >> a;
			REP(t, a) {
				int b;
				cin >> b;
				cnt[b]++;
			}
		}
		int now_max = 0;
		REP(i, 100) {
			if (cnt[now_max] < cnt[i]) {
				now_max = i;
			}
		}
		if (cnt[now_max] < query)now_max = 0;
		cout << now_max << endl;
	}
}

int main() {
	init();
	solve();
}


Measured memory_bytes: 3116
#include <iostream>
#include <algorithm>

using namespace std;
static const int MAX = 200000;

int main(int argc, const char * argv[]) {
    
    int R[MAX];
    int n;
    
    cin >> n;
    for (int i = 0; i < n; i++){
        cin >> R[i];
    }
    
    int maxv = -2000000000;
    int minv = R[0];
    
    for (int i = 1; i < n; i++){
        maxv = max(maxv, R[i]-minv);
        minv = min(minv, R[i]);
    }
    
    cout << maxv << endl;
    
    return 0;
}

Measured memory_bytes: 3868
#include <cstdio>
#include <cstdlib>

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

	int da = abs(x - a), db = abs(x - b);
	if (da < db) {
		puts("A");
	} else {
		puts("B");
	}
	return 0;
}


Measured memory_bytes: 128
#include <stdio.h>

int main(void)
{
	int n, d, x;
	scanf("%d%d%d", &n,&d,&x);
	int a[n];
	int i = 0;
	while (i < n)
	{
		scanf("%d", &a[i]);
		i++;
	}
	int j;
	int count = 0;
	i = 0;
	while (i < n)
	{
		j = 0;
		while (j < d)
		{
			if ((j * a[i]) + 1 <= d)
				count++;
			else
				break;
			j++;
		}
		i++;
	}
	printf("%d\n", count+x);
	return 0;
}


Measured memory_bytes: 128
def get_divisor(i, n):
    out = [0] * (n // i)
    for j in range(len(out)):
        out[j] = i * (j+1)
    return out

n = int(input())
A = list(map(int, input().split()))

B = [False] * n

for i in range(n, 0, -1):
    divisors = get_divisor(i, n)
    B[i-1] = bool(A[i-1]) ^ bool(sum(B[divisor-1] for divisor in divisors) % 2)

out = [str(i+1) for i in range(n) if B[i]]

print(sum(B))
print(" ".join(out))


Measured memory_bytes: 24760
#include <iostream>
#include <cstdio>
#include <map>
#include <algorithm>
#include <cstring>
using namespace std;
int n,m;
int side[100][3],s[100][100],flag[100][100];
int find()
{
	for(int k=1;k<=n;k++)
	{
		for(int i=1;i<=n;i++)
		{
			for(int j=1;j<=n;j++)
			{
				if(flag[i][k]&&flag[k][j])
					flag[i][j]=1;
			}
		}
	}
	for(int a=2;a<=n;a++)
	{
		if(!flag[1][a])return 0;
	}
	return 1;
}
int main(){
	int a,b,c,d;
	scanf("%d%d",&n,&m);
	memset(s,0,sizeof(s));
	for(a=1;a<=m;a++)
	{
		scanf("%d%d",&b,&c);
		s[b][c]=1;side[a][1]=b;
		s[c][b]=1;side[a][2]=c;
	}
	int sum=0;
	for(a=1;a<=m;a++)
	{
		memcpy(flag,s,sizeof(s));
		flag[side[a][1]][side[a][2]]=0;
		flag[side[a][2]][side[a][1]]=0;
		if(!find())
		sum++;
	}
	printf("%d\n",sum);
	return 0;
}

Measured memory_bytes: 384
k,n = map(int, input().split())
A = list(map(int,input().split()))
d = 0

for i in range(n-1) :
    d = max(d, A[i+1] - A[i])

d1 = (k - A[n-1]) + A[0]
d = max(d, d1)
print(k-d)

Measured memory_bytes: 32324
from itertools import*
from math import*
from collections import*
from heapq import*
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf = 10**18
mod = 10**9+7
from functools import reduce
import sys
sys.setrecursionlimit(10**7)

n,c = map(int,input().split())
D = [list(map(int,input().split())) for _ in range(c)]
C = [list(map(int,input().split())) for _ in range(n)]
C0,C1,C2 = [0]*c,[0]*c,[0]*c
for i in range(n):
    for j in range(n):
        if (i+j)%3 == 0:
            C0[C[i][j]-1] += 1
        elif (i+j)%3 == 1:
            C1[C[i][j]-1] += 1
        else:
            C2[C[i][j]-1] += 1
ans = inf
for (i,j,k) in permutations(range(c),3):
    cur = 0
    for l in range(c):
        cur += D[l][i]*C0[l]+D[l][j]*C1[l]+D[l][k]*C2[l]
    ans = min(ans,cur)
print(ans)

Measured memory_bytes: 44380
#include <cstdio>
#include <string>
#include <iostream>
#include <algorithm>
#include <map>
#include <vector>
#include <unordered_map>
#include <iomanip>
#include <math.h>
#include <cmath>

#define PI 3.14159265359

using namespace std;
#define ASCII 97


int main() {
	std::map<char, std::string> weather;
	weather['S'] = "Cloudy";
	weather['C'] = "Rainy";
	weather['R'] = "Sunny";

	std::string S;
	cin >> S;


	cout << weather[S.c_str()[0]] << endl;

	return 0;
}



Measured memory_bytes: 256
n, k = map(int, input().split(" "))

amari_list = []


def hoge(N, K):
    if N == 0:
        return amari_list
    sho = N//K
    amari = N%K

    amari_list.append(amari)
    return hoge(sho, K)

print(len(hoge(n, k)))




Measured memory_bytes: 2940
h, w, k = map(int, input().split())
c = [list(input()) for _ in range(h)]

ans = 0
for i in range(2 ** h):
    for j in range(2 ** w):
        d = [c[x][:] for x in range(h)]
        for p in range(h):
            if (1 << p) & i: 
                for q in range(w): d[p][q] = '.'
        for q in range(w):
            if (1 << q) & j: 
                for p in range(h): d[p][q] = '.'
        cnt = 0
        for p in range(h):
            for q in range(w): cnt += (d[p][q] == '#')
        ans += (cnt == k)
print(ans)

Measured memory_bytes: 9152
//abc102_b.cpp
//Sat Jul  7 20:07:13 2018

#include <iostream>
#include <string>
#include <queue>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <math.h>
using namespace std;
using ll=long long;

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

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

	int ans = 0;

	for (int i=0;i<n-1;i++){
		for (int j=i+1;j<n;j++){
			int temp = abs(a[j]-a[i]);
			if (temp > ans){
				ans = temp;
			}
		}
	}


	cout << ans << endl;
}

Measured memory_bytes: 256
n = int(input())
s = input()
t = input()

for i in range(n, -1, -1):
    ans = [""] * (2 * n - i)
    ans[:n] = list(s)
    ans[-n:] = list(t)
    if ans[:n] == list(s):
        break

print(2 * n - i)


Measured memory_bytes: 2940
#include <iostream>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <string>
#include <sstream>
#include <algorithm>
#include <random>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <cassert>
#include <climits>
#include <bitset>
#include <functional>
#include <iomanip>
#include <random>

#include <atcoder/all>

#define FOR_LT(i, beg, end) for (int i = (int)(beg); i < (int)(end); i++)
#define FOR_LE(i, beg, end) for (int i = (int)(beg); i <= (int)(end); i++)
#define FOR_DW(i, beg, end) for (int i = (int)(beg); (int)(end) <= i; i--)
#define REP(n)              for (int repeat_index = 0; repeat_index < (int)n; repeat_index++)

using namespace std;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout << fixed << setprecision(20);

	int n, q; cin >> n >> q;
	atcoder::fenwick_tree<int64_t> ft(n);
	FOR_LT(i, 0, n) {
		int a; cin >> a;
		ft.add(i, a);
	}

	REP(q) {
		int m; cin >> m;
		if (m == 0) {
			int p, x; cin >> p >> x;
			ft.add(p, x);
		}
		else {
			int a, b; cin >> a >> b;
			cout << ft.sum(a, b) << endl;
		}
	}

	return 0;
}

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

int main(void){
	string p[3];
	cin >> p[0] >> p[1] >> p[2];
	for(auto &s : p) reverse(s.begin(), s.end());
	int i=0;
	while(p[i].size()){
		int c = i;
		i=p[i].back()-'a';
		p[c].pop_back();
	}
	cout << char(i+'A') << endl;
}

Measured memory_bytes: 3612
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n; cin >> n;
  vector<int> v(n);
  for(int i = 0; i < n; ++i) cin >> v[i];
  int cnt = 0;
  for(int i = 0; i < n; ++i){
    if(v[i] == v[i + 1]){
      v[i + 1] = 101;
      cnt++;
    }
  }
  cout << cnt << endl;
}

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

int main() {
  int H, W;
  cin >> H >> W;
  for(int i=0; i<W+2 ; i++){
    cout << "#";
  	}
   cout << endl;
  for(int i=0 ; i<H; i++){
    string j;
    cin >> j ;
    cout << "#" << j << "#" << endl;
  }
  for(int i=0; i<W+2 ; i++){
    cout << "#";
  	}
   cout << endl;
}




Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++){
    cin >> A[i];
  }
  sort(A.begin(), A.end());
  if (N % 2 == 0){
    long long ans = 0;
    for (int i = 0; i < N / 2 - 1; i++){
      ans += (long long) (A[i + 1] - A[i]) * (i * 2 + 2);
    }
    ans += (long long) (A[N / 2] - A[N / 2 - 1]) * (N - 1);
    for (int i = N / 2; i < N - 1; i++){
      ans += (long long) (A[i + 1] - A[i]) * (N - i - 1) * 2;
    }
    cout << ans << endl;
  } else {
    long long ans = 0;
    for (int i = 0; i < N / 2; i++){
      ans += (long long) (A[i + 1] - A[i]) * (i * 2 + 2);
    }
    for (int i = N / 2; i < N - 1; i++){
      ans += (long long) (A[i + 1] - A[i]) * (N - i - 1) * 2;
    }
    ans -= min(A[N / 2 + 1] - A[N / 2], A[N / 2] - A[N / 2 - 1]);
    cout << ans << endl;
  }
}

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

int main()
{
    int a, b;
    cin >> a >> b;
    int ans=b;
    if(a < 13) ans = b/2;
    if(a <= 5) ans = 0;

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

Measured memory_bytes: 256
using System;
using System.Linq;
class Program
{
  static void Main(string[] args)
  {
    string[] input = Console.ReadLine().Split(' ');
    int a = int.Parse(input[0]);
    int b = int.Parse(input[1]);
    int[] num = new int[] { a+b, a-b, a*b };
    Console.WriteLine(num.Max());
  }
}


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

void std_str(int N, string s, int alpha_size) {
  if (s.size() == N) {
    cout << s << endl;
    return;
  }

  for (int i = 0; i < alpha_size; i++) {
    std_str(N, s + (char)('a' + i), alpha_size);
  }
  std_str(N, s + (char)('a' + alpha_size), alpha_size + 1);
}

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

  std_str(N, "a", 1);

  return 0;
}


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

struct cmp {
	int mod;
	cmp(int x) :mod(x) {}
	bool operator()(const int& a, const int& b)const {
		return a % mod < b% mod;
	}
};

int main() {
	int n; cin >> n;
	vector<int>a(n), b(n); for (auto&& x : a)cin >> x;for (auto&& x : b)cin >> x;
	int ans = 0;
	for (int i = 0; i < 30; i++) {
		sort(b.begin(), b.end(), cmp(1 << i));
		bool btg = false;
		for (int j = 0; j < n; j++) {
			btg ^= (b[j] >> i) & 1;
		}
		for (int j = 0; j < n; j++) {
			int v = (1 << i) - (a[j] % (1 << i)) - 1;
			int pos = upper_bound(b.begin(), b.end(), v, cmp(1 << i)) - b.begin();
			int pv = (a[j] >> i) & 1;
			bool tg = (pv ? pos & 1 : (n - pos) & 1);
			tg ^= btg;
			if (tg)ans ^= (1 << i);
		}
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 1792
package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)

	g := make([][]int, n+1)
	d := make([]int, n+1)
	for i := 0; i < n; i++ {
		var u,k int
		fmt.Scan(&u)
		fmt.Scan(&k)
		g[u] = make([]int, k)
		for j := 0; j < k; j++ {
			fmt.Scan(&g[u][j])
		}

		d[i+1] = -1
	}

	q := [][]int{}
	q = append(q, []int{1, 0})
	for len(q) > 0 {
		pop := q[0]
		if len(q) > 1 {
			q = q[1:]
		} else {
			q = [][]int{}
		}
		if d[pop[0]] >= 0 {
			continue
		}
		d[pop[0]] = pop[1]

		for j := 0; j < len(g[pop[0]]); j++ {
			q = append(q, []int{g[pop[0]][j], pop[1]+1})
		}
	}

	for i := 1; i <= n; i++ {
		fmt.Printf("%d %d\n", i, d[i])
	}
}



Measured memory_bytes: 1184
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pll pair<ll,ll>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))

using namespace std;

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

const ll INF=1e15;

int main(){
    ll n;
    cin >>n;
    vector<ll> a(n);
    
    vector<ll> x(n); //a[i]+i
    vector<ll> y(n); //a[i]-i
    vector<ll> z(n); //-a[i]+i
    vector<ll> w(n); //-a[i]-i
    map<ll,ll> s;
    map<ll,ll> t;
    
    rep(i,n){
        cin >> a[i];
        x[i]=a[i]+i;
        y[i]=a[i]-i;
        z[i]=-a[i]+i;
        w[i]=-a[i]-i;
        s[y[i]]++;
        t[w[i]]++;
    }
    ll ans=0;
    
    for(auto x:s){
        ans+=t[x.fi]*x.se;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 45272
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
    int N, sub;
    cin >> N;
    vector<int> A(N);
    for(int i = 0; i < N; i++){
        cin >> A[i];
    }
    sort(A.begin(), A.end());
    sub = A[N - 1] - A[0];
    cout << sub << endl;
}

Measured memory_bytes: 3616
from fractions import gcd
import math
def inverse(a):
    return pow(a, mod - 2, mod)


def usearch(x, a):
    lft = 0
    rgt = len(a) + 1
    while rgt - lft > 1:
        mid = (rgt + lft) // 2
        if a[mid] <= x:
            lft = mid
        else:
            rgt = mid
    return lft



def main():
    s = input()
    if ('N' in s) ^ ('S' in s):
        print('No')
        return
    if ('E' in s) ^ ('W' in s):
        print('No')
        return
    print('Yes')

main()


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

int F[100]; int N;

int main(){
  cin >> N;
  F[0] = 1;
  F[1] = 1;
  for(int i = 2; i < 45; ++i){
    F[i] = F[i-1] + F[i-2];
  }
  
  cout << F[N] << endl;
}



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

typedef long long int lli;

const int MOD = 1e9+7;
const int facHausSize = 900005;
lli facHaus[facHausSize];

lli powe(int a, int b) {
	if(b < 2) return b? a:1;
	else {
		lli base = powe(a, b/2);
		lli ans = base*base;
		ans %= MOD;
		if(b%2) {
			ans *= a;
			ans %= MOD;
		}
		return ans;
	}
}

lli inv(int a) {
	return powe(a, MOD-2);
}

lli choos(int a, int b) {
	if(a < b || b < 0) return 0;
	lli ans = facHaus[a];
	ans %= MOD;
	ans *= inv(facHaus[b]);
	ans %= MOD;
	ans *= inv(facHaus[a-b]);
	ans %= MOD;
	return ans;
}

int N, M, K;

int main() {
	facHaus[0]=facHaus[1]=1;
	for(int i = 2; i < facHausSize; i++) {
		facHaus[i]=(i*facHaus[i-1])%MOD;
	}

	cin >> N >> M >> K;

	//ans = summation of [(N-1+m+k)C(m+k)][(m+k)Cm]3^(M+K-m-n) from m = 0 to M and from k = 0 to K
	lli termOne = 1;
	lli termTwo = 1;
	lli termThree = powe(3, M+K);
	lli base = termOne*termTwo*termThree;
	lli ans = base;
	for(int summe = 1; summe <= M+K; summe++) {
		termOne *= (N-1+summe);
		termOne %= MOD;
		termOne *= inv(summe);
		termOne %= MOD;

		termTwo *= 2;
		if(summe > M) {
			termTwo -= choos(summe-1, M);
		}
		if(summe > K) {
			termTwo -= choos(summe-1, K);
		}
		termTwo += 2*MOD;
		termTwo %= MOD;
	
		termThree = powe(3, M+K-summe);

		base = termOne*termTwo;
		base %= MOD;
		base *= termThree;
		base %= MOD;

		ans += base;
		ans %= MOD;
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 7424
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template<class T,class U> using P = pair<T,U>;
template<class T> using vec = vector<T>;
template<class T> using vvec = vector<vec<T>>;

constexpr ll mod = 1e9+7;
struct mint {
    ll x;
    mint(ll x=0):x((x%mod+mod)%mod){}
    
    friend ostream &operator<<(ostream& os,const mint& a){
        return os << a.x;
    }

    friend istream &operator>>(istream& is,mint& a){
        ll t;
        is >> t;
        a = mint(t);
        return (is);
    }

    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint a) {
        if ((x += mod-a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const mint a) {
        (x *= a.x) %= mod;
        return *this;
    }
    mint operator+(const mint a) const {
        mint res(*this);
        return res+=a;
    }
    mint operator-(const mint a) const {
        mint res(*this);
        return res-=a;
    }
    mint operator*(const mint a) const {
        mint res(*this);
        return res*=a;
    }
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t>>1);
        a *= a;
        if (t&1) a *= *this;
        return a;
    }
    // for prime mod
    mint inv() const {
        return pow(mod-2);
    }
    mint& operator/=(const mint a) {
        return (*this) *= a.inv();
    }
    mint operator/(const mint a) const {
        mint res(*this);
        return res/=a;
    }
};

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

    auto prime = [](int x){
        unordered_map<int,int> mp;
        int n = x;
        for(int i=2;i*i<=x;i++){
            while(n%i==0){
                mp[i]++;
                n /= i;
            }
        }
        if(n!=1) mp[n]++;
        return mp;
    };

    vec<unordered_map<int,int>> mps;
    for(int i=0;i<N;i++){
        int a;
        cin >> a;
        mps.push_back(prime(a));
    }

    unordered_map<int,int> pmax;
    for(auto& mp:mps){
        for(auto& x:mp){
            if(!pmax.count(x.first)) pmax[x.first] = x.second;
            else pmax[x.first] = max(pmax[x.first],x.second);
        }
    }

    mint ans = 0;
    for(auto& mp:mps){
        mint now = 1;
        for(auto& p:pmax){
            mint num = p.first;
            if(!mp.count(p.first)) now *= num.pow(p.second);
            else now *= num.pow(p.second-mp[p.first]);
        }
        ans += now;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3288
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define ll long long
#define All(v) (v).begin(),(v).end()
int main(){
    int n,ans=0;
    cin>>n;
    rep(i,n){
        int l,r;
        cin>>l>>r;
        ans+=r-l+1;
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
map<string,int> mp;
int n;
string s;
int main(void){
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>s;
        mp[s]++;
    }
    cout<<"AC"<<" x ";
    cout<<mp["AC"]<<endl;
    cout<<"WA"<<" x ";
    cout<<mp["WA"]<<endl;
    cout<<"TLE"<<" x ";
    cout<<mp["TLE"]<<endl;
    cout<<"RE"<<" x ";
    cout<<mp["RE"]<<endl;
    
}


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

int main(void)
{
	int N, M;
	char U[256][11];
	char T[11];
	int i, j;
	int flag_open;
	
	scanf("%d", &N);
	
	for (i = 0; i < N; i++){
		scanf("%s", U[i]);
	}
	
	flag_open = 0;
	
	scanf("%d", &M);
	for (i = 0; i < M; i++){
		scanf("%s", T);
		
		for (j = 0; j < N; j++){
			if (strcmp(U[j], T) == 0){
				break;
			}
		}
		if (j == N){
			printf("Unknown %s\n", T);
		}
		else {
			if (flag_open == 0){
				printf("Opened by %s\n", T);
				flag_open = 1;
			}
			else {
				printf("Closed by %s\n", T);
				flag_open = 0;
			}
		}
	}
	
	return (0);
}

Measured memory_bytes: 608
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#pragma warning(disable:4996)
#include <stdio.h>
#include <string>
#include <stdlib.h>
#include <math.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <functional>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <list>
#include <set>
#include <map>
#include <iomanip> 
#include <ctime>
#include <numeric>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;

const double PI = 3.14159265358979323846;
const int MAX = 1e7;
const int MOD = 1e9+7;


int main(int argc, char *args[]) {
	int h, w, n; cin >> h >> w >> n;
	int bigger = 0;
	if (h >= w) bigger = h;
	else bigger = w;
	int res = 0;
	if (n % bigger == 0) {
		res = n / bigger;
	}
	else {
		res = n / bigger + 1;
	}
	cout << res << endl;
}

Measured memory_bytes: 256
package main
 
import (
	"bufio"
	"fmt"
	"log"
	"os"
	"strconv"
)
 
func run() {

	var A int;
    A = nextInt();
    var P int;
    P = nextInt();
	solve(A, P);

}

func solve(A int, P int){
	A = A*3 + P
	Println(A/2)
}


// --- template ---
// Thanks https://gist.github.com/halllllll/853ab587fd82ee3ffe6f7fb7fb499695
 
var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)
 
// Caution: You will get unexpected result if a single token is larger than this size.
const BufferSize = 64 * 1024 * 1024
 
func Print(a ...interface{}) (n int, err error) {
	return fmt.Fprint(out, a...)
}
 
func Printf(format string, a ...interface{}) (n int, err error) {
	return fmt.Fprintf(out, format, a...)
}
 
func Println(a ...interface{}) (n int, err error) {
	return fmt.Fprintln(out, a...)
}
 
func next() string {
	sc.Scan()
	return sc.Text()
}
 
func nextInt() int {
	a, err := strconv.Atoi(next())
	if err != nil {
		log.Fatal(err)
	}
	return a
}

func nextFloat() float64 {
	a, err := strconv.ParseFloat(next(), 64)
	if err != nil {
		log.Fatal(err)
	}
	return a
}


type IntHeap []int
func (h IntHeap) Len() int           { return len(h) }
func (h IntHeap) Less(i, j int) bool { return h[i] > h[j] }
func (h IntHeap) Swap(i, j int)      { h[i], h[j] = h[j], h[i] }

func (h *IntHeap) Push(x interface{}) {
	// Push and Pop use pointer receivers because they modify the slice's length,
	// not just its contents.
	*h = append(*h, x.(int))
}

func (h *IntHeap) Pop() interface{} {
	old := *h
	n := len(old)
	x := old[n-1]
	*h = old[0 : n-1]
	return x
}

/////数字と文字
// 基本クラス
type NS struct {
    Num int
    Str string
}

//////　数字と数字
// 基本クラス
type NN struct {
    Num1 int
    Num2 int
}

 
func main() {
	sc.Buffer(make([]byte, 0, BufferSize), BufferSize)
	sc.Split(bufio.ScanWords)
	run()
	out.Flush()
}



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

int main(){
	string S;
	cin >> S;
	string H[5]={"hi","hihi","hihihi","hihihihi","hihihihihi"};
	for(int i=0;i<5;i++){
		if(S==H[i]){
			cout << "Yes" << endl;
			return 0;
		}
	}
	cout << "No" << endl;
	return 0;
}

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

int main()
{
    long long n,i,d,dd,x,y,sum=0;
    cin>>n;
    long long a[n+2];
    for(i=0;i<n;i++)
    {
        cin>>a[i];
        sum+=a[i];
    }
    x=a[0];
    y=sum-a[0];
    d=abs(x-y);
    for(i=1;i<n-1;i++)
    {
        x+=a[i];
        y-=a[i];
        dd=abs(x-y);
        if(dd<d)
        {
            d=dd;
        }

    }
    cout<<d<<endl;
    return 0;
}


Measured memory_bytes: 1792
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	int n = sc.nextInt();
	sc.nextLine();
	String s = sc.nextLine();
	int ans = 0;
	for(int i = 0, x = 0;i < n;i++){
	    if(s.charAt(i) == 'I')
		x++;
	    else if(s.charAt(i) == 'D')
		x--;
	    ans = Math.max(ans, x);
	}
	System.out.println(ans);
    }

}


Measured memory_bytes: 9680
N,K = map(int, input().split(' '))
a=list(range(1,N+1))
for i in range(K):
  count=int(input())
  b=[int(x.strip()) for x in input().split(' ')]
  for j in range(count):
    if b[j] in a:
      a.remove(b[j])
print(len(a))

Measured memory_bytes: 8948
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
#define rep(i,m,n) for(int i=m;i<n;i++)
ll mod=1e9+7;

int main(){
  ll a,v,b,w,t;
  cin>>a>>v>>b>>w>>t;
  if(abs(a-b)<=t*(v-w)) cout<<"YES"<<endl;
  else cout<<"NO"<<endl;
}

Measured memory_bytes: 3676
#include<iostream>
#include<algorithm>
#include<string>
#include<cmath>
using namespace std;
int main()
{
	string s;
	int k,i;
	long long l=0;
	cin>>s>>k;
	for(i=0;i<s.length();i++)
	{
		if(s[i]=='1'&&k<=i+1)
		{
			printf("1");
			break;
		}
		else if(s[i]>49)
		{
			printf("%d",s[i]-48);
			break;
		}
	}
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
	int main(){
		int N,hasil;
		
		scanf ("%d", &N);
		
		if (N % 2 == 0){
			hasil = N/2;
			printf("%d",hasil);
		}else{
			hasil = N/2+1;
			printf ("%d",hasil);
		}
		return 0;
	}


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

typedef long long ll;

#define pb push_back
#define MS(x,y) memset((x),(y),sizeof((x)))
#define mn 1000000

using namespace std;

int main()
{
    #if LOCAL_DEBUG
        fstream cin("in.txt");
    #endif

    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int n,k;

    cin>>n>>k;

    if (n%k == 0) cout<<0<<endl;
    else cout<<1<<endl;

    return 0;
}


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

int main(){
  int h,n;cin >> h >> n;
  int total=0;
  vector<int> a(n);
  for(int i=0;i<n;i++){
    cin >> a[i];
    total += a[i];
  }
  if(total>=h){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  
}

Measured memory_bytes: 640
#A - Range Product 
a,b = map(int,input().split())
if a <= 0 and b >= 0:
    print('Zero')
elif a < 0 and b < 0:
    if abs(a - b) % 2 == 0:
        print('Negative')
    else :
        print('Positive')
elif a > 0 and b > 0:
    print('Positive')

Measured memory_bytes: 61776
#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<numeric>
#include<queue>
#include<string>
#include<vector>
#include <stdio.h>
#define ll long long
#include<cstring>
#define rep(i,n) for(int i=0;i<n;i++)
ll mod = 1000000007;
using namespace std;
priority_queue<ll int>QUE;//きゅー

int length(char* str) {
	int len = strlen(str);
	return len;
}

int main()
{
	int N;
	char S[100010];
	int a[100010];
	cin >> N >> S;
	int len = length(S);
	for (int i = 0; i < len; i++) {
		a[i] = S[i] - 'A';
		a[i] = (a[i] + N) % 26;
		putchar('A'+a[i]);
	}
}


Measured memory_bytes: 256
//  cd Desktop/Atcoder
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define rep(i,n) for(i=0;i<(n);i++)
#define ll long long
#define ull unsigned long long
#define MOD 1000000007

int main(){
    int n,i;
    char s[102]={};
    scanf("%d",&n);
    scanf("%s",s);
    if (n%2!=0){
        printf("No");
        return 0;
    }
    rep(i,n/2){
        if (s[i]!=s[i+n/2]){
            printf("No");
            return 0;
        }
        
    }
    printf("Yes");
    return 0;
}


Measured memory_bytes: 1708
import java.util.Scanner;

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

        int H = sc.nextInt(), W = sc.nextInt();
        int board[][] = new int[H][W];
        for (int i = 0; i < H; i++) {
            String row = sc.next();
            for (int j = 0; j < W; j++) {
                board[i][j] = row.charAt(j) == '#' ? 1 : 0;
            }
        }

        int r = 0, c = 0;
        while (true) {
            board[r][c] = 0;
            if (r == H-1 && c == W-1) {
                break;
            } else if (r + 1 < H && board[r+1][c] == 1) {
                r++;
            } else if (c + 1 < W && board[r][c+1] == 1) {
                c++;
            } else {
                System.out.println("Impossible");
                return;
            }
        }

        for (int i = 0; i < H; i++) {
            for (int j = 0; j < W; j++) {
                if (board[i][j] == 1) {
                    System.out.println("Impossible");
                    return ;
                }
            }
        }
        System.out.println("Possible");
    }
}


Measured memory_bytes: 9808
using System;
using System.Linq;

namespace TaskB
{
    class Program
    {
        static void Main(string[] args)
        {
            var numbers = Console.ReadLine()
                .Split(' ', StringSplitOptions.RemoveEmptyEntries)
                .Select(int.Parse)
                .ToArray();

            var a = numbers[0];
            var b = numbers[1];
            var c = numbers[2];
            var k = numbers[3];

            var res = Math.Min(a, k);
            if (k > a + b)
            {
                res -= (k - a - b);
            }

            Console.WriteLine(res);

        }
    }
}


Measured memory_bytes: 28232
n, m = list(map(int, input().split()))
A = [list(map(int, input().split())) for _ in range(n)]
A = sorted(A, key = lambda x: x[0])
count = 0
ans = 0
for i in range(n):
    if count + A[i][1] <= m:
        ans += A[i][0] * A[i][1]
        count += A[i][1]
    else:
        ans += A[i][0] * (m - count)
        print(ans)
        exit()
print(ans)

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

int main(){
    int N;
    cin >> N;
    char s[N];
    int f[4];
    for(int i=0;i<4;i++) f[i] = 0;
    for(int i=0;i<N;i++){
        cin >> s[i];
        if(s[i]=='P') f[0] = 1;
        else if(s[i]=='W') f[1] = 1;
        else if(s[i]=='G') f[2] = 1;
        else f[3] = 1;
    }
    if(f[3]==0) cout <<"Three";
    else cout <<"Four";


}

Measured memory_bytes: 256
import sys
import itertools
# import numpy as np
import time
import math

sys.setrecursionlimit(10 ** 7)

from collections import defaultdict

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n, x, y = map(int, readline().split())

dists = [0 for _ in range(n)]
for i in range(1, n + 1):
    for j in range(i + 1, n + 1):
        d = min(abs(i - j), abs(x - i) + 1 + abs(y - j))
        dists[d] += 1
for i in range(1, n):
    print(dists[i])



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

#define ll long long
#define fornum(A,B,C) for(A=B;A<C;A++)
#define mp make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>

using namespace std;

/////////////////////////////////////////////////////
#define MOD ((ll)1e9+7)
ll N,M,S[2020],T[2020];

ll mk[2020],mk2[2020];
ll i, j, k,ans;
ll dp[2020][2020];

int main(){
    scanf("%lld%lld", &N, &M);
    fornum(i,0,N){
        scanf("%lld", S+i);
    }
    fornum(i,0,M){
        scanf("%lld", T+i);
    }
    fornum(i,0,N){
        ll a = 1;
        fornum(j,0,M){
            dp[i + 1][j] = dp[i][j];
            if(S[i]==T[j]){
                dp[i + 1][j] = (dp[i + 1][j] + a) % MOD;
            }
            a += dp[i][j];
        }
    }
    ans = 1;
    fornum(i,0,M){
        ans +=dp[N][i];
    }
    printf("%lld", ans%MOD);

    return 0;
}

Measured memory_bytes: 31872
Mod = 1000000007
N = gets.to_i
S,T = (0..1).map{ gets.chomp }
U = (0...N).map{ |i| S[i] == T[i] ? "2" : "1" }.join.gsub(/11/,"1")
p (0...U.size-1).reduce(U[0]=="2" ? 3 : 6){ |a,i| 
  a * (U[i] == "2" ? 2 : U[i+1] == "2" ? 1 : 3) % Mod
}


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

int main()
{
  int64_t X, Y, A, B, C, a, t, x = 0, y = 0, z = 0, ans = 0;
  cin >> X >> Y >> A >> B >> C;
  priority_queue<pair<int64_t, int64_t>> pq;
  for (int i = 0; i < A; i++)
  {
    cin >> a;
    pq.push({a, 0});
  }
  for (int i = 0; i < B; i++)
  {
    cin >> a;
    pq.push({a, 1});
  }
  for (int i = 0; i < C; i++)
  {
    cin >> a;
    pq.push({a, 2});
  }
  while (x + y + z < X + Y)
  {
    tie(a, t) = pq.top();
    pq.pop();
    if (t == 0 && x < X)
    {
      ans += a;
      x++;
    }
    else if (t == 1 && y < Y)
    {
      ans += a;
      y++;
    }
    else if (t == 2)
    {
      ans += a;
      z++;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 11612
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define FOR(i,a,n) for(int i=(a); i<(n); i++)
#define all(v) v.begin(), v.end()
#define fi first
#define se second
#define sz(x) int(x.size())
using namespace std;
using ll = long long;
using P = pair<int ,int>;
const int INF = 1001001001;
const int MOD = 1000000007;
template<class T> inline bool chmax(T &a, T b) { if (a<b) {a=b; return 1;} return 0;}
template<class T> inline bool chmin(T &a, T b) { if (b<a) {a=b; return 1;} return 0;}

#ifdef _DEBUG
#include "debug.h"
#else
#define debug(...)
#define print(...)
#endif

int main() {
    int n; cin >> n;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    bool ok = true;
    ll ans = 0;
    if (a[0]!=0) {
        ok = false;
    } else {
        int now = -1;
        rep(i, n) {
            if (now==-1) {
                now = a[i];
            } else if (a[i]==now+1) {
                now = a[i];
            } else if (a[i]==now) {
                ans += now;
                now = a[i];
            } else if (a[i]<now) {
                ans += now;
                now = a[i];
            } else {
                ok = false;
                break;
            }
            if (i==n-1) ans += now;
            debug(now, ans);
        }
    }
    if (!ok) cout << -1 << endl;
    else cout << ans << endl;
}

Measured memory_bytes: 1024
#include <iostream>

using namespace std;

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

  int L = S / 100;
  int R = S % 100;

  if(L >= 1 && L <= 12) {
    if (R >= 1&& R <= 12) cout << "AMBIGUOUS" << endl;
    else cout << "MMYY" << endl;
  } else {
    if (R >= 1&& R <= 12) cout << "YYMM" << endl;
    else cout << "NA" << endl;
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)

int main(){

	double v;

	while(cin>>v){
		double t = v/9.8;
		double y = 4.9*t*t;
//		if(EQ(y,0))
//			cout<<1<<endl;
//		else
			cout<<(int)(y/5)+2<<endl;
	}
		
	return 0;
}

Measured memory_bytes: 0