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

using namespace std;

struct Dsu {
  vector<int> p;
  Dsu(int _n) : p(_n, -1) {}
  int find(int x) { return p[x] < 0 ? x : p[x] = find(p[x]); }
  bool merge(int u, int v) {
    u = find(u);
    v = find(v);
    if (u == v) return false;
    if (-p[u] > -p[v])
      swap(u, v);
    p[v] += p[u];
    p[u] = v;
    return true;
  }
};

int main() {
  int n;
  scanf("%d", &n);
  vector<tuple<int, int, int>> vp;
  for (int i = 0; i < n; ++i) {
    int x, y;
    scanf("%d %d", &x, &y);
    --x, --y;
    vp.emplace_back(y, x, i);
  }
  sort(vp.begin(), vp.end());
  Dsu dsu(n);
  stack<pair<int, int>> st;
  for (auto it : vp) {
    int x, y, id;
    tie(y, x, id) = it;
    int lef = x;
    while (!st.empty() && st.top().first <= x) {
      lef = min(lef, st.top().first);
      dsu.merge(id, st.top().second);
      st.pop();
    }
    st.push({lef, id});
  }
  for (int i = 0; i < n; ++i)
    printf("%d\n", -dsu.p[dsu.find(i)]);
  return 0;
}


Measured memory_bytes: 6436
#include<iostream>
#include<stack>
#include<cstdio>
#include<vector>

using namespace std;

int main(){
    int num_stack,num_query;
    int command,stack_id,val;
    
    scanf("%d %d",&num_stack,&num_query);
    stack<int> stack_array[num_stack];
    for(int i = 0; i < num_query;i++){
        scanf("%d %d",&command,&stack_id);
        if(command == 0){
            scanf("%d",&val);
            stack_array[stack_id].push(val);
        }else if(command == 1){
            if(!stack_array[stack_id].empty()) printf("%d\n",stack_array[stack_id].top());
        }else{
            if(!stack_array[stack_id].empty()) stack_array[stack_id].pop();
        }
    }
    
    
    
    return 0;
}



Measured memory_bytes: 4304
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

long check_P(int *m, long n, long P,long k0) {
  long k,i,t;
  t = 0;k = 1;
  for(i = 0; i < n; i++) {
    if(t+m[i] > P) {
      k++;
      t = 0;
      if(k > k0) return 1;
    }
    t+= m[i];
  }
  return 0;
}

long middle(long a, long b) {
  if(b-a == 2) return a+1;
  return (b-a-1)/2+a;
}

int main() {
  long n,k,i,max,P,d;
  int *m;
  scanf("%ld %ld", &n, &k);
  m = (int*)malloc(sizeof(int)*n);
  max = 0;			   
  for(i = 0; i < n; i++) {
    scanf("%d", m+i);
    if(max < m[i]) max = m[i];
  }

  d = max;
  if(n/k > max) d = n/k;
  P = d;
  while(check_P(m,n,P,k) != 0) P+=d;
  
  if(P == d){
    printf("%ld\n", P);
  }else{
    long a = P-d,b = P;
    while(b-a > 1) {
      if(check_P(m,n,middle(a,b),k) == 0) {
	b = middle(a,b);
      }else{
	a = middle(a,b);
      }
    }
    printf("%ld\n",b);
  }
  
  return 0;
}

Measured memory_bytes: 988
# 破壊的なのでなおしたい
def grouping(lst):
  if len(lst)==0:
    return [([],[],[],[])]
  else:
    elm = lst.pop()
    ans = []
    bf = grouping(lst)
    for i in range(4):
      for t in bf:
        ans.append(tuple(g + [elm] if idx==i else g for idx, g in enumerate(t)))
    return ans

n, a, b, c = map(int, input().split(" "))
reqs = (a, b, c)
ls = [int(input()) for _ in range(n)]
gr = filter(lambda x: len(x[0])!=0 and len(x[1])!=0 and len(x[2])!=0, grouping(ls))
print(min(sum(10*(len(es)-1) + abs(sum(es)-r)for es, r in zip(t, reqs))for t in gr))


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

int main() {
    int a[6],i;
    for(i = 0;i < 6;i++){
        cin >> a[i];
    }
    sort(a,a + 4);
    cout << (a[5] > a[4] ? a[5] : a[4]) + a[3] + a[2] + a[1] << endl;

}


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

// 累積和
struct cumulative_sum {
    using lint = long long int;
    int sz;
    // data[i]:元の数列
    vector<lint> data;
    // cum[i]:[0,i)の和
    vector<lint> sum;
    // 要素数を指定して初期化
    cumulative_sum(const int _sz) : sz(_sz) {
        data.assign(sz, 0);
        sum.assign(sz + 1, 0);
    }
    lint& operator[](const int k) {
        return data[k];
    }
    // dataに基づいてsumを構築
    void build() {
        for (int i = 0; i < sz; i++) sum[i + 1] = sum[i] + data[i];
    }
    // [a,b)の和を求める
    lint query(const int a, const int b) {
        return sum[b] - sum[a];
    }
};

lint n, m;
vector<lint> a;

//幸福度k以上の握手が何個あるか
lint count(lint k) {
    lint res = 0;
    for (int i = 0; i < n; i++) {
        res += a.end() - lower_bound(a.begin(), a.end(), k - a[i]);
    }
    return res;
}

bool check(lint k) {
    return count(k) < m;
}

// めぐる式二分探索
long long meguru_BinarySearch(long long ok, long long no,
                              function<bool(long long)> isValid) {
    while (abs(ok - no) > 1) {
        long long mid = (ok + no) / 2;
        (isValid(mid) ? ok : no) = mid;
    }
    return ok;
}

int main() {
    cin >> n >> m;
    a.resize(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    sort(a.begin(), a.end());
    lint ok = meguru_BinarySearch(1e+6, 0, check);
    lint ans = 0;
    ans += (ok - 1) * (m - count(ok));
    cumulative_sum cum(n);
    for (int i = 0; i < n; i++) {
        cum[i] = a[i];
    }
    cum.build();
    for (int i = 0; i < n; i++) {
        int b = lower_bound(a.begin(), a.end(), ok - a[i]) - a.begin();
        ans += a[i] * (n - b) + cum.query(b, n);
    }
    cout << ans << endl;
}

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

using namespace std;


struct SegTree
{
    public:
        int n;
        const int MAX = 100000;

        vector<int> tree;

        SegTree(int n)
        {
            tree = vector<int>(MAX * 4, 0);

            SegTree::n = 1;
            while (SegTree::n < n)
                SegTree::n *= 2;
        }

        void update(int i, int x)
        {
            i += (n - 1);
            tree[i] += x;
            while (i > 0) {
                i = (i - 1) / 2;
                tree[i] += x;
            }
        }

        int find(int s, int t)
        {
            return find_sub(s, t, 0, 0, n);
        }

    private:

        int find_sub(int s, int t, int k, int l, int r)
        {
            if (r <= s || t <= l)
                return 0;

            if (s <= l && r <= t)
                return tree[k];

            int u, v;
            u = find_sub(s, t, k * 2 + 1, l, (l + r) / 2);
            v = find_sub(s, t, k * 2 + 2, (l + r) / 2, r);
            return u + v;
        }
};


int main()
{
    int n, q;
    cin >> n >> q;
    SegTree st(n);

    for (int i = 0; i < q; i++) {
        int com, x, y;
        cin >> com >> x >> y;
        if (com == 0) {
            st.update(x - 1, y);
        } else {
            int ret = st.find(x - 1, y);
            cout << ret << endl;
        }
    }

    return 0;
}



Measured memory_bytes: 6020
#include<iostream>
#include <map>
#include <algorithm>
#include <vector>
#include <iterator>
#include <queue>
#define int long long
#define INF 1e18
#define F first
#define S second
using namespace std;
typedef pair<int, int> P;
typedef vector<P>::iterator vpi;
signed main() {
	int n, d, ans = 0, sum[31] = {}, sum2[31] = {};
	int x[31], y[31];
	vector<P> d1, d2, v[16];
	cin >> n >> d;
	for (int i = 1; i <= n; i++) {
		cin >> x[i] >> y[i];
		sum[i] = x[i] + sum[i - 1];
	}
	v[0].push_back(make_pair(0, 0));
	for (int i = 1; i <= 15; i++) {
		for (int j = 0; j < i; j++) {
			for (vpi itr = v[j].begin(); itr != v[j].end(); itr++) {
					v[i].push_back(make_pair(itr->F+ x[i],  itr->S + y[i]));
				if (n <= 15 || itr->F - x[i] + sum[15] - sum[i] > 0) {
					v[i].push_back(make_pair(itr->F - x[i], itr->S - y[i]));
				}
			}
		}
		if (n <= i) {
			for (int j = 0; j <= i; j++) {
				for (vpi itr = v[j].begin(); itr != v[j].end(); itr++) {
					if (itr->F >= -d && itr->F <= d) {
						ans = max(itr->S, ans);
					}
					if (-1 * itr->F >= -d && -1 * itr->F <= d) {
						ans = max(-1 * itr->S, ans);
					}
				}
			}
			cout << ans << endl;
			return 0;
		}
	}
	for (int i = 0; i <= 15; i++) {
		for (vpi itr = v[i].begin(); itr != v[i].end(); itr++) {
			P p = *itr;
			d1.push_back(make_pair(itr->F, itr->S));
			d1.push_back(make_pair(-itr->F, -itr->S));
		}
		v[i].clear();
	}
	v[0].push_back(make_pair(0, 0));
	for (int i = 16; i <= n; i++) {
		for (int j = 0; j < i - 15; j++) {
			for (vpi itr = v[j].begin(); itr != v[j].end(); itr++) {
				v[i - 15].push_back(make_pair(itr->F + x[i] , itr->S + y[i]));
				if (itr->F - x[i] + sum[n] - sum[i] >= 0)
					v[i - 15].push_back(make_pair(itr->F - x[i], itr->S - y[i]));
			}
		}
	}
	for (int j = 0; j <= 15; j++) {
		for (vpi itr = v[j].begin(); itr != v[j].end(); itr++) {
			d2.push_back(make_pair(itr->F, itr->S));
			d2.push_back(make_pair(-itr->F, -itr->S));
		}
		v[j].clear();
	}

	sort(d1.begin(), d1.end());
	sort(d2.begin(), d2.end());

	int a = 0, b = 0;
	deque<int> c;
	for ( int i = d1.size() - 1; i >= 0; i--) {
		while (a < d2.size() && d1[i].first + d2[a].first <= d) {
			while (!c.empty() && d2[c.back()].second <= d2[a].second) c.pop_back();
			c.push_back(a);
			a++;
		}
		while (b < d2.size() &&  d2[b].first + d1[i].first < -d) {
			if (!c.empty() && c.front() == b) c.pop_front();
			b++;
		}
		if(!c.empty()) ans = max(ans, d1[i].second + d2[c.front()].second);
	}
	cout << ans << endl;
	return 0;
}

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

ll f(ll n) { return n*(n+1)/2;}

int main() {
  int n;
  cin >> n;
  ll ans = 0;
  vector<int> d(n+1);
  for (int i = 1; i <= n; i++) {
    for (int j = i; j <= n; j += i) d[j]++;
    // ll r = n/i;
    // ans += f(r)*i;
  }
  for (int i = 1; i <= n; i++) ans += ll(i)*d[i];
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 42288
#include <stdio.h>
#include<math.h>
#include <algorithm>
using namespace std;

int main(){
	char table[3][4];
	bool FLG;

	while(true){
		scanf("%s",table[0]);
		if(table[0][0] == '0')break;

		scanf("%s",table[1]);
		scanf("%s",table[2]);

		FLG = false;

		//?¨???¨????????????
		for(int i=0; i < 3; i++){
			if((table[i][0] == 'b' || table[i][0] == 'w') && table[i][0] == table[i][1] &&
					table[i][0] == table[i][2]){
				printf("%c\n",table[i][0]);
				FLG = true;
				break;
			}

			if((table[0][i] == 'b' || table[0][i] == 'w') && table[0][i] == table[1][i] &&
					table[0][i] == table[2][i]){
				printf("%c\n",table[0][i]);
				FLG = true;
				break;
			}
		}

		if(!FLG){
			if((table[0][0] == 'b' || table[0][0] == 'w') && table[0][0] == table[1][1] &&
					table[0][0] == table[2][2]){
				printf("%c\n",table[0][0]);
				FLG = true;
			}

			if(!FLG){
				if((table[0][2] == 'b' || table[0][2] == 'w') && table[0][2] == table[1][1] &&
						table[0][2] == table[2][0]){
					printf("%c\n",table[0][2]);
					FLG = true;
				}
			}
		}

		if(!FLG)printf("NA\n");

	}

    return 0;
}

Measured memory_bytes: 2720
#include <bits/stdc++.h>
#define rep(i,s,n) for (int i = s; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
  int n;
  cin >> n;
  vector<ll> a(n);
  rep(i,0,n) {
    ll k;
    cin >> k;
    a[i] = k*2;
  }
  vector<ll> b(n+1,0);
  b[0] = a[0];
  rep(i,0,n) {
    b[i+1] = a[i] - b[i];
  }
  ll k = (b[0] - b[n]) / 2;
  rep(i,0,n) {
    if (i % 2 == 0) {
      b[i] -= k;
    } else {
      b[i] += k;
    }
  }
  rep(i,0,n-1) {
    cout << b[i] << " ";
  }
  cout << b[n-1] << endl;
  return 0;
}


Measured memory_bytes: 4760
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main(){
    int N, A, B, P[101], i;
    scanf("%d", &N);
    scanf("%d %d", &A, &B);
    for (i = 0; i < N; i++){
        scanf("%d", &P[i]);
    }

    int a=0, b=0, c=0;
    for (i = 0; i < N; i++){
        if(P[i] <= A){
            a += 1;
        }
        else if(P[i] >= B+1){
            c += 1;
        }
        else{
            b += 1;
        }
    }

    int d;
    if (a <= b){
        d = a;
    }
    else{
        d = b;
    }
    if (d >= c){
        d = c;
    }
    printf("%d\n", d);
    return 0;
}

Measured memory_bytes: 128
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
using namespace std;
#define REP(i,n) for(int i = 0; i < (int)n; i++)
#define FOR(i,a,b) for(int i = a; i < (int)b; i++)
#define pb push_back
#define mp make_pair
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef long long ll;
typedef unsigned long long ull;
const int INF = 1<<28;
const ll MOD = 1000000007;
const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n; cin >> n;
	while(n--) {
		vi a, c, d;
		vector<vi> v(100);
		int in;
		while(cin >> in, in)
			a.pb(in);
		int cur = 0, top = 1;
		c.pb(0); d.pb(a[0]);
		FOR(i, 1, a.size()) {
			if(a[i] > 0) {
				c.pb(c[cur]+1); d.pb(a[i]);
				v[top].pb(cur); v[cur].pb(top);
				d[top]--; d[cur]--;
				cur = top++;
			}
			else {
				int to;
				for(int j = cur; j >= 0; j--) {
					if(c[j] - c[cur] == a[i] && d[j] > 0) {
						to = j;
						break;
					}
				}
				v[to].pb(cur); v[cur].pb(to);
				d[to]--; d[cur]--;
				if(i == a.size()-1)
					break;
			}
			while(!d[cur]) cur--;
		}
		REP(i, top) {
			cout << i+1;
			sort(v[i].begin(), v[i].end());
			REP(j, v[i].size())
				cout << ' ' << v[i][j]+1;
			cout << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 1252
import math 
n,m = map(int,input().split())
nm_abs = abs(n-m)
n_lad = math.factorial(n)
m_lad = math.factorial(m)
if nm_abs >= 2:
  print(0)
elif nm_abs == 1:
  print((n_lad * m_lad) % (10**9+7))
else:
  print((n_lad * m_lad*2) % (10**9+7))


Measured memory_bytes: 5176
#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
int wi[100001], vi[100001];
long long dp[105][100005];

long long solve(int n, int w){
    if(n == 0 || w == 0) return 0;
    if(dp[n-1][w] != -1) return dp[n-1][w];
    if(wi[n-1] > w){
        return dp[n-1][w] = solve(n-1, w);
    }
    return dp[n-1][w] = max(solve(n-1,w), solve(n-1,w-wi[n-1])+vi[n-1]);
}


int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n,w; cin >> n >> w;
    for(int i = 0; i < n;i++) 
    {
        cin >> wi[i] >> vi[i];

    };
    for(int i = 0; i <= n ; i++){
        for(int j = 0;j <= w ; j++) {
            dp[i][j] = -1;
        }
    }
    cout << solve(n,w) << endl; 
    
    return 0;

}



Measured memory_bytes: 82408
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

#define rep(i,s,n)for(int i = s;i<n;i++)
#define repe(i,s,n)for(int i = s;i<=n;i++)
using namespace std;
typedef long long ll;
static const ll MOD = 1000000007;// 1e9 + 7

string s;
ll x, y;
ll ix = 0, iy = 0;
ll mx[8000];
ll my[8000];
bool px[2][16001];
bool py[2][16001];

int main() {
	cin >> s >> x >> y;

	bool F = true;
	bool X = true;
	rep(i, 0, s.size()) {
		if (s[i] == 'T') {
			if (X) {
				ix++;
			}
			else {
				iy++;
			}
			X = !X;
		}
		else if (s[i] == 'F') {
			if (X) {
				mx[ix]++;
			}
			else {
				my[iy]++;
			}
		}
	}

	px[0][8000] = true;
	py[0][8000] = true;
	ll L = max(ix, iy);
	repe(j, 0, L) {
		ll J = j % 2;
		ll JR = (j + 1) % 2;
		rep(i, 0, 16001) {
			if (px[J][i]) {
				px[JR][i + mx[j]] = true;
				if (j != 0) px[JR][i - mx[j]] = true;
				px[J][i] = false;
			}
			if (py[J][i]) {
				py[JR][i + my[j]] = true;
				py[JR][i - my[j]] = true;
				py[J][i] = false;
			}
		}
	}
	/////////////////////////////////////////////
	ll A = (L + 1) % 2;

	cout << ((px[A][x + 8000] && py[A][y + 8000]) ? "Yes" : "No") << endl;

	return 0;
}


Measured memory_bytes: 384
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <utility>
#include <cstdlib>
#include <memory>
#include <queue>
#include <cassert>
#include <cmath>
#include <ctime>
#include <complex>
#include <bitset>
#include <fstream>
#include <unordered_map>
#include <unordered_set>
#include <numeric>

using namespace std;

#define ws ws_____________________
#define y1 y1_____________________
#define y0 y0_____________________
#define left left_________________
#define right right_______________
#define next next_________________
#define prev prev_________________
#define hash hash_________________

#define pb push_back
#define fst first
#define snd second
#define mp make_pair 
#define sz(C) ((int) (C).size())
#define forn(i, n) for (int i = 0; i < (int) n; ++i)
#define ford(i, n) for (int i = ((int) n) - 1; i >= 0; --i)
#define all(C) begin(C), end(C)

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef vector<vector <int> > vvi;
typedef vector<pii> vii;
typedef long double ld;
typedef complex<double> cd;
typedef vector<cd> vcd;

#define FILE_NAME "a"

const int MAXN = 2e5 + 10;

int n;
string s;
int k;

bool read() {
	if  (!getline(cin, s)) {
		return false;
	}
	if  (scanf("%d", &k) < 1) {
		return false;
	}
	return true;
}

void solve() {
	forn(i, sz(s)) {
		if  (s[i] == 'a') {
			continue;
		}
		if  ('z' - s[i] + 1 > k) {
			continue;
		}
		k -= 'z' - s[i] + 1;
		s[i] = 'a';
	}
	k %= 26;
	int c = s.back() - 'a';
	c = (c + k) % 26;
	s.back() = 'a' + c;
	printf("%s\n", s.data());
}

int main() {
#ifdef LOCAL
	freopen(FILE_NAME ".in", "r", stdin);
	// freopen(FILE_NAME ".out", "w", stdout);
#endif

	while (read()) {
		solve();
	}

#ifdef LOCAL
	cerr.precision(5);
	cerr << "Time: " << fixed << (double) clock() / CLOCKS_PER_SEC << endl;
#endif
	return 0;
}


Measured memory_bytes: 512
N,D,X = 0, 0, 0
A = []
Sum = 0
while True:
    N = int(input())
    a = input().split()
    D, X = int(a[0]), int(a[1])
    if (N or D or X) <1  or (N or D or X) >100:
        continue
    for i in range(N):
        a = input()
        if int(a)>=1 or int(a)<=100:
            A.append(int(a))
        else:
            continue

    for i in A:
        Sum = Sum + int(D/i) + 1
        if int(D/i) == D/i:
            Sum = Sum -1
    break
print(Sum + X)


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i,n) for(int i=0, i##_len=(int)(n); i<i##_len; i++)
#define reps(i,n) for(int i=1 , i##_len=(int)(n);i<=i##_len;i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;i--)
#define rreps(i,n) for(int i=((int)(n));i>0;i--)
#define repi(i,x) for(auto i=(x).begin(),i##_fin=(x).end();i!=i##_fin;i++)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define solve(a) ((a)?"Yes":"No")
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef pair<int , int> Pi;
typedef vector<Pi> VPi;
typedef vector<long long> V;
typedef vector<V> VV;
typedef pair<long long , long long> P;
typedef vector<P> VP;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1;} return 0;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1;} return 0;}
const long long INFLL = 1LL<<60;
const int INF = 1<<30;
const double PI=acos(-1);
int main(){
	int n;
	ll ans=0LL;
	cin >>n;
	Vi a(n);
	int sum=0;
	int last=0;
	rep(i,n){
		cin>>a[i];
	}
	sum=a[0];
	for(int i=1;i<n;i++){
		while((sum & a[i])!=0){
			sum&=(~a[last]);
		//	clog<<i<<" "<<last<<endl;
			ans+=i-last;
			last++;
		}
		sum|=a[i];
	}
	while(n!=last){
    //    clog << n << " " << last << endl;
        ans += n - last;
        last++;
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 4044
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())
if A < B:
    A += V*T
    B += W*T
    print("YES" if A >= B else "NO")
else:
    A -= V*T
    B -= W*T
    print("YES" if A <= B else "NO")

Measured memory_bytes: 61616
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
using namespace std;

int main(){
  char N[11];
  int S[11]={};
  int K;
  int i=0;
  int num[10];
  int ans= 1000;
  int AAa=1000;
  int aAA=0, AAA;


  scanf("%s", N);
  do{
    S[i] = N[i]-48;
    i++;
  }  while(N[i]);


  for(int l=0;l<i-2;l++){
  	K=fabs(753-S[l]*100 - S[l+1]*10 - S[l+2]);
  	ans = min(ans, K);
   
  }


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

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

int main(){
	int be1=0,be2=0,be3=0,out=0,n,ining=0,point[100],i=0,j,k;
	char a[8],b1[4]="OUT",b2[4]="HIT",b3[8]="HOMERUN";
	scanf("%d",&n);
	k=n;
	for(i=0;i<100;i++){
		point[i]=0;
	}
	i=0;
	while(1){
		scanf("%s",&a);
		if(strcmp(a,b1)==0){
			out++;
			if(out==3){
				out=0;
				be1=0;
				be2=0;
				be3=0;
				ining++;
				i++;
				if(i==n){
					for(j=0;j<k;j++){
						printf("%d\n",point[j]);
					}
				return 0;
				}
			}
		}
		if(strcmp(a,b2)==0){
			if(be3==1){
				point[i]+=1;
			}
			be3=be2;
			be2=be1;
			be1=1;
		}
		if(strcmp(a,b3)==0){
			point[i]+=be1+be2+be3+1;
			be1=0;
			be2=0;
			be3=0;
		}
	}
}

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

using namespace std;

typedef long long ll;

double getTime() { 
  return clock() / (double) CLOCKS_PER_SEC;
}

void read() {};

template<typename T, typename... Args>
void read(T& a, Args&... args) {
  cin >> a;
  read(args...);
}

void print() {};

template <typename T, typename... Args>
void print(T a, Args... args) {
  cout << a << " \n"[sizeof...(args) == 0];
  print(args...);
}

int main() {
  int n, m; read(n, m);
  int k; read(k);
  for(int i = 0; i <= n; i++) {
    for(int j = 0; j <= m; j++) {
      int black = i * m + j * n;
      black -= 2 * i * j;
      if(black == k) {
        print("Yes");
        return 0;
      }
    }
  }
  print("No");
}

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

int main(){
  int a, b, c, d, e;
  cin>>a>>b>>c>>d>>e;
  if(a==0)
    cout<<1<<endl;
  else if(b==0)
    cout<<2<<endl;
  else if(c==0)
    cout<<3<<endl;
  else if(d==0)
    cout<<4<<endl;
  else if(e==0)
    cout<<5<<endl;
}

Measured memory_bytes: 3592
#include "bits/stdc++.h"
#include <boost/range/irange.hpp>
using namespace std;
using boost::irange;

// 定義
typedef long long           ll;
typedef pair<ll, ll>        P;
#define ALL(x)              (x).begin(),(x).end()
#define REP(i, n)           for (ll i = 0 ; i < (ll)n ; ++i)
#define REPN(i, m, n)       for (ll i = m ; i < (ll)n ; ++i)
const ll                    INF = 2e9;
const ll                    INF_LL = 1LL<<60;
const ll                    MOD = 998244353;

ll Ceil(ll val, ll div)   { return (val + div - 1) / div; }
ll CeilN(ll val, ll div)  { return Ceil(val, div) * div; }
ll FloorN(ll x, ll n)     { return (x - x % n); }
bool IsOdd(ll x)          { return ((x & 1) == 1); }
bool IsEven(ll x)         { return ((x & 1) == 0); }
template<class T> bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

template<class T>
class Ruiseki
{
private:
	int num;

public:
	vector<T> sumVal;
	Ruiseki(const vector<T> &srcVal)
	{
		num = srcVal.size();
		sumVal.resize(num + 1, 0);
		for (int i = 0; i < num; i++) {
			sumVal[i + 1] = sumVal[i] + srcVal[i];
		}
	}

	T GetSumAll()
	{
		return sumVal[num];
	}

	T GetSumRange(int startIdx, int stopIdx)
	{
		return sumVal[stopIdx] - sumVal[startIdx];
	}

	T GetSumFromTop(int stopIdx)
	{
		return sumVal[stopIdx] - sumVal[0];
	}

	T GetSumFromEnd(int startIdx)
	{
		return sumVal[num] - sumVal[startIdx];
	}
};

// 処理
void Solve()
{
	ll N;
	string S;
	cin >> N >> S;
	vector<ll> b(N);
	vector<ll> w(N);
	REP(i, N) {
		b[i] = S[i] == '#';
		w[i] = S[i] == '.';
	}

	ll ans = INF;
	Ruiseki<ll> ruib(b);
	Ruiseki<ll> ruiw(w);
	REP(i, N + 1) {
		ll ansOne = ruib.GetSumFromTop(i) + ruiw.GetSumFromEnd(i);
		chmin(ans, ansOne);
	}

	cout << ans << endl;
}

// メイン
int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Solve();
	return 0;
}


Measured memory_bytes: 9656
n=int(input())
a=[int(i) for i in input().split()]
color=[0]*8
over=0
for i in range(n):
    if a[i]<=399:
        color[0]+=1
    elif a[i]<=799:
        color[1]+=1
    elif a[i]<=1199:
        color[2]+=1
    elif a[i]<=1599:
        color[3]+=1
    elif a[i]<=1999:
        color[4]+=1
    elif a[i]<=2399:
        color[5]+=1
    elif a[i]<=2799:
        color[6]+=1
    elif a[i]<=3199:
        color[7]+=1
    else:
        over+=1
mini=8-color.count(0) if (8-color.count(0))>0 else 1
maxi=8-color.count(0)+over
print("{} {}".format(mini,maxi))

Measured memory_bytes: 3064
# coding: utf-8

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = 0

for i in range(n): 
  if a[i] >= b[i]:
    ans += b[i]
  else:
    b[i] -= a[i]
    ans += a[i]
    
    if a[i+1] >= b[i]:
      ans += b[i]
      a[i+1] -= b[i]
    else:
      ans += a[i+1]
      a[i+1] = 0

print(ans)


Measured memory_bytes: 18624
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        HashMap<Integer, Integer> map = new HashMap<Integer, Integer>();
        int ans = 0;
        for(int i=0;i<n;i++){
            int num = Integer.parseInt(sc.next());
            map.put(num-1, map.containsKey(num-1)?map.get(num-1)+1: 1);
            ans = Math.max(ans, map.get(num-1));
            map.put(num, map.containsKey(num)?map.get(num)+1: 1);
            ans = Math.max(ans, map.get(num));
            map.put(num+1, map.containsKey(num+1)?map.get(num+1)+1: 1);
            ans = Math.max(ans, map.get(num+1));
        }
        System.out.println(ans);
    }
}


Measured memory_bytes: 56252
--{-# LANGUAGE OverloadedStrings #-}
--{-# LANGUAGE OverloadedLists   #-}
{-# LANGUAGE BangPatterns      #-} --引数に!
{-# LANGUAGE MultiWayIf        #-}
{-# LANGUAGE TupleSections     #-}

import Data.Bits
import Data.Foldable (foldlM,foldrM)
import Data.Maybe (fromJust)
import Data.List
import Data.Array  --変数衝突
import Data.Array.Unboxed
import Data.Array.MArray
import Data.Array.ST
import qualified Data.Vector.Unboxed as V
import Control.Monad
import Control.Monad.State
import Control.Monad.ST
import qualified Data.ByteString.Lazy.Char8 as B
import Debug.Trace

cnt :: String -> String -> Int
cnt [] _ = 0
cnt (s:ss) (t:ts) = if s == t then 1+(cnt ss ts) else cnt ss ts

main :: IO ()
main = do
  s <- getLine
  let n = (length s)
  print $ min (cnt s $ take n (cycle "01")) (cnt s $ take n (cycle "10"))


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

int main()
{
    int n, a[40], b[40], c[40], result = 0;
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
    {
        scanf("%d", &a[i]);
    }
    for (int i = 0; i < n; i++)
    {
        scanf("%d", &b[i]);
        result += b[i];
    }
    for (int i = 0; i < n - 1; i++)
    {
        scanf("%d", &c[i]);
    }
    for (int i = 0; i < n; i++)
    {
        if (a[i] < n && a[i] + 1 == a[i + 1])
        {
            result += c[a[i] - 1];
        }
    }
    printf("%d\n", result);
}


Measured memory_bytes: 256
#include<stdio.h>
int main()
{
	char str[21]={0};
	int i=0,j=0;
	
	scanf("%s",str);
	while(str[i]!=0)
	{
		i++;
	}
	for(j=i-1;j>=0;j--)
	{
		putchar(str[j]);
	}
	puts("");
	return 0;
}

Measured memory_bytes: 524
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <deque>
#include <string>
#include <list>
#include <algorithm>
#include <cmath>
#include <fstream>
#include <map>
#include <set>
#include <sstream>
#include <ctime>
using namespace std;
typedef signed long long int lli;
#define FOR(i, p, n) for(int i(p); i < n; i++)
#define ALL(a) (a.begin()),(a.end())
#define sqrt(x) sqrt(1.0*(x))
#define pow(x,n) pow(1.0*(x),n)
#define UN(x) (x).resize(unique(ALL((x))) - (x).begin());
#define mp make_pair
const lli INF = 10e8;
bool solve()
{
	string s;
	cin >> s;
	string t = "YAKI";
	if (s.size() < 4) {
		cout << "No";
		return 1;
	}
	for (int i(0); i < 4 ; i++){
		if (s[i] != t[i]) {
			cout << "No";
			return 1;
		} 
	}
	cout << "Yes";
	return 1;
}
int main()
{
	solve();
	//while (solve());
	return 0;
}

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

int main(){
    string a,b;
    cin >> a >> b;
    string c = a + b;
    int  ab = stoi(c);
    double rep = sqrt(ab);
    int ans = sqrt(ab);
    if ( rep - ans == 0){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
// --------------------<optimizations>--------------------
#pragma GCC optimize("O3")
//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN TRYING TO BRUTEFORCE WITH A LOT OF LOOPS)\
#pragma GCC optimize("unroll-loops")

#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")

#include<bits/stdc++.h>

using namespace std;

#define int long long
#define ll long long
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define pii pair<ll,ll>
#define vpii vector<pair<ll,ll> >
#define F first
#define S second
#define ld long double
#define built __builtin_popcountll
#define mst(a,i) memset(a,i,sizeof(a))
#define all(x) x.begin(),x.end()
#define itit(it,a) for(auto it=(a).begin(); it!=(a).end(); it++)
#define rep(i,a,b) for(ll i=a; i<b; i++)
#define repr(i,a,b) for(ll i=a; i>b; i--)
#define reprr(i,a,b) for(ll i=a; i>=b; i--)
#define pi 3.14159265358979323846264338327950288419716939937510582097494459230
ll max3(ll x,ll y,ll z) {return max(max(x,y),z);}
ll min3(ll x,ll y,ll z) {return min(min(x,y),z);}
const ll N=1e5+10,M=2e5+10,M2=1e6+10,mod=1e9+7,inf=1e17+10;
const int INF=1e9+7;
void add(int& a, int b) {a+=b;if(a>=mod){a-=mod;}}


int X[] = {0, 1, 0, -1};
int Y[] = {-1, 0, 1, 0};
//assic value of ('0'-'9') is(48 - 57) and (a-z) is (97-122) and (A-Z) is(65-90) and 32 for space
ll power(ll x,ll n){ll result=1;while(n>0){if(n%2==1)result=(result*x)%mod; x=((x%mod)*(x%mod))%mod;n=n/2;}return result;}

const int Z=205;
int n,m,r;
int d[Z];
int lol[Z][Z];
int res;
bool used[Z];

void floyd_warshall(){
    for(int i=1; i<=n; i++)
        for(int j=1; j<=n; j++)
            for(int k=1; k<=n; k++)
                lol[j][k]=min(lol[j][k],lol[j][i]+lol[i][k]);
}

void dfs(int c, int last, int dist){
    if(c==r+1){
        res=min(res,dist);
        return;
    }
    for(int i=1; i<=r; i++){
        if(!used[i]){
            used[i]=true;
            if(last==-1) dfs(c+1,i,0ll);
            else dfs(c+1,i,dist+lol[d[i]][d[last]]);
            used[i]=false;
        }
    }
}

int32_t main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cin >> n >> m >> r;
    rep(i,1,r+1) cin >> d[i];
    for(int i=1; i<=n; i++)
        for(int j=1; j<=n; j++)
            if(i!=j) lol[i][j]=inf;

    rep(i,0,m){
        int a,b,c;
        cin >> a >> b >> c;
        lol[a][b]=c;
        lol[b][a]=c;
    }
    floyd_warshall();
    res=inf;
    dfs(1,-1,0);
    cout << res;
    return 0;
}

Measured memory_bytes: 640
//usr/bin/env picoc $0 - $@;exit
#include <stdio.h>
int main(){
  int A,B,C;
  scanf("%d%d",&A,&B);
  C= A+B;
  if(A-B>C){
    C=A-B;
  }
  if(A*B>C){
   C=A*B;
  }
  printf("%d\n",C);
  return 0;
}

Measured memory_bytes: 128
#include<iostream>
using namespace std;
int main()
{
string s,t;
  cin>>s>>t;
  int c=0;
  for(int i=0;i<s.length();++i)
  {if(t[i]==s[i]) c++;}
  if(c==s.length())
    cout<<"Yes";
   else cout<<"No";
  return 0;
}

Measured memory_bytes: 3588
#include<iostream>
#include<vector>
#include<math.h>
using namespace std;
vector<pair<int,int> > pos,pos1;
const int inf=1e9+7;
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n,i,j,k,l,num=0,ans=inf,now;
	cin>>n;
	string s,t;
	cin>>s>>t;
	s=" "+s;
	t=" "+t;
	pos.push_back({0,1-(int)(s[1]-'0')});
	pos1.push_back({0,1-(int)(t[1]-'0')});
	for(i=1;i<n;i++){
		if(s[i]!=s[i+1]){
			pos.push_back({i,(int)(s[i]-'0')});
		}
		if(t[i]!=t[i+1]){
			pos1.push_back({i,(int)(t[i]-'0')});
		}
	}
	pos.push_back({n,(int)(s[n]-'0')});
	pos1.push_back({n,(int)(t[n]-'0')});
//	for(i=0;i<pos.size();i++){
//		cout<<pos[i].first<<' '<<pos[i].second<<endl;
//	}
//	cout<<"cac\n";
//	for(i=0;i<pos1.size();i++){
//		cout<<pos1[i].first<<' '<<pos1[i].second<<endl;
//	}
//	cout<<"cac1\n";
	for(i=0;i<pos1.size();i++){
		if(pos1[i].second!=pos[0].second){
			continue;
		}
		num=0;
		for(now=0;now<i;now++){
			num+=pos1[now].first;
		}
		for(j=0;j<pos.size();j++){
			num+=abs(pos[j].first-pos1[now].first);
			now=min(now+1,(int)pos1.size()-1);
		}
		while(now<pos1.size()-1){
			num+=n-pos1[now].first;
			now++;
		}
		ans=min(ans,num);
	//	cout<<ans<<' '<<i+1<<endl;
	}
	//cout<<ans<<endl;
	for(i=0;i<pos.size();i++){
		if(pos[i].second!=pos1[0].second){
			continue;
		}
		num=0;
		for(now=0;now<i;now++){
			num+=pos[now].first;
		}
		for(j=0;j<pos1.size();j++){
			num+=abs(pos1[j].first-pos[now].first);
			now=min(now+1,(int)pos.size()-1);
		}
		while(now<pos.size()-1){
			num+=n-pos[now].first;
			now++;
		}
		ans=min(ans,num);
	}
	cout<<ans;
}

Measured memory_bytes: 512
my$s=<STDIN>;
my$n=<STDIN>;
chomp $s;
chomp $n;
if($s eq $n) {
    print "No";
    exit;
}
$s=join('',sort{ord($a)-ord($b)}split(//,$s));
$n=join('',sort{ord($b)-ord($a)}split(//,$n));
print $s lt $n ? "Yes" : "No";

Measured memory_bytes: 512
#define _GLIBCXX_DEBUG
#include<algorithm>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<iostream>
#include<vector>
#include<queue>
#include<deque>
#include<stack>
#include<set>
#include<map>
#include<string>
#include <bits/stdc++.h>
#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 ll long long 
#define all(v) v.begin(),v.end()
using namespace std;

int main() {
  int d,n;
  cin >> d >> n;
  int m=pow(100,d);
  if(n<100) cout << m * n << endl;
  else cout << m* 101 << endl;
}




Measured memory_bytes: 256
#include <stdio.h>
int main() {
	int a;
	char s[11];

	scanf("%d", &a);
	scanf("%s", &s);

	if (a >= 3200) {
		printf("%s\n", s);
	} else if(a < 3200){
		printf("red\n");
	}

	return 0;
}

Measured memory_bytes: 128
#include <stdio.h>

int main(){
  int len;
  scanf("%d",&len);
  
  int num[len];
  int *p;
  p = &num[0];
  
  int i;
  int count=0;
  for(i=0;i < len;i++){
    scanf("%d",&p[i]);

  }
  
  while(1){
    for(i=0;i < len;i++){
      if(p[i]%2 == 1){
        printf("%d",count);
      	return 0;
      }
      p[i] = p[i]/2;
    }
    count++;
  }
  return 0;
}
  


Measured memory_bytes: 128
n=int(input())
a1=[int(i) for i in input().split()]
a2=[int(i) for i in input().split()]
candy=0
count=0
for i in range(1,n+1):
    count+=sum(a1[:i])
    for j in range(i-1,n):
        count+=sum(a2[j:n+1])
        candy=max(candy,count)
        count=0
print(candy)


Measured memory_bytes: 3060
#include<iostream>
using namespace std;
int main()
{
	int a, b;
	char c;
	while (1)
	{
		cin >> a >> c >> b;
		if (c == '?')break;
		if (c == '+')cout << a + b << endl;
		if (c == '-')cout << a - b << endl;
		if (c == '/')cout << a / b << endl;
		if (c == '*')cout << a * b << endl;
	}
	return 0;
}


Measured memory_bytes: 3088
# -*- coding: utf-8 -*-
from math import log2

line = list(map(int, input().split(" ")))
n = line[0]
m = line[1]
d = line[2]

if 2*d<n and d>0:
    ret1 = 1+(m-2)*log2(n)
    ret2 = log2(n-d)
    ret3 = log2(m-1)
    ret4 = m*log2(n)
    print(2**(ret1+ret2+ret3-ret4))
else:
    ret1 = (m-1)*log2(n)
    ret2 = log2(m-1)
    ret3 = m*log2(n)
    print(2**(ret1+ret2-ret3))


Measured memory_bytes: 3188
#include <iostream>
#include <cstdio>
#include <vector>
#include <set>
#include <deque>
#include <algorithm>
#include <queue>
#include <cmath>
#include <map>
#include <complex>
#include <cstring>
#include <cassert>
#include <bitset>

using namespace std;
#define rep(i, a, b) for(int i = (a); i < (b); i++)
#define repd(i, a, b) for(int i = (a); i > (b); i--)
#define forIt(it, a) for(__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define forRev(it, a) for(__typeof((a).rbegin()) it = (a).rbegin(); it != (a).rend(); it++)
#define ft(a) __typeof((a).begin())
#define ll long long
#define ld long double
#define fi first
#define se second
#define mk make_pair
#define pb push_back
#define sz(a) (int)(a).size()
#define all(a) (a).begin(), (a).end()
#define Rep(i,n) for(int i = 0; i < (n); ++i)
#define bitcount(n) __builtin_popcountll(n)
#define randchar() ((rand() % 26) + 'a')


typedef vector<int> vi;
typedef pair<int, int> ii;
typedef pair<ii, int> iii;
typedef pair<ii, ii> iiii;
typedef vector<ii> vii;
typedef vector<iii> viii;

const int N = 300 + 7;
const int M = 20000007;
const int inf = 1e9 + 7;
const long long linf = 1ll * inf * (inf - 1);
const double pi = acos(-1);
const double eps = 1e-7;
const bool multipleTest = 0;


int state[N];
int n, m;
int a[N][N];
int b[N][N];
int check[N][N];
int cnt[N];

int calc() {
	memset(check, 0, sizeof(check));
	for (int i = 1; i <= m; ++i) {
		cnt[i] = 0;
		if (state[i] == 0) {
			for (int j = 1; j <= n; ++j) {
				check[j][a[j][i]] = 1;
			}
		}
	}
	
	
	for (int i = 1; i <= n; ++i) {
		int f = -1;
		for (int j = 1; j <= m; ++j) {
			if (check[i][j]) {
				f = j;
				break;
			}
		}
		if (f == -1) return inf;
		cnt[b[i][f]]++;
	}
	
	int mx = 0;
	for (int i = 1; i <= m; ++i) if (state[i] == 0) {
		if (!mx || cnt[mx] < cnt[i]) mx = i;
	}
	state[mx] = 1;
//	for (int i  )
//	cout << mx << ' ' << cnt[mx] << '\n';
	return cnt[mx];
}

void solve() {
	cin >> n >> m;
	for (int i = 1; i <= n; ++i) {
		for (int j = 1; j <= m; ++j) {
//			cin >> a[i][j];
			int u;
			cin >> u;
			a[i][u] = j;
			b[i][j] = u;
		}
	}
	
	
	int res = n;
	//int tmp;
	
	
	for (int i = 1; i < m; ++i) {
		res = min(res, calc());
	}
	
	
	cout << res;
	
	
	
}

int main() {
#ifdef _LOCAL_
	freopen("in.txt", "r", stdin);
#endif
	//	freopen("out.txt", "w", stdout);
	// 	ios_base::sync_with_stdio(false);
	// 	cin.tie(NULL);
	
	//	setbuf(stdout, NULL);
	
	int Test = 1;
	if (multipleTest) {
		cin >> Test;
	}
	for(int i = 0; i < Test; ++i) {
		//		printf("Case #%d\n", i + 1);
		//		cout << "Case #" << i + 1 << '\n';
		solve();
	}
	
#ifdef _LOCAL_
	cout<<"\n" << 1.0 * clock() / CLOCKS_PER_SEC<<endl;
#endif
}


Measured memory_bytes: 1280
from math import ceil
x,k,d=map(int,input().split())
x=abs(x)
n=ceil(x/d)
if n>=k:
    ans=abs(x-k*d)
else:
    if (k-n)%2==0:
        ans=abs(x-n*d)
    else:
        ans=x-(n-1)*d
print(ans)

Measured memory_bytes: 9016
#include <stdio.h>

int main() {
  int a, b;
  double s, tubo_s;
  double const tubo = 3.305785;

  scanf("%d %d", &a, &b);
  s = a * b;
  tubo_s = s / tubo;

  printf("%lf\n", tubo_s);
  return 0;
}

Measured memory_bytes: 632
#include <iostream>  // cin,cout
#include <stdio.h>   // printf,scanf (standard input/output)
#include <cmath>     // abs(x),pow(x,2)
#include <string>
#include <string.h>  // strlen, strcmp
#include <algorithm> // min,max, sort(v.begin(),v.end())
#include <vector>
#include <time.h>
using namespace std;



int main(){
    long long K, A, B;
    
    cin >> K >> A >> B;
    long long d = B-A;
    
    long long result = 0;
    
    if (A+2>=B) {
        result = K + 1;
    }
    else if (K<=(A-1)) {
        result = K + 1;
    }
    else {
        result = A;
        K -= (A-1);
        result += (K/2)*d;
        if (K%2 == 1) {
            result += 1;
        }
    }
    
    cout << result << endl;
    
    return 0;
}

Measured memory_bytes: 256
// https://beta.atcoder.jp/contests/abc077
// status: [review][solve]
// tag: [01BFS]

#define SUBMIT
//#define DEBUG

#include <utility>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <queue>
#include <numeric>
#include <limits>

using namespace std;
using ui64 = unsigned long long;
using i64 = long long;

const int MAX_K = 100000;
const int INF = 1 << 20;
int K;
int dist[MAX_K];

// (i-th node, distance) pair
deque<pair<int, int>> q;

int bfs() {
    // 重みつきグラフで重みが0 or 1のみの場合 0-1 BFSで効率的にBFSが可能
    q.push_back(make_pair(1, 0));

    while (!q.empty()) {
        auto p = q.front();
        q.pop_front();

        if (dist[p.first] != INF) continue;
        dist[p.first % K] = p.second;
        if (p.first == 0) break;

        q.push_back(make_pair((p.first + 1) % K, p.second + 1));
        q.push_front(make_pair((p.first * 10) % K, p.second));
    }

    return dist[0] + 1;
}

int main() {
#ifdef SUBMIT
    auto& stream = cin;
#else
    auto program_input = std::string(R"(6
)");
    stringstream stream(program_input);
#endif
    stream >> K;
    for (int i = 0; i < K; ++i) dist[i] = INF;

    auto ans = bfs();
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1408
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define repr(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define invrepr(i,a,b) for(int i=b-1;i>=a;i--)
#define invrep(i,n) invrepr(i,0,n)
#define repitr(itr,a) for(auto itr=a.begin();itr!=a.end();++itr)
#define P pair<int,int>
const ll MOD=1e9+7;
const int INF=2e9;
const double PI=acos(-1);

const int MAX=200010;


int main() {
    ios_base::sync_with_stdio(false); 

    string s;
    cin >> s;
    int n=s.size();
    bool flag=0;
    rep(i,n-2) {
        if (s[i]==s[i+1] || s[i]==s[i+2] || s[i+1]==s[i+2]) {
            cout << i+1 << ' ' << i+3 << endl;
            flag=1;
            break;
        }
    }
    if (n==2 && s[0]==s[1]) {
        cout << 1 << ' ' << 2 << endl;
        flag=1;
    }
    if (!flag) cout << -1 << ' ' << -1 << endl;
    
    return 0;
}


Measured memory_bytes: 3792
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <string>
#include <tuple>
#include <vector>
#include <map>
#include <list>
#include <set>
#include <stack>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <random>
#include <cassert>
using namespace std;
#define LL long long
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -2147483648
#define INT_MAX 2147483647
#define LL_MIN -9223372036854775808
#define LL_MAX 9223372036854775807
#define segment_size 65536
#define ROOP() while (true)

int main(){
    
    int N,C;
    cin >> N >> C;
    N++;
    
    int sum = 0;
    for(int i=0; i<C; i++){
        int tmp;
        cin >> tmp;
        sum += tmp;
    }

    int ans = sum / N;
    if(sum % N != 0) ans++;
    cout << ans << endl;
    
    return 0;
}


Measured memory_bytes: 3096
#include<iostream>
using namespace std;
int main(){
int n;
int num=0;
while(cin>>n){
for(int h=0;h<=9;h++){
for(int i=0;i<=9;i++){
for(int j=0;j<=9;j++){
for(int k=0;k<=9;k++){
if(h+i+j+k==n){num++;}
}
}
}
}
cout<<num<<endl;
num=0;
}
}

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

#include <atcoder/all>
using namespace std;
using namespace atcoder;
typedef long long ll;
const double pi = 3.141592653589793;
typedef unsigned long long ull;
typedef long double ldouble;
const ll INF = 1e18;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++)
template <class T>
inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return 1;
    }
    return 0;
}
typedef pair<int, int> P;
typedef pair<ll, ll> PL;

struct ProconInit {
    static constexpr int IOS_PREC = 15;
    static constexpr bool AUTOFLUSH = false;

    ProconInit() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(IOS_PREC);
        if (AUTOFLUSH) cout << unitbuf;
    }
} PROCON_INIT;
// コンパイル方法
// g++ ___/___.cpp -std=c++17 -I .
// ./a.out

const int MAX_A = 300005;

int op(int a, int b) { return max(a, b);};
int e() { return 0; };

int main() {
    int n, k;
    cin >> n >> k;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    segtree<int, op, e> t(MAX_A);
    rep(i, n) {
        int x = a[i];
        int l = x-k, r = x+k+1;
        chmax(l, 0);
        chmin(r, MAX_A);
        int now = t.prod(l,r)+1;
        t.set(x, now);
    }
    cout << t.prod(0, MAX_A) << endl;
    return 0;
}

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

using ll = long long;
constexpr ll inf = static_cast<ll>(1e15);
constexpr ll mod = static_cast<ll>(1e9 + 7);

int n;
ll a[2005], x;
ll b[2005];
int main()
{
	std::cin >> n >> x;
	for (int i = 0; i < n; ++i) {
		std::cin >> a[i];
		b[i] = inf;
	}

	ll ans = inf;
	for (int i = 0; i < n; ++i) {
		ll memo = 0;
		for (int j = 0; j < n; ++j) {
			b[j] = std::min(b[j], a[(n + (j - i)) % n]);
			memo += b[j];
		}
		ans = std::min(ans, memo + i * x);
	}
	std::cout << ans << std::endl;
	return 0;
}


Measured memory_bytes: 256
#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 pb push_back
#define sz(x) (int)(x).size()
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#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;
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;

int main(){
    int n;
    cin >> n;
    int a;
    int ans=0;

    rep(i, n){
        cin >> a;
        ans += a;
    }
    
    ans -= n;
    
    cout << ans << endl;
    return 0;
}

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

int main(){
    long long A,B,C,K;
    cin>>A>>B>>C>>K;
    long long ans;

    if(K % 2 == 0) ans = A - B;
    else if(K % 2 != 0) ans = B - A;

    cout<<ans<<endl;

    return 0;

}

Measured memory_bytes: 256