akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>
int main()
{
            float D,T,S;
            float R;
            scanf("%f",&D);
              scanf("%f",&T);
                scanf("%f",&S);

                if(D>=1&&D<=10000&&T>=1&&T<=10000&&S>=1&&S<=10000)
                {
                      R=D/T;

                      if(S>=R)
                        {
                                    printf("Yes\n");
                        }

                                    else

                                    {


                                                printf("No\n");
                                    }
                        }

}


Measured memory_bytes: 1728
N, A, B, C, D, E= [float(input()) for _ in range(6)]
cities = [A, B, C, D, E]
P = [N, 0, 0, 0, 0, 0]
t = 0
while True:
  for i, c in enumerate(cities):
    s = P[i] - c
    if s < 0 :
      P[i+1] += P[i]
      P[i] = 0
    else :
      P[i+1] += c
      P[i] = s
    t += 1
  if(P[5] > 0):
    break
print(int(-(-N//P[5]) + t - 1))


Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define ADD(a, b) a = (a + ll(b)) % mod
#define MUL(a, b) a = (a * ll(b)) % mod
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define rep(i, a, b) for(int i = int(a); i < int(b); i++)
#define rer(i, a, b) for(int i = int(a) - 1; i >= int(b); i--)
#define all(a) (a).begin(), (a).end()
#define sz(v) (int)(v).size()
#define pb push_back
#define sec second
#define fst first
#define debug(fmt, ...) Debug(__LINE__, ":", fmt, ##__VA_ARGS__)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<int, pi> ppi;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> mat;
typedef complex<double> comp;
void Debug() {cout << '\n'; }
template<class FIRST, class... REST>void Debug(FIRST arg, REST... rest){
	cout<<arg<<" ";Debug(rest...);}
template<class T>ostream& operator<<(ostream& out,const vector<T>& v) {
	out<<"[";if(!v.empty()){rep(i,0,sz(v)-1)out<<v[i]<<", ";out<<v.back();}out<<"]";return out;}
template<class S, class T>ostream& operator<<(ostream& out,const pair<S, T>& v){
	out<<"("<<v.first<<", "<<v.second<<")";return out;}
const int MAX_N = 300010;
const int MAX_V = 100010;
const double eps = 1e-6;
const ll mod = 1000000007;
const int inf = 1 << 30;
const ll linf = 1LL << 60;
const double PI = 3.14159265358979323846;
///////////////////////////////////////////////////////////////////////////////////////////////////

int N;
vector<int> vec;
int ans[110];

void solve() {
	cin >> N;
	rep(i, 0, N) {
		int a; cin >> a; vec.pb(a);
	}
	rer(n, N + 1, 1) {
		int at = -1;
		vector<int> nvec;
		rep(j, 0, n) {
			if(vec[j] == j + 1) at = j;
		}
		ans[n - 1] = at + 1;
		if(at == -1) {
			cout << -1 << "\n"; return;
		}
		rep(j, 0, n) {
			if(at != j) nvec.pb(vec[j]);
		}
		vec = nvec;
	}
	rep(i, 0, N) {
		cout << ans[i] << "\n";
	}
}

int main() {
#ifndef LOCAL
	ios::sync_with_stdio(false);
    cin.tie(0);
#endif
    cout << fixed;
	cout.precision(20);
	srand((unsigned int)time(NULL));
#ifdef LOCAL
	//freopen("in.txt", "wt", stdout); //for tester
    freopen("in.txt", "rt", stdin);
#endif	
	solve();
#ifdef LOCAL
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
	return 0;
}



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

// #define int long long
#define rep(i, n) for (long long i = (long long)(0); i < (long long)(n); ++i)
#define reps(i, n) for (long long i = (long long)(1); i <= (long long)(n); ++i)
#define rrep(i, n) for (long long i = ((long long)(n)-1); i >= 0; i--)
#define rreps(i, n) for (long long i = ((long long)(n)); i > 0; i--)
#define irep(i, m, n) for (long long i = (long long)(m); i < (long long)(n); ++i)
#define ireps(i, m, n) for (long long i = (long long)(m); i <= (long long)(n); ++i)
#define SORT(v, n) sort(v, v + n);
#define REVERSE(v, n) reverse(v, v+n);
#define vsort(v) sort(v.begin(), v.end());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
#define PI (acos(-1))
#define FILL(v, n, x) fill(v, v + n, x);
#define sz(x) long long(x.size())

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vs = vector<string>;
using vpll = vector<pair<ll, ll>>;
using vtp = vector<tuple<ll,ll,ll>>;
using vb = vector<bool>;

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 ll INF = 1e9;
const ll MOD = 1e9+7;
const ll LINF = 1e18;



signed main()
{
  cin.tie( 0 ); ios::sync_with_stdio( false );
  ll s; cin>>s;
  ll x1=1e9, x2=1;
  ll y2=(s+x1-1)/x1, y1=x1*y2-s;
  // cout<<x1*y2-x2*y1<<endl;
  cout<<0 <<" "<<0 <<" "<<x1 <<" "<<y1 <<" "<<x2 <<" "<<y2 <<endl;
  
}

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

int main(){
    std::string s;
    std::cin >> s;

    std::string ss = s;
    std::sort(ss.begin(), ss.end());
    ss.erase(std::unique(ss.begin(), ss.end()), ss.end());

    int counter;
    bool flg = false;
    for(int i = 0; i < ss.size(); ++i){
        counter = std::count(s.begin(), s.end(), ss.at(i));
        if(0 == counter%2){
            flg = true;
        }else{
            flg = false;
            break;
        }
    }
    
    if(flg){
        std::cout << "Yes" << std::endl;
    }else{
        std::cout << "No" << std::endl;
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#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(obj) (obj).begin(),(obj).end()
#define INF 1LL << 60
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
typedef pair<ll,ll> p;
const long long MOD=1000000007;

// vector<p> cut(M); vector<vector<ll> > v(4);
// cut[i].second
// cut[i].first;
// REP(i,M){
//     int a,b;cin>>a>>b;
//     cut[i] = make_pair(b,a);//last first の順番
// }
// for(int i=0; i<N;i++){
// }
// sort(cut.begin(),cut.end()), sort(v.rbegin(), v.rend()); //sort
// char '' str ""
int main(void)
{
    int N,K; cin>>N>>K; int sum=0;
    for(int i=0; i<N;i++){
      int x; cin>>x;
      int t = min(K-x, x);
      sum += t;
    }

    cout<<2*sum<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#include <boost/multiprecision/cpp_ll.hpp>
//typedef boost::multiprecision::cpp_ll ll;
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
ll inf=(ll)1E16;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
string alp="abcdefghijklmnopqrstuvwxyz";
#define endl "\n"
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);



int main(){fastio
    ll n,k,c;cin>>n>>k>>c;
    string s;cin>>s;
    ll dp1[n],dp2[n];
    rep(i,0,n-1){
        if(i==0){
            if(s[i]=='o'){
                dp1[i]=1;
                rep(j,i+1,min(i+c,n-1)){
                    dp1[j]=dp1[i];
                }
                i=i+c;
            }else{
                dp1[i]=0;
            }
        }else{
            if(s[i]=='o'){
                dp1[i]=dp1[i-1]+1;
                rep(j,i+1,min(i+c,n-1)){
                    dp1[j]=dp1[i];
                }
                i=i+c;
            }else{
                dp1[i]=dp1[i-1];
            }
        }
    }
    
    for(ll i=n-1;i>0;i--){
        if(i==n-1){
            if(s[i]=='o'){
                dp2[i]=1;
                rep(j,max(0,i-c),i-1){
                    dp2[j]=1;
                }
                i=max(0,i-c);
            }else{
                dp2[i]=0;
            }
            continue;
        }
        if(s[i]=='o'){
            dp2[i]=dp2[i+1]+1;
            rep(j,max(0,i-c),i-1){
                dp2[j]=dp2[i];
            }
            i=max(0,i-c);
        }else{
            dp2[i]=dp2[i+1];
        }
    }
    
    
    
    rep(i,0,n-1){
        if(s[i]=='o'){
            if(i==0){
                if(dp2[i+1]==k-1){
                    cout<<i+1<<endl;
                }
            }else if(i==n-1){
                if(dp1[i-1]==k-1){
                    cout<<i+1<<endl;
                }
            }else{
                if(dp1[i-1]+dp2[i+1]==k-1){
                    cout<<i+1<<endl;
                }
            }
        }
    }
    
    return 0;
}


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

#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define repp(i, n, m) for(int (i) = (n); (i) < (m); (i)++)
#define repn(i, n) for(int (i) = 1; (i) <= (n); (i)++)
#define repr(i, n) for(int (i) = (n-1); (i) >= 0; (i)--)
#define all(x) (x).begin(), (x).end()
#define lint long long
#define ulint unsigned long long
#define ldou long double
#define fi first
#define se second
#define setpre(x) std::cout << fixed << setprecision(x)
#define ii(x) int x; cin >> (x)
#define ii2(x, y) int x, y; cin >> (x) >> (y)
#define ii3(x, y, z) int x, y, z; cin >> (x) >> (y) >> (z)
#define out(x) cout << (x) << endl
#define outs(x) cout << (x) << " "
#define yn(x) cout << ((x)?("Yes"):("No")) << endl
#define YN(x) cout << ((x)?("YES"):("NO")) << endl
#define bit_c(x) __builtin_popcountll(x)

inline void logger(){ std::cout << " [LOGGER] " << endl; }
template<typename A, typename... B>
void logger(const A& a, const B&... b){
    cout << a << " , "; logger(b...);
}

typedef pair<lint, lint> P;
const lint MOD = 1000000007;
const lint MOD9 = 998244353;
const lint INF = MOD * MOD;
const int MAX = 200005;

/* ...o(^-^)o... */
int n, m, q;

struct req{
    lint a, b, c, d;
};
req R[55];

lint rec(vector<lint> v, int i){
    if(i == n-1){
        lint ans = 0;
        rep(j, q){
            if(v[R[j].b] - v[R[j].a] == R[j].c){
                ans += R[j].d;
            }
        }
        return ans;
    }
    lint res = 0;
    repp(k, v[i], m+1){
        vector<lint> u = v;
        u.push_back(k);
        res = max(res, rec(u, i+1));
    }
    return res;
}


int main(){
    cin >> n >> m >> q;
    rep(i, q){
        int a, b, c, d; cin>>a>>b>>c>>d; a--; b--;
        R[i] = req{a,b,c,d};
    }

    lint ans = 0;
    repn(i, m){
        vector<lint> v = {i};
        ans = max(ans, rec(v, 0));
    }
    out(ans);

}

Measured memory_bytes: 3632
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] array = new int[n];
        
        int count = 0;
        int min = 99999999;
        while (n-- > 0) {
            int num = sc.nextInt();
            if (num < min) {
                count++;
                min = num;
            }
        }
        System.out.println(count);
    }
}


Measured memory_bytes: 82896
//
//  main.cpp
//  ATcode131
//
//  Created by didi on 2020/1/16.
//  Copyright © 2020年 didi. All rights reserved.
//

#include <iostream>
#include <map>
#include <vector>
#include <set>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <string>
#include <cassert>
#include <queue>
#include <list>
using namespace std;

#define ll long long

ll help(ll A, ll B, ll K) {
    ll ans = B/K - (A-1)/K;
    return ans;
}
ll gcd(ll a, ll b) {
    return b == 0 ? a : gcd(b, a%b);
}

int main(int argc, const char * argv[]) {
    int N;
    cin >> N;
    vector<pair<int, int>> A;
    int a = 0, b = 0;
    for (int i = 0; i < N; ++i) {
        cin >> a >> b;
        A.push_back({a, b});
    }
    sort(A.begin(), A.end(), [](const pair<int, int>& pr1, const pair<int, int>& pr2) {
        return pr1.second < pr2.second || (pr1.second == pr2.second && pr1.first < pr2.first);
    });
    int p = 0;
    for (auto& v: A) {
        p += v.first;
        if (p > v.second) {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}



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

int main(){
  int N,Qdom,Qabr;
  string ranking;
  cin >> N >> Qdom >> Qabr >> ranking;
  const int Qtot= Qdom+ Qabr;

  int q_tot= 0;
  int q_abr= 0;
  for(auto player:ranking){
    if(player=='a'){
      if(q_tot < Qtot){
        cout << "Yes" << endl;
        q_tot++;
      }
      else{
        cout << "No" << endl;
      }
    }
    else if(player=='b'){
      if(q_tot < Qtot && q_abr < Qabr){
        cout << "Yes" << endl;
        q_tot++;
        q_abr++;
      }
      else{
        cout << "No" << endl;
      }
    }
    else{
      cout << "No" << endl;
    }
  }
}

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

int main(){

    int N;
    cin >> N;

    int B[N];
    for (size_t i = 0; i < N-1; i++)
    {
        cin >> B[i];
    }
    
    int A[N];
    A[0]=B[0];

    for (size_t i = 1; i < N-1; i++)
    {
        A[i]=min(B[i-1],B[i]);
    }
    
    A[N-1]=B[N-2];
    cout << accumulate(A,A+N,0) <<endl;


    return 0;
}

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

using ll = long long;
#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 INF 1e9
// constexpr ll INF = 1LL << 60;

ll gcd(ll a, ll b){
  if(b==0){
    return a;
  }
  return gcd(b, a%b);
}
ll lcm(ll a, ll b){
  return a / gcd(a, b) * b;
}
int main(){
  int N, M;
  string S, T;
  cin >> N >> M;
  cin >> S >> T;
  ll L = lcm(N, M);
  map<int, char> mp;
  REP(i, N){
    mp[L/N * i] = S[i];
  }
  REP(i, M){
    int id = L/M * i;
    auto it = mp.find(id);
    if(it == mp.end()){
      mp[id] = T[i];
    }
    else if(mp[id] != T[i]){
      cout << -1 << endl;
      return 0;
    }
    else{
      mp[id] = T[i];
    }
  }
  cout << L << endl;
  return 0;
}



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

void file(bool opt)
{
	if (opt&&fopen("in.txt", "r"))
	{
		freopen("in.txt", "r", stdin);
		//freopen("out.txt", "w", stdout);
	}
}

int n;
bool U, D, L, R;
long long uU = -0x3f3f3f3f, uD = 0x3f3f3f3f;
long long dU = -0x3f3f3f3f, dD = 0x3f3f3f3f;
long long lR = -0x3f3f3f3f, lL = 0x3f3f3f3f;
long long rR = -0x3f3f3f3f, rL = 0x3f3f3f3f;
long long udL = 0x3f3f3f3f, udR = -0x3f3f3f3f;
long long lrU = -0x3f3f3f3f, lrD = 0x3f3f3f3f;
vector<double>tt;

int main()
{
	scanf("%d", &n);
	for (int i = 1; i <= n; i++)
	{
		long long x, y;
		char opt;
		cin >> x >> y >> opt;
		if (opt == 'U')
		{
			U = 1;
			uU = max(uU, y);
			uD = min(uD, y);
			udL = min(udL, x);
			udR = max(udR, x);
		}
		else if (opt == 'D')
		{
			D = 1;
			dU = max(dU, y);
			dD = min(dD, y);
			udL = min(udL, x);
			udR = max(udR, x);
		}
		else if (opt == 'L')
		{
			L = 1;
			lrU = max(lrU, y);
			lrD = min(lrD, y);
			lL = min(lL, x);
			lR = max(lR, x);
		}
		else if (opt == 'R')
		{
			R = 1;
			lrU = max(lrU, y);
			lrD = min(lrD, y);
			rL = min(rL, x);
			rR = max(rR, x);
		}
	}
	tt.push_back(0);
	if (L&&R)
	{
		tt.push_back(0.5*(lR - rR));
		tt.push_back(0.5*(lL - rL));
	}
	if (U&&D)
	{
		tt.push_back(0.5*(dU - uU));
		tt.push_back(0.5*(dD - uD));
	}
	if (R && (U || D))
	{
		tt.push_back(udR - rR);
		tt.push_back(udL - rL);
	}
	if (L && (U || D))
	{
		tt.push_back(lR - udR);
		tt.push_back(lL - udL);
	}
	if (U && (L || R))
	{
		tt.push_back(lrU - uU);
		tt.push_back(lrD - uD);
	}
	if (D && (L || R))
	{
		tt.push_back(dU - lrU);
		tt.push_back(dD - lrD);
	}

	double ans = 0x3f3f3f3f3f3f3f3f;
	for (double x : tt)
	{
		if (x >= 0)
		{
			double xmin = min({ lL - x, rL + x, (double)udL });
			double xmax = max({ lR - x,rR + x,(double)udR });
			double ymax = max({ uU + x,dU - x,(double)lrU });
			double ymin = min({ uD + x,dD - x,(double)lrD });
			ans = min(ans, (xmax - xmin)*(ymax - ymin));
		}
	}
	printf("%.12lf\n", ans);
	return 0;
}

Measured memory_bytes: 256
A,B=map(int,input().split())
c=0
for i in range(A,B+1):
  d=True
  i=str(i)
  for j in range(len(i)//2):
    if i[j]!=i[-(j+1)]:
      d=False
      break
  if d==True:
    c+=1
    
print(c)
    
  
    
    

Measured memory_bytes: 3060
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <math.h>
typedef long long ll;
using namespace std;

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

	string s1, s2;

	int aa=0, bb=0;
	for (int i = 0; i < a; i++)
	{
		aa += pow(10, i) * b;
	}

	for (int i = 0; i < b; i++)
	{
		bb += pow(10, i) * a;
	}

	if (aa > bb) cout << aa << endl;
	else cout << bb << endl;
}

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

int main(){
  string s;
  cin>>s;
  sort(s.begin(),s.end());
  if(s[0]==s[1] and s[2]==s[3] and s[0]!=s[2]){
    cout<<"Yes"<<endl;
  }else cout<<"No"<<endl;
  return 0;
}

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

int main() {
  int N,S,A,B,sum;
  cin >> N;
  sum=0;
  A=0;
  B=0;
  vector<int> a(N);
  for(int i=0;i<N;i++){
  cin >> a.at(i);
    sum += a.at(i);
    for(int j=i;j>0;j--){
    if(a.at(j) < a.at(j-1)){
     S = a.at(j);
      a.at(j) = a.at(j-1);
      a.at(j-1) = S;
    }
      else{break;}
    }
  }
  for(int i=N-1;i>=0;i-=2){
  A += a.at(i);
  }
  B = sum - A;
  cout << A-B << endl;
}

Measured memory_bytes: 256
import java.util.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;

public class Main {

	int INF = 1 << 28;
	final int W = 20;
	int[] id, d, num;
	int[][] path;
	int[] ans;
	double[][] dp;
	int n;
	
	void run() {
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		id = new int[n];
		d = new int[n];
		num = new int[n];
		for(int i=0;i<n;i++) {
			id[i] = sc.nextInt();
			d[i] = sc.nextInt();
			num[i] = sc.nextInt();
		}
		
		dp = new double[n][(1<<n)];
		path = new int[n][1<<n];
		for(double[] a: dp) fill(a, -1);
		 solve(0, 0);
		printPath();
		
	}
	
	void printPath() {
		for(int v=0,S=0;n!=0;n--) {
			int x = path[v][S];
			System.out.print(id[x] + (n!=1? " ": "\n"));
			S += 1<<x;
			v = x;
		}
	}
	
	double solve(int v, int S) {
		if( dp[v][S] >= 0 ) return dp[v][S];
		if( S+1 == 1<<n ) return dp[v][S] = 0;
		
		int w = 0;
		for(int i=0;i<n;i++) if( ((S>>i)&1) == 1 ){
			w += num[i];
		}
		w *= W;
		
		double t = INF;
		for(int i=0;i<n;i++) if( ((S>>i)&1) == 0 ){
			double dis = abs(d[v]-d[i]);
			double tmp = solve(i, S+(1<<i)) + dis / 2000 * (double)(70 + w);
			if(tmp < t){
				t = tmp;
				path[v][S] = i;
			}
		}
		
//		debug(v, S, t);
		return dp[v][S] = t;
	}

	public static void main(String[] args) {
		new Main().run();
	}

	void debug(Object... os) {
		System.err.println(Arrays.deepToString(os));
	}
}

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

int main() {
  int N, C; cin >> N >> C;
  // 小数をきらい、スケールを 2 倍拡大
  vector<vector<int>> imos(C, vector<int>(200002));
  for (int i = 0; i < N; i++) {
    int s, t, c; cin >> s >> t >> c; c--;
    imos.at(c).at(2*s-1)++;
    imos.at(c).at(2*t)--;
  }
  for (int i = 0; i < C; i++) {
    for (int j = 0; j < 200001; j++) {
      imos.at(i).at(j+1) += imos.at(i).at(j);
    }
  }
  for (int i = 0; i < C; i++) {
    for (int j = 0; j < 200002; j++) {
      // 同チャンネルで 2 番組が連続しているとき、
      // いっぺんに録画してしまえばよい
      if (imos.at(i).at(j)) imos.at(i).at(j) = 1;
    }
  }
  int ans = 0;
  for (int i = 0; i < 200002; i++) {
    int cnt = 0;
    for (int j = 0; j < C; j++) {
      cnt += imos.at(j).at(i);
    }
    ans = max(ans, cnt);
  }
  cout << ans << endl;
}

Measured memory_bytes: 24576
#include <bits/stdc++.h>
#define vsort(v) sort(v.begin(), v.end())
#define rvsort(v) sort(v.begin(), v.end(), greater<ll>())
#define ll long long
#define rep(i, s, g) for (ll i = (s); i < (g); i++)
#define MOD 1000000007
#define vfind(v, target) find(v.begin(), v.end(), target)
#define notFound(v, target) (vfind(v, target) == v.end())

using namespace std;

int main()
{
  ll N; cin >> N;
  vector<ll> A(N);
  rep(i, 0, N) cin >> A[i];
  ll ans = 1, bef;
  rep(i, 0, N) {
  	if (A[i] == 0) {
    	cout << 0 << endl;
      	return 0;
    }
  }
  rep(i, 0, N) {
    bef = ans;
  	ans *= A[i];
    if (ans > 1000000000000000000 || bef > ans) {
    	cout << -1 << endl;
      	return 0;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 4052
/* ＵＴＦ－８ */
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <array>
#include <queue>
#include <stack>
#include <algorithm>
#include <tuple>
#include <numeric>
#include <type_traits>
#include <limits>

#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>

#define USE_COLORED 1

#ifdef USE_COLORED
static const char stdout_pre[]  = "\033[1m"; // bold black
static const char stderr_pre[]  = "\033[31;1m"; // bold red
static const char stdxxx_post[] = "\033[m";

// 当然ながら GCC(g++)/libstdc++ 依存
#include <ext/stdio_filebuf.h>
using stdio_filebuf = __gnu_cxx::stdio_filebuf<char>;
class colored_stdio_filebuf : public stdio_filebuf {
private:
	const char* const pre_;
	const char* const post_;

public:
	colored_stdio_filebuf(FILE* fp, const char* pre, const char* post) : stdio_filebuf(fp, std::ios_base::out), pre_(pre), post_(post)
	{
	}

protected:
	std::streamsize xsputn(const char* s, std::streamsize count) override
	{
		stdio_filebuf::xsputn(pre_, strlen(pre_));
		auto ret = stdio_filebuf::xsputn(s, count);
		stdio_filebuf::xsputn(post_, strlen(post_));
		return ret;
	}
};
#endif

int main()
{
#ifdef USE_COLORED
	if (getenv("DEBUG")) {
		std::cout.rdbuf(new colored_stdio_filebuf(stdout, stdout_pre, stdxxx_post));
		std::cerr.rdbuf(new colored_stdio_filebuf(stderr, stderr_pre, stdxxx_post));
	} else
#endif
	{
		int fd = open("/dev/null", O_WRONLY);
		dup2(fd, 2);
		close(fd);
	}

	std::string N;
	std::cin >> N;

	if (N[0] == '7' || N[1] == '7' || N[2] == '7')
		std::cout << "Yes\n";
	else
		std::cout << "No\n";
}


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

int main(){
    int n; cin >> n;
    vector<int> l(n);
    rep(i,n) cin >> l[i];
    sort(l.begin(), l.end());
    reverse(l.begin(), l.end());
    int sum = 0;
    for(int i = 1; i < n; i++){
        sum += l[i];
    }
    if(l[0] < sum) cout << "Yes";
    else cout << "No";
}

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

int main() {
 int n,k;cin>>n>>k;int h[n];for(int i=0;i<n;i++)cin>>h[i];
  int d[n-k+1];sort(h,h+n);
  
  for(int i=0;i<n-k+1;i++)d[i]=h[i+k-1]-h[i];
  sort(d,d+n-k+1);
  
  cout<<d[0]<<endl;
  
  
  
}


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

int main(){
  int N;
  cin >> N;
  int a;
  a=N/2;
  
  if(N-2*a>0){
    a=a+1;
  }
  
  else if(N-2*a==0){
  }
  cout<<a<<endl;
}


Measured memory_bytes: 256
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include<math.h>
#include<iomanip>
#include<functional>
using namespace std;

#define ll long long
using vt = ll; //ここで数値の型を変えられる
#define rep(i, n) for (vt i = 0; i < (vt)(n); i++)
#define reps(i, s, n) for(vt i = (vt) (s); i < (vt) (n); i++) 
#define all(v) v.begin(), v.end()
#define P pair<ll, ll>
const ll  MOD = 1000000007;

ll f(ll x) {
	if (x % 2 == 1) {
		ll c = (x + 1) / 2;
		if (c % 2 == 0) return 0;
		else return 1;
	}
	else {
		ll c = x / 2;
		if (c % 2 == 0) return x;
		else return x + 1;
	}
}

int main() {
	ll a, b;
	cin >> a >> b;
	if (b == 0) cout << b;
	else if (a == 0) cout << f(b);
	else {
		a = f(a - 1);
		b = f(b);
		bitset<60> x(a);
		bitset<60> y(b);
		bitset<60> z = a ^ b;
		cout << z.to_ullong();
	}
	return 0;
}

Measured memory_bytes: 256
#D
from collections import deque
n,k=map(int,input().split())
s=input()
if n==1:
    print(1)
elif "1" not in s:
  	print(len(s))
else:
    a=deque([])
    if s[0]=="1":
        a.append([0])
    for i in range(1,n):
        if s[i-1:i+1]=="01":
            a.append([i])
        elif s[i-1:i+1]=="10":
            a[-1].append(i-1)
    if s[n-1]=="1":
        a[-1].append(n-1)
    if a[0][0]!=0:
        a.appendleft([0,0])
    if a[-1][1]!=n-1:
        a.append([n-1,n-1])
    if len(a)-1<=k:
        print(n)
    else:
        t=0
        for i in range(len(a)-k):
            t=max(t,a[i+k][1]-a[i][0]+1)
        print(t)



Measured memory_bytes: 12532
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<(n);++i)
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
int gcd(int a,int b) { return b ? gcd(b,a%b) : a;}
int lcm(int a,int b) { return a/gcd(a,b)*b;}
void printb(unsigned int v) {
  unsigned int mask = (int)1 << (sizeof(v) * CHAR_BIT - 1);
  do putchar(mask & v ? '1' : '0');
  while (mask >>= 1);
}
void putb(unsigned int v) {putchar('0'), putchar('b'), printb(v), putchar('\n');}
#define ALL(W) (W).begin(),(W).end()

signed main(){
  int N,Y;
  cin >> N >> Y;
  int man,gosen,sen;
  man=Y/10000;
  gosen=(Y-man*10000)/5000;
  for(int i=Y/10000;i>=0;i--){
    for(int j=(Y-i*10000)/5000;j>=0;j--){
      if(i+j+(Y-i*10000-j*5000)/1000==N){
        cout << i << " " << j <<" "<< (Y-i*10000-j*5000)/1000 << endl;
        return 0;
      }
    }
  }
  cout << -1 <<" "<< -1<<" " << -1 << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <bits/stdc++.h>
using namespace std;
const int maxn=200+10;
const int inf=0x3f3f3f3f;
int g[maxn][maxn];
vector<int> e;
int main()
{
    int n,m,r;
    int x;
    cin>>n>>m>>r;
    memset(g,inf,sizeof(g));
    for(int i=0;i<r;i++){
        cin>>x;
        e.push_back(x);
    }
    for(int i=0;i<m;i++){
        int a,b,c;
        cin>>a>>b>>c;
        g[a][b]=c;
        g[b][a]=c;
    }
    for(int k=1;k<=n;k++){
        for(int i=1;i<=n;i++){
            for(int j=1;j<=n;j++){
                if(g[i][k]<inf&&g[k][j]<inf&&g[i][j]>g[i][k]+g[k][j])
                    g[i][j]=g[i][k]+g[k][j];
            }
        }
    }
    int ans=0x3f3f3f3f;
    string s;
    s.clear();
    for(int i=1;i<=r;i++)
        s.push_back(i+'0');
    int tmp=0;
        for(int i=0;i<r-1;i++){
            int x=s[i]-'0';
            int y=s[i+1]-'0';
            int xx=e[x-1];
            int yy=e[y-1];
            tmp+=g[xx][yy];
        }
        ans=min(ans,tmp);
    while(next_permutation(s.begin(),s.end())){
        tmp=0;
        for(int i=0;i<r-1;i++){
            int x=s[i]-'0';
            int y=s[i+1]-'0';
            int xx=e[x-1];
            int yy=e[y-1];
            tmp+=g[xx][yy];
        }
        ans=min(ans,tmp);
    }
    cout<<ans;
    return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>

using namespace std;

namespace shamal{
	template<typename F, typename IndexType, typename TargetType>
	pair<bool, IndexType> lower_bound(F const& func, IndexType left, IndexType right, TargetType const& t){
		do{
			auto const mid = left + (right - left) / 2;
			auto const val = func(mid);
			if(val > t){
				right = mid - 1;
			}else if(val < t){
				left = mid + 1;
			}else{
				right = mid;
			}
		}while(left <= right);

		return {func(left) == t, left};
	}
	template<typename F, typename IndexType, typename TargetType>
	pair<bool, IndexType> binary_search(F const& func, IndexType left, IndexType right, TargetType const& t){
		do{
			auto const mid = left + (right - left) / 2;
			auto const val = func(mid);
			if(val > t){
				right = mid - 1;
			}else if(val < t){
				left = mid + 1;
			}else{
				return {true, mid};
			}
		}while(left <= right);
		return {false, IndexType()};
	}
};

int main(void)
{
	int ns, nt;
	cin >> ns;
	vector<int> s(ns);
	for(int i = 0; i < ns; i++){
		scanf("%d", &s[i]);
	}

	cin >> nt;
	vector<int> t(nt);
	for(int i = 0; i < nt; i++){
		scanf("%d", &t[i]);
	}

	int r = 0;
	for(auto const& x : t){
		if(shamal::binary_search([&](int i){return s[i];}, 0, ns-1, x).first)
			r++;
	}
	cout << r << endl;
}

Measured memory_bytes: 3408
#include<bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#define dbg(x...) do { cout << "\033[32;1m " << #x << " -> "; err(x); } while (0)
void err() { cout << "\033[39;0m" << endl; }
template<template<typename...> class T, typename t, typename... A>
void err(T<t> a, A... x) { for (auto v: a) cout << v << ' '; err(x...); }
template<typename T, typename... A>
void err(T a, A... x) { cout << a << ' '; err(x...); }
#else
#define dbg(...)
#endif
typedef long long ll;
typedef pair<int,int> pi;
typedef vector<int> vi;
template<class T> using vc=vector<T>;
template<class T> using vvc=vc<vc<T>>;
template<class T> void mkuni(vector<T>&v)
{
    sort(v.begin(),v.end());
    v.erase(unique(v.begin(),v.end()),v.end());
}
template<class T>
void print(T x,int suc=1)
{
    cout<<x;
    if(suc==1) cout<<'\n';
    else cout<<' ';
}
template<class T>
void print(const vector<T>&v,int suc=1)
{
    for(int i=0;i<v.size();i++)
    print(v[i],i==(int)(v.size())-1?suc:2);
}
const int mxlen=4000;
typedef bitset<mxlen> bs;
bitset<mxlen> x,a[7];
bs gcd(bs& a,bs& b)
{
    //dbg(a,b);
    int la=-1,lb=-1;
    for(int i=0;i<4000;i++) 
    {
        if(a[i]) la=i;
        if(b[i]) lb=i;
    }
    if(lb>la) swap(a,b);
    if(lb==-1) return a;
    a^=(b<<(la-lb));
    return gcd(a,b);
}
const int maxn=1e5+7;
const int mod=998244353;
ll two[maxn];
int main()
{
    int n;
    cin>>n;
    string s;
    cin>>s;
    int mx=s.length()-1;
    for(int i=s.length()-1;i>=0;i--)
        x[s.length()-1-i]=s[i]=='1';
    //dbg(x);
    bs g;
    for(int i=0;i<n;i++)
    {
        cin>>s;
        for(int j=s.length()-1;j>=0;j--)
            a[i][s.length()-1-j]=s[j]=='1';
        g=gcd(g,a[i]);
    }
    //dbg(g);
    int lg=-1;
    for(int i=0;i<mxlen;i++) if(g[i]) lg=i;
    //dbg(mx,lg);
    two[0]=1;
    for(int i=1;i<maxn;i++) two[i]=two[i-1]*2%mod;
    ll ans=1;
    bs last;
    for(int i=mx;i>=lg;i--)
    {
        if(x[i]) 
            ans=(ans+two[i-lg])%mod;
        if(x[i]^last[i]) last^=g<<(i-lg); 
    }
    for(int i=mx;i>=0;i--)
    {
        if(x[i]>last[i])
            break;
        if(x[i]<last[i]) 
        {
            ans--;
            break;
        }
    }
    print(ans);

}

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

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

//container util
#define all(x) (x).begin(),(x).end()

//typedef
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VLL;
typedef vector<VLL> VVLL;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;


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


int main(){
  int n;
  cin >> n;
  vector<PII> player(n);
  rep(i,n){
    cin >> player[i].first >> player[i].second ;
  }
  sort(all(player));
  cout << player[n-1].first + player[n-1].second << endl;
  return 0;
}


Measured memory_bytes: 1024
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */

public class Main {
    public static void main(String[] args) {
        InputStream    inputStream    = System.in;
        OutputStream outputStream = System.out;
        InputReader    in                      = new InputReader(inputStream);
        PrintWriter      out                    = new PrintWriter(outputStream);
        Task                 solver               = new Task();
        solver.solve(1, in, out);
        out.close();
    }

    static class Task {
    	public void solve(int testNumber, InputReader in, PrintWriter out) {
    		int N = in.nextInt();
    		int[] A = new int[N];
    		for(int i = 0; i < N; i++) {
    			A[i] = in.nextInt();
    		}
    		int max = Math.abs(A[0]);
    		int min = Math.abs(A[0]);
    		for(int i = 1; i < N; i++) {
    			max = Math.max(max, A[i]);
    			min = Math.min(min, Math.abs(A[i]));
    		}
    		out.println(max - min);
    		
    	}
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}



Measured memory_bytes: 23252
s=input()

# 01010101や10101010としたい
ans=""
for i in range(len(s)+1):
    if i%2==0:
        ans+="0"
    else:
        ans+="1"
ans1=ans[:-1]
ans2=ans[1:]

cnt1=0
cnt2=0
for i in range(len(s)):
    if s[i]!=ans1[i]:
        cnt1+=1
    if s[i]!=ans2[i]:
        cnt2+=1
print(min(cnt1,cnt2))

Measured memory_bytes: 3444
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define repv(i,a,b) for(ll i=b-1;i>=a;i--)
#define MAXN 300005
#define endl "\n"

ll gcd(ll a,ll b){if(b==0) return a; else return gcd(b,a%b);}
ll power(ll x,ll y){ll res=1; while(y>0){if(y&1) res=res*x;y=y>>1;x=x*x;}return res;}

int n,d,arr[15][15];

int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin>>n>>d;
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=d;j++) cin>>arr[i][j];
    }
    int cnt=0;
    for(int i=1;i<n;i++)
    {
        for(int j=i+1;j<=n;j++)
        {
            int sum=0;
            for(int k=1;k<=d;k++)
            {
                sum+=((arr[j][k]-arr[i][k])*(arr[j][k]-arr[i][k]));
            }
            int p=sqrt(sum);
            if(p*p==sum) cnt++;
        }
    }
    cout<<cnt<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
typedef long long ll;
using namespace std;

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

Measured memory_bytes: 256
from sys import stdin,stdout
import math
from collections import Counter,defaultdict
LI=lambda:list(map(int,input().split()))
MAP=lambda:map(int,input().split())
IN=lambda:int(input())
S=lambda:input()

def case():
    a=b=c=d=0
    for i in range(IN()):
        s=S()
        if s=="AC":a+=1
        elif s=="TLE":b+=1
        elif s=="WA":c+=1
        else:d+=1
    print("AC","x",a)
    print("WA","x",c)
    print("TLE","x",b)
    print("RE","x",d)
for _ in range(1):
    case()
                


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

#define ll long int 

int main()
{
    string s;
    cin>>s;
    ll l=s.length();
    ll i=0, j=l-1;
    ll cnt=0;
    while(j-i>=0)
    {
        if(s[i]==s[j])
        {
            i++;
            j--;
        }
        else if(s[i]=='x')
        {
            i++;
            cnt++;
        }
        else if(s[j]=='x')
        {
            j--;
            cnt++;
        }
       else 
       {
           cout<<-1<<endl;
           return 0;
       }
    }
    cout<<cnt<<endl;



    return 0;
}

Measured memory_bytes: 3768
mod = 1000000007
N = int(input())
S = [list(input()) for _ in range(2)]
i = 0
ans = 1
if S[0][0] == S[1][0]:
  ans = 3
  i = 1
else:
  ans = 6
  i = 2
while i < N:
  if S[0][i-1] == S[1][i-1]:
    if S[0][i] == S[1][i]:
      ans = (ans * 2)%mod
      i += 1
    else:
      ans = (ans * 2)%mod
      i += 2
  else:
    if S[0][i] == S[1][i]:
      i += 1
    else:
      ans = (ans * 3)%mod
      i += 2
print(ans)

Measured memory_bytes: 38256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <climits>
#include <iomanip>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
int main(){
  ll n;
  cin >> n;
  ll res = 0;
  for(int i = 0;i < n;i++){
    ll in;
    cin >> in;
    if(i % 2 == 0 && in % 2 == 1)res++;
  }
  cout << res << endl;
}

Measured memory_bytes: 3508
#include <bits/stdc++.h>
#define rep(i,cc,n) for(int i=cc;i<=n;++i)
#define drep(i,cc,n) for(int i=cc;i>=n;--i)
#define sz(s) (int)(s.size())
#define vecprint(v) rep(i,0,v.size()-1)cout << v[i] << " ";cout << endl;
#define mod 1000000007
using namespace std;

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

    if(n%2==1){
        puts("No");
        return 0;
    }

    rep(i,0,n/2-1){
        if(s[i]!=s[i+n/2]){
            puts("No");
            return 0;
        }
    }
    puts("Yes");

    return 0;
}

Measured memory_bytes: 256
import math
import numpy as np
from fractions import gcd
import fractions
import statistics
import collections
from functools import reduce
import itertools
from collections import defaultdict

N,M=map(int, input().split())
city = defaultdict(list)
p = [0] * M
y = [0] * M

for i in range(M):
    p[i],y[i]=map(int, input().split())
    city[p[i]].append(y[i])

year = defaultdict(list)
for key,v in city.items():
    for i,x in enumerate(sorted(v)):
        year[x] = i+1

for a in range(M):
    print(str(p[a]).zfill(6)+str(year[y[a]]).zfill(6))

Measured memory_bytes: 50304
#include <bits/stdc++.h>
#define Speed ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
using namespace std;

#define st              first
#define nd              second
#define pb              push_back
#define pf              push_front
#define all(a)          (a).begin(), (a).end()
#define lwb             lower_bound
#define upb             upper_bound
#define vvll            vector<vector<ll> >
#define Mset(s, n)      memset(s, n, sizeof(s))
#define Sz(a)           int((a).size())
#define Max(a, b, c)    max(max((ll)(a), (ll)(b)), (ll)(c))
#define Min(a, b, c)    min(min((ll)(a), (ll)(b)), (ll)(c))
#define Unique(a)       sort(all(a)); (a).resize(unique(all(a)) - (a).begin())

typedef long double ld;
typedef pair<int, int> pii;
typedef long long ll;
typedef unsigned long long ull;

const ll MOD = 1e9 + 7;
const int oo = 2e9;
const ld PI = acos((ld) -1);
int Getbit(ll x, int k){return (x >> (k - 1)) & 1;}
ll Lcm(ll a, ll b) {return a / __gcd(a, b) * b;}
bool isPrime(ll n){for(ll i = 2; i * i <= n; i++){if(n % i == 0) return 0;} return (n > 1) ? 1 : 0;}
ll Powmod(ll n, ll k, ll p = MOD) {ll r = 1; for(; k; k /= 2, n = n * n % p){if(k & 1) r = r * n % p;} return r;}

const int N = 2e5 + 5;

ll n, m, k;
ll a[N];

void Solve(){
    cin >> n >> m;
    ll res = 0;
    if(n == 1){
        res += 300000;
    }
    if(n == 2){
        res += 200000;
    }
    if(n == 3){
        res += 100000;
    }
    if(m == 1){
        res += 300000;
    }
    if(m == 2){
        res += 200000;
    }
    if(m == 3){
        res += 100000;
    }
    if(m == 1 && n == 1){
        res += 400000;
    }
    cout << res;

}

int main(){
    Speed;
    int query = 1; //cin >> query;
    while(query--){
        Solve();
    }
}





Measured memory_bytes: 256
S = list(input())
a = int("".join(S[0:2]))
b = int("".join(S[2:]))

if 0 < a <= 12 and 0 < b <= 12:
    print("AMBIGUOUS")
elif 0 < a <= 12:
    print("MMYY")
elif 0 < b <= 12:
    print("YYMM")
else:
    print("NA")

Measured memory_bytes: 3060
#include <stdio.h>

int main(void) {
	int ch, sum = 0;
	
	while (1) {
		ch = getchar();
		if ((ch == '0') && (sum == 0)) {
			break;
		}
		if ((ch >= '0') && (ch <= '9')) {
			sum += ch - '0';
		} else {
			printf("%d\n", sum);
			sum = 0;
		}
	}
	
	return 0;
}

Measured memory_bytes: 524
#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>
#include<stdlib.h>
#include<cstdlib>
using namespace std;

int a, b, ans = 0, W = 0, B = 0, R = 0;

int tansaku(int iti, int ryo, vector<string> c) {
  int kariAns = 0;
  for(int i = 0; i < b; i++) {
    for(int j = 0; j < ryo; j++) {
      if(c[iti + j][i] != 'B') kariAns++;
    }
    for(int j = 1; j < iti; j++) {
      if(c[iti - j][i] != 'W') kariAns++;
    }
    for(int j = iti + ryo; j < a - 1; j++) {
      if(c[j][i] != 'R') kariAns++;
    }
  }
  if(iti + ryo == a - 1) {
    iti = 1;
    ryo++;
  }else {
    iti++;
  }
  if(ryo >= a - 1) return kariAns;
  return min(kariAns, tansaku(iti, ryo, c));
}

int main() {
  cin >> a >> b;
  vector<string> c(a);
  for(int i = 0; i < a; i++) {
    cin >> c[i];
  }
  for(int i = 0; i < b; i++) {
    if(c[0][i] != 'W') ans++;
    if(c[c.size() - 1][i] != 'R') ans++;
  }
  cout << ans + tansaku(1, 1, c) << endl;
}

Measured memory_bytes: 9144
#include <bits/stdc++.h>
using namespace std;
typedef long long ll ; 
	int N ; 
	double p[4000] ; 
	double dp[4000][4000] ; 
	int vis[4000][4000];
double calc (int idx , int sum) {
	if ( N == idx) {
		if (sum > N/2)return 1.0 ; 
		return 0 ; 
	}
	double &ret = dp[idx][sum] ; 
	if (vis[idx][sum] != -1)return ret ; 
	vis[idx][sum] = 1 ; 
	ret = 1.0 * p[idx] * calc(idx+1 , sum+1)+ 1.0 * (1.0-p[idx]) * calc(idx+1 , sum) ; 
	return ret;
}
int main() {
	memset(vis , -1 , sizeof vis) ; 
	scanf("%d", &N) ; 
	for (int i =0 ; i<N ;++i) {
		scanf("%lf" , &p[i]) ; 
	}
	double ans = calc(0 , 0) ; 
	printf("%.10lf" , ans) ; 
	return 0;
}

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

#define inf 1000000007
int dp[16][1<<16];

int main(){
    int n,m;
    cin >> n >> m;
    int dst[16][16]={};
    for(int i=0;i<16;i++){
        for(int j=0;j<16;j++){
            dst[i][j] = inf;
        }
    }
    for(int i=0;i<16;i++){
        for(int j=0;j<(1<<16);j++){
            dp[i][j] = inf;
        }
    }
    dp[0][0] = 0;
    for(int i=0;i<m;i++){
        int s,t,d;
        cin >> s >> t >> d;
        dst[s][t] = d;
    }
    for(int j=0;j<(1<<n);j++){
        for(int s=0;s<n;s++){
            for(int t=0;t<n;t++){
                if(s==t)continue;
                if((j&(1<<t))==0)dp[t][j+(1<<t)] = min(dp[t][j+(1<<t)],dp[s][j]+dst[s][t]);
            }
        }       
    }
    int ans = dp[0][(1<<n)-1];
    if(ans!=inf)cout << ans << endl;
    else cout << -1 << endl;
    return 0;
}


Measured memory_bytes: 7200
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
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; }
#define all(x) (x).begin(),(x).end()
#define pll pair<ll,ll>
#define pii pair<int,int>
#define rep(i,n) for(int i=0;i<n;i++)
#define sz(x) ((ll)(x).size())
#define pb push_back
#define mp make_pair
#define bit(n) (1LL<<(n))
#define F first
#define S second
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
const ll INF = 1LL<<60;
const ll mod = (int)1e9 + 7;

int main() {
    int n;
    cin >> n;
    int x=(double)n/1.08;
    x-=50;
    rep(i,100){
        int nn=(double)x*1.08;
        if(nn==n){
            cout << x;
            return 0;
        }
        x++;
    }
    cout << ":(";
    return 0;


}

/*



 */



Measured memory_bytes: 256
#include <string>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <iostream>
#include <functional>
#include <algorithm>
#include <sstream>
#include <iterator>
#include <cmath>
#include <limits>
#include <tuple>
#include <queue>
#include <stack>

using namespace std;
typedef long long ll;

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()

int main()
{
	string S;
	int Q;
	cin >> S >> Q;
	deque<char> dq(all(S));
	bool dir = true;
	rep(i, Q) {
		int T;
		cin >> T;
		if (T == 1) {
			dir = !dir;
		}
		else {
			int F;
			char C;
			cin >> F >> C;
			if (F == 1 && !dir || F == 2 && dir) {
				dq.push_back(C);
			} 
			else {
				dq.push_front(C);
			}
		}
	}
	if (!dir) {
		reverse(all(dq));
	}
	for (auto c : dq) {
		cout << c;
	}
	cout << endl;
	return 0;
}


Measured memory_bytes: 4004
#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> mypair;

int main(){
	int n,m;
	cin>>n>>m;
	vector<mypair> now(n+1);
	for(int i=0;i<=n;i++)now[i] = mypair(i,i);
	priority_queue<mypair,vector<mypair> ,greater<mypair> > q;
	for(int i=0;i<m;i++){
	int x,y;
	cin>>x>>y;
	q.push( mypair(x,y) );
	}
	while(!q.empty()){
	int y = q.top().second;
	q.pop();
	mypair tmp = mypair(now[y].first,now[y+1].second);
	now[y] = tmp;
	now[y+1] = tmp;
	}
	for(int i=1;i<n;i++)cout<<now[i].second-now[i].first+1<<' ';
	cout<<now[n].second-now[n].first+1<<endl;

		return 0;
}



Measured memory_bytes: 5368
import bisect
import heapq
import itertools
import math
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7

N, M = list(map(int, sys.stdin.readline().split()))
AB = [list(map(int, sys.stdin.readline().split())) for _ in range(M)]
AB.sort()

heap = []

ans = 0
for a, b in AB:
    if heap and a >= heap[0]:
        heap = []
        ans += 1
    heapq.heappush(heap, b)
if heap:
    ans += 1
print(ans)


Measured memory_bytes: 39552
#include <bits/stdc++.h>
using namespace std;
#define rep(i,ini,n) for(int64_t i=ini;i<n;i++)
#define _rep(i,ini,n) for(int64_t i=ini;i>=n;i--)
#define ToEnd(a) a.begin(),a.end()
uint64_t MOD=1000000007;

int main(){
    int64_t X,Y,A,B,C; cin>>X>>Y>>A>>B>>C;
    vector<int64_t> P(A),Q(B),R(C);
    rep(a,0,A) cin>>P.at(a);
    rep(b,0,B) cin>>Q.at(b);
    rep(c,0,C) cin>>R.at(c);

    sort(ToEnd(P),greater<int64_t>());
    sort(ToEnd(Q),greater<int64_t>());
    sort(ToEnd(R),greater<int64_t>());

    vector<int64_t> Ans;
    rep(x,0,X) Ans.push_back(P.at(x));
    rep(y,0,Y) Ans.push_back(Q.at(y));

    sort(ToEnd(Ans));
    
    rep(i,0,min(X+Y,C)){
        if(Ans.at(i)<R.at(i)) Ans.at(i)=R.at(i);
        else break;
    }

    int64_t ans=accumulate(ToEnd(Ans),0LL);
    cout<<ans<<endl;
}

Measured memory_bytes: 4724
#include <iostream>
#include <string>
#include <cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
#include <functional>
using namespace std;

#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)

typedef long long ll;
const ll INF = 1e17;
const ll MOD = 1000000007;
const ll MAX = 1000000;

ll max(ll a, ll b) {
	if (a > b) { return a; }
	return b;
}

ll min(ll a, ll b) {
	if (a > b) { return b; }
	return a;
}

///////////////////////////




int main() {

	string s;
	string t;

	cin >> s >> t;

	int ans = 0;

	rep(i, 3) {
		if (s[i] == t[i]) {
			ans++;

		}
	}

	cout << ans;
	

	system("PAUSE");
}


Measured memory_bytes: 504