akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#ifdef __DEBUG__
    #define DBG(X) cout << #X << " = " << (X) << endl;
    #define SAY(X) cout << (X) << endl;
#else
    #define DBG(X)
    #define SAY(X)
#endif

using namespace std;

using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

int dx[]={1, 0, -1, 0, 1,-1, 1,-1};
int dy[]={0, 1, 0, -1, 1, 1,-1,-1};
const int INT_INF = (int)(2e9);
const ll  LL_INF = (ll)(2e18);

inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const map<T, S> p) { for (auto el : p) cout << "[" << el.first << ";" << el.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const deque<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const set<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for (auto& elem : ret) cin >> elem; return ret; }

int N,M;
struct cake
{
    ll x,y,z;
    cake(ll x,ll y,ll z):x(x),y(y),z(z){}
};

vector<cake> C;
void input(){
    fast_io();
    cin >> N >> M;
    for (int i = 0; i < N; i++)
    {
        ll x,y,z; cin >> x >> y >> z;
        C.emplace_back(x,y,z);
    }
    
}

int sign(int s){
    if(s==0) return 1;
    else return -1;
}

int solve(){
    ll ans = 0;
    for (int sx = 0; sx <= 1; sx++)
    for (int sy = 0; sy <= 1; sy++)
    for (int sz = 0; sz <= 1; sz++)
    {
        vector<ll> score;
        for (int i = 0; i < N; i++)
        {
            score.push_back(sign(sx)*C[i].x+sign(sy)*C[i].y+sign(sz)*C[i].z);
        }
        sort(score.begin(),score.end(),greater<ll>());
        ll s = accumulate(score.begin(),score.begin()+M,0LL);
        ans = max(ans,s);
    }
    cout << ans << endl;
    
    return 0;
}   

int main()
{
    input();
    solve();
    return 0;
}

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

int main()
{
    string str1, str2;
    cin >> str1 >> str2;
    int n = str1.length();
    for(int i = 0; i < str1.length(); i++)
    {
        if(str1[i] == str2[i])
            n--;
    }
    cout << n;
    return 0;
}

Measured memory_bytes: 3916
import java.util.*;

class Main{
        public static void main(String[] args){
                int[][][] p = new int[7][4][4];
                p[0][0] = new int[]{1,1,0,0};
                p[0][1] = new int[]{1,1,0,0};
                for(int i = 0; i < 4; i++){
                        p[1][i][0] = 1;
                        p[2][0][i] = 1;
                }
                p[3][0][0] = 1;
                p[3][1][0] = 1;
                p[4][0] = new int[]{1,1,0,0};
                p[4][1] = new int[]{0,1,1,0};
                p[5][0][0] = 1;
                p[5][1] = new int[]{1,1,0,0};
                p[5][2][1] = 1;
                p[6][0] = new int[]{1,1,0,0};
                p[6][1][0] = 1;
                Scanner sc = new Scanner(System.in);
                while(sc.hasNext()){
                        int[][] map = new int[11][11];
                        for(int i = 0; i < 8; i++){
                                String s = sc.nextLine();
                                if(s.equals("")){
                                        s = sc.nextLine();
                                }
                                for(int j = 0; j < 8; j++){
                                        map[i][j] = s.charAt(j)-'0';
                                }
                        }
                        int[][] _p = new int[4][4];
                        search:for(int i = 0; i < 8; i++){
                                for(int j = 0; j < 8; j++){
                                        if(map[i][j] == 1){
                                                for(int k = 0; k < 4; k++){
                                                        for(int l = 0; l < 4; l++){
                                                                _p[k][l] = map[i+k][j+l];
                                                        }
                                                }
                                                break search;
                                        }
                                }
                        }
                        int n = 0;
                        while(!Arrays.deepEquals(p[n], _p)){
                                n++;
                        }
                        System.out.println((char)('A'+n));
                }
                sc.close();
        }
}

Measured memory_bytes: 12000
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
string s;
int n, k;
vector<string> v;
void solve() {
	n = s.length();
	string tmp;
	for (int i = 0; i<n; i++) {
		tmp.clear();
		for (int j = 0; j<5 && i + j<n; j++) {
			tmp.push_back(s[i + j]);
			//	cout << tmp << endl;
			v.push_back(tmp);
		}
	}
	sort(v.begin(), v.end());
	unique(v.begin(), v.end());
	cout << v[k - 1] << endl;
}
int main() {
	cin >> s >> k;
	solve();
	return 0;
}

Measured memory_bytes: 1160
"use strict";
var input=require("fs").readFileSync("/dev/stdin","utf8");
var cin=input.split(/ |\n/),cid=0;
function next(a){return a?cin[cid++]:+cin[cid++];}
function nexts(n,a){return a?cin.slice(cid,cid+=n):cin.slice(cid,cid+=n).map(a=>+a);}
function nextm(h,w,a){var r=[],i=0;if(a)for(;i<h;i++)r.push(cin.slice(cid,cid+=w));else for(;i<h;i++)r.push(cin.slice(cid,cid+=w).map(a=>+a));return r;}
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill().map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill().map(x=>"+r+")";return eval(r);}

var myOut = main();
if(myOut !== undefined)console.log(myOut);

function main(){
  var h = next(), w = next();
  var s = nexts(h,1);
  var map = xArray(0,h,w);
  var br = xArray(0,h,w);
  if(s[0][0] === "#")br[0][0] = 1, map[0][0] = 1;
  for(var i = 1; i < w; i++){
    if(s[0][i] === ".")map[0][i] = map[0][i-1];
    else{
      br[0][i] = 1;
      map[0][i] = map[0][i-1];
      if(br[0][i-1] === 0)map[0][i]++;
    }
  }
  for(var j = 1; j < h; j++){
    if(s[j][0] === ".")map[j][0] = map[j-1][0];
    else{
      br[j][0] = 1;
      map[j][0] = map[j-1][0];
      if(br[j-1][0] === 0)map[j][0]++;
    }
  }
  for(var i = 1; i < w; i++)for(var j = 1; j < h; j++){
    if(s[j][i] === ".")map[j][i] = Math.min(map[j][i-1],map[j-1][i]);
    else{
      br[j][i] = 1;
      map[j][i] = Math.min(map[j][i-1]-br[j][i-1]+1,map[j-1][i]-br[j-1][i]+1);
    }
  }
  return map[h-1][w-1];
}

Measured memory_bytes: 21996
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<int,int> Pi;
#define rep(i,n) for(ll i=0;i<n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define fi first
#define se second
#define endl "\n"

template<typename T> inline bool chmax(T &a, T b){if(a<b){a=b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if(a>b){a=b;return true;}return false;}
template<typename T> ostream& operator<<(ostream& s,const complex<T>& d) {return s<<"("<<d.real()<<", "<<d.imag()<< ")";}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const pair<T1,T2>& d) {return s<<"("<<d.first<<", "<<d.second<<")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& d){int len=d.size();rep(i,len){s<<d[i];if(i<len-1) s<<" ";}return s;}
template<typename T> ostream& operator<<(ostream& s,const vector<vector<T>>& d){int len=d.size();rep(i,len){s<<d[i]<<endl;}return s;}
template<typename T> ostream& operator<<(ostream& s,const set<T>& v){s<<"{ ";for(auto itr=v.begin();itr!=v.end();++itr) {if (itr!=v.begin()) {s<< ", ";}s<<(*itr);}s<<" }";return s;}
template<typename T> ostream& operator<<(ostream& s,const multiset<T>& v){s<<"{ ";for(auto itr=v.begin();itr!=v.end();++itr) {if (itr!=v.begin()) {s<< ", ";}s<<(*itr);}s<<" }";return s;}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const map<T1,T2>& m){s<<"{"<<endl;for(auto itr=m.begin();itr!=m.end();++itr){s<<" "<<(*itr).first<<" : "<<(*itr).second<<endl;}s<<"}"<<endl;return s;}

const ll mod=1e9+7;
const ll inf=1e17;
const int INF=1e9;
const double EPS=1e-10;
const double PI=acos(-1);

int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    int a,b,c;
    cin>>a>>b>>c;
    if(b-a==c-b) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(void){
  int a,b,x,y;
  while(scanf("%d%d",&a,&b)!=EOF){
    x=a+b;
    y=0;
    while(1){
      if(x==0)
	break;
      x=x/10;
      y++;
    }
    printf("%d\n",y);
  }
  return(0);
}

Measured memory_bytes: 0
#include <iostream>

using namespace std;

int main(){
    int a;
    int b;
    int c;
    int d;
    cin >> a >> b >> c >> d;
    if((a + b) < (c + d)){
        cout << "Right" << endl;
    }
    else if((c + d) < (a + b)){
        cout << "Left" << endl;
    }
    else if((a + b) == (c + d)){
        cout << "Balanced" << endl;
    }
}


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

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

int N;
int D[111111];

int w[111111];
int d[111111];
signed main(){
    cin>>N;
    map<int,int>uku;
    rep(i,N){
        cin>>D[i];
        uku[D[i]]=i;
    }

    fill_n(w,N,1);
    vpint lis;
    rep(i,N)lis.pb({D[i],i});
    sort(all(lis));reverse(all(lis));

    vpint ans;
    rep(i,N-1){
        int v=lis[i].se;

        int tmp=N-w[v];
        int fo=D[v]+w[v]-tmp;
        if(fo>=D[v]||uku.find(fo)==uku.end()){
            cout<<-1<<endl;
            return 0;
        }
        ans.pb({v,uku[fo]});
        w[uku[fo]]+=w[v];
        d[uku[fo]]+=d[v]+w[v];
    }

    int r=lis.back().se;
    if(D[r]!=d[r]){
        cout<<-1<<endl;
        return 0;
    }

    rep(i,ans.size())cout<<ans[i].fi+1<<" "<<ans[i].se+1<<endl;
    return 0;
}


Measured memory_bytes: 13428
//AnikModak
#include<iostream>
using namespace std;

int main()
{
    int a,b,c,x,y;
    cin>>a>>b>>c>>x>>y;

    long long ans=0,mx;

    if(a+b>=2*c){
        if(x>y){
            ans=2*y*c;
            ans+=(x-y)*a;
        }
        else{
            ans=2*x*c;
            ans+=(y-x)*b;
        }
    }
    else ans=x*a+y*b;

    mx=2*max(x,y)*c;
    ans=min(mx,ans);
    cout<<ans<<endl;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
n = int(input())
a = []
for i in range(n):
    a.append(int(input()))

b = sorted(a)
ans = b[n - 1]
for i in range(n):
    if a[i] >= ans:
        print(b[n - 2])
    else:
        print(ans)


Measured memory_bytes: 14112
A, B, C, D = map(int, input().split())

if A==C:
    print(min(B-A,D-C))

elif A<C:
    if B>=D:
        print(max(0,D-C))
    elif B<=D:
        print(max(0,B-C))

else:
    if D>=B:
        print(max(B-A,0))

    elif D<=B:
        print(max(D-A,0))               


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

int main(){
	int N,K;
  	cin >> N >>K;
  vector<int> P(N);
  for(int i = 0;i < N;i++){
  	cin >>P[i];
  }
  sort(P.begin(),P.end());
  int sum = 0;
  for(int i = 0;i < K;i++){
  	sum += P[i];
  }
  cout << sum << endl;
}


Measured memory_bytes: 3620
#include <iostream>

using namespace std;

int main(){
    int A, B, C, D;
    cin >> A >> B >> C >> D;
    while(B>0 && D>0){
        C -= B;
        if(C<=0) {
            cout << "Yes" << endl;
            break;
        }
        A -= D;
        if(A<=0){
            cout << "No" << endl;
            break;
        }
        
    }

    return 0;
}

Measured memory_bytes: 3644
//============================================================================
// Name        : template.cpp
// Author      : 
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <algorithm>
#include <set>
#include <map>
#include <set>
#include <vector>
#include <string.h> // for memset in CF judge.
using namespace std;
#define _CRT_SECURE_NO_DEPRECATE // suppress some compilation warning messages (for VC++ users)
// Shortcuts for "common" data types in contests
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef set<int> si;
typedef map<string, int> msi;
// To simplify repetitions/loops, Note: define your loop style and stick with it!
#define x first
#define y second
#define pb push_back
#define mp make_pair
#define REP(i, a, b) \
for (int i = int(a); i <= int(b); i++) // a to b, and variable i is local!
#define forn(i,n) \
for (int i =0; i<(n); i++)
#define TRvi(c, it) \
for (vi::iterator it = (c).begin(); it != (c).end(); it++)
#define TRvii(c, it) \
for (vii::iterator it = (c).begin(); it != (c).end(); it++)
#define TRmsi(c, it) \
for (msi::iterator it = (c).begin(); it != (c).end(); it++)
#define INF 2000000000 // 2 billion
// If you need to recall how to use memset:
#define MEMSET_INF 127 // about 2B
#define MEMSET_HALF_INF 63 // about 1B
//memset(dist, MEMSET_INF, sizeof dist); // useful to initialize shortest path distances
//memset(dp_memo, -1, sizeof dp_memo); // useful to initialize DP memoization table
//memset(arr, 0, sizeof arr); // useful to clear array of integers

int A() {
	int a,b,c;
	cin >> a >> b >> c;
	if(b -a == c-b) cout << "YES" << endl;
	else cout << "NO" << endl;
return 0;
}

int B() {
   string a,b; cin >> a >> b;
   int i = 0; int j = 0;
   string ans = "";
   while(i < a.length() && j < b.length()) {
       ans += a[i++];
       ans += b[j++];
   }

   if(i < a.length()) {
   	while(i < a.length()) {
   		ans += a[i++];
   	}
   } else {
   	while(j < b.length()) {
   		ans += b[j++];
   	}
   }
   cout << ans << endl;
	return 0;
}

int main() {
	int n; 
	cin >> n;
     int y[26]; memset(y, 70, sizeof y); // useful to clear array of integers

	while(n--) {
	string a; cin >> a; int z[30];
	memset(z, 0, sizeof z);
	
	forn(i, a.length()) {
		// cout << a[i] - 'a' << endl;
		z[a[i]-'a'] += 1;
	}

	forn(i, 26) {
			 // cout << y[i] ;<< " " << z[i] <<endl;
   // if(y[i] > z[i]) y[i] = z[i];
		y[i] = min(y[i], z[i]);

	}
  }
     string ans = "";
	forn(i, 26) {
      int g = y[i];
      if (g == 0) continue;
      char c = 'a' + i;
      string env = "";
      forn(j, g) {
        env.pb(c);
      }
      ans += env;
  	}
  cout << ans << endl;
}


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

using namespace std;
using ll = long long;
using ii = pair<ll, ll>;

const int MAX { 200010 };
const ll MOD { 1000000007 }, oo { 1LL << 62 };

string solve(int N, const vector<string>& xs)
{
    vector<int> cs;
    vector<ii> ds, es;

    int open = 0, close = 0;

    for (int i = 0; i < N; ++i)
    {
        int a = 0, b = 0;

        for (auto c : xs[i])
        {
            open += (c == '(' ? 1 : 0);
            close += (c == ')' ? 1 : 0);

            b += (c == '(' ? 1 : -1);

            if (b < 0)
            {
                a--;
                b = 0;
            }
        }

        if (a == 0)
            cs.push_back(i);
        else if (b + a > 0)
            ds.push_back(ii(b + a, i));
        else
            es.push_back(ii(b, i));
    }

    if (open != close)
        return "No";

    sort(ds.begin(), ds.end(), greater<ii>());
    sort(es.begin(), es.end(), greater<ii>());

    int s = 0;

    for (auto i : cs)
    {
        for (auto c : xs[i])
        {
            s += (c == '(' ? 1 : -1);

            if (s < 0)
                return "No";
        }
    }

    for (auto p : ds)
    {
        auto i = p.second;

        for (auto c : xs[i])
        {
            s += (c == '(' ? 1 : -1);

            if (s < 0)
                return "No";
        }
    }

    for (auto p : es)
    {
        auto i = p.second;

        for (auto c : xs[i])
        {
            s += (c == '(' ? 1 : -1);

            if (s < 0)
                return "No";
        }
    }


    return "Yes";
}

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

    int N;
    cin >> N;

    vector<string> xs(N);

    for (int i = 0; i < N; ++i)
        cin >> xs[i];

    auto ans = solve(N, xs);

    cout << ans << '\n';

    return 0;
}


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

int main()
{
    int n;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; i++)
        cin >> a[i];
    bool flag = false;
    int cnt = 0;
    while (1)
    {
        for (int i = 0; i < n; i++)
        {
            if (a[i] % 2 != 0)
            {
                flag = true;
                break;
            }
            a[i] /= 2;
        }
        if (flag)
            break;
        else
            cnt++;
    }
    cout << cnt << endl;
}


Measured memory_bytes: 3592
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }

    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int N = scan.nextInt();
        int M = scan.nextInt();
        int ans = N * (N-1)/2 + M * (M-1) / 2;
        System.out.println(ans);
    }
}


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

int gcd(int a,int b){int r,tmp;if(a < b){tmp = a;a = b;b = tmp;}r = a % b;while(r != 0){a = b;b = r;r = a % b;}return b;}

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

    int a;
    cin >> a;
    int ans = a;
    for (int i = 1; i < n; i++)
    {
        cin >> a;
        ans = gcd(ans, a);
    }

    cout << ans << endl;
}


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

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

	int negativeCount = 0;
	if(a > 0 && b > 0){
		cout << "Positive" << endl;
	}
	else if(a < 0 & b >= 0){
		cout << "Zero" << endl;
	}
	else if(a < 0 && b < 0){
		negativeCount = (-a) - (-b) + 1;
		if(negativeCount % 2 == 0){
			cout << "Positive" << endl;
		}
		else{
			cout << "Negative" << endl; 
		}
	}
}

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

int main() {
  int h, w;
  cin >> h >> w;
  char s[h][w];
  int i, j;
  for (i = 0; i < h; i++) {
    for (j = 0; j < w; j++) {
      cin >> s[i][j];
    }
  }
  vector<vector<int>> orb(h, vector<int>(w, 0)), ing(h, vector<int>(w, 0));
  for (i = h - 1; i >= 0; i--) {
    for (j = w - 1; j >= 0; j--) {
      if (j == w - 1) {
        orb[i][j] = (s[i][j] == 'O');
      } else {
        orb[i][j] = orb[i][j + 1] + (s[i][j] == 'O');
      }
    }
  }
  for (i = h - 1; i >= 0; i--) {
    for (j = w - 1; j >= 0; j--) {
      if (i == h - 1) {
        ing[i][j] = (s[i][j] == 'I');
      } else {
        ing[i][j] = ing[i + 1][j] + (s[i][j] == 'I');
      }
    }
  }

  long long result = 0;
  for (i = 0; i < h; i++) {
    for (j = 0; j < w; j++) {
      if (s[i][j] == 'J') {
        result += orb[i][j] * ing[i][j];
      }
    }
  }

  cout << result << endl;

  return 0;
}



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

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

bool primeNumber(long long n){
    if(n ==1) return true;
    else{
        for(long long i = 2; i * i <= n; i++){
            if(n % i == 0) return false;
        }
        return true;
    }
}
int main(){
    long long A,B;
    cin>>A>>B;
long long C=gcd(A,B);
long long counter=0;
for(long long i=1; i*i<=C; i++){
    if(C%i==0){
        if (primeNumber(i)) counter++;
        if(i!=(C/i) && primeNumber(C/i))counter++;
}
}
cout<<counter<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <string>
#include <cstring>
#include <sstream>
#include <cmath>
#include <functional>
#include <fstream>
#include <cstdlib>
typedef long long ll;
const ll MOD = 1e9+7;


#define REP(i, N) for (ll i = 0; i < (N); i++)
#define REPP(i, a, b) for (ll i = (a); i < (b); i++)
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define VSORT(c) sort((c).begin(),(c).end())
#define SZ(x) ((ll)(x).size())
//vvintを作る　マクロで　 #define vvint(N,M) vector<vector<ll>>

using namespace std;
// 変数初期化
vector<ll> bsv; // binary_search用のvector
ll a,b,c,n,m;
typedef pair<ll, ll> Pll;
vector<Pll> facts; // 素因数分解の結果格納用(基数:乗数)
vector<vector<ll> > bit_search_v; //nit全探索の結果格納用

// index が条件を満たすかどうか
bool isOK(ll index, ll key) {
    if (bsv[index] >= key) return true;
    else return false;
}

// 汎用的な二分探索のテンプレ
ll binary_search(int key) {
    int ng = -1;
    int ok = (ll)bsv.size();

    /* ok と ng のどちらが大きいかわからないことを考慮 */
    while (abs(ok - ng) > 1) {
        int mid = (ok + ng) / 2;

        if (isOK(mid, key)) ok = mid;
        else ng = mid;
    }
    // OK(key以上となる)のindex番号を返す
    return ok;
}

// 最大公約数
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);
}

//　素因数分解
void prime_fact(ll target){
    ll base=2, exp=0;
    while (base*base<=target) {
        while (target%base==0) {
            target /= base; exp++;
        }
        if (exp>0) {
            facts.push_back(make_pair(base, exp));
        }
        base++; exp=0;
    }
    if (target>1) facts.push_back(make_pair(target,1));
}
// prime_factの結果の確認用
void print_facts(){
    for (int i=0; i<facts.size(); i++) {
        cout << facts[i].first << " " << facts[i].second << endl;
    }
}

// bit全探索
void bit_search(ll target){
    for (ll i=0; i<(1<<target); ++i) {
        if (i==0) continue;
        vector<ll> v;
        for (ll j=0; j<target; ++j) {
            if (i&(1<<j)) v.push_back(j);
            if (i&(1<<j)) cout << i << "  :  " << j << endl;
        }
        bit_search_v.push_back(v);
    }
}
// bit全探索の結果確認用
void print_bit_search(){
    for (ll i=0; i<bit_search_v.size(); ++i) {
        for (ll j=0; j<bit_search_v[i].size(); ++j) {
            cout << bit_search_v[i][j] << " ";
        }
        cout << endl;
    }
}



int main(){
    
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll n;
    cin >> n;
    ll ans = 0;
    for(ll i = 1; i < n+1;i++){
        ll N = n/i;
        ans += (2*i+(N-1)*i)*N/2;
    }
    cout << ans << endl;
    

    return 0;
}

Measured memory_bytes: 3140
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    lli a,b;
  cin>>a>>b;  int x=0;
  for(lli i=10*b;i<10*b+10;i++){
  if((i*8)/100==a) {x=1;cout<<i;break;}

}
if(x==0) cout<<"-1";  
    return 0;
}

Measured memory_bytes: 256
#![allow(non_snake_case)]

#[allow(unused_macros)]
macro_rules ! input { ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; let mut next = || { iter . next ( ) . unwrap ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; ( $ ( $ r : tt ) * ) => { let stdin = std :: io :: stdin ( ) ; let mut bytes = std :: io :: Read :: bytes ( stdin . lock ( ) ) ; let mut next = move || -> String { bytes . by_ref ( ) . map ( | r | r . unwrap ( ) as char ) . skip_while ( | c | c . is_whitespace ( ) ) . take_while ( | c |! c . is_whitespace ( ) ) . collect ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules ! input_inner { ( $ next : expr ) => { } ; ( $ next : expr , ) => { } ; ( $ next : expr , mut $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let mut $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; ( $ next : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules ! read_value { ( $ next : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ next , $ t ) ) ,* ) } ; ( $ next : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ next , $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ next : expr , chars ) => { read_value ! ( $ next , String ) . chars ( ) . collect ::< Vec < char >> ( ) } ; ( $ next : expr , usize1 ) => { read_value ! ( $ next , usize ) - 1 } ; ( $ next : expr , $ t : ty ) => { $ next ( ) . parse ::<$ t > ( ) . expect ( "Parse error" ) } ; }

#[allow(unused_macros)]
macro_rules ! vecs { ( $ init : expr ; $ ( $ dim : expr ) ;* ) => { vecs ! ( $ ( $ dim ) ;* => $ init ) } ; ( $ head : expr ; $ ( $ tail : expr ) ;* => $ init : expr ) => { vec ! [ vecs ! ( $ ( $ tail ) ;* => $ init ) ; $ head ] } ; ( $ head : expr => $ init : expr ) => { vec ! [ $ init ; $ head ] } ; }

#[allow(unused_macros)]
macro_rules! chmax {
    ( $ x : expr , $ y : expr ) => {
        if $x < $y {
            $x = $y;
            true
        } else {
            false
        }
    };
}

fn main() {
    input! {
        n: usize,
        mut wsv: [(usize, usize, u64);n]
    }

    wsv.sort_by(|&(wa,sa,_),&(wb,sb,_)| (wa+sa).cmp(&(wb+sb)));
    let W = 20_000;
    let mut dp = vecs![0;n+1;W+1];
    for i in 0..n {
        let (w,s,v) = wsv[i];
        for j in 0..dp[0].len() {
            if j<=s && j+w < dp[0].len() {
                chmax!(dp[i+1][j+w], dp[i][j] + v);
            }
            chmax!(dp[i+1][j], dp[i][j]);
        }
    }
    let mut ret = 0;
    for i in 0..dp[0].len() {
        chmax!(ret, dp[n][i]);
    }
    println!("{}", ret);
}

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

int main()
{
    int a,b,c,d,e,k;
    cin >> a >> b >> c >> d >> e >> k;
    if(e-a <= k){
        cout << "Yay!" << endl;
    }else{
        cout << ":(" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long A,B,C,K,sum=0;
    cin>>A>>B>>C>>K;
    if(A>=K){
        cout << K ;
        return 0;
    }
    else
    {
        K-=A;
        sum+=A;
    }
    if(B>=K){
        cout << sum ;
        return 0;
    }
    else{
        K-=B;
    }
    if(C>=K){
        cout << sum-K ;
        return 0;
    }
    else{
        K-=C;
        sum-=C;
    }
    cout << sum;
    return 0;
}


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

int main(){
    int n,m; cin >> n >> m;
    vector<int> vp(1e5+1);
    vector<int> vwa(1e+5);
    int ac = 0,wa = 0;
    for(int i=0;i<m;i++){
        int p; string s;
        cin >> p >> s;
        p--;
        if(vp[p]==0){
            if(s=="AC"){
                vp[p]++;
                continue;
            }else{
                vwa[p]++;
                wa++;
            }
        } 
    }
    for(int i=0;i<n;i++){
     
        if(vp[i] > 0){
            ac++;
        }else{
            wa-=vwa[i];
        }
    }
    cout << ac << " " << wa << endl; 
}

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

// 解説を読んで実装。XORの知識が必要
int main() {
  int n, k;
  cin >> n >> k;
  vector<ll> A(n);
  rep(i, n) cin >> A[i];

  ll ans = 100000000000;
  // スイッチの付け方をビット全探索
  for (int bits = 0; bits < (1 << n); bits++) {
    int num_one = __builtin_popcount(bits);
    if (num_one < k) continue;

    ll sum = 0;
    ll max_length = 0;
    vector<ll> B(n, 0);
    rep(i, n) B[i] = A[i];
    for (int i = 0; i < n; i++) {
      if (bits & (1 << i)) {
        if (A[i] <= max_length) {
          sum += max_length - A[i] + 1;
          max_length += 1;
          B[i] = max_length;
        } else {
          max_length = A[i];
        }
      } else {
        max_length = max(max_length, A[i]);
      }
    }
    ans = min(ans, sum);
  }

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


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

#define OnlineJudge1

#define loop(x,a,n) for(int x = a;x < n;x++)
#define NumofDigits(n) ((int)log10(n)+1)
#define CountofNumber(array,n,x)  (upper_bound(array, array+n, x)-lower_bound(array, array+n, x))
#define readline(s) getline(cin,s)
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define EPS 1e-7
#define modulo ll (1e9 + 7)
const long double PI = 3.141592653589793238L;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<int,ll> pill;
typedef pair<ll,ll> pll;

#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)

#define time__(d) \
    for ( \
        auto blockTime = make_pair(chrono::high_resolution_clock::now(), true); \
        blockTime.second; \
        debug("%s: %lld ms\n", d, chrono::duration_cast<chrono::milliseconds>(chrono::high_resolution_clock::now() - blockTime.first).count()), blockTime.second = false \
    )

void init(){
    cin.tie(0);
    ios::sync_with_stdio(0);
#ifdef OnlineJudge
    freopen("in.txt","r",stdin);
    freopen("out.txt","w",stdout);
#endif
}


int main(){
    init();

    ll a,b,h;   cin >> a >> b >> h;
    cout << (a + b) * h / 2;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp11
{
    class Class69
    {
        static void Main()
        {
            var NM = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int N = NM[0], M = NM[1];
            var X = Console.ReadLine().Split().Select(int.Parse).ToArray();
            Array.Sort(X);
            if (M == 1) { Console.WriteLine(0);return; }
            if (N > M) N = M;
            var dif = new int[M-1];
            
            for(int i = 0; i < M-1; i++)
            {
                dif[i] = X[i + 1] - X[i];
            }
            int ans = dif.Sum();
            Array.Sort(dif);
            for(int i = 0; i < N-1; i++)
            {
                ans -= dif[M - 2 - i];
            }
            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 18656
#include <cstdio>
#include <algorithm>

#define MAXN 100000
#define LOGN 16

int best[LOGN + 1][MAXN + 1];
int v[MAXN + 1];

int main() {
    int n;
    scanf("%d", &n);

    for (int i = 1; i <= n; i++)
        scanf("%d", &v[i]);

    int l;
    scanf("%d", &l);

    int p = 1;
    for (int i = 1; i <= n; i++) {
        while (v[i] - v[p] > l)
            p++;
        best[0][i] = p;
    }

    for (int pas = 1; pas <= LOGN; pas++)
        for (int i = 1; i <= n; i++)
            best[pas][i] = best[pas - 1][best[pas - 1][i]];

    int q;
    scanf("%d", &q);

    for (int i = 1; i <= q; i++) {
        int x, y;
        scanf("%d%d", &x, &y);

        if(x > y)
            std::swap(x, y);

        int ans = 0;
        for (int pas = LOGN; pas >= 0; pas--)
            if (best[pas][y] > x)
                y = best[pas][y], ans += 1 << pas;

        printf("%d\n", ans + 1);
    }

    return 0;
}


Measured memory_bytes: 7808
#include<stdio.h>
void func(int,int);
int cnt,w,h;
int a[102][102];
int dx[2][6]={{-1,0,1,0,-1,-1},
				{0,1,1,1,0,-1}};
int dy[2][6]={{-1,-1,0,1,1,0},
				{-1,-1,0,1,1,0}};
int main(void)
{
	int i,j;
	scanf("%d %d",&w,&h);
	for(i=0;i<=h+1;i++){
		for(j=0;j<=w+1;j++){
			a[i][j]=0;
		}
	}
	for(i=1;i<=h;i++){
		for(j=1;j<=w;j++){
			scanf("%d",&a[i][j]);
		}
	}
	cnt=0;
	func(0,0);
	printf("%d\n",cnt);
	return 0;
}	
void func(int y,int x)
{
	int i,j,z,xx,yy;
	z=y%2;
	a[y][x]=2;
	for(i=0;i<6;i++){
		xx=x+dx[z][i]; yy=y+dy[z][i];
		if(xx<=w+1&&yy<=h+1&&xx>=0&&yy>=0&&a[yy][xx]==1){
			cnt++;
		}
		if(xx<=w+1&&yy<=h+1&&xx>=0&&yy>=0&&a[yy][xx]==0){
			func(yy,xx);
		}
	}
}

Measured memory_bytes: 3012
#include <bits/stdc++.h>
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define int long long
using namespace std;

typedef pair<int, int> Pii;

void readint(int N, vector<int> &a);
void readdouble(int N, vector<double> &a);
void readindex(int N, vector<int> &a);



signed main(){

    int A, B, X;
    cin >> A >> B >> X;

    if(A <= X && X <= A + B){
        cout << "YES";
    }else{
        cout << "NO";
    }
    
    return 0;
}








void readint(int N, vector<int> &a){
    string s;
    for(int i = 0; i < N - 1; i++){
        getline(cin, s, ' ');
        a[i] = atoi(s.c_str());
    }
    getline(cin, s, '\n');
    a[N - 1] = atoi(s.c_str());
}
void readdouble(int N, vector<double> &a){
    string s;
    for(int i = 0; i < N - 1; i++){
        getline(cin, s, ' ');
        a[i] = atof(s.c_str());
    }
    getline(cin, s, '\n');
    a[N - 1] = atof(s.c_str());
}
void readindex(int N, vector<int> &a){
    string s;
    for(int i = 0; i < N - 1; i++){
        getline(cin, s, ' ');
        a[i] = atoi(s.c_str()) - 1;
    }
    getline(cin, s, '\n');
    a[N - 1] = atoi(s.c_str()) - 1;
}

Measured memory_bytes: 256
# dequeのappendとappendleftはO(1)、O(1)

from collections import deque

n ,*a = map(int, open(0).read().split())
b = deque()

for i in range(n):
    if i % 2 == 0:
        b.append(a[i])
    else:
        b.appendleft(a[i])
 
if n % 2 == 1:
    b.reverse()
 
print(*b)

Measured memory_bytes: 25948
#include <iostream>
#include <stdio.h>
#include <algorithm>
using namespace std;
bool ax[8];

int main()
{
    int n,x,i,nor=0,res=0;
    scanf("%d",&n);
    for(i=0;i<n;i++)
        {
        scanf("%d",&x);
        if(x<400)ax[0]=1;
        if(x<800&&x>=400)ax[1]=1;
        if(x<1200&&x>=800)ax[2]=1;
        if(x<1600&&x>=1200)ax[3]=1;
        if(x<2000&&x>=1600)ax[4]=1;
        if(x<2400&&x>=2000)ax[5]=1;
        if(x<2800&&x>=2400)ax[6]=1;
        if(x<3200&&x>=2800)ax[7]=1;
        if(x>=3200)nor++;
    }
    for(i=0;i<8;i++)
        {
            if(ax[i]) res++;
            }
        printf("%d %d",max(1,res),res+nor);
    return 0;
}


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

int main(){
  int h, w, a, b;
  cin >> h >> w >> a >> b;
  bool rv = false;
  for(int i=0; i<h; ++i){
    if(i >= h-b) rv = true;
    for(int j=0; j<w; ++j){
      if(j < a && !rv) cout << 1;
      if(j >= a && !rv) cout << 0;
      if(j < a && rv) cout << 0;
      if(j >= a && rv) cout << 1;
    }
    cout << endl;
  }
}

Measured memory_bytes: 3596
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int N = scan.nextInt();
        long[] a = new long[N];
        long[] b = new long[N];
        for (int i = 0; i < N; i++) {
            a[i] = scan.nextInt();
        }
        for (int i = 0; i < N; i++) {
            b[i] = scan.nextInt();
        }
        long sum_a = Arrays.stream(a).sum();
        long sum_b = Arrays.stream(b).sum();
        if (sum_b < sum_a) {
            System.out.println("No");
            return;
        }
        long diff = sum_b - sum_a;
        long count = 0;
        for (int i = 0; i < N; i++) {
            if (b[i] < a[i]) {
                count += a[i] - b[i];
                b[i] += a[i] - b[i];
            }
        }
        for (int i = 0; i < N; i++) {
            if (a[i] < b[i]) {
                long k = (b[i] - a[i]) / 2;
                count -= k;
                a[i] += 2 * k;
                if (a[i] < b[i]) {
                    a[i] += 2;
                    b[i] += 1;
                }
            }
        }
        if (count <= 0) {
            System.out.println("Yes");
            return;
        }
        System.out.println("No");
    }
}


Measured memory_bytes: 44384
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int MOD = 1e9+7;

int main(){
	
	string s,t; cin>>s>>t;
	for(int i=0; i<s.size(); i++){
		if(s.at(i)!=t.at(i)){
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
}


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

#define REP(i,n) for(int i=0;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<29
#define LINF LLONG_MAX/3
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define ALL(v) (v).begin(),(v).end()
#define all(v) ALL(v)
#define debug(x) cerr<<#x<<":"<<x<<endl
#define debug2(x,y) cerr<<#x<<","<<#y":"<<x<<","<<y<<endl
#define CININIT cin.tie(0),ios::sync_with_stdio(false)
template<typename T> ostream& operator<<(ostream& os,const vector<T>& vec){ os << "["; for(const auto& v : vec){ os << v << ","; } os << "]"; return os; }
template<typename T,typename U> ostream& operator<<(ostream& os,const pair<T,U>& p){ os << "(" << p.first << ","<< p.second <<")"; return os; }
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
ll gcd(ll a,ll b){ if(b==0) return a; else return gcd(b,a%b); }

constexpr ll mod = 1e9+7;
const int dx[]={1,0,-1,0} ,dy[] = {0,1,0,-1};

int main(){
    int N;cin>>N;
    string s,t;cin>>s>>t;
    int ns=s.size();
    int nt=t.size();
    assert(N==ns);
    assert(N==nt);
    if(s==t){
        cout << ns << endl;
        return 0;
    }
    int z=0;
    for(int i=1;i<N;i++){
        string ss=s.substr(N-i);
        string tt=t.substr(0,i);
        if(ss==tt) z = i;
    }
//    cerr << z << endl;
    cout << 2*N-z << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
#define all(x) (x).begin(),(x).end()
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main() {
    string s;
    cin >> s;
    bool condition = true;
    if (s[0] == 'A'){
        int ccnt = 0;
        for (int i=2; i<s.size()-1; i++){
            if (s[i] == 'C')ccnt++;
        }

        if (ccnt == 1){
            for (int j = 1; j<s.size(); j++){
                if (s[j] != 'C' and isupper(s[j]))condition = false;
            }
        }
        else{
            condition = false;
        }
    }
    else condition = false;
    if (condition) cout << "AC" << endl;
    else cout << "WA" << endl;
}

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

// 最小公倍数を求める
int euqlid (int a, int b){
  int temp;
  temp = a % b;
  if(temp == 0)return b;
  return euqlid(b,temp);
}

int sumation(int a){
  return (1+a)* a / 2;
}

int main(){
  double n,k;
  cin >> n >> k;
  double total = 0;
  for(int i = 1;i < n+1;i++){
    int hoge = i;
    int count = 0;
    while(hoge < k){
      hoge *= 2;
      count++;
    }
    total += pow(0.5,count)/n;
  }
  // cout << fixed << setprecision(12) << total << endl;
  printf("%.12f\n",total);
}

Measured memory_bytes: 256
#D
from collections import deque
n=int(input())
a=deque(list(map(int,input().split())))
a.appendleft(0)
b=deque([0 for i in range(n+1)])
s=sum(a)
t=0
for i in range(1,(n-1)//2+1):
    t+=2*a[2*i]
b[1]=s-t
for i in range(2,n+1):
    b[i]=(a[i-1]-b[i-1]//2)*2
b.popleft()
print(" ".join(list(map(str,b))))

Measured memory_bytes: 81636
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
//#define int long long

template <class T>
bool INRANGE(T x, T a, T b) { return a <= x && x <= b; }
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>
void printv(vector<T> v) {for (T t : v) {cout << t << " ";}cout << '\n';}

#define REP(i, n) for (int i = 0; i < (n); ++i)
#define RREP(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define RFOR(i, a, b) for (int i = (a); i >= (b); --i)
#define ALL(v) (v).begin(), (v).end()
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \
                      << " " << __FILE__ << endl;

typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vi> vvi;
typedef pair<int, int> pii;

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

    int A, B;
    cin >> A >> B;

    if ((max(A,B) - min(A,B)) % 2 == 0) {
        
        cout << abs(max(A,B) - ((max(A,B) - min(A,B)) / 2)) << endl;
    } else {
        cout << "IMPOSSIBLE" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define N 55
#define ll long long
using namespace std;
ll f[N][N*N],ans=0;
int x,a,n;
int main(){
	f[0][0]=1,scanf("%d%d",&n,&a);
	for(int i=1;i<=n;++i){
		scanf("%d",&x);
		for(int j=i;j;--j)for(int k=2500;k>=x;--k)f[j][k]+=f[j-1][k-x];
	}
	for(int i=1;i<=n;++i)ans+=f[i][i*a];
	cout<<ans;
	return 0;
}


Measured memory_bytes: 1408
#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: 3096
N = int(input())
sList = [['' for i in range(1)] for j in range(N)]

for i in range(N):
    sList[i] = input()

M = int(input())
tList = [['' for i in range(1)] for j in range(M)]
for i in range(M):
    tList[i] = input()

ansMax = 0
for i in sList:
    tmp = sList.count(i) - tList.count(i)
    ansMax = max(ansMax, tmp)

print(ansMax)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#include <math.h>
#include <iomanip>
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int INF=1001001001;
const int mod=1e9+7;

int main(){
  int N;
  cin>>N;
  vector<int>A(N);
  for(int i=0;i<N;i++){
    cin>>A[i];
  }
  deque<int>q;
  for(int i=0;i<N;i++){
    int p=lower_bound(q.begin(),q.end(),A[i])-q.begin();
    if(p==0){q.push_front(A[i]);}
    else{q[p-1]=A[i];}
  }
  int ans=q.size();
  cout<<ans<<endl;
  return 0;                       
}

Measured memory_bytes: 4056
def gli
  gets.split.map(&:to_i)
end

q = []
q << gli
q << gli
q << gli
q << [q[0][0], q[1][0], q[2][0]]
q << [q[0][1], q[1][1], q[2][1]]
q << [q[0][2], q[1][2], q[2][2]]
q << [q[0][0], q[1][1], q[2][2]]
q << [q[0][2], q[1][1], q[2][0]]

n = gets.to_i

w = []
n.times {
  w << gets.to_i
}
flag = false
q.each { |aa|
  flag = true if (aa - w).empty?
}

puts flag ? :Yes : :No


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

int main(){
  double r;
  cin >> r ;
  double pi = 3.14159265;
  cout << fixed << setprecision(10);
  cout << 2*r*pi << endl;
}

Measured memory_bytes: 3788
n=int(input())

def f_xyz(x,y,z):
  return x**2+y**2+z**2+x*y+y*z+z*x 

li=[0]*(n+5)
for x in range(1,200):
  for y in range(1,200):
    for z in range(1,200):
      num=f_xyz(x,y,z)
      if num<=n:
        li[f_xyz(x,y,z)+1]+=1
      else:
        break
        
for i in li[2:n+2]:
  print(i)

Measured memory_bytes: 9088
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n ; ++i)
#define REP(i,a,b) for(int i=a; i<b; ++i)
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;
//プロトタイプ宣言
int gcd(int , int);
void often(void);
ll get_digent(ll);


int main(){
  often();
  int n,ans=0;
  cin >> n;
  vi d(n);
  rep(i,n) cin >> d[i];
  sort(d.begin(),d.end());
  if(d[n/2]==d[n/2-1]){
    cout << 0 << endl;
    return 0;
  }
  cout << d[n/2] - d[n/2-1] << endl;
}








































//以下、ライブラリ

int gcd(auto a, auto b) {
  return b ? gcd(b, a%b) : a;
}  //ユークリッドの互除法

void often(void){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}

ll get_digent(ll x){
  string s;
  s = to_string(x);
  ll digent = s.size();
  return digent;
} 

Measured memory_bytes: 640
from bisect import bisect
n, m, k = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
a = [0]
for i in range(n):
	a.append(a[-1] + A[i])
b = [0]
for i in range(m):
	b.append(b[-1] + B[i])

ans = 0
for i in range(n+1):
	if a[i] > k:
		break
	ans = max(ans, i + bisect(b, k-a[i]) - 1)
print(ans)

Measured memory_bytes: 47524
#import sys
#sys.setrecursionlimit(500000)　マージテクをちゃんとしていればこんなものはいらないはず……

class UF:
    #経路圧縮＋マージテクのunion find木
    def __init__(self,n):
        self.n = n
        self.parents = [-1] * (n+1) #1-indexedにするために１個足している
        self.rnks = [0] * (n+1)

    def find(self,n):
        if self.parents[n] < 0:
            return n
        else:
            return self.find(self.parents[n])


    def union(self,a,b):
        a_par = self.find(a)
        b_par = self.find(b)

        if a_par == b_par:
            return
        ##union by rank
        #if self.rnks[a_par] < self.rnks[b_par]: #ランクの高い方の根に低い方の根をつける　逆にしないように……！
        #    a_par,b_par = b_par,a_par
        #if self.rnks[a_par] == self.rnks[b_par]:
        #    self.rnks[a_par] += 1
        if self.size(a_par) < self.size(b_par): #parentsの値が負の数のとき、それはその木のサイズを表す。
            a_par,b_par = b_par,a_par
        self.parents[a_par] += self.parents[b_par]
        self.parents[b_par] = a_par

    def size(self,n):
        par = self.find(n)
        return abs(self.parents[par])

    def is_same(self,a,b):
        return self.find(a) == self.find(b)

def main():
    uf = UF(12)
    uf.union(1,3)
    uf.union(1,5)
    uf.union(1,7)
    uf.union(1,8)
    uf.union(1,10)
    uf.union(1,12)

    uf.union(4,6)
    uf.union(4,9)
    uf.union(4,11)

    x,y = map(int,input().split())
    print("Yes" if uf.is_same(x,y) else "No")
    
main()


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

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

using namespace std;
using ll = long long;
using ii = pair<int, int>;

const int N = 100005;

int main() {
  ll a, b, c;
  scanf("%lld %lld %lld", &a, &b, &c);
  c -= a;
  c -= b;
  if(c < 0){
    printf("No\n");
    return 0;
  }
  if(4 * a * b < c * c){
    printf("Yes\n");
  }
  else{
    printf("No\n");
  }

	return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <bits/stdc++.h>
#include <cstdint>
#include <iostream>
#include <iterator>
#include <vector>

// lib/util.hpp
#ifndef UTIL_HPP
#define UTIL_HPP


typedef ::std::int_fast64_t i64;
typedef ::std::uint_fast64_t u64;
typedef ::std::int_fast32_t i32;
typedef ::std::uint_fast32_t u32;

namespace tools {
  template <typename T>
  void read(::std::istream& is, ::std::vector<T>& vector, const typename ::std::vector<T>::size_type size) {
    vector.reserve(size);
    ::std::copy_n(::std::istream_iterator<T>(is), size, ::std::back_inserter(vector));
  }
  template <typename T>
  void read(::std::vector<T>& vector, const typename ::std::vector<T>::size_type size) {
    ::tools::read(::std::cin, vector, size);
  }

  template <typename T, ::std::size_t N>
  void read(::std::istream& is, ::std::array<T, N>& array) {
    ::std::copy_n(std::istream_iterator<T>(is), N, array.begin());
  }
  template <typename T, ::std::size_t N>
  void read(::std::array<T, N>& array) {
    ::tools::read(::std::cin, array);
  }
}

#endif

// main.cpp

int main() {
  i64 X;
  std::cin >> X;
  std::cout << (X / 500 * 1000 + X % 500 / 5 * 5) << std::endl;
  return 0;
}

Measured memory_bytes: 256
a,b,c,d = map(int, input().split())
m = 0
n = 0

e = a*c
f = b*d
g = a*d
h = b*c
ans = e

if(ans<f):
    ans = f
if(ans<g):
    ans = g
if(ans<h):
    ans = h

print(ans)

Measured memory_bytes: 9188