akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <vector>
#include <utility>
#include <map>
#include <string>
using namespace std;
typedef long double ld;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
#define mp(a,b)	make_pair(a,b)
#define fst	first
#define scn second

int main() {
	int n;	cin >> n;
	vector<ll> a(n), sum(n, 0);
	for (int i = 0; i < n; i++)	cin >> a[i];
	ll p = 0, m = 0;
	sum[0] = a[0];
	for (int i = 1; i < n; i++)	sum[i] = sum[i - 1] + a[i];
	ll pchange = 0, mchange = 0;
	//p
	if (a[0] <= 0) {
		p = -a[0] + 1;
		pchange = -a[0] + 1;
	}
	for (int i = 1; i < n; i++) {
		ll psum = pchange + sum[i];
		if (i % 2 == 1 && psum >= 0) {
			p += psum + 1;
			pchange -= psum + 1;
		}
		else if (i % 2 == 0 && psum <= 0) {
			p += -psum + 1;
			pchange += -psum + 1;
		}
	}
	//m
	if (a[0] >= 0) {
		m = a[0] + 1;
		mchange = -a[0] - 1;
	}
	for (int i = 1; i < n; i++) {
		ll msum = mchange + sum[i];
		if (i % 2 == 1 && msum <= 0) {
			m += -msum + 1;
			mchange += -msum + 1;
		}
		else if (i % 2 == 0 && msum >= 0) {
			m += msum + 1;
			mchange -= msum + 1;
		}
	}
	cout << min(p, m) << endl;
	return 0;
}

Measured memory_bytes: 1792
#include<vector>
#include<iostream>
#include<fstream>
#include<string>
#include<cassert>
#include<algorithm>
#include<random>
#include<map>
#include<set>
#include <bitset>

using namespace std;

//int mod = 998244353;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
typedef long double ld;
typedef vector<int>vi;
typedef vector<ll>vl;
typedef vector<char>vc;
typedef vector<string>vs;
typedef vector<vector<int>>vvi;
typedef vector<vector<char>>vvc;
typedef vector<vector<ll>>vvl;
typedef vector< pair<ll, ll>>vpll;
typedef vector< pair<ld, ld>>vpld;
typedef vector< pair<int, int>>vpi;
typedef pair<ld, ld>pld;
#define mp make_pair
#define pb push_back

int mod=998244353;
int sum(int a, int b)
{
	int c = a + b;
	if (c >= mod)
	{
		c -= mod;
	}
	return c;
}
int dif(int a, int b)
{
	int c = a - b;
	if (c < 0)
	{
		c += mod;
	}
	return c;
}
int mlt(int a, int b)
{
	ll c = a * 1LL * b;
	return c % mod;
}
int ibit(int n, int i)
{
	return ((n >> i) & 1);
}
void outp(vvi &ou)
{
	for (int i = 0; i < ou.size(); i++)
	{
		for (int j = 0; j < ou[i].size(); j++)
		{
			cout << ou[i][j] << ' ';
		}
		cout << '\n';
	}
}

void solve(istream &cin = std::cin, ostream &cout = std::cout)
{
	vpll vals;
	int n;
	cin >> n;
	ll sum = 0; 
	int num = -1;
	for (int i = 0; i < n; i++)
	{
		int x, y;
		cin >> x >> y;
		vals.pb(mp(x, y));
	}
	sort(vals.begin(), vals.end());
	for (int i = 0; i < n; i++)
	{
		ll y = vals[i].second, x = vals[i].first;
		sum = max(sum, (ll)y - x + 1);
		if (sum == (ll)y - x + 1)
		{
			num = i;
		}
	}
	ll left=-1, right=1000000007;
	for (int i = 0; i < n; i++)
	{
		if (i != num)
		{
			left = max(left, vals[i].first);
			right = min(right, vals[i].second);
		}
	}
	sum += max(right - left + 1, 0LL);
	//cerr << sum << endl;
	vl lleft(n+1), rleft(n+1), lright(n+1), rright(n+1);
	lleft[0] = -100, rleft[0] = 1000000007;
	for (int i = 0; i < n; i++)
	{
		lleft[i + 1] = max(lleft[i], vals[i].first);
		rleft[i + 1] = min(rleft[i], vals[i].second);
	}
	lright[n] = -100, rright[n] = 1000000007;
	for (int i = n-1; i >=0 ; i--)
	{
		lright[i] = max(lright[i+1], vals[i].first);
		rright[i] = min(rright[i+1], vals[i].second);
	}
	for (int i = 1; i < n; i++)
	{
		ll val = rright[i] + rleft[i] - lleft[i] - lright[i] + 2;
		sum = max(val, sum);
	}
	cout << sum << endl;
}
int main()
{
	solve();
	int n;
	cin >> n;
}

Measured memory_bytes: 4976
from fractions import gcd

n=int(input())
a=[int(i) for i in input().split()]
a1=[a[0]]
for i in range(1,n-1):
    a1.append(gcd(a1[-1],a[i]))
a2=[a[-1]]
for i in range(n-2,0,-1):
    a2.append(gcd(a2[-1],a[i]))
m=[]
for i in range(n-2):
    m.append(gcd(a1[i],a2[-i-2]))
m.append(a1[-1])
m.append(a2[-1])
print(max(m))

Measured memory_bytes: 16124
#include <iostream>

using namespace std;

int main(){

	int n;
	int a , b , c , d;
	int ans , count;

	while(cin >> n){
		if(n == 0) break;

		count = 0;

		for(a = 0; a <= 9; a++){
			for(b = 0; b <= 9; b++){
				for(c = 0; c <= 9; c++){
					for(d = 0; d <= 9; d++){

						ans = a + b + c + d;
						if(ans == n){
							count++;
						}
					}
				}
			}
		}

		cout << count << endl;
	
	}

	return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
#define ll long long
#define pq priority_queue
using namespace std;
const ll INF=(ll)1e9;
const ll MOD=(ll)1e9+7;
const ll MAX=510000;
vector<int> dx={1,0,-1,0},dy={0,1,0,-1};
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; }

int main(){
    ll N;
    cin>>N;
    map<ll,ll> m;
    vector<ll> a(N);
    for(ll i=0;i<N;i++){
        cin>>a[i];
        m[a[i]]++;
    }
    sort(a.begin(),a.end());
    if(m[0]==N){
        cout<<"Yes"<<endl;
        return 0;
    }
    if(N%3!=0){
        cout<<"No"<<endl;
        return 0;
    }
    if(m[0]==N/3&&m[a[N-1]]==N*2/3){
        cout<<"Yes"<<endl;
        return 0;
    }
    ll cnt=0;
    for(ll i=0;i<N;i++){
        if(m[a[i]]!=N/3){
            cout<<"No"<<endl;
            return 0;
        }
    }
    bitset<30> b1(a[0]),b2(a[N/3]),b3(a[N-1]),B;
    B=b1^b2;
    B^=b3;
    if(B==0){
        if(m[a[0]]==N/3&&m[a[N-1]]==N/3){
            cout<<"Yes"<<endl;
            return 0;
        }
    }
    cout<<"No"<<endl;
}


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

using namespace std;

#define MAX_H 10
#define MAX_W 10

struct Dice{
  int tmp,d[6];
  Dice(){
    for(int i = 0 ; i < 6 ; i++){
      d[i] = i;
    }
  }
  void rollN(){
    tmp = d[0];
    d[0] = d[1];
    d[1] = d[5];
    d[5] = d[4];
    d[4] = tmp;
  }
  void rollE(){
    tmp = d[0];
    d[0] = d[3];
    d[3] = d[5];
    d[5] = d[2];
    d[2] = tmp;
  }
  void rollS(){
    tmp = d[0];
    d[0] = d[4];
    d[4] = d[5];
    d[5] = d[1];
    d[1] = tmp;
  }
  void rollW(){
    tmp = d[0];
    d[0] = d[2];
    d[2] = d[5];
    d[5] = d[3];
    d[3] = tmp;
  }
};

struct State{
  int cost,x,y;
  Dice d;
  bool operator < (const State &s)const{
    return cost > s.cost;
  }
};

int main(){
  int H,W;
  while(cin >> H >> W, H){
    int field[MAX_H][MAX_W];
    int sx,sy,gx,gy;
    for(int i = 0 ; i < H ; i++){
      for(int j = 0 ; j < W ; j++){
        cin >> field[i][j];
      }
    }
    cin >> sy >> sx >> gy >> gx;
    int cost[MAX_H][MAX_W][6][6][6];
    for(int i = 0 ; i < H ; i++){
      for(int j = 0 ; j < W ; j++){
        for(int k = 0 ; k < 6 ; k++){
          for(int l = 0 ; l < 6 ; l++){
            for(int m = 0 ; m < 6 ; m++){
              cost[i][j][k][l][m] = 1e9;
            }
          }
        }
      }
    }
    Dice die;
    cost[sy][sx][die.d[0]][die.d[1]][die.d[2]] = 0;
    priority_queue<State> Q;
    Q.push((State){0,sx,sy,die});
    const int dx[] = {-1,0,1,0};
    const int dy[] = {0,-1,0,1};
    while(!Q.empty()){
      State s = Q.top(); Q.pop();
      int x = s.x, y = s.y;
      int ncost = cost[y][x][s.d.d[0]][s.d.d[1]][s.d.d[2]];
      if(ncost < s.cost){ continue; }
      if(x == gx && y == gy){
        cout << s.cost << endl;
        break;
      }
      for(int i = 0 ; i < 4 ; i++){
        int nx = x + dx[i], ny = y + dy[i];
        Dice d = s.d;
        if(0 > nx || nx >= W || 0 > ny || ny >= H){
          continue;
        }
        switch(i){
        case 0:
          d.rollW();
          break;
        case 1:
          d.rollN();
          break;
        case 2:
          d.rollE();
          break;
        case 3:
          d.rollS();
          break;
        }
        int p = (d.d[5]+1)*field[ny][nx];
        if(s.cost + p < cost[ny][nx][d.d[0]][d.d[1]][d.d[2]]){
          cost[ny][nx][d.d[0]][d.d[1]][d.d[2]] = s.cost + p;
          Q.push((State){cost[ny][nx][d.d[0]][d.d[1]][d.d[2]],nx,ny,d});
        }
      }
    }
  }
  return 0;
}

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

using namespace std;

#define forn(i,n) for (int i = 0; i < int(n); i++)
#define ford(i,n) for (int i = int(n) - 1; i >= 0; i--)
#define fore(i,l,r) for (int i = int(l); i < int(r); i++)
#define all(a) a.begin(), a.end()
#define sz(a) int(a.size())
#define mp make_pair
#define pb push_back
#define x first
#define y second

template<typename X> inline X abs(const X& a) { return a < 0 ? -a : a; }
template<typename X> inline X sqr(const X& a) { return a * a; }

typedef long long li;
typedef long double ld;
typedef pair<int, int> pt;

const int INF = int(1e9);
const li INF64 = li(1e18);
const ld EPS = 1e-9;
const ld PI = acosl(ld(-1));

mt19937 mt(time(NULL));

int n;

inline bool read()
{
	if (scanf ("%d", &n) != 1)
		return false;

	return true;
}

const int N = 100 * 1000 + 13;
int res[N], szres;

inline bool f (int t)
{
	szres = 0;
	int need = n;
	for (int i = t; i >= 1; i--)
	{
		if (need >= i)
		{
			need -= i;
			res[szres++] = i;
		}
	}
	return need == 0;
}

inline void solve()
{
	int lf = 1, rg = n;
	int ans = -1;
	while (lf <= rg)
	{
		int mid = (lf + rg) >> 1;
		
		if (f(mid))
		{
			ans = mid;
			rg = mid - 1;
		}
		else
			lf = mid + 1;
	}
	
	assert(f(ans));
	reverse(res, res + szres);
	forn(i, szres)
		printf ("%d\n", res[i]);
}

int main()
{
#ifdef SU2_PROJ
	assert(freopen("input.txt", "r", stdin));
	assert(freopen("output.txt", "w", stdout));
#endif

	cout << setprecision(25) << fixed;
	cerr << setprecision(10) << fixed;

	assert(read());
	solve();

#ifdef SU2_PROJ
	cerr << "TIME: " << clock() << endl;
#endif

	return 0;
}


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

using namespace std;

#define fi first
#define se second
#define pb push_back
#define mp make_pair

#define int long long

typedef pair<int, int> ii;

const int mod = 1e9 + 7;

const int N = 2e5 + 5;

vector<ii> vec[N];

int dp[N], n, m, it[4 * N], lz[4 * N];

void lzupdate(int k, int l, int r) {
    if(!lz[k]) return ;
    it[k] += lz[k];
    if(l != r) {
        lz[k << 1] += lz[k];
        lz[k << 1 | 1] += lz[k];
    }
    lz[k] = 0;
}

int get(int k, int l, int r, int L, int R) {
    lzupdate(k, l, r);
    if(r < L || R < l || L > R) return 0;
    if(L <= l && r <= R)
        return it[k];
    int mid = (l + r) >> 1;
    return max(get(k << 1, l, mid, L, R), get(k << 1 | 1, mid + 1, r, L, R));
}

void update(int k, int l, int r, int L, int R, int val) {
    lzupdate(k, l, r);
    if(r < L || R < l || L > R) return ;
    if(L <= l && r <= R) {
        lz[k] += val;
        lzupdate(k, l, r);
        return ;
    }
    int mid = (l + r) >> 1;
    update(k << 1, l, mid, L, R, val);
    update(k << 1 | 1, mid + 1, r, L, R, val);
    it[k] = max(it[k << 1], it[k << 1 | 1]);
}

signed main() {
    cin.tie(0), ios::sync_with_stdio(0);
    cin >> n >> m;
    for(int i = 1; i <= m; i++) {
        int l, r, a;
        cin >> l >> r >> a;
        vec[r].pb({l, a});
    }
    for(int i = 1; i <= n; i++) {
        update(1, 0, n, i, i, get(1, 0, n, 0, i - 1));
        for(int j = 0; j < vec[i].size(); j++) {
            ii l = vec[i][j];
            update(1, 0, n, l.fi, i, l.se);
        }
    }
    cout << it[1];
}


Measured memory_bytes: 24192
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> vvl;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvec;
typedef vector<vector<bool>> vveb;
typedef vector<vector<string>> vves;
#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 rep2(i,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define rev(v) reverse(v.begin(), v.end())
#define fs first
#define sc second
#define pb push_back
#define pp pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) *max_element(all(a))
#define minel(a) *min_element(all(a))
#define acc accumulate
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)
typedef long long int64;
//const int64 INF = 1LL << 58;
#define dame { puts("-1"); return 0;}
#define YES { cout << "YES" << endl; return 0; }
#define NO { cout << "NO" << endl; return 0; }
#define Yes { cout << "Yes" << endl; return 0; }
#define No { cout << "No" << endl; return 0; }
#define uniq(a) sort(all(a));(a).resize(unique(all(a)) - a.begin());
#define dab(v) for(auto i:v)cout<<i<<' '; cout << endl;
#define vin(v) for (ll i = 0; i < v.size(); ++i) cin >> v[i];
template<class T> bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> bool chmin(T& a, const T& b) { if (a > b) { a = b; return 1; } return 0; }
int dx[] = { 0, 0, -1, 1 };
int dy[] = { 1, -1, 0, 0 };
int gcd(int a, int b) { if (a % b == 0) { return(b); } else { return(gcd(b, a % b)); } }


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


	int A, B, H, M;
	cin >> A >> B >> H >> M;

	int suma = 60 * H + M;
	//cout << suma << endl;
	double hr = 2 * PI * ((double)suma / 720);
	double mn = 2 * PI * ((double)M / 60);
	//cout << hr << " " << mn;
	double temp = A * A + B * B - 2 * A * B * cos(hr - mn);
	cout << setprecision(15) << sqrt(temp);
	return 0;
}


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

int factorial(int a){
    int r= 1;
    for (int i = 1; i <= a; i++)
    {
        r*=i;
    }
    return r;
}
 
int main() {
    int n, m;
    cin >> n >> m;
    int even = n*(n-1)/2;
    int oneven = m*(m-1)/2;
    cout << even + oneven << endl;
	return 0;
}
 
/*#include <bits/stdc++.h>
 
using namespace std;
 
int main() {
	return 0;
}
 
#include <bits/stdc++.h>
 
using namespace std;
 
int main() {
	return 0;
}

using namespace std;
 
int main() {
	return 0;
}

using namespace std;
 
int main() {
	return 0;
}

using namespace std;
 
int main() {
	return 0;
}*/

Measured memory_bytes: 256
N = int(input())
if N >= 3*5*13:
    ans = 5
elif N >= 3*7*9:
    ans = 4
elif N >= 3*5*11 :
    ans = 3
elif N >= 3*5*9 :
    ans = 2
elif N >= 3*5*7 :
    ans = 1
else:
    ans = 0

print(ans)

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

using namespace std;

const long long MOD = 1000000007LL;
long long GCD(long long a, long long b){return b == 0 ? a : GCD(b, a % b);}

vector<string> arr;
int dist[51][51];

int main(){

    cin.sync_with_stdio(0); cin.tie(0); cout.tie(0);

    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    int h, w;
    int black = 0;

    cin >> h >> w;

    for(int i = 0; i < h; ++i){
        string a;
        cin >> a;
        arr.push_back(a);
        for(auto j : a)
            if(j == '#')
                black++;
    }

    for(int i = 0; i < h; ++i)
        for(int j = 0; j < w; ++j)
            dist[i][j] = -1;

    queue<pair<int, int>> q;

    q.push(make_pair(0, 0));
    dist[0][0] = 0;

    while(!q.empty()){
        pair<int, int> state = q.front();
        q.pop();
        int x = state.first;
        int y = state.second;
        if(x == h - 1 && y == w - 1){
            int moves = dist[x][y];
            cout << h * w - black - moves - 1;
            return 0;
        }

        for(int dx = -1; dx <= 1; ++dx){
            for(int dy = -1; dy <= 1; ++dy){
                if(dx * dy != 0 || (dx == 0 && dy == 0))
                    continue;
                if(x + dx < 0 || x + dx == h)
                    continue;
                if(y + dy < 0 || y + dy == w)
                    continue;
                if(arr[x + dx][y + dy] == '#')
                    continue;
                if(dist[x + dx][y + dy] != -1)
                    continue;
                dist[x + dx][y + dy] = dist[x][y] + 1;
                q.push(make_pair(x + dx, y + dy));
            }
        }

    }

    cout << -1;

    return 0;
}


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

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  if (a == b && a == c) {
    cout << 1 << endl;
  }
  else if (a == b || b == c || a == c) {
    cout << 2 << endl;
  }
  else {
    cout << 3 << endl;
  }  
}


Measured memory_bytes: 3580
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i <(n); ++i)
#define REP2(i,x,n) for (int i = x; i <(n); ++i)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
using namespace std;
using ll = long long;
using P = pair<int,int>;
static const double PI = acos(-1);
static const int INF = 1e9+7;



int main(){
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  REP(i,n) cin >> a[i];

  // ll pre = 1;
  //
  // REP(i,k){
  //   pre *= (ll)a[i];
  // }

  //cout << pre << endl;


  REP2(i,k,n){
    // ll now = (ll)pre/a[i-k];
    // now *= (ll)a[i];
    //cout << now << endl;
    if(a[i] > a[i-k]) cout << "Yes" << endl;
    else cout << "No" << endl;
    
  }


  return 0;
}


Measured memory_bytes: 4044
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define dbg(...) do{cerr<<__LINE__<<": ";dbgprint(#__VA_ARGS__, __VA_ARGS__);}while(0);

using namespace std;

namespace std{template<class S,class T>struct hash<pair<S,T>>{size_t operator()(const pair<S,T>&p)const{return ((size_t)1e9+7)*hash<S>()(p.first)+hash<T>()(p.second);}};template<class T>struct hash<vector<T>>{size_t operator()(const vector<T> &v)const{size_t h=0;for(auto i : v)h=h*((size_t)1e9+7)+hash<T>()(i)+1;return h;}};}
template<class T>ostream& operator<<(ostream &os, const vector<T> &v){os<<"[ ";rep(i,v.size())os<<v[i]<<(i==v.size()-1?" ]":", ");return os;}template<class T>ostream& operator<<(ostream &os,const set<T> &v){os<<"{ "; for(const auto &i:v)os<<i<<", ";return os<<"}";}
template<class T,class U>ostream& operator<<(ostream &os,const map<T,U> &v){os<<"{";for(const auto &i:v)os<<" "<<i.first<<": "<<i.second<<",";return os<<"}";}template<class T,class U>ostream& operator<<(ostream &os,const pair<T,U> &p){return os<<"("<<p.first<<", "<<p.second<<")";}
void dbgprint(const string &fmt){cerr<<endl;}template<class H,class... T>void dbgprint(const string &fmt,const H &h,const T&... r){cerr<<fmt.substr(0,fmt.find(","))<<"= "<<h<<" ";dbgprint(fmt.substr(fmt.find(",")+1),r...);}
typedef long long ll;typedef vector<int> vi;typedef pair<int,int> pi;const int inf = (int)1e9;const double INF = 1e12, EPS = 1e-9;

int main(){
	cin.tie(0); cin.sync_with_stdio(0);
	
	string s; cin >> s;
	int n = s.size();
	if(n == 1){
		cout << s << endl;
		return 0;
	}
	ll ans = 0;
	rep(i, 1 << n - 1){
		string t(1, s[0]);
		rep(j, n - 1){
			if(i & 1<< j) t.pb(' ');
			t.pb(s[j + 1]);
		}
		ll x;
		stringstream ss(t);
		while(ss >> x) ans += x;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
# https://qiita.com/_-_-_-_-_/items/34f933adc7be875e61d0
# abcde	s=input()	s='abcde'
# abcde	s=list(input())	s=['a', 'b', 'c', 'd', 'e']
# 5(1つだけ)	a=int(input())	a=5
# 1 2	| x,y = s_inpl()   |	x=1,y=2
# 1 2 3 4 5 ... n 　	li = input().split()	li=['1','2','3',...,'n']
# 1 2 3 4 5 ... n 　	li = inpl()	li=[1,2,3,4,5,...,n]
# FFFTFTTFF 　	li = input().split('T')	li=['FFF', 'F', '', 'FF']

# INPUT
# 3
# hoge
# foo
# bar
# ANSWER
# n=int(input())
# string_list=[input() for i in range(n)]

import math
import copy
from collections import defaultdict, Counter
from itertools import product
from bisect import bisect_left, bisect_right
# import numpy as np

def s_inpl(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))

A, B, C = s_inpl()

if A == B and B == C and C == A:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 4084
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for (int i = 0; i < n; ++i)
#define REP(i,k,n) for (int i = k; i <= n; ++i)
#define REPR(i,k,n) for (int i = k; i >= n; --i)
#define pb push_back
#define F first
#define S second
#define I insert
#define mp make_pair
#define sz(a) (int)((a).size())
#define all(a) (a).begin(), (a).end()
#define debug1(a) cout<<" "<<#a<<" : "<<a<<"\n"
#define debug2(a,b) cout<<" "<<#a<<" : "<<a<<" "<<#b<<" : "<<b<<"\n"
#define debug3(a,b,c) cout<<" "<<#a<<" : "<<a<<" "<<#b<<" : "<<b<<" "<<#c<<" : "<<c<<"\n"
#define debug4(a,b,c,d) cout<<" "<<#a<<" : "<<a<<" "<<#b<<" : "<<b<<" "<<#c<<" : "<<c<<" "<<#d<<" : "<<d<<"\n"
// #define M 421412341324321
#define MOD 998244353

signed main()
{
	ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
	
	int a,b;
	cin>>a>>b;

	int ans = max(a-2*b, 0LL);

	cout<<ans;


}


Measured memory_bytes: 256
n = int(input())
arr = list(map(int,input().strip().split(" ")))

ans = 0

for i in range(n):
    for j in range(i+1,n):
        if arr[i] == arr[j]:
            continue
        for k in range(j+1,n):
            if arr[i]==arr[k] or arr[j] == arr[k]:
                continue
            a = [arr[i],arr[j],arr[k]]
            a.sort()
            
            if a[0]+a[1]>a[2]:
                ans += 1

print(ans)

Measured memory_bytes: 9212
#include <bits/stdc++.h>
using namespace std;
string s;
int main()
{
	int f=0;
	cin>>s;
	int l=s.length();
	for(int i=0;i<l;i++)
	{
	   if(s[i]=='C')
	     f=1;
	   if(f==1&&s[i]=='F') 
	     f=2;
	}
	if(f==2) cout<<"Yes";
	else cout<<"No";
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repI(i, d, n) for (int i = (d); i < (n); ++i)
#define reps1(i, n) for (int i = 1; i < (n); ++i)
using namespace std;
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; }

using ll = long long;
using P = pair<int, int>;
using Pl = pair<ll, ll>;
using M = map<int, int>;
ll const INF = 1ll<<61;
double pi = 3.141592653589793238;

int main() {
  ll n;
  cin >> n;
  if (n % 2 == 1) {
    cout << 0 << endl;
    return 0;
  }
  ll div = 10;
  ll ans = 0;

  while(div <= n) {
    ans += n / div;
    div *= 5;
  }

  cout << ans << 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 popcount(n) (__builtin_popcountll(n))

using namespace std;

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 ll = long long;
using R = long double;
const R EPS = 1e-9L; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r) {return (r > EPS) - (r < -EPS);}
inline R sq(R x) {return sqrt(max(x, 0.0L));}

const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

// Problem Specific Parameter:
const int limit = 100010;
vector<int> graph[limit];
int deg[limit];
bool del[limit];

void dfs(int v, int p) {
	if (deg[v] >= 3) return;
	del[v] = true;
	for (auto &v2 : graph[v]) {
		if (v2 == p) continue;
		dfs(v2, v);
	}
}

int a[limit], b[limit];

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

	rep(i, n - 1) {
		cin >> a[i] >> b[i];
		graph[a[i]].push_back(b[i]);
		graph[b[i]].push_back(a[i]);
		deg[a[i]]++, deg[b[i]]++;
	}

	rep(v, n) {
		if (deg[v] != 1) continue;
		dfs(v, -1);
	}

	rep(v, n) graph[v].clear();

	rep(i, n - 1) {
		if (del[a[i]] or del[b[i]]) continue;
		graph[a[i]].push_back(b[i]);
		graph[b[i]].push_back(a[i]);
	}

	int ans = 0;
	rep(v, n) {
		if (deg[v] <= 2) continue;
		const int val = max<int>(0, deg[v] - 1 - graph[v].size());
		ans += val;
	}

	chmax(ans, 1);
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 11648
#include <bits/stdc++.h>
#define rep(i,N) for (int i = 0; i < (N); ++i)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main(void){
  int a;
  string s;
  cin >> a >> s;

  if (a >= 3200) cout << s << endl;
  else cout << "red" << endl;
}


Measured memory_bytes: 3596
import java.util.Scanner;

public class Main {
	Scanner sc = new Scanner(System.in);
	void doIt() {
		int n = sc.nextInt();
		System.out.println(((n + 110) / 111) * 111);
	}
	Main(){doIt();}
	public static void main(String[] args) {
		new Main();
	}

}


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

using ll  = long long;
using lli = long long int;
using vi  = vector<int>;
using vl = vector<long long>;
using pi = pair<int, int>;
using pl = pair<long long, long long>;
using vpi = vector<pair<int, int>>;
using vpl = vector<pair<long, long>>;
using si  = set<int>;
using sl  = set<long long>;
using mii = map<int, int>;
using mis = map<int, string>;
using msi = map<string, int>;
using umii = unordered_map<int, int>;
using umis = unordered_map<int, string>;
using umsi = unordered_map<string, int>;


#define all(v) ((v).begin()), ((v).end())
#define sz(v) ((int)((v).size()))
#define rep(i,n) for (int i = 0; i < (int) n; ++i) 
#define REP(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define MAX(a, b) a = max(a, b) 
#define MIN(a, b) a = min(a, b) 
#define DBG1(x) cout<<#x<<" = "<<x<<"\n"
#define DBG2(x1, x2) cout<<#x1<<" = "<<x1<<", "<<#x2<<" = "<<x2<<"\n"
#define DBG3(x1, x2, x3) cout<<#x1<<" = "<<x1<<", "<<#x2<<" = "<<x2<<", "<<#x3<<" = "<<x3<<"\n"
#define DBG4(x1, x2, x3, x4) cout<<#x1<<" = "<<x1<<", "<<#x2<<" = "<<x2<<", "<<#x3<<" = "<<x3<<", "<<#x4<<" = "<<x4<<"\n"
#define pb push_back
#define mp make_pair

#if USE_CP_REDIR
#define CP \
    freopen("input.txt","r", stdin); \
    freopen("output.txt","w", stdout);
#endif

const int INF = 1E9 - 5;
const double EPS = 1E-9;
const double PI = 3.1415926535897932384626433832795;
const int MOD = 1000000007;
const int maxN = 1E6;
int A[maxN+1];

void solve()
{
    int n;
    cin >> n;
    REP(i,0,n) cin >> A[i];
    

}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
#ifdef CP
    CP;
#endif
// your code goes here
    int a;
    cin >> a;
    cout << a + a*a + a*a*a << endl;

    return 0;
}


Measured memory_bytes: 3652
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#define rep(i,n) for(int i = 0; i , (n); ++i)
using ll = long long;
using namespace std;
int sum(int n) {
    if (n == 0) {
        return 0;
    }

    int s = sum(n - 1);
    return s + n;
}
int main() {
    int A;
    cin >> A;
    if (A == 1) {
        cout << 0;
    }
    else {
        cout << 1;
    }
}


Measured memory_bytes: 3564
#include <bits/stdc++.h>
using namespace std;
int main(){
  int x,a,b;
  cin>>x>>a>>b;
  int a1=abs(x-a);
  int b1=abs(x-b);
  if(a1<b1){
    cout<<"A"<<endl;
  }else{
    cout<<"B"<<endl;
  }
}
  
  

Measured memory_bytes: 256
n = int(input())
a = []
for _ in range(n):
    a.append(int(input())) # [1, 3, 5, 4, 2]
al = sorted(a, reverse = True) # [5, 4, 3, 2, 1]
mx = al[0]
submx = al[1]
for i in range(n):
    if a[i] == mx:
        print(submx)
    else:
        print(mx)

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

#define REP(i,n) for(long long i = 0; i < (n); i++)
#define FOR(i, m, n) for(long long i = (m);i < (n); ++i)
#define ALL(obj) (obj).begin(),(obj).end()
#define SPEED cin.tie(0);ios::sync_with_stdio(false);

template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;
template<class T> using PQ = priority_queue<T>;
template<class T> using PQR = priority_queue<T,vector<T>,greater<T>>;

const ll MOD = (ll)1e9 + 7;
const ll MOD2 = 998244353;
const ll HIGHINF = (ll)1e18;
const ll LOWINF = (ll)1e15;
const long double PI = 3.1415926535897932384626433;

template<typename T> vector<T> make_v(size_t N,T init){return vector<T>(N,init);}
template<typename... T> auto make_v(size_t N,T... t){return vector<decltype(make_v(t...))>(N,make_v(t...));}
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
template <class T, class U>ostream &operator<<(ostream &o, const map<T, U>&obj) {o << "{"; for (auto &x : obj) o << " {" << x.first << " : " << x.second << "}" << ","; o << " }"; return o;}
template <class T>ostream &operator<<(ostream &o, const set<T>&obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
template <class T>ostream &operator<<(ostream &o, const multiset<T>&obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
template <class T>ostream &operator<<(ostream &o, const vector<T>&obj) {o << "{"; for (int i = 0; i < (int)obj.size(); ++i)o << (i > 0 ? ", " : "") << obj[i]; o << "}"; return o;}
template <class T, class U>ostream &operator<<(ostream &o, const pair<T, U>&obj) {o << "{" << obj.first << ", " << obj.second << "}"; return o;}
template <template <class tmp>  class T, class U> ostream &operator<<(ostream &o, const T<U> &obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr)o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
void print(void) {cout << endl;}
template <class Head> void print(Head&& head) {cout << head;print();}
template <class Head, class... Tail> void print(Head&& head, Tail&&... tail) {cout << head << " ";print(forward<Tail>(tail)...);}
template <class T> void chmax(T& a, const T b){a=max<T>(a,b);}
template <class T> void chmin(T& a, const T b){a=min<T>(a,b);}
void YN(bool flg) {cout << ((flg) ? "YES" : "NO") << endl;}
void Yn(bool flg) {cout << ((flg) ? "Yes" : "No") << endl;}
void yn(bool flg) {cout << ((flg) ? "yes" : "no") << endl;}

int main() {
	int N; cin >> N;
	V<string> S(N);
	V<int> P(N);
	
	V<int> a(N);
	for(int i = 0; i < N; ++i){
		cin >> S[i] >> P[i];
		a[i] = i;
	}
	sort(ALL(a),[&](int l, int r){return (S[l] != S[r])?(S[l]<S[r]):(P[l]>P[r]);});
	for(int i = 0; i < N; ++i) cout << a[i]+1 << endl;

    return 0;
}


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

int main() {
	double a,b;
	cin >> a >> b;
	int c=a, d=b;
	cout << c/d << " " << c%d << " " << fixed << setprecision(5) << a/b << endl;
	return 0;
}

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

#define CIN_ONLY if(1)
struct cww{cww(){
    CIN_ONLY{
        ios::sync_with_stdio(false);cin.tie(0);
    }
}}star;
#define fin "\n"
#define FOR(i,bg,ed) for(int i=(bg);i<(ed);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
#define pb push_back
#define DEBUG if(0)
#define REC(ret, ...) std::function<ret (__VA_ARGS__)>
template <typename T>inline bool chmin(T &l,T r)
{bool a=l>r;if(a)l=r;return a;}
template <typename T>inline bool chmax(T &l,T r)
{bool a=l<r;if(a)l=r;return a;}
template <typename T>
istream& operator>>(istream &is,vector<T> &v){
    for(auto &it:v)is>>it;
    return is;
}
    
int main(){
    string s;
    cin>>s;
    if(s[0]==s[2])cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    
    return 0;
}


Measured memory_bytes: 256
# coding:utf-8

import sys
import math
import time
#import numpy as np
import collections
from collections import deque
from collections import Counter
import queue
import copy
import bisect
import heapq
import itertools



#sys.setrecursionlimit(10**7)
#N, Q = map(int, input().split())
#G = [list(input()) for i in range(H)]
#INF = V * 10001
#A = [int(i) for i in input().split()]
#AB = [list(map(int, input().split())) for _ in range(K)]

X = int(input())
ans = 100
temp=0
while True:
    ans=ans+int(ans*0.01)
    temp +=1
    if(X<=ans):
        print(temp)
        break


Measured memory_bytes: 69148
import java.io.*;
import java.util.*;
class Main{
	static final long MOD = 1_000_000_007; // 10^9+7
    static final int MAX = 2_147_483_646; // intMax 
    static final int INF = 1_000_000_000; // 10^9  
    public static void main(String[] args) throws Exception {
		hayami saori = new hayami();
		int a = saori.saori_hayami();
		int b = saori.saori_hayami();
		int c = saori.saori_hayami();
		int min = MAX;
		if(a + b < min){
			min = a + b;
		}
		if(a + c < min){
			min = a + c;
		}
		if(c + b < min){
			min = c + b;
		}
		System.out.println(min);
		saori.close();
    }
}

class hayami implements Closeable {
	private final InputStream in = System.in;
	private final byte[] hayami = new byte[1024];
	private int Hayami = 0;
	private int saori = 0;
	private boolean HayamiSaori() {
		if (Hayami < saori) {
			return true;
		}else{
			Hayami = 0;
			try {
				saori = in.read(hayami);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (saori <= 0) {
				return false;
			}
		}
		return true;
	}
	private int SaoriHayami() { 
		if (HayamiSaori()) {
            return hayami[Hayami++];
         }else{
             return -1;
         }
	}
	private static boolean hayami_saori(int hayami) { 
		return 33 <= hayami && hayami <= 126;
	}
	public boolean hayamisaori() { 
		while(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();
	}
	public String nextHayami() {
		if (!hayamisaori()) throw new NoSuchElementException();
		StringBuilder hayamin = new StringBuilder();
		int saori = SaoriHayami();
		while(hayami_saori(saori)) {
			hayamin.appendCodePoint(saori);
			saori = SaoriHayami();
		}
		return hayamin.toString();
	}
	public long saorihayami() {//nextLong
		if (!hayamisaori()) throw new NoSuchElementException();
		long hayami = 0;
		boolean misao = false;
		int saori = SaoriHayami();
		if (saori == '-') {
			misao = true;
			saori = SaoriHayami();
		}
		if (saori < '0' || '9' < saori) {
			throw new NumberFormatException();
		}
		while(true){
			if ('0' <= saori && saori <= '9') {
				hayami *= 10;
				hayami += saori - '0';
			}else if(saori == -1 || !hayami_saori(saori)){
				return misao ? -hayami : hayami;
			}else{
				throw new NumberFormatException();
			}
			saori = SaoriHayami();
		}
	}
	public int saori_hayami() {//nextInt
		long hayami = saorihayami();
		if (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();
		return (int) hayami;
	}
	public double Hayamin() { //nextDouble
		return Double.parseDouble(nextHayami());
	}
	public void close() {
		try {
			in.close();
		} catch (IOException e) {
		}
    }
    
}

Measured memory_bytes: 23124
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ln "\n"
#define pb push_back
#define pll pair<ll,ll>
#define ppll pair<ll,pll>
#define vll vector<ll>
#define vpll vector<pll>
#define vvll vector<vector<ll>>
#define sll stack<ll>
#define qll queue<ll>
#define mp make_pair
#define f first
#define s second
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define Test ll t;cin>>t; while(t--)
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL);
#define init(x,n,v) for(ll i=0;i<=n;i++) x[i]=v;
#define all(x) x.begin(),x.end()
ll MOD = 1e9+7 , MAX = 1e18 , k=1e9;
int main() 
{
	fast_io;
	ll n,k,i,ans=0;
	cin>>n>>k;
	ll min=0,max=0;
	for(i=0;i<k;i++) min+=i , max+=(n-i);
	ans=max-min+1;
	k++;
	while(i<=n)
	{
	    min+=i;
	    max+=(n-i);
	    i++;
	    ans = (ans+max-min+1)%MOD;
	}
	cout<<ans;
	return 0;
}

Measured memory_bytes: 3636
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    String T = sc.next();

    int ans  = 0;
    for (int i = 0; i < 3; i++) {
      if(S.charAt(i)==T.charAt(i)) ans++;
    }

    System.out.println(ans);

  }

}


Measured memory_bytes: 21844
S = input()
A = S[:2]
B = S[2:]
X = ['01','02','03','04','05','06','07','08','09','10','11','12']

if (A not in X) and (B not in X):
  print('NA')
elif A in X and B in X:
  print('AMBIGUOUS')
elif A in X:
  print('MMYY')
else:
  print('YYMM')

Measured memory_bytes: 3060
N = int(input())
S = input()

cum_e_cnt = [0]*(N)
for i in range(0, N):
    if i==0:
        if S[0] == "E":
            cum_e_cnt[0] = 1
    if S[i] == "E":
        cum_e_cnt[i] = cum_e_cnt[i-1] + 1
    else:
        cum_e_cnt[i] = cum_e_cnt[i-1]

cum_w_cnt = [0]*(N)
for i in range(0, N):
    if i==0:
        if S[0] == "W":
            cum_w_cnt[0] = 1
    if S[i] == "W":
        cum_w_cnt[i] = cum_w_cnt[i-1] + 1
    else:
        cum_w_cnt[i] = cum_w_cnt[i-1]

#l==0
ans = cum_e_cnt[N-1] - cum_e_cnt[0]
for l in range(1, N):
    ans = min(ans, cum_w_cnt[l-1] + cum_e_cnt[N-1] - cum_e_cnt[l])
print(ans)


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

int main() {
 int A, B;
 cin >> A >> B;
 bool flag = false;
 if( (A + B) % 3 == 0 || A % 3 == 0 || B % 3 == 0) flag = true;
 if(flag) cout << "Possible" << endl;
 else cout << "Impossible" << endl;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define YesNo(b) b?cout << "Yes" << endl: cout << "No" << endl
#define YESNO(b) b?cout << "YES" << endl: cout << "NO" << endl

class Value {
public:
    const int MOD = (int)1e9 + 7;
    const int MAX = (int)1e6;
};

vector<pair<long long, long long> > PrimeFactorization(long long int a) {
    vector<pair<long long, long long> > returnVector;
    for (long long int i = 2; i * 1 <= a; ++i) {
        if (a % i != 0) continue;
        int number = 0;
        while (a % i == 0) { ++number; a /= i; }
        returnVector.emplace_back(i, number);
    }
    if (a != 1) returnVector.emplace_back(a, 1);
    return returnVector;
}

long long int AdditionMOD(long long int a, long long int b) {
    return (a + b) % Value().MOD;
}

long long int SubtractionMOD(long long int a, long long int b) {
    return (a + Value().MOD - b) % Value().MOD;
}

long long int MultiplicationMOD(long long int a, long long int b) {
    return ((a % Value().MOD) * (b % Value().MOD) % Value().MOD);
}

long long int Power(long long int a, long long int b) {
    if (b == 0) return 1;
    else if (b == 1) return a % Value().MOD;
    else if (b % 2 == 0) return static_cast<long long int>(pow(Power(a, b / 2), 2)) % Value().MOD;
    else return (static_cast<long long int>(pow(Power(a, b / 2), 2)) * a) % Value().MOD;
}

long long int DivisionMOD(long long int a, long long int b) {
    return MultiplicationMOD(a, Power(b, Value().MOD - 2));
}

long long int fac[Value().MAX], finv[Value().MAX], inv[Value().MAX];

//　Required before binomial coefficient. and Change the MAX value according to my needs.
void BinomialCoefficientInitialization() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < Value().MAX; i++){
        fac[i] = fac[i - 1] * i % Value().MOD;
        inv[i] = Value().MOD - inv[Value().MOD % i] * (Value().MOD / i) % Value().MOD;
        finv[i] = finv[i - 1] * inv[i] % Value().MOD;
    }
}

// Calculation of binomial coefficient
long long int BinomialCoefficientCalculation(int n, int k) {
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % Value().MOD) % Value().MOD;
}

// AtCoder Beginner Contest 110 D
int main() {
    int N, M;
    cin >> N >> M;
    BinomialCoefficientInitialization();
    auto primePower = PrimeFactorization(M);
    long long int answer = 1;
    for (auto &i : primePower) {
        answer = MultiplicationMOD(answer, BinomialCoefficientCalculation(static_cast<int>(i.second + N - 1), N - 1));
    }
    cout << answer << endl;
}

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

using namespace std;

int main(void){

    int n;
    cin >> n;
    vector<int> a(n), b(n-1);
    for(int i = 0;i < n;i++) cin >> a[i];

    int minv = a[0];
    int maxv = -1000000000;
    for(int i = 1;i < n;i++){
        maxv = max(maxv, a[i]-minv);
        minv = min(minv, a[i]);
    }

    cout << maxv << endl;

    return 0;
}


Measured memory_bytes: 4344
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		sc.close();

		for(int i = 0; i < num; i++){
			int x = i + 1;
			if(x % 3 == 0){
				System.out.print(" " + (i + 1));
				continue;
			}
			while(x > 0){
				if(x % 10 == 3){
					System.out.print(" " + (i + 1));
					break;
				}
				x /= 10;
			}
		}
		System.out.println();
	}
}

Measured memory_bytes: 28648
#include <bits/stdc++.h>
#include <bitset>
#include <cassert>
#include <cstring>
#include <functional>
#include <iomanip>
#include <list>
#include <cmath>
#include <memory>
#include <queue>
#include <set>
#include <stack>
#include <vector>
// #include <boost/multiprecision/cpp_dec_float.hpp>
// #include <boost/multiprecision/cpp_int.hpp>
using namespace std;
#define REP(i, n) for (int64_t i = 0; i < (int64_t)n; i++)
#define REP_FOR(i, a, b) for (int64_t i = (int64_t)a; i < (int64_t)b; i++)
#define REP_REV(i, a, b) for (int64_t i = (int64_t)a; i > (int64_t)b; i--)
#define FORALL(v) (v).begin(), (v).end()
#define mp(a, b) make_pair(a, b)
#define eb(x) emplace_back(x)
#define F first
#define S second
typedef long long ll;
typedef long double ld;
typedef pair<int64_t, int64_t> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pdd;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<int64_t> vii;
typedef vector<vii> vvii;
const ll mod = 1e9 + 7;
const int64_t infi = 1147483600;
const ll infl = 4e18 + 5;
const char EOL = '\n';
//cout << fixed << setprecision(17) << res << endl;
// const ll MOD = 1000000009;


int main() {
    ll n, k;
    cin >> n >> k;
    vector<ll> A(n);
    for (auto & a : A) cin >> a;

    ll res = 0;

    for (int d = 60; d >= -1; --d) {
        if (d != -1 && !(k & (1LL<<d))) continue;
        ll tmp = 0;
        for (int e = 60; e >= 0; --e) {
            ll mask = 1LL<<e;
            ll num = 0;
            for (ll i = 0; i < n; ++i) {
                if (A[i] & mask) ++num;
            }
            if (e > d) {
                if (k & mask) {
                    tmp += mask * (n - num);
                } else {
                    tmp += mask * num;
                }
            }
            else if (e == d) {
                tmp += mask * num;
            }
            else {
                tmp += mask * max (num, n - num);
            }
        }
        res = max(res, tmp);
    }

    cout << res << endl;
}


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

int main(){
    int N;
    cin >> N;
    vector<int> A(N,0);
    bool flag = true;
    rep(i,N){
        cin >> A[i];
        if(A[i] % 2 == 0){
            if(A[i] % 3 == 0 || A[i] % 5 ==0){
                continue;
            }else{
                flag = false;
            }
        }
    }

    cout << (flag? "APPROVED":"DENIED") <<endl;

}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
 
#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());
 
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
 
int dfs(int u, int par, vector<set<int> > &g, vector<bool> &vis) {
	if (vis[u]) {
		return 0;
	}
	
	vis[u] = true;
	int ans = 1;

	for (auto it : g[u]) {
		if (it != par)
			ans += dfs(it, u, g, vis);
	}

	return ans;
} 

void c_p_c()
{
   ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);  
   int n, m, u, v;
   cin >> n >>m;
   vector<set<int> > g(n + 1, set<int> ());

   for (int i = 0; i < m; i++) {
   		cin >> u >> v;
   		g[u].insert(v);
   		g[v].insert(u);
   }

   vector<bool> vis(n + 1, false);
   int ans = INT_MIN;

   for (int node = 1; node <= n; node++) {
   		if (!vis[node]) {
   			int size = dfs(node, -1, g, vis);
   			ans = max(ans, size);
   		}
   }

   cout << ans;
}
 
int32_t main()
{
    c_p_c();
    return 0;
}

Measured memory_bytes: 46976
#include <bits/stdc++.h>
using namespace std;
#define MAX 10000
#define INFTY (1<<20)
#define WHITE 0
#define GRAY 1
#define BLACK 2

int n;
vector<pair<int, int> > adj[MAX];

void dijkstra() {
  priority_queue<pair<int, int> > PQ;
  int d[MAX], color[MAX];
  for ( int i = 0; i < n; i ++) {
    d[i] = INFTY;
    color[i] = WHITE;
  }

  d[0] = 0;
  PQ.push(make_pair(0,0));
  color[0] = GRAY;
  while ( !PQ.empty() ) {
    pair<int, int> f = PQ.top(); PQ.pop();//(cost, Nodeid)
    int u = f.second;
    color[u] = BLACK;
    if( d[u] < f.first * ( -1 ))continue;//今の最小Nodeよりコストが大きいなら再計算はしない
    for (int j = 0; j < adj[u].size(); j++) {
      int v = adj[u][j].first;
      if (color[v] == BLACK) continue;
      if (d[v] > d[u] + adj[u][j].second) {
        d[v] = d[u] + adj[u][j].second;
        PQ.push(make_pair(d[v] * (-1), v));//STL priority_queueはmaximum
        color[v] = GRAY;
      }
    }
  }
  for (int i =0; i< n; i++) {
    cout << i << " " << ( d[i] == INFTY ? -1 : d[i]) << endl;
  }
}

int main(){

  int k, c, u, v;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> u >> k;
    for (int j = 0; j<k;j++) {
      cin >> v >> c;
      adj[u].push_back(make_pair(v,c));
    }
  }
  dijkstra();

  return 0;
}



Measured memory_bytes: 8004