akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
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 ll mod = 1000000007;
ll beki(ll a, ll b) {
    if(b == 0) return 1;
    ll ret = beki(a, b / 2);
    ret = ret * ret % mod;
    if(b & 1) ret = ret * a % mod;
    return ret;
}

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
string S;
ll A[105000], AB[105000], ABC[105000];
ll question;

int main() {
    cin >> S;
    S = "#" + S;
    for(int i = 1; i < S.size(); i++) {
        if(S[i] == 'C') {
            ABC[i] = (ABC[i-1] + AB[i-1]) % mod;
            AB[i] = AB[i-1];
            A[i] = A[i-1];
            continue;
        }
        if(S[i] == 'B') {
            ABC[i] = (ABC[i-1]) % mod;
            AB[i] = (AB[i-1] + A[i-1]) % mod;
            A[i] = A[i-1];
            continue;
        }
        if(S[i] == 'A') {
            ABC[i] = (ABC[i-1]) % mod;
            AB[i] = AB[i-1];
            A[i] = (A[i-1] + 1) % mod;
            continue;
        }
        if(S[i] == '?') {
            ABC[i] = (ABC[i-1] + AB[i-1] * beki(3, mod - 2)) % mod;
            AB[i] = (AB[i-1] + A[i-1] * beki(3, mod - 2)) % mod;
            A[i] = (A[i-1] + beki(3, mod - 2)) % mod;
            question++;
        }
    }
    cout << ABC[S.size() - 1] * beki(3, question) % mod << endl;
    return 0;
}


Measured memory_bytes: 2940
#include <stdio.h>

int main(void)
{
  int n, v[n], c[n], i, ans=0;

  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&v[i]);
  }
  for(i=0;i<n;i++){
    scanf("%d",&c[i]);
  }

  for(i=0;i<n;i++){
    if(v[i]>c[i]){
      ans = ans + (v[i]-c[i]);
    }
  }

  printf("%d",ans);

  return 0;
}


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

using namespace std;
using ll = long long;
using ii = pair<int, int>;

const int MAX { 200010 };
const ll MOD { 1000000007 }, oo { 1LL << 62 };

double solve(int N, const vector<ii>& xs)
{
    vector<int> is(N);
    iota(is.begin(), is.end(), 0);

    int total = 0;
    double sum = 0.0;

    do {
        ++total;
        auto area = 0.0;

        for (int i = 1; i < N; ++i)
            area += hypot(xs[is[i]].first - xs[is[i - 1]].first, xs[is[i]].second - xs[is[i - 1]].second);

        sum += area;
    } while (next_permutation(is.begin(), is.end()));

    return sum / total;
}

int main()
{
    ios::sync_with_stdio(false);

    int N;
    cin >> N;

    vector<ii> xs(N);

    for (int i = 0; i < N; ++i)
        cin >> xs[i].first >> xs[i].second;

    auto ans = solve(N, xs);

    cout << setprecision(15) << fixed << ans << '\n';

    return 0;
}


Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args){
		  Scanner sc = new Scanner(System.in);
		  String s = sc.nextLine();
		  int K = sc.nextInt();
		  sc.close();
		  
		  List<String> list = new ArrayList<>();
	
		  for(int i = 0; i < s.length(); i++) {
			  for(int j = 0; j < Math.min(K, s.length() - i); j++) {
				  if(!list.contains(s.substring(i, i + j + 1))) {
					  list.add(s.substring(i, i + j + 1));
				  }
			  }
		  }
		  
		  Collections.sort(list);
		  
		  System.out.println(list.get(K - 1));
	      System.exit(0);
	    }
}

Measured memory_bytes: 26948
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int N = stdIn.nextInt();
		int K = stdIn.nextInt();
		if(K == 1) {
			System.out.println(0);
		}
		else {
			System.out.println(N-K);
		}

	}

}

Measured memory_bytes: 21844
// clang-format off
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}
// clang-format on

template <int mod>
struct ModInt {
    int x;

    ModInt() : x(0) {}
    ModInt(int64_t y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}

    ModInt &operator+=(const ModInt &p) {
        if ((x += p.x) >= mod) x -= mod;
        return *this;
    }
    ModInt &operator-=(const ModInt &p) {
        if ((x += mod - p.x) >= mod) x -= mod;
        return *this;
    }
    ModInt &operator*=(const ModInt &p) {
        x = (int)(1LL * x * p.x % mod);
        return *this;
    }
    ModInt &operator/=(const ModInt &p) {
        *this *= p.inverse();
        return *this;
    }

    ModInt operator-() const { return ModInt(-x); }
    ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }
    ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }
    ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }
    ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }
    bool operator==(const ModInt &p) const { return x == p.x; }
    bool operator!=(const ModInt &p) const { return x != p.x; }

    ModInt inverse() const {
        int a = x, b = mod, u = 1, v = 0, t;
        while (b > 0) {
            t = a / b;
            swap(a -= t * b, b);
            swap(u -= t * v, v);
        }
        return ModInt(u);
    }

    ModInt pow(int64_t n) const {
        ModInt ret(1), mul(x);
        while (n > 0) {
            if (n & 1) ret *= mul;
            mul *= mul;
            n >>= 1;
        }
        return ret;
    }

    friend ostream &operator<<(ostream &os, const ModInt &p) {
        return os << p.x;
    }

    friend istream &operator>>(istream &is, ModInt &a) {
        int64_t t;
        is >> t;
        a = ModInt<mod>(t);
        return (is);
    }

    static int get_mod() { return mod; }
};

const int mod = 1e9 + 7;
using mint = ModInt<mod>;

const int N = 200002;
mint f[N];

mint C(int n, int r) { return f[n] * f[r].inverse() * f[n - r].inverse(); }

int main() {
    f[0] = 1;
    rep(i, N - 1) f[i + 1] = f[i] * (i + 1);

    int n, k;
    cin >> n >> k;

    mint ans = 0;
    rep(i, min(n - 1, k) + 1) ans += C(n - 1, i) * C(n, i);
    cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 4416
#include <iostream>
#include <stdio.h>
#include <string.h>

using namespace std;

int a[10][10],b[10][10],m[10][10];

void rev(int x,int y) {
	b[y][x]=1;
	if (x>0) a[y][x-1]=1-a[y][x-1];
	if (x<9) a[y][x+1]=1-a[y][x+1];
	if (y>0) a[y-1][x]=1-a[y-1][x];
	if (y<9) a[y+1][x]=1-a[y+1][x];
	a[y][x]=1-a[y][x];
}

int main() {
	int n,i,j,k;
	cin >> n;
	for (n;n>0;n--) {
		for (i=0;i<10;i++) for (j=0;j<10;j++) cin >> m[i][j];
		for (k=0;k<1024;k++) {
			memset(a,0,sizeof(a)); memset(b,0,sizeof(b));
			for (i=0,j=k;i<10;i++,j/=2)  if (j % 2==1) rev(i,0); 
			for (i=1;i<10;i++) for (j=0;j<10;j++) if (m[i-1][j]!=a[i-1][j]) rev(j,i);
			for (i=0;i<10;i++) if (m[9][i]!=a[9][i]) break;
			if (i==10) break; 
		}
		for (i=0;i<10;i++) {
			cout << b[i][0];
			for (j=1;j<10;j++) cout << ' ' << b[i][j];
			cout << endl;
		}
	}
	return 0;
}

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

using namespace std;

int N,A,B,C;

int kadomatsu(int a,int b,int c,int i,vector<int> &vec){
  if(i==N){
    if(a>0&&b>0&&c>0)
      return abs(A-a)+abs(B-b)+abs(C-c)-30;
    else
      return 10000000;
  }
  else{
    return(min(kadomatsu(a+vec.at(i),b,c,i+1,vec)+10,
               min(kadomatsu(a,b+vec.at(i),c,i+1,vec)+10,
                   min(kadomatsu(a,b,c+vec.at(i),i+1,vec)+10,
                       kadomatsu(a,b,c,i+1,vec)))));
 			
  }
}

int main(){
  
  cin>>N>>A>>B>>C;
  vector<int> vec(N);
  
  for(int i=0;i<N;i++)
    cin>>vec.at(i);
  
  cout<<kadomatsu(0,0,0,0,vec)<<endl;
}
  

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

long long calculate(long long base, long long num[], long long size) {
	long long sum = 0;
	long long cur = 0;
	for (long long i = 0; i < size; i++) {
		cur = cur * 10 + *(num++);
		sum += calculate(base+cur, num, size - i - 1);
	}
	if (sum == 0) {
		sum = base;
	}
	return sum;
}

int main() {
	string S;
	cin >> S;
	long long num[S.length()];
	for (long long i = 0; i < S.length(); i++) {
		num[i] = (int)(S.at(i) - '0');
	}
	cout << calculate(0, num, S.length()) << "\n";
}


Measured memory_bytes: 256
n = int(input())
H = [int(i) for i in input().split()]

H1 = [abs(H[i]-H[i-1]) for i in range(1,n)]
H2 = [abs(H[i]-H[i-2]) for i in range(2,n)]

D = [0]*n
D[1] = H1[0]

for i in range(2,n):
    D[i] = min(D[i-1] + H1[i-1], D[i-2] + H2[i-2])

print(D[-1])


Measured memory_bytes: 19132
#include<bits/stdc++.h>
#define ll long long
using namespace std;
void dfs(ll int u,ll int p,ll int c, vector<vector<ll int>>&adj, vector<ll int> &pcost, vector<ll int> &
cost,ll int n)
{
    cost[u] = pcost[u] + c;
    
    for(auto v:adj[u])
    {
        if(v == p)
            continue;
        dfs(v,u, cost[u], adj,pcost,cost,n);
    }
    return;
}
int main()
{
    ll int n,m,x,y;
    cin>>n>>m;
    vector<vector<ll int>> adj(n+1);
    for(ll int i=0; i<n-1; i++)
    {
        cin>>x>>y;
        adj[x].push_back(y);
        adj[y].push_back(x);
    }
    
    vector<ll int> pcost(n+1, 0);
    for(ll int i=0; i<m; i++)
    {
        cin>>x>>y;
        pcost[x] += y;
    }
    vector<ll int> cost(n+1,0);
    dfs(1LL,-1LL,0LL,adj,pcost,cost,n);
    
    for(ll int i=1; i<=n; i++)
        cout<<cost[i]<<" ";
}

Measured memory_bytes: 35200
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <cmath>
#include <climits>
#include <math.h>
#include <bitset>

#define X first
#define Y second
#define vsort(v) sort(v.begin(), v.end())
#define vrev(v) reverse(v.begin(), v.end())
#define vmax_p(v) max_element(v.begin(), v.end())
#define vmin_p(v) min_element(v.begin(), v.end())
#define vmax_idx(v) distance(v.begin(), vmax_p(v))
#define vmin_idx(v) distance(v.begin(), vmin_p(v))
#define vcopy(src, dst) copy(src.begin(), src.end(), back_inserter(dst))
#define P pair

// stoi(s): string to int
// stod(s): string to double

// INT_MAX
// INT_MIN
// LLONG_MAX
// LLONG_MIN
// DBL_MIN
// DBL_MAX
// LDBL_MIN
// LDBL_MAX

// A-Z: 65~90
// a-z: 97~122
// |a-z| = 26

// floor(x): truncate

// 2進数変換
// string s = bitset<20>(x).to_string();

using namespace std;
using ll = long long;

int main(int argc, const char *argv[])
{
    int n;
    cin >> n;
    vector<int> v(n), c(n);
    for (int i = 0; i < n; i++)
    {
        cin >> v[i];
    }
    for (int i = 0; i < n; i++)
    {
        cin >> c[i];
    }

    int sum = 0;
    for (int i = 0; i < n; i++)
    {
        if (v[i] - c[i] > 0)
        {
            sum += v[i] - c[i];
        }
    }
    cout << sum << endl;
}


Measured memory_bytes: 256
//666yuchen
#include<bits/stdc++.h>
using namespace std;
long long n,zs,dr;
int main()
{
  cin>>n;
  if(n%2==0)cout<<n<<" "<<n<<" "<<n/2;
  else if(n%3==0)cout<<n<<" "<<n/3*2<<" "<<n/3*2;
  else if((n-3)%4==0)cout<<(n+1)/4<<" "<<(n+1)*(n+1)/4<<" "<<(n+1)*(n+1)*n/4;
  else
  for(int i=1;i<=3500;i++)
    for(int j=1;j<=3500;j++)
    {
      zs=n*i*j;
      dr=4*i*j-n*i-n*j;
      if(dr>0&&zs%dr==0){cout<<i<<" "<<j<<" "<<zs/dr<<endl;return 0;}
    }
  cout<<endl;
  return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {

  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    char[] c = str.toCharArray();
    boolean ans = true;

    for (int i = 0 ; i < str.length() ; i++ ) {
      if (i%2 == 0 && c[i] == 'L' || i%2 == 1 && c[i] == 'R') {
          ans = false;
          break;
        }
      }




    if (ans) {
      System.out.println("Yes");
    } else {
    System.out.println("No");
    }
  }
}


Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define uli unsigned long long int
#define INF 999999999999999999
#define rep(i,m,n) for(lli i = m;i < n;i++)
#define rrep(i,m,n) for(lli i=m-1;i>=n;i--)
#define pb(n) push_back(n)
#define UE(N) N.erase(unique(N.begin(),N.end()),N.end());
#define Sort(n) sort(n.begin(), n.end())
#define Rev(n) reverse(n.begin(),n.end())
#define Out(S) cout << S << endl
#define NeOut(S) cout << S
#define HpOut(S) cout << setprecision(25) << S << endl
#define Vec(K,L,N,S) vector<L> K(N,S)
#define DV(K,L,N,M,S) vector<vector<L>> K(N,vector<L>(M,S))
#define TV(K,L,N,M,R,S) vector<vector<vector<L>>> K(N,vector<vector<L>>(M,vector<L>(R,S)))
#define pint pair<lli,lli>
#define paf(L,R) pair<L,R>
#define mod 1000000007
#define MAX 5100000
#define ALL(a)  a.begin(),a.end()
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  lli A,B,C,D,E,F,N,M,K,L,X,Y,Z,H,W,sum=0,num=0,flag=0;string S,T;
  cin >> N >> X >> Y;
  DV(G,lli,N,0,0);
  rep(i,0,N-1){
    G[i].pb(i+1);
    G[i+1].pb(i);
  }
  G[X-1].pb(Y-1);
  G[Y-1].pb(X-1);
  DV(dist,lli,N,N,-1);
  rep(i,0,N){
    dist[i][i]=0;
    queue<int> que;
    que.push(i);
    while(!que.empty()){
      auto v=que.front();que.pop();
      for(auto w:G[v]){
        if(dist[i][w]!=-1)continue;
        dist[i][w]=dist[i][v]+1;
        que.push(w);
      }
    }
  }
  map<int,int>ma;
  rep(i,0,N)rep(j,i+1,N){
    ma[min(dist[i][j],dist[j][i])]++;
  }
  rep(i,1,N)Out(ma[i]);
}

Measured memory_bytes: 31744
#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<deque>
#include<regex>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>

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

typedef int long long ll;
using namespace std;
typedef pair<int, int> P;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
const ll MOD = 1e9 + 7;
static const int MAX = 100;
static const int INF = (1 << 23);
ll dp[51][51][5000];
int main() {
    int n,a;
    cin>>n>>a;
    vector<int> x(n);
    rep(i,n){
        cin>>x[i];
    }
    dp[0][0][0]=1;
    for(int i=0;i<n;i++){
        for(int j=0;j<i+1;j++){
            for(int k=0;k<5001;k++){

                dp[i+1][j][k]+=dp[i][j][k];
                if(k-x[i]>=0){dp[i+1][j+1][k]+=dp[i][j][k-x[i]];}

            }

        }
    }
    ll ans=0;
    for(int i=1;i<=n;i++){
        ans+=dp[n][i][i*a];
    }
    cout<<ans<<endl;






    return 0;
}


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

int main() {
  int h, w;
  cin >> h >> w;
  vector<string> grid(h);
  vector<vector<int>> light_row_count(h, vector<int>(w, 0));
  vector<vector<int>> light_column_count(h, vector<int>(w, 0));
  rep(i, h){
    cin >> grid[i];
  }
  int ans = 0;
  rep(i, h){
    int cn = 0;
    rep(j, w){
      if(grid[i][j] == '#'){
        cn = 0;
        continue;
      }
      cn++;
      light_row_count[i][j] += cn;
    }
  }
  rep(i, h){
    for (int j = w - 1; j > 0; j--){
      if(grid[i][j] == '#')continue;
      if(grid[i][j - 1] == '.')light_row_count[i][j - 1] = light_row_count[i][j];  
    }
  }
  rep(i, w){
    int cn = 0;
    rep(j, h){
      if(grid[j][i] == '#'){
        cn = 0;
        continue;
      }
      cn++;
      light_column_count[j][i] += cn;
    }
  }
  rep(i, w){
    for (int j = h - 1; j > 0; j--){
      if(grid[j][i] == '#')continue;
      if(grid[j-1][i] == '.')light_column_count[j-1][i] = light_column_count[j][i];
    }
  }
  rep(i,h){
    rep(j,w){
      ans = max(light_row_count[i][j] + light_column_count[i][j]-1, ans);
    }
  }
  cout << ans << endl;
}

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

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

  int r;
  int maxv = 0;
  int minv = 0;

  for( int i = 0; i < n; i++ ) {
    cin >> r;

    if( i == 0 ) {
      minv = r;
      continue;
    }

    if( maxv < r - minv or maxv == 0 ) {
      maxv = r - minv;
    }
    if( minv > r ) {
      minv = r;
    }
  }

  cout << maxv << endl;

  return 0;
}



Measured memory_bytes: 3096
n = int(input())
a = [int(input()) for _ in range(n)]
tmpa = a[:] 
tmpa.sort()

for x in a:
  if x == tmpa[n-1]:
    print(tmpa[n-2])
  else:
    print(tmpa[n-1])
"""
if a[0] > a[1]:
  m,m2 = a[0],a[1]
else:
  m,m2 = a[1],a[0]

for x in a[2:]:
  if x > m2:
    if x>m:
      m2,m = 

"""
"""
for i in range(n):
  if i == 0:
    p
    rint(max(a[i+1:]))
    continue
  if i == n-1:
    print(max(a[0:n-1]))
    break
  ans = max(max(a[0:i]),max(a[i+1:n]))
  print(ans)
  """

Measured memory_bytes: 14108
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define gc getchar_unlocked()
#define pc(x) putchar_unlocked(x)
template<typename T> void scan(T &x){x = 0;bool _=0;T c=gc;_=c==45;c=_?gc:c;while(c<48||c>57)c=gc;for(;c<48||c>57;c=gc);for(;c>47&&c<58;c=gc)x=(x<<3)+(x<<1)+(c&15);x=_?-x:x;}
template<typename T> void printn(T n){bool _=0;_=n<0;n=_?-n:n;char snum[65];int i=0;do{snum[i++]=n%10+48;n/= 10;}while(n);--i;if (_)pc(45);while(i>=0)pc(snum[i--]);}
template<typename First, typename ... Ints> void scan(First &arg, Ints&... rest){scan(arg);scan(rest...);}
template<typename T> void print(T n){printn(n);pc(10);}
template<typename First, typename ... Ints> void print(First arg, Ints... rest){printn(arg);pc(32);print(rest...);}

using namespace std;


int main(){
    
    long long a,b;
    scan(a, b);
    a %= b;
    if(abs(a-b) < a){
        a = abs(a-b);
    }
    print(a);
    
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<long long> vll;
typedef pair<int,int> pint;
typedef pair<long long, long long> pll;

#define MP make_pair
#define PB push_back
#define ALL(s) (s).begin(),(s).end()
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P) 
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P) 
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P) 
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s; }


const int MAX = 100100;

long long n, m;
int h;

long long ix[MAX], x[MAX], iy[MAX], y[MAX];

int main() {
    while (cin >> n >> m >> h) {
        for (int i = 0; i < h; ++i) {
            cin >> ix[i] >> iy[i];
            x[i] = ix[i], y[i] = iy[i];
        }
        sort(x, x+h);
        sort(y, y+h);
        
        long long vrx[3] = {x[h/2-1], x[h/2], x[h/2+1]};
        long long vry[3] = {y[h/2-1], y[h/2], y[h/2+1]};
        
        long long res = 1LL<<61;
        int arx = -1, ary = -1;
        for (int t1 = 0; t1 < 3; ++t1) {
            for (int t2 = 0; t2 < 3; ++t2) {
                long long rx = vrx[t1], ry = vry[t2]; 
                long long tmp = 0;
                vector<long long> vec(h);
                for (int i = 0; i < h; ++i) {
                    vec[i] = abs(ix[i] - rx) + abs(iy[i] - ry);
                    tmp += vec[i];
                }
                long long Max = -1;
                for (int i = 0; i < h; ++i) chmax(Max, vec[i]);
        
                tmp *= 2;
                tmp -= Max;
                
                if (chmin(res, tmp)) {
                    arx = rx, ary = ry;
                }
            }
        }
        
        cout << res << endl;
        cout << arx << " " << ary << endl;
    }
    return 0;
}


Measured memory_bytes: 5136
#include <bits/stdc++.h>
#define FOR(i, a, n) for(ll i = (ll)a; i < (ll)n; i++)
#define FORR(i, n) for(ll i = (ll)n - 1LL; i >= 0LL; i--)
#define rep(i, n) FOR(i, 0, n)
#define ALL(x) begin(x), end(x)
using namespace std;
using ll = long long;
constexpr ll Mod = 998244353;
constexpr ll mod = 1e9 + 7;
constexpr ll inf = 1LL << 60;
const double PI = acos(-1);
template <typename T1, typename T2> inline bool chmax(T1 &a, T2 b) {
    return a < b && (a = b, true);
}
template <typename T1, typename T2> inline bool chmin(T1 &a, T2 b) {
    return a > b && (a = b, true);
}
/*-------------------------------------------*/

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

    int x;
    cin >> x;
    cout << (2199 - x) / 200 << endl;

    return 0;
}

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

using namespace std;


/// Bismilahir Rahmanir Rahim


typedef unsigned int ui;
typedef long long int lli;
typedef unsigned long long int ulli;
typedef short int si;
typedef unsigned short int usi;
typedef double dd;
typedef pair <int, int> pii;


#define CASE false
#define TEST false
#define BUFFER false
#define TIME false
#define DEBUG true
#define SET_GEN false
#define _ << " " <<
#define __ << "\n"
#define ff first
#define ss second
#define RANGE(a, b) (rand() % (b-a+1) + a)


const double pi = acos(-1.);
const double eps = 1e-7;
const int inf = 2147483647;
const int _inf = -2147483648;
const int mod = 1e9+7;


void delay(int sec); // DEBUG


void max_self(ulli &a, ulli b)
{
    a = max(a, b);

    return ;
}

void solution(void)
{
    int n, w;

    cin >> n >> w;

    vector <ulli> ks(w+1);

    for(int i = 0; i < n; ++i) {
        int val, weight;

        cin >> weight >> val;
        for(int weight_already = w-weight; weight_already >= 0; --weight_already) {
            max_self(ks[weight_already+weight], ks[weight_already]+val);
        }
    }
    ulli ans = 0;

    for(int i = 0; i <= w; ++i) {
        max_self(ans, ks[i]);
    }

    cout << ans << "\n";

    //ks.clear();



    return ;
}

int main(int argc, char *arv[])
{
    #if BUFFER
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    #endif

    #if SET_GEN
    srand((unsigned int) time(0));
    #endif


    unsigned short int t = 1;

    #if CASE
    int cnt = 1;
    #endif

    #if TEST
    cin >> t;
    #endif

    #if TIME
    clock_t start_time, end_time;
    double time_elapsed;
    #endif


    while(t--) {

        #if TIME
        start_time = clock();
        #endif

        #if CASE
        cout << "Case " << cnt++ << ": ";
        #endif

        solution();

        #if TIME
        end_time = clock();

        time_elapsed = (double) (end_time - start_time) / CLOCKS_PER_SEC;

        cout << "\nRuntime: " << fixed << setprecision(7) << time_elapsed << "\n";
        #endif
    }


    return 0;
}

void delay(int sec)
{
    int mili_sec = 1000 * sec;

    clock_t start_time = clock();

    while (clock() < start_time + mili_sec);

    return ;
}


Measured memory_bytes: 1024
N, M = map(int, input().split())
wacou = [0]*N
acchc = [0]*N
for i in range(M):
  p, s = input().split()
  p = int(p)
  if s=='WA' and acchc[p-1]<1:
    wacou[p-1] += 1
  elif s=='AC' and acchc[p-1]<1:
    acchc[p-1] = 1
  else:
    continue
print(acchc.count(1), sum([x*y for x, y in zip(acchc, wacou)]))

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

int main() {
  ll N, K;
  cin >> N >> K;
  
  ll J = N + 1 - K;
  ll ans = (N+1)*J*(J+1)/2 - J*(J+1)*(2*J+1)/6 + (J+1);
  ans %= 1000000007;
  
  cout << ans << endl;
}

Measured memory_bytes: 3652
n,k = map(int,input().split())
p = list(map(int,input().split()))

for i in range(n):
    p[i] += 1

ans = []

a = [0] * (n + 1)
for i in range(n):
    a[i+1] = p[i] + a[i]

t = 0
for i in range(k,n+1):
    t = max(t, a[i] - a[i-k])

print(t/2)


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

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

#define X real()
#define Y imag()

using D = double;
using P = complex<D>;

const D EPS = 1e-10;
namespace std {
  bool operator < (const P& a, const P& b) {
    return a.X != b.X ? a.X < b.X : a.Y < b.Y;
  }
};

struct L : array<P, 2> {
  L () = default;
  L(const P& a, const P& b) {
    front() = a;
    back() = b;
  }
  P vec() const {
    return back() - front();
  }
};
D dot(const P& a, const P& b) {
  return (conj(a)*b).X;
}
D cross(const P& a, const P& b) {
  return (conj(a)*b).Y;
}
int ccw(P a, P b, P c) {
  b -= a;
  c -= a;
  if(cross(b, c) > 0) return +1; // ccw
  if(cross(b, c) < 0) return -1; // cw
  if(dot(b, c) < 0) return +2; // L c-a-b
  if(norm(b) < norm(c)) return -2; // L a-b-c
  return 0;
}

bool intersectLL(const L& l, const L& m) {
  return abs(cross(l.vec(), m.vec())) > EPS ||
    abs(cross(l[1] - l[0], m[0] - l[0])) < EPS;
}

P projection(const L& l,const P& p) {
  D t = dot(p-l[0], -l.vec()) / norm(-l.vec());
  return l[0] + t*(-l.vec());
}
P refrection(const L& l, const P& p) {
  return p  + 2.0 * (projection(l, p) - p);
}

vector<string> split(const string& s, char c = ' ') {
  stringstream ss(s);
  vector<string> ret;
  string t;
  while(getline(ss, t, c)) ret.push_back(t);
  return ret;
}
int main() {
  cout << fixed << setprecision(15);  
  string s;
  while(getline(cin, s)) {
    const int P_SIZE = 3;
    auto v = split(s, ',');
    vector<P> p(P_SIZE);
    rep(i, P_SIZE) {
      D x, y;
      x = stof(v[i*2].c_str());
      y = stof(v[i*2+1].c_str());
      p[i] = {x, y};
    }
    L l{p[0], p[1]};
    auto q = refrection(l, p[2]);

    cout << q.X << " " << q.Y << endl;
  }
  return 0;
}



Measured memory_bytes: 3244
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<bitset>
#include<deque>
#include<functional>
#include<iterator>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<utility>
using namespace std;
typedef long long ll;
#define sz(x) (ll)((x).size())
#define rep(i,n) for(ll i=0;i<(n);i++)
#define rep1(i,n) for(ll i=1;i<=(n);i++)
#define rrep(i,n) for(ll i=(n)-1;i>=0;i--)
#define rrep1(i,n) for(ll i=(n);i>=1;i--)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
const ll MOD=1000000007;
const ll INF=1000000000000000;

vector<ll> pw2(62,1);vector<ll> pw10(19,1);
ll high_order_bit(ll n){
    ll tmp=1,i=-1;
    while(tmp<=n){
        tmp*=2;
        i++;
    }
    if(n==0) return 0;
    else return i;
}
vector<ll> binary_expansion(ll n){
    vector<ll> B(high_order_bit(n)+1);
    ll tmp=n;
    for(ll i=high_order_bit(n);i>=0;i--){
        B[i]=tmp/pw2[i];
        tmp%=pw2[i];
    }
    return B;
}

int main(){
    {rep1(i,61) pw2[i]=2*pw2[i-1];}
    {rep1(i,18) pw10[i]=10*pw10[i-1];}
    
    ll N,K; cin>>N>>K;
    ll ans=0;
    vector<ll> A(N+1,0);
    rep1(i,N) cin>>A[i];
    
    //doubling[i][j]:jから2^i回でどこにいるか
    ll D_MAX=65; //2^D_MAXで辿り着ける
    vector<vector<ll> > doubling(D_MAX+1,vector<ll>(N+1,0));
    
    //[0][j]は入力から作る
    rep1(j,N) doubling[0][j]=A[j];
    
    //前処理
    //1つ前の時間の情報がいるからiからループ
    rep1(i,D_MAX)rep1(j,N){
        doubling[i][j]=doubling[i-1][doubling[i-1][j]];
    }
    
    //solve
    //1からK回
    vector<ll> v=binary_expansion(K);
    ll now=1;
    rep(i,sz(v)){
        if(v[i]==1) now=doubling[i][now];
    }
    cout<<now<<endl;
    
}



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

int main(){
  int a, b;
  cin >> a >> b;
  if(a%3==0 || b%3==0 || (a+b)%3==0) cout << "Possible" << "\n";
  else cout << "Impossible" << "\n";
  return 0;
}


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

#define REP(i,n) for(int i=0;i<(n);i++)
#define EPS (1e-7)
#define INF (2e9)
// cout << setprecision(10)

using namespace std;
typedef long long int ll;
const ll MOD = 1000000007;

int H, W;
int MAP[2000][2000];
int dp_l[2000][2000];
int dp_r[2000][2000];
int dp_u[2000][2000];
int dp_d[2000][2000];
int main(void){
    cin >> H >> W;
    char c;
    REP(h, H) REP(w,W){
        cin >> c;
        if (c=='#') MAP[h][w] = 1;
    }
    REP(h, H){
        int count = 0;
        for(int w=W-1;w>=0;w--){
            if(MAP[h][w]==0) dp_l[h][w] = count++;
            else count = 0;
        }
    }
    REP(h, H){
        int count = 0;
        REP(w, W){
            if(MAP[h][w]==0) dp_r[h][w] = count++;
            else count = 0;
        }
    }

    REP(w, W){
        int count = 0;
        for(int h=H-1;h>=0;h--){
            if(MAP[h][w]==0) dp_u[h][w] = count++;
            else count = 0;
        }
    }
    REP(w, W){
        int count = 0;
        REP(h, H){
            if(MAP[h][w]==0) dp_d[h][w] = count++;
            else count = 0;
        }
    }

    int res = 0;
    REP(h,H) REP(w,W){
        if(MAP[h][w]==0) res = max(res, 1+dp_l[h][w]+dp_r[h][w]+dp_u[h][w]+dp_d[h][w]);
    }
    cout << res << endl;
    return 0;
}



Measured memory_bytes: 78336
// #define DEBUGGING
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ALL(V) (V).begin(), (V).end()
#define ALLR(V) (V).rbegin(), (V).rend()

template <typename T> using V = vector<T>;
template <typename T> using VV = V<V<T>>;
using ll = int64_t;
using ull = uint64_t;
using PLL = pair<ll, ll>;

template <typename T> const T& var_min(const T &t) { return t; }
template <typename T> const T& var_max(const T &t) { return t; }
template <typename T, typename... Tail> const T& var_min(const T &t, const Tail&... tail) { return min(t, var_min(tail...)); }
template <typename T, typename... Tail> const T& var_max(const T &t, const Tail&... tail) { return max(t, var_max(tail...)); }
template <typename T, typename... Tail> void chmin(T &t, const Tail&... tail) { t = var_min(t, tail...); }
template <typename T, typename... Tail> void chmax(T &t, const Tail&... tail) { t = var_max(t, tail...); }
template <typename T> const T& clamp(const T &t, const T &low, const T &high) { return max(low, min(high, t)); }
template <typename T> void chclamp(T &t, const T &low, const T &high) { t = clamp(t, low, high); }

namespace init__ {

struct InitIO {
    InitIO() {
        cin.tie(nullptr);
        ios_base::sync_with_stdio(false);
        cout << fixed << setprecision(30);
    }
} init_io;

}

#ifdef DEBUGGING
// #include "../debug/debug.cpp"
#include "../../debug/debug.cpp"
#else
#define DEBUG(...) 0
#define DEBUG_SEPARATOR_LINE 0
#endif

template <typename T>
T make_v(T init) { return init; }

template <typename T, typename... Tail>
auto make_v(T init, size_t s, Tail... tail) {
#define rec make_v(init, tail...)
    return V<decltype(rec)>(s, rec);
#undef rec
}

const ll mod = 1e9 + 7;

ll solve() {
    ll N;
    string S;
    cin >> N >> S;
    if(S[0] == 'W') return 0;
    ll left_cnt = 0;
    left_cnt = 1;
    ll ans = 1;
    for(ll i = 1; i < S.size(); i++) {
        if(S[i] == 'B') {
            if(left_cnt % 2 == 0) {
                left_cnt++;
            } else {
                (ans *= left_cnt) %= mod;
                left_cnt--;
            }
        } else {
            if(left_cnt % 2 == 0) {
                if(left_cnt == 0) return 0;
                (ans *= left_cnt) %= mod;
                left_cnt--;
            } else {
                left_cnt++;
            }
        }
    }
    if(left_cnt != 0) return 0;
    for(ll i = N; i >= 1; i--) (ans *= i) %= mod;
    return ans;
}

int main() {
    cout << solve() << endl;
    return 0;
}


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

int main()
{
    int n, k;
    cin >> n >> k;
    if(n==k){
        cout << 1 << endl;
        return 0;
    }
    int left = 0;
    int right = 0;
    for(int i=0; i<n; i++){
        int t;
        cin >> t;
        if(t == 1){
            left = i;
            right = n-i-1;
            break;
        }
    }
    int ans = 0;
    if(left % (k-1) == 0){
        ans += left/(k-1);
        if(right % (k-1) == 0) 
            ans += right/(k-1);
        else 
            ans += right/(k-1) +1;
    }else if(right % (k-1) == 0){
        ans += right/(k-1);
        if(left % (k-1) == 0) 
            ans += left/(k-1);
        else 
            ans += left/(k-1) +1;
    }else{
        //left
        int tl = 0;
        int res = left%(k-1);
        tl++;
        tl += left/(k-1);
        int nright = right - (k-1-res);
        if(nright % (k-1) == 0) 
            tl += nright/(k-1);
        else 
            tl += nright/(k-1) +1;
        //right
        int tr = 0;
        res = right%(k-1);
        tr++;
        tr += right/(k-1);
        int nleft = left - (k-1-res);
        if(nleft % (k-1) == 0) 
            tr += nleft/(k-1);
        else 
            tr += nleft/(k-1) +1;
        ans = min(tl,tr);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdint>
#include <vector>
#include <set>
#include <map>
#include <cassert>
 
using namespace std;
typedef uint64_t U;
typedef std::vector<U> V;

V read() {
  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  U N;
  cin >> N;
 
  V a(N);
  for(uint64_t i=0; i<N; i++) {
    cin >> a[i];
  }
 
  return std::move(a);
}
 
bool check(const V& a, int k) {

  if(k==1) {
    for(size_t i=1; i<a.size(); i++) {
      if(a[i] <= a[i-1]) { return false; }
    }
    return true;
  }
 
  map<U,U> current;
 
  for(size_t i=1; i<a.size(); i++) {
    if(a[i] <= a[i-1]) {
      U pos = a[i]-1;
      current[pos] = current[pos] + 1;
      while( current[pos] == k && pos > 0 ) {
        pos--;
        current[pos] = current[pos] + 1;
      }
      auto it = current.lower_bound(pos+1);
      current.erase(it, current.end());
      if(current[0] == k) {
        return false;
      }
    }
    else {
      // extend current with zero
    }
  }
  return true;
}
 
int solve(const V& a) {
  int k_ng = 0;
  int k_ok = a.size();
 
  int k = k_ok / 10 + 1;
  while( k_ok - k_ng > 1 ) {
    if( check(a,k) ) {
      k_ok = k;
    }
    else {
      k_ng = k;
    }
    k = (k_ng + k_ok)/2;
  }
 
 
  return k_ok;
}
 
void test() {
  V a1 = {3,2,1};
  assert(solve(a1)==2);
 
  V a2 = {2,3,2,1,2};
  assert(solve(a2)==2);
 
  V a3 = {2,2,2,2,1};
  assert(solve(a3)==3);
 
  V a4 = {3,3,3,3,3,3,3,3};
  assert(solve(a4)==2);
 
  V a5 = {3,3,3,2,1};
  assert(solve(a5)==3);

  {
    V v(100000, 3);
    assert(solve(v)==47);
  }
  {
    V v(100000, 5);
    assert(solve(v)==10);
  }
  {
    V v(200000, 1000000000);
    bool b = check(v, 1);
    assert(b == false);

    bool b2 = check(v, 2);
    assert(b2 == true);
  }
  cerr << "passed" << endl;
}
 
int main() {
  V in = read();
  int r = solve(in);
  cout << r << endl;

  //test();
 
  return 0;
}


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


const ll MAX = 4000010;
const ll MOD = 998244353;

long long fac[MAX], finv[MAX], inv[MAX];
 
void COMinit() {
 fac[0] = fac[1] = 1;
 finv[0] = finv[1] = 1;
 inv[1] = 1;
  for (ll i = 2; i < MAX; i++){
  fac[i] = fac[i - 1] * i % MOD;
  inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
       finv[i] = finv[i - 1] * inv[i] % MOD;
        }
      }
 
   long long COM(ll n, ll k){
  if (n < k){ return 0;}
  if (n < 0 || k < 0) {return 0;}
     return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
     }
 


int main(){ 
  
  ll N,A,B,K; cin >> N >> A >> B >> K;
  
  ll ans = 0;
  
  COMinit();
  
  for(ll x = 0; x <= N; x++){
    
    ll res = K-x*A;
    
    if( res % B == 0 ){ 
      
      ll y = res/B;
      
      ans += COM(N,x)*COM(N,y);
      
      ans %= MOD;
      
    }
    
  }
  
  cout << ans%MOD << endl;
  
  return 0;
} 

Measured memory_bytes: 93952
# ANSHUL GAUTAM
# IIIT-D

from math import *
from copy import *
from string import *				# alpha = ascii_lowercase
from random import *				# l.sort(key=lambda l1:l1[0]-l1[1]) => ex: sort on the basis difference
from sys import stdin
from sys import maxsize
from operator import *				# d = sorted(d.items(), key=itemgetter(1))
from itertools import *
from collections import Counter		# d = dict(Counter(l))
from collections import defaultdict # d = defaultdict(list)

'''

'''

def solve(n,r):
	ans = max(r,r+(100*(10-n)))
	return ans

N,R = map(int, stdin.readline().rstrip().split())
ans = solve(N,R)
print(ans)


Measured memory_bytes: 4088
n, a, b = map(int, input().split())

ans = 0
for i in range(1, n+1):
    str_i = str(i)
    sum = 0
    for j in range(len(str_i)):
        sum += int(str_i[j])
    if a <= sum <= b:
        ans +=i

print(ans)


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

#define ll long long
#define endl "\n"

int main(){
	ll n, w; cin>>n>>w;
	vector<pair<ll, ll>> v(n);
	for(auto &i : v){
		cin>>i.first>>i.second;
	}
	sort(v.begin(), v.end());
	vector<vector<ll>> dp(n+1, vector<ll>(w+1, 0));
	for(int i = 1; i<=n; i++){
		for(int j = 1; j <= w; j++){
			if(j - v[i-1].first >= 0){
				dp[i][j] = max(dp[i-1][j], v[i-1].second + dp[i-1][j-v[i-1].first]);
			}else{
				dp[i][j] = dp[i-1][j];
			}
		}
	}
	cout<<dp[n][w]<<endl;
}


Measured memory_bytes: 80256
//Abhinav ---IIIT_A
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define f(i,x,n) for(int i=x;i<(int)n;++i)
#define vpii vector<pair<int,int>>
#define vi vector<int>
#define mpii map<pair<int,int>,int>
#define mpivpii map<int,vector<pair<int,int>>>
#define pii pair<int,int>
#define all(x) x.begin(),x.end()
#define sz(x) x.size()
#define mpi map<int,int>
#define vvi vector<vector<int>>
#define vvvi vector<vvi>
ld pie=3.141592653589;
int mod=1e9+7;

bool Compare(int a, int b)
{
   return a < b;
}
std::priority_queue<int, std::vector<int>, std::function<bool(int, int)>> pq(Compare);

int r,c,k; 
int val[3005][3005];
int dp[3005][3005][4];

int rec(int curr_r, int curr_c,int num){
  if(curr_r == r || curr_c == c) return 0;
  if(dp[curr_r][curr_c][num]!=-1) return dp[curr_r][curr_c][num];
  int a=LLONG_MIN;
  if(num==3) {
		a=max(a,rec(curr_r,curr_c+1,num));
        a=max(a,rec(curr_r+1,curr_c,0));
  }else{
    a=max(a,rec(curr_r+1,curr_c,0));
    a=max(a,rec(curr_r,curr_c+1,num));
    a=max(a,rec(curr_r+1,curr_c,0)+val[curr_r][curr_c]);
    a=max(a,rec(curr_r,curr_c+1,num+1)+val[curr_r][curr_c]); 
  }
  return dp[curr_r][curr_c][num]=a;
}

void solve(){
  cin>>r>>c>>k;
   f(i,0,k){
    int a,b,c; cin>>a>>b>>c;
    --a; --b; val[a][b]=c;
  }
  f(i,0,r) f(j,0,c) f(k,0,4) dp[i][j][k]=-1;
  cout<<rec(0,0,0)<<"\n";
}


int32_t main(){
  ios_base::sync_with_stdio(false);cin.tie(NULL);
  int t=1; //cin>>t;
  while(t--) solve();
  return 0;
}
// check for overflows dummy !!!

Measured memory_bytes: 356028
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,ans,mod=1e9+7,dp[3005][3005];
string s;
int main(){
	cin >> n >> s;
	dp[2][1]=s[0]=='>',dp[2][2]=s[0]=='<';
	for(int i=3;i<=n;i++)
		if(s[i-2]=='<'){
			dp[i][1]=0;
			for(int j=2;j<=i;j++)
				dp[i][j]=(dp[i][j-1]+dp[i-1][j-1])%mod;
		}
		else{
			dp[i][i]=0;
			for(int j=i-1;j>0;j--)
				dp[i][j]=(dp[i][j+1]+dp[i-1][j])%mod;
		}
	for(int i=1;i<=n;i++)
		ans=(ans+dp[n][i])%mod;
	cout << ans;
	return 0;
}

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

using namespace std;

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

    vector<int> v(n+1,k);

    for(int i =1; i <= p; ++i)
    {
        int x;cin >> x;
        v[x]++;
    }

    for(int i =1; i<= n; ++i)
    {
        if(v[i] - p > 0)
            cout << "Yes";
        else
            cout << "No";
        cout << '\n';
    }

    return 0;
}


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

#define int long long
#define fs first
#define sc second
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define mp make_pair
#define len(v) ((int)v.size())
#define vc vector
#define pr pair
#define endl "\n"
#define endd "\n"; return 0;
#define all(v) v.begin(), v.end()

using namespace std;

const int MAXN = 1e5;
const int INF = 1e10;
const int MOD = 1e9 + 7;

main() {
    ios_base::sync_with_stdio(0);
    int a, b, c;
    cin >> a >> b >> c;
    if (a <= c && c <= b){
        cout << "Yes";
    }
    else{
        cout << "No";
    }
}


Measured memory_bytes: 256
import java.util.*;
import java.util.stream.Collectors;
import java.io.*;
import java.nio.charset.StandardCharsets;

public class Main {
	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	}

	Main(BufferedReader in) throws IOException {
		int X = Integer.parseInt(in.readLine());
		int count = 1;
		int deg = X;
		while(deg != 0) {
			deg = (deg + X)%360;
			++count;
		}
		System.out.println(count);
	}

	void calc() {
	}

	void showResult() {
	}
}


Measured memory_bytes: 32500
import java.util.*;

public class Main {
  private static final long MAX = (long)1e18;
  
  public static void main(String args[]) {
  	long multiplication = 1;
    Scanner in = new Scanner(System.in);
    int n = in.nextInt();
    
    for (int i=0; i<n; i++) {
      long num = in.nextLong();
      if (num == 0) {
        System.out.print(0);
        return;
      } 
      
      if (multiplication != -1) {
        if (num > MAX / multiplication) {
          multiplication = -1;
        } else {        
          multiplication *= num;
        }
      }
    }
    
    System.out.print(multiplication);
  }
}


Measured memory_bytes: 59708
#include<cstdio>
#include<algorithm>
using namespace std;//没有sort的话就可以去掉了 
int n,h,ans;
struct Stu{
    long long a,b; 
}k[1000100];
int mian(Stu x,Stu y)//骚骚的mian
{
    return x.a<y.a;//相当于定义一个可给结构体排序的函数 
}
int main()
{
    scanf("%d%d",&n,&h);
    int oo=1;//计数器 
    for(int i=1;i<=n;++i)
    {
        scanf("%d",&k[oo++].a);//砍的伤害 
        k[oo-1].b=1;  //等于1说明刀已经扔了出去不能再用了 
        scanf("%d",&k[oo++].a);//飞的伤害 
    }
    sort(k+1,k+2*n+1,mian);//飞的伤害由小到大排序 
    int o=2*n;     //刀数乘2表示一把刀两种伤害 
    while(h>0)
    {
        if(k[o].b==0)
        {
            h-=k[o].a;//能扔的扔出去 
            ans++;
        }
        else break;
        o--;
    }
    if(h<0) h=0;//血量低于0的话再返回0 
    if(h%k[o].a==0) printf("%d\n",ans+h/k[o].a);//剩下的血量像楼下（上）说的一把刀砍到死 
    else printf("%d\n",ans+h/k[o].a+1);
    return 0;//好习惯
}

Measured memory_bytes: 4224
#include<bits/stdc++.h>
using ll= long long;
#define REP(i,n) for(ll i=0;i<ll(n);i++)
#define FOR(i,a,b) for(ll i=a;i<=ll(b);i++)
#define ALL(x) x.begin(),x.end()

#define INF (ll)1e9 //10^9:∞
#define LLINF (ll)1e12
#define MOD (ll)(1e9+7) //10^9+7:合同式の法
#define PI 3.141592653589
#define PB push_back
#define F first
#define S second
#define __MAGIC__ ios::sync_with_stdio(false);cin.tie(nullptr);

#define YESNO(T) if(T){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define yesno(T) if(T){cout<<"yes"<<endl;}else{cout<<"no"<<endl;}
#define YesNo(T) if(T){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}

#define Graph vector<vector<int>>
#define PII pair<int,int>
#define VI vector<int>
#define VVI vector<vector<int>>
#define VPII vector<pair<int,int>>

#define DDD fixed<<setprecision(10)
#define endl "\n"

using namespace std;
/*..................DEFINE GLOBAL VARIABLES...................*/


/*.....................DEFINE FUNCTIONS ......................*/



/*.........................kemkemG0...........................*/
signed main() {
	__MAGIC__


	vector<ll> v(100005,0);

	ll N,K;
	cin>>N>>K;

	REP(i,N){
		ll a,b;
		cin>>a>>b;
		v[a]+=b;
	}
	ll num=0;
	FOR(i,1,100005){
		num+=v[i];
		if(num>=K){
			cout<<i<<endl;
			break;
		}
	}

	
		return 0;
}


Measured memory_bytes: 3848
#define DEBUG 1
#include <bits/stdc++.h>
#define loop(n) for (lint ngtkana_is_a_genius = 0; ngtkana_is_a_genius < lint(n); ngtkana_is_a_genius++)
#define rep(i, begin, end) for (lint i = lint(begin); (i) < lint(end); i++)
#define all(v) v.begin(), v.end()
#define rand(l, r) std::uniform_int_distribution<>(l, r)(mt)
using lint = long long;
auto mt = std::mt19937_64(std::random_device{}());
auto cmn = [](auto&& a, auto b){ if (a > b) {a = b; return true;} return false; };
auto cmx = [](auto&& a, auto b){ if (a < b) {a = b; return true;} return false; };
void debug_impl() { std::cerr << std::endl; }
template <typename Head, typename... Tail>
void debug_impl(Head head, Tail... tail) { std::cerr << " " << head; debug_impl(tail...); }
#if DEBUG
#define debug(...)\
  do {\
    std::cerr << std::boolalpha << "[" << #__VA_ARGS__ << "]:";\
    debug_impl(__VA_ARGS__);\
    std::cerr << std::noboolalpha;\
  } while (false)
#else
#define debug(...) {}
#endif

int main() {
  std::cin.tie(0); std::cin.sync_with_stdio(false);
  char c; std::cin >> c;
  c++;
  std::cout << c << std::endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define ll long long
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
ll int gcd (ll int a,ll int b) { return b ? gcd (b, a % b) : a; }

int main()
{
  ll int n,m,k;
  cin>>n>>m>>k;
  ll int a[n+1],b[m+1];
  a[0]=0;b[0]=0;
  for(int i=1;i<=n;i++)
  {
    ll int x;cin>>x;
    a[i]=x+a[i-1];
  }
  for(int i=1;i<=m;i++)
  {
    ll int x;cin>>x;
    b[i]=x+b[i-1];
  }
  ll int ans = 0;
  ll int j = m;
  for(ll int i = 0; i<= n; i++)
  {
    if(a[i]>k)
      break;
    else
    {
      while(a[i]+b[j]>k)
        j--;
    }
    ans = max(ans,i+j);
  }
  cout<<ans;
}

Measured memory_bytes: 6680
[n, a, b] = list(map(int, input().split()))
if n == 2:
    print("Borys")
elif n == 3:
    if a == 1 and b == 3:
        print("Alice")
    else:
        print("Borys")
elif (b - a) % 2 == 0:
    print("Alice")
else:
    print("Borys")


Measured memory_bytes: 2940
#include<iostream>
#include<string>
#include<vector>
#include<stdio.h>
#include<algorithm>
#include<math.h>
#include<numeric>
#include<iomanip>
#include<deque>
#include<tuple>
#include<queue>
#include<map>
#include <cstdint>
#include <boost/multiprecision/cpp_int.hpp>


#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define Endl endl
#define F first
#define S second

namespace mp = boost::multiprecision;

using cpp_int = mp::cpp_int;
using ll = long long;
using namespace std;



ll dp[51][51][2501];

int main() {
	int n;
	cin >> n;
	int a; cin >> a;
	vector<int>x(n);
	FOR(i,0, n) {
		cin >> x[i];
	}
	
	int X =max(*max_element(all(x)),a);
	rep(j, n+1)rep(k, n+1)rep(s, n*X+1) {
		if (j == 0 && k == 0 && s == 0) {
			dp[j][k][s] = 1;
		}
		else if (j >= 1 && s < x[j-1]) {
			dp[j][k][s] = dp[j - 1][k][s];
		}
		else if (j >= 1 && k >= 1 && s >= x[j-1]) {
			dp[j][k][s] = dp[j - 1][k][s] +
				dp[j - 1][k - 1][s - x[j-1]];
		}
		else {
			dp[j][k][s] = 0;
		}
	}
	ll count = 0;
	rep(i, n+1) {
		count += dp[n][i][i*a];
	}
	cout << count-1 << endl;
}


Measured memory_bytes: 51072
#include <iostream>
#include <vector>
#include <string>

using namespace std;
// template for creating 2d vector
template<typename T>
vector<vector<T>> make_2d_vector(size_t rows, size_t cols, T init)
{ return vector< vector<T> >(rows, vector<T>(cols, init)); }



#define debug(x) cout << #x << "==" << x << endl;

const int inf = 100000000;

typedef long long ll;

int main() {
  ios::sync_with_stdio(false);

  vector<ll> hoge(1e7);        // 39296 KB

  char a, b;
  cin >> a >> b;
  if(a==b) {
    cout << "H" << endl;
  } else {
    cout << "D" << endl;
  }


  return 0;
}


Measured memory_bytes: 78336