akhauriyash/Code-Regression huggingface dataset:
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
 
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <ios>
#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 <string>
#include <utility>
#include <valarray>
#include <vector>
 
#if __cplusplus >= 201103L
#include <array>
#include <forward_list>
#include <random>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <unordered_map>
#include <unordered_set>
#endif
 
#define F first
#define S second
#define MP make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
#define lcm( a, b ) (a)/__gcd((a),(b))*(b)
#define endl '\n'
 
using namespace std;
 
typedef long long LL;
typedef pair< int, int > P;
typedef pair< LL, LL > LP;
typedef pair< int, P > iP;
typedef pair< P, P > PP;
 
static const int INF = INT_MAX;
static const LL LINF = LLONG_MAX;
static const int MIN = INT_MIN;
static const LL LMIN = LLONG_MIN;
static const int MOD = 1000000007;
static const int SIZE = 100005;
 
const int dx[] = {0, -1, 1, 0};
const int dy[] = {-1, 0, 0, 1};
 
vector< int > Div( int n ) {
    vector< int > ret;
    for( int i = 1; i * i <= n; ++i ) {
        if( n % i == 0 ) {
            ret.pb( i );
 
            if( i * i != n ) ret.pb( n / i );
        }
    }
    sort( all( ret ) );
    return ret;
}
 
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
 
    string s;
    cin >> s;
    string t;
    for( int i = 0; i < s.size(); ++i ) {
        if( s[i] != 'x' ) t += s[i];
 
    }
 
    if( t.size() == 0 ) {
        cout << 0 << endl;
        return 0;

    }

    int l = 0, r = t.size() - 1;
    bool flg = true;
    while( l < r ) {
        if( t[l] != t[r] ) {
            flg = false;
            break;
 
        }
        ++l, --r;
 
    }
 
    if( !flg ) {
        cout << -1 << endl;
        return 0;
 
    }
 
    l = 0; r = s.size() - 1;
    int res = 0;
    while( l < r ) {
        if( s[l] != s[r] ) {
            ++res;
            if( s[l] == 'x' ) ++l;
            else --r;
 
        } else {
            ++l;
            --r;
 
        }
    }
 
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 592
//g++ -std=c++14 test.cpp -o test.out

#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <iomanip>
#include <vector>
#include <queue>
#include <stack>
#include <map> 
#include <unordered_map> 
#include <utility>
#include <limits.h>
#include <bitset>
#include <set>
using namespace std;
 
#define LL long long int
const LL INF = (1LL<<60);
const int INF_INT = 2147483647-1e6-1;
const LL mod = 1000000007ll;
const int mod_int = 1000000007;

LL L,R,d;

LL ans = 0;

void solve(){
	for(int i=L;i<=R;i++){
		if(i%d==0) ans++;
	}
}

int main(){
    cin >> L >> R >> d;

    solve();

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

Measured memory_bytes: 3192
#include <bits/stdc++.h>
using namespace std;
#define _USE_MATH_DEFINES
#define ios std::ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define PI acos(-1.0) //3.14159265358
#define EPS 1e-9 //epsilon, 10^-9, checking for equality 
#define pb push_back
#define fi first
#define se second
#define sz(x) x.size()
#define rep(i,n) for(int i=0;i<n;i++)
#define isort(x) sort(x.begin(),x.end())
#define dsort(x) sort(x.rbegin(),x.rend())
const int inf=1e9+7; //10^9 +7
const int modc=998244353;
typedef long long int ll;typedef vector<int> vi;typedef vector<ll> vll;
typedef pair<int,int> ii;typedef map<int,int> mii;
inline void rvi(vi &v, int n){int temp; rep(i,n){cin>>temp;v.pb(temp);}}
inline void rvll(vll &v, int n){ll temp;rep(i,n){cin>>temp;v.pb(temp);}}
inline void prvi(vi &a){rep(i,sz(a)){cout<<a[i]<<" ";}cout<<endl;}
inline void prvll(vll &a){rep(i,sz(a)){cout<<a[i]<<" ";}cout<<endl;}
inline vll prefixsum(vi &a){vll b;b.pb(a[0]);for(int i=1;i<sz(a);i++){b.pb(a[i]+b[i-1]);}return b;}
inline vll suffixsum(vi &a){vll b(sz(a));b[sz(a)-1]=a[sz(a)-1];for(int i=sz(a)-2;i>=0;i--){b[i]=a[i]+b[i+1];}return b;}
inline vll prefixsum(vll &a){vll b;b.pb(a[0]);for(int i=1;i<sz(a);i++){b.pb(a[i]+b[i-1]);}return b;}
inline vll suffixsum(vll &a){vll b(sz(a));b[sz(a)-1]=a[sz(a)-1];for(int i=sz(a)-2;i>=0;i--){b[i]=a[i]+b[i+1];}return b;}
void solve();int main(){ios;solve();return 0;}
//--------SOLVE--------------------------------------------------------------------
void solve()
{
	int n,w;cin>>n>>w;
	vector< ii > items;
	items.pb({-1,-1});
	for(int i=0;i<n;i++)
	{
		int t1,t2;cin>>t1>>t2;
		items.pb({t1,t2});
	}
	//dp[i][j] gives max value for items 1 to i with max allowed weight=j
	ll dp[102][100005];
	for(int i=0;i<=n;i++) dp[i][0]=0; //0 weight allowed
	for(int i=0;i<=w;i++) dp[0][i]=0; //0 items taken
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=w;j++)
		{
			if(items[i].fi>j) dp[i][j]=dp[i-1][j];
			else dp[i][j]=max(dp[i-1][j],dp[i-1][j-items[i].fi]+items[i].se);
		}
	}
	cout<<dp[n][w]<<endl;
}

Measured memory_bytes: 79872
/* ---------- STL Libraries ---------- */
// IO library
#include <cstdio>

#include <fstream>
#include <iomanip>
#include <ios>
#include <iostream>

// algorithm library
#include <algorithm>

#include <cmath>
#include <numeric>
#include <random>
#include <cstring>
#include <cassert>

// container library
#include <array>
#include <bitset>
#include <deque>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>
#include <stack>

// type
#include <cstdint>
#include <functional>

/* ---------- Namespace ---------- */
using namespace std;

/* ---------- Type ---------- */
using ll = long long;
#define int ll
template <class T> using MaxHeap = priority_queue<T>;
template <class T> using MinHeap = priority_queue<T, vector<T>, greater<T>>;
#define P pair<ll, ll>

/* ---------- Constants  */
const double PI = 3.141592653589793238462643383279;
const ll MOD = 1e9 + 7;
const int INF = 1LL << 55;

/* ---------- Functions */
template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; }

/* v-v-v-v-v-v-v-v-v Main Part v-v-v-v-v-v-v-v-v */
signed main() {
    cin.sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

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

    int cnt = 0;
    for (int i = 0; i < N; i++) {
        bool ok = true;
        for (int next : table[i]) {
            if (H[next] >= H[i]) {
                ok = false;
                break;
            }
        }

        if (ok) cnt++;
    }

    cout << cnt << endl;
    return 0;
}

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

using namespace std;

#define debug(n) cerr << #n << ':' << n << endl;
#define dline    cerr << __LINE__ << endl;

using ll = long long;
template<class T, class U> using P = pair<T,U>;
template<class T> using Heap = priority_queue<T>;
template<class T> using heaP = priority_queue<T,vector<T>,greater<T>>;
template<class T,class U> using umap = unordered_map<T,U>;
template<class T> using uset = unordered_set<T>;

template<class T>
bool ChangeMax(T&a,const T&b){
  if(a >= b) return false;
  a = b;    return true;
}

template<class T>
bool ChangeMin(T&a,const T&b){
  if(a <= b) return false;
  a = b;    return true;  
}

template<class T, size_t N, class U>
void Fill(T (&a)[N], const U&v){
    fill((U*)a,(U*)(a+N),v);
}

template<class T>
istream& operator >> (istream&is, vector<T>&v){
  for(auto&e:v)is >> e;
  return is;
}

int main(){
  string s; cin >> s;
  if(s[0] == '7' || s[1] == '7' || s[2] == '7')cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


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

const int N = 1e6 + 10;
const int mod = 998244353;
const int inv = 499122177;

int p[N], ptot;
bool ptag[N];
int f[N];

void sieve (int n) {
	f[1] = 1;
	for (int i = 2; i <= n; i++) {
		if (!ptag[i]) {
			p[++ ptot] = i;
			f[i] = (i - 1ll * i * i % mod + mod) % mod;
		}
		for (int j = 1; j <= ptot && i * p[j] <= n; j++) {
			ptag[i * p[j]] = 1;
			if (i % p[j]) {
				f[i * p[j]] = 1ll * f[i] * f[p[j]] % mod;
			} else {
				f[i * p[j]] = 1ll * f[i] * p[j] % mod;
			}
		}
	}
}

int c[N], cc[N], sum;

int main (void) {
	sieve(1e6);

	int n, val;
	scanf("%d", &n);
	for (int i = 1; i <= n; i++) {
		scanf("%d", &val);
		c[val] ++;
		sum += val;
		if (sum >= mod) sum -= mod;
	}
	int m = 1e6;
	for (int i = 1; i <= m; i++) {
		for (int j = 1; i * j <= m; j++) {
			cc[i] += 1ll * c[i * j] * j % mod;
			if (cc[i] >= mod) cc[i] -= mod;
		}
	}

	int ans = 0;
	for (int i = 1; i <= m; i++) {
		ans += 1ll * f[i] * cc[i] % mod * cc[i] % mod;
		if (ans >= mod) ans -= mod;
	}
	ans -= sum;
	if (ans < 0) ans += mod;
	ans = 1ll * ans * inv % mod;
	printf("%d\n", ans);
}

Measured memory_bytes: 14592
#include<stdio.h>
#include<string.h>
 
int main(void){
	char str[100];
	scanf("%s",str);
	int b_letter[26];
	int dif[26];
	int i = 0;
	for(i = 0;i < 26;i++){
		b_letter[i] = -1;
		dif[i] = -1;
	}
	for(i = 0;i < strlen(str);i++){
		int temp = (int)(str[i] - 'a');
		if( i - b_letter[temp] -1 > dif[temp]){
			dif[temp] = i - b_letter[temp]-1;
		}
		b_letter[temp] = i;
		//printf("%d\n",temp);
	}
	int min = 100;
	for(i = 0;i < 26;i++){
		if(strlen(str) - b_letter[i] -1> dif[i])dif[i] = strlen(str) - b_letter[i]-1;
		//printf("%d \n",(dif[i]));
		if(dif[i] != -1 && min > dif[i])min = dif[i];
	}
	if(min > (strlen(str) + 1)/2){min = (strlen(str) + 1)/2;}
	printf("%d",min);
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <queue>
#include <algorithm>

using namespace std;
int main() {
    int n,ticket,x;
    vector<int>v;
    cin>>n>>ticket;
    priority_queue<int>pq;
    for(int i=0;i<n;i++){
        cin>>x;
        pq.push(x);
    }
    for(int i=0;i<ticket;i++){
        auto x = pq.top();pq.pop();
        x /= 2;
        pq.push(x);
    }
    long long sum = 0;
    while(!pq.empty()){
        int x = pq.top();pq.pop();
        sum += x;
    }
    cout<<sum<<endl;
}

Measured memory_bytes: 892
# include "bits/stdc++.h"
 
using namespace std;
 
#define endl "\n"
typedef long long int ll;
#define f first
#define s second
 
inline void fastio(){ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);}
inline void setPrecision(int n){cout.precision(n);}
 
//DEBUG
#define BR cerr<<endl
#define dbg(x) cerr<<(#x)<<": "<<x<<endl
#define dbgV(x) cerr<<(#x)<<": "; for(auto it: x) cerr<<it<<" "; cerr<<endl;
#define dbgS(x) cerr<<(#x)<<": "; for(auto it: x) cerr<<it<<" "; cerr<<endl;
#define dbgM(x) cerr<<(#x)<<": "; for(auto it: x) cerr<<"["<<it.f<<", "<<it.s<<"] "; cerr<<endl;
#define dbg2D(x) cerr<<(#x)<<": \n"; for(auto y: x) { for(auto it: y) cerr<<it<<" "; cerr<<endl; } cerr<<endl;
#define dbgA(x, n) cerr<<(#x)<<": "; for(int i=0;i<n;++i) cerr<<x[i]<<" "; cerr<<endl;
#define dbgVP(x) cerr<<(#x)<<": "; for(auto it: x) cerr<<"["<<it.f<<", "<<it.s<<"] "; cerr<<endl;
 
ll INF = 1e10;
int MOD = 1e9+7;

int n, k;
ll r, s, p;
string t;

inline bool win(int x, char s){
	if(x == 0){
		if(s == 's')
			return 1;
		else
			return 0;
	}else if(x == 1){
		if(s == 'r')
			return 1;
		else
			return 0;
	}
	else{
		if(s == 'p')
			return 1;
		else
			return 0;
	}
}

ll formdp(vector<int> a){
	int N = a.size();
	ll dp[N][3];
	ll score[] = {r, p , s};
	//0 for rock, 1 for paper, 2 for scissors
	dp[0][0] = win(0, t[a[0]]) ? score[0] : 0;
	dp[0][1] = win(1, t[a[0]]) ? score[1] : 0;
	dp[0][2] = win(2, t[a[0]]) ? score[2] : 0;

	for(int i = 1; i < N; ++ i){
		dp[i][0] = (win(0, t[a[i]]) ? score[0] : 0) + max(dp[i - 1][1], dp[i - 1][2]);
		dp[i][1] = (win(1, t[a[i]]) ? score[1] : 0) + max(dp[i - 1][0], dp[i - 1][2]);
		dp[i][2] = (win(2, t[a[i]]) ? score[2] : 0) + max(dp[i - 1][0], dp[i - 1][1]);
	}

	return max(dp[N - 1][0], max(dp[N - 1][1], dp[N - 1][2]));
}


int main(){
	#ifndef ONLINE_JUDGE
        freopen("inputf.in", "r", stdin);
    #endif
    fastio();

    cin >> n >> k >> r >> s >> p >> t;

    vector<vector<int>> groups;
    set<int> keep;
    for(int i = 0; i < n; ++ i)
    	keep.insert(i);
    while(!keep.empty()){
    	int cur = *keep.begin();
    	vector<int> temp;
    	while(cur < n){
    		temp.push_back(cur);
    		keep.erase(cur);
    		cur += k;
    	}
    	groups.push_back(temp);
    }
    ll ans = 0;
    for(auto grp : groups){
    	ans += formdp(grp);
    }
    cout << ans;
    return 0;
}

/*

*/

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

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define ALL(v) (v).begin(), (v).end()
#define p(s) cout<<(s)<<endl
#define p2(s, t) cout << (s) << " " << (t) << endl
#define br() p("")
#define pn(s) cout << (#s) << " " << (s) << endl
#define p_yes() p("Yes")
#define p_no() p("No")

const ll mod = 1e9 + 7;
const ll inf = 1e18;

template < typename T >
void vprint(T &V){
	for(auto v : V){
    	cout << v << " ";
	}
	cout << endl;
}

struct Edge{
    ll to;
    ll cost;
    Edge(ll to, ll cost): to(to), cost(cost) {}
};

ll N;
vector<vector<Edge> > G;

// i : 始点
pair<ll, ll> bfs(ll i){
    vector<ll> d(N, -1);
    queue<ll> que;
 
    que.push(i);
    d[i] = 0;
 
    while(!que.empty()){
        ll a = que.front();
        que.pop();
 
        for(Edge edge : G[a]){
            ll to = edge.to;
            ll cost = edge.cost;
            if(d[to]==-1){
                d[to] = d[a]+cost;
                que.push(to);
            }
        }
    }
    ll index = max_element(ALL(d)) - d.begin();
    return make_pair(index, d[index]);
}

ll diameter(){
    auto p = bfs(0);
    ll far_i = p.first;
 
    auto p2 = bfs(far_i);
    ll d = p2.second;
    return d;
}

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

    // input
    cin >> N;
    G.resize(N);

    FOR(i, 0, N-1){
        ll a, b, c;
        cin >> a >> b >> c;
        G[a].push_back(Edge(b, c));
        G[b].push_back(Edge(a, c));
    }

    ll d = diameter();
    p(d);
    
    return 0;
}


Measured memory_bytes: 11852
#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
const long long LINF = 1e18;
#define dump(x)  cout << 'x' << ' = ' << (x) << ` `;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
typedef long long ll;
using namespace std;
typedef pair<ll, ll> P;

template<typename T>
void print(const vector<T> &x) {
    int n = x.size();
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x) {
    int n = x.size();
    rep(i,n) {
        rep(j,x[i].size()) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

template<typename T>
void print(const vector<T> &x, int n) {
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x, int n, int m) {
    rep(i,n) {
        rep(j,m) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

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; }

void input_init() {
    cin.tie(0); ios::sync_with_stdio(false);
}

ll calc1(const string &s, int n) {
    ll ret = 0;
    for (int i = 0; i < n-2; ++i) {
        for (int j = i+1; j < n-1; ++j) {
            for (int k = j+1; k < n; ++k) {
                if (j-i == k-j) continue;
                if (s[i] != s[j] && s[j] != s[k] && s[i] != s[k]) ret++;
            }
        }
    }
    return ret;
}

int main(int argc, char const *argv[]) {
    int n; cin>>n;
    string s; cin>>s;
    vector<ll> r(n+10), g(n+10), b(n+10);
    rep(i,n) {
        if (s[i] == 'R') {
            r[i+1] = r[i]+1;
            g[i+1] = g[i];
            b[i+1] = b[i];
        }
        else if (s[i] == 'G') {
            g[i+1] = g[i]+1;
            r[i+1] = r[i];
            b[i+1] = b[i];
        }
        else {
            b[i+1] = b[i]+1;
            r[i+1] = r[i];
            g[i+1] = g[i];
        }
    }

    ll ans = 0;
    for (int j = 1; j < n-1; ++j) {
        for (int k = n-1; k > j; --k) {
            set<char> st;
            st.insert(s[j]); st.insert(s[k]);
            if (st.size() == 1) continue;
            int d = k-j;
            d = j-d;
            if (!st.count('R')) {
                ans += r[j];
                if (d >= 0 && s[d] == 'R') ans--;
            }
            else if (!st.count('G')) {
                ans += g[j];
                if (d >= 0 && s[d] == 'G') ans--;
            }
            else if (!st.count('B')) {
                ans += b[j];
                if (d >= 0 && s[d] == 'B') ans--;
            }
        }
    }

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

Measured memory_bytes: 3556
use proconio::input;

#[allow(unused_mut)]
#[allow(non_snake_case)]
fn main() {
    input! {
        N: usize,
        S: usize,
        A: [usize; N]
    }

    let mut dp: Vec<Vec<u64>> = vec![vec![0; S + 1]; N + 1];
    dp[0][0] = 1;
    let m = 998244353;

    for i in 1..=N {
        for j in 0..=S {
            // 入れないグループ
            dp[i][j] = (dp[i][j] + dp[i - 1][j] * 2) % m;

            // A[i]を追加するパターン
            if j + A[i - 1] <= S {
                dp[i][j + A[i - 1]] = (dp[i][j + A[i - 1]] + dp[i - 1][j]) % m;
            }
        }
    }

    println!("{}", dp[N][S]);
}


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

#define ll long long
#define endl '\n'
#ifndef _WINDOWS
// no getchar_unlocked on Windows so just call getchar
#define getchar getchar_unlocked
#endif

template <typename Func>
inline void loop(int e, Func&& f) {
    for (int i = 0; i < e; i++) {
        std::forward<Func>(f)(i);
    }
}
template <typename Func>
inline void loop(int s, int e, Func&& f) {
    for (int i = s; i < e; i++) {
        std::forward<Func>(f)(i);
    }
}
template <typename T>
inline void scanpn(T& num) {
    register int c;
    num = 0;
    c = getchar();
    // bool negative = false;
    // if (c == '-') {
    // 	negative = true;
    // 	c = getchar();
    // }
    for (; (c > 47 && c < 58); c = getchar()) num = num * 10 + c - 48;
    // if (negative)
    //     number = -number;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    string s;
    cin >> s;
    if (s.find('7') != string::npos)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 3612
#include <cstdio>
#include <string>
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <stdlib.h>
#include <vector>
#include <map>
#include <math.h>
using namespace std;

int main() {
    int a, b, c;
    scanf("%d%d%d", &a, &b, &c);
    if ( (a+b==c) || (c+b==a) || (a+c==b) ) printf("Yes\n");
    else printf("No\n");
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)(n); i++)
#define FOR(i, a, b) for(ll i = a; i < (ll)(b); i++)

#define ALL(x) x.begin(), x.end()
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
#define SORT(x) sort(ALL(x))
#define REV(x) reverse(ALL(x))

using namespace std;
using ll = long long;
using vl = vector<ll>;
using vvl = vector<vl>;
using vs = vector<string>;
using vb = vector<bool>;
using sl = stack<ll>;
using ql = queue<ll>;

const long long INF=2305843009213693951;
const long long dx[]={0,1,0,-1,1,-1,1,-1};
const long long dy[]={1,0,-1,0,1,1,-1,-1};


void Yes(bool a){cout<<(a?"Yes":"No")<<endl;}
void YES(bool a){cout<<(a?"YES":"NO")<<endl;}

int binary_search(ll x, vl a){
    auto ite = lower_bound(ALL(a), x);
    if(ite != a.end() && *ite == x) {
        return ite - a.begin() ;
    } else {
        return -1;
    }

}

ll modpow(ll a, ll n, ll mod) {
    if(n == 0)
        return 1;
    if(n == 1)
        return a % mod;
    if(n % 2 == 1)
        return (a * modpow(a, n - 1, mod)) % mod;
    ll t = modpow(a, n / 2, mod);
    return (t * t) % mod;
}

int main() {
    string S;
    cin >> S;
    REP(i, S.size()){
        S[i] = 'x';
    }

    cout << S << endl;

    return 0;
}

Measured memory_bytes: 3612
n = int(input())
x = list(map(int, input().split()))
y = list(x)
y.sort()
if n % 2 != 0:
    a,b,c = y[n//2-1],y[n//2],y[n//2+1]
    m = b
else:
    a,b = y[n//2-1],y[n//2]    
    m = (a+b)/2
for i in range(n):
    if i == n//2:
        if n%2==0:
            tm = a
        else:
            tm = (a+c)/2
    if x[i] < m :
        if n%2==0:
            tm = b
        else:
            tm = (b+c)/2
    else:
        if n%2==0:
            tm = a
        else:
            tm = (a+b)/2
    print(int(tm))


    

Measured memory_bytes: 26772
def count_bomb(y,x):
    ans=0
    for i in range(y-1,y+2):
        for j in range(x-1,x+2):
            if i>=0 and i<h and j>=0 and j<w:
                if s[i][j]=="#":
                    ans+=1
    return ans
h,w=map(int,input().split())
s = [list(input()) for _ in range(h)]
for i in range(h):
    for j in range(w):
        if s[i][j]==".":
            s[i][j]=count_bomb(i,j)
for i in range(h):
    print(*s[i],sep="")


Measured memory_bytes: 3444
#include <iostream>
#include <iomanip>
#include <cmath>
#include <queue>
#include <map>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <functional>
using namespace std;

int minii(int mini[], int n)
{
	int min = 10000;
	for (int i = 0; i < n; ++i) {
		if (mini[i] < min)min = mini[i];
	}
	return min;
}

int main(void)
{
	string alp("abcdefghijklmnopqrstuvwxyz");
	string s;
	int altialp[50][27];
	int min[50];
	int n;
	for (int i = 0; i < 50; ++i) {
		for (int j = 0; j < 27; ++j) {
			altialp[i][j] = 0;
		}
	}
	cin >> n;
	for (int i = 0; i < n; ++i) {
		cin >> s;
		for (int j = 0; j < s.length(); ++j) {
			for (int k = 0; k < 27; ++k) {
				if (s[j] == alp[k])altialp[i][k]++;
			}
		}
	}
	int mini;
	for (int i = 0; i < 27; ++i) {
		for (int x = 0; x < 50; ++x) {
			min[x] = 0;
		}
		for (int j = 0; j < n; ++j) {
			min[j] = altialp[j][i];
			mini = minii(min, n);
			for (int k = 0; k < mini; ++k) {
				cout << alp[i];
			}
		}
	}
	cout << endl;

	return 0;
}

Measured memory_bytes: 256
import sys
input = sys.stdin.readline
li = [int(i) for i in input().split()]
N = li[0]
M = li[1]
X = li[2]
Y = li[3]
x = [int(i) for i in input().split()]
y = [int(i) for i in input().split()]
maxx = -1000
for i in range(N) :
    maxx = max(maxx,x[i])
miny = 1000
a = "War"
for i in range(M) :
    miny = min(miny,y[i])
maxx = max(X,maxx)
miny = min(Y,miny)
if maxx < miny :
    a = "No War"
print(a)

Measured memory_bytes: 3064
use std::io::stdin;

fn main() {
    let mut values = String::new();
    {
        let mut input = String::new();
        stdin().read_line(&mut input);
        values = input;
    }
    let mut stack = [0; 2];
    for (i, j) in values.split_whitespace().enumerate() {
        stack[i] = j.parse().unwrap()
    }

    {
        let mut input = String::new();
        stdin().read_line(&mut input);
        values = input;
    }
    if stack[0] < stack[1] {println!("0");return;}

    let mut vec: Vec<i64> = values.split_whitespace().map(|x| x.parse::<i64>().unwrap()).collect();
    vec.sort();
    let count_vec = &vec[0..(vec.len() - stack[1])];
    let mut times = 0;
    for i in count_vec.iter() {
        times = times + i;
        // println!("vec: {}",i );
    }
    println!("{}", times);
}

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

int main() {
    ll h,w,k;
    std::cin >> h>>w>>k;
    
    ll x1,y1,x2,y2;
    std::cin >> x1>>y1>>x2>>y2;
    x1--;x2--;y1--;y2--;
    
    vector<string> c(h);
    for (int i = 0; i < h; i++) {
        std::cin >> c[i];
    }
    vector<vector<vector<ll>>> d(h,vector<vector<ll>>(w,vector<ll>(4,1e15)));
    for (int i = 0; i < 4; i++) {
        d[x1][y1][i]=0;
    }
    
    priority_queue< pair<ll,tuple<ll,ll,ll>>,vector<pair<ll,tuple<ll,ll,ll>>>,greater<pair<ll,tuple<ll,ll,ll>>> > pq;
    for (int i = 0; i < 4; i++) {
        pq.push({0,{x1,y1,i}});
    }
    
    vector<pair<ll,ll>> dir = {{0,1},{0,-1},{1,0},{-1,0}};
    
    while(pq.size()){
        auto now = pq.top();pq.pop();
        auto [xx,yy,dd] = now.second;
        if(d[xx][yy][dd]<now.first)continue;
        
        if(0<=xx+dir[dd].first&&xx+dir[dd].first<h&&0<=yy+dir[dd].second&&yy+dir[dd].second<w&&c[xx+dir[dd].first][yy+dir[dd].second]!='@'){
            if(d[xx+dir[dd].first][yy+dir[dd].second][dd]>now.first+1){
               d[xx+dir[dd].first][yy+dir[dd].second][dd] = now.first+1;
               pq.push({now.first+1,{xx+dir[dd].first,yy+dir[dd].second,dd}});
            }
        }
        for (int i = 0; i < 4; i++) {
            if(i==dd)continue;
            if(d[xx][yy][i]>now.first/k*k+(now.first%k+k-1)/k*k){
               d[xx][yy][i]=now.first/k*k+(now.first%k+k-1)/k*k;
               pq.push({d[xx][yy][i],{xx,yy,i}});
            }
        }
    }

    ll ans = 1e16;
    for (int i = 0; i < 4; i++) {
        ans = min(ans, d[x2][y2][i]);
    }
    if(ans==1000000000000000){
        std::cout << -1 << std::endl;
        return 0;
    }
    std::cout << ans/k+(ans%k+k-1)/k << std::endl;
}


Measured memory_bytes: 144912
n,q = map(int,input().split())
queue = []
for i in range(n):
	name,time = input().split()
	queue.append([name, int(time)])

t = 0
i = 0
while queue:
	i %= len(queue)
	p = queue[i]
	t += min(q, p[1])
	if p[1] > q:
		p[1] -= q
		i += 1
	else:
		print(p[0], t)
		queue.pop(i)


Measured memory_bytes: 13012
#include <bits/stdc++.h>
#define fname "D"
#define ll long long
#define ui unsigned int
#define ull unsigned long long
#define bug(x) cerr << (#x) << " = " << (x) << '\n'
#define REP0(i, n) for(int i = 0, _n = (n); i < _n; ++i)
#define REP1(i, n) for(int i = 1, _n = (n); i <= _n; ++i)
#define REPB0(i, n) for(int i = (n) - 1; i >= 0; --i)
#define REPB1(i, n) for(int i = (n); i > 0; --i)
#define FOR(i, a, b) for(int i = (a), _b = (b); i <= _b; ++i)
#define FORB(i, a, b) for(int i = (a), _b = (b); i >= _b; --i)
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define X first
#define Y second

using namespace std;
typedef pair<int, int> ii;
typedef pair<ll, ll> pll;
typedef pair<float, float> ff;
typedef pair<double, double> dd;
const int MAX = 200002, MOD = 1000000007;
int h, w, a, b, f[MAX+2], g[MAX+2];

ll sqr(const int &x) {return (ll)x*x;}
int pw(const int &a, const int &b, const int &c)
{
	if (!b) return 1;
	else {
		if(b % 2 == 0) return sqr(pw(a, b / 2, c)) % c;
		else return ((ll)a * (sqr(pw(a, b / 2, c)) % c)) % c;
	}
}
void construct()
{
	f[0] = g[0] = 1;
	REP1(i, MAX) {
		f[i] = ((ll)f[i - 1] * i) % MOD;
		g[i] = pw(f[i], MOD - 2, MOD);
	}
}
int C(const int &k, const int &n) {return ((((ll)f[n]*g[n - k]) % MOD)*(ll)g[k]) % MOD;}

int main()
{
	if (fopen(fname".INP", "r")) {
		freopen(fname".INP", "r", stdin);
		freopen(fname".OUT", "w", stdout);
	}
	ios_base::sync_with_stdio(false); cin.tie(0);
	scanf("%d %d %d %d", &h, &w, &a, &b);
	construct();
	int ans = 0;
	REP1(i, w - b) ans = (ans + (ll)C(h - a - 1, h - a + b - 2 + i)*C(a - 1, a + w - b - 1 - i)) % MOD;
	cout << ans;
	return 0;
}

Measured memory_bytes: 1792
n=int(input())
a=sorted(list(map(int,input().split())))
if a[0]==0:
    print(0)
else:
    ans=1
    for i in a:
        ans=ans*i
        if ans>10**18:
            print(-1)
            break
    else:
        if ans>10**18:
            print(-1)
        else:
            print(ans)
            

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

using namespace std;

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

typedef long long ll;

const int Inf = 1e9;
const double EPS = 1e-9;

int gcd(int a, int b) {
    if (b == 0) {
        return a;
    } else {
        return gcd(b, a % b);
    }
}

int lcm(int a, int b) {
    return a * b / gcd(a, b);
}

int bitCount(long bits) {
    bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
    bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
    bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
    bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
    return (bits & 0x0000ffff) + (bits >>16 & 0x0000ffff);
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;  cin >> s;
    rep (i, s.size()) {
      if (s[i] == ',') s[i] = ' ';
    }
    cout << s << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main(int argc, char *argv[]){
  string str;
  cin >> str;
  int count;
  cin >> count;
  for(int i = 0; i < count; i++){
    string command;
    cin >> command;
    if (command == "replace"){
      int first,last;
      string replace_str;
      cin >> first >> last >> replace_str;
      str.replace(first, last - first + 1, replace_str);
    }else if(command == "reverse"){
      int first,last;
      cin >> first >> last;
      reverse(str.begin() + first, str.begin() + last + 1);
    }else if(command == "print"){
      int first, last;
      cin >> first >> last;
      cout << str.substr(first,last - first + 1) << endl;
    }
  }
  return 0;
}

Measured memory_bytes: 3164
#include <bits/stdc++.h>
#define BIT(n) (1LL << (n))
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPB(i, n) for (int i = 0; i < BIT(n); i++)
#define REPS(i, x) for (int i = 1; i <= (int)(x); 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 FORA(i, n) for (auto &&i : n)
#define FORS(i, m, n) for (int i = m; i <= n; i++)
#define DEBUG(x) cerr << #x << ": " << x << "\n"
#define PRINTALL(V)    \
  for (auto v : (V)) { \
    cerr << v << " ";  \
  }                    \
  cerr << "\n";
#define ALL(v) v.begin(), v.end()
#define fst first
#define snd second
#define mp make_pair
#define pb push_back
#define epb emplace_back
#define int long long
using namespace std;
template <class T> bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> using vec = std::vector<T>;
template <class T> void print(const T &x) { cout << x << "\n"; }
const int MOD = 1000000007, INF = 1061109567;
const double EPS = 1e-10, PI = acos(-1.0);
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
signed main() {
  cin.tie(0), ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  string S;
  cin >> S;
  int N = S.size();
  /*REPR(i, N) {
    REP(j, N - i + 1) {
      if (S[j] == '1') {
        REP(k, i) { S[j + k] = (S[j + k] == '0') ? '1' : '0'; }
      }
    }
    DEBUG(S);
    if (count(ALL(S), '1') == 0) {
      print(i);
      break;
    }
  }*/
  /*  int halfN = N / 2;
    int ans = halfN;
    int a[2] = {0, 0};
    if (N % 2 == 1) {
      a[S[halfN] - '0']++;
    }
    REPR(i, halfN - 1) {
      a[S[i] - '0']++;
      a[S[N - 1] - '0']++;
      if (a[0] > 0 && a[1] > 0) {
        ans = halfN - 1 - i;
        break;
      }
    }
  print(ans + halfN + ((N % 2 == 0) ? 0 : 1));
    */
  int ans = N;
  REP(i, N - 1) {
    if (S[i] != S[i + 1]) {
      chmin(ans, max(i + 1, N - 1 - i));
    }
  }
  print(ans);
}

Measured memory_bytes: 512
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
typedef long long int ll;

string S;

int main(){
	cin >> S;
	int cnt0 = 0, cnt1 = 0;
	for(int i = 0; i < S.length(); i++){
		if(S[i] == '0') cnt0++;
		else cnt1++;
	}
	cout << min(cnt0, cnt1) * 2 << endl;
	return 0;
}


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

const int MOD = 1000000007;

int main()
{
  long long N, K, S;
  cin >> N >> K >> S;
  vector<long long> ans;
  for (int i = 0; i < K; i++)
  {
    ans.push_back(S);
  }
  if (S < 100000000)
  {
    for (int i = 0; i < N - K; i++)
    {
      ans.push_back(S + 1);
    }
  }
  else
  {
    for (int i = 0; i < N - K; i++)
    {
      ans.push_back(S - 1);
    }
  }

  for (int i = 0; i < ans.size(); i++)
  {
    cout << ans[i] << " ";
  }
  cout << endl;
}


Measured memory_bytes: 2164
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD=1000000007;
#define INF 1LL<<30
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()


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

    ll maz=-1LL<<60,miz=1LL<<60,maw=-1LL<<60,miw=1LL<<60;
    rep(i,n){
        ll x,y;
        cin>>x>>y;
        ll z=x+y;
        ll w=x-y;
        maz=max(maz,z);
        miz=min(miz,z);
        maw=max(maw,w);
        miw=min(miw,w);
    }

    cout<<max(maz-miz,maw-miw)<<endl;
} 


Measured memory_bytes: 3632
#include <iostream>
#include <vector>
#include <algorithm>
#define rep(i, n) for(int i = 0; i < n; ++i)
using namespace std;

int main() {
    int N, M; cin >> N >> M;
    int P[M];
    int  Y[M];
    rep(i, M) cin >> P[i] >> Y[i];

    vector<vector<int>> PY(N);
    rep(i, M) PY[P[i]-1].push_back(Y[i]);

    rep(i, N) sort(PY[i].begin(), PY[i].end());
    rep(i, M) {
        int id = lower_bound(PY[P[i]-1].begin(), PY[P[i]-1].end(), Y[i])-PY[P[i]-1].begin() + 1;
        printf("%06d%06d\n", P[i], id);
    }
}

Measured memory_bytes: 7680
#include <bits/stdc++.h>
#define All(v) v.begin(), v.end()
using namespace std;
typedef long long lint;
typedef pair<int, int> pii;
typedef pair<lint, lint> pll;
struct edge{int to; lint cost;};

int ans[(int)1e5 + 5];
vector<edge> G[(int)1e5 + 5];

void dfs(int s, int p, lint d){
    if(d%2==0) ans[s] = 0;
    else ans[s] = 1;
    for(auto e : G[s]){
        if(e.to==p) continue;
        dfs(e.to, s, d+e.cost);
    }
}

int main(){
    ios::sync_with_stdio(false), cin.tie(nullptr);
    int N; cin >> N;
    for(int i=0;i<N-1;i++){
        int u, v, c; cin >> u >> v >> c;
        edge e1 = {v, c}, e2 = {u, c};
        G[u].push_back(e1);
        G[v].push_back(e2);
    }

    dfs(1, -1, 0);

    for(int i=1;i<=N;i++) printf("%d\n", ans[i]);
    return 0;
}

Measured memory_bytes: 9856
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <stdlib.h>

using namespace std;

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

    printf("%d %d %.8lf \n", a/b, a%b, (double)a/(double)b);
    
    
    return 0;
}

Measured memory_bytes: 3204
/**   Created by: Marcos Portales
          Codeforces User: marcosportales
          Country: Cuba
          Copyright                    */
#include<bits/stdc++.h>
using namespace std;
/// Pragmas:
#pragma GCC optimize("Ofast","unroll-loops","omit-frame-pointer","inline") //Optimization flags
#pragma GCC option("arch=native","tune=native","no-zero-upper") //Enable AVX
#pragma GCC target("avx2") //Enable AVX
/// Macros:
#define int long long
#define f first
#define s second
#define db(x) cerr << #x << ": " << (x) << '\n';
#define pb push_back
#define lb lower_bound
#define up upper_bound
#define all(x) x.begin() , x.end()
#define rall(x) x.rbegin() , x.rend()
#define enl '\n'
#define vi vector<int>
#define sz(a) int((a).size())
#define rep(i,n) for(int i=0;i<(n);i++)
#define repi(i,n) for(int i=(1);i<=(n);i++)
typedef pair<int,int> ii;
typedef long double ld;
typedef unsigned long long ull;
/// Constraints:
const int maxn = 200005;
const int mod = 1000000007;
const ld eps = 1e-9;
const int inf = ((1ll<<31ll)-1ll);
const int INF = 2000000000000000000ll;
const ld pi = acos(-1);
/// Prime Numbers:
// 2, 173, 179, 181, 197, 311, 331, 737, 1009, 2011, 2027, 3079, 4001, 10037, 10079, 20011, 20089;
// 100003, 100019, 100043, 200003, 200017, 1000003, 1000033, 1000037, 1000081;
// 2000003, 2000029, 2000039, 1000000007, 1000000021, 2000000099;
/// Functions:
#define lg2(x) 31 - __builtin_clz(x)
#define lgx(x,b) ( log(x) / log(b) )
/// Red-Black Tree Test.insert(x)late ---------------------------------
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
//typedef tree < long long ,  null_type ,  less<long long> ,  rb_tree_tag ,  tree_order_statistics_node_update > ordered_set;
/// Quick Pow------------------------------------------------
int qpow(int b,int e){
    if( !e ) return 1;
    if( e & 1 ) return qpow(b,e-1) * b % mod;
    int pwur = qpow(b,e>>1);
    return (pwur * pwur) % mod;
}
int modinv(int x){
    return qpow(x,mod-2);
}

/// My Code -------------------------------------------------

bool can(int n){
    int num=n,s=0;
    for(;num>0;num/=10){
        s+=(num%10);
    }
    if(n%s==0)
    return true;
    else return false;
}
bool f[105][10];
int p[105][10];

int32_t main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
    cout.setf(ios::fixed); cout.precision(0);
    srand(time(NULL));
    //freopen("a.in","r",stdin);
    //freopen("a.in","w",stdout);
    int n;
    cin>>n;
    rep(i,n){
        rep(j,10)cin>>f[i][j];
    }
    rep(i,n){
        rep(j,11)cin>>p[i][j];
    }
    int ans=-inf;
    for(int bit = 1; bit < (1 << 10); bit++){
        int sum = 0;
        for(int i = 0; i < n; i++){
            int tmp = 0;
            for(int j = 0; j < 10; j++){
                if(f[i][j] == true && ((bit >> j) & 1) == 1) tmp++;
            }
            sum += p[i][tmp];
        }
        if(ans < sum) ans = sum;
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3644
import math
def nCr(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
from collections import Counter
N,M = map(int,input().split())
a_ls = list(map(int, input().split()))

for i in range(N):
    a_ls[i] = a_ls[i]%M
a_csum = [0] * N
now = 0
for i in range(N):
    now += a_ls[i]
    now %= M
    a_csum[i] = now

a_csum.append(0)
c = Counter(a_csum)
ans = 0
for value,time in c.items():
    if time >= 2:
        ans += nCr(time,2)
print(ans)

Measured memory_bytes: 95768
//////AGC039-B//////
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define For(i,n,k) for(ll i=(n);i<(k);i++)
ll n,ans=1;
string s;
void Main(){
    cin>>n>>s;
    For(i,1,n){
        if(s.at(i)!=s.at(i-1)) ans++;
    }
    cout<<ans<<endl;
}
int main(){
    Main();
    return 0;
}


Measured memory_bytes: 512
#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <cmath>
#define rep(i,cc,n) for(int i=cc;i<=n;++i)
#define drep(i,cc,n) for(int i=cc;i>=n;--i)
typedef long long ll;
using namespace std;
int main(){
    ll h,n;
    cin>>h>>n;
    int a[n];
    ll sum = 0;
    rep(i,0,n-1){
        cin>>a[i];
        sum += a[i];
    }
    if(h-sum<=0)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}

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

#define int long long
const double PI = 3.14159265358979323846;
typedef vector<int> vint;
typedef pair<int, int> pint;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
// cout << fixed << setprecision(20);

int a[3];
signed main() {
    cin>>a[0]>>a[1]>>a[2];
    sort(a,a+3);
    cout<<a[0]*a[1]/2;
}


Measured memory_bytes: 256
n,m,x = map(int,input().split())
ca = [list(map(int,input().split())) for _ in range(n)]
c = [ca[i][0] for i in range(n)]
a = [ca[i][1:] for i in range(n)]
l = 0
ans = sum(c) 
for i in range(2 ** n):
    get = [0] * m
    kari = 0
    for j in range(n):
        if (i >> j) & 1: #i(ex.5)を2進数(ex.101)に一桁ずつ変換
            get = [x + y for (x, y) in zip(get, a[j])]
            kari += c[j]
    #print(get,kari)
    #print([k >= x for k in get])
    if all([k >= x for k in get]):
        ans = min(ans,kari)
        l += 1
if l == 0:
    ans = -1
    
print(ans)
     

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


using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)

int gcd(ll a, ll b) {
    return b ? gcd(b, a % b) : a;
}

int lcm(ll a, ll b) {
    return (a*b)/gcd(a, b);
}

typedef pair<int, int> P;
int main() {

    int n; cin >> n;
    vector<int> d(n);
    rep(i, n) {
        cin >> d[i];
    }

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

    int max_num = d[n/2];
    int min_num = d[(n/2)-1];

    cout << max_num - min_num << endl;


}


Measured memory_bytes: 640
import java.util.*;

public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int cout = 0;
		for(int i = 0; i < 3; i++) {
			if(s.charAt(i) == 'o') {
				cout++;
			}
		}
		System.out.println(700 + cout * 100);
	}
}

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

int cnt_chocolates(int d, int a){
    int cnt = 0;
    for(int i=0;i<=d;i++){
        if(i*a+1<=d) cnt = cnt + 1;
    }
    return cnt;
}

int main()
{
    // 整数の入力
    int n, d, x;
    cin >> n;
    cin >> d >> x;
    
    // input of a_i
    int a[n+1];
    for(int i=1;i<=n;i++){
        cin >> a[i];
    }

    // count of chocolates
    int cnt_all = 0;
    for(int i=1;i<=n;i++){
        cnt_all = cnt_all + cnt_chocolates(d, a[i]);
    }

    // 出力
    cout << cnt_all + x << endl;
    return 0;
}

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

const ll mod = ll(1e9) + 7;
const int INF = 1<<29;
const ll lINF = 1l<<40;

int main(){
    ll n;
    cin >> n;
    vecLL a(5);
    rep(i,0,5) cin >> a[i];
    ll mi = a[0];
    rep(i,0,5){
        mi = min(mi,a[i]);
    }
    ll ans = (n + (mi - 1)) / mi + 5 - 1;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int A = a;
		int B = b;
		for (int i = 1; i < b; i++) {
			A = A*10+a;
		}
		for (int i = 1; i < a; i++) {
			B = B*10+b;
		}
		System.out.println(A>B?A:B);
		sc.close();
	}
}

Measured memory_bytes: 24276
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i=0;i<(n);++i)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define all(x) (x).begin(), (x).end()
#define PI 3.14159265358979323846264338327950L
using namespace std;
typedef long long ll;
typedef long double ld;
int main() {
    vector<int> s(3);
    rep(i,3) cin>>s[i];
    sort(all(s));
    int a=s[2],b=s[1],c=s[0],cnt=0;
    if((a-b)%2==(a-c)%2) cnt=a-b+(b-c)/2;
    else cnt=a-b+(b-c+1)/2+1;
    cout<<cnt;
}

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

int main() {
  int n;
  cin>>n;
  vector<int> t,x,y;
  bool result=true;
  
  for(int i=0;i<n;i++){
    int a,b,c;
    cin>>a>>b>>c;
    t.push_back(a);
    x.push_back(b);
    y.push_back(c);
  }
  
  for(int i=0;i<n;i++){
    if(t.at(i)<x.at(i)+y.at(i) || ( x.at(i)+y.at(i) )%2!=( t.at(i)%2 )){
      result=false;
    }
  }
  if(result) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}


Measured memory_bytes: 1644
import sys
input = sys.stdin.readline

N = 26

D = int(input())
Cs = list(map(int, input().split()))
Sss = [tuple(map(int, input().split())) for _ in range(D)]
Ts = [int(input())-1 for _ in range(D)]

anss = []
score = 0
dayLasts = [-1] * N
for day, T in enumerate(Ts):
    score += Sss[day][T]
    dayLasts[T] = day
    for C, dayLast in zip(Cs, dayLasts):
        score -= C * (day-dayLast)
    anss.append(score)

print('\n'.join(map(str, anss)))


Measured memory_bytes: 9384
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値を求める
#define MIN(x) *min_element(ALL(x)) //最小値を求める
typedef long long ll;

int main(){
    int n,k;
    cin>>n>>k;
    int hight,count=0;
    REP(i,n){
        cin>>hight;
        if(hight>=k){
            count++;
        }
    }
    cout<<count;
    return 0;
}


Measured memory_bytes: 256
import java.util.*;
public class Main 
{
	public static void main(String[] args) 
	{
		Scanner stdIn = new Scanner(System.in);
		int[][] route = new int[52][52];
		char[][] cicada = new char[52][52];
		int H = stdIn.nextInt();
		int W = stdIn.nextInt();
		for(int i = 0; i < H; ++i)
		{
			String str = stdIn.next();
			for(int j = 0; j < str.length(); ++j)
			{
				cicada[i][j] = str.charAt(j);
			}
		}
		for(int i = 0; i < H; ++i)
		{
			for(int j = 0; j < W; ++j)
			{
				route[i][j] = 999999999;
			}
		}
		route[0][0] = 0;
		for(int i = 0; i < H; ++i)
		{
			for(int j = 0; j < W; ++j)
			{
				if(route[i][j + 1] > route[i][j] + cicada[i][j + 1] - '0')
				{
					route[i][j + 1] = route[i][j] + cicada[i][j + 1] - '0';
				}
				if(route[i + 1][j] > route[i][j] + cicada[i + 1][j] - '0')
				{
					route[i + 1][j] = route[i][j] + cicada[i + 1][j] - '0';
				}
			}
		}
		System.out.println(route[H - 1][W - 1]);
	}
}

Measured memory_bytes: 12000
def main():
    from sys import setrecursionlimit, stdin, stderr
    from os import environ
    from collections import defaultdict, deque, Counter
    from math import ceil, floor
    from itertools import accumulate, combinations, combinations_with_replacement
    setrecursionlimit(10**6)
    dbg = (lambda *something: stderr.write("\033[92m{}\033[0m".format(str(something)+'\n'))) if 'TERM_PROGRAM' in environ else lambda *x: 0
    input = lambda: stdin.readline().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    P = 10**9+7
    INF = 10**18+10
    N,K = LMIIS()
    P = list(map(lambda x: int(x)-1,input().split()))
    C = LMIIS()
    score_sets = []
    used = [False]*N
    tmp = P[0]
    for i in range(N):
        if not used[i]:
            tmp = i
            score_set = []
            while not used[tmp]:
                used[tmp] = True
                tmp = P[tmp]
                score_set.append(C[tmp])
            score_sets.append(score_set)
        
    ans = -INF
    for score_set in score_sets:
        # 合計が最大になる区間を探す
        len_set = len(score_set)
        sum_score_set_real = sum(score_set)
        sum_score_set = max(0,sum_score_set_real)


        
        for i in range(len_set):
            cum_sum_1 = 0
            for j in range(i,min(len_set, i+K)):
                cum_sum_1 += score_set[j]
                num_move = j-i+1
                tmp_max = cum_sum_1 + (K - num_move) // len_set * sum_score_set
                ans = max(ans, tmp_max)

        for i in range(1,len_set-1):
            cum_sum_2 = sum_score_set_real
            for j in range(i,min(len_set-1-(K-i),len_set-1)):
                cum_sum_2 -= score_set[j]
            for j in range(max(i,len_set-1-(K-i)),len_set-1):
                cum_sum_2 -= score_set[j]
                num_move = len_set - (j-i+1)
                tmp_max = cum_sum_2 + (K - num_move) // len_set * sum_score_set
                ans = max(ans,tmp_max)






        
                
    print(ans)

    
main()

Measured memory_bytes: 75220