akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <iostream>
#include <cmath>
#include <vector>

using namespace std;

int main(){
  int N, M;
  cin >> N >> M;
  int ans = 1;
  for(int A=1;A*A<=M;++A){
    if(M%A != 0) continue;
    int B = M/A;
    if(B>=N && A > ans) ans = A;
    if(A>=N && B > ans) ans = B;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define long int64_t

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

	string S;
	cin >> S;
	cout << (S.size() >= 4 && S.find( "YAKI" ) == 0 ? "Yes" : "No") << endl;

	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,b) rng(i,0,b)
#define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--)
#define per(i,b) gnr(i,0,b)
#define bg begin()
#define ed end()
#define all(x) x.bg,x.ed
#define pb push_back
#define pf push_front
#define eb emplace_back
using namespace std;
typedef long long ll;
template<class t,class u> void chmax(t&a,u b){if(a<b)a=b;}
template<class t,class u> void chmin(t&a,u b){if(b<a)a=b;}
template<class t> using vc=vector<t>;
template<class t> using vvc=vc<vc<t>>;
using pi=pair<int,int>;
using vi=vc<int>;
void yes(){ cout << "Yes" << endl; }
void no(){ cout << "No" << endl; }
int SIZE(string s){return (int)s.size();}
const long long INF = 1LL << 60;

ll c(ll n, ll m){
    if(m == 0) return 1;
    chmin(m,n-m);
    ll ans = 1, cnt = m;
    while(cnt > 0){
        ans *= n-cnt+1;
        cnt--;
    }
    while(m > 0){
        ans /= m;
        m--;
    }
    return ans;
}

int main(){
    cout << fixed << setprecision(20);
    ll x,y; cin >> x >> y;
    ll cnt = 0;
    rep(i,x){
        int a; cin >> a;
        if(a % 2 == 1) cnt++;
    }
    ll ans = pow(2,x-cnt);
    ll sum = 0;
    for(ll i = y; i <= cnt; i += 2){
        sum += c(cnt,i);
    }
    cout << ans*sum << endl;
    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <complex>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
#include <functional>
#include <cstring>
#include <regex>
#include <random>
#include <cassert>
#include <stack>
#include <climits>
#include <chrono>
#include <fstream>
using namespace std;

#pragma region

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, s, n) for (int i = (s); i < (int)(n); i++)
#define revrep(i, n) for (int i = (n) - 1; i >= 0; i--)
#define revrepr(i, s, n) for (int i = (n) - 1; i >= s; i--)
#define debug(x) cerr << #x << ": " << x << "\n"
#define popcnt(x) __builtin_popcount(x)

const double PI = acos(-1.0);

using ll = long long;
using P = pair<int, int>;

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 T>
istream& operator >>(istream &is, vector<T> &v) {
    for (int i = 0; i < (int)v.size(); i++) cin >> v.at(i);
    return is;
}

template<class T, class U>
ostream& operator <<(ostream &os, pair<T, U> p) {
    cout << '(' << p.first << ", " << p.second << ')';
    return os;
}

template<class T>
void print(const vector<T> &v, const string &delimiter = " ") { rep(i, v.size()) cout << (0 < i ? delimiter : "") << v.at(i); cout << endl; }

template<class T>
void print(const vector<vector<T>> &vv, const string &delimiter) { for (const auto &v: vv) print(v, delimiter); }

#pragma endregion


int main() {
    ll n, k;
    cin >> n >> k;
    vector<int> p(n);
    vector<ll> c(n);
    cin >> p >> c;
    rep(i, n) p[i]--;

    ll ans = -1e18;
    rep(s, n) {
        vector<bool> done(n);
        ll len = 0;
        ll pos = s;
        ll sum = 0;
        while (1) {
            if (done[pos]) break;
            if (len == k) break;

            done[pos] = true;
            len++;
            sum += c[p[pos]];
            chmax(ans, sum);
            pos = p[pos];
        }

        if (len == k) continue;
        if (sum < 0) continue;

        ll rem = k % len + len;
        chmax(ans, sum);
        pos = s;
        ll score = (k / len - 1) * sum;
        chmax(ans, score);
        rep(i, rem) {
            score += c[p[pos]];
            pos = p[pos];
            chmax(ans, score);
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3704
#include <stdio.h>

int main()
{
    int n,l,ans=0,min,a;
    scanf("%d %d",&n,&l);
    if(l>0){
        a=l;
    }
    else if(n+l-1<=0){
        a = n+l-1;
    }
    else a=0;
    for(int i=0;i<n;i++){
        ans+=l;
        l++;
    }
    printf("%d",ans-a);
}


Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <tuple>

using namespace std;
typedef long long ll;
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
const int INF = 1<<29;

int main(){
    string S,T;
    cin >> S;
    cin >> T;
    int f=3;
    for(int i=0;i<3;i++){
        if(S[i]!=T[i]){
            f--;
        }
    }
    cout << f << endl;
    return 0;
}


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

using namespace std;

#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()

typedef uint64_t ll; typedef vector<int> VI; typedef pair<int,int> pii;
const ll mod = 1e9+7;

int main()
{
	
	//cin.tie(0); ios_base::sync_with_stdio(false);
	int a,b,c;
	cin >>a >>b >>c;
	
	int s=a+b;
	if(s > b+c) s = b+c;
	if(s > c+a) s = c+a;
	
	cout << s <<"\n";
	return 0;
}


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

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define fst first
#define snd second

int main()
{
    ll k;
    cin >> k;

    queue<ll> q;
    for(int i = 1; i <= 9; i++)
        q.push(i);
    ll cur = 0;
    for(int i = 0; i < k; i++)
    {
        cur = q.front();
        q.pop();
        if(cur % 10 > 0)
            q.push(cur * 10 + (cur % 10) - 1);
        q.push(cur * 10 + (cur % 10));
        if(cur % 10 < 9)
            q.push(cur * 10 + (cur % 10) + 1);
    }

    cout << cur;

    return 0;
}


Measured memory_bytes: 1792
#include "bits/stdc++.h"

using namespace std;
#ifdef _DEBUG
#define _GLIBCXX_DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

#define int long long
#define ll long long
#define DBG 1
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define loop(n) rep(loop, (0), (n))
#define all(c) begin(c), end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
using pii = pair<int, int>;
// template<class T> ostream &operator<<(ostream &os,T &t){dump(t);return os;}
template <typename T, typename S>istream &operator>>(istream &is, pair<T, S> &p) { is >> p.first >> p.second; return is; }
//template <typename T, typename S>ostream &operator<<(ostream &os, pair<T, S> &p) {os << p.first << " " << p.second;return os;}

template <typename T> void printvv(const vector<vector<T>> &v) {
	cerr << endl;
	rep(i, 0, v.size()) rep(j, 0, v[i].size()) {
		if (typeid(v[i][j]).name() == typeid(INF).name() and v[i][j] == INF) {
			cerr << "INF";
		}
		else
			cerr << v[i][j];
		cerr << (j == v[i].size() - 1 ? '\n' : ' ');
	}
	cerr << endl;
}

#ifndef _DEBUG
#define printvv(...)
#endif
void YES(bool f) { cout << (f ? "YES" : "NO") << endl; }
void Yes(bool f) { cout << (f ? "Yes" : "No") << endl; }
template <class T, class U>bool chmin(T& a, U b) { if (a > b) { a = b; return true; }return false; }
template <class T, class U>bool chmax(T& a, U b) { if (a < b) { a = b; return true; }return false; }

signed main(signed argc, char *argv[]) {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(12);

	int N; cin >> N;
	vector<int>h(N); rep(i, 0, N) { cin >> h[i]; }

	int ans = 0;
	bool f = true;
	rrep(i, 0, N - 1) {
		int m=max(h[i] - h[i + 1], 0ll);
		if (m > 1)f = false;
		h[i] -= m;
	}
	dump(h);
	Yes(f);
	return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
typedef signed long long ll;
 
#define REP(i,a,b) for(i=(int)a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)
#define all(a) (a).begin(), (a).end()

int main(){
	int i,j,k,n,m,l,f,x,y,z; string s;
	cin >> i >> s;
  	if (i >= 3200) cout << s;
  	else cout << "red";
}

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

// int/long:		-2,147,483,648 - 2,147,483,648 (-2^31 <= int < 2^31)
// long/long long:	-9,223,372,036,854,775,808 - 9,223,372,036,854,775,807 (-2^63 <= long < 2^63)

#define	INF (1<<29)
//536,870,912

// lower_bound(A.begin(), A.end(), N)
// upper_bound(...

// A.erase(unique(A.begin(), A.end()), A.end())

// bit: &/and, |/or, ^/xor, ~/not

// getline(cin, String)

// Graph
// Warshall-Floyd: Distance between each node, N^3
// Dijkstra: Distance from the start node, N^2
// DFS(Depth-First Search)

#define	MOD 1000000007

int	main() {
	int N, M;
	cin >>N >>M;
	vector<vector<int>> A(M, vector<int> (3));
	for (int i=0; i<M; i++)
		for (int j=0; j<3; j++)
			cin >>A.at(i).at(j);
	vector<vector<int>> d(N+1, vector<int> (N+1, INF));
	for (int i=0; i<=N; i++)
		d.at(i).at(i)=0;
	for (int i=0; i<M; i++) {
		int a=A.at(i).at(0);
		int b=A.at(i).at(1);
		int c=A.at(i).at(2);
		d.at(a).at(b)=c;
		d.at(b).at(a)=c;
	}
	// Add waypoints one by one
	for (int k=1; k<=N; k++)
		for (int i=1; i<=N; i++)
			for (int j=1; j<=N; j++)
				d.at(i).at(j) =min(d.at(i).at(j), d.at(i).at(k)+d.at(k).at(j));
	int S=0;
	for (int i=0; i<M; i++)
		if (d.at(A.at(i).at(0)).at(A.at(i).at(1))!=A.at(i).at(2))
			S++;
	cout <<S <<endl;
	return 0;
}



Measured memory_bytes: 384
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int n,k;
  cin>>n>>k;
  int a[n];
  int num[n];
  for(int i=0;i<n;i++){
    cin>>a[i];
    num[i]=0;
    }
  for(int i=0;i<n;i++){
    num[a[i]-1]++;
    }
  sort(num,num+n);
  reverse(num,num+n);
  int ans=n;
  for(int i=0;i<k;i++){
    ans-=num[i];
    }
  cout <<ans<<endl;
  return 0;
  }

  

Measured memory_bytes: 1792
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
#define int long long

int n;

bool is753(int n) {
  int count[10];
  fill(count, count + 10, 0);
  while (n) {
    count[n % 10]++;
    n /= 10;
  }
  if (count[3] && count[5] && count[7]) return true;
  else return false;
}

int dfs(int k) {
  if (k > n) return 0;
  int res = 0;
  if (is753(k)) res++;
  for (int i = 3; i <= 7; i += 2) {
    res += dfs(k * 10 + i);
  }
  return res;
}

signed main() {
  cin >> n;
  cout << dfs(0) << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
 
#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)
 
#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=(int)(a)-1;i>=(int)(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)
 
#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
 
// #define DEBUG
 
#ifdef DEBUG
    #define dump(...) fprintf(stderr, __VA_ARGS__)
#else
    #define dump(...)
#endif
 
template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}
 
using namespace std;
using ll=long long;
using vi=vector<int>;
using vll=vector<ll>;
 
const double EPS = 1e-10;
const double PI = acos(-1.0);
const ll inf =1LL << 62;
const ll mod=1000000007LL;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
 
 
ll extgcd(ll a,ll b,ll& x,ll& y){x=1,y=0;ll g=a;if(b!=0) g=extgcd(b,a%b,y,x),y-=a/b*x;return g;}
ll ADD(const ll &a, const ll &b,const ll &mod) { return (a+b)%mod;}
ll SUB(const ll &a, const ll &b,const ll &mod) { return (a-b+mod)%mod;}
ll MUL(const ll &a, const ll &b,const ll &mod) { return (1LL*a*b)%mod;}
ll DIV(const ll &a, const ll &b,const ll &mod) {ll x,y; extgcd(b,mod,x,y);return MUL(a,(x+mod)%mod,mod);}
 
random_device rd;
mt19937 mt(rd());
uniform_int_distribution<int> dice(1,6);
uniform_real_distribution<double> score(0.0,10.0);

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

    int a, b, c, d, e, f; cin >> a >> b >> c >> d >> e >> f;

    vi dp1(f + 1); dp1[0] = 1;
    vi dp2(f + 1); dp2[0] = 1;

    rep(i, f){
        if(dp1[i] and i + 100 * a <= f) dp1[i + 100 * a] = 1;
        if(dp1[i] and i + 100 * b <= f) dp1[i + 100 * b] = 1;
        if(dp2[i] and i + c <= f) dp2[i + c] = 1;
        if(dp2[i] and i + d <= f) dp2[i + d] = 1;
    }

    using R = double;
    R res = 0; int res1, res2;
    rep(i, 1, f + 1){
        rep(j, f + 1){
            if(not dp1[i] or not dp2[j]) continue;
            if(i + j > f) continue;
            if(e * i / 100 < j) continue;

            R cur = 100.0 * j / (i + j);
            if(cur >= res){
                res = cur;
                res1 = i;
                res2 = j;
            }
        }
    }

    cout << res1 + res2 << " " << res2 << endl;

    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(){
	int n;
	bool ans=false;

	scanf("%d", &n);

	for(int i=0; i<26; i++){
		for(int j=0; j<15; j++){
			if((4*i + 7*j) == n){
				ans = true;
				break;
			}
		}
		if(ans)	break;
	}

	if(ans)	printf("Yes\n");
	else	printf("No\n");

	return 0;
}


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

int main(){
	int n,cnt=0;
	cin>>n;
	for(int i=1;i<n;i++){
		if(n%i==0)cnt+=(n/i-1);
		else cnt+=(n/i);
	}
	cout<<cnt;
 	return 0;
}


Measured memory_bytes: 3632
#include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <cstdlib>
#include <list>
#include <numeric>
#define rep(i,n) for(int i=0;i<n;i++)
#define all(x) (x).begin(),(x).end()
using namespace std;

int a, b = 0,c, n, k;
string s, t;
//cout<<<<endl;


bool anagram(string s,string t)
{
	sort(all(s)); sort(all(t));
	if (s == t)
		return 1;
	else
		return 0;
}

int main()
{
	cin >> n;
	string s;
	cin >> s;
	
	int t = 0;
	rep(i, n)
	{
		if (s[i] == 'I')
			t++;
		else
			t--;
		c = max(c, t);
	}
	
	cout << c << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ipair = pair<int, int>;
using P = pair<int, int>;
using ll = long long;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())

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

const double PI=3.14159265358979323846;

const int mod = 1e9+7;

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

struct Sieve {
  int n;
  vector<int> f, primes;
  Sieve(int n=1):n(n), f(n+1) {
    f[0] = f[1] = -1;
    for (ll i = 2; i <= n; ++i) {
      if (f[i]) continue;
      primes.push_back(i);
      f[i] = i;
      for (ll j = i*i; j <= n; j += i) {
        if (!f[j]) f[j] = i;
      }
    }
  }
  bool isPrime(int x) { return f[x] == x;}
  vector<int> factorList(int x) {
    vector<int> res;
    while (x != 1) {
      res.push_back(f[x]);
      x /= f[x];
    }
    return res;
  }
  vector<P> factor(int x) {
    vector<int> fl = factorList(x);
    if (fl.size() == 0) return {};
    vector<P> res(1, P(fl[0], 0));
    for (int p : fl) {
      if (res.back().first == p) {
        res.back().second++;
      } else {
        res.emplace_back(p, 1);
      }
    }
    return res;
  }
};

int main(){
  Sieve sieve(1e6);
  int N;
  cin >> N;
  vector<ll> A(N);
  rep(i, N) cin >> A[i];

  map<int, int> mp;
  rep(i, N){
    auto f = sieve.factor(A[i]);
    for(auto p: f){
      chmax(mp[p.first], p.second);
    }
  }

  mint lcm = 1;
  for(auto p: mp){
    rep(i, p.second){
      lcm *= p.first;
    }
  }

  mint ans=0;
  rep(i, N){
    mint b = lcm / A[i];
    ans += b;
  }

  cout << ans.x << endl;
}


Measured memory_bytes: 4984
#include <bits/stdc++.h> 
using namespace std; 
int main() {
  int a,b,c,d;
  cin>>a>>b>>c>>d;
  if (a+b>c+d){
    cout<<"Left"<<endl;
  }
  else if (a+b==c+d){
    cout<<"Balanced"<<endl;
  }
  else {
    cout<<"Right"<<endl;
  }
}

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

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    vector<long long> x(n), y(n);
    multiset<pair<long long, long long>> b;
    long long maxr = 0, minr = 1e9, maxb = 0, minb = 1e9;
    for (int i = 0; i < n; i++) {
        cin >> x[i] >> y[i];
        maxr = max(maxr, max(x[i], y[i]));
        minr = min(minr, max(x[i], y[i]));
        maxb = max(maxb, min(x[i], y[i]));
        minb = min(minb, min(x[i], y[i]));
        b.emplace(min(x[i], y[i]), max(x[i], y[i]));
    }
    long long ans = (maxr - minr) * (maxb - minb); 
    long long delta = maxr - minb;
    while (true) {
        long long mul = b.rbegin()->first - b.begin()->first;
        ans = min(ans, delta * mul);
        auto it = *b.begin();
        if (it.first >= it.second) break;
        b.erase(b.begin());
        b.emplace(it.second, it.first);
    }
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 16768
#include <bits/stdc++.h>
#define ll long long int 
#define endl '\n'
#define INF 1000000000
#define MOD 1000000007
#define MAX 200001 
using namespace std;
int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n,ans=0,t;
    cin>>n;
    ll a[n];
    for(int i=0;i<n;i++)
    {
    	cin>>a[i];
    }
    for(int i=1;i<n;i++)
    {
    	if(a[i]<a[i-1])
    	{
    		t=a[i-1]-a[i];
    		a[i]+=t;
    		ans+=t;
    	}
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 5168
#include <bits/stdc++.h>
using namespace std;
#define iinf 2000000000
#define linf 1000000000000000000LL
#define ulinf 10000000000000000000ull
#define MOD1 1000000007LL
#define mpr make_pair
typedef long long LL;
typedef unsigned long long ULL;
typedef unsigned long UL;
typedef unsigned short US;
typedef pair < int , int > pii;
clock_t __stt;
inline void TStart(){__stt=clock();}
inline void TReport(){printf("\nTaken Time : %.3lf sec\n",(double)(clock()-__stt)/CLOCKS_PER_SEC);}
template < typename T > T MIN(T a,T b){return a<b?a:b;}
template < typename T > T MAX(T a,T b){return a>b?a:b;}
template < typename T > T ABS(T a){return a>0?a:(-a);}
template < typename T > void UMIN(T &a,T b){if(b<a) a=b;}
template < typename T > void UMAX(T &a,T b){if(b>a) a=b;}
int n,m,res;
pii qs[1000005];
namespace segT{
	int s[2000005],t[2000005];
	void init(int p,int L,int R){
		s[p]=-1;
		t[p]=-1;
		if(L<R){
			int M=((L+R)>>1);
			init((p<<1),L,M);
			init(((p<<1)|1),M+1,R);
		}
	}
	void modify(int p,int d,int v,int l=0,int r=m){
		if(l==r){
			s[p]=t[p]=v;
			return;
		}
		int M=((l+r)>>1);
		if(d<=M)modify((p<<1),d,v,l,M);
		else	modify(((p<<1)|1),d,v,M+1,r);
		s[p]=s[p<<1]+s[(p<<1)|1];
		t[p]=MAX(t[p<<1],t[(p<<1)|1]+s[p<<1]);
	}
	void add(int p,int d,int v,int l=0,int r=m){
		if(l==r){
			s[p]+=v;
			t[p]+=v;
			return;
		}
		int M=((l+r)>>1);
		if(d<=M)add((p<<1),d,v,l,M);
		else	add(((p<<1)|1),d,v,M+1,r);
		s[p]=s[p<<1]+s[(p<<1)|1];
		t[p]=MAX(t[p<<1],t[(p<<1)|1]+s[p<<1]);
	}
	int query(int p,int R,int c=0,int l=0,int r=m){
		if(l==r) return s[p]+c;
		int M=((l+r)>>1);
		if(R>M){
			return MAX(t[p<<1]+c,query(((p<<1)|1),R,c+s[p<<1],M+1,r));
		}
		else{
			return query((p<<1),R,c,l,M);
		}
	}
};
int main(){
    // inputting start
    // 数据结构记得初始化！ n，m别写反！
    scanf("%d%d",&n,&m);
	++m;
	int i,j,k;
	for(i=0;i<n;++i){
		scanf("%d%d",&qs[i].first,&qs[i].second);
	}
    #ifdef LOCAL
        TStart();
    #endif
    // calculation start
    // 数据结构记得初始化！ n，m别写反！
    sort(qs,qs+n);
	segT::init(1,0,m);
	segT::modify(1,0,0);
	segT::modify(1,m,0);
	for(i=1;i<m;++i) segT::modify(1,i,-1);
	res=MAX(0,n-m+1);
	for(i=0;i<n;++i){
		segT::add(1,m-qs[i].second,1);
		UMAX(res,segT::query(1,m-qs[i].first-1)-qs[i].first);
	}
	printf("%d\n",res);
    #ifdef LOCAL
        TReport();
    #endif
    return 0;
}


Measured memory_bytes: 12544
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define ld long double
#define f(i,x,n) for(int i=x;i<n;i++)
#define int long long
#define mod 1000000007
#define endl "\n"
const int INF = 1e18;
void fastio()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
}
int32_t main() 
{
	fastio();
	int n;
	cin>>n;
	string s;
	cin>>s;
	f(i,0,s.length())
	{
		int aa=s[i]-'A';
		aa=(aa+n)%26;
		aa=aa+'A';
		//cout<<aa;
		s[i]=(char)(aa);
	}
	cout<<s;
}

Measured memory_bytes: 256
N =int(input())
H = list(map(int,input().split()))
a = [0]
count = 0
for i in range(N-1):
    if H[i] >= H[i+1]:
        count += 1
    else:
        a.append(count)
        count = 0
    a.append(count)
print(max(a))

Measured memory_bytes: 14252
#include <bits/stdc++.h>
using namespace std;
int n,m,q,a[100005],b[100005],c[100005],e[100005],vis[100005],ans[100005];
vector<int> all;
vector<pair<int,int> > l[100005],r[100005];
struct bit
{
	int s[100005];
	int lowbit(int x)
	{
		return x&(-x);
	}
	void add(int x,int y)
	{
		int i;
		for(i=x;i<=m;i+=lowbit(i)) s[i]+=y;
	}
	int sum(int x)
	{
		int i,ss=0;
		for(i=x;i;i-=lowbit(i)) ss+=s[i];
		return ss;
	}
}tr;
struct node1
{
	int l,r,id;	
};
struct node2
{
	int l,r,id;	
};
bool operator <(node1 x,node1 y)
{
	return x.l>y.l;
}
bool operator <(node2 x,node2 y)
{
	return x.r<y.r;
}
priority_queue<node1> q1;
priority_queue<node2> q2;
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%d%d",&a[i],&b[i]);
	}
	for(int i=1;i<=n+1;i++)
	{
		scanf("%d",&c[i]);
		all.push_back(c[i]);
	}
	scanf("%d",&q);
	sort(all.begin(),all.end());
	all.resize(unique(all.begin(),all.end())-all.begin());
	for(int i=1;i<=n+1;i++)
	{
		c[i]=upper_bound(all.begin(),all.end(),c[i])-all.begin();
	}
	for(int i=1;i<=n;i++)
	{
		a[i]=lower_bound(all.begin(),all.end(),a[i])-all.begin()+1;
		b[i]=lower_bound(all.begin(),all.end(),b[i])-all.begin()+1;
		e[i]=min(a[i],b[i]);
		if(b[i]<a[i])
		{
			l[b[i]].push_back(make_pair(a[i]-1,i));
			r[a[i]-1].push_back(make_pair(b[i],i));
		}
	}
	m=all.size();
	sort(c+1,c+n+2);sort(e+1,e+n+1);
	
	for(int i=1;i<=n;i++)
	{
		tr.add(e[i],1);
	}
	for(int i=1;i<=n+1;i++)
	{
		tr.add(c[i],-1);
	}
	for(int i=1;i<=m;i++)
	{
		if(tr.sum(i)<-1)
		{
			while(q--)
			{
				puts("-1");
			}
			return 0;
		}
	}
	for(int i=1;i<=n;i++)
	{
		tr.add(e[i],-1);
		tr.add(a[i],1);
	}
	int cnt=0;
	for(int i=m;i;i--)
	{
		int sum=tr.sum(i);
		for(int j=0;j<r[i].size();j++)
		{
			q1.push((node1){r[i][j].first,i,r[i][j].second});
		}
		if(sum>=-1) continue;
		sum=-(sum+1);
		while(sum--)
		{
			node1 t=q1.top();q1.pop();
			cnt++;vis[t.id]=1;
			tr.add(t.l,1);
			tr.add(t.r+1,-1); 
		}
	}
	ans[0]=cnt;
	for(int i=1;i<=m;i++)
	{
		int sum=tr.sum(i);
		for(int j=0;j<l[i].size();j++) if(!vis[l[i][j].second])
		{
			q2.push((node2){i,l[i][j].first,l[i][j].second});
		}
		if(sum>=0){ans[i]=cnt;continue;}
		sum=-sum;
		bool su=1;
		while(sum--)
		{
			if(q2.empty()){su=0;break;}
			node2 t=q2.top();q2.pop();
			if(t.r<i){su=0;break;}
			cnt++;vis[t.id]=1;
			tr.add(t.l,1);
			tr.add(t.r+1,-1); 
		}
		if(!su)
		{
			for(int j=i;j<=m;j++)
			{
				ans[j]=0x3f3f3f3f;
			}
			break;
		}
		ans[i]=cnt;
	}
	
	while(q--)
	{
		int x,y;
		scanf("%d%d",&x,&y);
		x=lower_bound(all.begin(),all.end(),x)-all.begin()+1;
		y=lower_bound(all.begin(),all.end(),y)-all.begin()+1;
		int res=max(n+1-ans[x-1],n-ans[y-1]);
		printf("%d\n",max(-1,res));
	}
	return 0;
}

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

int main() {
	char let; cin >> let;
	if(let=='a') cout << "vowel" << endl;
	else if(let=='e') cout << "vowel" << endl;
	else if(let=='i') cout << "vowel" << endl;
	else if(let=='o') cout << "vowel" << endl;
	else if(let=='u') cout << "vowel" << endl;
	else cout << "consonant" << endl;
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string.h>
#include<string>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
using namespace std;
int n,h,w,a[100100],b[100100],cnt=0;

int read()
{
	int x=0,f=1;char ch=getchar();
	while ((ch<'0') || (ch>'9')) {if (ch=='-') f=-1;ch=getchar();}
	while ((ch>='0') && (ch<='9')) {x=x*10+(ch-'0');ch=getchar();}
	return x*f;
}

int main()
{
	n=read();h=read();w=read();int i;
	for (i=1;i<=n;i++)
	{
		a[i]=read();b[i]=read();
		if ((a[i]>=h) && (b[i]>=w)) cnt++;
	}
	cout << cnt;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include<time.h>
#include<string>
#include<cstring>
#include <cstdio>
#include<utility>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#include<bitset>
#include<queue>
#include<stack>
#include<set>
#include <limits>
#include <climits>
#include <numeric>
#include<cassert>
#include<cctype>
#include<iterator>
#include<unordered_map>
using namespace std;
typedef long long ll;
typedef unsigned long long LL;
typedef vector<ll>VI;
typedef vector<bool>VB;
typedef pair<ll,ll>P;
typedef pair<double,double>P_D;
#define VV(T) vector<vector<T>>
#define PI 3.1415926535897932384626433832795
#define rep(i, n) for (ll i = 0; i < (ll)n; i++)
#define reprev(i, n) for (ll i = (ll)n - 1; i >= 0; i--)
#define bitrep(bit,A) for(int bit=A; ;bit=(bit-1)&A)
#define ALL(a)  (a).begin(),(a).end()
#define SZ(a) (ll)((a).size())
#define c_max(a, b) (((ll)a)>((ll)b)?(a):(b))
#define c_min(a,b) (((ll)a)<((ll)b)?(a):(b))
#define chmax(x,a) x=c_max(x,a)
#define chmin(x,a) x=c_min(x,a)
#define vmax(v) *max_element(ALL(v))
#define vmin(v) *min_element(ALL(v))
#define SORT(c) stable_sort(ALL(c))
#define $(x) {cout<<#x<<" = " <<(x)<<endl;}
#define fi first
#define se second
#define MAX 100100//5
#define MAX2 200100
#define MAX_6 1001001//6
#define MAX_7 10010010//7
#define SENTINEL 2000000000//9
#define NIL -1
#define MOD 1000000007
#define INF 1<<30
#define INFTY 1000000000000000001LL
#define MAX_INT INT_MAX
#define Endl '\n'
#define greater greater<int>()
inline ll GCD(ll a,ll b){return b?GCD(b,a%b):a;}
inline ll lcm(ll a,ll b){return a*b/GCD(a,b);}
using Graph=vector<vector<ll> >;//int と P
// g++ -o a a.cpp -Wall -lm -std=c++14
ll n;
void solve(ll n,ll &counter,ll cur=0,ll bit=0){
    if(cur>n)return;
    if(bit==0b111)counter++;
    solve(n,counter,cur*10+7,bit|0b001);
    solve(n,counter,cur*10+5,bit|0b010);
    solve(n,counter,cur*10+3,bit|0b100);
}
int main(){
    cin>>n;
    ll res=0;
    solve(n,res);
    cout<<res<<endl;

}

Measured memory_bytes: 3596
#include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <queue>
#include <stack>

using namespace std;

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define REPO(i, n) for(int i = 1;i <= n;i++)
#define ll long long
#define INF 1999999999
#define MINF -1999999999
#define INF64 1999999999999999999
#define ALL(n) n.begin(),n.end()
#define ABS(a,b) max(a,b) - min(a,b)


int main() {
	int n, m, ans = 0;
	cin >> n >> m;
	ans += (n - m) * 100 + m * 1900;
	REP(i, m) ans *= 2;
	cout << ans << endl;
}

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

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

signed main(){
    int N,K;
    cin>>N>>K;
    cout<<(N%K?1:0)<<endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    list<int> q;
    list<int>::iterator itr=q.end();
    int n,x,d,j;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>j;
        if(j==0){
            cin>>x;
            itr=q.insert(itr,x);
        }
        else if(j==1){
            cin>>d;
            if(d>0){
                for(int i=0;i<d;i++)itr++;
            }
            else {
                for(int i=0;i>d;i--)itr--;
            }
        }
        else if(j==2){
            itr=q.erase(itr);
        }
    }
    for(itr=q.begin();itr!=q.end();itr++){
        cout<<*itr<<endl;
    }
    return 0;
}



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

const int limit = 1000000;
bool prime[limit + 10];

void era() {
    for(int i = 0; i < limit; i++) prime[i] = true;
    prime[0] = prime[1] = false;
    for(int i = 2; i * i <= limit; i++) {
        if(prime[i]) {
            for(int j = 2 * i; j < limit; j += i) {
                prime[j] = false;
            }
        }
    }
}

int main() {
    era();
    int n;

    while(cin >> n) {
        int ans = 0;

        for(int i = 0; i <= n; i++) {
            if(prime[i]) ans++;
        }
        cout << ans << endl;
    }
}


Measured memory_bytes: 4068
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double D;
typedef pair<ll,ll> P;
#define M 1000000007
#define F first
#define S second
#define PB push_back
#define INF 100000000000000000
int a,b,c,d;
int main(void){
    
    cin>>a>>b>>c>>d;
    if(a!=c)cout<<1<<endl;
    else cout<<0<<endl;
}


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

int main(){
	int N,W;
	cin>>N>>W;
	int v[N],w[N];
	for(int i=0;i<N;i++){
		cin>>v[i]>>w[i];
	}
	
	int DP[N+1][W+1];
	for(int i=0;i<N+1;i++){
		DP[i][0]=0;
	}
	for(int i=0;i<W+1;i++){
		DP[0][i]=0;
	}
	for(int i=1;i<=N;i++){
		for(int j=1;j<=W;j++){
			if(j<w[i-1]){
				DP[i][j]=DP[i-1][j];
			}else{
				if(DP[i][j-w[i-1]]+v[i-1]>DP[i-1][j]){
					DP[i][j]=DP[i][j-w[i-1]]+v[i-1];
				}
				else{
					DP[i][j]=DP[i-1][j];
				}
			}
		}
	}
	
	cout<<DP[N][W]<<endl;
	return 0;
		
}

Measured memory_bytes: 6996
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        String S = scan.next();
        if (S.length() == 2) {
            System.out.println(S);
        } else {
            System.out.println(new StringBuffer(S).reverse().toString());
        }
    }
}


Measured memory_bytes: 21844
#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#define REP(i, n) for(int i=0;i<n;++i)

typedef long long ll;
using namespace std;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n, m;
    cin >> n >> m;
    vector<ll> a = {};
    priority_queue<pair<ll, ll>> que;
    for(ll i=0;i<n;++i){
        ll x;
        cin >> x;
        que.push(make_pair(x, 1));
    }
    sort(a.begin(), a.end());
    vector<ll> b = {};
    vector<ll> c = {};    
    for(ll i=0;i<m;++i){
        ll x, y;
        cin >> x >> y;
        que.push(make_pair(y, x));
    }

    ll ans = 0;
    REP(i, n){
        auto p = que.top();
        que.pop();
        ans += p.first;
        if(p.second>1){
            --p.second;
            que.push(p);
        }
    }
    cout << ans << "\n";

    return 0;
}


Measured memory_bytes: 6512
using System;
using System.Collections.Generic;

enum occupant
{
build, floor, room, number
}

class Program
 {



    static void Main(string[] args)
    {
        string nyuryoku;


        double num,temp;
        var result = new List<double>();

        nyuryoku = Console.ReadLine();

        string data = nyuryoku + nyuryoku;

        nyuryoku = Console.ReadLine();
        if (data.Contains(nyuryoku))
            Console.WriteLine("Yes");
        else
            Console.WriteLine("No");

    }

 }



Measured memory_bytes: 17912
#include<bits/stdc++.h>
using namespace std;
int n,m,k;
int main()
{
    scanf("%d%d%d",&n,&m,&k);
    for(int i=0;i<=n;++i)
        for(int j=0;j<=m;++j)
        {
            if(i*m+j*n-i*j*2==k)
            {
                puts("Yes");
                exit(0);
            }
        }
    puts("No");
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<vector<vector<ll>>> vvvl;
struct edge{ll to,cost;};
const int inf = 1<<28;
const ll INF = 1LL<<53;
const int COMBMAX = 500005;
const ll MOD = 1e9+7;
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i=0;i<n;++i)
#define repf(i,n) for(int i=0;i<=n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
#define eachdo(v, e) for(const auto& e : v)
#define all(v) (v).begin(), (v).end()
#define lower_index(v, e) (ll)distance(v.begin(), lower_bound((v).begin(), (v).end(), e))
#define upper_index(v, e) (ll)distance(v.begin(), upper_bound((v).begin(), (v).end(), e))
ll mpow(ll a, ll n,ll mod=MOD){ll res=1;while(n>0){if(n&1)res=res*a%mod;a=a*a%mod;n>>=1;}return res;}
template<class T1, class T2> ll bcount(T1 v, T2 a){return upper_index(v,a)-lower_index(v,a);} 
template<class T> bool chmin(T &a, T b){if(a>b){a=b;return true;}return false;}
template<class T> bool chmax(T &a, T b){if(a<b){a=b;return true;}return false;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}
template<class T> void debug2(T v){rep(i,v.size()){rep(j,v[i].size())cout<<v[i][j]<<" ";cout<<endl;}}
template<class T> void rdv(T &v){rep(i,v.size())cin>>v[i];}
template<class T> void rdvv(T &v){rep(i,v.size()){rep(j,v[i].size())cin>>v[i][j];}}
// multimap
// mmap.emplace(key,value);
// auto ngw = list.equal_range("");
// for(auto e = ngw.first; it != ngw.second ; ++e)


int main(){
    ll X, Y, A, B, C; cin >> X >> Y >> A >> B >> C;
    vl p(A); rdv(p);
    vl q(B); rdv(q);
    vl r(C); rdv(r);
    sort(all(p));
    sort(all(q));
    sort(all(r));
    reverse(all(p));
    reverse(all(q));
    reverse(all(r));
    vl cont(X + Y + 1, 0);
    ll atep = 0, ateq = 0;
    rep1(i, X + Y){
        cont[i] += cont[i - 1];
        if (X <= atep || (p[atep] <= q[ateq] && ateq < Y)){
            cont[i] += q[ateq];
            ateq++;
        }else{
            cont[i] += p[atep];
            atep++;
        }
    //     cout << atep << " " << ateq << endl;
    }
    // debug(cont);
    vl cr(C + 1, 0);
    rep1(i,C){
        cr[i] = cr[i - 1] + r[i - 1];
    }
    ll ans = 0;
    rep(i, min(C + 1, X + Y + 1)){
        chmax(ans, cr[i] + cont[X + Y - i]);
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 4736
#ifndef ONLINE_JUDGE
    #include "debug.cpp"
#endif

#include <bits/stdc++.h>

using namespace std;

#define int long long
#define ar array

string lcs( string X, string Y, int m, int n ) 
{ 
   int L[m+1][n+1]; 
  
   /* Following steps build L[m+1][n+1] in bottom up fashion. Note 
      that L[i][j] contains length of LCS of X[0..i-1] and Y[0..j-1] */
   for (int i=0; i<=m; i++) 
   { 
     for (int j=0; j<=n; j++) 
     { 
       if (i == 0 || j == 0) 
         L[i][j] = 0; 
       else if (X[i-1] == Y[j-1]) 
         L[i][j] = L[i-1][j-1] + 1; 
       else
         L[i][j] = max(L[i-1][j], L[i][j-1]); 
     } 
   } 
  
   // Following code is used to print LCS 
   int index = L[m][n];
   int ind = index; 
  
   // Create a character array to store the lcs string 
   //char lcs[index+1]; 
   string ans(index+1,'\0');
   ans[index] = '\0'; // Set the terminating character 
  
   // Start from the right-most-bottom-most corner and 
   // one by one store characters in ans[] 
   int i = m, j = n; 
   while (i > 0 && j > 0) 
   { 
      // If current character in X[] and Y are same, then 
      // current character is part of ans 
      if (X[i-1] == Y[j-1]) 
      { 
          ans[index-1] = X[i-1]; // Put current character in result 
          i--; j--; index--;     // reduce values of i, j and index 
      } 
  
      // If not same, then find the larger of two and 
      // go in the direction of larger value 
      else if (L[i-1][j] > L[i][j-1]) 
         i--; 
      else
         j--; 
   } 
   string res = "";
   for(int i = 0;i < ind; i++){
   		res += ans[i];
   } 
   return res;
   // Print the ans 
} 
void solve(){
	string s, t;
	cin >> s >> t;
	cout << lcs(s,t,s.size(),t.size()) << "\n";
}

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

    int TC = 1;
    while(TC--)
        solve();

    return 0;
}



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

int main() {
  ll n, m;
  cin >> n >> m;
  if (n == m) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; --i)
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define FORR(i, a, b) for (int i = b - 1; i >= a; --i)
#define SORT(v) sort(v.begin(), v.end())
#define SORTR(v) sort(v.rbegin(), v.rend())
#define REV(v) reverse(v.begin(), v.end())
#define ITER(v) for (auto itr = v.begin(), itr != v.end(); ++itr)
#define LB(v, x) lower_bound(v.begin(), v.end(), x) - v.begin()
#define UB(v, x) upper_bound(v.begin(), v.end(), x) - v.begin()
using namespace std;
using ll = long long;
using P = pair<int, int>;

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

    int N;
    cin >> N;
    ll res = 0;
    FOR(i, 1, N + 1) {
        if (i % 3 && i % 5) res += i;
    }
    cout << res << endl;

    return 0;
}


Measured memory_bytes: 3640
#include <assert.h>
#include <limits.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using ll = long long;
using P = std::pair<ll, ll>;

template<typename T1,typename T2>
std::ostream& operator<< (std::ostream& os,std::pair<T1,T2> pa){return os<<"["<<pa.first<<", "<<pa.second<<"]";}

template<typename T>
std::ostream& operator<< (std::ostream& os,std::vector<T> vec){
  os<<"{";
  for(int i=0;i<vec.size();i++)os<<vec[i]<<(i+1 == vec.size()?"":", ");
  os<<"}";
  return os;
}

#define rep(i, a, b) for (ll(i) = (a); i < (b); i++)
#define all(i) i.begin(), i.end()
#define debug(i) std::cerr << "debug " << i << std::endl

// const ll MOD = 998244353;
const ll MOD = 1e9 + 7;

int main() {
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);
  //問題文中の添え字が0-indexか1-indexか確認!

  ll h,w,a,b;
  std::cin>>h>>w>>a>>b;

  rep(i,0,h){
    rep(j,0,w){
      std::cout<<(((i<b)^(j<a))?'0':'1');
    }
    std::cout<<"\n";
  }

  return 0;
}

Measured memory_bytes: 1280
#include<bits/stdc++.h>
using namespace std;
#define F first
#define S second
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> pl;
typedef pair<int,int> pi;
typedef pair<ll,pl> pp;
const ll MOD = 1e9+7;
const ll MAX = 1e18*2;

int main(){
  ll n,a[111111],b[111111],c[111111];
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>a[i]>>b[i]>>c[i];
  }
  ll dp[111111][3]={};
  for(int i=0;i<n;i++){
    for(int j=0;j<3;j++){
	 if(j!=0)dp[i+1][0]=max(dp[i+1][0],dp[i][j]+a[i]);
	 if(j!=1)dp[i+1][1]=max(dp[i+1][1],dp[i][j]+b[i]);
	 if(j!=2)dp[i+1][2]=max(dp[i+1][2],dp[i][j]+c[i]);
    }
  }
  cout<<max({dp[n][0],dp[n][1],dp[n][2]})<<endl;
  return 0;
}


Measured memory_bytes: 5504
#include <bits/stdc++.h>
#define ll long long

using namespace std;

int mod = 1e9 + 7;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int s;
    cin >> s;
    vector<int> dp(s + 1);
    dp[0] = 1;
    dp[1] = 0;
    dp[2] = 0;
    for(int i = 3; i <= s; i++)
    {
        int cnt = 0;
        for(int j = 3; j <= i; j++)
        {
            cnt = (cnt + dp[i - j]) % mod;
        }
        dp[i] = cnt;
    }

    cout << dp[s] << endl;

    return 0;
}




Measured memory_bytes: 3584
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define yesno(flg) if(flg){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define MAX_N 1002
#define i197 1000000007

using namespace std;

typedef long long ll;
typedef pair<ll,ll> P1;
typedef pair<int,int> Pi;
typedef pair<double,Pi> Pdi;
typedef pair<ll,int>Pli;
typedef pair<P1,ll> P2;
const ll INF=100000000000000001;
struct edge{int to,cost;};
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
struct Road{double cost;int a,b;};


int main() {


	int n,k;

	cin>>n>>k;

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


	return 0;
}


Measured memory_bytes: 256
def NextAmari(prev,d):
    return((prev*10+d)%13)

S = input()
mod = 10**9 + 7
DP = [[0]*13 for i in range(len(S)+1)]#DP[i][j] = 上位i桁目まで見たときの、j(mod13)の数　0<=j<13

DP[0][0] = 1
for n,s in enumerate(S):
    i = n
    if s != "?":
        d = int(s)
        for j,num in enumerate(DP[i]):
            DP[i+1][NextAmari(j,d)] += num
    else:
        for d in range(10):
            for j,num in enumerate(DP[i]):
                DP[i+1][NextAmari(j,d)] += num
    for a in range(13):
        DP[i+1][a] %= mod
print(DP[-1][5])

Measured memory_bytes: 61916
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <string>
#include <set>
#include <queue>
#include <stack>
#include <cmath>
#include <functional>
#define fi first
#define se second
using namespace std;
bool value(int y,int x,int R,int C){return 0<=y&&y<R&&0<=x&&x<C;}
typedef pair<int,int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long > vll;
typedef vector< vi > vvi;
double pie=acos(-1);
int dx[4] = { 0,-1,0,1 };
int dy[4] = { -1,0,1,0 };
int dp[105][10050];
int main() {
	int N,W;
	int v[105],w[105];
	cin>>N>>W;
	for(int i=0;i<N;i++){
		cin>>v[i]>>w[i];
	}
	/*for(int i=0;i<N;i++){
		for(int j=0;j<=W;j++){
			for(int k=0;k*w[i]<=j;k++){
				dp[i+1][j]=max(dp[i][j],dp[i][j-k*w[i]]+k*v[i]);
			}
		}
	}*/
	//TLE
	for(int i=0;i<N;i++){
		for(int j=0;j<=W;j++){
			if(j<w[i]){
				dp[i+1][j]=dp[i][j];
			}
			else{
				dp[i+1][j]=max(dp[i][j],dp[i+1][j-w[i]]+v[i]);
			}
		}
	}
	cout<<dp[N][W]<<endl;
}

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

#include <fstream>
using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << setprecision(20) << fixed;
  /*
  ifstream in("input.txt");
  cin.rdbuf(in.rdbuf());
  //*/
  int N, M, C;
  cin >> N >> M >> C;
  vector<int> B(M);
  int sum = 0;
  int ans = 0;
  for(int i = 0; i < M; i++) cin >> B[i];
  for(int i = 0; i < N; i++){
    sum = 0;
    for(int j = 0; j < M; j++){
      int A;
      cin >> A;
      sum += B[j] * A;
    }
    sum += C;
    if(sum > 0){
      ans ++;
    }
  }
  cout << ans <<endl;
}


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

int N;
int p[11];       // 最大 200 個なので余裕を持って 210 に --- 200 以上ならなんでもよいです

int main() {
    cin >> N;
    for (int i = 0; i < N; ++i) cin >> p[i];
    int Max = 100;
    int price = 0;

    for (int i = 0; i < N; ++i){
        Max = max(Max, p[i]);
    }

    for (int i = 0; i < N; ++i){
        price += p[i];
    }


    cout << price - Max/2 << endl;


}

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

using namespace std;
 
#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()
#define _P(...) (void)fprintf(stderr, __VA_ARGS__)

typedef int64_t ll; typedef vector<int> VI; typedef pair<int,int> pii;
const ll mod = 1e9+7;

void dbg(){ cerr << "\n"; }  
template <typename T,typename ...T2>
void dbg(const T& fst, const T2&...rst){ cerr << fst << ": "; dbg(rst...); }

int main()
{
 
	//cin.tie(0); ios_base::sync_with_stdio(false);
	int n;
	cin >>n;
	VI a(n), b(n), c(n);
	rep(i,n) cin >>a[i];
	rep(i,n) cin >>b[i];
	rep(i,n) cin >>c[i];
	

	vector<pii> vp; vp.reserve(3*n);
	rep(i, n){
		vp.emplace_back(a[i], 2);
		vp.emplace_back(b[i], 1);
		vp.emplace_back(c[i], 0);
	}
	sort(all(vp));
	vector<ll> ct(5);
	ct[0] = 1;
	for(auto x: vp){
		int cr = x.second;
		ct[3-cr] += ct[3-cr-1];
		
	}
	
	cout << ct[3] <<"\n";
	return 0;
}

Measured memory_bytes: 3712
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll mod=1e9+7;
ll dp[1001][1001];
int main()
{
	ll n,m,i,j;
	cin >> n >> m;
	string s[n];
	for(i=0;i<n;i++)
		cin >> s[i];
	
	dp[0][0]=1;	
	for(i=0;i<n;i++)
	{
		for(j=0;j<m;j++)
		{
			ll r1=i+1;
			ll c1=j;
			ll r2=i;
			ll c2=j+1;
			if(r1<n && c1<m && s[r1][c1]=='.')
			{
				dp[r1][c1]+=dp[i][j];
				dp[r1][c1]%=mod;
			}
			if(r2<n && c2<m && s[r2][c2]=='.')
			{
				dp[r2][c2]+=dp[i][j];
				dp[r2][c2]%=mod;
			}
		}
	}
	cout<<dp[n-1][m-1]<<"\n";
}

Measured memory_bytes: 9088