akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
using namespace std;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef long long ll;

template<class T> void read(T &x){
    int f=0; x=0; char ch=getchar();
    for(;!isdigit(ch);ch=getchar()) f|=(ch=='-');
    for(;isdigit(ch);ch=getchar()) x=x*10+ch-'0';
    if(f) x=-x;
}

const int N=105;
int f[N][N],n,m;
char s[N][N];

int main(){
    read(n),read(m);
    rep(i,1,n) scanf("%s",s[i]+1);
    memset(f,0x3f,sizeof f);
    f[1][1]=(s[1][1]=='#');
    rep(i,1,n) rep(j,(i==1?2:1),m)
        f[i][j]=min(f[i-1][j]+(s[i-1][j]=='.'&&s[i][j]=='#'),
                    f[i][j-1]+(s[i][j-1]=='.'&&s[i][j]=='#'));
    cout<<f[n][m]<<endl;
    
    return 0;
}

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

int n, x;

int ans=10000090;

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

    while(n--)
    {
        int a, b;
        cin>>a>>b;
        if(b<=x) ans=min(ans, a);
    }

    if(ans!=10000090) cout<<ans;
    else cout<<"TLE";
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;using ll=long long;using uint=unsigned int;using pii=pair<int,int>;using pll=pair<ll,ll>;using ull = unsigned long long;using ld=long double;template<typename T>void _(const char*s,T h){cerr<<s<<" = "<<h<<"\n";}template<typename T,typename...Ts>void _(const char*s,T h,Ts...t){int b=0;while(((b+=*s=='(')-=*s==')')!=0||*s!=',')cerr<<*s++;cerr<<" = "<<h<<",";_(s+1,t...);}// break continue pop_back 998244353
#define int ll
#define pii pll
#define f first
#define s second
#define pb emplace_back
#define forn(i,n) for(int i=0;i<(n);++i)
#define sz(a)((int)(a).size())
#define sqr(x) ((x)*(x))
struct init{init(){cin.tie(0);iostream::sync_with_stdio(0);cout<<fixed<<setprecision(10);cerr<<fixed<<setprecision(5);}~init(){
#ifdef LOCAL
#define dbg(...) _(#__VA_ARGS__,__VA_ARGS__)
cerr<<"Time elapsed: "<<(double)clock()/CLOCKS_PER_SEC<<"s.\n";
#else
#define dbg(...) 
#endif
}}init;template<typename T,typename U>void upx(T&x,U y){if(x<y)x=y;}template<typename T,typename U>void upn(T&x,U y){if(x>y)x=y;}mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());const int D=4,dx[]={+1,0,-1,0},dy[]={0,+1,0,-1};
const int N=1e5+5;
vector<int> g[N];
int co[N];
int dvu;
void dfs(int v,int c=1){
    co[v]=c;
    for(int to:g[v]){
        if(!co[to])dfs(to,3-c);
        dvu&=co[to]+co[v]==3;
    }
}
int32_t main(){
    int n,m;
    cin>>n>>m;
    forn(i,m){
        int a,b;
        cin>>a>>b;
        g[a].pb(b);
        g[b].pb(a);
    }
    int iso=0,cd=0,cn=0;
    for(int i=1;i<=n;++i){
        if(!co[i]){
            if(sz(g[i])){
                dvu=1;
                dfs(i);
                if(dvu)cd++;
                else cn++;
            }else iso++;
        }
    }
    int ans=iso*iso+2*iso*(n-iso)+cn*cn+2*cn*cd+cd*cd*2;
    cout<<ans<<'\n';
    return 0;
}

Measured memory_bytes: 16688
from sys import stdin
def main():
	readline=stdin.readline
	S=readline().strip()
	if S[0]=="<":
		l_flag=True
		l_count=1
		r_count=0
	else:
		l_flag=False
		l_count=0
		r_count=1

	res=0
	for i in range(1,len(S)+1):
		if i==len(S):
			res+=max(l_count,r_count)*(max(l_count,r_count)+1)//2
			res+=(min(l_count,r_count)-1)*min(l_count,r_count)//2
			break
		if S[i]=="<" and l_flag:
			l_count+=1
		elif S[i]==">" and l_flag:
			l_flag=False
			r_count+=1
		elif S[i]==">" and l_flag==False:
			r_count+=1
		elif S[i]=="<" and l_flag==False:
			res+=max(l_count,r_count)*(max(l_count,r_count)+1)//2
			res+=(min(l_count,r_count)-1)*min(l_count,r_count)//2
			l_flag=True
			l_count=1
			r_count=0
	print(res)
if __name__=="__main__":
	main()

Measured memory_bytes: 4232
#include<bits/stdc++.h>
#define ll long long int
#define pb push_back
#define mod 1000000007
#define pi (3.141592653589)
using namespace std;

const int N = 1e7 + 10;
int prime[N];

int main() {
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout << fixed;
    cout.precision(10);
    memset(prime, 0, sizeof(prime));
    for(int i = 2; i <= N; i++)
    {
        if(prime[i] == 0)
        {
            for(int j = 2 * i; j <= N; j += i)
            {
                prime[j] = 1;
            }
        }
    }
    int n;
    cin >> n;
    int ans;
    for(int i = n ; ; i++)
    {
        if(prime[i] == 0)
        {
            ans = i;
            break;
        }
    }
    cout << ans;
	return 0;
}


Measured memory_bytes: 39296
// finish date: 2018/01/10
#include <iostream>
#include <cmath>
#include <vector>
#include <bitset>
#include <algorithm>
#include <stack>
#include <map>
#include <climits>

using namespace std;

#define FOR(i, a, b) for(int i=a;i<b;i++)
#define rep(i, n)  FOR(i,0,n)
#define ll long long

bool isExist(char c, string str) {
    rep(i, str.length()) {
        if (c == str[i]) return true;
    }
    return false;
}

int fact(int n) {
    int ans = 1;
    FOR(i, 1, n + 1) {
        ans *= i;
    }
    return ans;
}

int main() {
    int A, B;
    char op;
    cin >> A >> op >> B;
    if (op == '+') cout << A + B << endl;
    else cout << A - B << endl;


    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdint>
#include <algorithm>
#include <utility>
#include <vector>

int const MAXN = 200000;
int const MAXM = 200000;
uint64_t const INF = 1<<59;

int const MAXA = (1<<19)-1;

int N, M, NN;

int64_t dp[MAXA], lazy[MAXA];
std::vector<std::pair<int, int> > scores[MAXM];

void init() {
  NN=1;
  while(NN<N+2) NN<<=1;
  std::fill(dp, dp+NN*2-1, 0);
  std::fill(lazy, lazy+NN*2-1, 0);
}

void eval(int k) {
  if(lazy[k] == 0) return;
  if(k*2+1 < NN*2-1) {
    lazy[2*k+1] += lazy[k];
    lazy[2*k+2] += lazy[k];
  }
  dp[k] += lazy[k];
  lazy[k] = 0;
}

int64_t update(int a, int b, int64_t x, int k, int l, int r) {
  if(b <= l || r <= a) {
    eval(k);
    return dp[k];
  }
  if(a <= l && r <= b) {
    lazy[k] += x;
    return dp[k] + lazy[k];
  }
  eval(k);
  int m = (l+r)/2;
  return dp[k] = std::max(update(a, b, x, k*2+1, l, m), update(a, b, x, k*2+2, m, r));
}

int64_t query(int a, int b, int k, int l, int r) {
  if(b <= l || r <= a) return -INF;
  eval(k);
  if(a <= l && r <= b) return dp[k];
  int m = (l+r)/2;
  bool intLeft = !(m <= a || b <= l);
  bool intRight = !(r <= a || b <= m);
  if(intLeft&intRight) return std::max(query(a, b, k*2+1, l, m), query(a, b, k*2+2, m, r));
  if(intLeft) return query(a, b, k*2+1, l, m);
  return query(a, b, k*2+2, m, r);
}

void add(int a, int b, int64_t x) { update(a, b, x, 0, 0, NN); }
int64_t get_max(int a, int b) { return query(a, b, 0, 0, NN); }

int main() {
  std::cin >> N >> M;
  for(int i = 0; i < M; ++i) {
    int l, r, a;
    std::cin >> l >> r >> a; --l; --r;
    scores[r].emplace_back(l, a);
  }

  init();
  for(int i = 0; i < N; ++i) {
    int64_t m = 0;
    if(i > 0) m = std::max(m, get_max(0, i));
    add(i, i+1, m);
    for(auto p: scores[i]) add(p.first, i+1, p.second);
  }
  int64_t m = 0;
  std::cout << std::max(get_max(0, N+1), m) << std::endl;
  return 0;
}


Measured memory_bytes: 19328
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
#define ll long long int
#define double long double
#define endl '\n'
#define vll vector<ll>
#define vvl vector<vll>
#define pll pair<ll,ll>
#define vpll vector<pll>
#define vppll vector<pll,pll>
#define mp make_pair
#define pb push_back
#define mapll map<ll,ll>
#define fir first
#define sec second
#define _cin ios_base::sync_with_stdio(0);  cin.tie(0);
#define fo(i,b) for(i=0;i<b;i++)
#define repa(i,a,b) for(i=a;i<b;i++)
#define repb(i,a,b) for(i=a;i>=b;i--)
#define all(x) (x).begin(), (x).end()
#define s(v) (ll)v.size()
#define watch(x) cerr << (#x) << " is " << (x) << endl
#define Time cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n"
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> 
const long long int MAX = (ll)(1e18+1);
const long long int MIN = (ll)(-1e18-1);
const long long int mod = (ll)(1e9+7);
using namespace std;  // order_of_key(k) -> Number of elements strictly smaller than k
using namespace __gnu_pbds; // order_of_key() ; *( find_by_order() ) -> kth element in set;

ll max(ll a,ll b,ll c) {return max(max(a, b), c);}
ll min( ll a, ll b, ll c) { return min(min(a, b), c);}
ll max(ll a,ll b) {return (a>b) ? a : b;}
ll min(ll a,ll b) {return (a<b) ? a : b;}
ll power(ll a, ll n) {ll p = 1;while (n > 0) {if(n%2) {p = p * a;} n >>= 1; a *= a;} return p;}
ll power_mod(ll a, ll n, ll mod_){ ll p=1; while(n){ if(n%2){ p=(p*a)%mod_;} n/=2; a=(a*a)%mod_;} return p%mod_;}                 
                          /*Code Begins*/




int main(){
    #ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
    #endif
    _cin;
    cout << setprecision(15);
    ll mn = MAX, mx = MIN;
    ll n, m, t,  k, i, j,  sum=0,  prev, flag=0, cnt=0;
    ll x=0, y=0, fx, diff, tot=0, l , r;
    int TC=1;
    // cin >> TC;
while(TC--){
    cin >> n;
    double pi = acos(-1);
    double x = 2.0*pi*n;
    cout << x ;


}

    Time;
    return 0;
}


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

typedef long long ll;
#define all(x) (x).begin(),(x).end()
const int mod=1000000007,MAX=100005;

int main(){
    
    string S;cin>>S;
    bool flag=true;
    if(S[0]==S[1]) flag=false;
    if(S[1]==S[2]) flag=false;
    if(S[2]==S[3]) flag=false;
    
    if(flag) cout<<"Good"<<endl;
    else cout<<"Bad"<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <iostream>
#include <math.h>
using namespace std;
int main() {
    int N;
    cin >> N;
    vector<vector<pair<int, int>>>shougens(N);
    for (int i=0; i<N; i++) {
        int shougen_count;
        cin >> shougen_count;
        shougens[i].resize(shougen_count);
        for (int j=0; j<shougen_count; j++) {
            int x, y;
            cin >> x >> y;
            shougens[i][j] = make_pair(x, y);
        }
    }

    int max_count = 0;
    // 正直者の数と組み合わせを仮定して、矛盾していないかどうかをチェックしていく
    // 矛盾しているケースが生まれた場合は、その仮定が成り立たないので棄却する
    // 全部うまくいくとした場合にmax_countと比較して数が多かったらそちらを採用する
    for (int bit=1; bit < (1 << N); bit++) {
        bool umakuiku = true;
        for (int i=0; i<N; i++) {
            bool syouziki = false;
            if (bit & (1<<i)) {
                syouziki = true;
            }

            for (int j=0; j<shougens[i].size();j++) {
                // この発言をした人が正直者とするならば、対象も正直になるはず
                pair<int, int> syougen = shougens[i][j];
                int x = syougen.first;
                int y = syougen.second;
                if (syouziki && y == 1) {
                    if (!(bit & (1 << (x -1)))) {
                        umakuiku = false;
                        break;
                    }
                } else if (syouziki && y == 0) {
                    if ((bit & (1 << (x -1)))) {
                        umakuiku = false;
                        break;
                    }

                }
            }
        }

        if (umakuiku) {
            int count = __builtin_popcount(bit);
            if (count > max_count) {
                max_count = count;
            }
        }
    }

    cout << max_count << endl;
    return 0;
}

Measured memory_bytes: 3644
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cmath>
#define MX 606
#define MOD 1000000007

using namespace std;

int n, m, q;
int a[MX], p[MX], ban[MX], f[MX][MX][MX], c[MX];

void add(int& a, int b) {a += b; if(a >= MOD) a %= MOD;}

int main()
{
	scanf("%d", &n);
	for(int i=1; i<=n*2; i++) scanf("%d", &a[i]);
	for(int i=1; i<=n; i++)
		if(a[i*2]<0 || a[i*2-1]<0)
		{
			if(a[i*2] > 0) p[a[i*2]] = 1;
			else if(a[i*2-1] > 0) p[a[i*2-1]] = 1;
			else q++;
		}
		else ban[a[i*2]] = ban[a[i*2-1]] = 1;
	f[n*2+1][0][0] = 1;
	c[0] = 1;
	for(int i=1; i<=n; i++) c[i] = 1ll * c[i-1] * i % MOD;
	for(int i=n*2+1; i>=1; i--)
	{
		if(ban[i-1]) memmove(f[i-1], f[i], sizeof(f[i]));
		else
		{
			if(p[i-1])
			{
				for(int j=0; j<=n; j++)
				{
					for(int k=0; k<=n; k++)
					{
						add(f[i-1][j][k+1], f[i][j][k]);
						if(j) add(f[i-1][j-1][k], f[i][j][k]);
					}
				}
			}
			else
			{
				for(int j=0; j<=n; j++)
				{
					for(int k=0; k<=n; k++)
					{
						add(f[i-1][j+1][k], f[i][j][k]);
						if(j) add(f[i-1][j-1][k], f[i][j][k]);
						if(k) add(f[i-1][j][k-1], 1ll * f[i][j][k] * k % MOD);
					}
				}
			}
		}
	}
	printf("%lld\n", 1ll * f[1][0][0] * c[q] % MOD);
	return 0;
}

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

typedef long long ll;
const ll INF = 10000000000000000;
int main(){
	int n,m,k;
	ll a[20000],dp[20001];
	scanf("%d %d %d",&n,&m,&k);
	for(int i=0;i<n;i++) scanf("%lld",a+i);
	for(int i=0;i<=n;i++){
		if(i==0){
			dp[i] = 0;
			continue;
		}
		dp[i] = INF;
		ll mi = a[i-1], ma = a[i-1];
		for(int j=i-1;i-j<=m&&j>=0;j--){
			mi = min(mi,a[j]);
			ma = max(ma,a[j]);
			dp[i] = min(dp[i],dp[j]+k+(ma-mi)*(i-j));
		}
	}
	printf("%lld\n",dp[n]);
	return 0;
}

Measured memory_bytes: 3044
a, b, c = map(int, input().split())
if a == b:
    if a != c:
        print('Yes')
    else:
        print('No')
elif a == c:
    if a != b:
        print('Yes')
    else:
        print('No')
elif b == c:
    if a != b:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
int h,w,n;
vector<P>vec;
ll dp[3005];
ll modpow(ll x,ll n){
	ll res=1;
	while(n>0){
		if(n&1) res=res*x%mod;
		x=x*x%mod;
		n>>=1;
	}
	return res;
}
ll F[200005],R[200005];
void make(){
	F[0] = 1;
	for(int i=1;i<200005;i++) F[i] = F[i-1]*i%mod;
	for(int i=0;i<200005;i++) R[i] = modpow(F[i],mod-2);
}
ll C(int a,int b){
	return F[a]*R[b]%mod*R[a-b]%mod;
}
int main(){
	cin>>h>>w>>n;
	rep(i,n){
		int x,y; cin>>x>>y;
		vec.pb(mp(x,y));
	}
	SORT(vec);
	make();
	ll ans = C(h-1+w-1,w-1);
	rep(i,n){
		int x = vec[i].fi, y = vec[i].sc;
		dp[i] = C(x-1+y-1,y-1);
		rep(j,i){
			int xx = vec[j].fi, yy = vec[j].sc;
			if(xx<=x && yy<=y){
				dp[i] -= dp[j]*C(x-xx+y-yy,y-yy)%mod;
			}
		}
		dp[i]%=mod;
		ans -= dp[i]*C(h-x+w-y,w-y)%mod;
	}
	cout<<(ans%mod+mod)%mod<<endl;
}

Measured memory_bytes: 3456
#include <bits/stdc++.h>
#define int long long
#define double long double
#define INF 1e18
using namespace std;
//int grid[500][500], sum[500][500];
signed main() {
  int H, W; cin >> H >> W;
  int ans = 0;
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      int a; cin >> a;
      int p = (i + 1) * (H - i);
      int q = (j + 1) * (W - j);
      ans += a * ((i+1)*(H-i)) * ((j+1)*(W-j));
    }
  }
  cout << ans << endl;
}



Measured memory_bytes: 3096
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef long double ld;
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int a,b,c;
  cin >> a >> b >> c;
  FOR(i,1,b+1){
    int x = i*a;
    if(x%b==c){
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
  return 0;
}

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

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

    int ans=0;
    for(int i=0; i<N-1; i++){
        int re=0;
        map<char,int> moji;
        // 左側
        for(int j=0; j<=i; j++){
            moji[S[j]]=1;
        }
        // 右側ループして一致カウント
        for(int k=i+1; k<N; k++){
            if(moji.count(S[k]) && moji[S[k]]==1){
                re++;
                moji[S[k]]=2;
            }
        }
        ans = max(ans,re);
    }
    cout << ans << endl;
}


Measured memory_bytes: 3620
/* {{{ */
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let 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,
        a: [usize;n]
    }
    let mut b = a.clone();
    b.sort();
    b.dedup();
    println!("{}",
        if a.len() == b.len() {"YES"} else {"NO"});
}
/* vim:set foldmethod=marker: */


Measured memory_bytes: 10492
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

using Pair = System.Collections.Generic.KeyValuePair<int, int>;

class Program
{
	public Program() { }

	static void Main(string[] args)
	{
		new Program().prog();
	}
	Scanner cin;
	const int MOD = 1000000007;
	const int INF = int.MaxValue;
	const double EPS = 1e-7;
	const double PI = 3.1415926536;

	void prog()
	{
		cin = new Scanner();
		int[,] dir8 = new int[8, 2] { { -1, -1 }, { -1, 0 }, { -1, 1 }, { 0, -1 }, { 0, 1 }, { 1, -1 }, { 1, 0 }, { 1, 1 } };
		int[,] dir4 = new int[4, 2] { { -1, 0 }, { 0, -1 }, { 0, 1 }, { 1, 0 } };

		string s = cin.next();
		int N = s.Length;
		if (N == 1)
		{
			Console.WriteLine(s);
			return;
		}
		long ans = 0;
		long[] pow10 = new long[11];
		pow10[0] = 1;
		for (int i = 1; i < 11; i++)
		{
			pow10[i] = pow10[i - 1] * 10;
		}
		int[] pow2 = new int[11];
		pow2[0] = 1;
		for (int i = 1; i < 11; i++)
		{
			pow2[i] = pow2[i - 1] * 2;
		}
		for (int i = 0; i < N; i++)
		{
			long num = long.Parse(s[i].ToString());
			for (int j = 0; j < N - 1 - i; j++)
			{
				ans += num * pow2[N - 2 - j];
				num *= 10;
			}
			ans += num * pow2[i];
		}
		Console.WriteLine(ans);
	}
}

class Scanner
{
	string[] s;
	int i;

	char[] cs = new char[] { ' ' };

	public Scanner()
	{
		s = new string[0];
		i = 0;
	}

	public string next()
	{
		if (i < s.Length) return s[i++];
		string st = Console.ReadLine();
		while (st == "") st = Console.ReadLine();
		s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
		i = 0;
		return next();
	}

	public int nextInt()
	{
		return int.Parse(next());
	}

	public long nextLong()
	{
		return long.Parse(next());
	}

	public double nextDouble()
	{
		return double.Parse(next());
	}
}

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

int main() {
	int n;
	int k[251];
	cin >> n;
	for ( int i = 1; i <= n; i++ )
		cin >> k[i];
	for ( int i = 1; i <= n; i++ ) {
		cout << "node " << i << ": key = " << k[i] << ", ";
		if ( i > 1 ) cout << "parent key = " << k[i / 2] << ", ";
		if ( n >= i * 2 ) cout << "left key = " << k[i * 2] << ", ";
		if ( n >= i * 2 + 1 ) cout << "right key = " << k[i * 2 + 1] << ", ";
		cout << endl;
	}
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define y_n(ans) cout<<(ans?"Yes":"No")<<endl;

int main() {
    int x; cin >> x;
    cout << 10 - x/200 << endl;
}

Measured memory_bytes: 3616
#include <stdio.h>

int cup;
int arr[50];

int main(void) {
  int n, p;

  while (1) {
    memset(arr, 0, sizeof(arr));
    scanf("%d%d", &n, &p);

    if (n * p == 0) return 0;

    cup = p;
    int i;
    for (i = 0; arr[i % n] != p; ++i) {
      if (cup == 0) {
        cup = arr[i % n];
        arr[i % n] = 0;
      } else {
        --cup;
        ++arr[i % n];
      }
    }

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


Measured memory_bytes: 2104
#include <iostream>

#include <stdio.h>

using namespace std;

int main(){

   int n;
   int max = -1000000, min = 1000000;
   long long int sum = 0;

   cin >> n;

   for(int i = 0; i < n; i++){
      int a;
      cin >> a;
      sum += a;
      if(max < a){
         max = a;
      }
      if(min > a){
         min = a;
      }
   }

   cout << min << " " << max << " " << sum << endl;

   return 0;
}


Measured memory_bytes: 3104
#include <iostream>
#include <algorithm>
#include <string>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <vector>
#include <queue>
#include <stack>
using namespace std;

#define rep(i, s) for (int i = 0; i < s; ++i)
#define all(v) (v.begin(), v.end())
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define VEC(a, n) vector<int>a(n)
#define PQ(a) priority_queue<int>a
#define PQmin(a) priority_queue< int, :vector<int>, greater<int> >a
#define PAIR pair<int, int>
/*
sort(sp.begin(), sp.end(), [](PAIR l, PAIR r){
        return l.first<r.first || (l.first==r.first && l.second > r.second);
        });
*/

typedef long long  ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int main() {
    string s;
    cin>>s;
    for(int i=0;i<s.size();i++){
        cout<<s.at(i);
        if(i==3){
            cout<<" ";
        }
    }
    cout<<endl;





    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0;i<int(N);++i)
#define rep1(i,N) for(int i=1;i<int(N);++i)
#define all(a) (a).begin(),(a).end()
#define print(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<_<<", "; cerr<<"]"<<endl; }
#define printpair(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<"{"<<_.first<<","<<_.second<<"}"<<", "; cerr<<"]"<<endl; }
#define dump(x) cerr<<#x<<": "<<x<<endl;
#define bit(k) (1LL<<(k))
typedef long long ll;
typedef pair<int, int> i_i;
typedef pair<ll, ll> l_l;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
template< typename T1, typename T2 >
ostream &operator<<(ostream &os, const pair< T1, T2 >& p) {
  os << "{" <<p.first << ", " << p.second << "}";
  return os;
}
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; }

const int INF = (ll)1e9;
const ll INFLL = (ll)1e18+1;
const ll MOD = 1'000'000'007;
// const ll MOD = 998244353;
const double PI = acos(-1.0);
/*
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const string dir = "DRUL";
*/

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

    ll H, W, M;
    cin >> H >> W >> M;
    vec<int> cntx(H,0), cnty(W,0);
    map<l_l, int> mp;
    vector<l_l> cnt_x;
    vector<l_l> cnt_y(1, {-1,-1});
    rep(i,M){
        int h, w;
        cin >> h >> w;
        h--; w--;
        cntx[h]++;
        cnty[w]++;
        mp[{h,w}]++;
    }
    rep(i,H)cnt_x.emplace_back(cntx[i], i);
    rep(j,W)cnt_y.emplace_back(cnty[j], j);
    sort(all(cnt_x), greater<>());
    sort(all(cnt_y));
    vector<int> kouho_y;
    for(int i = W; i >= 0; i--){
        kouho_y.emplace_back(cnt_y[i].second);
        if(cnt_y[i].first != cnt_y[i-1].first)break;
    }
    ll maxxy = cnt_y.back().first;
    ll ans = 0;
    rep(i,H){
        int idx = cnt_x[i].second;
        ll tmp = cnt_x[i].first;
        if(ans >= tmp + maxxy)break;
        for(auto y: kouho_y){
            chmax(ans, tmp + maxxy - (mp[{idx,y}] > 0));
            if(ans >= tmp + maxxy)break;
        }
    }
    cout << ans << endl;
}

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

using namespace std;


int main(int argc, char *argv[])
{
    
    cin.tie(0), cout.tie(0), ios::sync_with_stdio(false);
    
    string w, line, word;
    map<string, int> cnt;
    
    cin >> w;
    
    while (getline(cin,line), line != "END_OF_TEXT") {
        istringstream iss(line);
        while (iss >> word) {
            transform(word.begin(), word.end(), word.begin(), ::tolower);
            cnt[word]++;
        }
    }
    
    cout << cnt[w] << endl;
    
    return 0;
}



Measured memory_bytes: 3248
#include<stdio.h>

int fib(int i){
  
  int num1=1;
  int num2=1;
  int temp=1;
  int j;
  
  for(j=1; j<i; j++){
    temp = num1+num2;
    num1 = num2;
    num2 = temp;
  }
  return temp;
}

int main()
{
  int n;

  scanf("%d",&n);

  printf("%d\n",fib(n));

  return 0;
}



Measured memory_bytes: 2112
#include <bits/stdc++.h>
typedef long long ll;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REP2(i, a, b) for(int i = a;i <= b;i++)
#define REPR(i, a, b) for(int i = a; i >= b; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define MOD 1000000007
#define PI 3.14159265358979323846
#define vi vector<int>
#define vll vector<ll>
#define vi2 vector<vector<int>>
#define eb emplace_back
#define fi first
#define se second
#define ALL(v) v.begin(), v.end()
#define sz(x) int(x.size())
using namespace std;
using P = pair<ll,ll>;
const int dx[]{0, 1, 0, -1, -1, -1, 1, 1}, dy[]{1, 0, -1, 0, -1, 1, -1, 1};
#define INT(name) int name;cin >> name;
#define VEC(type,name,n) vector<type> name(n);REP(i,n) cin >> name[i];

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

int main()
{
  INT(N);
  string S;
  cin >> S;
  int cnt = 0;
  REP(i,sz(S)){
    if(S[i]=='R'){
      cnt++;
    }
  }
  int ans = 0;
  FOR(i,cnt,sz(S)){
    if(S[i]=='R'){
      ans++;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 3748
h1,m1,h2,m2,k = [int(i) for i in input().split()]

hour = (h2 - h1) if m2 >= m1 else (h2-h1-1)
minute = m2 - m1 if m2 >= m1 else 60 + (m2 - m1)

ans = 60 * hour + minute - k

print(ans)


Measured memory_bytes: 9172
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define All(v) (v).begin(),(v).end()
int dy[8] = {-1,0,1,0,-1,1,1,-1};
int dx[8] = {0,1,0,-1,1,1,-1,-1};
const int mod = 1000000007;
const int inf = mod*mod;
const int d5 = 100005;
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    long double a,b;
    cin>>a>>b;
    int res=a*b;
    cout<<res<<endl;
}

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

int a[105];
int dp[105][100005];

#define MOD 1000000007

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

    int n, k;
    cin >> n >> k;
    for(int i = 0; i < n; ++i){
        cin >> a[i];
    }
    for(int i = 0; i <= a[0]; ++i)
        dp[0][i] = i + 1;
    for(int i = a[0] + 1; i <= k; ++i)
        dp[0][i] = dp[0][a[0]];
    for(int i = 1; i < n; ++i){
        dp[i][0] = 1;
        for(int j = 1; j <= k; ++j){
            dp[i][j] = dp[i][j - 1];
            dp[i][j] += (dp[i - 1][j] - (j - a[i] - 1 >= 0 ? dp[i - 1][j - a[i] - 1] : 0)) % MOD;
            dp[i][j] %= MOD;
        }
    }

    cout << (dp[n - 1][k] - dp[n - 1][k - 1] + MOD) % MOD << "\n";
    return 0;
}


Measured memory_bytes: 41216
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;

public class Main {

	public static void main(String args[]) {
		FastScanner cin = new FastScanner(System.in);
		PrintWriter cout = new PrintWriter(System.out);
		solve(cin, cout);
		cout.flush();
	}

	private static void solve(FastScanner cin, PrintWriter cout) {
		assert !solve(48792, 105960835, 681218449, 90629745, 90632170);
		assert solve(491995, 412925347, 825318103, 59999126, 59999339);

		assert solve(5, 1, 5, 2, 4);
		assert !solve(4, 7, 6, 4, 5);
		assert !solve(48792, 105960835, 681218449, 90629745, 90632170);
		assert solve(491995, 412925347, 825318103, 59999126, 59999339);

		long n = cin.nextLong();
		long a = cin.nextLong();
		long b = cin.nextLong();
		long c = cin.nextLong();
		long d = cin.nextLong();

		boolean ans = solve(n, a, b, c, d);
		if (ans)
			cout.println("YES");
		else
			cout.println("NO");
	}

	private static boolean solve(long n, long a, long b, long c, long d) {
		long dif = Math.abs(b - a);
		long rng = d - c;
		long moves = n - 1;

		for (long i = moves % 2; i <= moves; i += 2) {
			long min = (moves - i) / 2 * -rng + c * i;
			long max = (moves - i) / 2 * +rng + d * i;
			if (min <= dif && dif <= max)
				return true;
		}
		return false;
	}

	static class FastScanner {
		private final InputStream in;
		private final byte[] buf = new byte[1 << 14];
		private int bufs = 0;
		private final long[] num = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
		private int ptr = 0;

		public FastScanner(InputStream in) {
			super();
			this.in = in;
		}

		boolean hasNext() {
			while (hasNextByte() && !isMeaningful(buf[ptr]))
				ptr++;
			return hasNextByte();
		}

		private boolean hasNextByte() {
			if (ptr < bufs)
				return true;
			ptr = 0;
			try {
				bufs = in.read(buf);
			} catch (IOException e) {
				throw new IllegalArgumentException(e);
			}
			if (bufs <= 0)
				return false;
			return true;
		}

		private static boolean isMeaningful(int b) {
			return 33 <= b && b <= 126;
			// return b != -1 && !Character.isWhitespace(b);
		}

		String next() {
			if (!hasNext())
				throw new IllegalArgumentException();
			StringBuilder sb = new StringBuilder();
			int b = read();
			while (isMeaningful(b)) {
				sb.appendCodePoint(b);
				b = read();
			}
			return sb.toString();
		}

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

		int nextInt() {
			long nl = nextLong();
			int ni = (int) nl;
			if (ni != nl)
				throw new IllegalArgumentException();
			return ni;
		}

		long nextLong() {
			if (!hasNext())
				throw new IllegalArgumentException();
			long n = 0;
			int plus = 1;
			int b = read();
			if (b == '-') {
				plus = -1;
				b = read();
			}
			if ('0' > b || b > '9')
				throw new java.lang.IllegalArgumentException();
			while (true) {
				if (!isMeaningful(b))
					return plus * n;
				n *= 10;
				n += num[b - '0'];
				b = read();
			}
		}

		private int read() {
			if (hasNextByte())
				return buf[ptr++];
			else
				return -1;
		}

	}
}


Measured memory_bytes: 21332
import math
n, k = map(int, input().split())
mod = 10**9 + 7
for i in range(k):
    if i > n - k :
        print(0)
    else:
        com1 = math.factorial(n-k+1) // (math.factorial(i+1) * math.factorial(n-k-i))
        com2 = math.factorial(k-1) // (math.factorial(i) * math.factorial(k-i-1))
        ball_com = com1 * com2
        print(ball_com % mod)


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

int main() {
  long long a,b,c;
  cin>>a>>b>>c;
  if(a%2==0||b%2==0||c%2==0){
    cout<<"0"<< endl;
    return 0;
  }
  else{
    if(a*b<=b*c&&a*b<=a*c){
      cout<<a*b<< endl;
      return 0;
    }
    if(a*c<=b*c&&a*c<=a*b){
      cout<<a*c<< endl;
      return 0;
    }
    if(b*c<=a*c&&b*c<=a*b){
      cout<<b*c<< endl;
    }
  }
}

Measured memory_bytes: 256
n, k = map(int, input().split())
R,S,P= map(int, input().split())
t=list(input())

count=0
m=n//k

for i in range(k):
    flag=False
    for j in range(m+1):
        if j==0:
            if t[i] == 'r':
                count += P
            elif t[i] == 's':
                count += R
            else:
                count += S
        else:
            if i+k*j>=n:
                break

            if t[i+k*j]==t[i+k*(j-1)]:
                if flag==False:
                    flag=True
                    continue
                else:
                    flag=False
                    if t[i+k*j] == 'r':
                        count += P
                    elif t[i+k*j] == 's':
                        count += R
                    else:
                        count += S

            else:
                flag=False
                if t[i+k*j] == 'r':
                    count += P
                elif t[i+k*j] == 's':
                    count += R
                else:
                    count += S




print(count)

Measured memory_bytes: 49648
import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;
import java.math.BigInteger;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    List<Integer> numList = new ArrayList<>();
    if(n == 1) {
        System.out.println(1);
        return;
    }
    for(int i = 1; i <= n; i++){
        numList.add(i);
    }

    BigInteger result = new BigInteger("1");
    for(int i = 1; i < n; i++){
        int sNum = numList.get(i);
        if (sNum == 1) continue;
        int count = 0;
        for(int j = i; j < n; j++){
            int tNum = numList.get(j);
            while(tNum % sNum == 0){
                tNum /= sNum;
                count++;
            }
            numList.set(j, tNum);
        }
        if (count != 0) {
            BigInteger tmpNum = new BigInteger(Integer.toString(count + 1));
            result = result.multiply(tmpNum);
        }
    }
    BigInteger seven = new BigInteger("7");
    System.out.println(result.remainder(BigInteger.TEN.pow(9).add(seven)));
  }
}

Measured memory_bytes: 10704
#include <iostream>

using namespace std;

int main(){
  int n,t;
  cin >> n >> t;
  int cost[n];
  int time[n];
  for (int i = 0; i < n; i++) {
    cin >> cost[i] >> time[i];
  }
  int min = 1001;
  for (int i = 0; i < n; i++) {
    if (time[i] <= t) {
      if (cost[i] < min) {
        min = cost[i];
      }
    }
  }

  if (min == 1001) {
    cout << "TLE" << endl;
    return 0;
  }

  cout << min << endl;
  return 0;
}

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

	if (6 - (a + b) == 1) {
		printf("1\n");
	}
	else if (6 - (a + b) == 2) {
		printf("2\n");
	}
	else {
		printf("3\n");
	}

	return 0;
}

Measured memory_bytes: 128
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce
from pprint import pprint


sys.setrecursionlimit(2147483647)
INF = 10 ** 13
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007


t1, t2 = LI()
a1, a2 = LI()
b1, b2 = LI()
p = (a1 - b1) * t1
q = (a2 - b2) * t2
if p > 0:
    p = -p
    q = -q
if p + q == 0:
    print('infinity')
elif p + q < 0:
    print(0)
else:
    print((-p // (p + q)) * 2 + bool(-p % (p + q)))

Measured memory_bytes: 41584
A = int(input())
B = int(input())
C = int(input())
X = int(input())

output = 0
for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      total = 500*a + 100*b + 50*c
      if total == X:
        output += 1

print(output)


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

using namespace std;

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

  vector<vector<int>> adjacent(n);
  for (int i = 0; i < n; i++) {
    int u, k;
    cin >> u >> k;
    --u;

    for (int i = 0; i < k; i++) {
      int v;
      cin >> v;
      --v;

      adjacent[u].push_back(v);
    }
  }

  vector<int> d(n, -1);
  vector<bool> pushed(n, false);
  queue<int> Q;

  Q.push(0);
  
  pushed[0] = true;
  
  d[0] = 0;

  while (!Q.empty()) {
    int u = Q.front();

    int parentDist = d[u];

    for (int i = 0; i < adjacent[u].size(); i++) {
      int v = adjacent[u][i];

      if (!pushed[v]) {
        Q.push(v);
        pushed[v] = true;
        d[v] = parentDist + 1;
      }
    }

    Q.pop();
  }

  for (int i = 0; i < n; i++) {
    cout << i + 1 << " " << d[i] << endl;
  }

  return 0;
}



Measured memory_bytes: 3160
package main

import "fmt"

func main() {
	var n, m, k int64
	fmt.Scan(&n)
	fmt.Scan(&m)
	fmt.Scan(&k)

	const M = 998244353

	fac := make([]int64, n, n)
	fac[0] = 1
	for i := int64(1); i < n; i++ {
		fac[i] = (fac[i - 1] * i) % M
	}

	answer := int64(0)
	for i := int64(0); i <= k; i++ {
		tmp := m * modpow(m - 1, n - 1 - i, M)
		tmp %= M
		tmp *= fac[n - 1]
		tmp %= M
		tmp *= modinv(fac[n - 1 - i], M)
		tmp %= M
		tmp *= modinv(fac[i], M)
		tmp %= M
		answer = (answer + tmp) % M
	}

	fmt.Println(answer)
}

func modpow(a int64, n int64, m int64) int64 {
	if n == 0 {
		return 1
	}
	tmp := modpow(a, n / 2, m)
	if n % 2 == 0 {
		return tmp * tmp % m
	}
	return tmp * tmp % m * a % m
}

func modinv(a int64, m int64) int64 {
	return modpow(a, m - 2, m)
}

Measured memory_bytes: 3388
#include <iostream>
#include <stdexcept>
#include <cassert>
#include <string>
using namespace std;


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

  const int N = S.size();
  assert(S.size() == T.size());

  int ans = 0;
  for (int i = 0; i < N; i++) {
    if (S.at(i) != T.at(i)) ans++;
  }

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

Measured memory_bytes: 3920
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cassert>
#include <cstring>
#include <string>
#include <vector>
#include <random>
#include <bitset>
#include <queue>
#include <cmath>
#include <unordered_map>
#include <set>
#include <map>
#define INCANT cin.tie(0), cout.tie(0), ios::sync_with_stdio(0), cout << fixed << setprecision(20);
#define rep(i,n) for (int i=0; i<n;++i)
#define ALL(a)  (a).begin(),(a).end()
#define PI 3.14159265358979
typedef long long ll;
using namespace std;
const ll MOD = 1e9+7LL;
const int INF = 2e9;
char c[3];

int main() {
  INCANT;
  char x;
  rep(i, 3) {
    rep(j, 3) {
      cin >> x;
      if (i==j) c[i] = x;
    }
  }
  rep(i, 3) cout << c[i];
  cout << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for(int i=m;i<(int)(n);i++)
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
typedef long long ll;
typedef pair<ll,ll> pint;
const long long INF = 1LL<<60;
ll gcd(ll a,ll b){
    if(b==0){
        return a;
    }
    else{
        return gcd(b,a%b);
    }
}

int main(){
    ll k;cin>>k;
    vector<ll> ans(50);
    if(k<50){
    int amari = k%50;
    ll sho = k/50;
    rep(i,50) ans[i]=49LL-k;
    rep(i,amari) ans[i]=49+(k+49)/50;
    cout<<50<<endl;
    rep(i,50) cout<<ans[i]<<" ";cout<<endl;
    }
    else{
    int amari = k%50;
    ll sho = k/50;
    rep(i,50) ans[i]=49LL+sho-amari;
    rep(i,amari) ans[i]+=51;
    cout<<50<<endl;
    rep(i,50) cout<<ans[i]<<" ";cout<<endl;
    }
}

Measured memory_bytes: 256
s = list(input())
ans = 0
if len(s)%2==0:
    for i in range(len(s)//2):
        if s[2*i]=="L" or s[2*i+1]=="R":
            ans += 1
            break
elif len(s)%2!=0:
    for i in range(len(s)//2):
        if s[2*i]=="L":
            ans += 1
            break
        elif s[2*i+1]=="R":
            ans += 1
            break
    if s[-1]=="L":
        ans += 1

if ans==0:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3064
/*
 * Author: .-O_O-.
 */
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include<bits/stdc++.h>
using namespace __gnu_pbds;
using namespace std;
#define ll long long
#define pb push_back
#define vi vector<int>
#define rep0(a,b) for(int a=0;a<b;a++)
#define rep1(a,b) for(int a=1;a<=b;a++)
#define repp(a,b,c) for(int a=b;a<c;a++)
#define in insert
#define len length()
#define si size()
#define lb lower_bound
#define ub upper_bound
#define beg begin()
#define en end()
#define f first
#define s second
#define pr(a) cout<<a
#define pr2(a,b) cout<<a<<" "<<b<<"\n"
#define nx cout<<"\n"
#define int long long
// void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
                                                     
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]"<<endl;}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define deb(x...)
#endif
const ll mod = 1000000007;
const ll N = 200005;
const ll mm = 1e+18;
void solve()
{
    set<int>s;
    rep0(i,3){
        int x;
        cin>>x;
        s.in(x);
    }
    pr((int)(s.si));
}
signed main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int t=1;
    //cin>>t;
    rep1(_i,t){
        //cout<<"Case #"<<_i<<": ";
        solve();
        //nx;
    }
    return 0;
}


Measured memory_bytes: 3528
#include<cstdio>
#include<cmath>
#include<cstring>
#include<queue>
#include<iostream>
#include<algorithm>
#include<map>
using namespace std;
int main(){
	int a,b;
	scanf("%d %d",&a,&b);
	int p=0;
	if((a+b)%3==0||a%3==0||b%3==0) printf("Possible\n");
	else printf("Impossible\n");
	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define ll long long
#define ull unsigned long long
using namespace std;
void io() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
}

const int MAXN = 1e5 + 5;
const ll INF = 0x3f3f3f3f3f3f3f;
const ll prim = 1e9 + 7;

int a[MAXN];
int n;

int main() {
    io();
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    ll ans = 0;
    for (int i = 0; i < n; i++) {
        if (i & 1) {
            ans -= a[i];
        } else {
            ans += a[i];
        }
    }
    cout << ans << ' ';
    for (int i = 0; i < n - 1; i++) {
        ans -= a[i];
        ans = -ans;
        ans += a[i];
        cout << ans << ' ';
    }
}

Measured memory_bytes: 4012
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
using namespace std;
#include<algorithm>
#include<queue>
typedef long long ll;
#include<vector>
#define cin(n) scanf("%lld",&(n))
#define cout(n) printf("%lld",(n))
#define couc(c) printf("%c",(c))
#define coutn printf("\n")
#define cout_ printf(" ")
#define debug() printf("haha\n")
const int MAXN= 1e6 + 5 ;
ll t;
ll n,k;
ll hamburger[MAXN]={1,5};
ll meat[MAXN]={1,3};
ll onemeat[MAXN]={0,0,1,2,3,3};
ll rou=3;
ll now=5;
ll an;
ll findmeat(ll x,ll m)
{
    if(m==1)
        return onemeat[x];
    if(x==1)
        return 0;
    else if(x<hamburger[m]/2+1)
        return findmeat(x-1,m-1);
    else if(x==hamburger[m]/2+1)
        return meat[m-1]+1;
    else if(x>hamburger[m]/2+1&&x!=hamburger[m])
        return meat[m-1]+1+findmeat(x-hamburger[m]/2-1,m-1);
    else if(x==hamburger[m])
        return meat[m];
}
int main()
{
    cin(n);
    cin(k);
    for(int i=2;i<=n;i++)
    {
        meat[i]=meat[i-1]*2+1;
        hamburger[i]=hamburger[i-1]*2+3;
    }
    ll ans=findmeat(k,n);
    cout(ans);
    coutn;
    return 0;
}



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

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;
int dp[67200000];
ll Hash[200002];
string S;
ll beki[28];

int moji(char in){
    return (int)in - (int)'a';
}

int main() {
    //cout.precision(10);
    cin >> S;
    S = "#" + S;
    beki[0] = 1;
    for(int i = 1; i < 28; i++){
        beki[i] = beki[i - 1] * 2;
    }
    Hash[0] = 0;
    for(int i = 1; i < S.size(); i++){
        Hash[i] = Hash[i - 1] ^ beki[moji(S[i])];
    }
    for(int i = 0; i < 67200000; i++){
        dp[i] = INF;
    }
    dp[0] = 0;
    for(int i = 1; i < S.size(); i++){
        int opt = dp[Hash[i]] + 1;
        for(int j = 0; j < 26; j++){
            opt = min(opt, dp[(Hash[i] ^ beki[j])] + 1);
            //cout << i << " "<< j << " " << Hash[i] << " " << beki[j] << " " << (Hash[i] ^ beki[j]) << " " << (dp[(Hash[i] ^ beki[j])]) << " " << opt << endl;
        }
        dp[Hash[i]] = min(dp[Hash[i]], opt);
        //cout << i << " "<< opt << endl;
        if(i + 1 == S.size()){
            cout << opt << endl;
            return 0;
        }
    }
    return 0;
}


Measured memory_bytes: 264644
import java.util.Scanner;
class Main {                                   
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int y = sc.nextInt();
		int z = sc.nextInt();
		if (z >= x && z <= y) {
			System.out.println("Yes");
		}else{
			System.out.println("No");
		}		
	}
}

Measured memory_bytes: 22868
#include<stdio.h>
#include<math.h>

int main(void)
{
    long K, i;
    int flag=0, c=0;
    long long n=7;

    scanf("%ld", &K);

    if(K%2 == 0 || K%5 == 0) {
        flag = 0;
    } else {
        for(i=0; i<1000000; i++) {
            c++;
            if(n%K == 0) {
                flag = 1;
                break;
            }
            n = n%K;
            n*=10;
            n+=7;
        }
    }

    if(flag == 1) {
        printf("%d\n", c);
    } else {
        printf("-1\n");
    }

    return 0;
}

Measured memory_bytes: 1736
#include <iostream>
#include <math.h>
#include <algorithm>
#include <string>
#include <string.h>
#include <queue>
#include <vector>
#include <set>
using namespace std;
int main() {
	char c;
	cin>>c;
	if(c=='a'||c=='i'||c=='u'||c=='e'||c=='o')cout<<"vowel";
	else cout<<"consonant";
}

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

int main(){   
   int n,y,e,f,g;
   cin >> n >> y;
   bool t=false;
   for(int a=0;;a++){
       for(int b=0;;b++){
           if(9000*a+4000*b==y-1000*n){
               e=a;
               f=b;
               g=n-e-f;
               if(g>=0){t=true;}
               break;
           }
           if(9000*a+4000*b>y-1000*n){
               break;
           }
       }
       if(9000*a>y-1000*n){
               break;
           }
       if(t){
           g=n-e-f;
           break;
       }
   }
   if(t && g>=0){
       cout << e <<" " <<f<<" "<< g<<endl;
   }else{
       cout <<"-1 -1 -1"<<endl;
   }
}

Measured memory_bytes: 256