akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>
#include<iostream>
#include<vector>
#include<math.h>
#include<queue>
#include<map>
#include<algorithm>
#include<string.h>
#include<functional>
#include<limits.h>
#include<stdlib.h>
#include<string>
#include<unordered_map>
#include <iomanip>
using namespace std;
 
#define intmax INT_MAX
#define lmax LONG_MAX
#define uintmax UINT_MAX
#define ulmax ULONG_MAX
#define llmax LLONG_MAX
#define ll long long
#define rep(i,a,N) for((i)=(a);(i)<(N);(i)++)
#define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--)
#define llfor ll i,j,k
#define sc(a) cin>>a
#define pr(a) cout<<a<<endl
#define pY puts("YES")
#define pN puts("NO")
#define py puts("Yes")
#define pn puts("No")
#define pnn printf("\n")
#define sort(a) sort(a.begin(),a.end())
#define push(a,b) (a).push_back(b)
#define llvec vector<vector<ll>>
#define charvec vector<vector<char>>
#define sizeoof(a,b) (a,vector<ll>(b))
#define llpvec vector<pair<ll,ll>>
/*繰り上げ除算*/ll cei(ll x,ll y){ll ans=x/y;if(x%y!=0)ans++;return ans;}
/*最大公約数*/ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
/*最小公倍数*/ll lcm(ll x,ll y){return x/gcd(x,y)*y;}
/*n乗*/ll llpow(ll x,ll n){ll i,ans=1;rep(i,0,n)ans*=x;return ans;}
/*階乗*/ll fact(ll x){ll i,ans=1;rep(i,0,x)ans*=(x-i);return ans;}
/*nCr*/ll ncr(ll n,ll r){return fact(n)/fact(r)/fact(n-r);}
/*nPr*/ll npr(ll n,ll r){return fact(n)/fact(n-r);}
/*primejudge*/bool prime(ll a){if(a<=1)return false;ll i;for(i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}
ll ans=0;llfor;///////////////////////////////////////////////////////////
int main(){
  string S;
  cin>>S;
  int N=S.size();
  if(N==2) cout<<S;
  else cout<<S[2]<<S[1]<<S[0];
return 0;}


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

int main(){
  int N;
  cin >> N;
  string S;
  cin >> S;
  char c;
  rep(i,S.size()){
    if(S[i]+N<='Z') c = S[i]+N;
    else c = S[i]+N-'Z'+'A'-1;
    cout << c;
  }
  cout << endl;
  return 0;
}


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

int N, M;
const int N_MAX = 1e5;

int main(){
  cin >> N >> M;
  queue<int> que;
  que.push(M);
  for(int i = M/2; i >= 1; i--){
    if(M % i == 0) que.push(i);
  }
  
  while(!que.empty()){
    int n = que.front(); que.pop();
    if(M / n >= N) {
      cout << n << endl;
      break;
    }
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int N=2e5+5;
ll n,A[N];
ll sum1[N],sum2[N];
int main()
{
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>A[i];
		sum1[i]=sum1[i-1]^A[i];
		sum2[i]=sum2[i-1]+A[i];
	}
	ll ans=0;
	for(int l=1,r=0;l<=n&&r<=n;l++)
	{
		if(l>r) r=l;
		while((sum1[r]^sum1[l-1])==sum2[r]-sum2[l-1]&&r<=n)
		{
			r++;
		}
		r--;
		ans+=r-l+1;		
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 4992
package main

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

var in = bufio.NewScanner(os.Stdin)

func main() {
	var p int
	in.Scan()
	n := atoi(in.Text())
	in.Scan()
	h := atoi(in.Text())
	in.Scan()
	w := atoi(in.Text())
	for i := 0; i < n; i++ {
		for j := 0; j < n; j++ {
			if i+h <= n && j+w <= n {
				p++
			}
			if j+w > n {
				break
			}
		}
		if i+h > n {
			break
		}
	}
	fmt.Println(p)
}

func atoi(s string) int {
	i, err := strconv.Atoi(s)
	if err != nil {
		panic(err)
	}
	return i
}


Measured memory_bytes: 640
solve :: [Int] -> String
solve (a:b:c:d:_)
  | l > r     = "Left"
  | l < r     = "Right"
  | otherwise = "Balanced"
  where l = a + b
        r = c + d

infixl 1 |>
x |> f = f x

main = do
  str <- getLine
  str |> words |> map read |> solve |> putStrLn

Measured memory_bytes: 508
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<queue>
#include<map>
#include<bitset>
#include<vector>
#include<deque>
using namespace std;
#define re register int
inline int read(){
	int x=0,ff=1;char c=getchar();
	while(c<'0'||c>'9'){if(c=='-')ff=-1;c=getchar();}
	while(c>='0'&&c<='9'){x=(x<<1)+(x<<3)+(c^48);c=getchar();}
	return x*ff;
}
string a,b;
int main(){
	cin>>a>>b;
	cout<<b<<a<<endl;
	return 0;
}
 

Measured memory_bytes: 256
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <queue>
#include <string>
#include <set>
#include <map>
#define REP(i,n) for(ll i = 0; i < (ll)n; i++)
#define INF 1000000000000000
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;

int main(){
  ll n; cin >> n;
  ll sum_round = 0;
  ll a[n];
  REP(i,n){
    cin >> a[i];
    sum_round += a[i];
  }
  ll b[2*n];
  REP(i,2*n){
    if(i==0) b[i] = 0;
    else b[i] = a[i%n] + b[i-1];
  }
  ll lb = 0, ub = sum_round;
  ll mid;
  while(ub-lb>1){
    mid = (ub+lb)/2;
    ll upper[n];
    ll r = 0;
    for(ll l = 0; l < n; l++){
      while(b[r]-b[l]<mid&&r<2*n) r++;
      upper[l] = r;
      if(l==r) r++;
    }
    bool ok = false;
    REP(i,n){
      ll first_cut = b[upper[i]]-b[i];
      ll j = upper[i]%n;
      ll next_cut = b[upper[j]]-b[j];
      if(sum_round-first_cut-next_cut>=mid){
        ok = true;
        break;
      }
    }
    if(ok){
      lb = mid;
    }else{
      ub = mid;
    }
  }
  cout << lb << endl;
  return 0;
}



Measured memory_bytes: 6260
#include<iostream>

using namespace std;

int main(){
	int num, num2;
	char a;
	bool flag = 0;

	while(1){
		cin >> num >> a >> num2;
		switch (a){
		case '+':
			cout << num + num2 << endl;
			break;
		case '-':
			cout << num - num2 << endl;
			break;
		case '*':
			cout << num * num2 << endl;
			break;
		case '/':
			cout << num / num2 << endl;
			break;
		case '?':
			flag = 1;
			break;
		default:
			break;
		}
		if(flag == 1) break;
	}
	return 0;
}

Measured memory_bytes: 3044
#include <algorithm>
#include <cmath>
#include <functional>
#include <iostream>
#include <string>
#include <vector>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repR(i, n) for(int i = (n) - 1; i > -1; i--)
#define rep1(i, n) for(int i = 1; i < (int)(n + 1); i++)
#define rep1R(i, n) for(int i = (n); i > 0; i--)
typedef long long ll;
typedef unsigned long long ull;
using namespace std;

int main() {
  int N; cin >> N;
  vector<int> a(N);
  rep(i, N) cin >> a[i];
  int ans = 0;
  rep(i, N) {
    while(a[i] % 2 == 0) {
      ans++;  
      a[i] /= 2;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
import heapq
from collections import defaultdict

read = lambda: map(int, raw_input().strip().split())
n, m = read()
jobs = [read() for _ in xrange(n)]
jobs_by_time = defaultdict(list)
for (a, b) in jobs:
  jobs_by_time[a].append(b)

ans = 0
q = [] # heapq
for t in xrange(0, m):
  day = t+1
  for job in jobs_by_time[day]:
    heapq.heappush(q, -job)
  
  if q:
    val = -heapq.heappop(q)
    ans += val
print ans
   


Measured memory_bytes: 39312
#include<bits/stdc++.h>
#include<string>
#define FIO ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
#define ll long long
#define mod (ll)(1e9+7)
#define nax (ll)(1e5)
#define INFL LLONG_MAX
#define NINFL LLONG_MIN
#define INF INT_MAX
#define disp(a,n,arr) for(int i=a;i<(ll)n;i++) cout << arr[i] << " "; cout << "\n";
#define check cout << "Working\n";
#define pi pair<int,int>
#define pl pair<ll,ll>
#define vi vector<int>
#define vl vector<ll>
#define vpl vector<pl>
#define vpi vector<pi>
#define vb vector<bool>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(a) a.begin(),a.end()
using namespace std;

int main() {
	FIO;
	int t = 1;
	//cin >> t;
	while (t--) {
		ll n,m;
		cin >> n >> m;
		map<ll,ll> mpp;
		for(int i=0;i<n;i++){
			ll a;
			cin >>a;
			mpp[a]++;
		}
		
		for(int j=0;j<m;j++){
			ll b,c;
			cin >> b >> c;
			for(auto i:mpp){
				if(i.fi < c){
					if(mpp[i.fi] > b){
						mpp[i.fi] -= b;
						mpp[c] += b;
						break;
					}else{
						b -= mpp[i.fi];
						mpp[c] += mpp[i.fi];
						mpp.erase(i.fi);
					}
				}else break;
			}
			//cout << mpp.size() << "\n";
		}
		ll ans = 0;
		for(auto i:mpp){
			ans += i.fi * i.se;
		}
		cout << ans << "\n";
	}


	return 0;
}


Measured memory_bytes: 9860
#include <iostream>
using namespace std;
int main(){
 int s, h=0, m=0, sec=0;
 cin >> s;
 h = s/3600;
 m = (s - 3600*h)/60;
 sec = (s - 3600*h)%60;
 cout << h << ":" << m << ":" << sec <<endl;
 return 0;
}

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

#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))
#define rep(i,a,b) for(int (i)=int(a);(i)<int(b);(i)++)
#define rrep(i,a,b) for(int (i)=int(a);(i)>=int(b);(i)--)

#define put(a) cout << (a) << endl
#define puts(a) cout << (a) << " "

#define llint long long int

#define INF (long long)(1e9+1)
#define MOD (long long)(1e9+7)
#define INF64 (long long)(1e18+1)

#define F first
#define S second

#define Pii  pair<int,int>
#define Pll  pair<long long,long long>
#define Piii pair<int,pair<int,int>>
#define Plll pair<long long,pair<long long,long long>>

#define Vll(a,b,c)    vector<vector<long long>> (a)((b),vector<long long>((c))
#define Vlll(a,b,c,d) vector<vector<vector<long long>>> (a)((b),vector<vector<long long>>((c),vector<long long>((d)))

#define MAX_N 1000000

llint my_binary_search(llint ary[], llint key, llint left, llint right) {
	llint middle;
	if (right < left) {
		return -(INF64);
	} else {
		middle = left + (right - left) / 2;
		if (ary[middle] > key) {
			return my_binary_search(ary, key, left, middle - 1);
		} else if (ary[middle] < key) {
			return my_binary_search(ary, key, middle + 1, right);
		} else {
			return middle;
		}
	}
}

struct UnionFind {
	vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

	UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
		for(int i = 0; i < N; i++) par[i] = i;
	}

	int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
		if (par[x] == x) return x;
		return par[x] = root(par[x]);
	}

	void unite(int x, int y) { // xとyの木を併合
		int rx = root(x); //xの根をrx
		int ry = root(y); //yの根をry
		if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
		par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
	}

	bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
		int rx = root(x);
		int ry = root(y);
		return rx == ry;
	}
};

int main (void)
{
	//INPUT
	llint H,A;
	cin >> H >> A;

	llint ans;

	ans = H/A;
	if (H%A==0) {

	} else {
		ans++;
	}

	//OUTPUT
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 3608
#include<iostream>
#include<iomanip>
#include<vector>
#include<map>
#include<set>
#include<algorithm>
#include<numeric>
#include<limits>
#include<bitset>
#include<functional>
#include<type_traits>
#include<queue>
#include<stack>
#include<array>
#include<random>
#include<utility>
#include<cstdlib>
#include<cstring>
#include<string>
#include<ctime>


using namespace std;

using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const double PI = acos(-1.0);
#define YES(n) cout << ((n) ? "YES" : "NO") << endl;
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl;
#define all(v) v.begin(), v.end()
const long MOD = pow(10, 9) + 7;

char alfa[] = { 'A','B' ,'C','D' ,'E' ,'F' ,'G' ,'H' ,'I' ,'J' ,'K' ,'L' ,'M' ,'N' ,'O' ,'P' ,'Q' ,'R' ,'S' ,'T' ,'U' ,'V' ,'W' ,'X' ,'Y','Z' };

inline void finish() {
	cout << -1 << endl;
	exit(0);
}

unsigned GetDigit(unsigned num) {
	return log10(num) + 1;
}

ll modinv(ll a, ll m) {
	ll b = m, u = 1, v = 0;
	while (b) {
		ll t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}

class Mod {
public:
	static inline ll Add(ll a, ll b) {
		return (a + b) % MOD;
	}

	static inline ll Sub(ll a, ll b) {
		ll ans = (a - b) % MOD;
		return (ans < 0) ? (ans + MOD) : ans;
	}

	static inline ll Mul(ll a, ll b) {
		return (a * b) % MOD;
	}

	static inline ll Div(ll a, ll b) {
		return (a % MOD) * modinv(b, MOD) % MOD;
	}
};



template <typename T>
inline void debug(vector<T> v) {
	cout << "[";
	for (ll i = 0; i < v.size() - 1; ++i) {
		cout << v[i] << ", ";
	}
	cout << v[v.size() - 1] << "]" << endl;
}

void Main();
inline void DebugMain() {
	while (true) {
		Main();
	}
}

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

	bool debug = false;
	if (debug) {
		cout << "\x1b[41m" << "Debug Mode " << endl;
	}
	(debug) ? DebugMain() : Main();
	return 0;
}

class man
{
public:
	int A;
	vector<pii> X;
	bool HeIsTrue;
private:
	
};

inline void Main() {
		ll X, Y, N;
		vector<ll> A;
		ll M1, D1, M2, D2;
		ll ans;
		ll sum=0,count =0;
		string S;
		string S2;
		int b[60];
		bool flag = false;
	
		cin >> X >> Y;
		
		if (1 != X && 1 != Y) {
			cout << 1;
		}else if (2 != X && 2 != Y) {
			cout << 2;
		}
		else if (3 != X && 3 != Y) {
			cout << 3;
		}
		
		
}



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

int main() {
    int n, k;
    cin >> n >> k;
    vector<long long> a(n), sum(n+1, 0);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        sum[i+1] = sum[i] + a[i];
    }
    
    vector<long long> val;
    for (int i = 0; i < n; i++) {
        for (int j = i+1; j <= n; j++) {
            val.emplace_back(sum[j] - sum[i]);
        }
    }
    
    const int m = val.size();
    vector<bool> use(m, true);
    for (int b = 45; b >= 0; b--) {
        int cnt = 0;
        for (int i = 0; i < m; i++) if (use[i]) {
            if (val[i]&(1LL<<b)) cnt++;
        }
        if (cnt < k) continue;
        for (int i = 0; i < m; i++) if (use[i]) {
            if ((val[i]&(1LL<<b)) == 0) use[i] = false;
        }
    }
    
    long long ans = (1LL<<60) - 1;
    for (int i = 0; i < m; i++) {
        if (use[i]) ans &= val[i];
    }
    
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 6132
#include <cstdio>

int main()
{
	int l, m, n;
	while(~scanf("%d %d %d", &l, &m, &n), ~l && ~m && ~n){
		long long total = l * 60LL * 60 + m * 60 + n, remaining = 120 * 60 - total;
		printf("%02lld:%02lld:%02lld\n", remaining / 60 / 60, remaining / 60 % 60, remaining % 60);
		remaining *= 3;
		printf("%02lld:%02lld:%02lld\n", remaining / 60 / 60, remaining / 60 % 60, remaining % 60);
	}
	return 0;
}

Measured memory_bytes: 1040
# coding: utf-8
# Your code here!

s = input()

# print(s)

# print(s.find('C'))
# print(s.find('F', 0))

index01 = s.find('C')
index02 = s.find('F', index01)

# print(index01)
# print(index02)

if index01 >= 0 and index02 >= 0:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 2940
S = input()

ans = 0

for i in range(2**(len(S)-1)):
    p = [0]
    for j in range(len(S)-1):
        if (i>>j)&1:
            p.append(j+1)
    p.append(len(S))
    
    for l,r in zip(p[:-1],p[1:]):
        ans += int(S[l:r])
print(ans)


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

#if DEBUG && !ONLINE_JUDGE
  #include "header.h"
#else
  #define debug(args...)
#endif

typedef vector<int> vi;
typedef pair<int,int> ii;
typedef long long lli;
typedef long double ld;

#define pb push_back
#define all(x) x.begin(),x.end()
#define SZ(x) (int)(x).size()
#define fi first
#define se second
#define lb lower_bound
#define ub upper_bound
#define rep(i,a,b) for(auto i=(a);i<b;i++)

#define INF (int)1e9
#define EPS 1e-9
#define MOD 1000000007

const int N = 1e5+100;

lli pow1(lli x, lli y) {
  lli ans = 1;
  while(y>0) {
    if(y&1LL) ans = ans * x;
    x = x * x;
    x %= MOD;
    ans %= MOD;
    y = y>>1;
  }
  return ans;
}

lli inv(lli x) {
  return pow1(x, MOD-2);
}

lli fac[N], ifac[N];

void preprocess(void) {
  fac[0] = 1;
  rep(i,1,N) fac[i] = (fac[i-1] * i) % MOD;
  ifac[N-1] = inv(fac[N-1]);
  for(int i = N-2; i>=0; i--) {
    ifac[i] = (ifac[i+1] * (i+1)) % MOD;
  }
  return;
}

lli nCr(lli x, lli y) {
  if(y<0 || x<0) return 0;
  if(y>x) return 0;
  lli ans = fac[x];
  ans *= ifac[y];
  ans %= MOD;
  ans *= ifac[x-y];
  ans %= MOD;
  return ans;
}


int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.precision(20);
  preprocess();
  int n, k; cin>>n>>k;
  vi a(n+1);
  rep(i,1,n+1) cin>>a[i];
  sort(a.begin()+1, a.end());
  rep(i,1,n+1) a[i] = (a[i] + MOD) % MOD;
  lli ans = 0;
  rep(i,1,n+1) {
    ans += (nCr(i-1, k-1)*a[i]) % MOD;
    ans %= MOD;
    ans -= (nCr(n-i, k-1)*a[i]) % MOD;
    ans %= MOD;
    if(ans<0) ans += MOD;
    ans %= MOD;
  }
  assert(ans>=0);
  cout<<ans<<endl;

}



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

// 整数スキャン（複数）
/*
int x;
scanf("%d",&x);
int y;
scanf("%d",&y);
int z;
scanf("%d",&y);

// n個の整数のスキャン
/*
ll a[n] = {};
rep(i,n){
    scanf("%lld",&a[i]);
}
*/

// 文字列スキャン
/*
string s;
cin >> s;
*/


int main() {
    //int n;
    //scanf("%d",&n);
    string s;
    cin >> s;




    int ans = 0;

    rep(i,4){
        if(s[i]=='+'){
            ans++;
        }else{
            ans--;
        }
    }

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(long long i=0;i<x;i++)
#define rrep(i,x) for(long long i=x-1;i>=0;i--)
#define repn(i,x) for(long long i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
vector<pair<string,P> >vec;
// vector<vector<int>> data(3, vector<int>(4));

ll dp[1000005][2];

int main(){	
	string N;
	cin >> N;
	ll res = 0;
	dp[0][1] = INF;
	int n = N.size();
	rep(i, n) {
		ll c = N[n-1-i]-'0';
		if (c != 9) dp[i+1][0] = min(dp[i][0]+c, dp[i][1]+c); else dp[i+1][0] = dp[i][0]+c; 
		dp[i+1][1] = min(dp[i][0]+10-c+1, dp[i][1]+9-c);
		// cout << i+1 << ": " << dp[i+1][0] << " " << dp[i+1][1] << endl;
	}
	
	cout << min(dp[n][0], dp[n][1]) << endl;
	return 0;
}



Measured memory_bytes: 17028
S=input()
N=int(len(S))
C=int(0)
for i in range(N):
    if(S[i]!=S[N-1-i]):
        C=1
        print('No')
        break
if C==0:
    for i in range(int((N-1)/2)):
        if(S[i]!=S[int(((N-1)/2)-1-i)]):
            C=1
            print('No')
            break
if C==0:
    print('Yes')

Measured memory_bytes: 3064
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>

using namespace std;

int main() {
	int n;
	string str;
	getline(cin, str);
	n = atoi(str.c_str());
	for (int i = 0; i < n; i++) {
		getline(cin, str);
		while (1) {
			size_t pos = str.find("Hoshino");
			if (pos == string::npos)
				break;
			str.replace(pos, 7, "Hoshina");
		}
		cout << str << endl;
	}
	return 0;
}

Measured memory_bytes: 1192
#include <iostream>
#include <string>
#include <vector>
#include <algorithm> 
#include <utility> 
#include <tuple> 
#include <cstdint> 
#include <cstdio> 
#include <map> 
#include <queue> 
#include <set> 
#include <stack> 
#include <deque> 
#include <unordered_map> 
#include <unordered_set> 
#include <bitset> 
#include <cctype> 
#include <cmath>
#include <iomanip>
#include <ctype.h>

using namespace std;
using ll = long long;
using PAIR = pair<int, int>;
using PAIRLL = pair<ll, ll>;
using vi = vector<int>;
using vvi = vector<vi>;

#define TR ","
#define fi first
#define se second
#define rep(i,N) for(ll i=0;i<(ll)N;++i)
#define repe(i,a,b) for(ll i=a;i<(ll)b;++i)
#define all(v) v.begin(), v.end()
#define IO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define INF 100000000

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

ll lcm(ll x, ll y) {
    return x / gcd(x, y) * y;
}

ll waz = 76543217;

ll inv(ll x) {
    if (x == 1) { return 1; }
    if (x == 0) { return 0; }
    else {
        ll a = (waz - inv(waz % x) * (waz / x)) % waz;
        if (a >= 0) { return a; }
        else { return waz + a; }
    }
}

void printVector(const vector<int>& vec) {
    for (int value : vec) {
        cout << value << " ";
    }
    cout << endl;
}

vector<ll> p;

ll phi(ll x) {
    ll a = x;
    ll b = x;
    for (ll k = 0; k != p.size(); ++k) {
        if (a % p[k] == 0) {
            while (a % p[k] == 0) {
                a /= p[k];
            }
            b = b / p[k] * (p[k] - 1);
        }
        if (a == 1) { break; }
    }
    return b;
}

bool my_compare(pair<string, int> a, pair<string, int> b) {
    if (a.first != b.first) {
        return a.first < b.first;
    }

    if (a.second != b.second) {
        return a.second > b.second;
    }
    else {
        return true;
    }
}

int main()
{
    IO;

    ll N; cin >> N;

    vector<deque<string> > deq(9);
    deque<string> deq2;
    deque<ll> deq3;


    deq[0].push_back("3");
    deq[0].push_back("5");
    deq[0].push_back("7");

    for (ll i = 1; i < 9; ++i) {
        rep(j, deq[i-1].size()) {
            deq[i].push_back("3" + deq[i - 1][j]);
        }
        rep(j, deq[i - 1].size()) {
            deq[i].push_back("5" + deq[i - 1][j]);
        }
        rep(j, deq[i - 1].size()) {
            deq[i].push_back("7" + deq[i - 1][j]);
        }
    }

    rep(i, 9) {
        rep(j, deq[i].size()) {
            deq2.push_back(deq[i][j]);
        }
    }

    sort(all(deq2));
    deq2.erase(unique(all(deq2)), deq2.end());

    rep(i,deq2.size()) {
        ll p = 0, q = 0, r = 0;
        rep(j, deq2[i].size()) {
            if (deq2[i][j] == '3') { ++p; }
            else if (deq2[i][j] == '5') { ++q; }
            else if (deq2[i][j] == '7') { ++r; }
        }
        if (p * q * r > 0) { deq3.push_back(stoll(deq2[i])); }
    }

    sort(all(deq3));

    ll ans = 0;

    rep(i, deq3.size()) {
        if (deq3[i] <= N) {
            ++ans;
        }
        else {
            break;
        }
    }

    cout << ans << endl;

}

Measured memory_bytes: 4824
#include <iostream>
#include <vector>
#include <list>
using namespace std;

struct tempList{
    list<int> ls;
    int countIncluded(int t){
        int count = 0;
        for(auto itr = ls.begin(); itr!=ls.end(); itr++){
            if(*itr == t){
              /*
                cout << *itr << ", " << t << endl;
                count ++;
              */
              return 1;
            }
        }
        return count;
    }
};

int main(){
    int x;
    cin >> x;
    tempList tl;
    for(int i=0; i<x; i++){
        int temp;
        cin >> temp;
        tl.ls.push_back(temp);
    }
    int len;
    cin >> len;
    int count = 0;
    for(int i=0; i<len; i++){
        int temp;
        cin >> temp;
        count += tl.countIncluded(temp);
    }
    cout << count << endl;
}


Measured memory_bytes: 3400
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = (s); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) for(int i = (n); i >= 0; i--)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << '\n';
#define CFYN(n) cout << ( (n) ? "YES":"NO") << '\n';
#define OUT(n) cout << (n) << '\n';
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

int main(void)
{
    IOS
    int n; cin >> n;
    string s; cin >> s;
    vector<int> r,g,b;
    REP(i,n) {
        if (s[i] == 'R') r.push_back(i);
        else if (s[i] == 'G') g.push_back(i);
        else b.push_back(i);
    }
    ll ans = 0;
    if (r.size() * g.size() * b.size() == 0){
        OUT(0)
        return 0;
    }
    for (auto i:r) {
        for (auto j:g) {
            ll i2 = i, j2 = j;
            if (i2 > j2) swap(i2,j2);
            ll d = j2-i2;
            ll bs = b.size();

            auto it1 = lower_bound(ALL(b),i2-d);
            if (*it1  == i2-d) bs--;
            auto it2 = lower_bound(ALL(b),j2+d);
            if (*it2 == j2+d) bs--;
            if (d % 2 == 0) {
                auto it3 = lower_bound(ALL(b),i2+d/2);
                if (*it3 == i2+d/2) bs--;
            }
            ans += bs;
        }
    }

    cout << ans << '\n';

    return 0;
}

Measured memory_bytes: 3656
import java.util.*;
 
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int num = sc.nextInt();
    long d = sc.nextLong();
    long count = 0;
    for(int i = 0;i < num;i++){
      long p = sc.nextLong();
      long q = sc.nextLong();
      long dis = p * p + q * q;
      if(dis <= d * d){
        count++;
      }
    }
    System.out.println(count);
  }
}

Measured memory_bytes: 61104
#include<stdio.h>
#include<stdlib.h>
int main(){
  int i,j,tmp,X,n,*A;
  scanf("%d",&n);
  A = malloc(sizeof(int)*n);
  for(i=0;i<n;i++)scanf("%d",&A[i]);

  X=A[n-1];
  i=-1;
  for(j=0;j<n-1;j++){
    if(X >=A[j]){
      i++;
      tmp=A[j];
      A[j]=A[i];
      A[i]=tmp;
    }
  }
  tmp=A[n-1];
  A[n-1]=A[i+1];
  A[i+1]=tmp;

  X = i+1;
  for(i=0;i<n;i++){
    if(i==n-1)printf("%d\n",A[i]);
    else{
      if(X == i){
	printf("[%d] ",A[i]);
      }
      else printf("%d ",A[i]);
    }
  }
  free(A);
  return 0;
}


Measured memory_bytes: 2144
import sys
n, m = map(int, input().split())
likes = [list(map(int, input().split())) for _ in range(n)]
if n == 1:
    print(len(likes[0]) - 1)
    sys.exit(0)
common = set(likes[0][1:]) & set(likes[1][1:])
for i in range(2, len(likes)):
    common = common & set(likes[i][1:])
print(len(common))


Measured memory_bytes: 3064
#import numpy as np
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial#, gcd
from bisect import bisect_left #bisect_left(list, value)
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep='\n')

N, K = map(int, input().split())

d = [0]*(K+1)
for i in range(1, K+1):
    val = K//i
    d[i] = pow(val, N, MOD)

# print(d)

for i in range(K, 0, -1):
    # print('i', i)
    for j in range(K//i, 1, -1):
        # print(' j', j)
        # print(i, i*j)
        d[i] -= d[i*j]
    # print(d)

res = 0
for i, v in enu(d):
    res += i*v
    res %= MOD
print(res)


Measured memory_bytes: 69524
def main():
    
    N_all, K_part = map(int, input().split())
    scores = list(map(int, input().split()))

    init = 1

    for i in range(N_all - K_part):
        index = i + K_part
        after = scores[index]
        before = scores[i]
        
        if (before < after):
            print('Yes')
        else:
            print('No')
        

if __name__ == '__main__':
    main()

Measured memory_bytes: 31672
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author toshif
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        MyReader in = new MyReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        private long n;
        private long m;

        public void solve(int testNumber, MyReader in, PrintWriter out) {
            n = in.nextLong();
            m = in.nextLong();

            long lo = 0, hi = (long) 1E12 + 5L;

            while (hi - lo > 1) {
                long mid = (lo + hi) / 2;
                if (ok(mid)) {
                    lo = mid;
                } else {
                    hi = mid;
                }
            }

            if (ok(hi)) {
                out.println(hi);
            } else {
                out.println(lo);
            }
        }

        boolean ok(long mid) {
            long s = n;
            long c = m;

            if (s < mid) {
                c -= 2 * (mid - s);
            }

            if (c < 0) return false;

            if (c < 2 * mid) return false;

            return true;
        }

    }

    static class MyReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public MyReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

    }
}



Measured memory_bytes: 21332
#include <bits/stdc++.h>
#include <numeric>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define rep1(i,n) for (int i = 1; i <= n; ++i)
template<typename T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
const long long MOD = 1e9+7;
#define precout(val) cout << std::fixed << std::setprecision(20) << val;

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

  long long n,m; cin >> n >> m;
  string s,t; cin >> s >> t;

  if(s[0] != t[0]) {
    cout << -1 << endl;
    return 0;
  }

  long long l = n * m / __gcd(n, m);
  map<int, char> ls;
  rep1(i, n-1) {
    int si = i * (l / n);
    ls[si] = s[i];
  }

  rep1(i, m-1) {
    int mi = i * (l / m);
    if(ls.find(mi) != ls.end() && ls[mi] != t[i]) {
      cout << -1 << endl;
      return 0;
    }
    ls[mi] != t[i];
  }

  cout << l << endl;
}


Measured memory_bytes: 8192
/*
ID: computerbox --> Huseyn Hajiyev
LANG: C++
TASK: target_mode_on
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>
#define ordered_set tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>
//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize ("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#define _CRT_SECURE_NO_WARNINGS
//#include <boost/multiprecision/cpp_int.hpp>
//using boost::multiprecision::cpp_int;
#define FAST_READ ios_base::sync_with_stdio(0);
#define in freopen("input.txt", "r", stdin);
#define out freopen("output.txt", "w", stdout);
#define ll long long
#define debt(x,y)cout<<"#x = "<<(x)<<" and "<<"#y = "<<(y)<<endl;
#define deb(x)cout<<"#x = "<<(x)<<endl;
#define COUT(n, a) cout<< fixed << setprecision(a) << n<<endl
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define endl "\n"
#define arr(a,n) for(ll i=1;i<=n;i++) cout<<a[i]<<" "; cout << "\n";
#define vecc(a,n) for(ll i=0;i<n;i++) cout<<a[i]<<" "; cout << "\n";
#define CURTIME() cerr << clock() * 1.0 / CLOCKS_PER_SEC << endl
#define DTIME(ccc) __begin = clock(); ccc; cerr<<"Time of work = "<<(clock()-__begin)/CLOCKS_PER_SEC<<endl;
#define MAXN 2000
//cin.ignore (7777, '\n');

using namespace std;
using namespace __gnu_pbds;

#define debug(args...)(Debugger()) , args
class Debugger
{
  public:
  Debugger(const std::string& _separator=", ") :
  first(true),separator(_separator){}
  template<typename ObjectType>
  Debugger& operator,(const ObjectType& v)
  {
        if(!first)cerr<<separator;
        cerr<<v;
        first=false;
        return *this;
  }
  ~Debugger() {cerr<<endl;}      
  private:
    bool first;
    string separator;
};
 
template <typename T1, typename T2>
inline ostream& operator<<(std::ostream& os, const std::pair<T1, T2>& p)
{
   return os<<"("<<p.first<<", "<<p.second<<")";
}
template<typename T>
inline ostream &operator<<(ostream & os,const vector<T>& v)
{
    bool first=true;
    os<<"[";
    for(unsigned ll i=0;i<v.size();i++)
    {
        if(!first)os<<", ";
        os<<v[i];
        first=false;
    }
        return os<<"]";
}
template<typename T>
inline ostream &operator<<(ostream & os,const set<T>&v)
{
    bool first=true;
    os<<"[";
    for(typename set<T>::const_iterator ii=v.begin();ii!=v.end();++ii)
    {
        if(!first)os<<", ";
        os<<*ii;
        first=false;
    }
    return os<<"]";
}
template<typename T1, typename T2>
inline ostream &operator<<(ostream & os,const map<T1, T2>&v)
{
        bool first=true;
        os<<"[";
        for(typename map<T1,T2>::const_iterator ii=v.begin(); ii!=v.end();++ii)
        {
            if(!first)os<<", ";
            os<<*ii;
            first=false;
        }
        return os<<"]";
}

ll a;
string stroka;
int main(){
FAST_READ;
cin>>a;
cin>>stroka;
if(a<3200)cout<<"red"<<endl;
else cout<<stroka<<endl;







return 0;
} 


Measured memory_bytes: 256
N, M, K = list(map(int, input().split()))

mod = 998244353


fac = [0] * (N+1)
fac[0] = 1
fac[1] = 1
for i in range(2, N+1):
    fac[i] = (fac[i-1] * i) % mod


def comb(a, b, p):
    if a < 0 or b < 0:
        return 0
    elif a < b:
        return 0
    c = fac[a]
    c *= pow(fac[b], p - 2, p)
    c *= pow(fac[a-b], p - 2, p)
    return c % p


ans = 0
ans += M * pow(M-1, N-1, mod)
ans %= mod

for k in range(1, K+1):
    ans += comb(N-1, k, mod) * M * pow(M-1, N-1-k, mod)
    ans %= mod

print(ans)


Measured memory_bytes: 72940
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <typeinfo>
#include <numeric>
#include <functional>
#include <unordered_map>
#include <bitset>
#include <stack>
#include <assert.h>
#include <unordered_set>
#include <random>



using namespace std;
using ll = long long;
using ull = unsigned long long;

const ll INF = 1e16;
const ll MOD = 1e9 + 7;

#define REP(i, n) for(ll i = 0; i < n; i++)























int main(){
    ll n, q;
    cin >> n >> q;
    vector<pair<ll, ll>> event;
    REP(i, n){
        ll s, t, x;
        cin >> s >> t >> x;
        event.push_back({s - x, x});
        event.push_back({t - x, -x});
    }
    sort(event.begin(), event.end());
    event.push_back({INF, INF});
    ll p = 0;
    set<ll> st;
    REP(i, q){
        ll d;
        cin >> d;
        while(event[p].first <= d){
            ll x = event[p].second;
            if(x > 0){
                st.insert(x);
            }
            else{
                st.erase(-x);
            }
            p++;
        }
        if(!st.empty()){
            cout << *st.begin() << endl;
        }
        else{
            cout << -1 << endl;
        }
    }
}

Measured memory_bytes: 18408
#include<algorithm>
#include<climits>
#include<cmath>
#include<iomanip>
#include<iostream>
#include<list>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<stack>
#include<utility>
#include<vector>
 
#define lint long long
#define VI vector<int>
#define VL vector<lint>
#define VB vector<bool>
#define VC vector<char>
#define VS vector<string>
#define VVI vector<VI>
#define VVL vector<VL>
#define rep(i, n) for(int i = 0 ; i < n ; i++)
#define repr(i, n) for(int i = n - 1 ; i >= 0 ; i--)
#define SORT(c) sort((c).begin(), (c).end())
#define SORT_INV(c) sort((c).begin(), (c).end(), greater<int>())
#define IINF INT_MAX
#define LLINF LLONG_MAX

using namespace std;

int pow(int x, int n){
    int t = 1;
    while(n > 0){
        if(n & 1){
            t *= x;
        }
        x *= x;
        n >>= 1;
    }
    return t;
}

int main(){
    int n, k;
    cin >> n >> k;
    VB d(10, true);
    rep(i, k){
        int t;
        cin >> t;
        d[t] = false;
    }
    int ans = n;
    while(true){
        int res = n;
        while(res > 0){
            int tmp = res % 10;
            if(!d[tmp]){
                break;
            }
            res = res / 10;
        }
        if(res == 0){
            ans = n;
            break;
        }
        n++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif


using namespace std;

// #define int long long
struct Fast {Fast(){std::cin.tie(0);ios::sync_with_stdio(false);}} fast;

inline bool inside(int y, int x, int H, int W) {return y >= 0 && x >= 0 && y < H && x < W;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

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

signed main() {
    Fast();

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

    int ret = a + b;
    ret = max(ret, a - b);
    ret = max(ret, a * b);
    cout << ret << endl;
    return 0;
}



Measured memory_bytes: 384
#include<iostream>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<algorithm>

using namespace std;

#define int long long
#define rep(i,n) for(int i = 0; i < (n); i++)
#define INF (long long)(1e18)
#define MOD (int)(1e9+7)

#define yn(f) ((f)?"Yes":"No")
#define YN(f) ((f)?"YES":"NO")

signed main(){
	cout<<fixed<<setprecision(7);
	
	int N, H, W;
	
	cin>>N>>H>>W;
	
	cout<<(N-H+1)*(N-W+1)<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h> 
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define all(vec) vec.begin(), vec.end()
typedef long long ll;ll MM = 1000000000;ll mod = MM + 7;
ll GCD(ll x, ll y) {if (x % y == 0) return y;else return GCD(y, x % y);}
ll LCM(ll x, ll y) { return x * y / GCD(x, y);}

int main(){
  ll a ; string s; cin>> a>>s ;
  
  if(a>=3200)cout<< s <<endl;
  else cout<<"red"<<endl;
}

Measured memory_bytes: 256
import java.util.*;
import java.text.*;

class Main {
    public static void main(String[]args)throws Exception {
        Scanner sc = new Scanner(System.in);
        double r = sc.nextDouble();
        double a = 3.14159265358979323846 * r * r;
        double l = 3.14159265358979323846 * r * 2;

        NumberFormat format = NumberFormat.getInstance();
        format.setMaximumFractionDigits(5);
        format.setMinimumFractionDigits(5);
        format.setGroupingUsed(false);
        System.out.println("" + format.format(a) + " " + format.format(l));
    }
}

Measured memory_bytes: 18972
#include <stdio.h>

#define MAX(a, b)	((a) > (b) ? (a) : (b))

int main(){
	
	long long N, A, B, ans;	scanf("%lld %lld %lld", &N, &A, &B);
	
	ans = (N - 2) * (B - A) + 1;
	
	printf("%lld", MAX(ans, 0));
	
return 0;	
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#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++)
typedef long long ll;
typedef pair<ll,ll> P;

int main() {
  int n;
  cin>>n;
  vector<int>a(n);
  rep(i,n) {
    cin>>a[i];
  }
  sort(a.begin(),a.end());
  bool ex=false;
  rep(i,n){
    if(a[i]!=0){
      ex=true;
    }
  }
  if(!ex){
    cout<<"Yes"<<endl;
  }
  else{
    if(n%3!=0){
      cout<<"No"<<endl;
    }
    else{
      rep(i,3){
        rep(j,n/3){
          if(a[n/3*i+j]!=a[n/3*i]){
            ex=false;
          }
        }
      }
      if(ex){
        if((a[0]^a[n/3])!=a[n/3*2]){
          ex=false;
        }
      }
      if(ex){
        cout<<"Yes"<<endl;
      }
      else{
        cout<<"No"<<endl;
      }
    }
  }
}


Measured memory_bytes: 3780
#include <iostream>
#include <algorithm>
using namespace std;
using ll = long long;
#define pi 3.1415926

int a[(int)2e5];

int main(){
    int n, m;
    cin >> n >> m;
    if(m == n)
        cout << "Yes";
    else   
        cout << "No";
    
    
    
}

    

		


Measured memory_bytes: 256
#include<iostream>
#include<bits/stdc++.h>
#define LL long long int
using namespace std;
int main()
{
	LL x,n;
	cin>>x>>n;
	LL a[n];
	map<LL,LL>m;
	LL count=0;
	for(LL i=0; i<n; i++)
	{
		cin>>a[i];
		m[a[i]]++;
	}
	if(m[x]==0)
	{
		cout<<x<<"\n";
		return 0;
	}
	
	LL mina=LLONG_MAX,ans=0;
	for(LL j=0; j<=101; j++)
	{
		if(m[j]==0)
		{
			mina=min(mina,abs(x-j));
		}
	}
	for(LL j=0; j<=101; j++)
	{
		if(m[j]==0)
		{
			LL temp=abs(x-j);
			if(temp==mina)
			{
				ans=j;
				break;
			}
		}
	}
	cout<<ans<<"\n";

}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
 
#define DEBUG 0
#define lli long long int
#define REP(i,n) for(int i=0;i<n;i++)
#define LIM 1000000007

using namespace std;

int main(){

	lli h,w,k;
	cin>>h>>w>>k;

	/*dp[i][j]: i本目にいて、高さがjにいるときの場合の数*/
	lli dp[110][10]={0};
	dp[0][0]=1;

	REP(i,h){
		REP(bit,1<<w-1){
			if(bit & (bit<<1))continue;
			int tmp[10];
			REP(j,w)tmp[j] = dp[i][j];
			REP(j,w-1){
				if(bit & 1<<j){
					swap(tmp[j],tmp[j+1]);
				}
			}
			REP(j,w)dp[i+1][j] = (dp[i+1][j] + tmp[j]) % LIM;
		}
	}
	cout<<dp[h][k-1]<<endl;

	return 0;
}

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

typedef long long ll;

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

int main() { 
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    cout << max({a*c, a*d, b*c, b*d}) << "\n";
    return 0;
}


Measured memory_bytes: 3608
#pragma GCC optimize("O3")
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

using ll = long long;
using P = pair<int, int>;
using T = tuple<int, int, int>;

template <class T> inline T chmax(T &a, const T b) {return a = (a < b) ? b : a;}
template <class T> inline T chmin(T &a, const T b) {return a = (a > b) ? b : a;}

constexpr int MOD = 1e9 + 7;
constexpr int inf = 1e9;
constexpr long long INF = 1e18;

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

typedef complex<double> Point, Vector;

#define X real()
#define Y imag()
#define EPS (1e-10)
#define equals(a, b) (fabs((a) - (b)) < EPS)

double cross(Vector a, Vector b){
    return a.X * b.Y - a.Y * b.X;
}

// 平行判定
bool isParallel(Vector a, Vector b){
    return equals(cross(a, b), 0);
}

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

    int n; cin>>n;
    while(n--){
        double x1, y1, x2, y2, x3, y3, x4, y4; cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4;
        Vector v1 = Point(x1, y1) - Point(x2, y2), v2 = Point(x3, y3) - Point(x4, y4);
        cout << (isParallel(v1, v2) ? "YES" : "NO") << endl;
    }

    return 0;
}


Measured memory_bytes: 3280
class range { // Range Iterator
  struct _Impl {
    int it;const bool rev;
    explicit constexpr _Impl(int it_, bool rev=false):it(it_), rev(rev) {}
    int operator*() { return it; }
    bool operator!=(_Impl& r) { return it!=r.it; }
    void operator++() { rev?--it:++it; }
  };
  const _Impl i,n;
public:
  explicit constexpr range(int n): i(0), n(n<0?0:n) {}
  explicit constexpr range(int i, int n): i(i,n<i), n(n) {}
  const _Impl& begin() { return i; }
  const _Impl& end() { return n; }
};

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

using i32 = int32_t;
using i64 = int64_t;
using usize = uint64_t;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    const i64 M = 998244353;
    i64 n, s;
    cin >> n >> s;
    auto a = vector<i64>(n, 0);
    for (usize i: range(n)) {
        cin >> a[i];
    }
    auto dp = vector<vector<i64>>(s + 1, vector<i64>(3));
    dp[0][0] = 1;
    for (usize i: range(n)) {
        auto dp_next = dp;
        for (usize j: range(s + 1)) {
            dp_next[j][1] += dp[j][0];
            dp_next[j][1] %= M;
            dp_next[j][2] += dp[j][0] + dp[j][1];
            dp_next[j][2] %= M;
            if (static_cast<i64>(j) + a[i] <= s) {
                dp_next[j + a[i]][1] += (dp[j][0] + dp[j][1]);
                dp_next[j + a[i]][1] %= M;
                dp_next[j + a[i]][2] += (dp[j][0] + dp[j][1]);
                dp_next[j + a[i]][2] %= M;
            }
        }
        dp = dp_next;
    }
    cout << dp[s][2] << endl;
    return 0;
}


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

ll dp[101][100002], k, n, a[101];

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

	for(int i = 0; i < n; ++i)
		cin >> a[i];

	for(int sum = 0; sum <= a[0]; ++sum)
		dp[0][sum] = 1;

	for(int pos = 1; pos < n; ++pos) {
		dp[pos][0] = dp[pos-1][0];

		for(int sum = 1; sum <= a[pos]; ++sum)
			dp[pos][sum] = (dp[pos-1][sum] + dp[pos][sum-1])%MOD;

		for(int sum = a[pos]+1; sum <= k; ++sum) {
			dp[pos][sum] = (dp[pos-1][sum] + dp[pos][sum-1])%MOD;
			dp[pos][sum] -= dp[pos-1][sum-a[pos]-1];
			dp[pos][sum] %= MOD;
			if(dp[pos][sum] < 0)
				dp[pos][sum] += MOD;
		}
	}

	cout << dp[n-1][k] << endl;
	return 0;
}

Measured memory_bytes: 78336