akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>

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

using namespace std;

typedef long long ll;
typedef pair<int,int> ii;

struct Data{
  int L,R;//[L,R]
  long long sum;
  Data(int L=0,int R=0,long long sum=0):L(L),R(R),sum(sum){}
  bool operator < (const Data& data)const{
    if( sum != data.sum ) return sum < data.sum;
    return L > data.L;
  }
};


const int IINF = INT_MAX, MAX = 4010;

int n,pre[MAX][MAX],dp[MAX];
ll sum[MAX];

int main(){
  cin >> n;
  vector<ll> A(n);
  rep(i,n){
    cin>>A[i];
    if( i == 0 ) sum[i] = A[i];
    else         sum[i] = sum[i-1] + A[i];
  }

  vector<Data> buf;
  rep(i,n+1)REP(j,i+1,n+1)buf.push_back(Data(i,j,sum[j-1]-((i-1>=0)?sum[i-1]:0LL)));
  sort(buf.begin(),buf.end());
  rep(i,MAX)dp[i] = -IINF;
  rep(i,MAX)rep(j,MAX)pre[i][j] = IINF;

  dp[0] = 0LL;

  rep(i,buf.size()){
    int cur = buf[i].L, next = buf[i].R;
    //cout << "buf[" << i << "] = " << cur << "," << next << " " << buf[i].sum << endl;
    if( dp[cur] == -IINF ) continue;
    if( dp[next] < dp[cur] + 1 ){
      //cout << "update dp[" << next << "] = " << dp[cur] + 1 << " pre[" << next << "] = " << cur << endl;
      dp[next] = dp[cur] + 1;
      pre[dp[next]][next] = cur;
    }
  }


  int cur = n,cnt = IINF;
  vector<int> path;

  for(int i = MAX-1; i >= 0; i-- ) if( pre[i][cur] != IINF ){
      cnt = i;
      break;
    }

  assert( cnt != IINF );
  while( cnt >= 0 && pre[cnt][cur] != IINF ){
    path.push_back(cur);
    cur = pre[cnt][cur];
    cnt--;
  }

  if( !path.empty() )reverse(path.begin(),path.end());
  if( path.size() >= 1)path.erase(path.end()-1);

  cout << path.size() + 1 << endl;
  rep(i,path.size()) {
    if( i ) cout << ' ';
    cout << path[i];
  } cout << endl;

  return 0;
}

Measured memory_bytes: 191000
#include <iostream>
#include <iomanip>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <utility>
#include <string>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <numeric>

using namespace std;

typedef uint64_t u64;
typedef int64_t s64;
typedef uint32_t u32;
typedef int32_t s32;
typedef vector<s32> vs32;
typedef vector<u32> vu32;
typedef vector<s64> vs64;
typedef vector<u64> vu64;

const double PI=3.14159265358979323846;

#define MAX(x, y) ((x) < (y) ? (y) : (x))
#define MIN(x, y) ((x) > (y) ? (y) : (x))

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

#define CEIL(x, y) (((x) + (y) - 1) / (y))
#define MOD 1000000007ULL

#define IN(l, r, x) ((l) <= (x) && (x) < (r))

const int N = 1000000;
s64 fac[N + 1], finv[N + 1];

s64 mypow(s64 x, s64 n)
{
    s64 ret = 1;
    while (n > 0)
    {
        if (n & 1) ret = (ret * x) % MOD;
        x = (x * x) % MOD;
        n >>= 1;
    }
    return ret;
}

void init(int n)
{
    if (n > N) n = N;
    fac[0] = 1;
    rep (i, n)
    {
        fac[i + 1] = (fac[i] * (i + 1)) % MOD;
    }
    finv[n] = mypow(fac[n], MOD - 2);
    for (int i = n; i >= 1; --i)
    {
        finv[i - 1] = (finv[i] * i) % MOD;
    }
}

s64 com(int n, int k)
{
    if (n < k || n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

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

    init(N);

    s64 h, w, a, b;
    cin >> h >> w >> a >> b;

    s64 sub = 0;
    s64 ans = 0;
    rep (i, h - a)
    {
        s64 H = h - a - 1 - i;
        s64 W = i + b - 1;
        if (W > w - 1) break;
        // cout << "H, W = " << H << ", " << i << "\n";
        // cout << "rH, rW = " << h - 1 - H << ", " << w - i - 1 << "\n";
        ans = (ans + com(H + W, W) * com(h - 1 - H + MIN(w - b - 1, w - W - 1), h - 1 - H) % MOD) % MOD;
    }
    // s64 ans = (com(h + w - 2, w - 1) + (MOD - sub)) % MOD;

    cout << ans << "\n";
    return 0;
}



Measured memory_bytes: 15872
from subprocess import*
call(('pypy3','-c',"""
n,t=[int(j) for j in input().split()]
ab=[]
ans=[]
dp=[0]*t
for i in range(n):
    tmp=[int(j) for j in input().split()]
    ab.append(tmp)
ab.sort()
for a,b in ab:
    for i in range(t)[::-1]:
        if dp[i]!=0 or i==0:
            if i+a>=t:
                ans.append(dp[i]+b)
            else:
                dp[i+a]=max(dp[i+a],dp[i]+b)
if ans:
    print(max(ans))
else:
    print(max(dp))
"""))

Measured memory_bytes: 143596
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define db double
#define pint pair<int,int>
#define mk(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define eb(x,y) emplace_back(x,y)
#define fi first
#define se second
#define Rep(x,y,z) for(int x=y;x<=z;x++)
#define Red(x,y,z) for(int x=y;x>=z;x--)
using namespace std;
char buf[1<<12],*pp1=buf,*pp2=buf,nc;int ny;
//inline char gc() {return pp1==pp2&&(pp2=(pp1=buf)+fread(buf,1,1<<12,stdin),pp1==pp2)?EOF:*pp1++;}
inline char gc(){return getchar();}
inline int read(){
	int x=0;for(ny=1;nc=gc(),(nc<48||nc>57)&&nc!=EOF;)if(nc==45)ny=-1;if(nc<0)return nc;
	for(x=nc-48;nc=gc(),47<nc&&nc<58&&nc!=EOF;x=(x<<3)+(x<<1)+(nc^48));return x*ny;
}
int n;char s[1<<10];vector<pint>ans;
inline string rev(string a){reverse(a.begin(),a.end());return a;}
inline void Solve(int sta){
	int cnt=0;for(int i=0;i<n;i++)cnt+=sta>>i&1;
	if(cnt==1){
		int t=0;for(;t<n;t++)if(sta>>t&1)break;
		Rep(i,1,t)ans.eb(i,0);ans.eb(t,1),ans.eb(t+1,1),ans.eb(t+1,0);
		Red(i,t,0)ans.eb(i,0);
		return;
	}
	string S;S.clear();int i=n-1;
	for(;i>=0;i--)if(sta>>i&1)break;S.pb(i+'a'),S.pb(i+'A');
	for(i--;i>=0;i--)if(sta>>i&1)S=(char)('a'+i)+S+(char)('a'+i)+(char)('A'+i)+rev(S)+(char)('A'+i);
	int now=0;
	for(auto o:S){
		int opt,p,d;
		if(isupper(o))opt=1,p=o-'A';else opt=0,p=o-'a';
		if(now<=p){d=0;Rep(i,now+1,p)ans.eb(i,0);}
		else{d=1;Red(i,now-1,p+1)ans.eb(i,0);}
		if(d&&opt)ans.eb(p,0),now=p;
		else if(d&&!opt)ans.eb(p+1,1),ans.eb(p,1),ans.eb(p,0),now=p;
		else if(!d&&opt)ans.eb(p+1,0),now=p+1;
		else if(!d&&!opt)ans.eb(p,1),ans.eb(p+1,1),ans.eb(p+1,0),now=p+1;
	}Red(i,now-1,0)ans.eb(i,0);
}
int main(){
//	freopen("std.in","r",stdin);
//	freopen("std.out","w",stdout);
	n=read(),scanf("%s",s);
	if(s[0]=='0')return puts("Impossible"),0;
	for(int i=0;i<1<<n;i++){
		if(s[i]=='1'){
			for(int j=0;j<n;j++)if(i>>j&1)
				if(s[i^(1<<j)]=='0')return puts("Impossible"),0;
		}else{
			for(int j=0;j<n;j++)if(!(i>>j&1))
				if(s[i^(1<<j)]=='1')return puts("Impossible"),0;
		}
	}
	ans.eb(0,0);
	for(int i=0;i<1<<n;i++)if(s[i]=='0'){
		bool flg=1;
		for(int j=0;j<n;j++)if((i>>j&1)&&s[i^(1<<j)]=='0')flg=0;
		if(flg)Solve(i);
	}puts("Possible");cout<<ans.size()-1<<'\n';
	for(auto o:ans)cout<<o.fi<<' '<<o.se<<'\n';
	return 0;
}




Measured memory_bytes: 3736
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#include <numeric>
typedef long long Int;
#define rep(i,a,b) for(Int i=a;i<b;++i)
#define rrep(i,a,b) for(Int i=a;i>=b;--i)
using namespace std;

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

    char c; cin >> c;
    string vowel = "aiueo";
    rep(i, 0, vowel.size()) {
      if (c == vowel[i]) {
        cout << "vowel" << endl;
        return 0;
      }
    }
    cout << "consonant" << endl;
}


Measured memory_bytes: 256
import sys

cnt = [0 for i in xrange(26)]

for e_string in sys.stdin:

	for i in e_string:
		j = ord(i)
		if   j >= 65 and j <= 90:
			cnt[j%65] += 1
		elif j >= 97 and j <= 122:
			cnt[j%97] += 1
		else:
			continue

for i in xrange(26):
	print u"%c : %d" % (chr(97+i), cnt[i])

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

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

void Main() {
    int X;
    cin >> X;
    vector<bool> dp(X + 1000, false);
    dp[0] = true;

    rep(i, X) {
        dp[i + 100] = (dp[i + 100] | dp[i]);
        dp[i + 101] = (dp[i + 101] | dp[i]);
        dp[i + 102] = (dp[i + 102] | dp[i]);
        dp[i + 103] = (dp[i + 103] | dp[i]);
        dp[i + 104] = (dp[i + 104] | dp[i]);
        dp[i + 105] = (dp[i + 105] | dp[i]);
    }
    if (dp[X]) {
        cout << 1 << '\n';
    } else {
        cout << 0 << '\n';
    }
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <map>
#include <set>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <fstream>
#include <bitset>
#include <queue>
#include <stack>
#include <deque>
#include <complex>
#include <iomanip>
#include <stdio.h>
#include <string.h>
#include <random>
#include <functional>

using std::cin;
using std::cout;
using std::cerr;
using std::endl;

using std::map;
using std::set;
using std::bitset;
using std::vector;
using std::string;
using std::multimap;
using std::multiset;
using std::deque;
using std::queue;
using std::stack;
using std::pair;
using std::iterator;

using std::sort;
using std::stable_sort;
using std::reverse;
using std::max_element;
using std::min_element;
using std::unique;
using std::ios_base;
using std::swap;
using std::fill;

using std::setprecision;
using std::fixed;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef string S;

ll min(ll a, ll b) {return a < b ? a : b;}
ll min(int a, ll b) {return a < b ? a : b;}
ll min(ll a, int b) {return a < b ? a : b;}
ll min(int a, int b) {return a < b ? a : b;}

ll max(ll a, ll b) {return a > b ? a : b;}
ll max(int a, ll b) {return a > b ? a : b;}
ll max(ll a, int b) {return a > b ? a : b;}
ll max(int a, int b) {return a > b ? a : b;}

namespace MySpace{

};

#define F(i, n) for (int (i) = 0; (i) != (n); (i)++)
#define fi first
#define se second
#define re return
#define all(x) (x).begin(), (x).end()

long long h, w, n;
int x[500000], y[500000];
int dp[500000];
map<pair<int, int>, int> mm;
int ans = 0;

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> h >> w >> n;
    ans = h;
    for (int i = 0; i < n; i++)
    {
        cin >> x[i] >> y[i];
        mm[{x[i], y[i]}] = 1;
    }
    dp[1] = 1;
    for (int i = 2; i <= w; i++)
    {
        int t = 0;
        for (int j = dp[i - 1] + 1; j <= h; j++)
        {
            if (mm[{j, i}] == 0)
            {
                t = 1;
                dp[i] = j;
                break;
            }
        }
        if (!t) dp[i] = h + 1;
        //cout << dp[i] << " ";
    }
    for (int i = 0; i < n; i++)
    {
        if (x[i] > dp[y[i]])
        {
            ans = min(ans, x[i] - 1);
        }
    }
    cout << ans;
}


Measured memory_bytes: 26112
# ABC 044 A - 高橋君とホテルイージー / Tak and Hotels (ABC Edit)
N = int(input())
K = int(input())
X = int(input())
Y = int(input())

if K >= N:
    ans = N * X
elif N > K:
    ans = K * X
    ans +=(N-K)* Y

print( ans )

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


int main(){



  string s;
  cin>>s;
  int k;
  cin>>k;
  

  int ssize=int(s.size());
  

  int flag=-1;
  
  for (int i=0;i<ssize;i++){
    if (s.at(i)!='1'){
      flag=i;
      break;
    }
  }
  
  if (flag==-1){
    cout<<1<<endl;
  }

  else if (k<=flag){
    cout<<1<<endl;
  }
  
  else {
    cout<<s.at(flag)<<endl;
  }
  
  

  
    
    
    

  
}

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

#define FOR(i, a, b) for(int i=(a); i<(b); i++)
#define RFOR(i, a, b) for(int i=(a); i>=(b); i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, n, 0)
#define CEIL(n, m) ceil(n/pow(10.0, m))*pow(10.0, m)
#define FLOOR(n, m) floor(n/pow(10.0, m))*pow(10.0, m)
#define ROUND(n, m) round(n/pow(10.0, m))*pow(10.0, m)
#define ALL(x) (x).begin(),(x).end()
#define SORT(x) sort((x).begin(),(x).end())
#define RSORT(x) sort((x).begin(),(x).end(),greater<int>())
#define SZ(x) ((int)(x).size())
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) " (L" << __LINE__ << ") " << __FILE__ << endl;

typedef long long ll;
const int mod = 1e9+7;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const int inf = 0x3f3f3f3f;

void solve()
{
  int n; cin >> n;
  vector<int> a(n); REP(i, n) cin >> a[i];
  sort(a.begin(), a.end());
  ll x=0,y=0;
  int tmp=0;
  for (int i=n-1; i>=0; i--) {
    if (tmp==a[i]) {
      if (x==0)
      {
        x=a[i];
      }
      else if (y==0)
      {
        y=a[i];
      }
      tmp=0;
    } else {
      tmp = a[i];
    }
  }

  cout << x*y << endl;
}

int main()
{
  solve();
  return 0;
}


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

using namespace std;

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

  vector<int> v(n);
  vector<long long> pref(n);
  for (int i = 0; i < n; ++i) {
    cin >> v[i];
    pref[i] = v[i];
    if (i > 0)
      pref[i] += pref[i - 1];
  }

  int j = 0, k = 0;
  long long best = 2e18;
  for (int i = 1; i + 2 < n; ++i) {
    while (j + 1 < i && pref[j + 1] <= pref[i] / 2)
      ++j;
    while (k <= i || pref[k + 1] - pref[i] <= (pref[n - 1] - pref[i]) / 2)
      ++k;
    for (int jp = j; jp <= j + 1; ++jp)
      for (int kp = k; kp <= k + 1; ++kp) {
        if (jp < i && i < kp && kp < n) {
          long long minn = min({pref[jp], pref[i] - pref[jp], pref[kp] - pref[i], pref[n - 1] - pref[kp]});
          long long maxx = max({pref[jp], pref[i] - pref[jp], pref[kp] - pref[i], pref[n - 1] - pref[kp]});
          best = min(best, maxx - minn);
        }
      }
  }
  cout << best << endl;
}


Measured memory_bytes: 2688
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
const ll MOD = 2019;

int main(){
    string S; cin >> S;
    int len = S.size();

    reverse(S.begin(),S.end());

    vector<ll> T(len+1);
    ll p = 1;
    for(int i=1; i<=len; i++){
        T[len - i] = (p * (S[i-1]-'0'))%MOD + T[len - (i-1)]%MOD;
        T[len-i] %= MOD;
        p *= 10;
        p %= MOD;
    }

    //余りを数える
    vector<ll> remainders(2019);
    for(int i=0; i<=len; i++){
        remainders[T[len-i] % MOD]++;    
    }

    ll ans = 0;
    for(int i=0; i<2019; i++){
        if(remainders[i] > 1) ans += (remainders[i]*(remainders[i]-1))/2;
    }

    cout << ans << endl;
}

Measured memory_bytes: 5168
N, M = map(int, input().split())

if M%2 == 1:
    a = 1
    b = M
    for _ in range(M//2):
        print(a,b)
        a += 1
        b -= 1
    a = M+1
    b = 2*M + 1
    for _ in range(M - M//2):
        print(a,b)
        a += 1
        b -= 1
else:
    a = 1
    b = M+1
    for _ in range(M//2):
        print(a,b)
        a += 1
        b -= 1
    a = M+2
    b = 2*M + 1
    for _ in range(M - M//2):
        print(a,b)
        a += 1
        b -= 1

Measured memory_bytes: 9284
#include<iostream>
#include<vector>
using namespace std;
int main() {
	int n;
	int i;
	int sum = 0;
	int flag = 0;
	cin >> n;
	vector<int>a(n, 0);
	for (i = 0; i < n; i++) {
		cin >> a[i];
	}
	while (flag == 0) {
		for (i = 0; i < n; i++) {
			if (a[i] % 2 == 1) {
				flag = 1;
			}
		}
		if (flag == 0) {
			sum++;
			for (i = 0; i < n; i++) {
				a[i] = a[i] / 2;
			}
		}
	}
	cout << sum << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
  int r,d,x;
  cin >> r >> d >> x;
  long int ans = r*x-d;
  cout << ans << endl;
  for(int i=0; i<9; i++) {
    ans = r*ans-d;
    cout << ans << endl;
  }
}

Measured memory_bytes: 3556
import Control.Monad
import Control.Applicative
import Data.Functor
import Data.Function
import Data.Monoid
import Data.Maybe
import Data.List
import Data.Foldable (foldMap)
import Data.List.Split
import Data.Char
import Data.Ratio
import Data.Ord
import Data.Array.IO
 
readInt = read :: String -> Int
readDouble = read :: String -> Double
getInt = readLn :: IO Int
getInts = map readInt . words <$> getLine
sjoin :: (Show a) => [a] -> String
sjoin = unwords . map show
cond :: a -> a -> Bool -> a
cond t f c = if c then t else f
-- end of templete

comb n k = product [n-k+1..n] `div` product [1..k]

main = map ((`mod` 10) . sum . zipWith (*) (map (comb 9) [0..9]) . map digitToInt) . lines <$> getContents >>= mapM_ print

Measured memory_bytes: 3580
N = int(input())
d_i = [int(input()) for i in range(N)]

count = 0
num_i = [0 for i in range(100)]

for i in d_i:
    num_i[i - 1] += 1

for i in range(100):
    if num_i[i] != 0:
        count += 1

print(count)


Measured memory_bytes: 3060
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <map>
using namespace std;
static const uint64_t MOD = 1000000007LL;
// uint64_t dp[100005][13];

/* nCk == (n-1)C(k-1) + (n-1)Ck*/
long mem[4000][4000];
long combi(int n, int k)
{
    if (mem[n][k])
        return mem[n][k];
    long ret = 0;
    if ((k == 0) || (n <= k)) {
        ret = 1;
    } else {
        ret = (combi(n - 1, k - 1) + combi(n - 1, k)) % MOD;
    }   

    mem[n][k] = ret;
    return ret;
}

int main()
{
    int n, k; /* k: Bule */
    cin >> n >> k;

    for (int i = 1; i <= k; i++) {
        if (i > (n - k + 1) ) { 
            cout << 0 << endl;
            continue;
        }   
        long cnt = ((long) combi(k - 1, i - 1) * combi(n - k + 1, i)) % MOD;
        cout << cnt << endl;
    }   
}

Measured memory_bytes: 62080
#include<bits/stdc++.h>
using namespace std;
int main(){
	string s;
	cin>>s;
	sort(s.begin(),s.end());
	if(s[0]==s[1] && s[1]!=s[2]&& s[2]==s[3] ) cout<<"Yes";
	else cout<<"No";
	
	
	return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

typedef long long LL;

const int maxn = 2005;
const int mod = 1000000007;

inline int pow(int a, int b)
{
    if (b < 0)
        return 1;
    int ans = 1;
    for (; b; b >>= 1, a = (LL) a * a % mod)
        if (b & 1)
            ans = (LL) ans * a % mod;
    return ans;
}

int dp[maxn];

int main()
{
    int n, k;
    cin >> n >> k;
    dp[n + 1] = 1;
    for (int i = 1; i <= k; ++i)
    {
        for (int j = n; j; --j)
        {
            if (n - j + 1 < i)
                dp[j] = 0;
            else
            {
                dp[j] = dp[j + 1] + dp[j];
                if (dp[j] >= mod)
                    dp[j] -= mod;
            }
        }
    }
    cout << (LL) dp[1] * pow(2, n - k - 1) % mod;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
   int N;
   cin>>N;
   vector<int> H(N);
   for(int i=0;i<N;i++){
      cin>>H.at(i);
   }

   H.at(0)--;
   bool flag=true;
   for(int i=1;i<N;i++){
      if(H.at(i-1)<H.at(i))
         H.at(i)--;
      else if(H.at(i-1)>H.at(i)){
         cout<<"No"<<endl;
         flag=false;
         break;
      }
   }
   if(flag==true)
      cout<<"Yes"<<endl;
}

Measured memory_bytes: 640
sys={}
sys['S']=[]
sys['H']=[]
sys['C']=[]
sys['D']=[]
s=[]
h=[]
c=[]
d=[]
for i in range(input()):
    x=raw_input().split()
    if x[0]=='S':
        sys['S'].append(int(x[1]))
    elif x[0]=='H':
        sys['H'].append(int(x[1]))
    elif x[0]=='C':
        sys['C'].append(int(x[1]))
    elif x[0]=='D':
        sys['D'].append(int(x[1]))

for i in range(1,14):
    if i not in sys['S']:
        s.append(str(i))
    if i not in sys['H']:
        h.append(str(i))
    if i not in sys['C']:
        c.append(str(i))
    if i not in sys['D']:
        d.append(str(i))
for w in s:
    print 'S '+w
for w in h:
    print 'H '+w
for w in c:
    print 'C '+w
for w in d:
    print 'D '+w



Measured memory_bytes: 4696
#include<bits/stdc++.h>
#define ALL(c) (c).begin(), (c).end()
using namespace std;
using ll = long long;
using ld = long double;

const int N = 1e6+6;


int main(){
	//freopen("input.txt","r",stdin); //freopen("output.txt","w",stdout);
	ios::sync_with_stdio(0);cin.tie(0);//cout.precision(12);cout<<fixed;
	
	int n, m;
	
	#define no {cout<<"No"; return 0;}
	
	int px = 0, py = 0, pt = 0;
	cin>>n;
	while(n--){
		int x,y,t;
		cin>>t>>x>>y;
		int dx = abs(x-px);
		int dy = abs(y-py);
		if(dx+dy>t-pt) no
		int l = (t-pt) - (dx+dy);
		if(l%2) no
		px = x;
		py = y;
		pt = t;
	}
	
	cout<<"Yes";
	
	
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long; 
#ifdef LOCAL
#include "1.h"
#else
#define dbg(...) 
#endif
ll n,m,i,j,k,in,cnt = 0,l,r,u,v,x,y,tc = 1,mod = 1000000007 , ans , inf = 1e18;
const ll  mx = 100001 ;
vector<ll> a(mx,0), b(mx,0);
vector<vector<ll>> dp(mx,vector<ll>(101,-1));
ll foo(int weight , int pos){
    // dbg(weight , pos);
    if(weight == 0 or pos==n)
        return 0;
    if(dp[weight][pos]!=-1)
        return dp[weight][pos];
    else{
        ll ans1 = 0;
        // dbg(weight , pos);
        if(a[pos] <= weight)
            ans1 =  max(b[pos] + foo(weight-a[pos], pos+1), ans1);
        ans1 = max(ans1 , foo(weight , pos+1));
        // dbg(weight , pos , ans1);
        return dp[weight][pos] = ans1;
    }
        
}
void solve(){
    cin>>n>>m;
    for (int i = 0; i < n; ++i)
    {
        cin>>a[i]>>b[i];
    }
    ll ans = -1;
    ans = foo(m,0);
    cout << ans << endl;
    
}
signed main(){                                          //F
    clock_t time = clock();                             //A
    ios_base::sync_with_stdio(0);                       //S
    cin.tie(0);                                         //T
    cout.tie(0);                                        //I
    cerr.tie(0);                                        //O
    if(0) cin>>tc;
    while(tc--)
        solve();
    dbg("Author - Amit dwivedi");
    return 0&fprintf(stderr, "Time ::%.3lf ms.\n",((clock() - time)*1000.0)/CLOCKS_PER_SEC);
}


Measured memory_bytes: 83840
def main():
    import sys
    #input = sys.stdin.readline
    
    N,M = map(int, input().split())
    G = [[] for i in range(N+2)]
    iG = [[] for i in range(N+2)]
    E = []
    for i in range(M):
        a,b,c = map(int,input().split())
        G[a].append([b,-c])
        iG[b].append([a,-c])
        E.append([a,b,c])
        
    from1 = [0]*(N+2)
    toN = [0]*(N+2)
    que = [1]
    while que != []:
        v = que.pop()
        from1[v] = 1
        for L in G[v]:
            b,c = L
            if from1[b] == 0:
                que.append(b)
    que = [N]
    while que != []:
        v = que.pop()
        toN[v] = 1
        for L in iG[v]:
            b,c = L
            if toN[b] == 0:
                que.append(b)
    
    oneN = [0]*(N+2)
    for i in range(N+1):
        oneN[i] = from1[i]*toN[i]
    
    
    itG =[[] for i in range(N+2)]
    for e in E:
        a,b,c = e
        if oneN[a]==oneN[b]==1:
            itG[b].append([a,-c])
            
    import copy
    cost = [float("inf")]*(N+2)
    cost[1] = 0
    for i in range(N+2):
        tmpcost = copy.deepcopy(cost)
        for j in range(1,N+1):
            for e in itG[j]:
                a,c = e
                #print(j,a,c)
                tmpcost[j] = min(tmpcost[j], cost[a]+c)
                #print(tmpcost)
        #print(tmpcost)
        cost = copy.deepcopy(tmpcost)
    flag = 0
    tmpcost = copy.deepcopy(cost)
    for j in range(1,N+1):
        for e in itG[j]:
            a,c = e
            if cost[a]+c < cost[j]:
                #print(cost[a]+c)
                flag = 1
                break
    #print(from1)
    #print(toN)
    #print(oneN)
    #print(itG)
    #print(tmpcost)
    if flag == 1:
        print("inf")
    else:
        print(-cost[N])
    
    
    
main()

Measured memory_bytes: 87768
#include <stdio.h>

int main(){
	int n;
	scanf("%d", &n);
	int flag = 0;

	for (int i=1; i<10; i++){
		for (int j=i; j<10; j++){
			if (i*j == n){
				flag = 1;
				break;
			}
		}
		if (flag){
			break;
		}
	}

	if (flag){
		printf("Yes\n");
	}
	else{
		printf("No\n");
	}
	
	return 0;
}


Measured memory_bytes: 1664
while 1 :
    n,x=[int(i) for i in input().split()]
    count=0
    if n==x==0:
        break
    for i in range(1,n+1):
        for j in range(i+1,n+1):
            for k in range(j+1,n+1):
                if i+j+k==x:
                    count=count+1
    print(count)

Measured memory_bytes: 7632
#include <iostream>
//#include <vector>
//#include <string>
//#include <algorithm>
//#include <math.h>
//#include <queue>
//#include <stack>
//#include <iomanip>

// sometimes used
//#include <set>
//#include <map>
//#include <numeric>
//#include <list>
//#include <deque>
//#include <unordered_map>

typedef long long LL;
//typedef long double LD;
using namespace std;
 
//#define MOD 1000000007
//#define MAX 200100
//#define NIL -1

int main() {
    LL n;
    LL ans;
    cin >> n;
    if(n%2==0){
        ans=n;
    }else{
        ans=n*2;
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
let print_qq =
  let rec iter_left a b =
    if 10 > b then
      (Printf.printf "%dx%d=%d\n" a b (a * b); iter_left a (b+1))
    else ()
  in
  let rec iter_right a =
    if 10 > a then
      (iter_left a 1; iter_right (a+1))
    else ()
  in iter_right 1
;;

print_qq
;;



Measured memory_bytes: 2284
S = input()

length = [0] * len(S)
child = [0] * len(S)

index = 0
count = 0
while index < len(S):
  while index < len(S) and S[index] == "R":
    index += 1
  count = 1
  while index < len(S) and S[index] == "L":
    length[index] = -count
    index += 1
    count += 1

index = 0
count = 0
while index < len(S):
  while index < len(S) and S[len(S) - index - 1] == "L":
    index += 1
  count = 1
  while index < len(S) and S[len(S) - index - 1] == "R":
    length[len(S) - index - 1] = count
    index += 1
    count += 1

for i in range(len(S)):
  if length[i] > 0:
    l = length[i] - 1
    child[i + l + l % 2] += 1
  else:
    l = abs(length[i]) - 1
    child[i - l - l % 2] += 1

for i in range(len(S)):
  print(child[i], end="")
  if i != len(S) - 1:
    print(" ", end="")
print()


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

#define REP(i,n) for (int i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()

using namespace std;

using ll = long long;

template<class T>
class binary_indexed_tree {
private:
    const size_t size;
    const function<T(T, T)> f;
    const T unit;
    T *a;
public:
    binary_indexed_tree(size_t n, function<T(T, T)>, T unit);
    ~binary_indexed_tree();
    void update(size_t i, T x);
    T query(size_t i) const;
};

template<class T>
binary_indexed_tree<T>::binary_indexed_tree(size_t size, function<T(T, T)> f, T unit): size(size), f(f), unit(unit) {
    a = new T[size];
    fill(a, a + size, unit);
}

template<class T>
binary_indexed_tree<T>::~binary_indexed_tree() {
    delete [] a;
}

template<class T>
void binary_indexed_tree<T>::update(size_t i, T x) {
    for (size_t j = i; j < size; j |= j + 1) {
        a[j] = f(a[j], x);
    }
}

template<class T>
T binary_indexed_tree<T>::query(size_t i) const {
    T result = unit;
    for (size_t j = i; j > 0; j = (j & (j + 1))) {
        result = f(result, a[--j]);
    }
    return result;
}

class range_add_sum_query {
private:
    binary_indexed_tree<ll> *bit1;
    binary_indexed_tree<ll> *bit2;
public:
    range_add_sum_query(size_t n) {
        this->bit1 = new binary_indexed_tree<ll>(n + 1, [](ll x, ll y) { return x + y; }, 0);
        this->bit2 = new binary_indexed_tree<ll>(n + 1, [](ll x, ll y) { return x + y; }, 0);
    }

    ~range_add_sum_query() {
        delete this->bit1;
        delete this->bit2;
    }

    void range_add(size_t first, size_t last, ll x) {
        bit1->update(first, x);
        bit1->update(last, -x);
        bit2->update(first, first * x);
        bit2->update(last, -last * x);
    }

    ll range_sum(size_t last) {
        return bit1->query(last) * last - bit2->query(last);
    }

    ll range_sum(size_t first, size_t last) {
        return range_sum(last) - range_sum(first);
    }
};

using pii = pair<int, int>;
using tri = tuple<int, int, int>;

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

    int N, M, Q;
    cin >> N >> M >> Q;
    vector<pii> LR(M);
    vector<tri> pqi(Q);
    range_add_sum_query rasq(N + 1);
    REP(i, M) {
        int L, R;
        cin >> L >> R;
        --L;
        LR[i] = pii(L, R);
        rasq.range_add(R, N + 1, 1);
    }
    REP(i, Q) {
        int p, q;
        cin >> p >> q;
        --p;
        pqi[i] = tri(p, q, i);
    }
    sort(all(LR));
    sort(all(pqi));

    vector<int> result(Q);
    int p_LR = 0;
    for (tri t: pqi) {
        int p, q, i;
        tie(p, q, i) = t;
        while (p_LR < LR.size() && LR[p_LR].first < p) {
            rasq.range_add(LR[p_LR].second, N + 1, -1);
            ++p_LR;
        }
        result[i] += rasq.range_sum(q, q + 1);
    }
    for (int res: result) {
        cout << res << '\n';
    }
    cout << flush;
    return 0;
}

Measured memory_bytes: 4096
import sys

class Node:
    def __init__(self, x):
        self.key = x
        self.left = None
        self.right = None

class BinaryTree:
    def __init__(self):
        self.root = None

    def insert(self, x):
        if self.root is None:
            self.root = Node(x)
            return self

        node = self.root
        while True:
            if x > node.key:
                if node.right is None:
                    node.right = Node(x)
                    break
                else:
                    node = node.right
            elif x < node.key:
                if node.left is None:
                    node.left = Node(x)
                    break
                else:
                    node = node.left
            else:
                break

        return self

    def find(self, x):
        node = self.root
        while node is not None:
            if x == node.key:
                return True
            elif x < node.key:
                node = node.left
            else:
                node = node.right
        return False

    def pre_order(self):
        keys = []
        self.do_pre_order(self.root, keys)
        print(' ' + ' '.join(map(str, keys)))

    def do_pre_order(self, node, keys):
        if node is None:
            return
        keys.append(node.key)
        self.do_pre_order(node.left, keys)
        self.do_pre_order(node.right, keys)

    def in_order(self):
        keys = []
        self.do_in_order(self.root, keys)
        print(' ' + ' '.join(map(str, keys)))

    def do_in_order(self, node, keys):
        if node is None:
            return
        self.do_in_order(node.left, keys)
        keys.append(node.key)
        self.do_in_order(node.right, keys)

# main
tree = BinaryTree()
lines = sys.stdin.readlines()

for line in lines[1:]:
    if len(line.rstrip()) == 0:
        continue

    command = line.rstrip().split(' ')

    if command[0] == 'insert':
        tree.insert(int(command[1]))
    elif command[0] == 'print':
        tree.in_order()
        tree.pre_order()
    elif command[0] == 'find':
        if (tree.find(int(command[1]))):
            print('yes')
        else:
            print('no')
    else:
        raise 'unknown command: ' + command[0]

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

using namespace std;

namespace {
    int N, M;
    vector<vector<int>> G;
    void input() {
        cin >> N >> M;
        G = vector<vector<int>>(N);
        for (int i = 0; i < M; i++) {
            int a, b; cin >> a >> b;
            a--; b--;
            G[a].push_back(b);
            G[b].push_back(a);
        }
    }

    void solve() {
        auto f = [&]() {
            queue<tuple<int, int>> Q;
            Q.push(make_tuple(0, 0));
            vector<bool> flg(N, false);
            flg[0] = true;
            while (not Q.empty()) {
                int v, d;
                tie(v, d) = Q.front(); Q.pop();
                for (auto n : G[v]) {
                    if (flg[n]) continue;
                    flg[n] = true;
                    if (d + 1 == 2 && n == N - 1) {
                        return true;
                    }
                    Q.push(make_tuple(n, d + 1));
                }
            }
            return false;
        };
        cout << (f() ? "POSSIBLE" : "IMPOSSIBLE") << endl;
    }
}

int main() {
    input(); solve();
    return 0;
}



Measured memory_bytes: 12784
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

def main():
	X,Y = inputMap()

	ans = 0
	if X == 1:
		ans += 300000
	elif X == 2:
		ans += 200000
	elif X == 3:
		ans += 100000

	if Y == 1:
		ans += 300000
	elif Y == 2:
		ans += 200000
	elif Y == 3:
		ans += 100000

	if X == Y and X == 1:
		ans += 400000

	print(ans)


if __name__ == "__main__":
	main()


Measured memory_bytes: 38448
#include "bits/stdc++.h"
#define PRECISION(x) cout << fixed << setprecision(x)
#define FAST_IO ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define ALLR(X) (X).rbegin(), (X).rend()
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define F first
#define S second

using namespace std;
 
template<class T> bool max_self(T & a, const T & b){ 
  return b > a ? a = b, true : false; 
}
template<class T> bool min_self(T & a, const T & b){ 
  return b < a ? a = b, true : false;    
}
typedef long long LL;
const int INF = 1e9 + 7;
const double PI = acos(-1.0);
const double EPS = (1e-9);

int N, M, c, total = 0;

int main(){
  FAST_IO
  cin >> N >> M >> c;
  vector<int> b(M);
  for(int &ele : b) cin >> ele;

  for(int r = 0; r < N; ++r){
    int okay = 0;
    for(int rep = 0, x; rep < M; ++rep){
      cin >> x;
      okay += x * b[rep];
    }

    okay += c;
    if(okay > 0) total++;
  }

  cout << total << '\n';
  return 0;
}


Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(long long i=0; i<(n); ++i)
#define REP(i, d, n) for(long long i=(d); i<(n); ++i)
#define all(v) v.begin(), v.end()
using ll = long long;
int main() {//言語変えろ言語変えろ言語変えろ言語変えろ言語変えろ

int a,b,h,m;cin>>a>>b>>h>>m;
 long double pai=3.141592653589793238462643383279 ;
  long double ldo=6*m;
  long double sdo=30*h+m/2.00000000000;
  
   long double ddo;
  if(sdo>=ldo){ddo=sdo-ldo;}
  else{ddo=ldo-sdo;}
  
  long double dra=ddo*2*pai/360.000000000000;
  long double cosdra; cosdra=cos(dra);
  
  long double y=0; long double x=a*a+b*b-2*a*b*cosdra;
  y=sqrt(x);
  
   cout << fixed << setprecision(20) << y << endl;
 
 
}


Measured memory_bytes: 4160
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <utility>
#include <unordered_set>
#include <unordered_map>
#include <stack>
#include <queue>
#include <deque>
#include <functional>
#include <numeric>
#include <complex>
#include <iomanip>

using namespace std;

#define bitcount(n) __builtin_popcount(n)

#define debug(n) cout << n << endl;

#define PREC(n) setprecision(n)
#define DOTPREC(n) fixed << setprecision(n)

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pii> vpii;

#define fst first
#define scd second
#define PB push_back
#define MP make_pair
#define rep(i,x) for(int i=0;i<(x);++i)
#define rep1(i,x) for(int i=1;i<=(x);++i)
#define rrep(i,x) for(int i=(x)-1;i>=0;--i)
#define rrep1(i,x) for(int i=(x);i>=1;--i)
#define FOR(i,a,x) for(int i=(a);i<(x);++i)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()

#define omajinai ios::sync_with_stdio(false); cin.tie(0)

template<typename T> bool chmax(T&a,T b) { if(a < b) {a = b; return true;} return false;}
template<typename T> bool chmin(T&a,T b) { if(a > b) {a = b; return true;} return false;}

const int inf = 1e9;
const ll linf = 3e18;
const double eps = 1e-9;

const ll MOD = 1000000007;

int main(void)
{
    int A, B, T;
    cin >> A >> B >> T;

    int i = 1, sum = 0;
    while (A * i < T + 0.5) {
        sum += B;
        i++;
    }
    cout << sum << endl;

    return 0;
}


Measured memory_bytes: 256
/*
  Motto - try hard to become an expert
*/
#include <bits/stdc++.h>
#include <map>
#include <algorithm>
#include <vector>
#include <string.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <chrono>
#include <thread>
#include <iomanip>
 
//define
#define rep(i,n)    for(int i=0;i<n;i++)
#define repu(i,k,n) for(int i=k;i<=n;i++)
#define repd(i,k,n) for(int i=k;i>=n;i--)
#define se second
#define fi first
#define pb push_back
#define mp make_pair
#define INF (int)INT_MAX
#define all(v)  v.begin(), v.end()
#define endl "\n"
 
//typedef
typedef long long int ll;
typedef long double ld;
typedef std::pair<int, int> pii;
typedef std::vector<int> vi;
typedef std::vector< pii > vii;
typedef std::vector< ll > vll;
typedef std::vector< std::pair < pii, int > > vpp;
 
const int N = 3*1e5 +5 ;
const long long MOD = 998244353;
const long long inf = 1e18;
 
using namespace std;
 
ll MAXN=100001;
ll spf[100001]; 
 
ll modpow(ll x,ll n){
    ll res=1;
    while(n>0){
        if(n&1) res=res*x%MOD;
        x=x*x%MOD;
        n>>=1;
    }
    return res;
}
 
ll modFact(ll n, ll p) 
{ 
    if (n >= p) 
        return 0; 
  
    ll result = 1; 
    for (ll i = 1; i <= n; i++) 
        result = (result * i) % p; 
  
    return result;  
} 
 
bool isPrime(int x)
{
    if(x%2==0)
        return 0;
    for(int i=3;i<=sqrt(x);i+=2)
    {
        if(x%i==0)
            return 0;
    }
    return 1;
}
 

 
void solve()
{
   int x , y ;
   cin>>x>>y ;
   if(y%2){
   	cout<<"No";
   	return ;
   }
   y /= 2 ;
   if(x>y){
   	cout<<"No";
   	return ;
   }
   int b = y-x ;
   int a = x-b;
   if(a>=0){
   	cout<<"Yes";
   	return ;
   }
   else{
   	cout<<"No";
   	return;
   }
}
 
int main() {
    #ifndef ONLINE_JUDGE
        // for getting input from input.txt
        freopen("input.txt", "r", stdin);
        // for writing output to output.txt
        freopen("output.txt", "w", stdout);
    #endif
    
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    int t = 1;
    //cin>>t;
    while(t--)
    {
        solve();
    } 
    cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
}

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

typedef long long ll;
typedef pair<int,int> pii;

long long MOD = 1000000000 + 7;

int main(){
  cout << setprecision(10);

  ll INF = 10000000000000000;
  ll A,B;
  cin >> A >> B;

  ll ans = 0;
  ll tmp1,tmp2,tmp3,tmp4;

  // BB
  tmp1 = 1 + (-B-(-A)) + 1;
  tmp1 = (tmp1 >= 0 ? tmp1 : INF);
  // B-
  tmp2 = 1 + B - (-A);
  tmp2 = (tmp2 >= 0 ? tmp2 : INF);
  // -B
  tmp3 = -B -A + 1;
  tmp3 = (tmp3 >= 0 ? tmp3 : INF);
  // --
  tmp4 = B-A;
  tmp4 = (tmp4 >= 0 ? tmp4 : INF);


  cout << min(min(tmp1,tmp2), min(tmp3,tmp4)) << endl;
}


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

using namespace std;

int n;
long double x_p[100001], y_p[100001], x_d[100001], y_d[100001];

long double get_bound(long double mult){

    long double minix =  1e18;
    long double maxix = -1e18;

    long double miniy =  1e18;
    long double maxiy = -1e18;

    for(int i = 0; i < n; ++i){
        long double x = x_p[i] + x_d[i] * mult;
        long double y = y_p[i] + y_d[i] * mult;
        minix = min(minix, x);
        maxix = max(maxix, x);
        miniy = min(miniy, y);
        maxiy = max(maxiy, y);
    }

    return (maxix - minix) * (maxiy - miniy);

}

int main(){

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

    cin >> n;

    for(int i = 0; i < n; ++i){
        long double x, y;
        char d;
        cin >> x_p[i] >> y_p[i] >> d;
        if(d == 'U'){
            y_d[i] = 1;
        } else if(d == 'D'){
            y_d[i] = -1;
        } else if(d == 'R'){
            x_d[i] = 1;
        } else {
            x_d[i] = -1;
        }
    }

    long double left = 0, right = 1000000000;

    long double best = -1;

    for(int it = 0; it < 200; ++it){
        long double middle1 = left + (right - left) / 3;
        long double middle2 = right - (right - left) / 3;
        long double bound1 = get_bound(middle1);
        long double bound2 = get_bound(middle2);
        if(bound1 < bound2){
            right = middle2;
            if(best == -1)
                best = bound1;
            best = min(best, bound1);
        } else {
            left = middle1;
            if(best == -1)
                best = bound2;
            best = min(best, bound2);
        }
    }

    cout << fixed << setprecision(11) << best;

    return 0;
}


Measured memory_bytes: 6528
def main():
  from collections import Counter
  M=998244353
  n,*d=map(int,open(0).read().split())
  e=Counter(d)
  a=1if d[0]<1==e[0]else 0
  for i in range(n):a*=pow(e[i],e[i+1],M)
  print(a%M)
main()

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

int main(){
  int n;
  int k;
  cin >> n >>k;
  string s;
  
  cin >> s;
  
//  cout << s;
//  cout << s[0];
  if(s[k-1]=='A'){
    s[k-1]='a';
  }
  else if(s[k-1]=='B'){
    s[k-1]='b';
  }
  else {
    s[k-1]='c';
  }
  
  cout << s;
  
}

  

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

int main()
{
    int h, w, ct = 0;
    char a[105][105];
    cin >> h >> w;

    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            cin >> a[i][j];
            if (a[i][j] == '.') ++ct;
        }

        if (ct == w) 
            for (int j = 0; j < w; j++) a[i][j] = '0';
        ct = 0;
    }

    for (int j = 0; j < w; j++) {
        for (int i = 0; i < h; i++) {
            if (a[i][j] == '.' || a[i][j] == '0') ct++;
        }

        if (ct == h)
            for (int i = 0; i < h; i++) a[i][j] = '0';
        ct = 0;
    }


    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            if (a[i][j] != '0') cout << a[i][j];
            else ++ct;
        }

        if(ct != w)cout << endl;
        ct = 0;
    }
}

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

using VS = vector<string>;    using LL = long long;
using VI = vector<int>;       using VVI = vector<VI>;
using PII = pair<int, int>;   using PLL = pair<LL, LL>;
using VL = vector<LL>;        using VVL = vector<VL>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
#define debug(x) cerr << #x << ": " << x << endl
const int INF = 1e9;                          const LL LINF = 1e16;
const LL MOD = 1000000007;                    const double PI = acos(-1.0);
int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };

/* -----  2018/02/14  Problem: 069_arc_a / Link: https://abc055.contest.atcoder.jp/tasks/arc069_a?lang=en ----- */
/* ------問題------



-----問題ここまで----- */
/* -----解説等-----



----解説ここまで---- */

LL N,M;

LL ans = 0LL;

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

	cin >> N>>M;
	if (2 * N <= M) {
		ans = N;
		M -= 2 * N;
	}
	else {
		ans = M / 2;
		M = 0;
	}
	if (M > 0) {
		ans += M / 4;
	}
	cout << ans << "\n";

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define sz(x) int(x.size())
#define show(x) {for(auto i: x){cout << i << " ";} cout << endl;}
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
  int A, B;
  cin >> A >> B;
  int ans = max(0, A - 2 * B);
  cout << ans << '\n';
  return 0;
}

Measured memory_bytes: 3636
#include<iostream>
using namespace std;
 
int main(void) {
  int a, b;
  cin >> a >> b;
  
  if (a % 3 == 0 || b % 3 == 0 || (a+b) % 3 == 0) cout << "Possible" << endl;
  else cout << "Impossible" << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>

#define MAXLENGTH 1200
int main(void)
{
	int i;
	char st[MAXLENGTH];

	for (i = 0; i < MAXLENGTH; i++)
	{
		scanf("%c", &st[i]);

		if (('a' <= st[i]) && (st[i] <= 'z'))
			st[i] = st[i] - 'a' + 'A';
		else if (('A' <= st[i]) && (st[i] <= 'Z'))
			st[i] = st[i] - 'A' + 'a';
		else if (st[i] == '\n')
			break;

		printf("%c", st[i]);
		
	}
	printf("\n");

}



Measured memory_bytes: 2052
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<stack>
#include<bitset>
#include<ext/pb_ds/priority_queue.hpp>
using namespace std;

const int maxn = 2E5 + 20;
typedef pair <int,int> pr;
typedef unsigned long long u64;
const u64 mo = 1000000007;

int n,c[maxn],A[maxn],pos[maxn],L[maxn],R[maxn];
u64 sum[maxn],f[maxn];

#define fr first
#define sc second
#define mp(a,b) (make_pair((a),(b)))
#define min(a,b) ((a) < (b) ? (a) : (b))
#define max(a,b) ((a) > (b) ? (a) : (b))

pr p[maxn],q[maxn];

int main()
{
	#ifdef DMC
		freopen("DMC.txt","r",stdin);
	#endif
	
	cin >> n;
	for (int i = 1; i <= n; i++)
	{
		int x,v; scanf("%d%d",&x,&v);
		p[i] = mp(v,x); A[i] = x;
	}
	sort(p + 1,p + n + 1); sort(A + 1,A + n + 1);
	for (int i = 1; i <= n; i++) c[i] = maxn;
	for (int i = 1; i <= n; i++)
	{
		L[i] = i; pos[i] = lower_bound(A + 1,A + n + 1,p[i].sc) - A;
		for (int j = pos[i]; j > 0; j -= j&-j) c[j] = min(c[j],i);
		for (int j = pos[i]; j <= n; j += j&-j) L[i] = min(L[i],c[j]);
	}
	for (int i = 1; i <= n; i++) c[i] = 0;
	for (int i = n; i; i--)
	{
		for (int j = pos[i]; j <= n; j += j&-j) c[j] = max(c[j],i);
		for (int j = pos[i]; j > 0; j -= j&-j) R[i] = max(R[i],c[j]);
	}
	for (int i = 1; i <= n; i++) q[i] = mp(L[i],R[i]);
	sort(q + 1,q + n + 1); sum[n + 1] = 1;
	for (int i = n; i >= 0; i--)
	{
		for (int j = q[i].sc + 1; j > 0; j -= j&-j) f[i] += sum[j];
		f[i] %= mo; if (!i) break;
		for (int j = q[i].fr; j <= n + 1; j += j&-j) sum[j] += f[i];
	}
	cout << f[0] << endl;
	return 0;
}

Measured memory_bytes: 10368
import java.util.Scanner;
 
public class Main{
    public static void main(String args[]){
        Scanner sc=new Scanner(System.in);
        int i=1,n=sc.nextInt();
        while(i<=n){
            int x=i;
            if(x%3==0){
                System.out.printf(" %d",i);
            }else{
                while(x>=1){
                    if(x%10==3){
                        System.out.printf(" %d",i);
                        break;
                    }
                    x/=10;
                }
            }
            i++;
        }
        System.out.printf("\n");
    }};


Measured memory_bytes: 38040