akhauriyash/Code-Regression huggingface dataset:
/*
 * 	Roses are red
 * 		Violets are blue
 * 			I cried
 * 				And so did you
 */
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,fma,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#ifndef rd
#define endl '\n'
#endif
#ifdef rd
#define trace(...) cout<<"Line:"<<__LINE__<<" "; __f(#__VA_ARGS__, __VA_ARGS__)
template<typename Arg1>
void __f(const char* name, Arg1&& arg1) {
	cout<<name<<" : "<<arg1<<endl;
}
template<typename Arg1, typename ... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
	const char* comma=strchr(names+1,',');
	cout.write(names,comma-names)<<" : "<<arg1<<" | ";
	__f(comma+1,args...);
}
#else
#define trace(...)
#endif
#define pb push_back
#define fi first
#define se second
#define int long long
typedef long long ll;
typedef long double f80;
#define double long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define sz(x) ((long long)x.size())
#define fr(a,b,c) for(int a=b; a<=c; a++)
#define rep(a,b,c) for(int a=b; a<c; a++)
#define trav(a,x) for(auto &a:x)
#define all(con) con.begin(),con.end()
const ll infl=2e18;
const int infi=1e9;
//const int mod=998244353;
const int mod=1000000007;
typedef vector<int> vi;
typedef tree<int, null_type, less<int>, rb_tree_tag,
		tree_order_statistics_node_update> oset;
mt19937 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
auto clk=clock();
int rng(int lim) {
	uniform_int_distribution<int> uid(0,lim-1);
	return uid(rang);
}

int fact[200005],ifact[200005];
int powm(int a, int b) {
	int res=1;
	while(b) {
		if(b&1)
			res=(res*a)%mod;
		a=(a*a)%mod;
		b>>=1;
	}
	return res;
}
inline int ncr(int n, int r) {
	return (((fact[n]*ifact[r])%mod)*ifact[n-r])%mod;
}
void solve() {
	fact[0]=1;
	fr(i,1,200001)
		fact[i]=(fact[i-1]*i)%mod;
	ifact[200001]=powm(fact[200001],mod-2);
	for(int i=200000; i>=0; i--)
		ifact[i]=(ifact[i+1]*(i+1))%mod;
	int h,w,a,b;
	cin>>h>>w>>a>>b;
	int ans=ncr(h+w-2,w-1);
	trace(ans);
	for(int i=0; i<a; i++) {
		ans=(ans-(ncr(h-i+b-2,b-1)*ncr(i+w-b-1,i)))%mod;
	}
	if(ans<0)
		ans+=mod;
	cout<<ans<<endl;
}

signed main() {
	ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	srand(chrono::high_resolution_clock::now().time_since_epoch().count());
	cout<<fixed<<setprecision(10);
	int t=1;
//	cin>>t;
	while(t--)
		solve();
#ifdef rd
	cout<<endl<<endl<<"Time elapsed: "<<(double)(clock()-clk)/CLOCKS_PER_SEC<<endl;
#endif
	return 0;
}


Measured memory_bytes: 3328
#include<iostream>
#include<string>

int main(){
	std::string s{};
	std::cin >> s;

	int c = 0;
	for (auto e : s) {
		c += e == 'o' ? 100 : 0;
	}
	std::cout << c + 700 << "\n";
	return 0;
}


Measured memory_bytes: 888
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

using namespace std;
using boost::multiprecision::cpp_int;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ll,pair<ll, ll>> lpll;
typedef pair<ll, int> pli;
typedef pair<int, int> pii;

#define deg_to_rad(deg) (((deg)/360)*2*PI)

const ll LINF = LLONG_MAX;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;

const ld PI = (acos(-1));
const ld EPS = 0.0000000001;
// cout << fixed << setprecision(10) << middle << endl;

int main() {
    // input, ready
    ll a;
    cin >> a;

    // resolve

    // output
    cout << a+a*a+a*a*a << endl;

    return 0;
}


Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
  cin>>n;
string s;
  map<string,int>m;
  for(int i=0;i<n;i++)
  {
    cin>>s;
    m[s]++;
  }
  int f=0;
  for(auto i:m)
  {
  if(i.first=="AC")
  {
    cout<<i.first<<" "<<"x"<<" "<<i.second<<"\n";
    f=1;break;
  }
  } 
  if(f==0)
        cout<<"AC"<<" "<<"x"<<" "<<"0"<<"\n";
  f=0;
  for(auto i:m)
  {
  if(i.first=="WA")
  {
    cout<<i.first<<" "<<"x"<<" "<<i.second<<"\n";
    f=1;break;
  }
  }
  if(f==0)
        cout<<"WA"<<" "<<"x"<<" "<<"0"<<"\n";
  f=0;
  for(auto i:m)
  {
  if(i.first=="TLE")
  {
    cout<<i.first<<" "<<"x"<<" "<<i.second<<"\n";
    f=1;break;
  }
  }
  if(f==0)
        cout<<"TLE"<<" "<<"x"<<" "<<"0"<<"\n";
  f=0;
  for(auto i:m)
  {
  if(i.first=="RE")
  {
    cout<<i.first<<" "<<"x"<<" "<<i.second<<"\n";
    f=1;break;
  }
  }
  if(f==0)
    cout<<"RE"<<" "<<"x"<<" "<<"0"<<"\n";
}

Measured memory_bytes: 3560
#include <stdio.h>

int main(){
	int S,h,m,s;
	scanf("%d", &S);
	h = S / 3600;
	m = S / 60 - h * 60;
	s = S - m * 60 - h * 3600;
	printf("%d:%d:%d\n", h,m,s);
	return 0;
}

Measured memory_bytes: 1020
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define mod 1000000007
#define f(i,a,b) for(ll i=a;i<b;i++)
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ii pair<ll,ll>
#define vii vector<ii>
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define MAX 1e9
 
ll modpow(ll base, ll exp, ll modulus) {base %= modulus;ll result = 1;while (exp > 0) {if (exp & 1) result = (result * base) % modulus;base = (base * base) % modulus;exp >>= 1;}return result;}
const ld pi=acos(-1);


int main(){
    IOS;
    ll a,b,c;
    cin>>a>>b>>c;
    swap(a,b);
    swap(a,c);
    cout<<a<<" "<<b<<" "<<c;
    return 0;  
} 





Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define speedhack ios_base::sync_with_stdio(false); cin.tie(nullptr);
#define fromfile freopen("input.txt", "r", stdin);  freopen("output.txt", "w", stdout); 
#define mod int (1e9+7)
#define MAXN int (1e9)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ull, ull> pull;
typedef pair<int, int> pii;
typedef pair<ld, ld> pld;


int n,x,l;



int main() {

    //fromfile;
    speedhack;
    cin >> n;
    vector<int> dp(n+1,0);
    vector<int> h;
    h.pb(0); // shifting index
    for (int j = 0; j<n; j++){
        cin >> l;
        h.pb(l);
    }
    dp[1] = 0;
    dp[2] = abs(h[2] - h[1]);
    for (int k = 3; k<=n; k++){
        dp[k] = min(dp[k-1] + abs(h[k] - h[k-1]), dp[k-2] + abs(h[k] - h[k-2]) );
    }
    cout << dp[n];

    }

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

const int MAX_N = 1e5+2;
int N;
int a[MAX_N],b[MAX_N];
int c[MAX_N];
vector<int> G[MAX_N];
ll tot = 0;
int ans[MAX_N];
bool vis[MAX_N];

void add_edge(int fr, int to)
{
	G[fr].push_back(to);
	G[to].push_back(fr);
}

void bfs(int s, int at)
{
	ans[s] = c[at++];
	queue<int> que;
	que.push(s);
	vis[s] = true;
	while(!que.empty()){
		int cur = que.front(); que.pop();
		for(int nxt : G[cur]){
			if(!vis[nxt]){
				ans[nxt] = c[at++];
				tot += ans[nxt];
				que.push(nxt);
				vis[nxt]=true;
			}
		}
	}
}

void solve()
{
	sort(c+1, c+N+1, greater<int>());
	for(int i=0;i<N-1;++i) add_edge(a[i], b[i]);
	int root = -1;
	for(int i=1;i<=N;++i)if(root == -1 || G[i].size() > G[root].size()) root = i;
	bfs(root, 1);
	cout << tot << '\n';
	for(int i=1;i<=N;++i) cout<<ans[i]<<' ';
	cout<<'\n';
}

int main()
{
	cin >> N;
	for(int i=0;i<N-1;++i){
		cin >> a[i] >> b[i];
	}
	for(int i=1;i<=N;++i) cin >> c[i];
	solve();
	return 0;
}

Measured memory_bytes: 6456
#include <iostream>
#include <algorithm>

using namespace std;
using LL = long long;

LL N, V;
LL a[1001], b[1001], c[1001], d[1001];

int main() {

    cin >> N >> V;

    for (int i = 0; i < N; i++) cin >> a[i];
    for (int i = 0; i < N; i++) cin >> b[i];
    for (int i = 0; i < N; i++) cin >> c[i];
    for (int i = 0; i < N; i++) cin >> d[i];

    LL AB[N * N];
    LL *last = AB + N * N;

    for (int i = 0; i < N; i++) {
        for (int j = 0; j < N; j++) {
            AB[i * N + j] = a[i] + b[j];
        }
    }

    sort(AB, last);

    LL ans = 0;

    for (int i = 0; i < N; i++) {
        for (int j = 0; j < N; j++) {
            LL CD = c[i] + d[j];
            ans += upper_bound(AB, last, V - CD) - lower_bound(AB, last, V - CD);
        }
    }

    cout << ans << endl;
}


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

#define FOR(i, a, b) for (int i=a; i<b; i++)
#define For(i, a) for (int i=0; i<a; i++)
#define FORR(i,a,b) for (int i = a; i >= b; i--)
#define Forr(i,a) for (int i = a; i >= 0; i--)

#define deb(...) cerr << "[" << #__VA_ARGS__ << "] : [", DBG(__VA_ARGS__)
void DBG() { cerr << "]\n";}
template<typename T, typename ...Args> void DBG(T first, Args... args)
{cerr << first; if(sizeof...(args))cerr<<", "; DBG(args...); }

void solve(){
  string s; cin >> s;
  int n=s.length();
  if(s[n-1]=='s'){
    s+='e';
    s+='s';
    cout << s << "\n";
  }
  else{
    s+='s';
    cout << s << "\n";
  }
}


int32_t main(){
  ios_base:: sync_with_stdio(false);
  cin.tie(0);
  int t=1;
  for(int tt=1;tt<=t;tt++){
    solve();
  }
}

Measured memory_bytes: 3664
;; -*- coding: utf-8 -*-
(eval-when (:compile-toplevel :load-toplevel :execute)
  (defparameter OPT
    #+swank '(optimize (speed 3) (safety 2))
    #-swank '(optimize (speed 3) (safety 0) (debug 0)))
  #+swank (progn (ql:quickload '(:cl-debug-print :fiveam))
                 (shadow :run)
                 (use-package :fiveam))
  #-swank (set-dispatch-macro-character #\# #\> (lambda (s c p) (declare (ignore c p)) (read s nil (values) t))))
#+swank (cl-syntax:use-syntax cl-debug-print:debug-print-syntax)

;; BEGIN_INSERTED_CONTENTS
(defmacro dbg (&rest forms)
  #+swank
  (if (= (length forms) 1)
      `(format *error-output* "~A => ~A~%" ',(car forms) ,(car forms))
      `(format *error-output* "~A => ~A~%" ',forms `(,,@forms)))
  #-swank (declare (ignore forms)))

(defmacro define-int-types (&rest bits)
  `(progn
     ,@(mapcar (lambda (b) `(deftype ,(intern (format nil "UINT~A" b)) () '(unsigned-byte ,b))) bits)
     ,@(mapcar (lambda (b) `(deftype ,(intern (format nil "INT~A" b)) () '(signed-byte ,b))) bits)))
(define-int-types 2 4 7 8 15 16 31 32 62 63 64)

(declaim (inline println))
(defun println (obj &optional (stream *standard-output*))
  (let ((*read-default-float-format* 'double-float))
    (prog1 (princ obj stream) (terpri stream))))

(defconstant +mod+ 1000000007)

;; Body

(defun main ()
  (let* ((n (read))
         (k (read)))
    (if (= k 1)
        (println 0)
        (println (- n k)))))

#-swank(main)


;; For Test
#+swank
(defun io-equal (in-string out-string &optional (func #'main))
  "Passes IN-STRING to *STANDARD-INPUT*, executes FUNC, and checks the string
output to *STANDARD-OUTPUT* is equal to OUT-STRING."
  (labels ((ensure-last-lf (s)
             (if (and (> (length s) 0)
                      (eql (char s (- (length s) 1)) #\Linefeed))
                 s
                 (uiop:strcat s uiop:+lf+))))
    (equal (ensure-last-lf out-string)
           (with-output-to-string (out)
             (let ((*standard-output* out))
               (with-input-from-string (*standard-input* (ensure-last-lf in-string))
                 (funcall func)))))))

#+swank
(defun get-clipbrd ()
  (with-output-to-string (out)
    (run-program "C:/msys64/usr/bin/cat.exe" '("/dev/clipboard") :output out)))

#+swank (defparameter *this-pathname* (uiop:current-lisp-file-pathname))
#+swank (defparameter *dat-pathname* (uiop:merge-pathnames* "test.dat" *this-pathname*))

#+swank
(defun run (&optional thing (out *standard-output*))
  (let ((*standard-output* out))
    (etypecase thing
      (null ; Runs #'MAIN with the string on clipboard
       (with-input-from-string (*standard-input* (delete #\Return (get-clipbrd)))
         (main)))
      (string
       (with-input-from-string (*standard-input* (delete #\Return thing))
         (main)))
      (symbol (5am:run! thing))
      (pathname ; Runs #'MAIN with the string in a text file
       (with-open-file (*standard-input* thing)
         (main))))))

#+swank
(defun gen-dat ()
  (uiop:with-output-file (out *dat-pathname* :if-exists :supersede)
    (format out "")))

#+swank
(defun bench (&optional (out (make-broadcast-stream)))
  (time (run *dat-pathname* out)))


Measured memory_bytes: 14944
#include <bits/stdc++.h>
using namespace std;
#define lld long long

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

	vector<int>arr(n);
	int ans = 0;
	cin>>arr[0];
	for(int i=1; i<n; i++)
	{
		cin>>arr[i];
		if(arr[i-1]!=0 && arr[i] == arr[i-1])
		{
			ans++;
			arr[i] = 0;
		}
	}
	cout<<ans;
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>

using namespace std;

#define FOR(i,k,n) for(int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cerr<<*i<<" "; cerr<<endl; }
inline bool valid(int x, int y, int W, int H){ return (x >= 0 && y >= 0 && x < W && y < H); }

typedef long long ll;
const int INF = 100000000;
const double EPS = 1e-8;
const int MOD = 1000000007;
struct Edge{
  int src, dst, cap, rev;
  Edge(int s, int d, int c, int r) : 
    src(s), dst(d), cap(c), rev(r) {}
};
typedef vector<Edge> Node;
typedef vector<Node> Graph;
void add_edge(Graph& G, int a, int b, int c){
  G[a].push_back(Edge(a, b, c, G[b].size()));
  G[b].push_back(Edge(b, a, 0, G[a].size() - 1));
}

bool used[300];
int dfs(Graph& G, int v, int t, int f){
  if(v == t) return f;
  used[v] = true;
  REP(i, G[v].size()){
    Edge& e = G[v][i];
    if(!used[e.dst] && e.cap > 0){
      int d = dfs(G, e.dst, t, min(f, e.cap));
      if(d > 0){
        e.cap -= d;
        G[e.dst][e.rev].cap += d;
        return d;
      }
    }
  }
  return 0;
}

int max_flow(Graph& G, int s, int t){
  int flow = 0;
  while(true){
    memset(used, 0, sizeof(used));
    int f = dfs(G, s, t, INF);
    if(f == 0) break;
    flow += f;
  }
  return flow;
}


int main(){
  int N, M, L;
  while(cin >> N >> M >> L){
    int dist[110][110] = {};
    REP(i, N) REP(j, N) dist[i][j] = (i != j ? INF : 0);
    REP(i, M){
      int a, b, c; cin >> a >> b >> c;
      a--; b--;
      dist[a][b] = dist[b][a] = c;
    }
    REP(k, N) REP(i, N) REP(j, N) dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
    int S = 2 * N;
    int D = S + 1;
    Graph G(D + 1);
    REP(i, N){
      int P; cin >> P;
      add_edge(G, S, i, P);
    }
    REP(i, N){
      int K; cin >> K;
      add_edge(G, N + i, D, K);
    }
    REP(i, N) REP(j, N) if(dist[i][j] < L) add_edge(G, i, N + j, INF);
    int ans = max_flow(G, S, D);
    cout << ans << endl;
  }
  return 0;
}

Measured memory_bytes: 1680
import java.util.*;
public class Main{
  public static void main(String[]args){
      Scanner sc = new Scanner(System.in);

      int n = sc.nextInt();

      if(n==2){
        int a = sc.nextInt();
        int b = sc.nextInt();

        System.out.println(a+b);
      }else{
        System.out.println("Hello World");
      }


  }
}


Measured memory_bytes: 21332
#include <bits/stdc++.h>
#define ff { ios_base::sync_with_stdio(false);cin.tie(NULL);}
using namespace std;

typedef long long int ll;
 ll  p=1e9+7; 

 int  main() {
        ff;
       
       
       ll n;
       cin>>n;
       string s;
       map<string,int> m;
       ll sum=0;
       while(n--){
           cin>>s;
           if(m[s]==0){
               m[s]=1;
               sum++;
           }
       }
       
       cout<<sum<<endl;
       
      
    return 0;
}

Measured memory_bytes: 19248
#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define EACH(i, c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort((c).begin(), (c).end())
#define dump(x) cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \
                      << " " << __FILE__ << endl;
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())

using namespace std;

int calc(int sum, vector<int> num, vector<int> op){
    for (auto a : op){
        sum -= num[a+1]*2;
        
    }

    return sum;
}

vector<int> swp(vector<int> input){
    vector<int> output(input.size());
    REP(i,(int)input.size()){
        output[i] = input[input.size()-1-i];
    }

    return output;
}
// 各桁を配列要素に分解 その先頭ポインタを返す
vector<int> slice_digit_swp( int num )
{
    int mod = 0;
    vector<int> parts;

    while( num >= 1 )   {
        mod = num % 10; // 一の位の余り
        num = num / 10; // 取得済みの余りを"num"から除去
        parts.PB(mod);
    }

    return swp(parts);
}



string res(vector<int> num, vector<int> opNum){
    string res = "";
    vector<string> opStr(3,"+");
    for (int op : opNum){
        opStr[op] = "-";
    }
    REP (i,(int)num.size()){
        res += to_string(num[i]);
        if (i < (int)opStr.size())res += opStr[i];
    }
    res += "=7";

    return res;
}

int main() {
    string n;
    cin >> n;
    vector<int> num(n.length());
    REP(i,(int)n.length()){
        num[i] = stoi(n.substr(i, 1));
    }
    
    int sum = accumulate(ALL(num),0);

    // {0, 1, ..., n-1} の部分集合の全探索
    for (int bit = 0; bit < (1<<(int)num.size()-1); ++bit)
    {

        // bit の表す集合を求める
        vector<int> S;
        for (int i = 0; i < (int)num.size()-1; ++i) {
            if (bit & (1<<i)) { // i が bit に入るかどうか
                S.push_back(i);
            }
        }

        if (calc(sum,num,S) == 7){
            cout << res(num,S);

            
            
            return 0;
        }



        
        
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
int main() {
  char a;
  cin>>a;
  if(a=='G'){
    cout<<'C'<<endl;
  }
  else if(a=='C'){
    cout<<'G'<<endl;
  }
  else if(a=='T'){
    cout<<'A'<<endl;
  }
  else{
    cout<<'T'<<endl;
  }
  return 0;
}


Measured memory_bytes: 3604
#include<bits/stdc++.h>
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
#define Rep(i,j,k) for (int i=(int)(j);i>=(int)(k);i--)
#define pii pair<int,int>
#define fi first
#define se second
#define PB push_back
#define ll long long
using namespace std;
const int mo=998244353;
const int N=3000005;
int fac[N],inv[N],n,m;
int C(int x,int y){
	if (x<0||y<0||y>x) return 0;
	return 1ll*fac[x]*inv[y]%mo*inv[x-y]%mo;
}
int main(){
	fac[0]=inv[0]=inv[1]=1;
	For(i,2,N-1) inv[i]=1ll*inv[mo%i]*(mo-mo/i)%mo;
	For(i,1,N-1) inv[i]=1ll*inv[i-1]*inv[i]%mo;
	For(i,1,N-1) fac[i]=1ll*fac[i-1]*i%mo;
	int n,m;
	scanf("%d%d",&n,&m);
	int ans=(C(3*m+n-1,n-1)+mo-1ll*C(m-1+n-1,n-1)*n%mo)%mo;
	For(j,m+1,m*3) if ((m*3-j)%2==0)
		ans=(ans+mo-1ll*C(n,j)*C((m*3-j)/2+n-1,n-1)%mo)%mo;
	printf("%d\n",ans);
}

Measured memory_bytes: 23680
#include <cstdio>
#include <algorithm>
#include <queue>
using namespace std;

int odd[110000];
int even[110000];
int n;
int main(){
	//freopen("input.txt","r",stdin);
	scanf("%d",&n);
	int tmp;
	for(int i = 0 ; i < n ; i++){
		scanf("%d",&tmp);
		if((i%2) == 0){
			even[tmp]++;
		}
		else{
			odd[tmp]++;
		}
	}	

	priority_queue<pair<int,int>> opq;
	priority_queue<pair<int,int>> epq;

	for(int i = 0 ; i < 101000 ; i++){
		if(odd[i]==0)	continue;
		opq.push({odd[i],i});
	}

	for(int i = 0 ; i < 101000;i++){
		if(even[i]==0)	continue;
		epq.push({even[i],i});
	}

	if(opq.top().second == epq.top().second){
		int ans = n;
		int optop = opq.top().first;
		opq.pop();
		int evtop = epq.top().first;
		epq.pop();

		if(opq.size()){
			ans = min(ans,n-evtop-opq.top().first);
		}
		if(epq.size()){
			ans = min(ans,n-optop-epq.top().first);
		}
		if(opq.size()==0 && epq.size()==0){
			ans = min(ans,n-evtop);
			ans = min(ans,n-optop);
		}
	
		printf("%d",ans);

	}
	else{
		printf("%d",n-opq.top().first-epq.top().first);
	}


}

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

#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define endl '\n'
#define fcin ios::sync_with_stdio(false); cin.tie(nullptr);
#define INF 0x3f3f3f3f
#define all(x) x.begin(), x.end()
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

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

template <typename A, typename B>
string to_string(pair<A, B> p){
    return "(" + to_string(p.fi) + ", " + to_string(p.se) + ")";
}

template <typename T>
string to_string(T v){
    string s = "{";
    bool first = true;
    for(const auto & x : v){
        if(!first) s += ", ";
        first = false;
        s += to_string(x);
    }
    return s + "}";
}

void debug_out(){ cerr << endl;}
template <typename First, typename... Next>
void debug_out(First F, Next... N){
    cerr << " " << to_string(F);
    debug_out(N...);
}

#ifdef LOCAL
    #define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
    #define debug(...) 1
#endif

int main(){
    fcin;

    int n, m;
    cin >> n >> m;

    string s;
    cin >> s;

    vector<int> dp(n+1, INF), nxt(n+1, 0);

    priority_queue<pii, vector<pii>, greater<pii>> pq;

    dp[n] = 0;
    nxt[n] = n;

    pq.emplace(dp[n], n);
    for(int i = n - 1; i >= 0; i--){
        if(s[i] == '1') continue;
        while(pq.size() and pq.top().se > i + m) pq.pop();
        if(pq.size()){
            dp[i] = pq.top().fi + 1;
            nxt[i] = pq.top().se - i;
            pq.emplace(dp[i], i);
        }
    }

    if(dp[0] == INF) return cout << -1 << endl, 0;

    int i = 0;
    while(i < n){
        cout << nxt[i] << " ";
        i += nxt[i];
    }
    return 0;
}



Measured memory_bytes: 2296
#include <iostream>
#include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <string>
#include <tuple>
#include <utility>
#include <functional>
#include <sys/time.h>
#include <iomanip>

using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define REP(i, m, n) for(int i = (m); i < (n); ++i)
#define rep(i, n) REP(i, 0, n)
#define all(s) (s).begin(), (s).end()
#define pb push_back
#define fs first
#define sc second
template <typename T>
bool chmax(T &a, const T b){if(a < b){a = b; return true;} return false;}
template <typename T>
bool chmin(T &a, const T b){if(a > b){a = b; return true;} return false;}
template <typename T>
ll pow2(const T n){return (1LL << n);}
void setp(const int n){cout << fixed << setprecision(n);}
constexpr int INF = 1e9+1;
constexpr ll LINF = 1e18+1;
constexpr ll MOD = 1e9+7;
//constexpr ll MOD = 998244353;
constexpr ld EPS = 1e-11;
const ld PI = acos(-1);

constexpr int BEAM_SIZE = 1000;
constexpr int SZ = 26;
constexpr int D = 365;
array<int, SZ> C;
int SUM = 0;
array<array<int, SZ>, D> S;

struct State {
	array<short, SZ> last = {};
	array<char, D> ans;
	int score = 0, sum = 0;

	void update_score(int d, int t) {
		score += S[d][t];
		sum -= C[t] * (d + 1 - last[t]);
		last[t] = d + 1;
		sum += SUM;
		score -= sum;
	}

	int next_eval(int d, int t){
		int res = score;
		res += S[d][t];
		res += C[t] * (d + 1 - last[t]);
		res -= sum + SUM;
		return res;
	}

	int eval() const {
		return score;
	}

	State place(int d, int t) {
		State res = *this;
		res.ans[d] = t;
		res.update_score(d, t);
		return res;
	}

	array<char, D> answer() {
		return ans;
	}
};

array<char, D> solve() {
	State initial_state;
	using f = function<bool(State&, State&)>;
	priority_queue<State, vector<State>, f> cur([](State& a, State& b){return a.eval() > b.eval();});
	cur.push(initial_state);
	priority_queue<State, vector<State>, f> nxt([](State& a, State& b){return a.eval() > b.eval();});
	rep(d, D){
		while(!nxt.empty()) nxt.pop();
		while(!cur.empty()){
			State now = cur.top(); cur.pop();
			rep(t, SZ){
				if(nxt.size() < BEAM_SIZE || now.next_eval(d, t) > nxt.top().eval()) nxt.push(now.place(d, t));
				if(nxt.size() > BEAM_SIZE) nxt.pop();
			}
		}
		swap(cur, nxt);
	}

	State res;
	while(!cur.empty()){
		if(cur.size() == 1) res = cur.top();
		cur.pop();
	}
	cerr << res.eval() << endl;
	return res.answer();
}

int main(void){
	int tmp;
	cin >> tmp;
	rep(i, SZ) cin >> C[i];
	rep(i, SZ) SUM += C[i];
	rep(i, D) rep(j, SZ) cin >> S[i][j];

	auto ans = solve();
	for (char i : ans) cout << (int)i + 1 << endl;

	return 0;
}


Measured memory_bytes: 4324
#include <iostream>
#include <vector>
#include <deque>

using namespace std;

vector<int> gen(int N, int dif){
    if(N == 1) return {0, 1};
    auto prev = gen(N%2 == 0 ? N-1 : N-2, dif);
    vector<int> res;
    if(N%2 == 0){
        for(int i=0;i<prev.size();i++){
            res.push_back(2*prev[i]+i%2);
            res.push_back(2*prev[i]+1-i%2);
        }
    } else {
        int v[2][8] = {
            {0, 1, 3, 2, 2, 3, 1, 0},
            {0, 1, 3, 2, 2, 0, 1, 3}
        };
        for(int i=0;i<prev.size();i+=2){
            int type = (N <= dif && i == prev.size() - 2 ? 1 : 0);
            for(int j=0;j<8;j++){
                res.push_back(4*prev[i+j/4] + v[type][j]);
            }
        }
    }
    return res;
}

int main(){
    int N, A, B; cin >> N >> A >> B;
    deque<int> qu;
    int cnt = 0;
    for(int i=0;i<N;i++){
        if(((A^B)>>i)%2){
            qu.push_back(i);
            ++cnt;
        } else {
            qu.push_front(i);
        }
    }
    if(cnt%2 == 0){
        cout << "NO" << endl;
    } else {
        cout << "YES" << endl;
        auto v = gen(N, cnt);
        for(auto& t : v){
            int val = 0;
            for(int i=0;i<qu.size();i++){
                val |= (((A>>qu[i])%2)^((t>>i)%2)) << qu[i];
            }
            cout << val << " ";
        }
        cout << endl;
    }
}

Measured memory_bytes: 1784
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define pb push_back
const int maxn=2e5+10;
const int mod=998244353;
int a[3005][3005];
ll dp[3005][3005][5];


int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int r,c,k;
    cin>>r>>c>>k;
    while(k--)
    {
        int x,y,z;
        cin>>x>>y>>z;
        a[x][y]=z;
    }
    ll ans=0;
    for(int i=1;i<=r;i++)
    {
        dp[i][1][0]=dp[i-1][1][1];
        dp[i][1][1]=dp[i-1][1][1]+a[i][1];
        ans=max(ans,dp[i][1][1]);
    }
    /*for(int i=1;i<=c;i++)
    {
        for(int x=1;x<=3;x++)
        {
            dp[1][i][x]=max(dp[1][i-1][x],dp[1][i-1][x-1]+a[1][i]);
            ans=max(ans,dp[1][i][x]);
        }
    }*/

    for(int i=1;i<=r;i++)
    {
        for(int j=2;j<=c;j++)
        {
            dp[i][j][0]=max(dp[i][j-1][0],max(dp[i-1][j][2],dp[i-1][j][3]));
            ans=max(ans,dp[i][j][0]);
            for(int x=1;x<=3;x++)
            {
                dp[i][j][x]=max(max(dp[i-1][j][3]+a[i][j],dp[i-1][j][2]+a[i][j]),max(dp[i][j-1][x],dp[i][j-1][x-1]+a[i][j]));
                ans=max(ans,dp[i][j][x]);
            }
        }
    }
    cout<<ans<<'\n';


}


Measured memory_bytes: 390944
int main(){
int a,b,c,x;
scanf("%d %d %d\n",&a,&b,&c);
if (a>c){x=c;c=a;a=x;};
if (a>b){x=b;b=a;a=x;};
if (b>c){x=c;c=b;b=x;};
printf("%d %d %d\n",a,b,c);
return 0;
}

Measured memory_bytes: 600
#include <iostream>
#include<sstream>
#include<string>
#include<vector>
#include <cmath>
#include <limits>
#include <queue>
#include<algorithm>

using namespace std;

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

int main(){
    int h,w,n,L;
    cin >> h >> w >> n;
    if (h > w) L = h;
    else L = w;
    if(n%L == 0) cout << n/L;
    else cout << n/L+1;
    

    return 0;
}

Measured memory_bytes: 256
package main

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

const (
	initialBufSize = 1e4
	maxBufSize     = 1e8 + 7
)

var buf []byte = make([]byte, maxBufSize)
var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(buf, maxBufSize)
}

func main() {
	N := nextInt()
	K := nextInt()
	An := make([]int, N)
	nums := []int{0}
	var count, prev, ans int
	for i := range An {
		An[i] = nextInt()
	}
	sort.Ints(An)
	for i := 0; i < N; i++ {
		if An[i] != prev {
			prev = An[i]

			nums = append(nums, 0)
			count++
		}
		nums[count]++
	}
	numsvars := nums[1:]
	sort.Ints(numsvars)
	if K < len(numsvars) {
		for i := 0; i < len(numsvars)-K; i++ {
			ans += numsvars[i]
		}
	}
	fmt.Println(ans)
}

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

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


Measured memory_bytes: 19712
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG //GCC5.4.1で配列の範囲外アクセスをエラーにする

//cmdで g++ test.cpp とするとコンパイルできる
//制限1秒なら10^6は余裕 10^7は多分間に合う 10^8はよほど単純でないと厳しい

#define ALL(x) x.begin(),x.end()
typedef long long ll; //long long
typedef pair<int,int> pii; //pair<int,int>
typedef vector<int> vi; //vector<int>
typedef vector<vector<int>> vvi; //vector<vector<int>>
typedef vector<ll> vll; //vector<long long>
typedef vector<vector<ll>> vvll; //vector<vector<long long>>
typedef priority_queue<int, vector<int>, greater<int> > gpq; //逆順priority_queue
typedef priority_queue<int> pq;

//const int MOD=998244353;
const int MOD=1000000007; //10^9+7
const double PI=3.1415926535;

gpq A;

bool contain_357(int x){
    bool b3=false,b5=false,b7=false;
    while(x){
        if(x%10==3)b3=true;
        if(x%10==5)b5=true;
        if(x%10==7)b7=true;
        x/=10;
    }
    return (b3&&b5&&b7)?true:false;
}

void push_val(int x,int dig,int max_dig){
    if(dig==max_dig){
        if(contain_357(x))A.push(x);
    }else{
        push_val(x*10+3,dig+1,max_dig);
        push_val(x*10+5,dig+1,max_dig);
        push_val(x*10+7,dig+1,max_dig);
    }
}


int main(){
    int N;
    cin>>N;
    for(int d=3;d<=9;d++){
        push_val(0,0,d);
    }
    int ans=0;
    while(!A.empty()){
        if(A.top()<=N){
            ans++;
        }else{
            break;
        }
        A.pop();
        // cout<<A.top()<<" "<<endl;
        // A.pop();
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long
#define sz(i) (int)(i.size())
#define F first
#define S second
#define L long double
#define P pair<int, int>
const int inf = 0x3f3f3f3f3f3f3f3LL;
const int mod = (int)1e9 + 7;
using namespace std;
#if LOCAL
#include "../../tr.h"
#else
#define tr(...)
#define endl '\n'
#endif
template<class T> void smin(T& a, T val) {if (a > val) a = val;}template<class T> void smax(T& a, T val) {if (a < val) a = val;}
const int N = 5*(int)1e5 + 10;

int n, a[N];

int32_t main(){_
         
      string s;
   cin >> s;

   bool a = false, b = false;

   for(auto it: s){
      a |= it == 'A';
   }
   
   for(auto it: s){
      b |= it == 'B';
   }

   if (a and b){
      cout<<"Yes\n";
   }
   else{
      cout<<"No\n";
   }

   return 0;
}


Measured memory_bytes: 3604
my $n=<>;my $counter=0;($c0,$c1,$c2,$c3)=(0,0,0,0);
while ($n>$counter){$test=<>;if($test=~/^A/){$c0++;}elsif($test=~/^W/){$c1++;} elsif($test=~/^T/){$c2++;}else{$c3++;}$counter++;}
print "AC x $c0\nWA x $c1\nTLE x $c2\nRE x $c3";


Measured memory_bytes: 4896
#pragma GCC optimize ("O3")
#pragma GCC optimize("unroll-loops")
#include"bits/stdc++.h"
using namespace std;
#define v first
#define w second
vector<int> col;
vector<vector<pair<int,int>>>g;
int n;
void dfs(int node=0, int par=-1, int c=0)
{
	col[node]=c;
	for(auto u:g[node])
	{
		if(u.v==par)continue;
		if(u.w&1)dfs(u.v,node,c^1);
		else dfs(u.v,node,c);
	}
}
int32_t main()
{
	cin>>n;
	col=vector<int>(n);
	g=vector<vector<pair<int,int>>>(n);
	int x,y,u;
	for(int i=1;i<n;i++)
	{
		cin>>x>>y>>u;
		x--;y--;
		g[x].push_back({y,u});
		g[y].push_back({x,u});
	}
	dfs();
	
	for(int i=0;i<n;i++)
	{
		cout<<col[i]<<'\n';
	}
	
}

Measured memory_bytes: 12264
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
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; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     @hamayanhamayan0
　　　　／　　　＼　 　  |　|
　　　 /　　 /￣￣￣￣/　　|
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿
　 　　　＼/＿＿＿＿/　（u　⊃
---------------------------------------------------------------------------------------------------*/














ll A, V, B, W, T;
//---------------------------------------------------------------------------------------------------
void _main() {
	cin >> A >> V >> B >> W >> T;
	if (A > B) A *= -1, B *= -1;
	A += V * T;
	B += W * T;

	if (B <= A) cout << "YES" << endl;
	else cout << "NO" << endl;
}







Measured memory_bytes: 3608
N = int(input())
ab = [list(map(int, input().split())) for _ in range(N)]
mnl = [ab[i][0] for i in range(N)]
mxl = [ab[i][1] for i in range(N)]
mnl.sort()
mxl.sort()

if N % 2:
  mn = mnl[N//2]
  mx = mxl[N//2]
  print(mx-mn+1)
else:
  mn = (mnl[N//2-1]+mnl[N//2])/2
  mx = (mxl[N//2-1]+mxl[N//2])/2
  d = mx-mn
  print(int(mx-mn+1+d))


Measured memory_bytes: 129512
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <queue>
#include <vector>
#include <iostream>
using namespace std;
int main()
{
    int n,k,maxn=-9999999;
    scanf("%d%d",&n,&k);
    int num[55];
    for(int i=0; i<n; i++)
        scanf("%d",&num[i]);
    int a,b,c;
    for(a=0; a<=k; a++)
    {
        for(b=0; b<=k; b++)
        {
            for(c=0; c<=k; c++)
            {
                if(a+b+c<=k&&a+b<=n&&a+b>=c)
                {
                    priority_queue<int>q;
                    for(int i=0; i<a; i++)
                        q.push(num[i]);
                    for(int i=0; i<b; i++)
                        q.push(num[n-1-i]);
                    int sum=0;
                    for(int i=0;i<a+b-c;i++)
                    {
                        sum=sum+q.top();
                        q.pop();
                    }
                     maxn=max(maxn,sum);
                }

            }
        }
    }
    printf("%d",maxn);
    return 0;
}


Measured memory_bytes: 3752
#include <bits/stdc++.h>
 
using namespace std;
 
#define INF 1001000100010001000
#define MOD 1000000007
#define EPS 1e-10
#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 For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define mp make_pair
#define i_i pair<int, int>
#define vi vector<int>
#define vvi vector<vi >
#define vb vector<bool>
#define vvb vector<vb >
#define vp vector< i_i >
#define all(a) (a).begin(), (a).end()
#define Int(x) int x; scanf("%lld", &x);
#define int2(x, y) int x, y; scanf("%lld %lld", &x, &y);
 
//int dxy[5] = {0, 1, 0, -1, 0};
// assign
 
signed main()
{
    Int(n);
    vvi data(n, vi(n));
    rep(i, n) {
        rep(j, n) {
            cin >> data[i][j];
        }
    }
    int ans = 0;
    rep(i, n) {
        for (int j = i+1; j < n; j++) {
            ans += min(data[i][j], data[j][i]);
        }
    }
    cout << ans << endl;

    return 0;
}

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

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

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

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

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

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

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

bool dp[81][81][10000];

int main(int argc, char const *argv[]) {
    int h,w; cin>>h>>w;
    vector<vector<int>> a(h, vector<int>(w));
    vector<vector<int>> b(h, vector<int>(w));
    rep(i,h) rep(j,w) cin>>a[i][j];
    rep(i,h) rep(j,w) cin>>b[i][j];
    memset(dp,0,sizeof(dp));
    dp[0][0][abs(a[0][0]-b[0][0])] = true;
    
    rep(i,h) {
        rep(j,w) {
            if (i==0&&j==0) continue;
            int m = abs(a[i][j]-b[i][j]);
            rep(k,9000) {
                int nex1 = abs(k+m); int nex2 = abs(k-m);
                if (i-1>=0) {
                    dp[i][j][nex1] |= dp[i-1][j][k];
                    dp[i][j][nex2] |= dp[i-1][j][k];
                }
                if (j-1>=0) {
                    dp[i][j][nex1] |= dp[i][j-1][k];
                    dp[i][j][nex2] |= dp[i][j-1][k];
                }
            }
        }
    }

    int ans = INF;
    rep(k,6402) if (dp[h-1][w-1][k]) chmin(ans,k);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 64384
#include<stdio.h>
int i,j,EW,NS,L,W;
char D,P[4][13][3]={0};

int ch(char c)
{
	switch(c)
	{
	case 'T':return 10;
	case 'J':return 11;
	case 'Q':return 12;
	case 'K':return 13;
	case 'A':return 99;
	default:return c-'0';
	}
}

int main()
{
	for(;scanf("%c\n",&D),D!='#';)
	{
		for(i=EW=NS=0;i<4;i++)
			for(j=0;j<13;j++)
				scanf("%2s%*c",P[i][j]);
		for(i=L=0;i<13;i++)
		{
			for(j=0,W=L;j<4;j++)
			{
				if(P[j][i][1]==P[W][i][1])
				{
					if(ch(P[j][i][0])>ch(P[W][i][0]))
						W=j;
				}
				else if(P[j][i][1]==D)
						W=j;
			}
			W%2?EW++:NS++;
			L=W;
		}
		if(NS<EW){printf("EW %d\n",EW-6);}
		else{printf("NS %d\n",NS-6);}
	}
	return 0;
}

Measured memory_bytes: 548
#include <bits/stdc++.h>
using namespace std;
int main() {
  int a = 0, b = 0, c = 0, d = 0, N;
  cin >> N;
  vector<string> vec(N);
  for(int i = 0; i < N; i++) {
    cin >> vec.at(i);
    if(vec.at(i) == "AC") {
      a += 1;
      continue;
    }
    else if(vec.at(i) == "WA") {
      b += 1;
      continue;
    }
    else if(vec.at(i) == "TLE") {
      c += 1;
      continue;
    }
    else {
      d += 1;
      continue;
    }
  }
  cout << "AC x " << a << endl;
  cout << "WA x " << b << endl;
  cout << "TLE x " << c << endl;
  cout << "RE x " << d << endl;
}


Measured memory_bytes: 6320
#include<stdio.h>
int main(void){
int n;
  scanf("%d",&n);
  int d[n];
  int  sum=0;
  for(int i=0;i<n;i++){
	scanf("%d",&d[i]);
  }
  for(int i=0;i<n-1;i++){
    	for(int j=i+1;j<n;j++){
	sum+=d[i]*d[j];
        }
  }
  printf("%d",sum);
  return 0;
}

Measured memory_bytes: 128
#include <iostream>
using namespace std;
main () {
	int n, m;
	cin>>n>>m;
	int a[n], res1 = 0;
	for (int i=0;i<n;i++) {
		cin>>a[i];
		res1+=a[i];
	}
	int ans = 0;
	int result = res1 * (0.25);
	for (int i=0;i<n;i++) {
		if (res1 <= a[i] * 4 * m) {
			ans++;
		}
	}
	if (ans >= m) {
		cout<<"Yes"<<endl;
	} else {
		cout<<"No"<<endl;
	}
}

Measured memory_bytes: 256
fn main() {
  let mut s = String::new();
  std::io::stdin().read_line(&mut s).unwrap();
  let mut iter = s.split_whitespace();
  let A: i32 = iter.next().unwrap().parse().unwrap();
  let B: i32 = iter.next().unwrap().parse().unwrap();
  if A <= 5 {
    println!("0");
  } else if A <= 12 {
    println!("{}", B/2);
  } else {
    println!("{}", B);
  }
}

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

if n == 0:
    print('0')
else:
    sum = 0
    i = 0
    S = []
    while n != 0:

        x = n % (2 ** (i+1))
        if x != 0:
            S.append('1')

            n -= (-2) ** i

        else:
            S.append('0')
        i += 1
    
    S = S[::-1]
    strS = ''.join(S)
    print(strS)


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

int main()
{
  int n, m;
  cin >> n >> m;
  vector<priority_queue<pair<int, int>>> v(m);

  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    if (a >= m) continue;
    v[a].emplace(b, a);
  }

  int ans = 0;
  priority_queue<pair<int, int>> pq;

  for (int i = 0; i < m; i++) {
    if (!v[i].empty()) {
      pq.push(v[i].top());
      v[i].pop();
    }
    if (!pq.empty()) {
      auto t = pq.top();
      pq.pop();
      ans += t.first;
      if (!v[t.second].empty()) {
        pq.push(v[t.second].top());
        v[t.second].pop();
      }
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 6400
N = int(input())
ab = []
for i in range(N):
    _a, _b = map(int, input().split())
    ab.append((_a, _b))
cd = []
for j in range(N):
    _c, _d = map(int, input().split())
    cd.append((_c, _d))
cd.sort()

s = set()
for j in range(N):
    maxb = -1
    maxi = -1
    for i in range(N):
        if ab[i][0] < cd[j][0] and ab[i][1] < cd[j][1] and i not in s:
            if ab[i][1] > maxb:
                maxb = ab[i][1]
                maxi = i
    if maxi != -1:
        s.add(maxi)
print(len(s))

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#if ONLINE_JUDGE
    #define DEBUG false
#else
    #define DEBUG true
#endif
#define fastcin() cin.tie(0);ios::sync_with_stdio(false)
#define REP(i, k, n) for (int i = (int)(k); i < (int)(n); i++)
#define rep(i, n) REP(i, 0, n)
#define rep1(i, n) REP(i, 1, n)
#define rREP(i, k, n) for (int i = (int)(n)-1; i >= k; i--)
#define rrep(i, n) rREP(i, 0, n)
#define forlist(i, vec) for(auto &&i : vec)
#define all(x) (x).begin(),(x).end()
#define SORT(x) sort(all(x))
#define REV(x) reverse(all(x))
#define UNIQUE(x) x.erase(unique(all(x)), x.end());
#define MAX(x) *max_element(all(x))
#define MIN(x) *min_element(all(x))
#define LOWitr(x, n) lower_bound(all(x), n)
#define UPRitr(x, n) upper_bound(all(x), n)
#define cii(x) int x;cin >> x
#define cill(x) LL x;cin >> x
#define cis(x) string x;cin >> x
#define co(x) cout << x << endl
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define truecheck assert
#define dump(x) if(DEBUG) cout << #x << ": " << (x) << endl
using namespace std;
typedef long long LL;
typedef long long int64;
typedef std::vector<int> VI;
typedef std::vector<VI> VVI;
typedef std::vector<LL> VL;
typedef std::vector<VL> VVL;
typedef std::vector<std::string> VS;
typedef std::pair<int, int> PII;
typedef std::pair<LL, LL> PLL;
typedef std::queue<int> QI;
typedef std::priority_queue<int> PQI;
template<class T,class U>inline bool chmax(T &a, const U &b){if (a<b){a=b;return true;}return false;}
template<class T,class U>inline bool chmin(T &a, const U &b){if (b<a){a=b;return true;}return false;}
template<class T,class U>inline void vcinpb(T &v, U n){rep(i, n){typename T::value_type a;cin >> a;v.pb(a);}}
template<class T>inline void dumpv(T &v){
    if(!DEBUG){return;}cout<<"{";rep(i,v.size()){cout<<v[i]<<",";}cout<<"}"<<endl;
}

const int INF = 1e9, MOD = 1e9 + 7;
const LL LLINF = 1e16;
// M_PI 3.1415...

int main() {
    fastcin();
    cout << fixed << setprecision(10);
    cill(n);
    VL v(n+10), ph(201000), mh(201000), idxes;
    LL ans = 0;
    rep(i, n){
        cin >> v[i];
    }
    rep(i, n){
        if(i+1 + v[i] < 200900){
            ph[ i+1 + v[i] ]++;
            if (ph[ i+1 + v[i] ] == 1){
                idxes.pb(i+1 + v[i]);
            }
        }
        if(i+1 - v[i] > 0){
            mh[ i+1 - v[i] ]++;
            if (mh[ i+1 - v[i] ] == 1){
                idxes.pb(i+1 - v[i]);
            }
        }

    }
    SORT(idxes);
    UNIQUE(idxes);
    dumpv(idxes);
    for(auto&& i : idxes){
        ans += ph[i] * mh[i];
        dump(ans);
    }
    co(ans);
    return 0;
}

Measured memory_bytes: 10016
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>

using LL = long long;

const int mod = (int)1e9 + 7;
const int maxN = (int)1e6 + 5;

int fac[maxN], invFac[maxN];
int N;

int quickPow(int x, int e)
{
    LL base = x;
    LL ans = 1;
    for (; e; e >>= 1)
    {
        if (e & 1)
            ans = ans * base % mod;
        base = base * base % mod;
    }
    return (int)ans;
}

void initFac()
{
    fac[0] = 1;
    for (int i = 0; i < N; i++)
        fac[i + 1] = (int)((i + 1LL) * fac[i] % mod);

    for (int i = 0; i <= N; i++)
        invFac[i] = quickPow(fac[i], mod - 2);
}

inline int C(int n, int k)
{
    LL t = 1LL * fac[n] * invFac[k] % mod;
    return (int)(t * invFac[n - k] % mod);
}

int solve()
{
    std::vector<LL> vec;
    vec.reserve(maxN);

    for (int k = 0; k < N; k++)
    {
        LL t = fac[N - 1 - k];
        if (N - k - 2 >= k)
        {
            t = t * C(N - k - 2, k) % mod;
            t = t * fac[k] % mod;
            vec.push_back(t);
        }
        else
            break;
    }
    LL ans = 0;
    for (int i = 0; i < vec.size(); ++i)
    {
        LL diff = i + 1 < vec.size() ? (vec[i] + mod - vec[i + 1]) % mod : vec[i];
        ans = (ans + diff * (N - i - 1)) % mod;
    }
    return (int)ans;
}

int main()
{
    scanf("%d", &N);
    initFac();
    printf("%d", solve());
    return 0;
}


Measured memory_bytes: 13696
#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 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)
typedef long long ll;
 
const int inf = int(1e9);
const int mod = 1e9 + 7;
const int N = 1e6 + 555;
const long double PI = acos(-1.0);

void solve()
{	
	int a, b;
	cin >> a >> b;
	cout << max(a + b, max(a - b, a * b));
}

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


Measured memory_bytes: 256
N = int(input())
As = list(map(int, input().split(" ")))

count = 0
flag = False

while True:
    for i, A in enumerate(As):
        if A % 2 == 0:
            As[i] = int(A/2)
        else:
            flag = True
            break

    if flag:
        break

    count += 1

print(count)



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

int main(){
    int n;cin>>n;int x[n];
    for(int i=0;i<n;i++) cin>>x[i];
    int ans=1000000;
    for(int p=1;p<=100;p++){
        int sum=0;
        for(int i=0;i<n;i++){
            sum+=(x[i]-p)*(x[i]-p);
        }
        ans=min(sum,ans);
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256