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

using namespace std;
typedef long long ll;
const int maxn = 2e5 + 100;
const ll inf = 0x3f3f3f3f3f;
const int mod = 1e9 + 7;
int a[maxn];

struct XYZ {
    struct SegmentTree {
        int l, r;
        int maxx, minn;
    } tree[maxn << 2];

    void build(int p, int l, int r) {
        tree[p].l = l;
        tree[p].r = r;
        if (l == r) {
            tree[p].minn = tree[p].maxx = a[l];
            return;
        }
        int mid = (l + r) / 2;
        build(p * 2, l, mid);
        build(p * 2 + 1, mid + 1, r);
        tree[p].maxx = max(tree[p * 2].maxx, tree[p * 2 + 1].maxx);
        tree[p].minn = min(tree[p * 2].minn, tree[p * 2 + 1].minn);
    }

    int askmax(int p, int l, int r) {
        if (l <= tree[p].l && r >= tree[p].r) {
            return tree[p].maxx;
        }
        int mid = (tree[p].l + tree[p].r) / 2;
        int val = 0;
        if (l <= mid) val = max(val, askmax(p * 2, l, r));
        if (r > mid) val = max(val, askmax(p * 2 + 1, l, r));
        return val;
    }

    int askmin(int p, int l, int r) {
//    cout << p << " " << l << " " << r << " " << tree[p].l << " " << tree[p].r << endl;
        if (l <= tree[p].l && r >= tree[p].r) {
            return tree[p].minn;
        }
        int mid = (tree[p].l + tree[p].r) / 2;
        int val = 0x3f3f3f3f;
        if (l <= mid) val = min(val, askmin(p * 2, l, r));
        if (r > mid) val = min(val, askmin(p * 2 + 1, l, r));
        return val;
    }
} xx, yy;

int d[maxn];

int main() {
//    freopen("in.txt", "r", stdin);
    int n, k;
    scanf("%d %d", &n, &k);
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    xx.build(1, 1, n + 1);

    for (int i = 1; i <= n; i++) {
        d[i] = a[i];
    }
    for (int i = 2; i <= n; i++) {
        a[i] = (d[i] > d[i - 1]);
    }

    yy.build(1, 1, n);
    for (int i = 1; i <= n; i++) a[i] = d[i];
//    cout << askmin(1, 1, n) << endl;
    int ans = n - k + 1;
    int cnt = 0;
    for (int i = 1; i + k - 1 <= n; i++) {
//        cout << i << endl;
//        cout << askmax(1, i, i + k - 1) << endl;

//        cout << askmin(1, i, i + k - 1) << endl;
//        cout << i << " " << i + k - 1 << " " << i + 1 << " " << i + k << endl;
//        cout << xx.askmin(1, i, i + k - 1) << " " << xx.askmax(1, i + 1, i + k) << endl;
        if (a[i] == xx.askmin(1, i, i + k - 1) && a[i + k] == xx.askmax(1, i + 1, i + k)) ans--;
        else {
            if (yy.askmin(1, i + 1, i + k - 1) > 0) cnt++;
        }
    }
    if (cnt >= 2) ans = ans - cnt + 1;
    printf("%d\n", ans);
    return 0;
}


Measured memory_bytes: 21504
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vin=vector<int>;
using vll=vector<long long>;
using vvin=vector<vector<int>>;
using vvll=vector<vector<long long>>;
using vstr=vector<string>;
using vvstr=vector<vector<string>>;
using vch=vector<char>;
using vvch=vector<vector<char>>;
using vbo=vector<bool>;
using vvbo=vector<vector<bool>>;
using vpii=vector<pair<int,int>>;
using pqsin=priority_queue<int,vector<int>,greater<int>>;
#define mp make_pair
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep2(i,s,n) for(int i=(s);i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define decp(n) cout<<fixed<<setprecision((int)n)
const int inf=1e9+7;

int main(){
    int x;cin>>x;
    int ansa,ansb;
    for(int a=1;a*a*a*a*a<=x;a++)if(a*a*a*a*a==x){
        ansa=a;
        ansb=0;
        goto out;
    }
    for(int a=1;a*a<=x;a++){
        for(int b=1;a*a*b*b<=x;b++){
            if(pow(a,5)-pow(b,5)==x){
                ansa=a;
                ansb=b;
                goto out;
            }
        }
        for(int b=1;a*a*b*b<=x;b--){
            if(pow(a,5)-pow(b,5)==x){
                ansa=a;
                ansb=b;
                goto out;
            }
        }
    }
    out:
    cout<<ansa<<" "<<ansb<<endl;
}

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

int main(){
    int sx,sy,tx,ty;
    cin >> sx >> sy >> tx >> ty;
    int dx=tx-sx;
    int dy=ty-sy;
    for(int i=0; i<dy; i++){
        cout << 'U';
    }
    for(int i=0; i<dx; i++){
        cout << "R";
    }
    for(int i=0; i<dy; i++){
        cout << "D";
    }
    for(int i=0; i<dx; i++){
        cout << "L";
    }
    cout << "L";
    for(int i=0; i<dy+1; i++){
        cout << "U";
    }
    for(int i=0; i<dx+1; i++){
        cout << "R";
    }
    cout << "DR";
    for(int i=0; i<dy+1; i++){
        cout << "D";
    }
    for(int i=0; i<dx+1; i++){
        cout << "L";
    }
    cout << "U" << endl;
}

Measured memory_bytes: 3588
// Problem : C - H and V
// Contest : AtCoder - AtCoder Beginner Contest 173
// URL : https://atcoder.jp/contests/abc173/tasks/abc173_c
// Memory Limit : 1024 MB
// Time Limit : 1000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>
#define int long long
#define ios std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define mii map<int, int>
#define pii pair<int, int>
#define ff first
#define ss second
#define endl '\n'
#define all(x) (x).begin(), (x).end()
#define rep(i,x,y) for(int i=(int)x; i<y; i++)
#define fill(a,b) memset(a, b, sizeof(a))
#define vi vector<int>
#define setbits(x) __builtin_popcountll(x)
using namespace std;
const long long MOD=LLONG_MAX; //1e5+7;
int gcd(int x, int y)
{
	if(y==0) return x;
	else return gcd(y,x%y);
}
int power(int x, unsigned int y)  
{  
    int res = 1;
    x = x % MOD;
    if (x == 0) return 0;
  
    while (y > 0)  
    { 
        if (y & 1)  
            res = (res*x) % MOD;
        y = y>>1;
        x = (x*x) % MOD;  
    }  
    return res;  
}
void solve()
{
	int h,w,k,ans=0;
	cin>>h>>w>>k;
	char a[h][w];
	rep(i,0,h) rep(j,0,w) cin>>a[i][j];
	int temp;
	rep(x,0,1<<h)rep(y,0,1<<w){	
		temp=0;	
		rep(i,0,h) rep(j,0,w){
			if((1<<i)&x||(1<<j)&y)continue;
			if(a[i][j]=='#')
			temp++;
		}
		if(temp==k)ans++;
	}	
	cout<<ans<<endl;
}

int32_t main()
{	
	ios;
	int t=1; 
	//cin>>t;
	while(t--) solve();
}

Measured memory_bytes: 3632
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int y = sc.nextInt();
		
		int ans = Integer.MAX_VALUE;
		if(x<=y)
			ans = Math.min(ans, y-x);
		if(-x<=y)
			ans = Math.min(ans, y+x+1);
		if(x<=-y)
			ans = Math.min(ans, -y-x+1);
		if(-x<=-y)
			ans = Math.min(ans, -y+x+2);
		
		System.out.println(ans);
		
		sc.close();
	}
}


Measured memory_bytes: 9792
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
using namespace std;
int main() {
    int n, m, l;
    cin >> n >> m >> l;
    vector<vector<long long>> g(n, vector<long long>(n, -1));
    for (int i = 0; i < m; ++i){
        int a, b, c;
        cin >> a >> b >> c;
        --a;
        --b;
        g.at(a).at(b) = c;
        g.at(b).at(a) = c;
    }
    for (int i = 0; i < n; ++i) {
        g.at(i).at(i) = 0;
    }
    int q;
    cin >> q;
    vector<int> s(q), t(q);
    for (int i = 0; i < q; ++i){
        cin >> s.at(i) >> t.at(i);
        --s.at(i);
        --t.at(i);
    }
    for (int k = 0; k < n; ++k) {
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < n; ++j) {
                if (g.at(i).at(k) != -1 and g.at(k).at(j) != -1) {
                    if (g.at(i).at(j) == -1) {
                        g.at(i).at(j) = g.at(i).at(k) + g.at(k).at(j);
                    } else {
                        g.at(i).at(j) = min(g.at(i).at(j), g.at(i).at(k) + g.at(k).at(j));
                    }
                }
            }
        }
    }
    vector<vector<long long>> d(n, vector<long long>(n, -1));
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < n; ++j) {
            if (g.at(i).at(j) <= l and g.at(i).at(j) != -1) {
                d.at(i).at(j) = 1;
                d.at(j).at(i) = 1;
            }
        }
    }
    for (int k = 0; k < n; ++k) {
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < n; ++j) {
                if (d.at(i).at(k) != -1 and d.at(k).at(j) != -1) {
                    if (d.at(i).at(j) == -1) {
                        d.at(i).at(j) = d.at(i).at(k) + d.at(k).at(j);
                    } else {
                        d.at(i).at(j) = min(d.at(i).at(j), d.at(i).at(k) + d.at(k).at(j));
                    }
                }
            }
        }
    }
    for (int i = 0; i < q; ++i) {
        if (d.at(s.at(i)).at(t.at(i)) == -1) {
            cout << -1 << endl;
        } else {
            cout << d.at(s.at(i)).at(t.at(i)) - 1 << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 2688
#include<iostream>
#include<map>
#include<string>
using namespace std;

typedef pair<int,string> P;
map<P,int>ans;


int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		string str;
		int x;
		cin>>str>>x;
		ans[P(str.size(),str)]+=x;
	}
	for(map<P,int>::iterator itr=ans.begin();itr!=ans.end();itr++){
		cout<<((itr->first).second)<<" "<<(itr->second)<<endl;
	}

}

Measured memory_bytes: 1224
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
map<int,int> mp;
int n,a,ans;
int main(void){
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a;
        mp[a]++;
    }
    for(auto x:mp){
        if(x.second%2==1)ans++;
    }
    cout<<ans<<endl;
}


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

int main() {
    cin.tie(0)->sync_with_stdio(false);

	int n, x, t;
	cin >> n >> x >> t;

	int div = n / x;
	int mod = n % x;

	if (mod) cout << t * (div + 1) << '\n';
	else cout << t * div << '\n';
    return 0;
}

Measured memory_bytes: 3696
#include <stdio.h>

int main(void) {
  int N;
scanf("%d",&N);
long A[N+1];
for(int i=0;i<N+1;i++)
  scanf("%ld",&A[i]);
long B[N];
for(int i=0;i<N;i++)
  scanf("%ld",&B[i]);

long count=0;

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

printf("%ld",count);
  return 0;
}

Measured memory_bytes: 1664
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define dump(x) cout << x << endl
#define answer(x) cout << x << endl
typedef int64_t Int;

using namespace std;
using Graph = vector<vector<Int>>;

const double pi = M_PI;
const Int MOD = 1000000007;

// 二分累乗法
Int modpow(Int a, Int n, Int mod) {
    Int ret = 1;
    while (n > 0) {
        if (n & 1) {
            ret = ret * a % mod;
        }
        a = a * a % mod;
        n >>= 1;
    }

    return ret;
}

vector<Int> factorials(0), invs(0);
bool is_ncr_table = false;
void calc_ncr_table(Int n, Int mod) {
    is_ncr_table = true;

    // 1! ~ n! の計算
    Int f = 1;
    factorials.push_back(f);
    for (Int i = 1; i < n + 1; i++) {
        f *= i;
        f %= mod;
        factorials.push_back(f);
    }
    // n!^-1 の計算
    Int inv = modpow(factorials[n], mod - 2, mod);
    // (n-1)!^-1 ~ 1!^-1 の計算
    invs.assign(n, 1);
    invs[n] = inv;
    for (Int i = n; i >= 1; i--) {
        inv *= i;
        inv %= mod;
        invs[i - 1] = inv;
    }
}

Int factorial(Int n, Int mod = 1) {
    Int ret = 1;
    if (mod == 1) {
        for (Int i = 1; i < n + 1; i++) {
            ret *= i;
        }

        return ret;
    } else {
        for (Int i = 1; i < n + 1; i++) {
            ret *= i;
            ret %= mod;
        }

        return ret;
    }
}

Int ncr(Int n, Int r, Int mod, bool use_table = false) {
    if (use_table) {
        // modが素数の場合のみ
        if (!is_ncr_table) {
            calc_ncr_table(n, mod);
        }
        return factorials[n] * invs[r] * invs[n - r] % mod;
    } else {
        Int x = 1;
        for (Int i = n - r + 1; i < n + 1; i++) {
            x *= i;
            x %= MOD;
        }
        return x * modpow(factorial(r, mod), mod - 2, mod) % mod;
    }
}

int main() {
    int n;
    cin >> n;
    vector<int> p(n), q(n), fac;
    set<int> nu;
    for (int i = 0; i < n; i++) {
        cin >> p[i];
    }
    for (int i = 0; i < n; i++) {
        cin >> q[i];
    }

    int ans = 0, pn = 0, qn = 0;
    fac.push_back(1);
    for (int i = 1; i <= n; i++) {
        fac.push_back(fac[i - 1] * i);
        nu.insert(i);
    }
    reverse(fac.begin(), fac.end());

    set<int> pa(nu), qa(nu);
    for (int i = 0; i < n; i++) {
        auto itr = pa.find(p[i]);
        int index = (int)distance(pa.begin(), itr);
        pn += index * fac[i + 1];
        pa.erase(itr);
    }
    for (int i = 0; i < n; i++) {
        auto itr = qa.find(q[i]);
        int index = (int)distance(qa.begin(), itr);
        qn += index * fac[i + 1];
        qa.erase(itr);
    }

    ans = abs(qn - pn);
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repi(i, s, n) for (int i = (s); i < (n); i++)
#ifdef LOCAL
#define INPUT_FILE                   \
  ifstream in("atcoder-problems/abc132_c.txt"); \
  cin.rdbuf(in.rdbuf());
#else
#define INPUT_FILE
#endif
#define CIN_OPTIMIZE \
  cin.tie(0);        \
  ios::sync_with_stdio(false);
typedef pair<int, int> P;
typedef long long ll;
const int INF = 100100100;
const ll LINF = 1e18+100;
const int MOD = 1e9 + 7;

int main() {
  INPUT_FILE CIN_OPTIMIZE;

  int N;
  cin >> N;
  
  vector<int> c(N);
  rep(i, N) { cin >> c[i]; }
  sort(c.begin(), c.end());

  int ans = c[N / 2] - c[N / 2 - 1];

  cout << ans << endl;
}

Measured memory_bytes: 640
import math

line = input()
n, q = list(map(int, line.split()))
N = 1
while N < n:
    N *= 2
a = [2 ** 31 - 1 for _ in range(0, 2 * N - 1)]

def update(k, v):
    k += N - 1
    a[k] = v
    while k > 0:
        k = (k - 1) // 2
        a[k] = min(a[k * 2 + 1], a[k * 2 + 2])

def query(x, y, k, l, r):
    if r <= x or y <= l:
        return 2 ** 31 - 1
    elif x <= l and r <= y:
        return a[k]
    m = (l + r) // 2
    return min(query(x, y, k * 2 + 1, l, m), query(x, y, k * 2 + 2, m, r))

for _ in range(0, q):
    line = input()
    c, x, y = list(map(int, line.split()))
    if c == 0:
        update(x, y)
    elif c == 1:
        ans = query(x, y + 1, 0, 0, N)
        print(ans)


Measured memory_bytes: 8872
H,W,A,B=map(int,input().split())

L=[["0" for i in range(W)]for j in range(H)]

for i in range(H):
    for j in range(W):
        if i+1<=B and j+1>A:
            L[i][j]="1"
        elif i+1>B and j+1<=A:
            L[i][j]="1"
for i in range(H):
    print("".join(L[i]))

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

using namespace std;

#define fst(t) std::get<0>(t)
#define snd(t) std::get<1>(t)
#define thd(t) std::get<2>(t)

using ll = long long;
using P = std::tuple<int,int,int>;

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

int R, C, N;

vector<P> ps;

int index(const P& p1){
    int x1, y1;
    tie(x1, y1, ignore) = p1;

    if(y1 == 0 && 0 <= x1 && x1 < R){
        return 0;
    }else if(x1 == R && 0 <= y1 && y1 < C){
        return 1;
    }else if(y1 == C && 0 < x1 && x1 <= R){
        return 2;
    }
    return 3;
}

bool compare(const P& p1, const P& p2){
    if(index(p1) != index(p2)){
        return index(p1) < index(p2);
    }

    int idx = index(p1);
    int x1, y1, x2, y2;
    tie(x1, y1, ignore) = p1;
    tie(x2, y2, ignore) = p2;

    // std::cout << "(" << x1 << ", " << y1 << ")" << " v.s. " << "(" << x2 << ", " << y2 << ")" << std::endl;
    
    if(idx >= 2){
        x1 = -x1;
        y1 = -y1;
        x2 = -x2;
        y2 = -y2;
    }

    return x1 < x2 || y1 < y2;
}

bool boundary(int x, int y){
    return (x == 0 || x == R) || (y == 0 || y == C);
}

ll S[200200], I[200200];
const string YESNO[2] = {"NO", "YES"};

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

    std::cin >> R >> C >> N;

    for(int i=0;i<N;++i){
        int x1, y1, x2, y2;
        std::cin >> x1 >> y1 >> x2 >> y2;

        if(!boundary(x1, y1) || !boundary(x2, y2)){
            continue;
        }

        // std::cout << i << std::endl;
        
        ps.emplace_back(x1, y1, i);
        ps.emplace_back(x2, y2, i);
    }

    sort(ps.begin(), ps.end(), compare);

    // std::cout << "idx: " << index(std::make_tuple(0, 1, 0)) << std::endl;

    // for(auto& p : ps){
    //     int x, y, i;
    //     tie(x, y, i) = p;
    //     std::cout << x << ", " << y << ", " << i << std::endl;
    // }

    memset(I, -1, sizeof(I));
    
    int M = ps.size();
    for(int i=0;i<M;++i){
        int idx;
        tie(ignore, ignore, idx) = ps[i];

        if(I[idx] == -1){
            S[i] = +1;
        }else{
            S[i] = -1;
        }
        I[idx] = i;
    }

    for(int i=0;i+1<M;++i){
        S[i+1] += S[i];
    }

    bool flag = true;
    for(int i=0;i<M;++i){
        int idx;
        tie(ignore, ignore, idx) = ps[i];

        if(I[idx] == i){continue;}

        int s = S[I[idx]-1] - S[i];
        if(s > 0){
            flag = false;
            break;
        }
    }

    std::cout << YESNO[flag] << std::endl;
}


Measured memory_bytes: 6384
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cmath>
#include<vector>
#include<string>
#include<algorithm>
#include<queue>
#include<set>
#include<map>
#include<limits>
#include<stack>
#include<array>
#include<stdio.h>
#include<cstring>

using namespace std;

typedef unsigned long long ll;
typedef pair<int,int> ii;
typedef vector<pair<int,int> > vii;
typedef vector<vii> vvii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<string> vs;

int INF = 1000000009; //std::numeric_limits<int>::max();
ll LLINF = 1e15;
int NINF = std::numeric_limits<int>::min();
int MOD = 1e9+7;

int col[] = {1,0,-1,0,1,1,-1,-1};
int row[] = {0,1,0,-1,1,-1,1,-1};

//knight moves
int cc[] = {1,2,2,1,-1,-1,-2,-2};
int rr[] = {-2,-1,1,2,-2,2,1,-1};


int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    //ios::sync_with_stdio(0);
    //cin.tie(0);

    int n;
    cin >> n;

    vll cumsum(n+1,0);
    vll slimes(n+1);

    cumsum[0] = 0;

    for(int i = 1 ; i <= n ; ++i)
        {
            cin >> slimes[i];
            cumsum[i] = cumsum[i-1]+slimes[i];
        }

    vvll dp(401,vll(401,0));

    for(int j = 2; j <= n ; ++j)
    {
        for(int i = 1; i <= n-j+1 ; ++i)
        {
            int clmn = i+j-1;

            ll rangeDiff = cumsum[clmn]-cumsum[i-1];

            dp[i][clmn] = 1e18;
            for(int k = i ; k < clmn; ++k)
            dp[i][clmn] = min(dp[i][clmn], rangeDiff + dp[i][k] + dp[k+1][clmn]);
        }
    }

    /*for(int i = 0 ; i <n ; ++i)
    {
        for(int j = 0 ; j < n ; ++j)
            cout << dp[i][j] << "   ";
        cout << endl;
    }*/


    cout << dp[1][n];

    return 0;
}


Measured memory_bytes: 4892
import java.util.Scanner;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    int d = sc.nextInt();
    int time = 0;
    int x = 0;
    int y = 0;
    x = Math.max(a,c);
    y = Math.min(b,d);
    if(y-x<0){
      System.out.println(0);
    }else{
      System.out.println(y-x);
    }
  }
}

Measured memory_bytes: 23764
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <stack>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
using namespace std;
#define int long long
#define endl '\n'
typedef long long ll;

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int n,m;
	cin >> n >> m;
	if(n > m) swap(n,m);
	if(n == 1) {
		if(m == 1) cout << 1;
		else if(m == 2) cout << 0;
		else {
			cout << m-2;
		}
		return 0;
	}
	cout << (n-2) * (m-2) << endl;
}


Measured memory_bytes: 3612
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pli = pair<ll, int>;
template <typename T>
using Graph = vector<vector<T>>;
const int MOD = 1e9 + 7;

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

    ll a, b, c;
    cin >> a >> b >> c;

    bool isok = true;
    if (c < a + b)
        isok = false;
    if (isok)
        isok = (4 * a * b < (c - a - b) * (c - a - b));
        
    cout << (isok ? "Yes" : "No") << endl;
    return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import static java.lang.Integer.parseInt;

public class Main {

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

  public void run() {

    try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

      int n,a,b,sumA,sumB;
      // String[] lines;
      String line;
      StringBuilder buf = new StringBuilder();
      while (true) {
        n = parseInt(br.readLine());
        if( n == 0 ) break;

        sumA = sumB = 0;
        for(int i=0; i<n; i++) {
          // lines = br.readLine().split(" ");
          // a = parseInt(lines[0]);
          // b = parseInt(lines[1]);
          line = br.readLine();
          a = Character.getNumericValue(line.charAt(0));
          b = Character.getNumericValue(line.charAt(2));
          if(a > b)
            sumA += (a+b);
          else if(b > a)
            sumB += (a+b);
          else
            { sumA += a; sumB += b; }
        }
        buf.append(sumA).append(" ").append(sumB).append("\n");
      }
      System.out.print(buf);
    }
    catch (IOException e) {
      System.err.println(e);
    }
  }
}


Measured memory_bytes: 26848
#include<bits/stdc++.h>
using namespace std;
inline int read(){
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=(x<<3)+(x<<1)+ch-'0';ch=getchar();}
	return x*f;
}
#define MN 200005
#define lowbit(x) (x&(-x))
int n,m,a[MN],num[MN],x,y,ans,no[MN],mip[MN];
int main(){
	n=read(),m=read();
	for(int i=1;i<=n;i++) a[i]=read(),num[a[i]]++;
	for(int i=1;i<=n;i++){
		mip[i+1]--;
		if(i+1-num[i]<1){
			mip[1]+=1+num[i]-i;
			mip[2]-=num[i]-i;
			continue;
		}
		mip[i+1-num[i]]++;
	}
	for(int i=1;i<=n;i++){
		no[i]=no[i-1]+mip[i];
		if(no[i]==0) ans++;
	}
	while(m--){
		x=read(),y=read();
		if(a[x]==y){printf("%d\n",ans);continue;}
		if(!no[max(y-num[y],1)]) ans--;
		no[max(y-num[y],1)]++;
		no[max(a[x]+1-num[a[x]],1)]--;
		if(!no[max(a[x]+1-num[a[x]],1)]) ans++;
		num[a[x]]--,num[y]++;a[x]=y;
		printf("%d\n",ans);
	}
	return 0;
}

Measured memory_bytes: 4480
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.h"
#else
#define dump(...)
#endif
#define endl "\n"
#define ll long long
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define REP(i, x) for (int i = 0; i < (int)(x); i++)
#define REPS(i, x) for (int i = 1; i <= (int)(x); i++)
#define RREP(i, x) for (int i = ((int)(x)-1); i >= 0; i--)
#define RREPS(i, x) for (int i = ((int)(x)); i > 0; i--)
#define INF 2147483647
#define LLINF 9223372036854775807LL
#define vi vector<int>
#define vvi vector<vector<int>>
#define pi pair<int, int>
#define ALL(a) (a).begin(), (a).end()
#define BIT(n) (1LL << (n))
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end()) //sortしてからつかうこと
constexpr ll MOD = 1e9 + 7;
int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};
ll A, B, C, D, E, F, G, H, N, M, L, K, P, Q, R, W, X, Y, Z;
string S, T;
ll ans = 0;

template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
    for (T &x : vec)
        is >> x;
    return is;
}

signed main() {
    cin >> A >> B;
    if (A > 9 || B > 9)
        cout << -1 << endl;
    else
        cout << A * B << endl;
}


Measured memory_bytes: 3600
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <queue>
#include <set>
#include <numeric>
#include <cmath>

using namespace std;

typedef long long int ll;

#define all(x) x.begin(),x.end()

const ll mod = 1e9+7;
const ll INF = 1e9;
const ll MAXN = 1e9;

ll n,f[100][10],p[100][11];

int main()
{
	cin >> n;
	for(int i = 0; i < n; i++){
		for(int j = 0; j < 10; j++){
			cin >> f[i][j];
		}
	}
	for(int i = 0; i < n; i++){
		for(int j = 0; j < 11; j++){
			cin >> p[i][j];
		}
	}

	ll ans = -(1<<30);

	for(int bit = 1; bit < (1<<10); bit++){
		ll x = 0;
		for(int i = 0; i < n; i++){
			int cnt = 0;
			for(int j = 0; j < 10; j++){
				if((bit>>j&1) && f[i][j]) cnt++;
			}
			x += p[i][cnt];
		}
		if(ans<x) ans = x;
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
using namespace std;

int main()
{
    string s;
    cin >> s;
    int n = s.size();
    cout << s[0] << (n - 2) << s[n-1] << endl;

    return 0;
}


Measured memory_bytes: 256
a,b,c,d,e,f = map(int,input().split())

n = 30

noudo = -1
all_s = 0
sato_s = 0

r_flag = False

for i in range(1,(f+99)//100):
    for j in range(30+1):
        if r_flag == True:
            break
        for k in range(30+1):
            if i == j*a+k*b:
                r_flag = True
                break
    if r_flag == False:
        continue
    for j in range(int((i*e)/c)+1):
        e_sato = min(f - i*100-j*c, i*e-j*c)
        d_num = e_sato // d
        tmp_sato = j*c+d_num*d
        tmp_all = tmp_sato + i*100
        tmp_noudo = (100*(tmp_sato)) / tmp_all
        #print(tmp_sato)
        if tmp_all > f:
            continue
        if noudo < tmp_noudo:
            noudo = tmp_noudo
            all_s = tmp_all
            sato_s = tmp_sato
            #print(e_sato,sato_s)
    r_flag = False


print(all_s,sato_s)


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
int main(void)
{
    int n;
    scanf("%d",&n);
    long long arr[n+1];
    for(int i=1;i<=n;i++)
        scanf("%lld",arr+i);
    long long sum[n+1];
    sum[0]=0;
    for(int i=1;i<=n;i++)
        sum[i]=sum[i-1]+arr[i];
    sort(sum,sum+n+1);
    long long last=sum[0];
    long long ans=0;
    long long cnt=1;
    for(int i=1;i<=n;i++)
    {
        if(sum[i]==last)
            cnt++;
        else
        {
            ans+=((cnt)*(cnt-1))/2;
            last=sum[i];
            cnt=1;
        }
    }
    ans+=((cnt)*(cnt-1))/2;
    printf("%lld\n",ans);
    return 0;
}


Measured memory_bytes: 3328
#include<cstdio>
#include<cstring>
#include<cmath>
#include<vector>
using namespace std;
int N,D,c,P[100],d;
int main()
{
	for(;scanf("%d%d",&N,&D),N;)
	{
		vector<int> M[100];
		memset(P,0,sizeof(P));
		for(int i=c=d=0;i<N;i++)
		{
			int m,t;
			scanf("%d",&m);
			c+=m;
			for(int j=0;j<m;j++)
			{
				scanf("%d",&t);
				P[i]+=t;
				M[i].push_back(t);
			}
		}
		int i,f=1;
		for(i=0;i<c&&f;i++)
			for(int j=f=0;j<N;j++)
			{
				if(P[j]!=0)
				{
					int k;
					for(k=0;k<N;k++)
						if(k!=j&&abs(P[j]-M[j][M[j].size()-1]-P[k])>D)break;
					if(k==N)
					{
						P[j]-=M[j][M[j].size()-1];
						M[j].pop_back();
						f=1;
						break;
					}

				}
			}
		puts(i==c?"Yes":"No");
	}
}

Measured memory_bytes: 1084
n = int(raw_input())
while n != 0:
	a = [map(int,raw_input().split()) for i in xrange(n)]
	a = [l + [sum(l)] for l in a]
	a.append([sum([l[i] for l in a]) for i in xrange(len(a[0]))])
	print '\n'.join([''.join([str(i).rjust(5) for i in l]) for l in a])
	n = int(raw_input())

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

#define  ll long long
#define  il inline
#define INF 0x3f3f3f3f
#define pii pair<int,int>
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
#define dep(i,a,b) for(int i=(a);i>=(b);--i)

const int mod = 1e9 + 7;
const int maxn = 1e6 + 5;
const int maxm = 2e5 + 10;
const double PI = acos(-1.0);

int n,m;
string s,t;

int main()
{
    ios::sync_with_stdio(false);cin.tie(0);
   	cin >> s >> t;
   	int ans = 0;
   	rep(i,0,2) if(s[i] == t[i]) ans++;
   	cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1000000000000000000
#define MOD 1000000007
typedef pair<int, int> P;

bool prime(int n) {
	for (int i = 2; i <= sqrt(n); i++) {
		if (n % i == 0)return false;
	}
	return n != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x / gcd(x, y) * y;
}
int mod_pow(int n, int p, int m) {
	if (p == 0) return 1;
	if (p % 2 == 0) {
		int t = mod_pow(n, p / 2, m);
		return (t * t) % m;
	}
	return n * mod_pow(n, p - 1, m) % m;
}
int extGCD(int a, int b, int& x, int& y) {
	if (b == 0) {
		x = 1;
		y = 0;
		return a;
	}
	long long d = extGCD(b, a % b, y, x);
	y -= a / b * x;
	return d;
}
int modinv(int a, int m) {
	int b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}
int digit(int x) {
	int cnt = 0;
	while (x > 0) {
		cnt += x % 10;
		x /= 10;
	}
	return cnt;
}

bool dp[85][85][25605];

signed main() {
	int h, w;
	int ans = INF;
	cin >> h >> w;
	int a[82][82], b[82][82];
	rep(y, h) {
		rep(x, w) {
			cin >> a[y][x];
		}
	}
	rep(y, h) {
		rep(x, w) {
			cin >> b[y][x];
		}
	}
	int z = 12800;
	rep(y, h) {
		rep(x, w) {
			if (x == 0 && y == 0) {
				dp[0][0][z - (a[0][0] - b[0][0])] = true;
				dp[0][0][z + (a[0][0] - b[0][0])] = true;
				/*for (int i = z - 10; i < z + 10; i++) {
					cout << dp[0][0][i] << " ";
				}
				cout << endl;*/
				continue;
			}
			rep(i, 25601) {
				if (y != 0) {
					if (i - abs(a[y][x] - b[y][x]) >= 0) {
						if (dp[y - 1][x][i - abs(a[y][x] - b[y][x])]) {
							dp[y][x][i] = true;
						}
					}
					if (i + abs(a[y][x] - b[y][x]) <= 25600) {
						if (dp[y - 1][x][i + abs(a[y][x] - b[y][x])]) {
							dp[y][x][i] = true;
						}
					}
				}
				if (x != 0) {
					if (i - abs(a[y][x] - b[y][x]) >= 0) {
						if (dp[y][x - 1][i - abs(a[y][x] - b[y][x])]) {
							dp[y][x][i] = true;
						}
					}
					if (i + abs(a[y][x] - b[y][x]) <= 25600) {
						if (dp[y][x - 1][i + abs(a[y][x] - b[y][x])]) {
							dp[y][x][i] = true;
						}
					}
				}
			}
		}
	}
	rep(i, 25601) {
		if (dp[h-1][w-1][i]) {
			ans = min(ans, abs(z - i));
		}
	}
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 169088
#include <stdio.h>

int main()
{
    int N,i;
    double sum;
    scanf("%d",&N);
    int A[N];
    for(i=0;i<N;i++){
        scanf("%d",&A[i]);
    }
    for(i=0;i<N;i++){
    sum = sum + 1.0/A[i];
    }
    printf("%lf",(1/sum));
    return 0;
}


Measured memory_bytes: 128
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

//		long ans2 = 0;
//		long ans = 0;
//		int ans = 0;
		String ans = "";

		Scanner sc = new Scanner(System.in);


		int n = sc.nextInt();
//		int k = sc.nextInt();
//		int k = sc.nextInt();
		String s = sc.next();
		String t = sc.next();

//		String string = sc.next();
//		StringBuilder s = new StringBuilder(string);

		boolean f = false;

//

//		int[] b = new int[n];
//		int[][] aa = new int[h][w];
//		int[] bb = new int[n];
//		for (int i = 0; i < h; i++) {
//			for(int j = 0; j < w; j++) {
//				a[i][j] = sc.nextInt();
//			}
//		}
//		for (int i = 0; i < n; i++) {
//			b[i] = sc.nextInt();
//			bb[i] = b[i];
//		}

		for(int i=0; i < n; i++) {
			ans = ans + s.charAt(i);
			ans = ans + t.charAt(i);
		}


		System.out.println(ans);

		sc.close();
	}
}

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

int main() {
  string S;
  cin >> S;
  if (S == "SUN"){
    cout <<'7';
  }
  else if (S == "MON"){
    cout <<'6';
  }
  else if (S == "TUE"){
    cout <<'5';
  }
  else if (S == "WED"){
    cout <<'4';
  }
  else if (S == "THU"){
    cout <<'3';
  }
  else if (S == "FRI"){
    cout <<'2';
  }
  else{
    cout <<'1';
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <cstring>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <bitset>
#define ll long long
#define LINF 0x3f3f3f3f3f3f3f3f
#define INF 0x3f3f3f3f
using namespace std;
const int MAX = 2e5 + 10;
const int MOD = 1e9 + 7;
int N, M, K, Q;
pair<int, int> boxes[MAX];
vector<pair<int, int>> vt;
int check[MAX];
int visited[MAX];
int n;

void add(int idx) {
	if (++check[idx] == 1) ++n;
}

int main()
{
	int i, j, k;
	scanf("%d", &N);
	for (i = 0; i < N; ++i) {
		scanf("%d%d", &boxes[i].first, &boxes[i].second);
		vt.push_back({ boxes[i].first, i });
		vt.push_back({ boxes[i].second, i });
	}
	sort(vt.begin(), vt.end());

	n = 0;
	memset(check, 0, sizeof(check));

	int f, l;
	int sz = vt.size();
	for (i = sz - 1; i >= 0; --i) {
		int idx = vt[i].second;
		if (!visited[idx]) visited[idx] = i;
	}

	for (i = 0; i < sz; ++i) {
		add(vt[i].second);
		if (n == N) {
			f = i;
			break;
		}
	}
	n = 0;
	memset(check, 0, sizeof(check));
	for (i = sz - 1; i >= 0; --i) {
		add(vt[i].second);
		if (n == N) {
			l = i;
			break;
		}
	}

	ll ans = (ll)(vt[sz - 1].first - vt[l].first)*(vt[f].first - vt[0].first);
	
	f = max(f, visited[vt[0].second]);
	for (i = 1; i <= l; ++i) {
		if (f == sz - 1) break;
		ans = min(ans, (ll)(vt[sz - 1].first - vt[0].first)*(vt[f].first - vt[i].first));
		f = max(f, visited[vt[i].second]);
	}
	printf("%lld", ans);
}

Measured memory_bytes: 7532
/*************************************************************************
	> File Name: 1.cpp
	> Author: Knowledge_llz
	> Mail: 925538513@qq.com 
	> Blog: https://blog.csdn.net/Pig_cfbsl 
	> Created Time: 2020/5/17 19:59:47
 ************************************************************************/

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<algorithm>
#define For(i,a,b) for(register int i=(a);i<=(b);++i)
#define LL long long
using namespace std;
int read(){
	char x=getchar(); int u=0,fg=0;
	while(!isdigit(x)){ if(x=='-') fg=1; x=getchar(); }
	while(isdigit(x)){ u=(u<<3)+(u<<1)+(x^48); x=getchar(); }
	return fg?-u:u;
}
char s[10000];
int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.in", "r", stdin);
	freopen("output.out", "w", stdout);
#endif
	int n=read();
	scanf("%s",s);
	if(strlen(s)<=n){
		cout<<s;
		return 0;
	}
	For(i,n,n+2) s[i]='.';
	s[n+3]='\0';
	cout<<s;
	return 0;
}


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

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

    vector<vector<char>> grid(100, vector<char>(100, '.'));
    for (int i = 50; i < 100; i++)
    {
        grid.at(i) = vector<char>(100, '#');
    }
    a--;
    b--;

    int i = 0, j = 0;
    while (b > 0)
    {
        grid.at(i).at(j) = '#';
        b--;
        j += 2;
        if (j > 99)
        {
            i += 2;
            j = 0;
        }
    }

    i = 99;
    j = 0;
    while (a > 0)
    {
        grid.at(i).at(j) = '.';
        a--;
        j += 2;
        if (j > 99)
        {
            i -= 2;
            j = 0;
        }
    }

    cout << 100 << " " << 100 << endl;
    for (int i = 0; i < 100; i++)
    {
        for (int j = 0; j < 100; j++)
        {
            cout << grid.at(i).at(j);
        }
        cout << endl;
    }
}

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

int arr[150];
int main()
{
    int n;
    cin>>n;
    for(int i = 0 ; i<n ; ++i)
    {
        cin>>arr[i];
    }
    int ans = 1e9;
    for(int i = -100 ; i<=100 ;++i)
    {
        int sum = 0;
        for(int j = 0 ; j<n  ;++j)
        {
            sum += (arr[j] - i)*(arr[j] - i);
        }
        ans = min(ans , sum);
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,o,n) for(long long i = o;i<n;i++)
#define oneforall ios::sync_with_stdio(false);cin.tie(0);
#define all(v) (v).begin(),(v).end()
#define ini(...) int __VA_ARGS__; in(__VA_ARGS__)
#define inl(...) long long __VA_ARGS__; in(__VA_ARGS__)
#define ins(...) string __VA_ARGS__; in(__VA_ARGS__)
#define int long long 
const long long INF=1e18;
void in(){} template <typename T,class... U> void in(T &t,U &...u){ cin >> t; in(u...);}
void out(){cout << "\n";} template <typename T,class... U> void out(const T &t,const U &...u){ cout << t; if(sizeof...(u)) cout << " "; out(u...);}
typedef vector<int> vi;
typedef vector<long long> vl;
typedef long long ll;
typedef vector<pair<long, long > > vpll;
typedef vector<pair<int, int > > vpii;



int32_t main() {
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	
	
	ini(n);
	vi morty(n);
	FOR(i,0,n){
		in(morty[i]);
	}
	vi rick(n);
	vi rick1(n);
	FOR(i,0,n){
		rick[morty[i]-1] = 30000*(morty[i]);
		rick1[morty[i]-1] = 30000*(n-morty[i])+i+1;
	}
	FOR(i,0,n){
		cout<<rick[i]<<" ";
	}
	out();
	FOR(i,0,n){
		cout<<rick1[i]<<" ";
	}














	return 0;
}


Measured memory_bytes: 1152
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>
using namespace std;
using ll = long long;

int main(int argc, const char * argv[]) {
    string o, e;
    cin >> o >> e;
    int oc = 0, ec = 0;
    for (int i = 0; i < o.length() + e.length(); i++) {
        if (i % 2 == 0) {
            cout << o[oc];
            oc++;
        }else{
            cout << e[ec];
            ec++;
        }
    }
    cout << endl;
    return 0;
}


Measured memory_bytes: 256
/*
PROG: arc084c
LANG: C++
    _____
  .'     '.
 /  0   0  \
|     ^     |
|  \     /  |
 \  '---'  /
  '._____.'
*/
#include <bits/stdc++.h>
 
using namespace std;
 
long long readi()
{
	long long input = 0;
	char c = ' ';
	while (c < '-')
	{
		c = getchar();
	}
	bool negative = false;
	if (c == '-')
	{
		negative = true;
		c = getchar();
	}
	while (c >= '0')
	{
		input = 10 * input + (c - '0');
		c = getchar();
	}
	if (negative)
	{
		input = -input;
	}
	return input;
}
void printi(long long output)
{
	if (output == 0)
	{
		putchar('0');
		return;
	}
	if (output < 0)
	{
		putchar('-');
		output = -output;
	}
	int aout[20];
	int ilen = 0;
	while(output)
	{
		aout[ilen] = ((output % 10));
		output /= 10;
		ilen++;
	}
	for (int i = ilen - 1; i >= 0; i--)
	{
		putchar(aout[i] + '0');
	}
	return;
}
string reads()
{
	string input = "";
	char c = ' ';
	while (c <= ' ')
	{
		c = getchar();
	}
	while (c > ' ')
	{
		input += c;
		c = getchar();
	}
	return input;
}
void prints(string output)
{
	for (int i = 0; i < output.length(); i++)
	{
		putchar(output[i]);
	}
	return;
}

#define MP make_pair
#define PB push_back
#define PF push_front
#define MT make_tuple
#define LB lower_bound
#define UB upper_bound

#define SINF 10007
#define MOD 1000000007
#define INF 1000000861
#define LLINF 1000000000000000861ll
#define CO 1000861
#define EPS 0.000000000000001
#define PI 3.141592653589793

typedef int64_t ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

int N, K;
vector<int> ans;

void take()
{
	if (ans.back() == 1)
	{
		ans.pop_back();
		return;
	}
	ans.back()--;
	while(ans.size() < K)
	{
		ans.PB(N);
	}
}

int32_t main()
{
	ios_base::sync_with_stdio(false);
	srand(time(NULL));
//	cout << fixed << setprecision(10);	
//	cerr << fixed << setprecision(10);
//	if (fopen("arc084c.in", "r"))
//	{	
//		freopen ("arc084c.in", "r", stdin);
//		freopen ("arc084c.out", "w", stdout);
//	}
	cin >> N >> K;
	//nums from 1 to N, sizes from 1 to K
	if (N % 2 == 0)
	{
		cout << (N/2);
		for (int i = 1; i < K; i++)
		{
			cout << ' ' << N;
		}
		cout << '\n';
		return 0;
	}
	for (int i = 0; i < K; i++)
	{
		ans.PB((N + 1)/2);
	}
	for (int i = 0; i < K/2; i++)
	{
		take();
	}
	cout << ans[0];
	for (int i = 1; i < ans.size(); i++)
	{
		cout << ' ' << ans[i];
	}
	cout << '\n';
	return 0;
}


Measured memory_bytes: 3568
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int maxn=2e5+10;
char t[maxn];
int dp[maxn],L[maxn];
stack<int>P;
ll ans;
void work()
{
    int cnt=0;
    while(!P.empty())
    {
        int v=P.top();
        P.pop();
        if(v==1)
            ans+=cnt;
        else
            cnt++;
    }
}
int main()
{
    scanf("%s",t+1);
    int len=strlen(t+1);
    for(int i=1;i<=len;i++)
    {
        if(t[i]=='A')
            P.push(1);
        else if(t[i]=='B'&&t[i+1]=='C')
        {
            P.push(2);
            i++;
        }
        else if(t[i]=='B')
        {
            work();
        }
        else
            work();
    }
    work();
    printf("%lld\n",ans);
    return 0;
}


Measured memory_bytes: 1280
#include <iostream>
#include <vector>
#include <cmath>

#define FOR(i,a,b) for(int i=(a);i<(b);++i)

using namespace std;
typedef long long ll;

int main(){
    int N,K;
    cin>>N>>K;
    double A[N+1];

    for(int i=1;i<=N;++i){
        cin>>A[i];
    }
    
    for(int i=K+1;i<=N;++i){
        if(A[i]>A[i-K]){
            cout<<"Yes"<<endl;
        }else{
            cout<<"No"<<endl;
        }
    }
    
    
   
}


Measured memory_bytes: 5272
#include<bits/stdc++.h>
using namespace std;
long long a,b,x;
inline long long f(long long n) {
	if(-1==n){
		return 0;
	}else{
		return n/x+1;
	}
	
}
int main(){
	cin>>a>>b>>x;
	cout<<f(b)-f(a-1)<<endl;
	return 0;
}


Measured memory_bytes: 256
import sys
N = int(sys.stdin.readline())
S = sys.stdin.readline()
Q = int(sys.stdin.readline())
K = list(map(int, sys.stdin.readline().split()))
for i in range(Q):
    k = K[i]
    D = 0
    M = 0
    DM = 0
    num = 0
    for j in range(N):
        if S[j] == 'D':
            D += 1
        elif S[j] == 'M':
            DM += D
            M += 1
        elif S[j] == 'C':
            num += DM
        if j >= k - 1:
            if S[j - k + 1] == 'D':
                D -= 1
                DM -= M
            elif S[j - k + 1] == 'M':
                M -= 1
    print(num)

Measured memory_bytes: 55644
/*#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>

#include <boost/rational.hpp>
*/
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
using ll = long long;
using ld = long double;
#define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++)
#define rep3(i, n) for (ll i = 1; i < (ll)(n+1); i++)
#define rep4(i, s, n) for (ll i = (s); i < (ll)(n+1); i++)
#define repr(i,n) for (ll i = (n-1); i>=0;i--)
#define repr3(i,n) for(ll i = (n);i>0;i--)
#define repr4(i,s,n) for(ll i = (n);i>=(s);i--)
#define stlen(s) ll s.size()-1
#define all(v) v.begin(), v.end()
#define cout(n) cout<<std::fixed<<std::setprecision(n)
using Graph = vector<vector<int>>;
using Graphw = vector<vector<pair<ll,ll>>>;
#define INF1  INT_MAX;
#define INF2  LLONG_MAX;
#define PI  3.14159265358979323846;
#define MOD 1000000007;
/*
namespace mp = boost::multiprecision;
// 任意長整数型
using Bint = mp::cpp_int;
// 仮数部長が32の浮動小数点数型
using Real32 = mp::number<mp::cpp_dec_float<32>>;
// 仮数部長が1024の浮動小数点数型
using Real1024 = mp::number<mp::cpp_dec_float<1024>>;
// 有理数型
using Rat = boost::rational<Bint>;
*/


int main(){
int N,M;
cin>>N>>M;
vector<int> list;
map<int,int> map;
rep(i,M){
    int a,b;
    cin>>a>>b;
    if(map[a]==0){
        list.push_back(a);
    }
    map[a]++;
    if(map[b]==0){
        list.push_back(b);
    }
    map[b]++;
}
bool judge=true;
rep(i,list.size()){
    if(map[list[i]]%2==1)judge=false;
}
if(judge){
    cout<<"YES"<<endl;
}
else{
    cout<<"NO"<<endl;
}

return 0;
}

Measured memory_bytes: 7700
//file_name:ABC73_A.cpp
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define dame { puts("-1"); return 0;}
#define yn {puts("Yes");}else{puts("No");}
const int MX = 200005;

    // int scan
    /*
    int x;
    scanf("%d",&x);
    int y;
    scanf("%d",&y);
    int z;
    scanf("%d",&z);

    // matrix scan
    /*
    ll a[n] = {};
    rep(i,n){
        scanf("%lld",&a[i]);
    }
    */

    // string scan
    /*
    string s;
    cin >> s;
    */


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

    if(n%10==9||(n/10)%10==9)yn;

    return 0;
}



Measured memory_bytes: 256