akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long LL;
typedef pair<LL,LL> P;
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; }
template<typename T> T gcd(T a,T b){return b?gcd(b,a%b):a;}
const LL mod=1000000007;
const LL LINF=1LL<<62;
const int INF=1<<30;
int dx[]={1,0,-1,0,1,-1,1,-1};
int dy[]={0,1,0,-1,1,-1,-1,1};


int main(){
    int a,b,h,m;cin >> a >> b >> h >> m;
    double aa = 30 * h + m / 2.;
    double bb = 6 * m;
    double t = abs(aa - bb);
    double tp = t / 180. * acos(-1);
    cout << setprecision(30) << fixed << sqrt(a * a + b * b - 2 * a * b * cos(tp)) << endl;
    return 0;
}



Measured memory_bytes: 4228
import java.util.Scanner;

class Main{
    public static void main(String[] args){
        Scanner scn=new Scanner(System.in);
        long L =scn.nextLong();
        long R =scn.nextLong(); 
        R=Math.min(R,L+4038);
        long answer = 2018;
        for(long i=L;i<=R;i++){
            for(long j=i+1;j<=R;j++){
                long x = i*j%2019;
                answer=Math.min(answer,x);
            }
        }
        System.out.println(answer);
    }
}

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

int main() {
    uint64_t K;
    std::string S;

    std::cin >> K >> S;

    if (S.size() <= K) {
        std::cout << S << std::endl;
    } else {
        std::cout << S.substr(0, K) << "..." << std::endl;
    }

    return 0;
}


Measured memory_bytes: 3632
numerosSTR = input().split(" ")
for i in numerosSTR:
    a = int(numerosSTR[0])
    b = int(numerosSTR[1])
if 2*a-1 > 2*b-1:
    if (2*a-1) > a+b:
        print(2*a-1)
    else:
        print(a+b)
else:
    if 2*b-1 > a+b:
        print(2*b-1)
    else:
        print(a+b)

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


void solve(long long r){
    cout<<r*r<<endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long r;
    scanf("%lld",&r);
    solve(r);
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize ("-ffloat-store") // to restrict undesirable precision
#pragma GCC optimize ("-fno-defer-pop")// to pop argument of function as soon as it returns
#define all(a) a.begin(),a.end()
#define ll long long int
#define ld long double
ll power(ll a,ll b,ll m){ if(b==0) return 1; if(b==1) return a%m; ll t=power(a,b/2,m)%m; t=(t*t)%m; if(b&1) t=((t%m)*(a%m))%m; return t;}
ll modInverse(ll a, ll m) { return power(a, m-2, m); }
#define ps push_back
#define fs first
#define sc second
#define takeline cin.ignore();
#define iactive cout.flush();
#define N 200005
#define endl "\n"
#define mod 1000000007
//((1.0l)*BIG MULTIPLY MAGIC?)
// string to integer stoi()
// string to long long stoll()
// string.substr(position,length);
// integer to string to_string();
//-----------------------------------------------
int main(){
	
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	
	string s;
	cin>>s;
	if(s[2]==s[3]&&s[4]==s[5]){
		cout<<"Yes";
	}
	else cout<<"No";
	return 0;
}

Measured memory_bytes: 256
mi = []
ma = []
n = int(input())

for _ in range(n):
    a, b = [int(a) for a in input().split()]
    mi.append(a)
    ma.append(b)

mi.sort()
ma.sort()
mi = (mi[int(n/2)] + mi[int((n-1)/2)])/2
ma = (ma[int(n/2)] + ma[int((n-1)/2)])/2

if n%2 == 0:
    print(int((ma-mi+0.5) * 2))
else:
    print(int(ma-mi+1))

    

Measured memory_bytes: 25416
h,w = map(int,input().split())
s = list(input() for _ in range(h))
dxy = [(1,0),(-1,0),(0,1),(0,-1)]
for y in range(h):
    for x in range(w):
        if s[y][x] == ".": continue
        else:
            for dx,dy in dxy:
                nx,ny = x+dx,y+dy
                if not 0<=nx<w: continue
                if not 0<=ny<h: continue
                if s[ny][nx]=="#": break
            else:    
                print("No")
                exit()
print("Yes")


Measured memory_bytes: 3064
// abc129_a
#include <bits/stdc++.h>
#ifdef LOCAL
#include "../cxx-prettyprint/prettyprint.hpp"
#endif
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;

#define REP(i, n) for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n) for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define REP_REV(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define REPN_REV(i, m, n) for (int (i) = (int)(n) - 1 ; (i) >= m ; --(i))
#define ALL(x) x.begin(), x.end()

#define INF ((1 << 29)-1)
#define MOD (1000000007)

#define print2D(h, w, arr) REP(i, h) { REP(j, w) cout << arr[i][j] << " "; cout << endl; }
template<class T> void print(const T& x){cout << x << endl;}
template<class T, class... A> void print(const T& first, const A&... rest) { cout << first << " "; print(rest...); }
struct PreMain {PreMain(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(20);}} premain;

int main() {
#ifdef LOCAL
    ifstream in("../arg.txt");
    cin.rdbuf(in.rdbuf());
#endif

    vector<int> A(3);
    REP(i, 3) cin >> A[i];

    sort(ALL(A));

    print(A[0] + A[1]);


    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
int main(void)
{
  int a=0;int b=0;int c=0;int d=0;int e=0;int f=0;int g=0;
  scanf("%d",&a);
  scanf("%d",&b);
  scanf("%d",&c);
  scanf("%d",&d);
  scanf("%d",&e);
  scanf("%d",&f);
  g=a+b+c+d+e+f;
  if(g==15){
    printf("YES\n");
  }else{
    printf("NO\n");
  }
  return 0;
}


Measured memory_bytes: 1640
import java.util.Scanner;

public class Main {

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


        int N = sc.nextInt();
        int K = sc.nextInt();

        System.out.println(solve(N, K));
    }

    public static double solve(int N, int K) {
        double sum = 0;
        double prob = (double)1/N;

        for (int i=1; i<=N; i++) {
            if (i>= K) {
                sum += 1;
                continue;
            }

            sum += Math.pow(0.5, count2(K, i));
        }

        return sum * prob;
   }

   private static int count(int K, int n) {
        int count = (int)Math.ceil((Math.log(K) - Math.log(n)) / Math.log(2.0));
        if (count <= 0) {
            count = 1;
        }

        return count;
   }
   
   private static int count2(int K, int n) {
        for (int i=0;;i++) {
            if (n >= K) return i;
            
            n *= 2;
       }
   }
}

Measured memory_bytes: 21844
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
using namespace std;

void split(string input, int &query, int &num) {
    if(input[0] == '2') {
        query = 2;
        num = 0;
    } else {
        istringstream iss(input);
        string q, n;
        iss >> q >> n;
        query = int(q[0] - '0');
        num = stoi(n);
    }
}

int main() {
    cin.tie(0);
   	ios::sync_with_stdio(false);
   	
    vector<long int> vli;
    int loops, query, num;
    string input;

    cin >> loops;

    getline(cin, input);
    for (int i = 0; i < loops; i++) {
        getline(cin, input);
        split(input, query, num);

        switch (query) {
        case 0:
            vli.push_back(num);
            break;
        case 1:
            cout << vli.at(num) << endl;
            break;
        case 2:
            vli.pop_back();
            break;
        }
    }
}



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

int main(){
  int n, m;
  cin >> n >> m;
  vector<int>vec(n, 0);
  rep(i, m){
    int a, b;
    cin >> a >> b;
    rep(i, n){
      if((i+1)==a||(i+1)==b){
      vec.at(i) += 1;
      }
    }
  }
  rep(i,n){
    cout << vec.at(i) << endl;
  }
}



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


int facto(int n)
{
	int i, ans;
	ans = 1;
	for (i = 1; i <= n; i++) {
		ans = ans * i;
	}
	return ans;
}

int main()
{
	int N;
	cin >> N;
	vector<pair<int, int>> P(N);
	for (int i = 0; i < N; i++)
	{
		int x, y;
		cin >> x >> y;
		P[i] = make_pair(x, y);
	}

	double sum = 0;

	for (int i = 0; i < N; i++)
	{
		for (int j = 0; j < N; j++)
		{
			sum += sqrt(pow(P[i].first - P[j].first, 2) + pow(P[i].second - P[j].second, 2));
		}
	}

	printf("%.8lf\n", sum / N);

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define ALL(a) a.begin(), a.end()
ll dx[4] = { 0, 1, 0, -1 };
ll dy[4] = { 1, 0, -1, 0 };
const ll INF = 1e14;
const ll MOD = 1e9 + 7;

#define M 1046527
#define NIL -1
#define L 14

char H[M][L]; /* Hash Table */

int getChar(char ch)
{
    if (ch == 'A')
        return 1;
    else if (ch == 'C')
        return 2;
    else if (ch == 'G')
        return 3;
    else
        return 4;
}

/* convert a string into an integer value */
ll getKey(char str[])
{
    ll sum = 0, p = 1;
    int i;
    for (i = 0; i < strlen(str); i++) {
        sum += p * (getChar(str[i]));
        p *= 5;
    }
    return sum;
}

int hash1(int key) { return key % M; }
int hash2(int key) { return 1 + (key % (M - 1)); }

bool find(char str[])
{
    ll key, i, hash;
    key = getKey(str);
    for (i = 0;; i++) {
        hash = (hash1(key) + i * hash2(key)) % M;
        if (strcmp(H[hash], str) == 0) {
            return true;
        } else if (strlen(H[hash]) == 0) {
            return false;
        }
    }
}

void insert(char str[])
{
    ll key, i, hash;
    key = getKey(str);
    for (i = 0;; i++) {
        hash = (hash1(key) + i * hash2(key)) % M;
        if (strcmp(H[hash], str) == 0) {
            return;
        } else if (strlen(H[hash]) == 0) {
            strcpy(H[hash], str);
            return;
        }
    }
}

int main()
{
    int i, n;
    char str[L], com[9];
    for (i = 0; i < M; i++)
        H[i][0] = '\0';

    scanf("%d", &n);

    for (i = 0; i < n; i++) {
        scanf("%s %s", com, str);

        if (com[0] == 'i') {
            insert(str);
        } else {
            if (find(str)) {
                printf("yes\n");
            } else {
                printf("no\n");
            }
        }
    }

    return 0;
}


Measured memory_bytes: 17448
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<cstdio>
#include<sstream>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef pair<int,pii> pip;
typedef vector<pip>vip;
const double PI=acos(-1);
const double EPS=1e-8;
const int inf=1e8;
int main(){
	int n;
	while(cin>>n,n){
		vi in(n);
		rep(i,n){
			string s;
			cin>>s;
			in[i]=s.size();
		}
		int t[5]={5,7,5,7,7};
		rep(i,n){
			vi co(5);
			int now=i;
			int nowc=0;
			while(1){
				co[nowc]+=in[now];
				now++;
				if(co[nowc]==t[nowc])nowc++;
				else if(co[nowc]>t[nowc])break;
				if(nowc==5){
					cout<<i+1<<endl;
					goto end;
				}
			}
		}
		end:;
	}
}

Measured memory_bytes: 1212
a,b,c=map(int,input().split())
cnt=0
m=max(a,b,c)
while a < m-1:
  cnt+=1
  a+=2
while b < m-1:
  cnt+=1
  b+=2
while c < m-1:
  cnt+=1
  c+=2
s=m*3
if s-a-b-c==0:
  print(cnt)
elif s-a-b-c==1:
  print(cnt+2)
else:
  print(cnt+1)



Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define fastIO (cin.tie(0), cout.tie(0), ios::sync_with_stdio(false))
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define precise(i) fixed << setprecision(i)
using lint = long;
using llint = long long;
using namespace std;

int main() {
    fastIO;
    string s, t;
    cin >> s >> t;
    cout << t << s;
}


Measured memory_bytes: 3616
# B
N, T = map(int, input().split())
c = [0] * N
t = [0] * N
can_list = []
for i in range(N):
    c[i], t[i] = map(int, input().split())
    if t[i] <= T:
        can_list.append(c[i])
if len(can_list) == 0:
    print('TLE')
else:
    result = min(can_list)
    print(result)

Measured memory_bytes: 3060
n_blue = int(input())
blue_str = []
red_str = []
blue_count = []
red_count = []
maxi = 0
for _ in range(n_blue):
    blue_str.append(input())
n_red = int(input())
for _ in range(n_red):
    red_str.append(input())
kind = list(set(blue_str))
for i in kind:
    blue_count.append(blue_str.count(i))
    red_count.append(red_str.count(i))
for i in range(len(blue_count)):
    tmp = blue_count[i] - red_count[i]
    maxi = max(maxi, tmp)
print(max(0, maxi))

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

#define x first
#define y second
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;

const int N = 1000010;


string s;
int w;

int main() {
	cin >> s>> w;
	string a = "";
	for (int i = 0; i < s.size(); i += w){
		a += s[i];
	}
	cout << a << endl;
	return 0;
}

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

int G[1500][1500];
int dp[1500][1500];

int main() {
    int W, H; cin >> H >> W;
    int ans = 0;
    rep(i, H){
        rep(j, W){
            cin >> G[i][j];
            dp[i][j] = (G[i][j]+1) % 2;
            ans = max(ans, dp[i][j]);
        }
    }

    for (int i = 1; i < H; i++){
        for (int j = 1; j < W; j++){
            if(dp[i][j] != 0){
                dp[i][j] = min(dp[i][j-1], min(dp[i-1][j], dp[i-1][j-1])) + 1;
                ans = max(ans, dp[i][j]);
            }
        }
    }

    cout << ans*ans << endl;

    return 0;
}


Measured memory_bytes: 19524
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;


using real = double;
static constexpr real EPS = 1e-10;
struct Point3 {
    real x, y, z;
    Point3& operator+=(const Point3 a) { x += a.x; y += a.y; z += a.z;  return *this; }
    Point3& operator-=(const Point3 a) { x -= a.x; y -= a.y; z -= a.z; return *this; }
    Point3& operator*=(const real k) { x *= k; y *= k; z *= k;  return *this; }
    Point3& operator/=(const real k) { x /= k; y /= k; z /= k; return *this; }
    Point3 operator+(const Point3 a) const {return Point3(*this) += a; }
    Point3 operator-(const Point3 a) const {return Point3(*this) -= a; }
    Point3 operator*(const real k) const {return Point3(*this) *= k; }
    Point3 operator/(const real k) const {return Point3(*this) /= k; }
    Point3 (real a = 0, real b = 0, real c = 0) : x(a), y(b), z(c) {};
};

inline real dot(Point3 a, Point3 b){ return a.x*b.x + a.y*b.y + a.z*b.z; }
inline real abs(Point3 a){ return sqrt(dot(a, a)); }
inline Point3 cross(Point3 a, Point3 b){ return {a.y*b.z-a.z*b.y, a.z*b.x-a.x*b.z, a.x*b.y-a.y*b.x};  }

istream& operator>> (istream& s, Point3& P){
    s >> P.x >> P.y >> P.z;
    return s;
}

struct Plane{
    real a, b, c, d;
    Plane(real a, real b, real c, real d) : a(a), b(b), c(c), d(d){};
    Plane(Point3 P, Point3 Q, Point3 R){
        auto X = cross(Q-P, R-P);
        a = X.x, b = X.y, c = X.z;
        d = -(P.x*a+P.y*b+P.z*c);
    }
};

Point3 crossPoint(Point3 X, Point3 Y, Plane P){
    Y -= X;
    double t = -(Y.x*P.a+Y.y*P.b+Y.z*P.c)/(X.x*P.a+X.y*P.b+X.z*P.c+P.d);
    return X + Y*t;
}

int main() {
    Point3 X, Y, a, b, c;
    cin >> X >> Y >> a >> b >> c;
    Plane P(a, b, c);
    Y -= X;
    double t = -(X.x*P.a+X.y*P.b+X.z*P.c+P.d)/(Y.x*P.a+Y.y*P.b+Y.z*P.c);
    if(t < -EPS || 1+EPS < t){
        puts("HIT");
        return 0;
    }
    Point3 K = X+Y*t;
    Point3 AA = cross(b-a, K-b), BB = cross(c-b, K-c), CC = cross(a-c, K-a);
    if(dot(AA, BB) > -EPS && dot(AA, CC) > -EPS) puts("MISS");
    else puts("HIT");
    return 0;
}


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

int main(void){
 
    int R;
    cin >> R;
    
    if(R <1200){
        cout << "ABC" << endl;
    }
    else if(R <2800){
        cout << "ARC" <<endl;
    }
    else{
        cout <<"AGC" <<endl;
    }
}

Measured memory_bytes: 3604
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect_left
from heapq import heappush, heappop
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import floyd_warshall

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, X = MAP()

print(3*(N-gcd(N, X)))


Measured memory_bytes: 23916
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<string>
#include<math.h>
#include<vector>
#include<iomanip>
using namespace std;

long long int gcd(long long int x, long long int y)
{
	if (y == 0) { return x; }
	return gcd(y, x % y);
}

int main(void)
{
	bool judge = true;
	int n;
	string s;
	cin >> n >> s;
	if (n % 2 != 0) { judge = false; }
	else
	{
		for (int i = 0; i < n / 2; i++)
		{
			if (s[i] != s[i + n / 2]) { judge = false; }
		}
	}
	if (judge) { cout << "Yes" << endl; }
	else { cout << "No" << endl; }
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
# define mod 1000000007
# define INF (1 << 29)
# define MAX_N 1000010


struct edge{
    int u;
    int v;
    int cost;
};

// 辺のコストの比較関数(クラスカル法で使う)
bool comp(const edge& e1, const edge& e2){
    return e1.cost < e2.cost;
}

// Union-Find Tree(クラスカル法で使う)
class UnionFind{
    private:
        int par_[MAX_N];
        int rank_[MAX_N];
        int groups_;
    
    public:
        void init(int n){ // initializes the tree 
            for(int i=0; i<n; i++){
                par_[i] = i;
                rank_[i] = 0;
            }
            groups_ = n;
        } 
        int rootOf(int x){ // returns the root of x 
            if(par_[x] == x){
                return x;
            }
            else{
                return par_[x] = rootOf(par_[x]);
            }
        } 
        void unite(int x, int y){ // unites x and y 
            x = rootOf(x);
            y = rootOf(y);
            if(x == y) return;
            if(rank_[x] < rank_[y]){
                par_[x] = y;
                groups_--;
            }
            else{
                par_[y] = x;
                groups_--;
                if(rank_[x] == rank_[y]) rank_[x]++;
            }
        }
        bool isSameGroupe(int x, int y){ // whether x and y are united
            return rootOf(x) == rootOf(y);
        }
        int countGroups(){ // returns the number of groups
            return groups_;
        }
};

int main(void){
    int n;
    cin >> n;
    vector<pair<int,int> > vx;
    vector<pair<int,int> > vy;
    for(int i=0; i<n; i++){
        int x, y;
        cin >> x >> y;
        vx.push_back(make_pair(x, i));
        vy.push_back(make_pair(y, i));
    }
    sort(vx.begin(), vx.end());
    sort(vy.begin(), vy.end());

    vector<edge> es;
    // x 座標で隣り合う点どうしに辺を張る
    for(int i=0; i<n-1; i++){
        edge tmp_e;
        tmp_e.u = vx[i].second;
        tmp_e.v = vx[i+1].second;
        tmp_e.cost = (vx[i+1].first - vx[i].first);
        es.push_back(tmp_e);
    }
    // y 座標で隣り合う点どうしに辺を張る
    for(int i=0; i<n-1; i++){
        edge tmp_e;
        tmp_e.u = vy[i].second;
        tmp_e.v = vy[i+1].second;
        tmp_e.cost = (vy[i+1].first - vy[i].first);
        es.push_back(tmp_e);
    }

    // ここからクラスカル法
    sort(es.begin(), es.end(), comp);
    UnionFind tree; 
    tree.init(n);
    int ans = 0;
    for(int i=0; i<es.size(); i++){
        edge e = es[i];
        if(!tree.isSameGroupe(e.u, e.v)){
            tree.unite(e.u, e.v);
            ans += e.cost;
        }
    }

    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 11748
n = int(input())
m = int(input())

cars_in = m
max_cars_in = cars_in

is_negative = False

for i in range(n) :
    a, b = map(int, input().split())
    cars_in = cars_in + a - b
    max_cars_in = max(max_cars_in, cars_in)

    if cars_in < 0 :
        is_negative = True
        
if is_negative :
    print(0)
else :
    print(max_cars_in)
    


Measured memory_bytes: 5612
#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
#define rep(i, n) for (int i = 0; i < ((int)(n)); i++) // 0-indexed昇順

int main()
{
  int W, a, b;
  cin >> W >> a >> b;
  if (a < b) {
    if (a + W >= b)
      cout << 0 << endl;
    else
      cout << b - (a + W) << endl;
  } else {
    if (b + W >= a)
      cout << 0 << endl;
    else
      cout << a - (b + W) << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
typedef long long ll;
typedef unsigned long long ull;
const ll mod = 1e9 + 7;
const ll inf = 9223372036854775;
const ll mininf = -9223372036854775807;
const ll nax = 1e5 + 5;

ll val[nax], weight[nax], n, w, sum;
vector<ll> dp(nax, inf);

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

  cin >> n >> w;
  for (ll i = 0; i < n; i++){
    cin >> weight[i] >> val[i];
    sum += val[i];
  }
  dp[0] = 0;
  for (ll i = 0; i < n; i++){
    for (ll j = sum; j >= 0; j--){
      if (j - val[i] >= 0){
        dp[j] = min(dp[j], dp[j - val[i]] + weight[i]);
      }
    }
  }
  for (ll i = sum; i >= 0; i--){
    if (dp[i] <= w){
      cout << i << '\n';
      break;
    }
  }
}
  

Measured memory_bytes: 1024
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	sc.Split(bufio.ScanWords)

	n := nextInt()
	a := nextInt()
	b := nextInt()

	if n == 2 {

	}

	// if n == 2 && a%2 == 1 && b%2 == 0 {
	// 	fmt.Println("Draw")
	// 	return
	// }

	if a%2 == 0 && b%2 == 0 {
		fmt.Println("Alice")
	} else if a%2 == 1 && b%2 == 0 {
		fmt.Println("Borys")
	} else if a%2 == 1 && b%2 == 1 {
		fmt.Println("Alice")
	} else if a%2 == 0 && b%2 == 1 {
		fmt.Println("Borys")
	}
}


Measured memory_bytes: 640
using System;
using System.Collections.Generic;
using System.Linq;
 
static class Program
{
    static void Main(string[] args)
    {
        var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
        Console.SetOut(sw);

        //入力
        var H = long.Parse(Console.ReadLine());

        //処理
        var result = Cal(H);
        
        Console.WriteLine(result);

        Console.Out.Flush();
    }
    static long Cal(long n)
    { 
      if(n == 1) return 1;
      return 2 * Cal(n / 2) + 1;      
    }

}

Measured memory_bytes: 13140
from functools import lru_cache
import numpy as np

N = int(input())
A = np.array(list(map(int, input().split(' '))))
i = np.arange(1, N + 1)

right = 10 ** 10
left = -1 * right


@lru_cache(maxsize=None)
def cost(b):
    return np.sum(np.abs(A - (i + b)))


while True:
    mid = (left + right) // 2
    c_left = cost(left)
    c_right = cost(right)
    if left == mid or right == mid:
        print(min(c_left, c_right))
        break
    elif c_left < c_right:
        right = mid
    else:
        left = mid


Measured memory_bytes: 49684
fn get_input() -> String {
    let mut word = String::new();
    std::io::stdin().read_line(&mut word).unwrap();
    word.trim().to_owned()
}

fn main() {
    let (n,m,c) = {
        let line = get_input();
        let mut split = line.split_whitespace();
        let n:usize = split.next().unwrap().parse().unwrap();
        let m:usize = split.next().unwrap().parse().unwrap();
        let c:i64 = split.next().unwrap().parse().unwrap();
        (n,m,c)
    };

    let b:Vec<i64> = get_input().split_whitespace().map(|x| x.parse().unwrap()).collect();

    let mut a = vec![vec![0;m]; n];
    for i in 0..n {
        a[i] = get_input().split_whitespace().map(|x| x.parse().unwrap()).collect();
    }

    let mut ans = 0;
    for i in 0..n {
        let s = (0..m).map(|x| a[i][x] * b[x]).collect::<Vec<i64>>().iter().sum::<i64>();
        if s + c > 0 {
            ans += 1;
        }
    }
    println!("{}", ans);
}

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

#define pb         push_back

typedef long long ll;
const ll INF = 1000000000ll;
const ll MOD = 1000000007ll;
const double EPS = 1e-8;

int main(void) {
	//ios_base::sync_with_stdio(false);
	//cin.tie(0);
	
	ll n, m;
	cin >> n >> m;

	ll ans = 0;
	if(m - 2*n >= 0){
		m = m - 2*n;
		ans = n;
	}else{
		ans = m/2; 
		cout << ans << endl;
		return 0;
	}

	ans += m/4;

	cout << ans << endl;
	
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define FOR(i,a,b) for (register int i=(a);i<=(b);i++)
#define For(i,a,b) for (register int i=(a);i>=(b);i--)
#define mem(i,j) memset(i,j,sizeof(i))
#define GO(u) for (register int j=f[u];j!=-1;j=nxxt[j])
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define MP make_pair
using namespace std;
typedef long long ll;
const int N=2e5+5;
int n,tmp1,tmp2,k,vv[N],p[N],col[N],tag[N],ans[N];
int tot=0,f[N],nxxt[N<<1];
struct E
{
	int u,v;
}e[N<<1];
inline void add(int u,int v)
{
	tot++;
	nxxt[tot]=f[u];
	f[u]=tot;
	e[tot]=(E){u,v};
	return;
}
inline int read()
{
	int x=0,f=1;
	char c=getchar();
	while (c<'0'||c>'9') {if (c=='-') f=-1;c=getchar();}
	while (c>='0'&&c<='9') {x=(x<<1)+(x<<3)+c-'0';c=getchar();}
	return f*x;
}
inline void write(int x)
{
	if (x<0) putchar('-'),x=-x;
	if (x>9) write(x/10);
	putchar(x%10+'0');
	return;
}
struct data
{
	int first,siz;
	inline data work()
	{
		data ret;
		ret.first=first-1;
		ret.siz=siz+1;
		return ret;
	}
	inline void merge(data x)
	{
		if (first==-1&&siz==-1) {first=x.first;siz=x.siz;return;}
		if (((x.first+2*n)%2)!=((first+2*n)%2)) {first=0;siz=0;return;}
		int min1=first,max1=first+(siz-1)*2,min2=x.first,max2=x.first+(x.siz-1)*2;
		int mn=max(min1,min2),mx=min(max1,max2);
		if (mn>mx) {first=0,siz=0;return;}
		first=mn;
		siz=(mx-mn)/2+1;
		return;
	}
	inline void Print()
	{
		write(first),putchar(' '),write(siz),putchar('\n');
		return;
	}
}s[N];
inline void no()
{
	printf("No\n");
	exit(0);
}
inline data dfs(int u,int fa)
{
	if (s[u].siz==0) no();
	data tmp,ret;
	data nxt=s[u].work();
	GO(u)
	{
		int v=e[j].v;
		if (v==fa) continue;
		s[v].merge(nxt);
		tmp=dfs(v,u);
		s[u].merge(tmp);
		if (s[u].siz==0) no();
	}
	ret=s[u].work();
	return ret;
}
inline void debug()
{
	FOR(i,1,n)
	{
		printf("%d : ",i);
		s[i].Print();
	}
	return;
}
inline void confirm(int u,int fa)
{
	if (s[u].first==-1) s[u]=(data){1,1};
	ans[u]=s[u].first;
	s[u].siz=1;
	data nxt=s[u].work();
	GO(u)
	{
		int v=e[j].v;
		if (v==fa) continue;
		s[v].merge(nxt);
		confirm(v,u);
	}
	return;
}
int main()
{
	mem(f,-1);
	n=read();
	FOR(i,1,n-1) tmp1=read(),tmp2=read(),add(tmp1,tmp2),add(tmp2,tmp1);
	k=read();
	FOR(i,1,k) vv[i]=read(),p[i]=read(),col[vv[i]]=p[i],tag[vv[i]]=1,s[vv[i]]=(data){p[i],1};
	FOR(i,1,n) if (!tag[i]) s[i]=(data){-1,-1};
	dfs(vv[1],0);
	confirm(vv[1],0);
	printf("Yes\n");
	FOR(i,1,n) write(ans[i]),putchar('\n');
	return 0;
}

Measured memory_bytes: 14720
//B
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<pii> vii;
const int INF=(int)2e9;
const double PI=(double)acos(-1.0);
const double EPS=(double)1e-9;
const ll MOD=(ll)1e9+7;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pob pop_back
#define pf push_front
#define pof pop_front
#define REPP(i,a,b,c) for(int i=a;i<=b;i+=c)
#define REP(i,a,b) REPP(i,a,b,1)
#define FOR(i,n) REP(i,0,n-1)
#define REVV(i,a,b,c) for(int i=a;i>=b;i-=c)
#define REV(i,a,b) REVV(i,a,b,1)
#define FORD(i,n) REV(i,n-1,0)

char s[100005];

int main(){
	scanf("%[^\n]",s);
	int l=strlen(s);
	FOR(i,l) if(i%2==0)putchar(s[i]);
	puts("");
	return 0;
}

Measured memory_bytes: 384
fun main(args: Array<String>) {
    var n = readLine()!!.toInt()
    val gcdList = Array(n + 1, { arrayOfNulls<Int>(n + 1) }).toMutableList()
    var sum = 0L
    for (i in 1..n) {
        for (j in 1..n) {
            gcdList[i][j] = gcd(i, j)
        }
    }
    for (i in 1..n) {
        for (j in 1..n) {
            for (k in 1..n) {
                sum += gcd(gcdList[i][j]!!, k)
            }
        }
    }
    println(sum)
}

fun gcd(a: Int, b: Int): Int {
    if (b == 0) return Math.abs(a)
    return gcd(b, a % b)
}


Measured memory_bytes: 39284
X = int(input())

def isPrime(n):
    if n == 2:
        return True
    if n == 1 or n % 2 == 0:
        return False
    for p in range(3, int(n**0.5)+1, 2):
        if n % p == 0:
            return False
    return True

while True:
    if isPrime(X):
        print(X)
        exit()
    else:
        X += 1

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

int main(){
	int total[100];
	int n;
	for(int i=0;i<100;i++){
		total[i]=0;
	}

	for(int i1=0;i1<10;i1++){
		for(int i2=0;i2<10;i2++){
			for(int i3=0;i3<10;i3++){
				for(int i4=0;i4<10;i4++){
					total[i1+i2+i3+i4] += 1;
				}
			}
		}
	}
	while(cin>>n){
		cout<<total[n]<<endl;
	}
	return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
#define LL long long
#define PII pair<int,int>
using namespace std;
const int MAXN = 100005;
const int INF = (LL)1e9 + 5;
const LL MOD = 998244353;

int N, M, a[MAXN];
LL st[MAXN], ed[MAXN], sub[MAXN];

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);
	
	LL sum = 0, num = 0, cur = 0;
	cin >> N >> M;
	for (int i = 0; i < N; i++) {
		cin >> a[i];
		a[i]--;
		if (i > 0) {
			int d = a[i] < a[i - 1] ? M - (a[i - 1] - a[i]) : a[i] - a[i - 1];
			st[a[i - 1]]++;
			ed[a[i]]++;
			sub[a[i]] += d;
			sum += d;
			
			if (a[i] < a[i - 1]) {
				num++;
				cur += M - a[i - 1];
			}
		}
	}
	
	LL maxp = 0;
	for (int i = 0; i < M; i++) {
		maxp = max(maxp, cur - num);
//		cout << "At " << i << " -> " << cur << "\n";
		
		num += st[i];
		num -= ed[i];
		cur -= sub[i];
		cur += num;
	}
	
	cout << sum - maxp << "\n";
	
	return 0;
}


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

int n;
int p[11],q[11]; 

bool check(int x[],int y[])
{
	for(int i=1; i<=n; i++)
	{
		if(x[i]!=y[i])
		{
			return false;
		}
	}
	
	return true;
}

int main()
{
	cin>>n;
	int a[n+1];
	
	for(int i=1; i<=n; i++)	cin>>p[i];
	for(int i=1; i<=n; i++)	cin>>q[i];
	for(int i=1; i<=n; i++)	a[i]=i;
	
	int count=0,x=0,y=0;
	do{
		count++;
		if(check(a,p))
			x=count;
		if(check(a,q))
			y=count;
		
		if(x!=0 && y!=0)
			break;
	}while(next_permutation(a+1,a+n+1));
	
	cout<<fabs(x-y)<< endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        String b = scanner.nextLine();

        String ret = "";
        for (char c: b.toCharArray()) {
            switch (c) {
                case 'A':
                    ret += "T";
                    break;
                case 'T':
                    ret += "A";
                    break;
                case 'C':
                    ret += "G";
                    break;
                case 'G':
                    ret += "C";
                    break;
            }
        }
        System.out.println(ret);
    }

}


Measured memory_bytes: 21332
n, m, c = map(int, input().split())
b = list(map(int, input().split()))
code_list = [list(map(int, input().split())) for _ in range(n)]
ans = 0
for code in code_list:
  total = 0
  for i, j in zip(code, b):
    total += i * j 
  if (total + c) > 0:
    ans += 1
print(ans)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin >> s;
  map<char, int> mp;
  for(int i = 0; i < s.size(); i++){
    mp[s[i]]++;
  }
  for(auto x : mp){
     if(x.second % 2 != 0){
       cout << "No" << endl;
       return 0;
     }
  }
  cout << "Yes" << endl;
}

Measured memory_bytes: 256
#define _DEBUG 1
#define _GLIBCXX_DEBUG

#include <bits/stdc++.h>
using namespace std;

using ll = long long;

#ifdef _DEBUG
#define dump(x) cerr << #x << "=" << x << endl
#define dump2(x, y) cerr << #x << "=" << x << "," << #y << "=" << y << endl
#define dump3(x, y, z)                                                         \
  cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z     \
       << endl
#define check(s) cerr << s << endl
#else
#define dump(x)
#define dump2(x, y)
#define dump3(x, y, z)
#define check(s)
#endif

#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define unique(v) v.erase(unique(v.begin(), v.end()), v.end());

const ll LINF = 2e18;
const int INF = 1e9;

void solve(ll R) { cout << 2.000 * M_PI * R << endl; }

int main() {
  ll R;
  scanf("%lld", &R);
  solve(R);
  return 0;
}


Measured memory_bytes: 3852
// C++ program to count the Minimum number of 
// increasing subsequences 
#include <bits/stdc++.h> 
using namespace std; 

int MinimumNumIncreasingSubsequences(int arr[], int n) 
{ 
	multiset<int> last; 

	// last element in each increasing subsequence 
	// found so far 
	for (int i = 0; i < n; i++) { 

		// here our current element is arr[i] 
		multiset<int>::iterator it = last.lower_bound(arr[i]); 

		// iterator to the first element larger 
		// than or equal to arr[i] 
		if (it == last.begin()) 

			// if all the elements in last larger 
			// than or to arr[i] then insert it into last 
			last.insert(arr[i]); 

		else { 
			it--; 

			// the largest element smaller than arr[i] is the number 
			// before *it which is it-- 
			last.erase(it); // erase the largest element smaller than arr[i] 
			last.insert(arr[i]); // and replace it with arr[i] 
		} 
	} 
	return last.size(); // our answer is the size of last 
} 

// Driver program 
int arr[100000+10];
int main() 
{ 
	int N;cin>>N;
  //array<int,N>arr;
  for(int i=0;i<N;++i)cin>>arr[i];
  //int n = sizeof(arr) / sizeof(int); 
	//cout << "Minimum number of increasing subsequences are : "
	 cout<<MinimumNumIncreasingSubsequences(arr, N)<<"\n"; 
	return 0; 
} 



Measured memory_bytes: 5376
using System;
using System.Linq;

namespace id_2259cs
{
    class Program
    {
        static void Main(string[] args)
        {
            var vs = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            var m = vs[0];
            var maxCount = 0;
            foreach(var i in Enumerable.Range(0, m))
            {
                var tmp = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
                maxCount = Math.Max(tmp.Where(x => x == 1).Count(), maxCount);
            }
            Console.WriteLine(maxCount);
        }
    }
}



Measured memory_bytes: 18484
def insertion_sort(a,n,g):
  global cnt
  for i in range(g,n):
    temp = a[i]
    j = i - g
    while j >= 0 and a[j] > temp:
      a[j + g] = a[j]
      j = j - g
      cnt += 1
    a[j+g] = temp
    
def shell_sort(a,n):
  h = 1
  g = []
  while h <= n:
    g.append(h)
    h = h * 3 + 1
  m = len(g)
  g = g[::-1]
  for i in range(m):
    insertion_sort(a,n,g[i])
  print(m)
  print(' '.join(map(str,g)))
  print(cnt)
  [print(i) for i in a]
    
num = int(input())
a = []
cnt = 0
for i in range(num):
  a.append(int(input()))
shell_sort(a,num)
print(cnt)


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

#ifdef LOCAL
	#define D(a) cerr << #a << " = " << a << endl
#else
	#define D(a)
	#define cerr false && cerr
#endif
#define fastio ios_base::sync_with_stdio(0); cin.tie(0)
#define dforsn(i,s,n) for(int i=int(n-1);i>=int(s);i--)
#define forsn(i,s,n) for(int i=int(s);i<int(n);i++)
#define dforn(i,n) dforsn(i,0,n)
#define forn(i,n) forsn(i,0,n)
#define all(a) a.begin(),a.end()
#define si(a) int((a).size())
#define pb emplace_back
#define mp make_pair
#define snd second
#define fst first
#define endl '\n'
using pii = pair<int,int>;
using vi = vector<int>;
using ll = long long;

int main() {
	fastio;
	
    int a,b,t; cin >> a >> b >> t;
    cout << t/a * b << endl;
	
	return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
  #pragma GCC target("avx,avx2,fma")
  #pragma GCC optimization ("unroll-loops")
  #include <bits/stdc++.h>
  using namespace std;
  //---------------------------------//
  void __print(int x) {cerr << x;}
  void __print(long x) {cerr << x;}
  void __print(long long x) {cerr << x;}
  void __print(unsigned x) {cerr << x;}
  void __print(unsigned long x) {cerr << x;}
  void __print(unsigned long long x) {cerr << x;}
  void __print(float x) {cerr << x;}
  void __print(double x) {cerr << x;}
  void __print(long double x) {cerr << x;}
  void __print(char x) {cerr << '\'' << x << '\'';}
  void __print(const char *x) {cerr << '\"' << x << '\"';}
  void __print(const string &x) {cerr << '\"' << x << '\"';}
  void __print(bool x) {cerr << (x ? "true" : "false");}

  template<typename T, typename V>
  void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
  template<typename T>
  void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
  void _print() {cerr << "]\n";}
  template <typename T, typename... V>
  void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
  #ifndef ONLINE_JUDGE
  #define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
  #else
  #define deb(x...)
  #endif
 //------------------------------//

  typedef long long int ll;
  typedef pair<int,int> pi;
  typedef pair<ll,ll> pll;
  typedef vector<int> vi;
  typedef vector<ll> vll;
  typedef vector<pi> vpi;
  typedef vector<pll> vpll;

  #define  ff           first
  #define  ss           second
  #define  pb           push_back
  #define  IOS          ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
  #define  all(x)       (x).begin(), (x).end()
  #define  ps(x,y)      fixed<<setprecision(y)<<x
  #define  rep(i,a,b)   for(ll i=a ; i<b ; ++i)

  const ll MOD = 1e9 + 7;
  const ll INF = 1e18;
  const ll maxn = 1e6 + 4;


  void solve(){
		int n;
		cin >> n;
		vi v(n);
		for(int i=0;i<n;i++)cin >> v[i];
		int ans=0;
		for(int i=0;i<n;i++){
			for(int j=i+1;j<n;j++){
				for(int k=j+1;k<n;k++){
					set<int> s;
					s.insert(v[i]);
					s.insert(v[j]);
					s.insert(v[k]);
					if(s.size()==3){
						int k = *(s.begin());
						int o = *(++s.begin());
						int l = *(--s.end());
						if(k+o>l)ans++;
					}
				}
			}
		}
		cout << ans;	
  }

  int main(){
    IOS
    	solve();
    //cerr <<endl <<"[ Time : " << (float)clock() / CLOCKS_PER_SEC << " secs ]" << endl;
  }

// integer overflow
// remember to clear visited array
// take input as vector<string> while using grid
// don't assign after modifying

Measured memory_bytes: 3656
#include<bits/stdc++.h>
using namespace std;
#define int long long 
#define ii pair <int, int>
#define app push_back
#define all(a) a.begin(), a.end()
#define bp __builtin_popcount
signed main() {
    #ifdef HOME
    freopen("input.txt", "r", stdin);
    #else
    ios_base::sync_with_stdio(0); cin.tie(0);
    #endif
    vector <int> cnt;
    string s; cin >> s;
    int n = s.size();
    int c = 1;
    for (int i = 1; i < n; ++i) {
        if (s[i] != s[i - 1]) { cnt.app(c); c = 1; }
        else ++c;
    }
    cnt.app(c);
    int ans = 0;
    for (int i = 0; i < cnt.size(); ++i) {
        if (cnt[i] % 3 == 2) {
            if (i + 1 < cnt.size()) { ans += 2 * (cnt[i] / 3) + 2; --cnt[i + 1]; }
            else ans += 2 * (cnt[i] / 3) + 1;
        }   
        else ans += 2 * (cnt[i] / 3) + (cnt[i] % 3);
    }
    cout << ans << '\n';
}   

Measured memory_bytes: 2700
#include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define itrep(it, a) for(it = (a).begin(); it != (a).end(); it++)
#define all(a) (a).begin(), (a).end()
#define debug(x) cout << "debug " << x << endl;
#define INF (1 << 30)
using namespace std;

int main(){
    string inp, str;
    stack<char> sc;
    cin >> inp;
    rep(i,inp.size()){
        if(inp[i] == 'B'){
            if(not sc.empty()) sc.pop();
        }else{
            sc.push(inp[i]);
        }
    }
    while(not sc.empty()){
        str+=sc.top();
        sc.pop();
    }
    for(int i = str.size() - 1; i >= 0; i--) cout << str[i];
    cout << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <numeric>
#include <algorithm>
#include <math.h>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;
int main(){
string s;
cin >> s;
int s_size;
s_size = s.size();
int long long count1=0,count2=0;
string ans1,ans2;
for(int i = 0; i < s_size; ++i){
    if(i%2 ==0) ans1.push_back('0');
    else ans1.push_back('1');
    if(ans1[i] != s[i]) count1++;
}
for(int i = 0; i < s_size; ++i){
    if(i%2 == 0) ans2.push_back('1');
    else ans2.push_back('0');
    if(ans2[i] != s[i]) count2++;
}
if(count1>count2) cout << count2 << endl;
else cout << count1 << endl;

}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int N,M,X,Y;
    cin >> N >> M >> X >> Y;
    vector<int> cityX(N);
    vector<int> cityY(M);

    for (int i = 0;i<N;i++){
        cin >> cityX.at(i);
    }
    for (int j = 0;j<M;j++){
        cin >> cityY.at(j);
    }
    
    sort(cityX.begin(), cityX.end());
    reverse(cityX.begin(), cityX.end());

    sort(cityY.begin(), cityY.end());

    int low = cityX.at(0);
    int high = cityY.at(0);

    //bool war = true;
    if (low - X > 0 && Y - high >= 0){
        if (high - low > 0){
            cout << "No War" << endl;
        }
      	else{
        	cout << "War" << endl;
        }
    }
    else{
        cout << "War" << endl;
    }

    if (high - low >= 1){

    }

}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
using namespace std;
typedef long long int ll;

char S[222222];
int memo1[222222];

int main(){
	scanf("%s", S);
	ll res = 0LL;
	for(int i = 0; i < strlen(S); i++){
		if(S[i] == 'B') memo1[i + 1] = memo1[i] + 1;
		if(S[i] == 'W'){
			res += memo1[i];
			memo1[i + 1] = memo1[i];
		}
	}
	printf("%lld\n", res);
	return 0;
}


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

int main(){
    ll a,b,c,ans;
    cin >> a >> b >> c;
    if((a*b*c)%2==0) ans = 0;
    else ans = min(a*b,min(b*c,c*a));
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<iostream>
#include<numeric>
#include<queue>
#include<sstream>
#include<stack>
#include<string>
#include<unordered_set>
#include<vector>

#define ll long long
#define P pair<int,int>
#define FOR(i,N) for(int i=0;i<(int)N;i++)
#define FORIN(i,a,b) for(int i=a;i<(int)b;i++)
#define ALL(x) (x).begin(),(x).end()
#define LAST(x) (x)[(x).size()-1]

using namespace std;

string to_hex(int x){
    stringstream ss;
    ss<<hex<<x;
    return ss.str();
}

inline int get_int(){
    int ret;
    scanf("%d",&ret);
    return ret;
}

inline vector<int> get_ints(int n){
    vector<int> ret(n);
    FOR(i,n){
        scanf("%d",&ret[i]);
    }
    return ret;
}

inline string get_str(){
    string ret;
    cin>>ret;
    return ret;
}

bool is_prime(int n){
    int s=sqrt(n)+1;
    for(int i=2;i<=s;++i){
        if(n%i==0){
            return 0;
        }
    }
    return 1;
}

vector<P> prime_division(int n){
    vector<P> ret;
    int s=sqrt(n)+1;
    int c=0;
    for(int i=2;i<=s;++i){
        if(n%i==0){
            c=0;
            do{
                ++c;
                n/=i;
            }while(n%i==0);
            ret.push_back(P(i,c));
        }
    }
    return ret;
}

string to_string(string s){
    return s;
}

template<class T>
string to_string(vector<T> v){
    string ret="{";
    FOR(i,v.size()-1){
        ret+=to_string(v[i])+",";
    }
    if(v.size()>0){
        ret+=to_string(LAST(v));
    }
    ret+="}";
    return ret;
}

void debug(){
    cerr<<endl;
}

template<class Head,class... Tail>
void debug(Head head,Tail... tail){
    cerr<<" "<<to_string(head);
    debug(tail...);
}

int main(){
    int Q=get_int();
    bool table[100001];
    FOR(i,100001)table[i]=1;
    int s=sqrt(100001)+1;
    for(int i=2;i<s;++i){
        if(table[i]){
            for(int j=0;i*(j+2)<100001;++j){
                table[i*(j+2)]=0;
            }
        }
    }
    bool like[100001];
    for(int i=1;i<100001;i+=2){
        if(table[i]&&table[(i+1)/2]){
            like[i]=1;
        }
    }
    int count[100001];
    count[1]=1;
    for(int i=3;i<100001;i+=2){
        if(like[i]){
            count[i]=count[i-2]+1;
        }else{
            count[i]=count[i-2];
        }
    }
    FOR(i,Q){
        int l,r;
        cin>>l>>r;
        cout<<count[r]-(l==1?1:count[l-2])<<endl;
    }
    return 0;
}

Measured memory_bytes: 1280
import bisect
N = int(input())
lst = list(map(int, input().split()))
lst.sort()
total = 0
for i in range(N-1):
    for j in range(i+1, N-1):
        x = bisect.bisect_left(lst, lst[i]+lst[j])
        total += x-j-1
print(total)

Measured memory_bytes: 3316
#include<cstdio>
#include<stdlib.h>
#include<algorithm>
#include<iostream>
#include<string>
#include<cstring>
#include<map>
#include<vector>
#include<queue>
#include<math.h>
#include<climits>
#include<set>
#include<sstream>
#include<time.h>

#define debug(x) cout <<#x<<" = "<<x<<endl
#define debug2(x, y) cout<<#x<<" = "<<x<<", "<<#y<<" = "<<y<<endl
#define gg cout <<"---------------QAQ---------------"<<endl
#define fi first
#define SZ(x) (int)x.size()
#define se second
#define pb push_back
#define MEM(a) memset(a, 0, sizeof(a))
#define inf 0x3f3f3f3f
#define lson l, m, rt<<1
#define rson m+1, r, rt<<1|1
#define PI acos(-1)
#define endl "\n"
#define eps 1e-8
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<pii, ll> Pii;
template<class T> inline void read(T &x){
    x=0; char c=getchar(); int f=1;
    while (!isdigit(c)) {if (c=='-') f=-1; c=getchar();}
    while (isdigit(c)) {x=x*10+c-'0'; c=getchar();} x*=f;
}
const int N = 2e5+10, maxn = 1e6+10;
void FAST(){ios::sync_with_stdio(false);cin.tie(nullptr); cout.tie(nullptr);}
const ll mod =  998244353;

int n, m, k;
int a[N];

void solve()
{
    scanf("%d%d", &n, &m);
    printf("%d", n*m);
}

int main()
{
//    FAST();
//    init();
//    int _;scanf("%d", &_); while(_--)
//    while(scanf("%d", &n)&&n)
//    while(scanf("%d%d%d", &n, &m, &k)&&(n+m+k))
    solve();
    return 0;
}


Measured memory_bytes: 3760
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define reps(i, n) for (int i = 1, i##_len = (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 rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define repc2(i, s, n) for (int i = (s); i <= (int)(n); i++)
#define inf 2e9
#define linf 9000000000000000000ll
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int n, W;
int v[101], w[101];
ll dp[101][100001];

ll rec(int i, int j) {
    if (i == 0 || j == 0) return 0;
    if (dp[i][j] != -1) return dp[i][j];
    if (j - w[i] >= 0) return dp[i][j] = max(rec(i - 1, j), rec(i - 1, j - w[i]) + v[i]);
    return dp[i][j] = rec(i - 1, j);
}
int main() {
    memset(dp, -1, sizeof(dp));
    cin >> n >> W;
    reps(i, n) cin >> w[i] >> v[i];
    cout << rec(n, W) << endl;
    return 0;
}

Measured memory_bytes: 79232