akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<vector>
#include<string>
#include <ios>     
#include <iomanip> 
#define rep(i,N) for(int i = 0; i<N,i++)
using namespace std;
typedef long long llong;
typedef unsigned long long ullong;

llong gcd(llong a, llong b) {
	if (a < b) swap(a, b);
	if (a % b == 0) return b;
	else return gcd(b, a % b);
}

llong lcm(llong a, llong b) {
	llong g = gcd(a, b);
	return a * b / g;
}

//ここまで共通

int main() {
	int N;
	cin >> N;
	cout << 180 * (N - 2);
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <deque>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <complex>
#include <functional>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cctype>

using namespace std;

#define dump(n) cout<<"# "<<#n<<"="<<(n)<<endl
#define debug(n) cout<<__FILE__<<","<<__LINE__<<": # "<<#n<<"="<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,n) repi(i,0,n)
#define iter(c) __typeof((c).begin())
#define tr(c,i) for(iter(c) i=(c).begin();i!=(c).end();i++)
#define allof(c) (c).begin(),(c).end()
#define mp make_pair

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int,int> pii;

bool search(int n,vi& hist)
{
	if(n==4)
		return true;
	
	rep(i,9){
		if(hist[i]>=3){
			hist[i]-=3;
			if(search(n+1,hist)){
				//printf("%d %d %d\n",i,i,i);
				return true;
			}
			hist[i]+=3;
		}
		else if(i<=6 && hist[i] && hist[i+1] && hist[i+2]){
			rep(j,3)
				hist[i+j]--;
			if(search(n+1,hist)){
				//printf("%d %d %d\n",i,i+1,i+2);
				return true;
			}
			rep(j,3)
				hist[i+j]++;
		}
	}
	return false;
}

bool solve(const vi& a)
{
	vi hist(9);
	rep(i,a.size())
		hist[a[i]]++;
	
	// í
	//if(*max_element(allof(hist))>=5)
	//	return false;
	
	rep(i,9){
		if(hist[i]>=2){
			hist[i]-=2;
			if(search(0,hist)){
				//printf("(%d %d)\n",i,i);
				return true;
			}
			hist[i]+=2;
		}
	}
	
	return false;
}

int main()
{
	for(string s;getline(cin,s);){
		vi a(13);
		rep(i,s.size())
			a[i]=s[i]-1-'0';
		
		vi res;
		rep(i,9){
			//  éð1ÂÁ¦é±ÆÅC»Ìª5ÂÈãÉÈéÌª¾ßçµ¢D
			// nß©ç¯¶ª5ÂÈãÜÜêÄ¢ÄC»±ÉÊÌðÁ¦é±ÆÅðª®¬·éÌÈçC»êÍLø
			if(count(allof(a),i)>=4)
				continue;
			
			a.push_back(i);
			if(solve(a))
				res.push_back(i+1);
			a.pop_back();
		}
		
		if(res.size()==0)
			cout<<"0"<<endl;
		else{
			rep(i,res.size())
				cout<<(i==0?"":" ")<<res[i];
			cout<<endl;
		}
	}
	
	return 0;
}

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

int main(){
    int N,M;
    cin>>N>>M;
    vector<int> kadai(M);
    for(int i=0;i<M;++i){
        cin>>kadai.at(i);
    }

    int sum=0;

    for(int i=0;i<M;++i){
        sum+=kadai.at(i);
    }

    if(sum>N){
        cout<<-1<<endl;

    }else{
        cout<<N-sum<<endl;
    }
}

Measured memory_bytes: 3672
#include<iostream>
#include<map>

int field[102][102];//y,x
bool flag;
int sx,sy,gx,gy,col;
std::map<int, bool> memo;

void erase(){
	for(int i=0; i<102; i++)
		for(int j=0; j<102; j++)
			field[i][j] = 0;
}

void DFS(int x, int y){
	if(field[y][x] != col || memo[1000*x+y])
		return;
	if(x == gx && y == gy){
		flag = true;
		return;
	}
	memo[1000*x+y] = true;
	DFS(x+1, y);
	if(flag)
		return;
	DFS(x, y+1);
	if(flag)
		return;
	DFS(x-1, y);
	if(flag)
		return;
	DFS(x, y-1);
}

int main(){
	int n,c,d,bx,by;
	while(true){
		flag = false;
		erase();
		memo.clear();

		std::cin >> c >> d;
		if(!c && !d)
			return 0;

		std::cin >> sx >> sy;
		std::cin >> gx >> gy;

		std::cin >> n;
		for(int i=0; i<n; i++){
			std::cin >> c >> d >> bx >> by;
			if(d==0)
				for(int h=by; h<by+2; h++)
					for(int w=bx; w<bx+4; w++)
						field[h][w] = c;
			else
				for(int h=by; h<by+4; h++)
					for(int w=bx; w<bx+2; w++)
						field[h][w] = c;
		}

		col = field[gy][gx];
		DFS(sx, sy);
		if(flag)
			std::cout << "OK\n";
		else
			std::cout << "NG\n";
	}
}

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

signed main() {
    string S;
    cin >> S;
    int ret = 10000;
    for(int i = 0;i < 26;i++) {
        int cnt = 0;
        int cnt2 = -1;
        for(int j = 0;j < S.size();j++) {
            if(S.at(j) == 'a' + i) {
                cnt = max(cnt,j - cnt2 - 1);
              	cnt2 = j;
            }
        }
      	int A = S.size();
        cnt = max(cnt,A - cnt2 - 1);
        ret = min(ret,cnt);
    }
    cout << ret << endl;
}

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

typedef long long ll;

ll inf = 1e9+7;
ll fact[200010] = {0};
ll inv[200010] = {0};

ll mult(ll n, ll m){
	if(m==1) return n%inf;
	else if(m%2==0){
		ll t = mult(n,m/2);
		return (t*t)%inf;
	}else{
		ll t = mult(n,m-1);
		return (t*n)%inf;
	}
}

void factorial(ll N){
	for(ll i=0;i<=N;i++){
		if(i==0){
			fact[i] = 1;
			inv[i] = 1;
		}
		else{
			fact[i] = (i*fact[i-1])%inf;
			inv[i] = mult(fact[i],inf-2);
		}
	}
}

ll comb(ll n,ll k){
	if(n<k) return 0;
	if(n<0 || k<0) return 0;
	else return (((fact[n]*inv[k])%inf)*inv[n-k])%inf;
}

ll hcomb(ll n,ll k){
	if(n==0 && k==0) return 1;
	return comb(n+k-1,k);
}

int B,W;
ll ans[200010] = {},p[200010],q[200010];

int main(){
    cin >> B >> W;
    factorial(B+W);
    p[0] = 0;
    q[0] = 0;
    for(int i=0;i<B+W;i++){
        if(i>=1){
            p[i] = (p[i-1]+comb(i-1,B-1)*mult(mult(2,i),inf-2))%inf;
            q[i] = (q[i-1]+comb(i-1,W-1)*mult(mult(2,i),inf-2))%inf; 
        }    
        ll ans = (1-p[i]+q[i]+inf)%inf*mult(2,inf-2)%inf;
        cout << ans << endl;
    }
}

Measured memory_bytes: 9984
#include<iostream>
#include<algorithm>
#include<vector>

using namespace std;

int main(){
	
  	int N,L;
  	cin >> N >> L;
  
  	vector<string>S(N);
  	for(int i =0; i<N; i++){
    		cin >> S.at(i);	
    }
  
  	sort(S.begin(), S.end());
  	string maetango;
  	for(int i =0; i<N; i++){
      	maetango = maetango + S.at(i);
    }
  
  	cout << maetango << endl;
  	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define agewari(a, b) ((ll)a + ((ll)b - 1)) / b
const int MOD = 1000000007;
const long long INF = 1LL << 60;
using Graph = vector<vector<ll>>;

int main()
{
    ll n;
    string s;
    cin >> n >> s;
    //"000"から"999"を格納する配列を作る
    vector<string> V(1000);
    rep(i, 1000) V[i] = "000";
    rep(i, 1000)
    {
        string tmp = to_string(i);
        rep(j, tmp.length())
        {
            V[i][2 - j] = tmp[tmp.length() - 1 - j];
        }
    }

    ll ans = 0;
    rep(i, 1000)
    {
        ll cnt = 0;
        rep(j, n)
        {
            if (V[i][cnt] == s[j])
                cnt++;
        }
        if (cnt >= 3)
            ans++;
    }

    cout << ans << endl;
}

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

double dist(ll x1, ll y1, ll x2, ll y2){
	return sqrtl((x1-x2)*(x1-x2)+(y2-y1)*(y2-y1));
}
typedef pair<double,ll> pd;

int main(){
	double xs,ys,xt,yt; cin >> xs >> ys >> xt >> yt;
	ll n; cin >> n;
	vd x(n+2),y(n+2),r(n+2);
	x[0] = xs; y[0] = ys; r[0] = 0;
	x[n+1] = xt; y[n+1] = yt; r[n+1] = 0;
	REP(i,1,n+1) cin >> x[i] >> y[i] >> r[i];
	vector<vd> d(n+2,vd(n+2,linf));
	rep(i,n+2){
		rep(j,n+2){
			if(i==j) d[i][j] = 0;
			else{
				d[i][j] = max(0.0,dist(x[i],y[i],x[j],y[j])-r[i]-r[j]);
			}
		}
	}
	vd dd(n+2,linf);
	dd[0] = 0.0;
	priority_queue<pd,vector<pd>,greater<pd>> pq;
	pq.emplace(0,0);
	while(!pq.empty()){
		pd p = pq.top(); pq.pop();
		ll u = p.second;
		rep(v,n+2){
			if(v==u) continue;
			if(dd[v] <= dd[u] + d[u][v]) continue;
			dd[v] = dd[u] + d[u][v];
			pq.emplace(dd[v],v);
		}
	}
	printf("%.10f\n",dd[n+1]);
}


Measured memory_bytes: 14192
// Vicfred
// https://atcoder.jp/contests/abc160/tasks/abc160_d
import std.algorithm;
import std.math;
import std.stdio;

void main() {
    int n, x, y;
    readf("%s %s %s", &n, &x, &y);
    readln;

    int ans = 0;
    int[] dist = new int[n];

    for(int j = 1; j <= n; j++) {
        for(int i = 1; i < j; i++) {
            int minima = min(j-i, abs(y-j)+abs(x-i)+1);
            minima = min(minima, abs(y-i)+abs(x-j)+1);
            dist[minima] += 1;
        }
    }

    for(int i = 1; i <= n-1; i++)
        dist[i].writeln;
}



Measured memory_bytes: 256
#define LOCAL
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define rrep(i, n) for(int i=(n-1); i>=0; --i)
#define rep2(i, s, n) for(int i=s; i<(n); ++i)
#define ALL(v) (v).begin(), (v).end()
#define memr(dp, val) memset(dp, val, sizeof(dp))
using namespace std;
typedef long long ll;
static const int INTINF = (INT_MAX >> 1); // 10^9 + 10^7
static const ll LLINF = (LLONG_MAX >> 1);
static const int MAX = 1e5+1;
static const ll MOD = 1e9+7;
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; }
string to_string(string s) { return '"' + s + '"'; }
string to_string(bool b) { return b ? "true" : "false"; }
template <size_t N> string to_string(bitset<N> bs) {
  string res;
  for (size_t i = 0; i < N; ++i) res += '0' + bs[i];
  return res;
}
string to_string(vector<bool> v) {
  string res = "{";
  for (bool e : v) res += to_string(e) + ", ";
  return res += "}";
}
template <class T, class U> string to_string(pair<T, U> p);
template <class C> string to_string(C c) {
  string res = "{";
  for (auto e : c) res += to_string(e) + ", ";
  return res += "}";
}
template <class T, class U> string to_string(pair<T, U> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
void debug() { cerr << '\n'; }
template <class Head, class... Tail> void debug(Head head, Tail... tail) {
  cerr << '\t' << to_string(head), debug(tail...);
}
#ifdef LOCAL
#define DEBUG(...) cerr << "[" << #__VA_ARGS__ << "]:", debug(__VA_ARGS__)
#else
#define DEBUG(...)
#endif

ll N, A, B;
vector<ll> H;

bool solve(ll mid){
	vector<ll> v(N);
	rep(i, N){
		v[i] = H[i] - B * mid;
	}
	ll res = 0;
	rep(i, N){
		if(v[i] > 0){
			res += v[i] / (A - B);
			if(v[i] % (A - B) != 0) res++;
		}
	}
	return res <= mid;
}

int main(int argc, const char * argv[]) {
	std::cout << std::fixed << std::setprecision(15);

	cin >> N >> A >> B;
	H.resize(N);
	rep(i, N) cin >> H[i];

	ll l = 0, r = 1e9+1;
	while(r - l > 1){
		ll mid = (l + r) / 2;
		if(solve(mid)){
			r = mid;
		}
		else{
			l = mid;
		}
	}

	cout << r << endl;
	return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long
#define sim template <class c
#define ris return *this
#define dor > debug &operator<<
#define eni(x)                                                                    \
	sim > typename enable_if<sizeof dud<c>(0) x 1, debug &>::type operator<<(c i) \
	{
sim > struct rge
{
	c b, e;
};
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c *x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug
{
#ifndef LOCAL
	~debug()
	{
		cerr << endl;
	}
	eni(!=) cerr << boolalpha << i;
	ris;
} eni(==) ris << range(begin(i), end(i));
}
sim, class b dor(pair<b, c> d)
{
	ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d)
{
	*this << "[";
	for (auto it = d.b; it != d.e; ++it)
		*this << ", " + 2 * (it == d.b) << *it;
	ris << "]";
}
#else
	sim dor(const c &)
	{
		ris;
	}
#endif
}
;
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
template <typename T>
using indexed_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define int long long
#define ld long double
#define pb push_back
#define mp make_pair
#define in insert
#define fi first
#define se second
#define lb lower_bound
#define ub upper_bound
#define mod 1000000007
#define sz(v) (int)(v.size())
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define prec fixed << setprecision(12)
#define rep(i, a, b) for (int i = a; i <= b; ++i)
#define repr(i, a, b) for (int i = a; i >= b; i--)
#define test  \
	int t;    \
	cin >> t; \
	while (t--)
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef set<int> si;
typedef map<int, int> mii;
typedef vector<pii> vpi;

void solve()
{
	int n;
	cin >> n;
	vi v(n + 1);
	rep(i, 1, n) cin >> v[i];
	int ans = LLONG_MAX;
	rep(t, 1, n - 1)
	{
		int sum1 = 0, sum2 = 0;
		rep(i, 1, t)
			sum1 += v[i];
		rep(i, t + 1, n)
			sum2 += v[i];
		ans = min(ans, abs(sum1 - sum2));
	}
	cout << ans << "\n";
}

int32_t main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	// test
	solve();
	return 0;
}


Measured memory_bytes: 3640
n=int(input())
a=input().split()
b=[a[i] for i in range(n) if i%2!=0] #奇数インデックス
rb=b[::-1]
c=[a[i] for i in range(n) if i%2==0] #偶数インデックス
rc=c[::-1]

if n%2==0: ans=rb+c
else: ans=rc+b

ans=" ".join(ans)
print(ans)

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

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n;
	cin >> n;
	vector<int> a(n);
	int ans = 0;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		if (i % 2 == 0 && a[i] % 2) {
			ans++;
		}
	}
	cout << ans;
}



Measured memory_bytes: 3664
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	char a[2][3];
	int t=0;
	for(int i=0;i<2;i++)
	{
		for(int j=0;j<3;j++)
		cin>>a[i][j];
	}
	
	for(int j=0;j<3;j++)
	{
		if(a[0][j]==a[1][2-j])
		t++;
		else
		break;
	}
	if(t==3)
	printf("YES\n");
	else
	printf("NO\n");
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++)
const ll MAX = 1001001;
const ll MOD = 1000000007;
int main()
{
    ll n;
    cin >> n;
    vector<ll> a(n);
    ll now = 0;
    rep(i, n)
    {
        cin >> a[i];
        now += a[i];
    }
    ll ans = now;
    rep(i, n)
    {
        now -= 2 * a[i];
        ans = min(ans, abs(now));
    }
    cout << ans << endl;
}

Measured memory_bytes: 3608
#include <iostream>
#include <string>
using namespace std;
int main(){
  string str;
  int N;
  cin >> N;
  cin >> str;
  int count1=0;
  for(int i=N-1;i>=0;i--){
    if(str[i]==')'){
      count1++;
    }else if(str[i]=='('){
      count1--;
    }
    if(count1==-1){
      count1++;
    }
  }
  string s1;
  for(int i=0;i<count1;i++){
    s1+='(';
  }
  str=s1+str;
  int count=count1+N;
  count1=0;
  for(int i=0;i<count;i++){
    if(str[i]==')'){
      count1++;
    }else if(str[i]=='('){
      count1--;
    }
  }
  string s2;
  count1*=-1;
  for(int i=0;i<count1;i++){
    s2+=')';
  }
  cout <<str<<s2<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <queue>
#include <cstring>
#include <vector>
#include <map>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <bitset>
#include <set>
#include <stack>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,k,n) for(int i=(k);i<(int)(n);i++)
#define all(i,n) (i),(i+n)

int dx4[4]={1,0,-1,0};
int dy4[4]={0,-1,0,1};
int dx8[8]={1,0,-1,1,-1,1,0,-1};
int dy8[8]={1,1,1,0,0,-1,-1,-1};
int dx9[9]={0,1,0,-1,1,-1,1,0,-1};
int dy9[9]={0,1,1,1,0,0,-1,-1,-1};

typedef pair<int, int> P;
typedef pair<string, int> SP;
typedef long long ll;
typedef pair<ll, ll> PLL;

const int INF = 1e9;
const ll LLINF = 1e18;
const int MAX_V = 1e6+1;
const ll mod = 1000000007;
// << fixed << setprecision
// --------------------------------------
ll k;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  cin >> k;

  ll a = k / 50;
  ll b = k % 50;

  vector<ll> ans;

  REP(i, 50 - b) {
    ll t = 50 - (b + 1) + a;
    ans.push_back(t);
  }

  REP(i, b) {
    ll t = 50 + (50 - b) + a;
    ans.push_back(t);
  }

  cout << 50 << endl;
  REP(i, 50) cout << ans[i] << " ";
  cout << endl;
}


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

const ll INF64 = 1LL << 60;
const int INF32 = 1 << 29;
const int MOD = 1000000007;
//const int MOD = 998244353;

// Lib
//

int main(){
#ifdef MYLOCAL
    ifstream in("input.txt");
    cin.rdbuf(in.rdbuf());
#endif
    int N; cin >> N;
    vector<long long> left(N), right(N);
    for (int i = 0; i < N; ++i) cin >> left[i] >> right[i];
    sort(left.begin(), left.end(), greater<long long>());
    sort(right.begin(), right.end());
    long long res = 0, tmp = 0;

    // left スタート
    tmp = 0;
    for (int i = 0; i < N; ++i) {
        tmp += left[i]; res = max(res, tmp);
        tmp -= right[i]; res = max(res, tmp);
    }

    // right スタート
    tmp = 0;
    for (int i = 0; i < N; ++i) {
        tmp -= right[i]; res = max(res, tmp);
        tmp += left[i]; res = max(res, tmp);
    }

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


Measured memory_bytes: 1920
// https://atcoder.jp/contests/abcXXX/tasks/abcXXX_x

#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ull = unsigned long long;
using pll = pair<ll, ll>;

static const ll INF = 1001001001;
static const ll LLINF = 1001001001001001001;
static const ll MOD = (ll)1e9 + 7;
static const double EPS = 1e-9;

#define REP(i, n) for(ll i = 0; i < (n); ++i)
#define RANGE(i, m, n) for(ll i = (m); i <= (n); ++i)
#define RRANGE(i, m, n) for(ll i = (m); i >= (n); --i)
#define POSITIVE(x) (x)=((x) < 0) ? 0 : (x)

ll power(ll x, ll y) {
    ll ret = 1;
    while(y-- > 0) ret *= x;
    return ret;
}

ll gcd(ll a, ll b) {
    assert(a >= 0);
    assert(b >= 0);
    if (b == 0) return a;
    return gcd(b, a % b);
}

ll extgcd(ll a, ll b, ll& x, ll& y) {
    x = 1; y = 0;
    assert(a >= 0);
    assert(b >= 0);
    if (b == 0) return a;
    ll X, Y;
    auto d = extgcd(b, a % b, X, Y);
    x = Y;
    y = X - (a / b) * Y;
    return d;
}

int run(istream& in, ostream& out) {
    string S;
    in >> S;
    out << (S == "ARC" ? "ABC" : "ARC")<< endl;
    return 0;
}

int main() {
    return run(cin, cout);
}


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

int main() {
  	long long c1, c2;
	long long v1, v2, t;
  	cin >> c1 >> v1 >> c2 >> v2 >> t;
    if (c1 < c2) {
       	if (abs(c1 + v1 * t) >= abs(c2 + v2 * t))
           	cout << "YES" << endl;
        else
           	cout << "NO" << endl;
       }
  	else {
      	if (abs(c1 - (v1 * t)) >= abs(c2 - (v2 * t)))
          	cout << "YES" << endl;
         else
        	cout << "NO" << endl;
    }	
    return 0;
}
  

Measured memory_bytes: 3632
#include <iostream>
#include <limits.h>
#include <vector>
#include <queue>

using namespace std;

struct Node {
    int id;
    int cost;
    bool done;
    vector<int> next_node;
    vector<int> len_cost;

    bool operator<(const Node& right) const {
        return cost > right.cost;
    }
} node[10000];

int main() {
    int n, id, k;

    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> id >> k;
        node[id].id = id;
        node[id].cost = INT_MAX;
        node[id].done = false;
        node[id].next_node.resize(k);
        node[id].len_cost.resize(k);
        for (int j = 0; j < k; j++) {
            cin >> node[id].next_node[j] >> node[id].len_cost[j];
        }
    }

    priority_queue<Node> q;
    node[0].cost = 0;
    q.push(node[0]);
    while (!q.empty()) {
        Node temp = q.top();
        q.pop();

        if (temp.done == true) {
            continue;
        }
        node[temp.id].done = true;

        for (int i = 0; i < temp.next_node.size(); i++) {
            int to = temp.next_node[i];
            int cost = temp.cost + temp.len_cost[i];
            if (node[to].cost > cost) {
                node[to].cost = cost;
                q.push(node[to]);
            }
        }
    }

    for (int i = 0; i < n; i++) {
        cout << i << " " << node[i].cost << endl;
    }
    
    return 0;
}

Measured memory_bytes: 39272
#include<stdio.h>
#include<math.h>
double rround(double x);
double det(double a,double b,double c,double d);
int main(){
double a,b,c,d,e,f;
 while(scanf("\n%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f)!=EOF){
 printf("%.3lf %.3lf\n",rround(1000*det(c,f,b,e)/det(a,d,b,e))/1000.0,rround(1000*det(a,d,c,f)/det(a,d,b,e))/1000.0);
 }
return 0;
}
double det(double a,double b,double c,double d){
double determinant;
determinant=a*d-b*c;
return determinant;
}

double rround(double x){
if((x<0.5)&&(x>-0.5)){
x=0.0;
}
return x;
}

Measured memory_bytes: 652
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"
#include "ctime"

using namespace std;

//constexpr long long int MOD = 1000000007;
//constexpr int MOD = 1000000007;
//constexpr int MOD = 998244353;
constexpr long long int MOD = 998244353;
constexpr double EPS = 1e-12;

//int N, M, K, T, H, W, L, R;
long long int N, M, K, T, H, W, L, R;


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

	cin >> N;
	vector<int>a(N);
	vector<int>b(N);
	for (int i = 0; i < N; i++) {
		cin >> a[i] >> b[i];
		if (i > 1) {
			if (a[i] == b[i] && a[i - 1] == b[i - 1] && a[i - 2] == b[i - 2]) {
				cout << "Yes\n";
				return 0;
			}
		}
	}
	cout << "No\n";
	return 0;
}

Measured memory_bytes: 3584
def main():
    K, S = map(int, input().split())
    ans = 0
    for x in range(min(K, S) + 1):
        for y in range(min(K, S-x) + 1):
            if S-x-y <= K:
                ans += 1
    print(ans)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
#include <iostream>
#include <string>
#include <math.h>
#include <algorithm>
using namespace std;

int main(){
    
	int n,ans = 0; char s[55]; cin >> n >> s;
	for (int i = 0; i < n - 2; i++) {
		if (s[i] == 'A' && s[i + 1] == 'B' && s[i + 2] == 'C') ans++;
	}
	cout << ans << endl;

	return 0;
}

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

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
ld n,m,d;
int main()
{
	scanf("%Lf%Lf%Lf",&n,&m,&d);
	printf("%.10Lf",(n-d)*(m-1)/(n*n)*(d?2.0:1.0));
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (true) {
            int x = sc.nextInt();
            int y = sc.nextInt();
            if (x == 0 && y == 0) 
                break;
            if (x < y) {
                System.out.println(x + " " + y);
            } else {
                System.out.println(y + " " + x);

            }

        }
    }
}



Measured memory_bytes: 36536
#include<iostream>

using namespace std;

int n;
int A[50];

int solve(int i, int m)
{
    if (m == 0)
    {
        return 1;
    }
    if (i >= n)
    {
        return 0;
    }

    int res = solve(i + 1, m) || solve(i + 1, m - A[i]);
    return res;
}

int main()
{
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        cin >> A[i];
    }

    int q;
    cin >> q;

    int *m = new int[q];
    int Res;
    for (int j = 0; j < q; j++)
    {
        cin >> m[j];
        Res = solve(0, m[j]);
        if (Res)
        {
            cout << "yes" << endl;
        }
        else
        {
            cout << "no" << endl;
        }
    }


    return 0;
}



Measured memory_bytes: 3112
#include <iostream>
#include <cctype>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <string>
#include <functional>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iomanip>
#define pb push_back 
#define YES cout<<"YES"<<endl
#define Yes cout<<"Yes"<<endl
#define NO cout<<"NO"<<endl
#define No cout<<"No"<<endl
typedef long long ll;
const int INF = 100000000, mod = 1000000007;
const double pi = 3.14159265;
const ll LLINF = 1LL << 50;
using namespace std;


int main() {
    int a, b;
    cin >> a >> b;
    cout << max(max(a + b, a - b), a*b) << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = (n); i >= 0; i--)
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define ALL(obj) begin(obj), end(obj)
using namespace std;
using ll = long long;
using ull = unsigned long long;

const int INF = 2100100100;
const int MOD = 1e9 + 7;

// 多次元 vector 生成
template <class T> vector<T> make_vec(size_t a) { return vector<T>(a); }
template <class T, class... Ts> auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
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 (b < a) {
        a = b;
        return 1;
    }
    return 0;
}
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int a, b;
    cin >> a >> b;

    if (a == 1) {
        a = 14;
    }
    if (b == 1) {
        b = 14;
    }

    if (a == b) {
        cout << "Draw" << endl;
    } else if (a > b) {
        cout << "Alice" << endl;
    } else if (a < b) {
        cout << "Bob" << endl;
    }

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <sstream>
#include <algorithm>
#include <utility>
#include <unordered_map>
#include <map>
#include <unordered_set>
#include <set>
#include <vector>
#include <string>
#include <cmath>
#include <queue>
#include <memory>
#include <initializer_list>
#include <iomanip>
#include <stack>
#include <bitset>
#include <cstdio>
// #include <complex>
#include <random>
 
using namespace std;
 
using ll = long long;
using ull = unsigned long long;
using ld = long double;
const ll INF = 1e18;
// const ld INF = 1e20;
const ll MOD = 1e9 + 7;
const ld EPS = 1e-9;
//const double PI = acos(-1);

void solve() {
    int a;
    cin >> a;
    for (int i = 1; i <= 9; ++i) {
        if (a % i == 0 && a / i < 10) {
            cout << "Yes\n";
            return;
        }
    }   
    cout << "No\n";
}

int main() {
    // freopen("moscow.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    solve();
    return 0;
}


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

int mod = 1000000007;

int main() {
    int n;
    cin>>n;
    
    vector<ll> arr(n+1,1);
    for(ll i=1; i<=n; i++){
        arr[i] = (arr[i-1]*i)%mod;
    }
    
    cout<<arr[n];
}

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

using namespace std;

int main(){
	int a, b;

	cin >> a;
	cin >> b;

	if(a%2 == 0 || b%2 == 0){
		cout << "Even" << endl;
	}else{
	cout << "Odd" << endl;
	}
	return 0;
}


Measured memory_bytes: 384
z,*s=gets.split(/
|T/,-1).map &:size
Y=Z=1<<8e3
X=Y<<z
s.each_slice(2){|t,u|Y=Y>>t|Y<<t
u&&X=X>>u|X<<u}
eval"puts X>>%d&Y>>%d&Z>0?:Yes: :No"%gets.split

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


using namespace std;

using ll   = long long;
using ii   = pair < int , int >;
using i3   = pair < int , ii >;
using li   = pair < ll , int >;
using lii  = pair <  ll,  ii >;
using vi   = vector < int >;
using vl   = vector < ll >;
using vli  = vector < li >;
using vii  = vector < ii >;
using vi3  = vector < i3 >;
using vlii = vector < lii >;

const int N = 2e5 + 5;
const ll INF = 1e17;
const double eps = 1e-12 , PI = acos(-1);

int n , m;

void solve(int cs){
    scanf("%d %d" , &n , &m);

    int ans = 0;
    for(int i = 0 ; i < n ; i ++){
            int x;
            scanf("%d" , &x);

            if(x >= m)ans ++;
    }

    printf("%d\n" , ans);
}

main(){
    int t = 1;
    //scanf("%d" , &t);

    for(int cs = 1 ; t -- ; cs ++){
        solve(cs);
    }

    return 0;
}



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

long long ans;

int main() {
	
	int n, a, b;

	scanf("%d", &n);
	scanf("%d", &b);
	if (b != 0) {
		puts("-1");
		return 0;
	}
	for (int i = 2; i <= n; ++i) {
		scanf("%d", &a);
		if (a <= b) {
			ans += b;
		} else if (a > b + 1) {
			puts("-1");
			return 0;
		}
		b = a;
	}
	printf("%lld\n", ans + b);
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
static const int MAX = 100;

static int cnt = 0;

void trace(int *a, int n) {
    for (int i = 0; i < n-1; i++) {
        cout << a[i] << " ";
    }
    cout << a[n-1] << endl;
}

void bubbleSort(int *a, int n) {
    int flag = 1;
    while (flag) {
        flag = 0;
        for (int j = n-1; j > 0; j--) {
            if (a[j] < a[j-1]) {
                cnt++;
                int tmp = a[j];
                a[j] = a[j-1];
                a[j-1] = tmp;
                flag = 1;
            }
        }
    }
}

int main() {    
    int a[MAX], n;

    cin >> n;
    
    for (int i = 0; i < n; i++) cin >> a[i];
    
    bubbleSort(a, n);
    trace(a, n);
    cout << cnt << endl;

    return 0;
}



Measured memory_bytes: 3064
#include <iostream>

/*
[x^Ny^K]  \sum_{t=0}^\infty [(M-1)(x+yx^2+y^2x^3+...)]^t
[x^Ny^K]  1/[1- (M-1)(x+yx^2+y^2x^3+...)]
[x^Ny^K]  1/[1- (M-1)x/(1-yx)]
[x^Ny^K]  (1-yx)/[1-yx - (M-1)x]
[x^Ny^K]  (1-yx) \sum_{i=0}^\infty (yx+(M-1)x)^i

[y^K]  (y+(M-1))^N - y (y+(M-1))^{N-1}
\binom{N}{K} (M-1)^{N-K} - \binom{N-1}{K-1} (M-1)^{N-K}
(M-1)^{N-K} \binom{N-1}{K}

\sum_{i=0}^K (M-1)^{N-i} \binom{N-1}{i}
*/

int n, m, k;

constexpr int mod = 998244353;

using u64 = unsigned long long int;

int inv[200001];

int modpow(int a, int n){
  int r = 1;
  for(; n; n >>= 1){
    if(n & 1) r = (u64) r * a % mod;
    a = (u64) a * a % mod;
  }
  return r;
}

int main(){
  std::cin >> n >> m >> k;

  u64 ans = 0;
  u64 binom = 1;
  inv[1] = 1;
  for(int i = 0; i <= k; i++){
    ans += (u64) modpow(m-1, n-i-1) * binom % mod;
    binom = binom * (n-1-i) % mod * inv[i+1] % mod;
    inv[i+2] = mod - (u64) inv[mod % (i+2)] * (mod / (i+2)) % mod;
  }
  ans %= mod;
  ans = ans * m % mod;
  std::cout << ans << std::endl;
  return 0;
}


Measured memory_bytes: 4368
#include <iostream>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <string>
#include <sstream>
#include <algorithm>
#include <random>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <cassert>
#include <climits>
#include <bitset>
#include <functional>
#include <iomanip>
#include <random>

#define FOR_LT(i, beg, end) for (int i = (int)(beg); i < (int)(end); i++)
#define FOR_LE(i, beg, end) for (int i = (int)(beg); i <= (int)(end); i++)
#define FOR_DW(i, beg, end) for (int i = (int)(beg); (int)(end) <= i; i--)
#define REP(n)              for (int repeat_index = 0; repeat_index < (int)n; repeat_index++)

using namespace std;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout << fixed << setprecision(20);

	int x, y, d; cin >> x >> y >> d;
	int ans = 0;
	FOR_LE(i, x, y) {
		if (i % d == 0) ans++;
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 3636
#include <stdio.h>
#include <string.h>
#define max(x,y) ((x)>(y)?(x):(y))

int main(void) {
	int H,W,i,j,t,ans;
	int map[501][500],L[500],R[500],st[500];
	char str[501];
	
	while(scanf("%d %d",&H,&W),H+W){
		memset(map,0,sizeof(map));
		for(i = 0;i < H;i++){
			scanf("%s",str);
			for(j = 0;j < W;j++){
				if(str[j] == '.'){
					map[i+1][j] = map[i][j]+1;
				}
			}
		}
		
		memset(L,0,sizeof(L));
		memset(R,0,sizeof(R));
		ans = 0;
		for(i = 0;i < H;i++){
			t = 0;
			for(j = 0;j < W;j++){
				while(t && map[i+1][st[t-1]] >= map[i+1][j]){
					t--;
				}
				L[j] = t ? st[t-1]+1 : 0;
				st[t++] = j;
			}
			t = 0;
			for(j = W-1;j >= 0;j--){
				while(t && map[i+1][st[t-1]] >= map[i+1][j]){
					t--;
				}
				R[j] = t ? st[t-1] : W;
				st[t++] = j;
			}
			
			for(j = 0;j < W;j++){
				ans = max(ans,map[i+1][j]*(R[j]-L[j]));
			}
		}
		
		printf("%d\n",ans);
	}
	
	return 0;
}

Measured memory_bytes: 1596
def main():
  M=10**9+7
  n,*a=open(0)
  n=int(n)
  a=[list(map(int,t[::2]))for t in a]
  dp=[1]+[0]*(2**n-1)
  for i in range(2**n-1):
    j=bin(i).count('1')
    for k in range(n):
      to=i|1<<k
      if to==i or not a[j][k]:continue
      dp[to]+=dp[i]
      dp[to]%=M
  print(dp[-1])
main()

Measured memory_bytes: 73328
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define CC puts("-------ok--------");
#define all(in) in.begin(), in.end()
#define bv vector<bool>
using namespace std;
typedef pair<int, int>PA;
using namespace std;
#define MAX  999999
int main(){
    int d; int k;
    cin >> d >>k;
    vi v(k+1,0);
    rep(i,k)
        cin >> v[i];
    if(k == 1){cout << d-1 << endl; return 0;}
    sort(v.begin(),v.begin()+k,greater<int>());
    double c = (double)d/2;
    //cout << c << endl;
     if(c<v[0]){
        int temp = v[0]-1;
        for(int j = 1;j<k;j++){
            temp-=v[j];
        }
        cout << temp << endl;
    }else if(c == v[0] || c>v[0]){
        cout << 0 << endl;
    }
    return 0;
}


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

using namespace std;
typedef long long ll;

const int N=2e5+10;
int n,k,m;
int a[N];
int b[N];
int ans[N];
string s;
int vis[N];
map<int,int> mp;

int cmp(int a, int b){
    return a>b;
}
int main()
{
    ll a1,b1,c1,d1;
    cin>>a1>>b1>>c1>>d1;
    ll ans1=a1*c1;
    ll ans2=a1*d1;
    ll ans3=b1*c1;
    ll ans4=b1*d1;
    ans1=max(ans1,ans2);
    ans1=max(ans1,ans3);
    ans1=max(ans1,ans4);
    cout<<ans1<<endl;
}



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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
int main() {
  
  long long A, B;
  cin >> A >> B;

  if (A <= 2*B ) {
  	cout << 0 << endl;
  }
  else{
    cout << A - 2*B << endl;
  }
}


Measured memory_bytes: 256
#include <iostream>

int main(){
	
	int64_t N, M;
	std::cin >> N >> M;
	int64_t ans = 0;
	if(M/2>=N){
		ans += N;
		M -= N*2;
	}
	else {
		ans += M/2;
		M %= 2;
	}
	ans += M / 4;
	std::cout << ans << std::endl;
}


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

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

using namespace std;

using ll = long long;

const int mod = 1e9 + 7;

int n;
bool p[1000];

int mul(int a, int b){
  return ll(a) * b % mod;
}

int cnt(int p){
  int c = 0;
  int d = n / p;
  while(d){
    c += d;
    d /= p;
  }
  return c;
}

int main(){
  cin >> n;

  fill_n(p + 2, 1000 - 2, true);
  rep(i, 1000){
    if(p[i]){
      for(int j = 2 * i; j < 1000; j += i){
        p[j] = false;
      }
    }
  }

  int ans = 1;
  rep(i, 1000){
    if(p[i]){
      ans = mul(ans, cnt(i) + 1);  
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(){
	int n,i,j,k,cnt;
	while(1){
		scanf("%d",&n);
		if(!n)break;
		cnt=0;
		for(i=2;i<n;i++){ //
			for(j=1;i+j<=n;j++){ // min_fact
				if(n==((2*j-1+i)*i/2))cnt++;
			}
		}
		printf("%d\n",cnt);
	}
	return 0;
}

Measured memory_bytes: 1028
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <string>
#include <map>

#define ll long long
#define REP(i,n) for(int i = 0; i < n; i++)
#define PI 3.141592653589

using namespace std;

int gcd(int a, int b){return (a % b)? gcd(b, a % b) : b;}
int lcm(int a, int b){return a * b / gcd(a, b);}

void solve_A(){
    int n;
    cin >> n;
    if(n%2 == 0) cout << n/2;
    else cout << n/2 + 1;
}

void solve_B(){
    int a[3][3];
    int n;
    REP(i,3){
        REP(j,3){
            cin >> a[i][j];
        }
    }
    cin >> n;
    int b[n];
    REP(i,n){
        cin >> b[i];
        REP(k,3){
            REP(l,3){
                if(b[i] == a[k][l]) a[k][l] = -1;
            }
        }
    }

    bool ok = false;

    REP(i,3){
        if(a[i][0] == -1 && a[i][1] == -1 && a[i][2] == -1) ok = true;
    }

    REP(i,3){
        if(a[0][i] == -1 && a[1][i] == -1 && a[2][i] == -1) ok = true;
    }

    if(a[0][0] == -1 && a[1][1] == -1 && a[2][2] == -1) ok = true;
    if(a[0][2] == -1 && a[1][1] == -1 && a[2][0] == -1) ok = true;

    if(ok) cout << "Yes";
    else cout << "No";

}

void solve_C(){
    int n, m;
    cin >> n >> m;
    
    int ans[n];
    if(n == 1) ans[0] = 0;
    else{
        ans[0] = 1;
        for(int i = 1; i < n; i++) ans[i] = 0;
    }

    bool ok = true;

    int s[m], c[m];

    REP(i,m){
        cin >> s[i] >> c[i];
        
        REP(j,i){
            if(s[i] == 1){
                if(s[j] == s[i] && c[j] != 0 && c[j] != c[i]) ok = false;
            } else{
                if(s[j] == s[i] && c[j] != c[i]) ok = false;
            }
        }
        ans[s[i]-1] = c[i];
    }

    if(n != 1 && ans[0] == 0) ok = false;

    if(ok) REP(i,n) cout << ans[i];
    else cout << -1;
}

int main(void){
    solve_C();
    
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<string>
using namespace std;
int main() {
	string s;

	cin >> s;
	bool flg = true;

	for (int i = 0; i < s.size(); i++) {
		if (i % 2 == 0 && s[i] == 'L')flg = false;
		if (i % 2 == 1 && s[i] == 'R')flg = false;
		if (!flg)break;
	}

	if (flg)puts("Yes");
	else puts("No");

	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<map>
#include<iomanip>
#include<queue>
#include<stack>
#include<time.h>
#define rep(i,n)for(ll i=0;i<n;i++)
#define ll long long
#define ggr getchar();getchar();return 0;
#define prique priority_queue
#define inf 1000000007
#define double long double
using namespace std;
typedef pair<double, double>P;
bool prime(int n) {
	int cnt = 0;
	for (int i = 1; i <= sqrt(n); i++) {
		if (n % i == 0)cnt++;
	}
	if (cnt != 1)return false;
	else return n != 1;
}
ll gcd(ll x, ll y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
ll lcm(ll x, ll y) {
	return x * y / gcd(x, y);
}
ll mod_pow(ll x, ll n, ll mod) {
	ll bit = 1;
	while (n) {
		if (n & 1)bit = bit * x % mod;
		x = x * x % mod;
		n /= 2;
	}
	return bit;
}
ll C(ll a, ll b) {
	ll x = 1, y = 1;
	rep(i, b) {
		x = x * (a - i) % inf;
		y = y * (b - i) % inf;
	}
	rep(i, inf) {
		if (x == y * i % inf) {
			return i;
		}
	}
}
signed main() {
	ll n;
	cin >> n;
	cout << pow(n, 3) << endl;
	ggr
}


Measured memory_bytes: 256
import java.util.Scanner;

class Main {
     public static void main(String[] args) {
        Scanner input=new Scanner(System.in);
        char []S;
        int count=0;
        S=input.next().toCharArray();
        for(int i=0;i<3;i++)
        {
                if(S[i]==S[i+1])
                {
                    System.out.println("Bad");
                    count++;
                    break;
                }
            
        }
        if(count==0)
        {
            System.out.println("Good");
        }    
     }
        
}


Measured memory_bytes: 21844
while True:
        k=map(int,raw_input().split())
        H=k[0]
        W=k[1]
        if H+W==0:
                break
#       
        if W%2==0:
                pattern="even"
        else:
                pattern="odd"
#
        if pattern=="even":
                f_line="#."*(W/2)
                s_line=".#"*(W/2)
        if pattern=="odd":
                f_line="#."*((W-1)/2)+"#"
                s_line=".#"*((W-1)/2)+"."
        for i in range(H):
                if i%2==0:
                        print f_line
                else:
                        print s_line
#
        print ""

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

int main() {
  string s,t;
  cin >> s >> t;
  sort(s.begin(),s.end()) ;
  sort(t.begin(),t.end(),greater<int>());
  if(s < t){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
struct Fast {Fast(){std::cin.tie(0);ios::sync_with_stdio(false);cout.precision(20);}} fast;

/* define */
#define FOR(I,X,Y) for(long long (I)=(X);(I)<(Y);(I)++)
#define REP(I,X,Y) for(long long (I)=(Y)-1;(I)>=(X);(I)--)
#define ALL(X) (X).begin(),(X).end()
#define pb push_back
#define COUNT(V,X) (upper_bound((V).begin(),(V).end(),X)-lower_bound((V).begin(),(V).end(),X))
#define debug(x) cerr<<#x<<':'<<x<<endl;
#define DEBUG(v) cerr<<#v<<':';for(auto xXx:v)cerr<<xXx<<' ';cerr<<endl;
#define Yes(X) if(X){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}
#define YES(X) if(X){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define ctoi(C) (C-'0')
#define pow2(x) ((long long)((long long)1<<x))

/* alias */
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vii = vector<vector<int>>;
using vl = vector<long long>;
using vll = vector<vector<long long>>;
using pi = pair<int,int>;
using pl = pair<long long,long long>;
template<typename T> using PQ = priority_queue<T>;
template<typename T> using minPQ = priority_queue<T, vector<T>, greater<T>>;

/* const */
const long long dx[] = {1,0,-1,0};
const long long dy[] = {0,1,0,-1};
const long long dx8[] = {1,1,0,-1,-1,-1,0,1};
const long long dy8[] = {0,1,1,1,0,-1,-1,-1};
const long long dx9[] = {1,1,0,-1,-1,-1,0,1,0};
const long long dy9[] = {0,1,1,1,0,-1,-1,-1,0};
const int INF = 1000000007;
const long long LINF = 1000000000000000007;

/* func */
template <typename T> inline bool chmin(T& a, const T& b) {if (a > b) a = b; return a > b;}
template <typename T> inline bool chmax(T& a, const T& b) {if (a < b) a = b; return a < b;}
long long max(long long x,int y){return max(x,(long long)y);}
long long max(int x,long long y){return max((long long)x,y);}
long long min(long long x,int y){return min(x,(long long)y);}
long long min(int x,long long y){return min((long long)x,y);}

/* liblary */



/* main */

signed main(){
	int A,B,C;
	cin >> A >> B >> C;
	int canplay = B/A;
	cout << min(canplay,C) << endl;
}

Measured memory_bytes: 384
#!/usr/bin/env python
import sys


def solve(A: int, B: int, C: int, D: int, E: int):
    p = [A,B,C,D,E]
    list = []
    for d in p:
        diff = 10 - d % 10
        if diff == 10:
            diff = 0
        list.append((diff,d))
    list.sort()
    sum = 0
    for i in range(4):
        sum += list[i][0] + list[i][1]

    print(sum + list[4][1])
    return


# Generated by 1.1.3 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    D = int(next(tokens))  # type: int
    E = int(next(tokens))  # type: int
    solve(A, B, C, D, E)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
/*

                   _ooOoo_
                  o8888888o
                  88" . "88
                  (| -_- |)
                  O\  =  /O
               ____/`---'\____
             .'  \\|     |//  `.
            /  \\|||  :  |||//  \
           /  _||||| -:- |||||-  \
           |   | \\\  -  /// |   |
           | \_|  ''\---/''  |   |
           \  .-\__  `-`  ___/-. /
         ___`. .'  /--.--\  `. . __
      ."" '<  `.___\_<|>_/___.'  >'"".
     | | :  `- \`.;`\ _ /`;.`/ - ` : | |
     \  \ `-.   \_ __\ /__ _/   .-` /  /
======`-.____`-.___\_____/___.-`____.-'======
                   `=---='
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    prayer
*/

// g++ -std=c++11 a.cpp
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<unordered_map>
#include<utility>
#include<cmath>
#include<random>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(long long i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define FOR(i,a) for(auto i:a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define show1d(v) {rep(_,v.size())cout<<" "<<v[_];cout<<endl;}
#define show2d(v) {rep(__,v.size())show1d(v[__]);}
using namespace std;
//kaewasuretyuui
typedef long long ll;
#define int ll
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
#define mt make_tuple
typedef tuple<int,int,int,int> tp;
typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
const double PI=acos(-1);
const double EPS=1e-9;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9+10;
#define yes cout<<"Yes"<<"\n"
#define no cout<<"No"<<"\n"

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

	int a,b,c;
	cin>>a>>b>>c;
	vi in={a,b,c};
	sort(all(in));
	cout<<in[0]*in[1]/2<<endl;
}


Measured memory_bytes: 256