akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cstring>
using namespace std;
int MAX = 200005;

int main(){
    char a[MAX];
    char b[MAX];
    cin>>a;
    cin>>b;
    int c = strlen(a);
    int d = strlen(b);
    int n = (c>d?c:d);
    int t = 0;
    for(int i = 0;i < n;i++){
        if(a[i]!=b[i]){t++;}
    }
    cout<<t;
    return 0;

}

Measured memory_bytes: 3980
#include <iostream>
#include <algorithm>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <queue>
#include <cmath>

// output
#define SPBR(w, n) std::cout<<(w + 1 == n ? '\n' : ' ');
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
// utility
#define ALL(i) (i).begin(), (i).end()
#define FOR(i, a, n) for(int i=(a);i<(n);++i)
#define RFOR(i, a, n) for(int i=(n)-1;i>=(a);--i)
#define REP(i, n) for(int i=0;i<int(n);++i)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define IN(a, x, b) (a<=x && x<b)
#define OUT(a, x, b) (x<a || b<=x)
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; }

// type/const
#define int ll
using ll = long long;
using ull = unsigned long long;
using ld = long double;
const int MOD = 1000000007;
const int INF = 1e18;

using namespace std;


signed main() {
  int N;
  cin >> N;

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

  pair<int, int> mi = {INF, 0}, ma = {-INF, 0};
  REP(i, N){
    if(mi.first > A[i]){
      mi.first = A[i];
      mi.second = i;
    }
    if(ma.first < A[i]){
      ma.first = A[i];
      ma.second = i;
    }
  }

  cout << 2*N-1 << endl;
  if(abs(mi.first) <= abs(ma.first)){
    REP(i, N){
      cout << ma.second+1 << " " << i+1 << endl;
      A[i] += ma.first;
    }
  }else{
    REP(i, N){
      cout << mi.second+1 << " " << i+1 << endl;
      A[i] += mi.first;
    }
  }
  
  if(A[0] >= 0){
    REP(i, N-1){
      cout << i+1 << " " << i+2 << endl;
      A[i+1] += A[i];
    }
  }else{
    RFOR(i, 1, N){
      cout << i+1 << " " << i << endl;
      A[i-1] += A[i];
    }
  }

  return 0;
}

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

#define F first
#define S second
#define PB push_back
#define PP pop_back
#define sz(x) (int)(x.size())

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

const int mod = 1e9 + 7;

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

	int n, k;
	cin >> n >> k;
	n++;
	ll out = 0;
	for (int i = k; i <= n; i++) {
		ll minposs = (ll)i * (i - 1) / 2LL;
		ll maxposs = (ll)i * ((n - 1) + n - i) / 2LL;
//		cout << minposs << ' ' << maxposs;
//		cout << endl;
		out = ((maxposs - minposs) % mod + (out % mod) + 1) % mod;
	}
	cout << out << endl;
	return 0;
}


Measured memory_bytes: 3612
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <utility>
#include <string>
#include <stack>
#include <regex>
#include <numeric>
#include <queue>
#include <set>
 
#define REP(i, n) for (int i = 0; i < n; i++)
#define ALL(v) (v).begin(), (v).end()
 
using namespace std;
 
typedef long long ll;

int main(int argc, char const *argv[])
{
  string s;
  cin >> s;
  if (s == "A"){
    cout << "T" << endl;
  }
  else if ( s == "T") {
    cout << "A" << endl;
  }
  else if (s == "C") {
    cout << "G" << endl;
  }
  else if (s == "G") {
    cout << "C" << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; i++)
using namespace std;
long long modpow(long long a, long long n, long long m) {
    if (n == 0) return 1;
    long long half = modpow(a, n/2, m);
    long long res = half * half % m;
    if (n & 1) res = res * a % m;
    return res;
}
int main() {
    int k;
    cin >> k;
    queue<long long> lunlun;
    vector<int> res;
    int currentLunlun = 9;
    rep(i, 9) {
        lunlun.push(i+1);
    }
    if(k <= 9) {
        cout << k << endl;
        return 0;
    }
    while(true) {
        long long num = lunlun.front();
        lunlun.pop();
        long long d = modpow(num, 1, 10);
        if (d == 0) {
            lunlun.push(10*num + 0);
            lunlun.push(10*num+1);
            currentLunlun += 2;
            if (currentLunlun >= k) {
                if(currentLunlun == k)  {
                    cout << 10*num+1 << endl;
                } else {
                    cout << 10*num+0 << endl;
                }
                break;
            } else {
                continue;
            }
        }
        if (d == 9) {
            lunlun.push(10*num + 8);
            lunlun.push(10*num+9);
            currentLunlun += 2;
            if (currentLunlun >= k) {
                if(currentLunlun == k)  {
                    cout << 10*num+9 << endl;
                } else {
                    cout << 10*num+8 << endl;
                }

                break;
            } else {
                continue;
            }
        }
        lunlun.push(10*num+d-1);
        lunlun.push(10*num+d);
        lunlun.push(10*num+d+1);
        currentLunlun += 3;
       if (currentLunlun >= k) {
           if(currentLunlun == k)  {
                cout << 10*num+d + 1 << endl;
                break;
            }
           if(currentLunlun-1==k) {
               cout << 10*num+d << endl;
               break;
            }
            cout << 10*num+d -1 << endl;
            break;
        } else {
            continue;
        }

    }



    return 0;
}


Measured memory_bytes: 768
#include <bits/stdc++.h>
#define boost ios_base::sync_with_stdio(0); cin.tie(); cout.tie()
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define endl '\n'
#define len(a) a.length()
#define TIME cout << endl << "Time execute: " << clock() / (double)CLOCKS_PER_SEC << " sec" << endl;
#define f first
#define s second

#pragma GCC optimize("-O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")

using namespace std;

typedef long long ll;

const int Iinf = 1e9;
const long long LLinf = 1e18;
const double eps = 1e-6;
const long long mod = 998244353;

bool is_prime (ll a) {
    for (ll i = 2; i <= sqrt(a); i++)
        if (a % i == 0)
            return false;
    return true;
}

ll binpow (ll a, ll n) {
	ll res = 1;
	while (n) {
		if (n & 1LL)
			res = (res * a) % mod;
		a = (a * a) % mod;
		n >>= 1LL;
	}
	return res;
}

ll string_to_int (string s) {
    reverse(all(s));
    int pw = 1;
    int ans = 0;
    for (int i = 0; i < len(s); i++) {
        ans += (s[i] - '0') * pw;
        pw *= 10;
    }
    return ans;
}

ll div_up (ll x, ll y) {
    if (x == 0)
        return 0;
    return (x - 1) / y + 1;
}

int32_t main()
{
    boost;
    int l, r, d; cin >> l >> r >> d;
    int ans = 0;
    for (int i = l; i <= r; i++) {
        ans += (i % d == 0);
    }
    cout << ans;
    return 0;
}

/*

*/


Measured memory_bytes: 3572
#include <bits/stdc++.h>
  
using namespace std;
  
template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }
  
#define pb push_back
#define mp make_pair
#define cotu cout
#define itn int
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int i = 0; i < n; ++i)
#define repr(i,n) for(int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for(int i = (a); i <=(n); ++i)
#define repst(i, n) for(auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for(int i = (n); i >= (a); --i)
  
#define ordered_set tree<int , null_type,less<int >, rb_tree_tag,tree_order_statistics_node_update> 
  
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
  
typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
  
const int inf = int(1e9);
const int mod = inf + 7;
const int N = 1e6 + 555; // TL MB
const double PI = acos(-1.0);
 
void mul(ll &x, ll y){
	x *= y;
	if(x >= mod) x %= mod;
}
 
void add(ll &x, ll y){
	x += y;
	if(x >= mod) x -= mod;
	if(x < 0) x += mod;
}
ll bp(ll a, ll n){
	ll r = 1;
	while(n){
		if(n & 1) mul(r, a);
		mul(a, a);
		n >>= 1;
	}
	return r;
}

void solve()
{
	int a[3];
	rep(i, 3) cin >> a[i];
	sort(a, a + 3);
	cout << a[0] + a[1];
}


 
 
int main()
{
    Red;
  	// int T; cin >> T; while(T--)
    solve();
    return 0;
}

Measured memory_bytes: 256
n, mm, k = map(int,input().split())

mod = 998244353

l = 3*10**5 + 3

M = [1]  # i!のmod
m = 1
for i in range(1, l):
    m = (m * i) % mod
    M.append(m)

def pow(x, y, mod):  # x**y の mod を返す関数
    ans = 1
    while y > 0:
        if y % 2 == 1:
            ans = (ans * x) % mod
        x = (x**2) % mod
        y //= 2
    return ans

def inv(x, mod):  # x の mod での逆元を返す関数
    return pow(x, mod-2, mod)

# print(inv(8,13))

MI = [0] * (l-1) +[inv(M[l-1], mod)]  # i!の逆元
for i in range(l-2, -1, -1):
    MI[i] = MI[i+1] * (i+1) % mod

def C(x, y):  # コンビネーション
    if y < 0 or y > x:
        return 0
    elif x > l:  # O(min(y, x-y))
        y = min(y, x-y)
        ans = 1
        for i in range(x, x-y, -1):
            ans = (ans * i) % mod
        return (ans * MI[y]) % mod
    else:  # O(1)
        ans = M[x]
        ans = (ans * MI[y]) % mod
        return (ans * MI[x-y]) % mod

MM1 = [1, mm-1]
for i in range(l):
    MM1.append((MM1[-1] * (mm-1)) % mod)
# print(MM1[:5])

ans = 0
for i in range(k+1):
    
    ans = (ans + (mm * MM1[n-i-1] * C(n-1, i))) % mod
    # print(i, ans)

print(ans%mod)

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

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

  
  cout <<n*(n-1)/2+m*(m-1)/2;
  
}


Measured memory_bytes: 3620
#include <bits/stdc++.h>
#include <ext/rope>
#define VALHALLA cin.tie(0);ios_base::sync_with_stdio(false);cout<<fixed<<setprecision(13);cerr<<fixed<<setprecision(5);
#define endl "\n"
#define pb push_back
#define all(v) v.begin(),v.end()
#define debug(x) std::cerr << #x << ": " << (x) << '\n';
#define sz(x) (int)x.size()
#define fast(map_name) map_name.reserve(1024);map_name.max_load_factor(0.25);
using namespace std;
using namespace __gnu_cxx;
typedef long long int ll;
typedef pair<int,int> ii;
typedef complex<double> point;
const double epsilon=1e-9;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const ll mod=1e9+7;
/* VARIABLE DECLARATION START */
int globe[int(1e6)];
/*  FUCNTION TEMPLATE STARTS  HERE */
double dot(point a,point b){ return (conj(a)*b).real() ; }
double cross(point a,point b){ return (conj(a)*b).imag() ; }
double dist(point a, point b){ return abs(a-b); }
struct neal {
static uint64_t splitmix64(uint64_t x)
 {
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
}
size_t operator()(uint64_t x) const
 {
    static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
}
};
struct HASH{
  size_t operator()(const pair<int,int>&x)const{
    return (size_t) x.first * 37U + (size_t) x.second;
  }
};
bool isprime(ll n) {
    if (n == 2 || n == 3) return true;
    if (n < 2 || n % 2 == 0 || n % 3 == 0) return false;
    for (ll i = 6; (i - 1) * (i - 1) <= n; i += 6) {
        if (n % (i - 1) == 0 || n % (i + 1) == 0) {
            return false;
        }
    }
    return true;
}
inline ll exp(ll a, ll b, ll mod) {
    ll n = 1;
    ll p = a;
    while (b > 0) {
        if (b % 2 == 1) {
            n *= p;
            n %= mod;
        }
        p *= p;
        p %= mod;
        b /= 2;
    }
    return n;
}

inline bool comp(double a,double b)
{
  return (fabs(a-b)<epsilon);
}
ll gcd(ll u, ll v) {
  ll r;
  while (0 != v) {
    r = u % v; u = v; v = r;
  }
  return u;
}
/*  FUCNTION TEMPLATE ENDS HERE */
int main()
{
   VALHALLA
   ll a,b,x;
   cin>>a>>b>>x;
   ll cnt1=b/x;
   ll cnt2=a/x;
   if(a%x==0)
   {
     cout<<cnt1-cnt2+1<<endl;
   }
   else
    cout<<cnt1-cnt2<<endl;


   
}



Measured memory_bytes: 256
import math
from itertools import accumulate

Q=int(input())
lr=[list(map(int,input().split())) for _ in range(Q)]

MAX=10**5
lim=int(math.sqrt(MAX))
primes=[2]
table=[i+1 for i in range(2,MAX,2)]
while lim>table[0]:
  primes.append(table[0])
  table=[j for j in table if j%table[0]!=0]
primes=set(primes+table)

similars=[0]*MAX
for i in range(2,MAX):
  if i in primes and (i+1)//2 in primes:
    similars[i]=1
similars=list(accumulate(similars))

for i in lr:
  l,r=i
  print(similars[r]-similars[l-1])

Measured memory_bytes: 32504
//高知能系Vtuberの高井茅乃です。
//Twitter: https://twitter.com/takaichino
//YouTube: https://www.youtube.com/channel/UCTOxnI3eOI_o1HRgzq-LEZw

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

#define INF 1999999999
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(int i=1;i<=n;i++)
#define MODA 1000000007 

int main() {
	int ans = 0;
	int tmp;
	ll n, a, b;
	cin >> n >> a >> b;
	ll c, d, e;
	cin >> c >> d >> e;
	ll mi = min({a, b, c, d, e});

	cout << 4 + (n + mi -1) / mi << endl;
}

Measured memory_bytes: 256
alphabets = [i for i in range(ord('a'), ord('z') + 1)]
lists = [ord(i) for i in input()]
lists=list(set(lists))
lists.sort()
for i in range(len(alphabets)):
    if i+1>=len(lists) and i!=25:
        if alphabets[i] == lists[i]:
            print(chr(alphabets[i+1]))
            exit(0)
    if alphabets[i]!=lists[i]:
        print(chr(alphabets[i]))
        exit(0)


print('None')


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


#define rp(i, k, n) for (int i = k; i < n; i++)
typedef long long ll;
typedef double ld;

ll mod = 1000000007ll;
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; }
const ll inf = 1ll << 60;

int gcc(int n, int m) {
    int a = max({n, m});
    int b = min({n, m});
    if(b == 0) return a;
    int c;
    while(a % b != 0){
        c = a % b;
        a = b;
        b = c;
    }
    return b;
}

int main() {
    int n, k;
    scanf("%d%d", &n, &k);
    double ans = 0.0;
    rp(i, 1, n+1){
        double p = 1;
        int f = i;
        while(f < k){
            p /= 2;
            f *= 2;
        }
        ans += p;
    }
    ans /= n;
    cout << fixed << setprecision(12) << ans << endl;
    return 0;
}



Measured memory_bytes: 256
#include <stdio.h>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
#include <functional>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef vector<vector<int>> v2int;
typedef vector<ll> vll;
typedef vector<vector<ll>> v2ll;
typedef list<int> liint;
typedef pair<int, int> pint;
const int INF = int(2e9);
const ll LINF = ll(2e9) * ll(2e9);
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T, class C> void chmax(T& a, C b) { a > b ? : a = b; }
template<class T, class C> void chmin(T& a, C b) { a < b ? : a = b; }

bool judge(vector<set<int>>& pos, string& s) {
    int now_pos = -1;
    for (auto &t : s) {
        auto it = pos[t - 0x30].upper_bound(now_pos);
        if (it == pos[t - 0x30].end()) {
            return false;
        }
        now_pos = *it;
    }
    return true;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int N;
    cin >> N;
    string S;
    cin >> S;

    vector<set<int>> pos(10);
    rep(i, S.size()) {
        pos[S[i] - 0x30].insert(i);
    }
    int ans = 0;
    rep(x, 1000) {
        string xs = to_string(x);
        if (xs.size() < 3) xs = "0" + xs;
        if (xs.size() < 3) xs = "0" + xs;
        if (judge(pos, xs) == true) ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1664
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;

const int MAXN = 100000+9;
char S[MAXN];
int len;
int ans;

int main(){
	scanf("%s",S+1);
	len=strlen(S+1);
	ans=len;
	for(int i=1;i<len;i++){
		if(S[i]!=S[i+1])
			ans=min(ans,max(i,len-i));
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 256
//                             ¯\_(ツ)_/¯   
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mma,ava,tune=native")
//#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>

#define pb push_back
#define sz(a) ((int)(a).size())
#define all(a) (a).begin(),(a).end()
#define ll long long

using namespace std;

void file(){
	#ifndef ONLINE_JUDGE
    	freopen("in.txt", "r", stdin);
	#endif
}
int tc;

const int N=2e5+5,M=2e6+5,MOD=1e9+7,OO=1e9;

int main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	//file();
	
	int n;

	cin>>n;
	string a;
	set<string>s;
	for(int i=0;i<n;i++)cin>>a,s.insert(a);
	cout<<sz(s)<<endl;
}


Measured memory_bytes: 19284
#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++)


int main() {
  long d;
  cin>>d;
  vector<long>c(26);
  rep(i,26){
    cin>>c.at(i);
  }
  vector<vector<long>>s(d,vector<long>(26));
  rep(i,d){
    rep(j,26){
      cin>>s[i][j];
    }
  }
  vector<long>ch(26);
  
  rep(i,d){
    long now=0;
    long ans=-1001001001;
    rep(j,26){
      
    
      long mi=0;
      rep(k,26){
        if(k!=j){
          mi+=c[k]*(i+1-ch[k]);
        }
      }
      if(ans<s[i][j]-mi){
        ans=s[i][j]-mi;
        now=j;
      }
    }
    cout<<now+1<<endl;
    ch[now]=i+1;
  }
  
}




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

int main(){
	int n, p;
	while( cin >> n ){
		vector<int> vc;
		int ans = 0;
		for(int i=0 ; i<n ; i++ ){
			cin >> p;
			vc.push_back(p);
		}
		sort( vc.begin() , vc.end() );
		for(int i=0 ; i<n ; i++ ){
			ans += vc[i]*(n-i);
		}
		cout << ans << endl;
	}
}

Measured memory_bytes: 0
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <iomanip>
using namespace std;
#define pb push_back
#define pf push_fron
#define INF 1000000000
typedef long long ll;


int main() {
	/*cin.tie(0);
	ios::sync_with_stdio(false);*/
	ll n, m;
	ll cnt = 0;
	cin >> n >> m;

	if (n == 1 && m == 1)cnt = 1;
	else if (n == 1)cnt = m - 2;
	else if (m == 1) cnt = n - 2;
	else if (n == 2 || m == 2) cnt = 0;
	else cnt = (n - 2)*(m - 2);

	cout << cnt << 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);

		while (true) {

			// ?????????????????\???
			String input = sc.nextLine();

			// 0?????\?????????????????????
			if (input.equals("0"))
				break;

			// ??\?????????????????????char????????????
			char[] sentence = input.toCharArray();

			// ????¨?????????\???????????°
			int sum = 0;

			// ???????????°??????????¨?????¨????????????????
			for (int cnt = 0; cnt < sentence.length; cnt++) {

				sum += Character.getNumericValue(sentence[cnt]);

			}
			System.out.println(sum);
		}
		sc.close();
	}
}

Measured memory_bytes: 26680
//IOI 2021

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

#define pb push_back
#define ff first
#define ss second

typedef long long ll;
typedef pair<int, int> pii;

const int MAXN = 2 * 1000 + 17;

int a, b;

int main() {
	ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cin >> a >> b;
	if (a > b)
		swap(a, b);
	if ((a <= 0 && b >= 0) || (a == 0 || b == 0))
		cout << "Zero";
	else if (a < 0) {
		if ((b - a) % 2 == 0)
			cout << "Negative";
		else
			cout << "Positive";
	}
	else {
		cout << "Positive";
	}
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
const int INF = 1000000000;
const long INF64 = 1000000000000000ll;
const int MOD = 1000000007;
int main(){
	char c;
	std::cin >> c;
	if(c=='a'||c=='i'||c=='u'||c=='o'||c=='e')std::cout <<"vowel"  << std::endl;
	else std::cout <<"consonant" << std::endl;
}


Measured memory_bytes: 256
#include <stdio.h>
#define N 200001
#define NT -1

struct Node{
    int p,left,right;
};

struct Node T[N];
int getDepth(int p){
    if(T[p].p == NT) return 0;
    return getDepth(T[p].p)+1;
}
int main()
{
    int n,i,key,j,c;
    int id,temp;
    int depth[N];

    scanf("%d",&n);

    for( i=0;i<n;i++){

      T[i].p=T[i].left=T[i].right=NT;
    }
    
    for(i=0;i<n;i++){

      scanf("%d%d",&id,&key);

	for(j=0;j<key;j++){

	  scanf("%d",&c);

	    if(j==0){
                T[id].left=c;
                T[c].p=id;
                temp=c;
            }

	    else{
                T[temp].right=c;
                T[c].p=id;
                temp=c;
            }
        }
    }
    for(i=0;i<n;i++)
      depth[i]=getDepth(i);
    
    for(i=0;i<n;i++){
      printf("node %d: parent = %d, depth = %d, ",i,T[i].p,depth[i]);

      if(T[i].p==NT)
	printf("root, [");
      else  if(T[i].left==NT)
	printf("leaf, [");
       
      else
	printf("internal node, [");

      if(T[i].left != NT){
	printf("%d",T[i].left);
                temp = T[i].left;
		
                while(1){
                    if(T[temp].right==NT) break;
                    printf(", %d",T[temp].right);
                    temp = T[temp].right;
                }
		
            }
            printf("]\n");
        }
  return 0;
}



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

int main(){
    int A;
    int B;

    cin >> A >> B;
    if(0 <= A && A < 6){
        cout << 0 << endl;
    } else if(A > 12){
        cout << B << endl;
    } else {
        cout << B / 2 << endl;
    }
    return 0;
}

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

int main()
{
    string s;
    cin>>s;
    int cnt=0;
    for(int i=0;i<s.size();i++)
    {
        cnt+=(int)(s[i]-'0');
        cnt=cnt%9;
    }
    if(cnt==0)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}


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

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

  if(x>=400&&x<=599) {
    cout<<8;
  }
  else if(x>=600&&x<=799) {
    cout<<7;
  }
  else if(x>=800&&x<=999) {
    cout<<6;
  }
  else if(x>=1000&&x<=1199) {
    cout<<5;
  }
  else if(x>=1200&&x<=1399) {
    cout<<4;
  }
  else if(x>=1400&&x<=1599) {
    cout<<3;
  }
  else if(x>=1600&&x<=1799) {
    cout<<2;
  }
  else if(x>=1800&&x<=1999) {
    cout<<1;
  }
  cout<<endl;


}


Measured memory_bytes: 3620
use proconio::{
   fastout, input,
   marker::{Bytes, Chars, Isize1, Usize1},
};

#[fastout]
fn main() {
   input! {
      n:usize,
      mut a:[u128;n]
   }
   a.sort();
   if a[0] == 0 {
      println!("0");
      return;
   }
   let mut ans = a[0];
   for i in 1..a.len() {
      ans *= a[i];
      if ans > 1000_000_000_000_000_000 {
         println!("-1");
         return;
      }
   }
   println!("{}", ans);
}


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

//template
#define rep(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define ALL(v) (v).begin(),(v).end()
typedef long long int ll;
const int inf = 0x3fffffff; const ll INF = 0x1fffffffffffffff; const double eps=1e-12;
template<typename T>inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<typename T>inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
//end

char g[2010][2010];
int v_rui[2010][2010]={};
int r_rui[2010][2010]={},c_rui[2010][2010]={};

int main(){
   int n,m,q; cin>>n>>m>>q;
   rep(i,0,n)rep(j,0,m)cin>>g[i][j];
   rep(i,0,n)rep(j,0,m)v_rui[i+1][j+1]=v_rui[i][j+1]+v_rui[i+1][j]-v_rui[i][j]+(g[i][j]=='1');
   cerr<<v_rui[2][2]<<endl;
   rep(i,0,n)rep(j,0,m){
      r_rui[i+1][j+1]=r_rui[i][j+1]+r_rui[i+1][j]-r_rui[i][j]+(j>0 and g[i][j]=='1' and g[i][j-1]=='1');
      c_rui[i+1][j+1]=c_rui[i][j+1]+c_rui[i+1][j]-c_rui[i][j]+(i>0 and g[i][j]=='1' and g[i-1][j]=='1');
   }
   rep(i,0,q){
      int x1,y1,x2,y2;
      cin>>x1>>y1>>x2>>y2;
      int res=v_rui[x2][y2]-v_rui[x1-1][y2]-v_rui[x2][y1-1]+v_rui[x1-1][y1-1];
      res-=r_rui[x2][y2]-r_rui[x2][y1]-r_rui[x1-1][y2]+r_rui[x1-1][y1];
      res-=c_rui[x2][y2]-c_rui[x1][y2]-c_rui[x2][y1-1]+c_rui[x1][y1-1];
      cout<<res<<endl;
   }
   return 0;
}

Measured memory_bytes: 53120
#include<algorithm>
#include<iostream>
#include<vector>
#include<string>
#include<queue>
#include<stack>
#include<cmath>
#include<list>
#include<set>
#include<map>
//#include<bits/stdc++.h>

using namespace std;
long long MOD = 1000000007LL;
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -2147483648
#define INT_MAX 2147483647
#define endl "\n"

int main() {
	int N;
	double M;
	cin >> N >> M;
	vector<double> vec(N);
	double sum = 0;
	for (int i = 0; i < N; ++i) {
		cin >> vec[i];
		sum += vec[i];
	}

	int count = 0;
	for (int i = 0; i < N; ++i) {
		if (sum / (4.0 * M) <= vec[i])++count;
	}
	if (M <= count)cout << "Yes" << endl;
	else cout << "No" << endl;

	return 0;
}

Measured memory_bytes: 256
import math
n = int(input())
count =[0 for _ in range(10**4)]
for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            ans =0
            ans = x **2 +y**2+z**2 +x*y+y*z +x*z
            if ans <= n:
                count[ans-1] += 1
for o in count[:n]:
    print(o)



Measured memory_bytes: 9260
#include<bits/stdc++.h>
#define ll long long int
#define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define REP(i,n) FOR(i,0,n)
#define REP1(i,n) FOR(i,1,n)
using namespace std;

int main () {
  int a, b, ans;
  char op;

  do {
    cin >> a >> op >> b;
    if (op == '?') {
      break;
    }

    switch (op) {
      case '+': 
        ans = a + b;
        break;
      case '-': 
        ans = a - b;
        break;
      case '*': 
        ans = a*b;
        break;
      case '/': 
        ans = a/b;
        break;
    }
    cout << ans << endl;
  } while (op != '?');

  return 0;
}

Measured memory_bytes: 3108
n = int(input())
a = [int(x) for x in input().split()]
ans = []
if n == 1: print(a[0])
else:
    for i in a[::-2]:
        ans.append(i)
    if n % 2 == 0:
        for i in a[::2]:
            ans.append(i)
    else:
        for i in a[1::2]:
            ans.append(i)
print(*ans)

Measured memory_bytes: 26360
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<list>
#include<set>
#include<map>
#include<utility>
#include<cmath>


#define rep(i,x) for(int i=0;i<(int)(x);i++)
#define reps(i,x) for(int i=1;i<=(int)(x);i++)
#define rrep(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define rreps(i,x) for(int i=((int)(x));i>0;i--)

#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define INF 2e9

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; }
typedef long long ll;
int gcd(int a,int b){return b?gcd(b,a%b):a;}

using namespace std;

int main()
{
    int n;
    cin >> n;
    vector<ll> a(n), b(n), c(n);
    rep(i, n) cin >> a[i];
    rep(i, n) cin >> b[i];
    rep(i, n) cin >> c[i];

    sort(all(a));
    sort(all(b));
    sort(all(c));

    ll ans = 0;
    rep(j, n){
        auto itri = lower_bound(all(a), b[j]);
        auto itrk = upper_bound(all(c), b[j]);
        ll idxi = itri - a.begin();
        ll idxk = itrk - c.begin();
        ans += idxi*(n-idxk);
    }
    cout << ans << endl;
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int N = 1e5 + 5;
const ll mod = 998244353 ;
const double pi = acos(-1);
ll fastpow(ll b, ll e) {
    if (!e)
        return 1;
    ll ret = fastpow(b, e / 2);
    ret = (ret * ret) % mod;
    if (e % 2)
        ret = (ret * b) % mod;
    return ret;
}
ll modinv(ll x) {
    return fastpow(x, mod - 2);
}
double torad(double ang) {
    return ang * pi / 180.0;
}
/*
int solve(int node) {

    int ret = 0;
    for (int i = 0; i < v[node].size(); i++) {
        int cur = v[node][i];
        ret = max(ret, solve(cur));
    }
    return ret + 1;
}
*/
int main()
{
    ///smallest/largest case
    ///initialize
    vector<vector<int> > v(N);
    int in[N] = {0};
    int n, m;
    scanf("%d%d", &n, &m);
    for (int i = 0; i < m; i++) {
        int x, y;
        scanf("%d%d", &x, &y);
        in[y]++;
        v[x].push_back(y);
    }
    queue<int> q;
    for (int i = 1; i <= n; i++) {
        if (!in[i])
            q.push(i);
    }
    int dp[N] = {0}, mx = 0;
    while (q.size()) {
        int node = q.front();
        q.pop();
        for (int j = 0; j < v[node].size(); j++) {
            int cur = v[node][j];
            in[cur]--;
            if (!in[cur])
                q.push(cur);
            dp[cur] = max(dp[cur], dp[node] + 1);
            mx = max(mx, dp[cur]);
        }
    }
    printf("%d", mx);
    return 0;
}


Measured memory_bytes: 6528
#pragma region header
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define rev(i, n) for(int i = (int)(n - 1); i >= 0; i--)
#define rev1(i, n) for(int i = (int)(n); i > 0; i--)
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define resort(v) sort((v).rbegin(), (v).rend())
#define vi vector<int>
#define vvi vector<vector<int>>
#define vc vector<char>
#define vvc vector<vector<char>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
using ll = long long;
using P = pair<int, int>;
/* ----------------よく使う数字や配列----------------- */
int dx[] = {1,0,-1,0};
int dy[] = {0,1,0,-1};
constexpr ll mod = 1e9+7;
constexpr int inf = INT32_MAX/2;
constexpr ll INF = LLONG_MAX/2;
constexpr long double eps = DBL_EPSILON;
constexpr long double pi = 3.141592653589793238462643383279;
/* ----------------------end----------------------- */

/* --------------------テンプレート------------------ */
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
/* ----------------------end----------------------- */

/* --------------------ライブラリ-------------------- */
ll fact(int i) {       //階乗
    if (i == 0) return 1;
    return (fact(i - 1)) * i;
}
ll gcd(ll a, ll b) {        //最大公約数
    if(b == 0) return a;
    return gcd(b, a % b); 
}
ll lcm(ll a, ll b) {      //最小公倍数
    return a * b / gcd(a, b);
}
int keta(ll n) {        //桁数を求める
    if(n == 0) return 1;
    int count = 0;
    while(n != 0) {
        n /= 10;
        count++;
    }
    return count;
}
ll ketasum(ll n) {    //各桁の和
    ll sum = 0;
    while(n != 0) {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}
/* ----------------------end----------------------- */
#pragma endregion
#define int long long
signed main() {
    string s;cin >> s;
    reverse(all(s));
    rep(i, s.size()) {
        if(s[i]=='m') {
            if(s.substr(i,5) == "maerd") {
                // cout << "NO\n" << endl;
                // return 0;
                i+=4;
                continue;
            }
            cout << "NO\n";
            return 0;
        }
        else if(s[i]=='e') {
            if(s.substr(i, 5)=="esare") {
                // cout << "NO\n" << endl;
                // return 0;
                i+=4;
                continue;
            }
            cout << "NO\n";
            return 0;
        }
        else if(s[i]=='r') {
            if(s.substr(i,6)=="resare") {
                
                i+=5;
                continue;
            }
            
            else if(s.substr(i, 7)=="remaerd") {
                
                i+=6;
                continue;
            }
            cout << "NO\n";
            return 0;
            cout << "NO\n";
            return 0; 
        }
        else {
            cout << "NO\n";
            return 0;
        }
    }
    cout << "YES\n";
    return 0;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using pll = pair<ll, ll>;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define rrep(i, m, n) for(ll i = m; i > n; i--)
#define Rep(i, m, n) for(ll i = m; i < n; i++)
#define all(vec) vec.begin(), vec.end()
#define lmax(x, y) max<ll>(x, y)
#define lmin(x, y) min<ll>(x, y)
#define tmax(x, y, z) lmax((x), lmax((y), (z)))
#define tmin(x, y, z) lmin((x), lmin((y), (z)))
#define MINUS(a) memset(a, 0xff, sizeof(a))
#define ZERO(a) memset(a, 0, sizeof(a))
const ll INF = 1LL << 60;
const ll MM = 1000000000; const ll MOD = MM + 7; const ll MMM=9223372036854775807;//2^63 -1
#define ADD(a,b) a = (a + ll(b)) % MOD
#define MUL(a,b) a = (a * ll(b)) % MOD
ll GCD(ll x, ll y){ if(y == 0) return x; else return GCD(y, x % y);}
ll LCM(ll x, ll y){ return x / GCD(x, y) * y;}
template<class T> inline bool chmin(T& a, T b){ if(a > b){ a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b){ if(a < b){ a = b; return true;} return false;}
template<typename A, size_t N, typename T> void FILL(A (&array)[N], const T &val){ fill( (T*)array, (T*)(array+N), val );}
// struct edge{ ll from, to, cost; };
// struct edge{ ll to, cost; };
// using Graph = vector<vector<ll>>;  // 重み無し
// using Graph = vector<edge>;  // 辺
// using Graph = vector<vector<edge>>;  // 重み付き
ll dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
ll ddx[8] = {1, 1, 0, -1, -1, -1, 0, 1}, ddy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
//cout << fixed << setprecision(10);
// priority_queue<ll, vector<ll>, greater<ll>> pq;


int main(){
    ll x, t; cin >> x >> t;
    cout << lmax(0, x - t) << endl;
}


Measured memory_bytes: 3620
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define  SIZE 300000
#define max(a,b) ((a>b) ? (a) : (b))

int cmp1(const void *p,const void *q)//昇順
{
    return *(int *)p - *(int *)q;
}

typedef long long int int64;

int tate[SIZE]={0};
int yoko[SIZE]={0};

int tatemax[SIZE]={0};
int yokomax[SIZE]={0};
int tatemaxnum=0;
int yokomaxnum=0;
int bombh[SIZE]={0};
int bombw[SIZE]={0};

int main()
{
    int h,w,m;
    int x,y;
    int i,j,k;
    int hmaxcand=-1;
    int wmaxcand=-1;
    int64 ans=0;
    //printf("a");
    scanf("%d %d %d",&h,&w,&m);
    for(i=0;i<m;i++)
    {
        scanf("%d %d",&x,&y);
        bombh[i]=x-1;
        bombw[i]=y-1;
        tate[x-1]++;
        yoko[y-1]++;
    }
    //printf("b");
    for(i=0;i<h;i++)
    {
        if(hmaxcand<tate[i])
        {
            hmaxcand=tate[i];
            tatemaxnum=0;
            tatemax[tatemaxnum]=i;
            tatemaxnum++;
        }
        else if(hmaxcand==tate[i])
        {
            tatemax[tatemaxnum]=i;
            tatemaxnum++;
        }
    }
    for(j=0;j<w;j++)
    {
        if(wmaxcand<yoko[j])
        {
            wmaxcand=yoko[j];
            yokomaxnum=0;
            yokomax[yokomaxnum]=j;
            yokomaxnum++;
        }
        else if(wmaxcand==yoko[j])
        {
            yokomax[yokomaxnum]=j;
            yokomaxnum++;
        }
    }
    //printf("c");
    //暫定の答え
    ans=(int64)(hmaxcand)+(int64)(wmaxcand);
    //printf("zantei = %lld\n",ans);

    //tatemax,yokomaxをソート
    qsort(tatemax,tatemaxnum,sizeof(int),cmp1);
    qsort(yokomax,yokomaxnum,sizeof(int),cmp1);


    void *result1;
    void *result2;

    int64 flag=0;
    for(i=0;i<m;i++)
    {
        //各爆弾について、tatemax中、yokomax中にあるかにぶたん
        //printf("searching %d %d\n",bombh[i],bombw[i]);
        result1 = bsearch(bombh+i,tatemax,tatemaxnum,sizeof(int),cmp1);
        result2 = bsearch(bombw+i,yokomax,yokomaxnum,sizeof(int),cmp1);
        if(result1!=NULL && result2!=NULL)
        {
            flag++;
        }
    }
    //printf("%lld ",((int64)(hmaxcand)*(int64)(wmaxcand)));
    if(flag==((int64)(tatemaxnum)*(int64)(yokomaxnum)))ans--;

    printf("%lld",ans);
}



Measured memory_bytes: 9328
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define all(v) v.begin(),v.end()
#define P pair<int,int>
#define len(s) (int)s.size()
#define pb push_back

template<class T> inline bool chmin(T &a, T b){
	if(a>b){a=b;return true;}
	return false;
}
template<class T> inline bool chmax(T &a, T b){
	if(a<b){a=b;return true;}
	return false;
}
constexpr int mod = 1e9+7;
constexpr int inf = 3e18;


signed main(){
	int t;cin>>t;
	while(t--){
		int n,a,b,c,d;cin>>n>>a>>b>>c>>d;
		priority_queue<P,vector<P>,greater<P>>que;
		map<int,int>ans;ans[n]=0;
		map<int,bool>used;used[n]=true;
		que.push({0,n});
		while(!que.empty()){
			P p=que.top();que.pop();
			for(int i=p.second-1;i<=p.second+1;i++){
				if(i%2==0){
					int nc;
					if(i<=2e9)nc=p.first+abs(i-p.second)*d+min(a,d*i/2);
					else nc=p.first+abs(i-p.second)*d+a;
					if(!used[i/2]||ans[i/2]>nc){
						ans[i/2]=nc;used[i/2]=true;
						que.push({nc,i/2});
					}
				}
			}
			for(int i=p.second-2;i<=p.second+2;i++){
				if(i%3==0){
					int nc;
					if(i<=3e9)nc=p.first+abs(i-p.second)*d+min(b,d*i/3*2);
					else nc=p.first+abs(i-p.second)*d+b;
					if(!used[i/3]||ans[i/3]>nc){
						ans[i/3]=nc;used[i/3]=true;
						que.push({nc,i/3});
					}
				}
			}
			for(int i=p.second-4;i<=p.second+4;i++){
				if(i%5==0){
					int nc;
					if(i<=5e9)nc=p.first+abs(i-p.second)*d+min(c,d*i/5*4);
					else nc=p.first+abs(i-p.second)*d+c;
					if(!used[i/5]||ans[i/5]>nc){
						ans[i/5]=nc;used[i/5]=true;
						que.push({nc,i/5});
					}
				}
			}
		}
		cout<<ans[1]+d<<endl;
	}
}


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

using namespace std;

#define ll long long

int main() {
    int n, q, a, t, x;
    cin >> n >> q;
    vector<queue<ll>> que(n);
    while (q--) {
        cin >> a;
        switch (a) {
            case 0:
                cin >> t >> x;
                que[t].push(x);
                break;
            case 1:
                cin >> t;
                if (!que[t].empty())
                    cout << que[t].front() << endl;
                break;
            case 2:
                cin >> t;
                if (!que[t].empty())
                    que[t].pop();
                break;
        }
    }
    return 0;
}


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

int main(){
  long double W,H,x,y,s1,s2,ans;
  int b=0;
  cin>>W>>H>>x>>y;
  
  ans=W*H/2;
  if(x==W/2&&y==H/2){b=1;}
  
  cout<<fixed<<setprecision(10)<<ans<<" "<<b;
}

Measured memory_bytes: 256
/********************************************************************************

        Code by a weak man who named CYJian, and he hope the code can get more points.

        Algorithm:

 ********************************************************************************/

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

//{{{ FAST IO AND SOME FUNCTIONS
const int __SIZE = 1 << 18;
char ibuf[__SIZE], *iS, *iT;

#define ge (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, __SIZE, stdin), (iS == iT ? EOF : *iS++)) : *iS++)
#define ri read_int()
#define rl read_ll()
#define FILE(s) freopen(s "in", "r", stdin), freopen(s "out", "w", stdout)

template <typename T> inline void read(T &x) {
    char ch, t = 0;
    x = 0;
    while (!isdigit(ch = ge))
        t |= ch == '-';
    while (isdigit(ch))
        x = x * 10 + (ch ^ 48), ch = ge;
    x = t ? -x : x;
}
inline int read_int() {
    int x;
    return read(x), x;
}
inline ll read_ll() {
    ll x;
    return read(x), x;
}

template <typename T> inline void chkmin(T &a, T b) { a = a < b ? a : b; }
template <typename T> inline void chkmax(T &a, T b) { a = a > b ? a : b; }
//}}}

const int MAXN = 200010;

int a[MAXN];
ll f[MAXN][2][2];

int main() {
#ifdef LOCAL
    FILE("");
#endif
    int n = ri, o = 0, t = 1;
    ll inf = 1LL << 62;
    for (int i = 1; i <= n; i++) {
        a[i] = ri;
        for (int x = 0; x < 2; x++)
            for (int y = 0; y < 2; y++)
                f[i][x][y] = -inf;
    }
    for (int i = 1; i <= n; i++) {
        chkmax(f[i][1][0], max(f[i - 1][0][0], f[i - 1][0][1]));
        chkmax(f[i][1][1], max(f[i - 1][0][0], f[i - 1][0][1]));
        if (i > 1) {
            for (int t = 0; t < 2; t++) {
                chkmax(f[i][t][0], f[i - 2][t][0] + a[i - 1]);
                chkmax(f[i][t][1], max(f[i - 2][t][0], f[i - 2][t][1]) + a[i]);
            }
        }
    }
    if (n & 1)
        cout << max(f[n][1][0], f[n][1][1]) << endl;
    else
        cout << max(f[n][0][0], f[n][0][1]) << endl;
    return 0;
}


Measured memory_bytes: 10912
#include <bits/stdc++.h>
using namespace std;
const int Maxn=100005;
int n,m,S,T,cnt,head[Maxn];
struct edg
{
	int nxt,to;
}edge[Maxn];
void add(int x,int y)
{
	edge[++cnt]=(edg){head[x],y};
	head[x]=cnt;
}
struct sta
{
	int u,dis;
	bool operator < (const sta &tmp) const
	{
		return dis>tmp.dis;
	}
};
priority_queue <sta> Pr;
int dis[4][Maxn];
void dijkstra(void)
{
	for(int i=0;i<=2;i++)
		memset(dis[i],0x3f,sizeof(int[n+1]));
	dis[0][S]=0;
	Pr.push((sta){S,0});
	while(!Pr.empty())
	{
		sta now=Pr.top();
		Pr.pop();
		int u=now.u;
		for(int i=head[u];i;i=edge[i].nxt)
		{
			int to=edge[i].to;
			if(now.dis+1<dis[(now.dis+1)%3][to])
			{
				dis[(now.dis+1)%3][to]=now.dis+1;
				Pr.push((sta){to,now.dis+1});
			}
		}
	}
}
int main()
{
	scanf("%d%d",&n,&m);
	for(int i=1;i<=m;i++)
	{
		int a,b;
		scanf("%d%d",&a,&b);
		add(a,b);
	}
	scanf("%d%d",&S,&T);
	dijkstra();
	if(dis[0][T]==0x3f3f3f3f) printf("-1");
	else printf("%d",dis[0][T]/3);
	return 0;
}

Measured memory_bytes: 2688
#include<math.h>
#include <iostream>
using namespace std;
int main()
{
	long long int n; cin >> n;
	long long int q = sqrt(n);long long int y = 10000000000000;
	long long int sum = 0;
	for (long long int i = q; i >= 1; i--) {
		if (n % i == 0) {
			sum = i + (n / i) - 2;
			if (sum < y)
				y = sum;
		}
	}
	cout << y << endl;
}

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

int h[1001][1001];
string A;
string B;

void f(int i, int j) {
    if (A.at(i) == B.at(j)) {
            h[i][j] = h[i-1][j-1] + 1;
    } else {
        h[i][j] = max(h[i][j-1], h[i-1][j]);
    }
}

int lcs(string A, string B) {
    for (int i = 1; i <= A.length()-1; ++i) {
        for (int j = 1; j <= B.length()-1; ++j) {
            f(i, j);
        }

    }
    return h[A.length()-1][B.length()-1];
}

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

    for (int i = 0; i < n; ++i) {
        cin >> A;
        cin >> B;
        A = " " + A;
        B = " " + B;
        int a = lcs(A, B);
        cout << a << endl;
    }

    return 0;
}



Measured memory_bytes: 7032
#include <iostream>
#include <math.h>
#include <unordered_map>
#include <vector>
using namespace std;
using ll = long long;
using ull = unsigned long long;

int main() {
  const ll N = 100000;
  ll n, k, r, s, p;
  string t;
  string subt[N];
  unordered_map<char, int> point;

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

  point['r'] = p;
  point['s'] = r;
  point['p'] = s;

  for (ll i = 0; i < n; i++) {
    subt[i % k] += t[i];
  }

  ll total = 0;
  for (ll i = 0; i < k; i++) {
    total += point[subt[i][0]];
    for (ll j = 1; j < subt[i].length(); j++) {
      if (subt[i][j - 1] == subt[i][j]) {
        subt[i][j] = 'x';
      } else {
        total += point[subt[i][j]];
      }
    }
  }

  cout << total << endl;
}


Measured memory_bytes: 5248
#include <iostream>
#include <algorithm>
#include <map>
#include <utility>
#include <vector>
#include <cstdio>
#include <iomanip>
#include <cmath>
using namespace std;
using ll = long long;
#define rep(i, n) for(int i = 0; i < n; i++)

int main() {
    int N, K, h[110000];
    cin >> N >> K;
    rep(i,N) cin >> h[i];
    int count = 0;
    rep(i,N) {
        if(h[i]>=K) {
            ++count;
        }
    }
    cout << count << endl;
    return 0;
}

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

int main()
{
    string O,E;
    cin >> O >> E;

    for(int i=0; i<O.size(); i++)
    {
        cout << O[i];
        if(i<E.size()) cout << E[i];
    }

    cout << endl;
    return 0;
}

Measured memory_bytes: 3568
#include <bits/stdc++.h>
typedef long long ll;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define repr(i,n) for(ll i=(n-1);i>=0;i--)
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
using namespace std;
ll INF = 1000000007;
using Graph = vector<vector<ll>>;

// 0 false, 1 true 
// stringの数字をint型にしてアスキーコードになったら -48する

vector<vector<pair<int,int>>> vec;
int ans = 0;



void bit_full_search(int n)
{
    //2^n回ループ
    for (int bit = 0; bit < (1<<n); ++bit) {
        vector<int> vec_ans(n);
        int count = 0;
        //cout << "{";
        for (int i = 0; i < n; ++i) {
            if (bit & (1<<i)) {
                //cout << " " << i << " ";
                vec_ans[i] = 1;
                count++;
            }
        }
        //cout << "}" << endl;

        ll flag = 0;

        rep(i,vec_ans.size()){
            if(vec_ans.at(i) == 1){
                rep(j, vec[i].size()){
                    ll man = vec[i].at(j).first;
                    ll say = vec[i].at(j).second;
                    if(vec_ans[man] != say){
                        flag = 1;
                        break;
                    }
                }
            }
            if(flag == 1){
                break;
            }
        }

        if(flag == 0){
            ans = max(count, ans);
        }
    }


    
}

int main() {
    int n;
    cin >> n;
    
    vec.resize(n);
    
    rep(i,n){
        int a;
        cin >> a;
        rep(j,a){
            int x, y;
            cin >> x >> y;
            x--;
            vec[i].pb(make_pair(x,y));
        }
        
    }    

    bit_full_search(n);

    cout << ans << endl;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long int
#define mod 1000000007
#define string_mod 2549536629329_base_255
#define pb push_back
#define F first
#define S second
#define ff first
#define endl "\n"
#define ss second
#define all(v) v.begin(), v.end()
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
int power(int x, unsigned int y, int p)
{
    int res = 1;
    x = x % p;
    //  cout << x << " ";
    while (y > 0)
    {

        if (y & 1)
            res = (res * x) % p;

        y = y >> 1;
        x = (x * x) % p;
    }
    return res % p;
}
int lcm(int a, int b)
{
    return (a * b) / __gcd(a, b);
}
int fac[100001];
int inv[100001];
int comb(int a, int b)
{
    if (a < b)
        return 0;
    return ((fac[a] * inv[b]) % mod * inv[a - b] % mod);
}
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int tc;
    tc = 1;
    while (tc--)
    {
        int a, b,sum=0;
        cin >> a >> b;
        int ar[a];
        for (int i = 0; i < a;i++){
            cin >> ar[i];
        }
        sort(ar, ar + a);
        if(b>=a){
            cout << 0 << endl;
        }
        else{
            for (int j = a - b-1; j >= 0;j--){
                sum += ar[j];
            }
            cout << sum << endl;
        }
    }

    return 0;
}

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

int main()
{
	int a, b;

	cin >> a >> b;

	if (a > b){
		cout << "a > b"<< endl;
	}
	else if (a < b){
		cout << "a < b"<< endl;
	}
	else{
		cout << "a == b" << endl;
	}

	return 0;
}

Measured memory_bytes: 3104