akhauriyash/Code-Regression huggingface dataset:
#include                        <bits/stdc++.h>
#include                        <ext/pb_ds/assoc_container.hpp>
#define lb                      lower_bound
#define ub                      upper_bound
#define pb(x)                   push_back((x))
#define pb2(x,y)                push_back({x,y})
#define pb3(x,y,z)              push_back({x,y,z})
#define load(node,n)            bool operator < (const node &n) const
#define fbo(x)                  find_by_order(x)
#define ook(x)                  order_of_key(x)
#define all(x)                  (x).begin(),(x).end()
#define FOR(i,n)                for(int i = 1; i<=n; i++)
#define REP(i,n)                for(int i = 0; i<n;  i++)
#define dbg(a)                  cout<<#a <<" --> "<<(a)<<endl;
#define TT                      int TC;  scanf("%d",&TC);  while(TC--)
#define read                    freopen("input.txt","r",stdin)
#define write                   freopen("output.txt","w",stdout)
#define set(x)                  tree<x,null_type,less<x>,rb_tree_tag,tree_order_statistics_node_update>
using                           namespace std;
using                           namespace __gnu_pbds;
typedef                         long long ll;
typedef                         pair<ll,ll> pll;
typedef                         pair<int,int> pii;

int ar[] = {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};



main(){
//read;


int n;
cin>>n;
cout<<ar[n-1];

return 0;
}



Measured memory_bytes: 256
void main() {
	auto ip = readAs!(int[]), N = ip[0], K = ip[1];
	auto ip2 = readAs!(int[]), R = ip2[0], S = ip2[1], P = ip2[2];
	auto T = rs;
	string history;
	char win(char t) {
		if(t == 'r') return 'p';
		if(t == 's') return 'r';
		return 's';
	}
	int score(char t) {
		if(t == 'r') return R;
		if(t == 's') return S;
		return P;
	}
	int res;
	foreach(i, v; T) {
		if(i >= K) {
			auto last = history[i - K];
			if(last == win(v)) {
				history ~= "*";
				continue;
			} else {
				history ~= win(v);
				res += score(win(v));
			}
		} else {
			history ~= win(v);
			res += score(win(v));
		}
	}
	res.writeln;
}

// ===================================

import std.stdio;
import std.string;
import std.functional;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}

Measured memory_bytes: 2556
#include <iostream>
#include <vector>
#include <bitset>
#include <string>
#include <array>
#include <random>
#include <chrono>
#include <algorithm>

int main(void){
	int n, x;
	std::cin >> n >> x;
	std::vector<int> l(n);
	for(int i=0;i<n;i++)std::cin >> l[i];
	int d = 0;
	int ans = 0;
	while(d <= x && ans < n){
		d += l[ans++];
	}
	if(d <= x)ans++;
	std::cout << ans << std::endl;
	return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>
int judge(int);

int main()
{
  int i,a,x[10000],y,c=0;
  int m;

  scanf("%d",&a);
  for(i=0;i<a;i++){
    scanf("%d",&x[i]);
    m=judge(x[i]);
    if(m==1){
      c++;
    }
  }
  printf("%d\n",c);
  return 0;
  
}
int judge(int x){
  int i;
  if (x == 2)
    return 1;
  if(x<2 || x%2==0){
    return 0;
  }
  i=3;
  while(i<=sqrt(x)){
    if(x%i==0)return 0;
    i=i+2;
  }
  return 1;
}

Measured memory_bytes: 628
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#define ArraySizeOf(array)     (sizeof(array) / sizeof(array[0]))
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define int long long
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define _GLIBCXX_DEBUG
int INF = 1e9+7;
unsigned NthDayOfWeekToDay(unsigned n, unsigned dow, unsigned dow1)
{
unsigned day;
if(dow < dow1) dow += 7;
day = dow - dow1;
day += 7 * n - 6;
return day;
}
unsigned DayToWeekNumber(unsigned day)
{
  return (day - 1) / 7 + 1;
}
unsigned AnotherDayOfWeek(unsigned day, unsigned day0, unsigned dow0)
{
  return (dow0 + 35 + day - day0) % 7;
}
using namespace std;
signed main(){
	int N;
	cin>>N;
	int ans=0;
	vector<int>a(N);
	rep(i,N)cin>>a[i];
	sort(a.begin(),a.end());
	reverse(a.begin(),a.end());
    ans+=a[0];
    for(int i=1;i<N-1;i++){
      ans+=a[(i+1)/2];
    }
	cout<<ans<<endl;
}

Measured memory_bytes: 4820
from math import sqrt
n = int (input())
nsqrt = int(sqrt(n))
for i in range(nsqrt, 0, -1):
    if n % i == 0:
        b = n // i
        a = i
        break
    if i == 1:
        b = 1
        a = n
def digits(n):
    ans = 0
    while n > 0:
        ans += 1
        n //= 10
    return ans
print (max(digits(a), digits(b)))
                



Measured memory_bytes: 63084
program main;
var
	s1, s2 : string;
    count, len, i : integer;


begin
    count := 0;
	readln(s1);
    readln(s2);
    
    len := length(s1);
    for i := 1 to len do begin
    	if s1[i] <> s2[i]
        	then count := count + 1;
    end;
	writeln(count);
end.
    

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

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

  int color[10] = {};
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    if (a < 3200) color[a / 400] = 1;
    else color[8]++;
  }

  int cnt = 0;
  for (int i = 0; i < 8; i++) cnt += color[i];

  int minv = max(1, cnt), maxv = cnt + color[8];

  cout << minv << " " << maxv << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
const int mod = 1e9 + 7;

string conv(string s)
{
    for (int i = 0; i < s.size(); i++)
    {
        char c = s.at(i);
        if (c >= 'A' && c <= 'Z')
        {
            c += 'a' - 'A';
        }
        s.at(i) = c;
    }
    return s;
}

int main()
{
    string t, s;
    cin >> t;
    int ans = 0;
    while (true)
    {
        cin >> s;
        if (s == "END_OF_TEXT")
        {
            break;
        }
        if (conv(s) == t)
        {
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3132
# -*- coding: utf-8 -*-


N = int(input())
An = list(map(int, input().split()))
ans = [0,0]

asum = 0
for i in range(N):
  asum += An[i]
  if asum*(-1)**i < 1:
    ans[0] += 1 - asum*(-1)**i
    asum = (-1)**i

asum = 0
for i in range(N):
  asum += An[i]
  if asum*(-1)**(i+1) < 1:
    ans[1] += 1 - asum*(-1)**(i+1)
    asum = (-1)**(i+1)

print(min(ans))

Measured memory_bytes: 14468
// C++ 14
#include <bits/stdc++.h>
using namespace std;
template <typename T>  ostream& operator<<(ostream& os, const vector<T>& v)  {  os << "[";  for (int i = 0; i < v.size(); ++i) {  os << v[i];  if (i != v.size() - 1)  os << ", ";  }  os << "]";  return os;  }
template <typename T> void print(T v) { cout << v << endl; }
template <typename T> void in(T &v) { cin >> v; }
#define ll long long
#define loop(__x, __start, __end) for(ll __x = __start; __x < __end; __x++)

int main() {
  int n, m; in(n), in(m);
  vector<ll> A(n), C;
  loop(i,0,n) in(A[i]);
  map<ll, int> M;
  loop(i,0,m) {
    ll b, c; in(b), in(c);
    M[c] += b;
  }
  for (auto &&m: M) C.push_back(m.first);
  sort(A.begin(), A.end());
  sort(C.rbegin(), C.rend());
  int c_i = 0;
  ll sum = 0;
  loop(i,0,n) {
    if (c_i < C.size() and M[C[c_i]] > 0) {
      ll c = C[c_i];
      if (c > A[i]) {
        sum += c;
        if (--M[C[c_i]] <= 0) c_i++;
        continue;
      }
    }
    
    sum += A[i];
  }
  print(sum);
  return 0;
}


Measured memory_bytes: 11324
#include <stdio.h>

int main(void)
{
    int W;
    int H;
    int x;
    int y;
    int r;

    scanf("%d %d %d %d %d", &W, &H, &x, &y, &r);

    if (r <= x && x <= W - r && r <= y && y <= H - r)
        printf("Yes\n");
    else
        printf("No\n");

    return 0;
}


Measured memory_bytes: 2696
#include<cstdio>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<queue>
using namespace std;
int main(){
    int N;
    cin>>N;
    int cou=0;
    int flg=0;
    for(int i=0;i<N;i++){
        int a,b;
        cin>>a>>b;
        if(a==b){
            cou++;
        }
        else{
            cou=0;
        }
        if(3<=cou)flg=1;
    }
    if(flg)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}


Measured memory_bytes: 3120
#include <bits/stdc++.h>
#define ll long long
#define rep(X,N) for(ll X = 0; X < (N); X++)
#define PI (acos(-1.0))
#define pback push_back
#define mpair make_pair
#define MODN 1000000007
#define ALL(V) (V).begin(),(V).end()
#define CERR if(false) cerr

using namespace std;

int main(){

    int a,b,c,x;
    cin >> a;
    cin >> b;
    cin >> c;
    cin >> x;

    int ans = 0;

    rep(i,a + 1){
        rep(j, b + 1){
            rep(k, c + 1){
                if(500 * i + 100 * j + 50 * k == x) ans++;
            }
        }
    }

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

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

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	int n; cin >> n;
	bool f = false;
	for (int i = 0; i < n; i++) {
		int a; cin >> a;
		if (a % 2) f = true;
	}
	if (f) cout << "first" << '\n';
	else cout << "second" << '\n';
	return 0;
}

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

#define mod 1000000007

using namespace std;
 
int main(void){
	
	int A, B;
	
	cin >> A >> B;
	
	if(B%A == 0)
		cout << A + B;
	else
		cout << B - A;
	
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
const int mod=1e9+7;
const int maxn=1e5+5;
using namespace std;
int ans=0;
string s;

int main()
{
	cin>>s;
    for(int i=0;i<s.size()-1;i++)
        if(s[i]=='h' && s[i+1]=='i') ans+=2;
    if(ans==s.size()) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define bug(x) cout<<#x<<" : "<<x<<endl
#define de puts("#")
#define ll long long
using namespace std;
int a1;
const int maxn=1e6+5;
int n,k,a[maxn];
ll p[maxn];
vector<int>s;
int b1;
/*
我们有一个N个整数序列：a1，A2..AN，您可以在0到K次(包括)之间执行以下操作：
选择两个整数i和j，使i≠j，每个在1和N(包含)之间。将1添加到A[i]，将-1添加到A[j]，
可能为负。计算运算后每个元素除以的能整除的最大可能正整数。
*/

bool check(int d){
	ll t=0;
	for(int i=1;i<=n;i++){
		int x=a[i]%d;
		t+=x;
		p[i]=x;
	}
	ll sum=0;
	sort(p+1,p+n+1);
	for(int i=1;i<=n;i++){
		sum+=p[i];
		if(sum==1LL*(n-i)*d-(t-sum))break;
	}
	return sum<=k;
}

int main() {
//	printf("%fKB\n",(&b1-&a1)/1024.0);
	int sum=0;
	scanf("%d %d",&n,&k);
	for(int i=1; i<=n; i++)scanf("%d",&a[i]),sum+=a[i];
	s.clear();
	for(int i=1;i*i<=sum;i++){
		if(sum%i==0){
			s.push_back(i);
			if(i*i!=sum)s.push_back(sum/i);
		}
	}
	sort(a+1,a+n+1);
	sort(s.begin(),s.end());
	int ans=1;
	for(int i=s.size()-1;i>=1;i--){//贪心 
		if(check(s[i])){
			ans=s[i];
			break;
		}
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 2304
#include <iostream>

using namespace std;

int main(void) {

	int H, W;
	while(true) {
		cin >> H >> W;
		if(H == 0 && W == 0)	break;

		for(int i=0;i<H;i++) {
			for(int j=0;j<W;j++) {
				if(i == 0 || i == H-1 || j == 0 || j == W-1) {
					cout << "#";
				} else {
					cout << ".";
				}
				// cout << "#";
			}
			cout << endl;
		}

		cout << endl;
	}

	return 0;
}

Measured memory_bytes: 1156
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll gcd(ll m,ll n){
    if(m>n){swap(m,n);}
    if(m==0){return n;}
    else{return gcd(n%m,m);}
}
ll lcm(ll m,ll n){
    return m*n/gcd(m,n);
}
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n,m,L,G;
    string s,t;
    cin>>n>>m>>s>>t;
    L=lcm(m,n);
    G=gcd(m,n);
    for(ll i=0;i<G;i++){
        if(s[n/G*i]!=t[m/G*i]){cout<<-1;return 0;}
    }
    cout<<L;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
const int N=2e5+5;
typedef long long ll;
int n,m,k;
ll a[N],b[N];
int main()
{
    scanf("%d%d%d",&n,&m,&k);
    for(int i=1;i<=n;i++) scanf("%lld",&a[i]),a[i]+=a[i-1];
    for(int i=1;i<=m;i++) scanf("%lld",&b[i]),b[i]+=b[i-1];
    int ans=0;
    for(int i=0,j=m;i<=n;i++)
        if(a[i]<=k)
        {
            while(a[i]+b[j]>k) j--;
            ans=max(ans,i+j);
        }
    printf("%d\n",ans);
}


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

using namespace std;

void FAST_IO() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
}

#define REP(_i, _a) for(int _i = 0; _i < (int)_a; ++_i)
#define FOR(_i, _a, _b) for(int _i = (int)_a; _i <= (int)_b; ++_i)
#define FORD(_i, _a, _b) for(int _i = (int)_a; _i >= (int)_b; --_i)
#define RESET(_a, _value) fill_n(_a,sizeof(_a)/sizeof(_a[0]),_v)
#define ALL(_a) _a.begin(), _a.end()
#define SIZE(_a) _a.size()
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define newline '\n';

// DEBUG UTIL
#define DEBUG(args...) { cerr << "> "; \
						 string _s = #args; \
						 replace(_s.begin(), _s.end(), ',', ' '); \
						 stringstream _ss(_s); istream_iterator<string> _it(_ss); \
						 err(_it, args); }

void err(istream_iterator<string> it) { cerr << endl; }
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << ": " << a << " ";
	err(++it, args...);
}

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> ii;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;

string format(const string& s, ...) {
    va_list args;
    va_start (args, s);
    size_t len = vsnprintf(NULL, 0, s.c_str(), args);
    va_end (args);
    std::vector<char> vec(len + 1);
    va_start (args, s);
    vsnprintf(&vec[0], len + 1, s.c_str(), args);
    va_end (args);
    return &vec[0];
}

const double PI = acos(-1.0);
const int MOD = 1e9 + 7;
const int INF = 2e9;

string S, T;

void read() {
	cin >> S >> T;
}

void solve() {
	int n = S.length();
	REP(i, n) {
		if (S.substr(n - i) + S.substr(0, n -i) == T) {
			cout << "Yes\n";
			return;
		}
	}
	cout << "No\n";
}

int main() {
	FAST_IO();

	int TC = 1;
	// cin >> TC;
	FOR(tc, 1, TC) {
		read();
		solve();
	}

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <unordered_map>
#include <map>
#include <set>
#include <algorithm>
#include <queue>
#include <stack>
#include <functional>
#include <bitset>
#include <assert.h>
#include <unordered_map>
#include <fstream>
#include <time.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef pair<ll,ll> P;
typedef pair<int,int> pii;
typedef vector<P> vpl;
typedef tuple<ll,ll,ll> tapu;
#define rep(i,n) for(int i=0; i<(n); i++)
#define REP(i,a,b) for(int i=(a); i<(b); i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
const int inf = 1<<30;
const ll linf = 1LL<<62;
const int MAX = 2020000;
ll dy[8] = {1,-1,0,0,1,-1,1,-1};
ll dx[8] = {0,0,1,-1,1,-1,-1,1};
const double pi = acos(-1);
const double eps = 1e-7;
template<typename T1,typename T2> inline bool chmin(T1 &a,T2 b){
	if(a>b){
		a = b; return true;
	}
	else return false;
}
template<typename T1,typename T2> inline bool chmax(T1 &a,T2 b){
	if(a<b){
		a = b; return true;
	}
	else return false;
}
template<typename T> inline void print(T &a){
    rep(i,a.size()) cout << a[i] << " ";
    cout << "\n";
}
template<typename T1,typename T2> inline void print2(T1 a, T2 b){cout << a << " " << b << "\n";}
template<typename T1,typename T2,typename T3> inline void print3(T1 a, T2 b, T3 c){
	cout << a << " " << b << " " << c << "\n";
}
const int mod = 1e9 + 7;
//const int mod = 998244353;

vvl G(101010);
vl memo(101010,-1);

ll dfs(ll u, ll p){
	if(memo[u] != -1) return memo[u];
	ll res = 0;
	ll cnt = 0;
	for(auto v : G[u]){
		if(v == p) continue;
		ll df = dfs(v,u);
		res += df;
		if(!df) cnt++;
	}
	res += max(0LL, cnt-1);
	return memo[u] = res;
}

int main(){
	ll n; cin >> n;
	rep(i,n-1){
		ll u,v; cin >> u >> v;
		G[u].push_back(v);
		G[v].push_back(u);
	}
	ll s = -1;
	rep(i,n){
		if(G[i].size() >= 3) s = i;
	}
	if(s == -1) cout << 1 << endl;
	else cout << dfs(s,-1) << endl;
}

Measured memory_bytes: 13908
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <functional>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>
 
using namespace std;
 
#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)
#define rep(i,n) REP(i, 0, n)
#define pb push_back
#define mp make_pair
#define all(r) (r).begin(),(r).end()
#define rall(r) (r).rbegin(),(r).rend()
#define fi first
#define se second
#define DBG(X) cout<<" "<<#X<<" : "<<X<<endl
 
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;

const int INF = 1e9;
const double EPS = 1e-8;
const int mod = 1e9 + 7;
const ll LINF = 1e18;

struct Input
{
	int n;char c;char str[10010];string s;ll l;double d;
	int nextInt(){scanf("%d", &n);return n;}
	ll nextLong(){scanf("%lld", &l);return l;}
	double nextDouble(){scanf("%lf", &d);return d;}
	char nextChar(){scanf("%c", &c);return c;}
	string next(){scanf("%s", str);return string(str);}
	string nextLine(){getline(cin, s);return s;}
};
Input in;

const int Mod = 1001;

ll fib[100010];
ll calcFib(int n){
	if(n == 0 || n==-1) return 1LL;
	if(fib[n]>0) return fib[n];
	return fib[n] = (calcFib(n-1)+calcFib(n-2))%Mod;
}

struct UFT{	//O(loga(n))
	int n;
	vi d, r;
	UFT(int n) : n(n), d(n, -1), r(n, 0){};
	int root(int i){
		if(d[i] < 0) return i;
		return d[i] = root(d[i]);
	}
	bool same(int x, int y){
		return root(x) == root(y);
	}
	bool unite(int x, int y){
		x = root(x);
		y = root(y);
		if(x == y) return false;

		if(r[x] < r[y]) swap(x, y);
		else if(r[x] == r[y]) r[x]++;
		d[x] += d[y];
		d[y] = x;
		return true;
	}
	int size(int i){
		return -d[root(i)];
	}
};



int main(){
	calcFib(1010);
	int v, d;
	while(scanf("%d%d", &v, &d) != EOF){
		UFT uft(v+1);
		int ans = 0;
		for(int i= 1; i <= v; i++){
			for(int j = i + 1; j <= v; j++){
				if(abs(fib[i]-fib[j])<d){
					uft.unite(i, j);
				}
			}
		}
		set<int> st;
		for(int i = 1; i <= v; i++){
			st.insert(uft.root(i));
		}
		printf("%d\n", (int)st.size());
	}
}

Measured memory_bytes: 3152
import java.util.Scanner;

class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int K = sc.nextInt();
        int X = sc.nextInt();
        if (K*500>=X){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }


    }
}

Measured memory_bytes: 21844
#include<bits/stdc++.h>
#define ll long long
#define endl '\n'
using namespace std;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int ac=0, wa=0, tle=0, re=0;
	int t;
	cin>>t;
	while(t--){
		string s;
		cin>>s;
		if(s[0] == 'A') ac++;
		else if(s[0] == 'W') wa++;
		else if(s[0] == 'T') tle++;
		else re++;
	}
	cout<<"AC x "<<ac<<endl;
	cout<<"WA x "<<wa<<endl;
	cout<<"TLE x "<<tle<<endl;
	cout<<"RE x "<<re<<endl;
	return 0;
}


Measured memory_bytes: 3644
i1 = input()

n = int(i1.split(' ')[0])
k = int(i1.split(' ')[1])

i2 = input()
p = i2.split(' ')

m_l = 0
for nn in range(0, k):
    m_l += int(p[nn])
m = m_l
for nn in range(k, n):
    m += -int(p[nn-k])+int(p[nn])
    if(m_l < m):
        m_l = m

print((m_l + k)/2)

Measured memory_bytes: 17252
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0;i< (n);i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<int, ll> pil;

//priority_queue<int, vector<int>, greater<int>> min_heap;
//struct Point {
//	int x,y;
//};
//long long ccw(const Point& A, const Point& B, const Point& C) { // 시계방향이면 음수 
//	return 1LL * (B.x - A.x)*(C.y - A.y) - 1LL * (B.y - A.y)*(C.x - A.x);
//}

int main() { // 골드 1, 플레 1, 네트워크 유량(디닉 알고리즘), 

	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	string a, b; cin >> a >> b;
	int ans = 0;
	rep(i, 3) {
		if (a[i] == b[i]) {
			ans += 1;
		}
	}
	cout << ans << '\n';









}


Measured memory_bytes: 256
t1, t2 = map(int, input().split())
a1, a2 = map(int, input().split())
b1, b2 = map(int, input().split())

ng = "infinity"

first = t1 * a1 - t1 * b1
second = t1 * a1 + t2 * a2 - t1 * b1 - t2 * b2

if second == 0:
    print(ng)
    exit()

if first * second > 0:
    print(0)
    exit()

if first < 0:
    first *= -1
    second *= -1
second *= -1
ans = 2 * (first // second) + 1
if first % second == 0:ans -=1
print(ans)

Measured memory_bytes: 3188
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;

int main()
{
	int a,b,c;
	cin >> a >> b >> c;

	if(a == 1 && b == 0 && c == 0) cout << "Close" << endl;
	else if(a == 0 && b == 1 && c == 0) cout << "Close" << endl;
	else if(a == 1 && b == 1 && c == 0) cout << "Open" << endl;
	else if(a == 0 && b == 0 && c == 1) cout << "Open" << endl;
	else if(a == 0 && b == 0 && c == 0) cout << "Close" << endl;

}

Measured memory_bytes: 1156
#include <bits/stdc++.h>
#include <vector>
#include <iostream>
#include<algorithm>
#include<string>
#include <map>
#include <queue>
#include <stack>
#include <set>

#define DIV 1000000007
using namespace std;
using ll = long long;

typedef struct {
    vector<pair<int,ll>> edge;
    int visit;
    ll dis=LLONG_MAX;
}node_t;
vector<node_t> node;

priority_queue<pair<ll,int>, vector<pair<ll,int>>, greater<pair<ll,int>>> q;
void kyori() {
    pair<ll,int> x = q.top();
    q.pop();

    node[x.second].visit = 1;
    for (auto ed : node[x.second].edge) {
        if (node[ed.first].visit) continue;
        if (node[ed.first].dis > node[x.second].dis + ed.second) {
            node[ed.first].dis = node[x.second].dis + ed.second;
            q.emplace(node[ed.first].dis,ed.first);
        }
    }

    if (!q.empty())
        kyori();
}

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

    node = vector<node_t>(N + 1);
    for (int i = 0; i < N - 1; i++) {
        int a, b, c;
        cin >> a >> b >> c;
        node[a].edge.push_back(make_pair(b, c));
        node[b].edge.push_back(make_pair(a, c));
    }

    int Q, K;
    cin >> Q >> K;

    node[K].dis = 0;
    q.push(make_pair(0, K));
    
    kyori();
    /*
    for (int i = 1; i <= N; i++)
        printf("node[%d].dis=%lld\n", i, node[i].dis);
    */
    for (int i = 0; i < Q; i++) {
        int x, y;
        cin >> x >> y;
        cout << node[x].dis + node[y].dis << endl;
    }

}

Measured memory_bytes: 14040
N,A,B = map(int,input().split())
S = input()
L = []
cur = 0
for i in range(N):
  if S[i] == 'a':
    if cur < A+B:
      print('Yes')
      cur += 1
    else:
      print('No')
  elif S[i] == 'b':
    if cur < A+B:
      if len(L) < B:
        print('Yes')
        L.append(S[i])
        cur += 1
      else:
        print('No')
    else:
      print('No')
  else:
    print('No')      

Measured memory_bytes: 4528
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.PriorityQueue;
import java.util.StringTokenizer;

public class Main {

    static BufferedReader in;
    static PrintWriter out;
    static StringTokenizer tok;

    void solve() throws IOException {
        int N = ni();
        int A = ni();
        int B = ni();
        String S = ns();

        int all = 0;
        int oversea = 0;

        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == 'a' && all < A + B) {
                all++;
                out.println("Yes");
            } else if (S.charAt(i) == 'b' && all < A + B && oversea < B) {
                all++;
                oversea++;
                out.println("Yes");
            } else {
                out.println("No");
            }
        }
    }

    String ns() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine(), " ");
        }
        return tok.nextToken();
    }

    int ni() throws IOException {
        return Integer.parseInt(ns());
    }

    long nl() throws IOException {
        return Long.parseLong(ns());
    }

    double nd() throws IOException {
        return Double.parseDouble(ns());
    }

    String[] nsa(int n) throws IOException {
        String[] res = new String[n];
        for (int i = 0; i < n; i++) {
            res[i] = ns();
        }
        return res;
    }

    int[] nia(int n) throws IOException {
        int[] res = new int[n];
        for (int i = 0; i < n; i++) {
            res[i] = ni();
        }
        return res;
    }

    long[] nla(int n) throws IOException {
        long[] res = new long[n];
        for (int i = 0; i < n; i++) {
            res[i] = nl();
        }
        return res;
    }

    public static void main(String[] args) throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        tok = new StringTokenizer("");
        Main main = new Main();
        main.solve();
        out.close();
    }
}

Measured memory_bytes: 12188
#include <stdio.h>
int main(void)
{
    int a,b,x,y,tmp,amari,lcm;
    
    while(scanf("%d %d",&a,&b)!=EOF)
    {
        x=a; y=b;
        if(x==0 && y==0) break;
        else
        {
            if(x<y) {tmp=x; x=y; y=tmp;}
            while(1)
            {
                if(y==0) break;
                else
                {
                amari=x%y;
                x=amari;
                tmp=x; x=y; y=tmp;
                }
            }
            lcm=a/x*b;
            printf("%d %d\n",x,lcm);
        }
    }
    return 0;
}


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

#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define rept(i,n) for(int (i)=0;(i)<=(int)(n);(i)++)
#define reps(i,s,n) for(int (i)=(s);(i)<(int)(n);(i)++)
#define repst(i,s,n) for(int (i)=(s);(i)<=(int)(n);(i)++)
#define repr(i,n) for(int (i)=(n);(i)>=0;(i)--)
#define each(itr,v) for(auto (itr):(v))
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define mp(x,y) make_pair((x),(y))
#define fi first
#define se second
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define ln "\n"
#define show(x) cout << #x << " = " << x ln
#define dbg(x) cout<<#x"="<<x ln

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vector<int> > mat;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

const int inf = (int)1e9;
const ll linf = (ll)1e18;
const int mod = (int)(1e9+7);
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};

struct oreno_initializer {
	oreno_initializer() {
		cin.tie(0);
		ios::sync_with_stdio(0);
	}
} oreno_initializer;

// ━━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…
// .｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋
// ・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・

int n;
int p[1111];

int main() {
	cin >> n;
	if (n==1) {
		cout << 1 << ln;
		return 0;
	}
	
	repst(i,2,n) {
		int t = i;
		repst(j,2,sqrt(i)) {
			while (t%j == 0) {
				p[j]++;
				t /= j;
			}
		}
		if (t!=1) p[t]++;
	}
	ll ans = 1;
	repst(i,2,n) ans = ans*(p[i]+1)%mod;
	cout << ans <<ln;
}

Measured memory_bytes: 256
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
 
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
 
using namespace std;
using namespace __gnu_pbds;
 
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;
 
template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;
 
#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,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
 
#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()
 
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
const int MOD = 1000000007;
const ll INF = 1e18;
const int MX = 100001; //check the limits, dummy

const int LOG_A = 60;
ll basis[LOG_A];

ll shifts[60];

void insertVector(ll mask) {
	for (int i = LOG_A - 1; i >= 0; i--) {
		if ((mask & shifts[i]) == 0) continue;

		if (!basis[i]) {
			basis[i] = mask;
			return;
		}

		mask ^= basis[i];
	}
}
 
int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);    
	
	int N; cin >> N;
	
	ll data[N];
	shifts[0] = 1;
	FOR(i, 1, 60) shifts[i] = shifts[i-1]*2;
	ll totalXor = 0;
	F0R(i, N) {
		cin >> data[i];
		//insertVector(data[i]);
		totalXor ^= data[i];
	}
	ll z = 0;
	F0R(i, 60) {
		if (totalXor & shifts[i]) {
            z += shifts[i];
			F0R(j, N) {
				if (data[j] & shifts[i]) data[j] -= shifts[i];
			}
		}
	}
	
	F0R(i, N) insertVector(data[i]);
	
	ll ans = 0;
	
	F0Rd(i, 60) {
		if (!basis[i]) continue;
		if (ans & shifts[i]) continue;
		ans ^= basis[i];
	}
	
	cout << (2 * ans + z) << endl;
	//cout << ans << endl;
	
	return 0;
}
 
// read the question correctly (ll vs int)
// template by bqi343


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
int main()
{
    int a,b,c,ans=0;
    cin >> a >> b;
    c = b-a;
    for(int i=1;i<c;i++){
    	ans+=i;
    }
    cout << ans-a << endl;
	return 0;
}



Measured memory_bytes: 256
N,M,C=gets.split(" ").map &:to_i
bs = gets.split(" ").map &:to_i
ans = 0
N.times do |n|
  as = gets.split(" ").map &:to_i
  tmp = C
  M.times do |i| 
    tmp += as[i]*bs[i]
  end
  ans += 1 if tmp > 0
end

puts ans

Measured memory_bytes: 3836
#include<cmath>
#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<utility>
#include<map>
#include<set>
#include<queue>
#include<functional>
#define INF 1e16
#define N (998244353)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll,P> Q;





int main(void){
    int h,w;
    cin>>w>>h;
    priority_queue<ll,vector<ll>,greater<ll>>p,q;
    for(int i=0;i<w;i++){
        ll x;
        cin>>x;
        q.push(x);
    }
    for(int i=0;i<h;i++){
        ll x;
        cin>>x;
        p.push(x);
    }
    ll ans = 0;
    ll tate = 0,yoko = 0;
    while((!p.empty())&&(!q.empty())){
        ll pprev = p.top();
        ll qprev = q.top();
        if(pprev>=qprev){
            ans+=qprev*(h+1-tate);
            yoko++;
            q.pop();
        }
        else{
            ans+=pprev*(w+1-yoko);
            tate++;
            p.pop();
        }
        //cout<<ans<<endl;
    }
    if(q.empty()&&p.empty())cout<<ans<<endl;
    else{
        if(q.empty()){
            while(!p.empty()){
                ans+=p.top();
                p.pop();
            }
            cout<<ans<<endl;
        }
        else{
            while(!q.empty()){
                ans+=q.top();
                q.pop();
            }
            cout<<ans<<endl;
        }
    }
    return 0;
}

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


map< ll, int > prime_factor(ll n) {
  map< ll, int > ret;
  for(ll i = 2; i * i <= n; i++) {
    while(n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if(n != 1) ret[n] = 1;
  return ret;
}


int main() {
  ll n;
  cin >> n;
  int count=0;
  for(auto p : prime_factor(n)) {
    int k=1;
    while(p.second>=k){
      p.second -=k;
      k+=1;
      //cout << p.second << ' ' << k << endl;
      count +=1;
    }
  }
  cout << count << endl;
}


Measured memory_bytes: 3632
using System;

namespace ConsoleApp3
{
	class Program
	{
		static void Main(string[] args)
		{
			var input = Console.ReadLine().Split(' ');
			long l = long.Parse(input[0]);
			long r = long.Parse(input[1]);
			r = Math.Min(r, l + 2019);

			long minMod = 2018;
			for (long i = l; i < r; i++)
			{
				for (long j = i + 1; j <= r; j++)
				{
					long mod = (i * j) % 2019;
					minMod = Math.Min(minMod, mod);
					if (minMod == 0)
					{
						break;
					}
				}
			}
			Console.WriteLine(minMod);
		}
	}
}


Measured memory_bytes: 13140
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lf long double
#define pb push_back
#define mp make_pair
#define F first
#define S second
typedef pair <ll,ll> ii;
typedef vector <ll> vi;
typedef vector <ii> vii;
typedef vector <bool> vb;
typedef vector <vector <ll> > vv;
typedef vector <string> vs;
typedef vector <lf> vf;
#define mod 1000000007
#define inf 999999999999999ll
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll a,b;
    cin>>a>>b;
    cout<<max(0ll,a-2*b)<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define IFOR(i,a,b) for(int i=(b-1);i>=(a);--i)
#define RPT(i,a,b) for(int i=(a);i<((a)+(b));++i)
#define IRPT(i,a,b) for(int i=((a)+(b)-1);i>=(a);--i)
void solve(){
  int n, m; cin >> n >> m;
  int ans = n * (n-1)/2 + m*(m-1)/2;
  cout << ans;
}
int main(void){
  solve();
  return 0;
}

Measured memory_bytes: 256
###2分探索

import sys

N,K = map(int,input().split())

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

p = 0###無理（そこまで小さくできない）
q = max(A)###可能

if K == 0:
    print(q)
    sys.exit(0)

while q-p > 1:
    r = (p+q)//2
    count = 0
    for i in range(N):
        if A[i]/r == A[i]//r:
            count += A[i]//r - 1
        else:
            count += A[i]//r
    if count > K:
        p = r
    else:
        q = r
    #print(p,q)

print(q)

Measured memory_bytes: 94028
#include <cstdio>
#define V_MAX 10000+1
#define N_MAX 2000000+1

void countingSort(int n, int A[]) {
	int B[N_MAX], C[V_MAX] = {0};
	for (int i = 1; i <= n; i++) C[A[i]]++;
	for (int i = 1; i < V_MAX; i++) C[i] = C[i - 1] + C[i];
	for (int i = n; i > 0; i--) {
		B[C[A[i]]] = A[i];
		C[A[i]]--;
	}
	for (int i = 1; i <= n; i++) A[i] = B[i];
}

int main() {
	int n, A[N_MAX];

	scanf("%d", &n);
	for (int i = 1; i <= n; i++) {
		scanf("%d", &A[i]);
	}

	countingSort(n, A);
	for (int i = 1; i <= n; i++) {
		if (i != n) printf("%d ", A[i]);
		else printf("%d\n", A[i]);
	}

	return 0;
}


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

int main(){
  long long x,y;
  cin >> x >> y;
  
  int signx, signy;
  signx = x==0 ? 0 : x/abs(x);
  signy = y==0 ? 0 : y/abs(y);
  
  cout << abs(abs(x) - abs(y)) + (signx == signy) * (x > y) * 2 + (signx*signy != 0) * (signx != signy) + (signy == 0) * (signx > 0) + (signy<0) * (signx == 0) << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
	int a,b,c;
	cin>>a>>b>>c;
	if(a+b==c||b+c==a||a+c==b){
		cout<<"Yes"<<endl;
	}else{
		cout<<"No"<<endl;
	}
	return 0;
} 

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(void){
    double x,y;
    int s;
    while (cin>>x>>y>>s) {
        if (x==0&&y==0&&s==0) {
            break;
        }
        double ans=0;
        for (int i=1;i<s;i++) {
            for (int j=i;j<s;j++) {
                if ( floor(double(i)*(100+x)/100)+floor(double(j)*(100+x)/100)==s ) {
                    //cout<<floor(double(i)*(100+x)/100)<<" "<<floor(double(j)*(100+x)/100)<<endl;
                    ans=max(ans,floor(double(i)*(100+y)/100)+floor(double(j)*(100+y)/100));
                    //cout<<floor(double(i)*(100+y)/100)<<" "<<floor(double(j)*(100+y)/100)<<endl;
                    //cout<<endl;
                }
            }
        }
        cout<<ans<<endl;
    }
}


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

typedef long long LL;
typedef unsigned long long uLL;

#define SZ(x) ((int)x.size())
#define ALL(x) (x).begin(), (x).end()
#define MP(x, y) std::make_pair(x, y)
#define DE(x) cerr << x << endl;
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define GO cerr << "GO" << endl;

using namespace std;

inline void proc_status()
{
	ifstream t("/proc/self/status");
	cerr << string(istreambuf_iterator<char>(t), istreambuf_iterator<char>()) << endl;
}
inline int read() 
{
    register int x = 0; register int f = 1; register char c;
    while (!isdigit(c = getchar())) if (c == '-') f = -1;
    while (x = (x << 1) + (x << 3) + (c xor 48), isdigit(c = getchar()));
    return x * f;
}
template<class T> inline void write(T x) 
{
    static char stk[30]; static int top = 0;
    if (x < 0) { x = -x, putchar('-'); }
    while (stk[++top] = x % 10 xor 48, x /= 10, x);
    while (putchar(stk[top--]), top);
}
template<typename T> inline bool chkmin(T &a, T b) { return a > b ? a = b, 1 : 0; }
template<typename T> inline bool chkmax(T &a, T b) { return a < b ? a = b, 1 : 0; }

const int maxN = 1000;
const int mod = 1e9 + 7;

void pls(int &x, int y)
{
	x += y;
	if (x >= mod) x -= mod;
	if (x < 0) x += mod;
}

int n, K, to[maxN], sum[maxN];
int dp[maxN][maxN], g[maxN];

int main() 
{ 
	cin >> n >> K;
	for (int i = 1; i <= K; ++i)
	{
		int u, v;
		cin >> u >> v;
		to[u] = v;
		to[v] = u;
		sum[u]++;
		sum[v]++;
	}
	n <<= 1;
	for (int i = 1; i <= n; ++i)
		sum[i] += sum[i - 1];
	g[0] = 1;
	for (int i = 2; i <= n; i += 2) 
		g[i] = 1ll * (i - 1) * g[i - 2] % mod;
	for (int i = 1; i <= n; ++i)
	{
		for (int j = i + 1; j <= n; j += 2)
		{
			bool flag = 0;
			for (int k = i; k <= j; ++k)
				if (to[k] and (to[k] < i || to[k] > j))
				{
					flag = 1;
					break;
				}
			if (flag)
				continue;
			dp[i][j] = g[j - i + 1 - sum[j] + sum[i - 1]];
			for (int l = i + 1; l < j; l += 2)
				pls(dp[i][j], -1ll * dp[i][l] * g[j - l- sum[j] + sum[l]] % mod);
		}
	}
	K <<= 1;
	int ans(0);
	for (int i = 1; i <= n; ++i)
		for (int j = i + 1; j <= n; j += 2)
			pls(ans, 1ll * dp[i][j] * g[n - (j - i + 1) - (K - (sum[j] - sum[i - 1]))] % mod);
	cout << ans << endl;
    return 0;
}


Measured memory_bytes: 2560
from numpy import zeros
s = list(map(int, list(input())))
ans1 = 0
ans2 = 0
sam1 = zeros(len(s))
sam2 = zeros(len(s))
for i in range(len(s)):
    if i%2: sam1[i] = 1
    else: sam2[i] = 1
for i in range(len(s)):
    if s[i] != sam1[i]: ans1 += 1
    elif s[i] != sam2[i]: ans2 += 1
print(min(ans1, ans2))

Measured memory_bytes: 21648
N,L = map(int,input().split())
import math
T = []
for i in range(N):
  T.append(L+i)
cnt = 0
mcnt = sum(T)
k = 1000000
for i in range(0,N):
  if abs(T[i])<k:
    mcnt = sum(T)-T[i]
    cnt = i+1
    k=abs(T[i])
print(mcnt)


Measured memory_bytes: 3060
#include <cstdio>
#include <algorithm>

using std::max;

const int MAXN=105;
int a[3][MAXN],suf[3][MAXN];

int main(){
	int n;
	scanf("%d",&n);
	for(int i=1;i<=n;++i)
		scanf("%d",&a[1][i]);
	for(int i=1;i<=n;++i)
		scanf("%d",&a[2][i]);
	for(int i=n;i;--i){
		suf[1][i]=suf[1][i+1]+a[1][i];
		suf[2][i]=suf[2][i+1]+a[2][i];
	}
	int ans=0;
	for(int i=1,tmp=0;i<=n;++i){
		tmp+=a[1][i];
		ans=max(ans,tmp+suf[2][i]);
	}
	printf("%d",ans);
	return 0;
	/*int cur=1;
	for(int i=2;i<=n;++i){
		if(suf[1][i]<suf[2][i]){
			cur=i-1;
			break;
		}
	}
	int ans=0;
	for(int i=1;i<=cur;++i)
		ans+=a[1][i];
	printf("%d",ans+suf[2][cur]);*/
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
#define ls(x) (x)<<1
#define rs(x) (x)<<1|1
#define fu(i,r,t) for(int i=r;i<=t;i++)
#define fd(i,r,t) for(int i=r;i>=t;i--)
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define endl '\n'
#define lcm(a,b) (a*b)/__gcd(a,b)
#define Case(i,ans) cout<<"Case "<<i<<": "<<ans<<endl;
#define cp(i,ans) printf("%.if",ans);
#define cpp(i,ans) cout<<setprecision(i)<<fixed<<ans<<endl;
#define pb(x) push_back(x)
#define pf(x) push_front(x)
#define pque priority_queue
#define mset multiset
#define lowbit(x) (x)&(-x)
#define out(x) {cout<<x<<endl;return 0;}
#define all(V) V.begin(),V.end()
#define mod(x) (x)%mo_num
using namespace std;
const int INF=1e17+5;
const int maxn=1e5+5;
const int mo_num=1e9+7;
int n,m,a[maxn],b[maxn],ans,sum;

int32_t main()
{
    IOS
    cin>>n;
    int x;
    cin>>ans;
    fu(i,2,n){
        cin>>x;
        ans^=x;
    }
    if(!ans)cout<<"Yes";
    else cout<<"No";
    return 0;
}

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

int main() {
	int n; cin >> n;
	vector<int>A(n),b(n); for (auto&& x : A)cin >> x;
	for (int i = 0; i < n; i++) {
		b[i] = A[i] - i + 1;
	}
	sort(b.begin(), b.end());
	int bMed = b.size() % 2 == 0 ? (b[b.size() / 2] + b[b.size() / 2 - 1]) / 2 : b[b.size() / 2];
	long long ans = 0; for (auto&& x : b)ans += abs(x - bMed);
	cout << ans << endl;
		
	return 0;
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
// make pair, tuple
// __gcd(int, int)
// bool isPrime(int n){
//       if(n <= 1)return false;
//       if(n <= 3)return true;
//       if(n % 2 == 0 || n % 3 == 0)return false;
//       for(int i = 5;i * i <= n;i += 6){
//             if(n % i == 0 || n % (i + 2) == 0)return false;
//       }
//       return true;
// }
// int countSubString(string s, string temp){
//       int ans = 0;
//       size_t f = s.find(temp);
//       while(f != string::npos){
//             ans++;
//             f = s.find(temp, f + 1);
//       }
//       return ans;
// }

int main(){
    int h,n;cin >> h >> n;
    for(int i = 0;i < n;i++){
        int t;cin >> t;
        h -= t;
    }
    if(h <= 0)cout << "Yes";
    else cout << "No";
}

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

#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
#define ALL(a) (a).begin(),(a).end()
#define Yes(hoge) cout<<((hoge)?"Yes":"No")<<endl;
#define YES(hoge) cout<<((hoge)?"YES":"NO")<<endl;
struct Grid{
  int x,y,t;
};


using namespace std;

const int MAX_N = 2220;
int row,col;
ll rui[MAX_N][MAX_N];
ll ele[MAX_N][MAX_N];
void make_sum(int r,int l){
  row=r;col=l;
  for(int i=1;i<=row+1;i++)
    for(int j=1;j<=col+1;j++)
      rui[i][j] = ele[i][j] + rui[i-1][j] + rui[i][j-1] - rui[i-1][j-1];
}

ll ret_sum(int lx,int ly,int rx,int ry){//閉区間
  if(lx>rx||ly>ry)return 0;
  else return rui[rx][ry] - rui[lx-1][ry] - rui[rx][ly-1] + rui[lx-1][ly-1]; 
}

int main(){
  int n,k;cin>>n>>k;
  for(int i=0;i<n;i++){
    int a,b;char c;
    cin>>a>>b>>c;
    if(c=='W')
      b+=k;
    a%=(2*k);
    b%=(2*k);
    ele[a+1][b+1]++;
  }
  ll ans=-1;
  make_sum(2*k,2*k);
  for(int i=1;i<=k;i++){
    for(int j=1;j<=k;j++){
      ll num = ret_sum(i,j,i+k-1,j+k-1)+ret_sum(i+k,j+k,2*k,2*k)+
	ret_sum(1,1,i-1,j-1)+ret_sum(i+k,1,2*k,j-1)+ret_sum(1,j+k,i-1,2*k);
      ans=max(ans,max(n-num,num));
    }
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 71936
#include <iostream>
#include<queue>
#include<stack>
#include<vector>
#include<set>
#include<map>
#include<algorithm>
#include<cstring>
#include<string>
#include<cassert>
#include<cmath>
#include<climits>
#include<iomanip>
#include<bitset>
#include<unordered_map>

using namespace std;

#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define rep(i,j,n) for(ll (i)=(j);(i)<(n);(i)++)
#define FOR(i,c) for(decltype((c).begin())i=(c).begin();i!=(c).end();++i)
#define ll long long
#define ull unsigned long long
#define all(hoge) (hoge).begin(),(hoge).end()
typedef pair<ll, ll> P;
const long long INF = 1LL << 60;
const long long MOD = 1e9 + 7;
typedef vector<ll> Array;
typedef vector<Array> Matrix;


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;
}

//グラフ関連
struct Edge {//グラフ
	ll to, cap, rev;
	Edge(ll _to, ll _cap, ll _rev) {
		to = _to; cap = _cap; rev = _rev;
	}
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;

void add_edge(Graph& G, ll from, ll to, ll cap, bool revFlag, ll revCap) {
	G[from].push_back(Edge(to, cap, (ll)G[to].size()));
	if (revFlag)G[to].push_back(Edge(from, revCap, (ll)G[from].size() - 1));
}

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

	ll r;
	cin >> r;

	cout << r * r << endl;


	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <set>
#include <vector>
#include <string>
#include <algorithm>
#include <iterator>

using namespace std;

#define rep(i, n) for(int i = 0; i < n; i++)
#define repi(i, n) for(auto i = (n).begin(); i != (n).end(); i++)
#define in_arr(type, a, n) copy_n(istream_iterator<type>(cin), n, (a).begin());

using ll = long long int;

ll gcd(ll a, ll b) {
    return b == 0 ? a : gcd(b, a % b);
}

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

int main(){
    int n, d;
    cin >> n >> d;
    int e = 2 * d + 1;
    if(n % e == 0) {
        cout << n / e << endl;
    } else {
        cout << n / e + 1 << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>

#define JPY_per_BTC   380000.0
#define indicator_BTC "BTC"
#define indicator_JPY "JPY"

int main (void)
{
	/* variables for main process */
	
	double      buf_val;
	double      val_total_JPY;
	int         num_relatives;
	std::string buf_str;


	// STEP.01
	// read out the number of relatives
	std::cin >> num_relatives;

	// STEP.02
	// initialize the variables to use
	val_total_JPY = (double)0.0;

	// STEP.03
	// calculate the total value [JPY]
	for(int itr = 0; itr < num_relatives; itr++)
	{
		// STEP.03.01
		// read out the written data
		std::cin >> buf_val >> buf_str;

		// STEP.03.02
		// calculate the total value
		if( buf_str == indicator_BTC ) val_total_JPY += buf_val * JPY_per_BTC;
		if( buf_str == indicator_JPY ) val_total_JPY += buf_val;
	}
	
	// STEP.04
	// output the result
	std::cout << val_total_JPY << std::endl;

	// STEP.END
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define LIMIT 1000000007 //10^9+7
#define rep(i, n) for(int i=0; i<(int)n; i++)
#define all(v) (v).begin(), (v).end()

int main(){
	int N;cin>>N;
  int maxH = 0;
  int cnt = 0;
  rep(i,N){
    int h;cin>>h;
    if(h >= maxH){
      cnt++;
      maxH = h;
    }
  }
  cout<<cnt<<endl;
}

Measured memory_bytes: 3580