akhauriyash/Code-Regression huggingface dataset:
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() -> () {
    input!{
        n: usize,
        m: usize,
        x: i32,
        y: i32,
        xn: [i32; n],
        yn: [i32; m],
    }
    let xm = *xn.iter().max().unwrap();
    let ym = *yn.iter().min().unwrap();
    let z = ym;
    if xm < z && x < z && z <= y {
        println!("No War");
    } else {
        println!("War");
    }
}


Measured memory_bytes: 4476
var du,n,m,res:int64;
    i:longint;
begin
du:=round(1e9)+7;
readln(n,m);
if abs(n-m)>=2 then
    begin
       writeln(0);
       halt;
    end;
res:=1; 
for i:=1 to n do
   res:=(res*i)   mod du;
for i:=1 to m do
    res:=(res*i) mod du;
if n=m then res:=(res*2) mod du;
writeln(res);
end.


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

int main(){
	int  a,b;
	cin>>a>>b;
	int temp=1.0*a*100/8,ans=1e9;
	for(int i=temp-20;i<=temp+20;i++){
		if( floor(i*0.08) ==a && floor(i*0.1)==b) ans=min(ans,i);
	}
	if(ans==1e9) cout<<-1;
	else cout<<ans;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 1e9;
const double PI = acos(-1.0);

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

	int n;
	cin >> n;
	
	vector<int> v;
	
	v.push_back(0);
	for(int i = 1; i <= 52; i++) {
		v.push_back(i);
	}
	
	for(int i = 0; i < n; i++) {
		int num;
		string str;
		cin >> str >> num;
		
		int x = 0;
		if(str == "S") x = 0;
		if(str == "H") x = 1;
		if(str == "C") x = 2;
		if(str == "D") x = 3;
		
		num = num + x * 13;
		v[num] = v[num] - num;
	}
	
	sort(v.begin(), v.end());
	
	for(int i = 1; i <= 52; i++) {
		if(v[i] != 0) {
			int r = v[i] % 13;
			int d = (v[i] - 1) / 13;
			if(d == 0) cout << "S";
			if(d == 1) cout << "H";
			if(d == 2) cout << "C";
			if(d == 3) cout << "D";
			if(r == 0) r = 13;
			cout << " " << r << "\n";
		}
	}
	
	return 0;
}

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

const int N = 200010;
int f[N], s[N];

int fd(int x)
{
	if (f[x] != x)
		f[x] = fd(f[x]);
	return f[x];
}

int main()
{
	int n, m;
	scanf("%d%d", &n, &m);
	for (int i = 1; i <= n; i ++ )
		f[i] = i, s[i] = 1;
		
	int x, y;
	while (m -- )
	{
		scanf("%d%d", &x, &y);
		int fx = fd(x), fy = fd(y);
		if (fx != fy)
		{
			s[fx] += s[fy];
			f[fy] = fx;
		}
	}
	
	int mx = 0;
	for (int i = 1; i <= n; i ++ )
		mx = max(mx, s[fd(i)]);
	printf("%d\n", mx);
	
	return 0;
}

Measured memory_bytes: 3532
# coding: utf-8
import sys

stdin = sys.stdin
ns = lambda: stdin.readline().rstrip() # ignore trailing spaces
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))


def main():
    a,v = na()
    b,w = na()
    t = ni()
    if abs(a-b) <= (v-w)*t:
        print('YES')
    else:
        print('NO')
    return


if __name__ == '__main__':
    main()

Measured memory_bytes: 61740
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
#define F first
#define S second
#define forn(i, n) for (int i = 0; i < (int)n; i++)
#define pb push_back
#define fastIO ios::sync_with_stdio(0), cin.tie(0);
#define endl '\n'
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int, int> pii;

int main() {
#ifdef LOCAL
    // freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
#else
    fastIO;
#endif
    string s;
    cin >> s;
    bool ok1 = 0, ok2 = 0, ok3 = 1;
    ok1 = s[0] == 'A' ? 1 : 0;
    int ind = 0;
    for (int i = 2; i < sz(s) - 1; i++) {
        if (s[i] == 'C') {
            ok2 = 1;
            ind = i;
            break;
        }
    }
    if (ok1 && ok2) {
        for (int i = 1; i < sz(s); i++) {
            if (i != ind && (s[i] >= 'A' && s[i] <= 'Z')) {
                ok3 = 0;
                break;
            }
        }
    }
    if (ok1 && ok2 && ok3)
        cout << "AC" << endl;
    else
        cout << "WA" << endl;
    return 0;
}

Measured memory_bytes: 256
/*
 ============================================================================
 Name        : AtCoder_C.c
 Author      : 
 Version     :
 Copyright   : Your copyright notice
 Description : Hello World in C, Ansi-style
 ============================================================================
 */

#include <stdio.h>
#include <stdlib.h>

int N;
void MergeSort(int x[ ], int left, int right)
{
    int mid, i, j, k;
    int temp[N];

    if (left >= right)              /* 配列の要素がひとつなら */
        return;                     /* 何もしないで戻る */

                                    /* ここでは分割しているだけ */
    mid = (left + right) / 2;       /* 中央の値より */
    MergeSort(x, left, mid);        /* 左を再帰呼び出し */
    MergeSort(x, mid + 1, right);   /* 右を再帰呼び出し */

      /* x[left] から x[mid] を作業領域にコピー */
    for (i = left; i <= mid; i++)
        temp[i] = x[i];

      /* x[mid + 1] から x[right] は逆順にコピー */
    for (i = mid + 1, j = right; i <= right; i++, j--)
        temp[i] = x[j];

    i = left;         /* i とj は作業領域のデーターを */
    j = right;        /* k は配列の要素を指している */

    for (k = left; k <= right; k++)    /* 小さい方から配列に戻す */
        if (temp[i] <= temp[j])        /* ここでソートされる */
            x[k] = temp[i++];
        else
            x[k] = temp[j--];
}
int main(void) {
	int i;

	  /* 数値を格納する配列 */
	int total;
		  scanf("%d", &total);
	  int* number = (int*)malloc(sizeof(int)*total);
	  int* sortmae = (int*)malloc(sizeof(int)*total);

	  /* 数値の総数を入力 */


	  /* 配列に格納する数値を入力 */
	  for (i=0; i<total; ++i){
	    scanf("%d", &number[i]);
	    sortmae[i] = number[i];
	  }
	  N = total;
	  MergeSort(number, 0, total -1);

	  for (i=0; i<total; ++i){
		  if(sortmae[i] <= number[(total/2-1)] ){
			  printf("%d\n", number[total/2 ]);
		  }else{
			  printf("%d\n", number[total/2-1]);
		  }
	  }
	return EXIT_SUCCESS;
}


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

int main() {
  string A,B;
  int C,D;
  string E;
  cin >> A >> B;
  cin >> C >> D;
  cin >> E;
  
  if(E==A){
    cout << C-1 << " " << D << endl;
  }
  else if(E==B){
    cout << C << " " << D-1 << endl;
  }
}

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

using namespace std;
typedef long long ll;

char a[300][300], b[300][300];

bool check_it(ll n) {
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if (b[i][j] != b[j][i])
                return false;
        }
    }
    return true;
}


int main() {
    ll n, res = 0;
    cin >> n;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            cin >> a[i][j];
        }
    }
    for (int k = 0; k < n; k++) {
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                b[(i + k) % n][j] = a[i][j];
            }
        }
        if (check_it(n)) {
            res++;
        }
    }
    res *= n;
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 384
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<functional>
#include<fstream>
#include<utility>
#include<bitset>
#include<map>
#include<deque>
#include<cmath>
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define rep(N) for (int i = 0; i < N; ++i)
#define Rep(a, b) for (int i = a; i < b; ++i)
#define For(i, N) for (int i = 0; i < N; ++i)
#define rev(v) 	v.rbegin(), v.rend()
#define all(v) v.begin(), v.end()
#define makei(N) int N; cin >> N;
#define makel(N) ll N; cin >> N;
#define makes(s) string s; cin >> s;
#define maked(d) double d; cin >> d;
#define makev(v, N) vi v(N); rep(N)cin >> v[i];
#define mod 1000000007
#define re return 0

using namespace std;
using ll = long long int;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vector<bool>>;
using vs = vector<string>;
using pii = pair<int, int>;
using pis = pair<int, string>;

template<typename T>
void say(T s) {
	cout << s << endl;
}

template<typename T>
void say(vector<T> s) {
	auto itr = s.begin();
	cout << *(itr++);
	while (itr != s.end()) {
		cout << " " << *(itr++);
	}
	cout << endl;
}

int main() {
	int A = 0;
	int B = 0;
	makei(N);
	makev(a, N);
	sort(rev(a));
	rep(N) {
		if (i % 2 == 0)A += a[i];
		else B += a[i];
	}
	say(A - B);
}


Measured memory_bytes: 256
N = input()
l = len(N)

if N[l-1] == '2' or N[l-1] =='4' or N[l-1] == '5' or N[l-1] == '7' or N[l-1] == '9':
    print('hon')
elif N[l-1] == '0' or N[l-1] == '1' or N[l-1] == '6' or N[l-1] == '8':
    print('pon')
elif N[l-1] == '3':
    print('bon')

Measured memory_bytes: 9096
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repe(i, n) for (int i = 0; i <= (int)(n); i++)
#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define ANS cout << ans << endl
#define all(a) a.begin(),a.end()
#define SORT(a) sort(all(a))
#define REVERSE(a) reverse(all(a))
#define int ll
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORe(i, m, n) for(int i = m;i <= n;i++)
#define VIin(a) for(int i=0; i<a.size(); i++) cin >> a[i]
#define OUT(a) cout << a << endl
#define IN(a) cin >> a
typedef vector<int> VI;
typedef vector<VI> VVI;
const int MOD=1e9+7;
const long long INF = 1LL << 60;
/*最大公約数*/int gcd(int x, int y) { return y ? gcd(y,x%y) : x;}
/*最小公倍数*/int lcm(int a, int b) { int g = gcd(a, b); return a / g * b; }
/*素数判定*/int isPrime(int n){if(n<2){return 0;}for(int i=2; i*i<=n; i++){if(n%i==0){return 0;}}return 1;}
/*約数列挙*/vector<int> getDivisor(int n){vector<int> v; for(int i=1; i*i<=n; i++){if(n%i==0){v.push_back(i);if(i!=n/i){v.push_back(n/i);}}}sort(v.begin(),v.end()); return v;}
//----------------------------------------------
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    map<string,int> s;
    string str;
    int n; IN(n);
    rep(i,n){
        IN(str);
        s[str]++;
    }
    int m; IN(m);
    rep(i,m){
        IN(str);
        s[str]--;
    }
    int ans = 0;
    for(auto a:s) ans = max(ans,a.second);
    ANS;
    
    return 0;
}

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

namespace AtCoderCS
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split();
            int X = int.Parse(input[0]);
            int A = int.Parse(input[1]);

            if (X < A)
            {
                Console.WriteLine(0);
            }
            else
            {
                Console.WriteLine(10);
            }
        }
    }
}


Measured memory_bytes: 13140
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    cout<<fixed<<setprecision(12);
    int n;
    cin>>n;
    double p[n+1];
    p[0]=0;
    for(int i=1;i<=n;i++)
    {
        cin>>p[i];
    }
    double dp[n+1][n+1];
    memset(dp,0,sizeof(dp));
    dp[0][0]=1;
    for(int i=1;i<=n;i++)
    {
        for(int j=0;j<=i;j++)
        {
            if(j==0)
            {
                dp[i][j]=dp[i-1][j]*(1-p[i]);
            }
            else
            {
                dp[i][j]=(dp[i-1][j]*(1-p[i]))+(dp[i-1][j-1]*p[i]);
            }
        }
    }
    long double ans=0.0000000;
    for(int i=(n+1)/2;i<=n;i++)
    {
        ans+=dp[n][i];
    }
    /*for(int i=0;i<=n;i++)
    {
        for(int j=0;j<=n;j++)
        {
            cout<<dp[i][j]<<" ";
        }
        cout<<endl;
    }*/
    cout<<ans;
    return 0;
}









Measured memory_bytes: 70656
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
int main(){
    int d,h;
	while(cin>>d){
		h=0;
		for(int i=1;i<600/d;i++)
			h+=(i*d)*(i*d)*d;
		cout<<h<<endl;
	}
	return 0;
}

Measured memory_bytes: 1160
// Problem : C - A+...+B Problem
// Contest : Virtual Judge - practice contest 2
// URL : https://vjudge.net/contest/390405#problem/C
// Memory Limit : 262 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

// #pragma GCC optimize ("O3")
// #pragma GCC target ("sse4")

#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;
 
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
 
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;
 
#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,b,a) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
#define trav(a,x) for (auto& a : x)
 
#define bug(x) cout<<#x<<"="<<x<<endl; 
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define ins insert
 
template<class T> bool ckmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }
 
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
const ld pii=3.14159265359; 
const int MOD = 1000000007;
const char nl = '\n';
const int MX = 200001; //check the limits, dummy
 
int main() 
{
	ios_base::sync_with_stdio(0); cin.tie(0);    
	ll N,A,B;
	cin>>N>>A>>B;
	if(A>B || N==1 && A!=B)
	{
		cout<<0<<nl;
		return 0;
	}
	cout<<(N-1)*B+A-(N-1)*A-B+1<<nl;
	return 0;
}
 
// read the question correctly (ll vs int)
// template by bqi343

Measured memory_bytes: 3616
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<utility>
#include<cmath>
#include<climits>
#include<queue>
#include<stack>
#include<numeric>
#include<set>
#include<iomanip>
#include<map>
#include<type_traits>
#include<tuple>
#include<deque>
#include<cassert>
#include<bitset>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
#define rep(i,N) for(ll (i)=0;(i)<(N);(i)++)
#define chmax(x,y) x=max(x,y)
#define chmin(x,y) x=min(x,y)
const int mod = 1000000007;
const int INF = 1001001001;

int main() {
  ll a, b;
  cin >> a >> b;
  ll cnt = 1;

  set<ll> as, bs;
  auto f = [&](ll x) {
    set<ll> st;
    for(ll i = 2; i * i <= x; ++i) {
      if(x % i) continue;
      st.insert(i);
      while (x % i == 0) x /= i;
    }
    if(x > 1) st.insert(x);
    return st;
  };

  as = f(a);
  bs = f(b);
  for (ll p : as) {
    ll bp = *bs.lower_bound(p);
    if(bp == p) cnt++;
  }
  cout << cnt << endl;
}


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

using namespace std;

#define llong long long int
#define ldouble long double
#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define SZ(x) ((int)(x).size())
#define stl_rep(itr, x) for (auto itr = x.begin(); itr != x.end(); ++itr)
#define UNIQUE(x) x.erase(unique(x.begin(), x.end()), x.end())

const static llong MOD = 1000000000 + 7;
const static llong INF = 1LL << 60;
const static double eps = 1e-6;
const static int dy[] = {0, 1, 0, -1};
const static int dx[] = {1, 0, -1, 0};

const static int needed_matchsticks[9] = {2, 5, 5, 4, 5, 6, 3, 7, 6};
string dp[11000];

string comp_string(string &s1, string &s2) {
    if (SZ(s1) > SZ(s2)) {
        return s1;
    } else if (SZ(s2) > SZ(s1)) {
        return s2;
    } else {
        if (s1 > s2) return s1;
        else return s2;
    }
}

signed main (int argc, char *argv[]) {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n, m;
    cin >> n >> m; 
    vector<int> A(m);
    rep(i, m) cin >> A[i];

    rep(i, 11000) dp[i] = "/";

    dp[0] = "";
    rep(i, n + 1) {
        if (dp[i] == "/") continue;
        rep(j, A.size()) {
            string tmp = dp[i] + to_string(A[j]);
            dp[i + needed_matchsticks[A[j] - 1]] = comp_string(dp[i + needed_matchsticks[A[j] - 1]], tmp);
        }
    }

    cout << dp[n] << endl;

    return 0;
}

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


int main(int argc, char *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << setprecision(20);

  ll N; cin >> N;
  vector<string> S(N);
  vector<ll> T(N);
  for (ll i = 0; i < N; i++) cin >> S.at(i) >> T.at(i);
  string X; cin >> X;
  ll cnt = 0;
  bool sl = false;
  for (ll i = 0; i < N; i++) {
    if (sl) {
      cnt += T.at(i);
    }else if (S.at(i) == X) {
      sl = true;
    }
  }
  cout << cnt << endl;

  return 0;
}



Measured memory_bytes: 256
// khodaya khodet komak kon
#include <bits/stdc++.h>
#define pb push_back
#define ers erase
#define ins insert
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define debug(x)  cerr << #x << " = " << x << endl
#define kill(x) return cout << x, 0;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#pragma GCC optimize ("Ofast")
using namespace std;

typedef long long ll;
typedef long double ld;
typedef string str;
typedef pair<ll, ll> pll;
typedef vector<ll> vl;
typedef vector<pll> vpl;

const ld Pi = 3.14159265359;
const ll MOD = 998244353;
const ll N = 3e5 + 10;
const ll INF = 1e18;
const ll LOG = 20;
ll fac[N], im[N];
ll POW_MOD(ll x, ll t){
	if (t == 0){
		return 1;
	}
	if (t % 2 == 0){
		return (POW_MOD((x * x) % MOD, t / 2));
	}else{
		return (x * POW_MOD(x, t - 1)) % MOD;
	}
}

ll CHOOSE(ll n, ll c){
	if (c > n) return 0;
	ll ans = fac[n] * im[c];
	ans %= MOD;
	ans *= im[n - c];
	ans %= MOD;
	return ans;
}





int main(){
	IOS;
	fac[0] = 1;
	ll n, A, B, K;
	for (int i = 1; i < N; i++){
		fac[i] = (fac[i - 1] * i) % MOD;
	}
	for (int i = 0; i < N; i++){
		im[i] = POW_MOD(fac[i], MOD - 2);
	}
	ll ans = 0;
	cin >> n >> A >> B >> K;
	for (int i = 0; i <= n; i++){
		ll magh;
		if (K < A * i){
			break;
		}
		if ((K - A * i) % B == 0 && (K - A * i) / B <= n){
			magh = (K - A * i) / B;
			ans += CHOOSE(n, i) * CHOOSE(n, magh);
			ans %= MOD;
		}
	}	
	cout << ans;
	
	
	
	
	
	return 0;
}






/*
     ,---,           ___                 ,--,
    '  .' \        ,--.'|_             ,--.'|                             ,--,
   /  ;    '.      |  | :,'            |  | :                           ,--.'|    ,---.        ,---,
  :  :       \     :  : ' :            :  : '                 .--.--.   |  |,    '   ,'\   ,-+-. /  |
  :  |   /\   \  .;__,'  /    ,--.--.  |  ' |     ,--.--.    /  /    '  `--'_   /   /   | ,--.'|'   |
  |  :  ' ;.   : |  |   |    /       \ '  | |    /       \  |  :  /`./  ,' ,'| .   ; ,. :|   |  ,"' |
  |  |  ;/  \   \:__,'| :   .--.  .-. ||  | :   .--.  .-. | |  :  ;_    '  | | '   | |: :|   | /  | |
  '  :  | \  \ ,'  '  : |__  \__\/: . .'  : |__  \__\/: . .  \  \    `. |  | : '   | .; :|   | |  | |
  |  |  '  '--'    |  | '.'| ," .--.; ||  | '.'| ," .--.; |   `----.   \'  : |_|   :    ||   | |  |/
  |  :  :          ;  :    ;/  /  ,.  |;  :    ;/  /  ,.  |  /  /`--'  /|  | '.'\   \  / |   | |--'
  |  | ,'          |  ,   /;  :   .'   \  ,   /;  :   .'   \'--'.     / ;  :    ;`----'  |   |/
  `--''             ---`-' |  ,     .-./---`-' |  ,     .-./  `--'---'  |  ,   /         '---'
                            `--`---'            `--`---'                 ---`-'
*/




Measured memory_bytes: 4992
#include <stdio.h>
 
int main(void)
{
 
  int x, y, r, tmp;
 
  
  scanf("%d%d", &x,&y);
  
 
  if(x<y){
    tmp = x;
    x = y;
    y = tmp;
  }
 
  r = x % y;
  while(r!=0){
    x = y;
    y = r;
    r = x % y;
  }
 
  printf("%d\n", y);
 
  return 0;
}

Measured memory_bytes: 592
#include <bits/stdc++.h>
#define pq priority_queue
using namespace std; typedef pair<int, int> P; typedef pair<int, P> P2;
typedef pair<int, P2> P3; typedef long long ll; typedef long double ld;
constexpr long long gcd(long long a, long long b){return b ? gcd(b, a % b) : a;}
constexpr long long lcm(long long a, long long b){return a / gcd(a, b) * b;}
constexpr int INF = 1e9, MOD = INF + 7, around[] = {0, 1, 1, -1, -1, 0, -1, 1, 0, 0};
constexpr int mod_pow(long long x, long long n, const int mod){long long ret=1;while(n){if(n&1)(ret*=x)%=mod;(x*=x)%=mod;n>>=1;}return ret;}
template<int n> struct Prime{bool arr[n+1];constexpr bool operator[](int k){return arr[k];}constexpr Prime():arr(){for(int i=2;i<n;i++){arr[i]=true;for(int j=2;j*j<=i;j++){if(!(i%j))arr[i]=false;}}}};
template<int n> struct Factorial{long long arr[n+1],ary[n+1];constexpr Factorial():arr(),ary(){arr[0]=1;ary[0]=1;for(int i=0;i<n;i++){arr[i+1]=arr[i]*(i+1)%MOD;ary[i+1]=mod_pow(arr[i+1],MOD-2,MOD);}}};
constexpr Factorial<10> fact; constexpr Prime<10> prime;
constexpr int comb(int a, int b){long long pos = fact.arr[a], pot = fact.ary[a - b], por = fact.ary[b];return pos * pot % MOD * por % MOD;}
template<int n> struct Bernoulli{long long arr[n+1];constexpr Bernoulli():arr(){arr[0]=1;for(int i=1;i<=n;i++){long long sum=0;for(int j=0;j<i;j++){(sum+=comb(i+1,j)*arr[j]%MOD)%=MOD;}arr[i]=(MOD-mod_pow(i+1,MOD-2,MOD))%MOD*sum%MOD;}}};
constexpr int vx[] = {1, 0, -1, 0}, vy[] = {0, 1, 0, -1};
constexpr int sqrtN = 512, logN = 32;
constexpr ld PI = abs(acos(-1));
constexpr ll LINF=1e18;

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


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000
#define int long long int

signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, x;
    cin >> N >> x;
    int a[N];
    int ans = 0;
    rep(i, N) {
        cin >> a[i];
        ans += max(0LL, a[i] - x);
        a[i] = min(a[i], x);
    }
    rep(i, N-1) {
        if (a[i+1] + a[i] > x) {
            ans += a[i+1] + a[i] - x;
            a[i+1] -= a[i+1] + a[i] - x;
        }
    }
    cout << ans << endl;


    return 0;
}


Measured memory_bytes: 1024
#include <cstring>
#include <cmath>
#include <algorithm>
#include <string>
#include <map>
#include <iostream>
#include <vector>
#include <queue>
#include <unordered_map>
#include <random>
#include <stack>
#include <set>
#include <unordered_set>

#define bug(x) cout<<"zdongdebug1: "<<x<<endl;
#define bug2(x, y) cout<<"zdongdebug2: "<<x<<" "<<y<<endl;
#define bug3(x, y, z) cout<<"zdongdebug3: "<<x<<" "<<y<<" "<<z<<endl;
using namespace std;
typedef long long ll;
const int maxn = 200005;
const int mod = 1000000007;

int main() {
#ifdef suiyuan2009
  freopen("/Users/suiyuan2009/CLionProjects/icpc/input.txt", "r", stdin);
  //freopen("/Users/suiyuan2009/CLionProjects/icpc/output.txt", "w", stdout);
#endif
  int n;
  cin>>n;
  vector<pair<int,int>>a;
  for(int i=0;i<n;i++){
    int x,y;
    cin>>x>>y;
    a.push_back(make_pair(x,y));
  }
  sort(a.begin(),a.end());
  set<int>st1,st2;
  int ret = 0;
  for(int i=0;i<n;i++){
    auto pr = a[i];
    int x = pr.first;
    int y = pr.second;
    if(!st1.empty()) {
      int tt1 = *st1.begin();
      int tt2 = *st2.begin();
      ret = max(ret, x+y-tt1);
      ret = max(ret, x-y-tt2);
    }
    st1.insert(x+y);
    st2.insert(x-y);
  }
  cout<<ret<<endl;
  return 0;
}


Measured memory_bytes: 23564
#include <stdio.h>
int max(int a,int b){ return a<b?b:a;}
int n,t,s;
int dp[3005]={},a[3005],b[3005],ret=0;
int main(){
	scanf("%d%d%d",&n,&t,&s);
	for(int i=1;i<=n;i++) scanf("%d%d",&a[i],&b[i]);
	for(int i=1;i<=n;i++){
		for(int j=t;j>=b[i];j--){
			if(j-b[i]>=s || j<=s){
				dp[j]=max(dp[j],dp[j-b[i]]+a[i]);
			}
			ret=max(ret,dp[j]);
		}
	}
	printf("%d\n",ret);
}

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

int main()
{
  int n;
  cin >> n;
  
  for(int i = 1; i < 10; i++){
    if(n % i == 0){
      if(n / i < 10){
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  
  cout << "No" << endl;
  
  return 0;
}


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

#define INF 1000010000
#define nl '\n'
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define fi first
#define se second
#define pii pair<int,int>
#define pdd pair<double,double>
#define all(c) (c).begin(), (c).end()
#define SORT(c) sort(all(c))
#define sz(c) (c).size()
#define rep(i,n) for( int i = 0; i < n; ++i )
#define repi(i,n) for( int i = 1 ; i <= n; ++i )
#define repn(i,n) for( int i = n - 1 ; i >= 0 ; --i )
#define repf(j,i,n) for( int j = i ; j < n ; ++j )
#define die(s) {std::cout << s << nl;}
#define dier(s) {std::cout << s; return 0;}
#define dbg(var) {std::cout << #var << "  = " << var << nl;}
#define vi vector<int>
typedef long long ll;

using namespace std;


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

	string s;
	cin >> s;

	if(sz(s) < 3) dier(0);

	

	set<pii> todo;
	ll ans  = 0;
	int tota = 0;
	for(int i = 0 ; i < sz(s) ; ++i)
	{
		if(s[i] == 'A') { ++tota; continue; }
		
		if(i + 1 < sz(s) && s[i] == 'B' && s[i + 1] == 'C')
		{
			ans += tota;
			++i;
			continue;
		}
		
		tota = 0;
	}

	dier(ans);

	return 0;
}

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

int main()
{
    int H,W=0;
    char c=0;
    cin>>H>>W;
	do
	{
		for (int i = 0; i < H; i++)
		{
			cout << '#';
			if ((i == 0) || (i == H - 1))
			{
				c = '#';
			}
			else
			{
				c = '.';
			}
			for (int j = 1; j < W - 1; j++)
			{
				cout << c;
			}
			cout << '#' << endl;
		}
		cout << endl;
		cin >> H >> W;
	} while ((H != 0) || (W != 0));
	return 0;
}

Measured memory_bytes: 3080
i = int(input())
line = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(line[i-1])

Measured memory_bytes: 3060
#include<stdio.h>
int min(int a, int b){return a>b?b:a;}
int n, m, x, a, i;
int now[2];
int main(){
	scanf("%d%d%d", &n, &m, &x);
	for(i=0; i<m; i++){
		scanf("%d", &a);
		now[a<x]++;
	}
	printf("%d\n", min(now[0], now[1]));
}


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

using namespace std;

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

#define INF 2<<29
#define F first
#define S second

int main(){
  int t[4];
  int n[4];
  
  for(int i=0;i<4;i++){
    scanf("%d %d",&t[i],&n[i]);
    
    switch(t[i]){
    case 1:
      t[i]=6000;
      break;
    case 2:
      t[i]=4000;
      break;
    case 3:
      t[i]=3000;
      break;
    case 4:
      t[i]=2000;
      break;
    }
  }

  for(int i=0;i<4;i++){
    printf("%d\n",t[i]*n[i]);
  }
  
  return (0);
}



Measured memory_bytes: 3232
def inpl():
    return list(map(int, input().split()))


H, W = inpl()
A = [list(input()) for i in range(H)]

x, y = 0, 0

while y != H - 1 or x != W - 1:
    A[y][x] = '.'
    dy, dx = min(y + 1, H - 1), x
    ry, rx = y, min(x + 1, W - 1)
    if A[dy][dx] == '#':
        y, x = dy, dx
    elif A[ry][rx] == '#':
        y, x = ry, rx
    else:
        # print(A)
        print('Impossible')
        break
else:
    A[H - 1][W - 1] = '.'
    if any('#' in a for a in A) is True:
        print('Impossible')
    else:
        print('Possible')


Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define INF 5000000000000000000
#define ll long long
#define pll pair<ll, ll>
using namespace std;

int main() {
  ll a, b;
  cin >> a >> b;
  ll ans = max(a + b, a - b);
  ans = max(ans, a * b);
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	char str1[3] = "", str2[3] = "";
	
	scanf("%s", str1);
	scanf("%s", str2);
	
	if (str1[0] == str2[2] && str1[2] == str2[0] && str1[1] == str2[1]){
		printf("YES\n");
	}
	else {
		printf("NO\n");
	}
	return (0);
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N, K;
  cin >> N >> K;
  int V[N];
  for (int i = 0; i < N; i++) {
    cin >> V[i];
  }
  int ans = 0;


  for (int l = 0; l <= K; l++) {
    if (l > N) break;
    vector<int> v1;
    int sum1 = 0;
    for (int i = 0; i < l; i++) {
      sum1 += V[i];
      if (V[i] < 0) v1.push_back(V[i]);
    }
    for (int r = 0; r <= K; r++) {
      if (l + r > K || r > N || N - l < r) break;
      vector<int> v2;
      int sum2 = sum1;
      for (int i = N - 1; i >= N - r; i--) {
        sum2 += V[i];
        if (V[i] < 0) v2.push_back(V[i]);
      }
      copy(v1.begin(), v1.end(), back_inserter(v2));
      sort(v2.begin(), v2.end());
      for (int i = 0; i < K - l - r && i < v2.size(); i++) {
        sum2 += -v2[i];
      }
      ans = max(ans, sum2);
    }
  }
  cout << ans << "\n";
  return 0;
}

Measured memory_bytes: 256
// Problem : B - Bingo
// Contest : AtCoder Beginner Contest 157
// URL : https://atcoder.jp/contests/abc157/tasks/abc157_b
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/coder3101/cp-editor)

#include <bits/stdc++.h>
using namespace std;

#ifdef LOCAL
#define DEBUG(...) cerr << #__VA_ARGS__ << ": ", debug(__VA_ARGS__);
#else
#define DEBUG(...)
#endif

template<typename T, typename S> ostream& operator << (ostream &os, const pair<T, S> &p) {return os << "(" << p.first << ", " << p.second << ")";}
template<typename T> ostream& operator << (ostream &os, const vector<T> &v) {os << "["; for (int i=0; i<(int)v.size(); i++) {if (i) os << ", "; os << v[i];} return os << "]";}
void debug() {cerr << "\n";} template<typename T, typename... Args> void debug(T x, Args... args) {cerr << x << "; "; debug(args...);}

int a[3][3];

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    
    for (int i=0; i<3; i++)
        for (int j=0; j<3; j++)
            cin >> a[i][j];
    
    int n;
    cin >> n;
    for (int i=0; i<n; i++) {
        int b;
        cin >> b;
        for (int i=0; i<3; i++)
            for (int j=0; j<3; j++)
                if (a[i][j] == b)
                    a[i][j] = -1;
    }
    
    bool row = false;
    for (int i=0; i<3; i++) {
        bool ok = true;
        for (int j=0; j<3; j++)
            if (a[i][j] != -1) {
                ok = false;
                break;
            }
        if (ok) {
            row = true;
            break;
        }
    }
    
    bool col = false;
    for (int j=0; j<3; j++) {
        bool ok = true;
        for (int i=0; i<3; i++)
            if (a[i][j] != -1) {
                ok = false;
                break;
            }
        if (ok) {
            col = true;
            break;
        }
    }
    
    bool diag1 = a[0][0] == -1 && a[1][1] == -1 && a[2][2] == -1;
    bool diag2 = a[0][2] == -1 && a[1][1] == -1 && a[2][0] == -1;
    if (row || col || diag1 || diag2)
        cout << "Yes\n";
    else
        cout << "No\n";

    return 0;
}


Measured memory_bytes: 256
let rec knapsack q vs ws =
  let n = List.length ws in
  let xs = Array.init (n+1) (fun _ -> Array.make (q+1) 0) in
  let ks = function
      (0,_) -> 0
    | (_,0) -> 0
    | (i,w) when w >= List.nth ws (i-1) ->
      max
        (xs.(i-1).(w))
        (xs.(i-1).(w - (List.nth ws (i-1))) + List.nth vs (i-1))
    | (i,w) -> xs.(i-1).(w) in
  for i = 0 to n do
    for j = 0 to q do
      xs.(i).(j) <- ks (i,j)
    done;
  done;
  ks (n,q)

let _ =
  let (n, w) = Scanf.scanf "%d %d\n" (fun a b -> (a, b)) in
  let vs = ref [] in
  let ws = ref [] in
  for i = 1 to n do
    vs := Scanf.scanf "%d " (fun a -> a) :: !vs;
    ws := Scanf.scanf "%d\n" (fun a -> a) :: !ws;
  done;
  Printf.printf "%d\n" @@ knapsack w !vs !ws



Measured memory_bytes: 10556
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define df 0
int dc=100000;
typedef long int li;
int comp(const void* a,const void* b){
  long int x=*((li*)a),y=*((li*)b);
  return (x-y>0)?1:-1;
}

int main(){
  if(df)printf("*** debug mode ***\n");
  int n;
  scanf("%d",&n);
  li a[n],s[n+1],i;
  s[0]=0;
  for(i=0;i<n;i++){
    scanf("%ld",&a[i]);
    s[i+1]=a[i]+s[i];
  }
  qsort(s,n+1,sizeof(li),comp);
  li sum=0;
  li count=1;
  for(i=0;i<n;i++){
    if(s[i]==s[i+1]){
      count++;
      continue;
    }
    sum+=count*(count-1)/2;
    count=1;
  }
  sum+=count*(count-1)/2;
  printf("%ld",sum);
  return 0;
}


/// confirm df==0 ///


Measured memory_bytes: 4860
#include <iostream>
#include <algorithm>
#include <cmath>
#include <list>

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

int main() {
    long long a, b, v, w, t;
    cin >> a >> v >> b >> w >> t;

    if(abs(a - b) <= (v * t) - (w * t))
        cout << "YES" << endl;
    else
        cout << "NO" << endl;

    return 0;
}

Measured memory_bytes: 3124
n=int(input())
gg=[input() for _ in [0]*n]
graph=[[] for _ in [0]*n]


inf=10**10
dist=[[inf for _ in [0]*n] for _ in [0]*n]

for i in range(n):
    dist[i][i]=0
    for j in range(n):
        if gg[i][j]=="1":
            graph[i].append(j)
            dist[i][j]=1
            dist[j][i]=1
q=[0]
dp=[0]*n
dp[0]=1


flag=True
while q:
    i=q.pop()
    for j in graph[i]:
        if dp[j]==0:
            dp[j]=dp[i]*(-1)
            q.append(j)
        elif dp[j]==dp[i]:
            flag=False
            break
    if flag==False:
        break

        

if flag==False:
    print(-1)
else:
    for k in range(n):
        for i in range(n):
            for j in range(n):dist[i][j]=min(dist[i][j],(dist[i][k]+dist[k][j]))
    print(max([max([i for i in j]) for j in dist])+1)

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

int main() {
  string s,t;
  cin >> s >> t;
  long long count = 0;
  for(int i=0; i<s.size(); i++){
    if(s[i] != t[i]) count++;
  }
  
  cout << count << endl;
	return 0;
}


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

int main(){
    string s;
    cin>>s;
    
    if(s[5]=='1')
        cout << "TBD" << endl;
    else if(s[6]<'5')
        cout << "Heisei" << endl;
    else
        cout << "TBD" << endl;
    return 0;
}

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

using namespace std;

#define MAX 100002

int n;
int m;
vector<int> p;
int belong[MAX];
inline int root(int b){
    if(belong[b]==-1){
        return b;
    }
    belong[b]=root(belong[b]);
    return belong[b];
}
void merge(int a,int b){
    a=root(a);
    b=root(b);
    if(a==b)return;
    belong[a]=b;
}

set<int> s[100002];

int main(){
    memset(belong,-1,sizeof(belong));
    cin>>n>>m;
    for(int i=0;i<n;i++){
        int p2;
        scanf("%d",&p2);
        p2--;
        p.push_back(p2);
    }
    for(int i=0;i<m;i++){
        int a,b;
        scanf("%d%d",&a,&b);
        a--;
        b--;
        merge(a,b);
    }
    for(int i=0;i<n;i++){
        s[root(i)].insert(i);
    }
    int ans=0;
    for(int i=0;i<n;i++){
        if(s[root(i)].count(p[i])){
            ans++;
        }
    }
    cout<<ans<<endl;
    return 0;
}


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

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

    int s, w;
    cin >> s >> w;
    if(s <= w) {
        cout << "unsafe\n";
    }
    else {
        cout << "safe\n";
    }
}


Measured memory_bytes: 3636
import collections

def resolve():
    N = int(input())
    S_list = []
    for i in range(N):
        S_list.append(input())
    
    cc = collections.Counter(S_list)
    cc_list = cc.most_common()

    most_num = cc_list[0][1]
    tmp_list = []

    for i in cc_list:
        if most_num == i[1]:
            tmp_list.append(i[0])
        else:
            break

    tmp_list_sorted = sorted(tmp_list)
    for tls in tmp_list_sorted:
        print(tls)


if __name__ == "__main__":
    resolve()

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



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

using namespace std;

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

	vector<int> A(N, 0);
	for(int i = 0; i < N; ++i)
		cin >> A[i];

	for(int i = K; i < N; ++i) {
		if( A[i] > A[i-K])
			cout << "Yes" << endl;
		else
			cout << "No" << endl;
	}

	return 0;
}

Measured memory_bytes: 4020
import java.util.*;
public class Main {
        public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                Map hs = new HashMap();
                int n = sc.nextInt();
                int a = sc.nextInt();
                if(n % 500 > a) System.out.println("No");
                else System.out.println("Yes");
        }
}

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

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> P;
typedef long long ll;

#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) reverse((c).begin(),(c).end())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RFOR(i,a,b) for(int i=(a)-1;i>=(b);--i)
#define RREP(i,n) RFOR(i,n,0)

const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int INT_INF = 2147483647;
const long long LL_INF = 1LL<<60;
const long long MOD = 1000000007;

#define CLR(a) memset((a), 0 ,sizeof(a))

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

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

int main(void){
    double T,X; cin >> T >> X;
    cout << fixed << setprecision(5) << T/X << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
	string s;
	getline(cin,s);
	for(int i=0;i<=19;i++){
		if(s[5]==',')
	    s[5]=' ';
	    if(s[13]==',')
	    s[13]=' ';
	}
	cout<<s;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;
const int MAXN = 3005;
const int MOD = 998244353;
int n, s, dp[MAXN][MAXN];

int main() {
    cin >> n >> s;
    dp[0][0] = 1;
    for (int i = 1; i <= n; ++i) {
        int t;
        cin >> t;
        for (int j = 0; j <= s; ++j) {
            dp[i][j] = 2 * dp[i - 1][j] % MOD;
            if (j >= t) {
                dp[i][j] = (dp[i][j] + dp[i - 1][j - t]) % MOD;
            }
        }
    }
    cout << dp[n][s] << endl;
    return 0;
}

Measured memory_bytes: 38808
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<utility>
#include<map>
#include<queue>
#include<set>
#include<bitset>
#include<stdio.h>
#include<deque>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
typedef long long ll;
 
int main()
{
    int x, a;
    cin >> x >> a;
    if(x < a) cout << 0 << endl;
    else cout << 10 << endl;
    return 0;
}

Measured memory_bytes: 256
ns = []
 STDIN.each_line { |l| ns << l }
ns= ns.to_a.join.split[1..-1].map!(&:to_i)
 p = ns[-1]
 ns = ns[0..-2]

 #a = []
 b = []
 ns.each { |d|
   if d <= p
  #   a << d
     print d, ' '
     b = b[1..-1] + [b[0]] if b.size != 0
     else
       b << d
     end}
b = b[1..-1] + [b[0]]

#ret = a + ["[#{p}]"] + b
ret = ["[#{p}]"] + b
puts ret.join(' ')

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

int main(){
      char c;

      cin >> c;

      if(c =='a' || c == 'e' || c == 'i' || c == 'o' || c == 'u'){
            cout <<  "vowel" << endl;
      }else{
            cout << "consonant" << endl;
      }
}


Measured memory_bytes: 256
class Node:
    def __init__(self, key):
        self.key = key
        self.parent = None
        self.left = None
        self.right = None

parent_node = None

        
def getParent():
    tmp_node = Nodes
    while Nodes.parent != None:
        tmp_node = tmp_node.parent
    return tmp_node    

def printPreorder(u):
    if u == None:
        return
    print(" ", u.key, sep="", end="")
    printPreorder(u.left)
    printPreorder(u.right)
    
def printInorder(u):
    if u == None:
        return
    printInorder(u.left)
    print(" ", u.key, sep="", end="")
    printInorder(u.right)

def find(u, num):
    while u != None and u.key != num:
        if num < u.key:
            u = u.left
        else:
            u = u.right
    if u != None:
        print("yes")
    else:
        print("no")

def getMinimum(u):
    while u.left != None:
        u = u.left
    return u

def getSuccessor(u):
    if u.right != None:
        return getMinimum(u.right)
    
    y = u.parent
    while y != None and u == y.right:
        u = y
        y = y.parent
    return y
        
def delete(u, num):
    while u != None and u.key != num:
        if num < u.key:
            u = u.left
        else:
            u = u.right
            
    y = None
    if u.left == None or u.right == None:
        y = u
    else:
        y = getSuccessor(u)
    
    x = None
    if y.left != None:
        x = y.left
    else:
        x = y.right
    
    if x != None:
        x.parent = y.parent
    
    if y.parent == None:
        parent_node = x
    elif y == y.parent.left:
        y.parent.left = x
    else:
        y.parent.right = x
    
    if y != u:
        u.key = y.key
    
n = int(input())

# メモリの確保
Nodes = []
for i in range(n):
    tmp_node = Node(0)
    Nodes.append(tmp_node)

for i in range(n):
    cmd = input().split()
    if cmd[0] == 'insert':
        key = int(cmd[1])

        insert_node = Nodes[i]
        insert_node.key = key
        key_parent = None
        x = parent_node
            
        while x != None:
            key_parent = x
            if insert_node.key < x.key:
                x = x.left
            else:
                x = x.right
        insert_node.parent = key_parent
            
        if key_parent == None:
            parent_node = insert_node
        elif insert_node.key < key_parent.key:
            key_parent.left = insert_node
        else:
            key_parent.right = insert_node
    # プリント
    elif cmd[0] == 'print':
        printInorder(parent_node)
        print("")
        printPreorder(parent_node)
        print("")
    # サーチ
    elif cmd[0] == 'find':
        key = int(cmd[1])
        find(parent_node, key)
    # 削除
    else:
        key = int(cmd[1])
        delete(parent_node, key)


Measured memory_bytes: 106012
number,energy = gets.chomp.split(" ").map(&:to_i)
garbage = gets.chomp.split(" ").map(&:to_i)
total_e = 10**17
point = 0
count = 1
check = 1
list = [0]
for i in 1..number
  list[i] = list[i - 1] + garbage[i - 1]
end

for i in 1..number
  while (count + i) <= number
    if check == 1
      point += (list[-count] - list[-count - i])*5
      check += 1
      count += i
    else
      point += (list[-count] - list[-count - i])*(check*2 + 1)
      check += 1
      count += i
    end
  end
  if check == 1
    point += list[-count]*5
  else
    point += list[-count]*(check*2 + 1)
  end
  point += i * energy
  if point < total_e
    total_e = point
  end
  point = 0
  check = 1
  count = 1
end



total_e += number * energy
print total_e


Measured memory_bytes: 23444
use itertools::iproduct;
use proconio::input;

fn main() {
    input! {
        k: u64,
    }

    let ans = iproduct!(1..=k, 1..=k, 1..=k)
        .map(|(a, b, c)| num::integer::gcd(num::integer::gcd(a, b), c))
        .sum::<u64>();
    println!("{}", ans);
}


Measured memory_bytes: 2196
x, n = map(int, input().split())
l = list(map(int, input().split()))

if x not in l:
    print(x)
    exit()

x_a = x
for i in range(100):
    x -= 1
    x_a += 1
    if x not in l:
        print(x)
        exit()
    if x_a not in l:
        print(x_a)
        exit()

Measured memory_bytes: 9120
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define llu unsigned long long int
#define sa(a,n,t) for(int ii=0;ii<n;ii++) scanf("%"#t"",&(a)[ii])
#define rep(i,n) for(int i=0;i<n;i++) 
#define reps(i,a,n) for(int i=a;i<n;i++) 
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define rreps(i,a,n) for(int i=n-1;i>=a;i--)
#define validl(i,a,b) ((i>=a)&&(i<=b))?1:0
#define validmat(x,y,a,b,c,d) (validl(x,a,b) && validl(y,a,b))?1:0
#define validmn(x,y,m,n) validmat(x,y,0,m,0,n)
#define valid(i,n) validl(i,0,n)
#define v(t) vector<t>
#define vv(t) vector<vector<t> >
#define mk make_pair
#define pb push_back
#define pa(a,n,t)  for(int i=0;i<n;i++) printf("%"#t"",a[i])
#define p2 pair<int,int>
#define p3 pair<p2,int>
#define fi first
#define se second
#define sd(a) scanf("%d",&a)
#define sl(a) scanf("%lld",&a)
#define pl(a) printf("%lld",a)
#define pd(a) printf("%d",a)
#define sf(a) scanf("%lf",&a)
#define pf(a) printf("%lf",a)
#define nline printf("\n")
#define ss(a) scanf("%s",a)
#define ps(a) printf("%s",a)
#define sc(a) scanf("%c",&a)
#define pc(a) printf("%c",&a)
#define mf(m,f) m.find(f)!=m.end()
#define pp3(m) cout<<m.fi.fi<<" "<<m.fi.se<<" "<<m.se<<" "
#define pp2(m) cout<<m.fi<<" "<<m.se<<" "
#define debug 0
/*v(int) adj[200001];
void dfs(int i,int p){
    rep(j,adj[i].size()){
        if(p!=adj[i][j])
            dfs(adj[i][j],i);
    }
}*/
int main()
{
  ios_base::sync_with_stdio(false);
    cin.tie(NULL);
  int n,k;
  cin>>n>>k;
  v(p2) pp;
  rep(i,k){
      int a,b;
      cin>>a>>b;
      pp.pb(mk(a,b));
  }
lli ans[200001];
ans[1]=1;
    reps(i,2,n+1){
        ans[i]=0;
        rep(j,k){
            lli a=(i-pp[j].se-1)>=1?ans[i-pp[j].se-1]:0;
            lli b=(i-pp[j].fi)>=1?ans[i-pp[j].fi]:0;
            ans[i]=(ans[i]+b-a+998244353)%998244353;
        }
        ans[i]=(ans[i]+ans[i-1])%998244353;
    }
    cout<<(ans[n]-ans[n-1]+998244353)%998244353<<endl;
  return 0;
}

Measured memory_bytes: 5212
import java.util.*;
class Main{
    public static void main(String[] args){
        Scanner s=new Scanner(System.in);
        String p[]={"101","000000","000011","10010001","010001","000001","100101","10011010","0101","0001","110"
        ,"01001","10011011","010000","0111","10011000","0110","00100","10011001","10011110","00101","111","10011111"
        ,"1000","00110","00111","10011100","10011101","000010","10010010","10010011","10010000"};
        String c=" ',-.?ABCDEFGHIJKLMNOPQRSTUVWXYZ";
        String q[]={"11010","11110","11100","11101","11011","11111","00000","00001","00010","00011","00100"
        ,"00101","00110","00111","01000","01001","01010","01011","01100","01101","01110","01111","10000","10001"
        ,"10010","10011","10100","10101","10110","10111","11000","11001"};
        while(s.hasNext()){
            String k=s.nextLine();
            String a="";
            for(int i=0;i<k.length();i++)
                for(int j=0;j<32;j++)if(k.charAt(i)==c.charAt(j))a+=q[j];
        //  while(a.length()%5!=0)a+="0";
            String e="";
            int at=0;
            for(int i=0;i<a.length()/5;i++){
                for(int j=0;j<32;j++){
                    if(at+p[j].length()<=a.length()&&a.substring(at,at+p[j].length()).equals(p[j])){
                        e+=c.charAt(j);
                        at+=p[j].length();
                    }
                }
            }
            System.out.println(e);
        }
    }
}


Measured memory_bytes: 61164