akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;


int main(){
    int a=3;
    int arr[a];
    for (int i = 0; i < a; i++) {
        /* code */
        std::cin >> arr[i];
    }
    
    int x=arr[0];
    int y=arr[1];
     arr[0]=y;
     arr[1]=x;
    
    int k=arr[0];
    int j=arr[2];
    arr[2]=k;
    arr[0]=j;
    
    cout<<arr[0]<<" "<<arr[1]<<" "<<arr[2]<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define EM 100000000
using namespace std;
using LL = long long;
using P = pair<LL, LL>;
LL LINF = 1e18;
int INF = 1e9;
LL mod = 1e9+7;
using vint = vector<int>;
using vLL = vector<LL>;
using vvint = vector<vector<int>>;
using vvLL = vector<vector<LL>>;
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; }

int main(){
	int L, R;
	cin >> L >> R;
	if(R-L >= 2019){cout << 0 << endl;return 0;}
	vector<int>	amod;
	int ans = 1000000;
	for(int i = L;i <= R;i++)	amod.push_back(i%2019);
	for(int i = 0;i < amod.size();i++){
		for(int j = i+1;j < amod.size();j++){
			ans = min(ans, (amod[i] * amod[j])%2019);
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
n = int(input())
li = list(map(int,input().split()))
cnt = 0
for i in range(len(li)-2):
    a = li[i]
    b = li[i+1]
    c = li[i+2]
    if max(a,c)>b and b>min(a,c):
        cnt+=1
print(cnt)

Measured memory_bytes: 3064
#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()
#define get_tp(t,i) get<i>(t)
typedef long long ll; //long long
typedef pair<int,int> pii; //pair<int,int>
typedef pair<long long,long long> pllll; //pair<ll,ll>
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 long double PI=3.1415926535897932;

int main(){
    ll N;
    cin>>N;
    vll a(N);
    ll all_xor=0;
    for(int i=0;i<N;i++){
        cin>>a[i];
        all_xor=all_xor^a[i];
    }
    for(int i=0;i<N-1;i++){
        cout<<(all_xor^a[i])<<" ";
    }
    cout<<(all_xor^a[N-1])<<endl;
}

Measured memory_bytes: 4696
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<vector>
#include<queue>
#include<map>
#define rep(index,num) for(int index=0;index<num;index++)
#define rep1(index,num) for(int index=1;index<=num;index++)
#define scan(argument) cin>>argument
#define prin(argument) cout<<argument<<endl
#define kaigyo cout<<endl
#define eps 1e-15
typedef long long ll;
using namespace std;
typedef pair<int,int> pint;
typedef vector<int> vint;
int INF=2e+9+1;
int main(){
	string s;
	vector<int> forwardnum[2];
	int X[2];
	int muki=0;
	scan(s);
	scan(X[0]);scan(X[1]);
	int Fcount=0;
	int initialmuki=((s[0]=='F') ? 1 : 0);//1:migifix, 0:free
	rep(i,s.size()){
		if(s[i]=='T'){
			if(Fcount!=0) forwardnum[muki].push_back(Fcount);
			muki=(muki ? 0 : 1);
			Fcount=0;
		}
		else Fcount++;
		if(i==s.size()-1&&Fcount){
			forwardnum[muki].push_back(Fcount);
		}
	}
	vector<int> zahyonow[2];
	zahyonow[0].push_back(0);
	zahyonow[1].push_back(0);
	int flag;
	rep(i,2){
		//printf("i: %d / 2\n",i);
		rep(j,forwardnum[i].size()){
			//printf("j: %d / %d\n",j,forwardnum[i].size());
			vector<int> zahyobefore=zahyonow[i];
			zahyonow[i].clear();
			int chohuku[16001]={0};
			rep(k,zahyobefore.size()){
				//printf("k: %d / %d\n",k,zahyobefore.size());
				int tozahyo[2]={zahyobefore[k],zahyobefore[k]};
				if(i==1||j!=0||initialmuki==0){
					tozahyo[0]+=forwardnum[i][j];
					tozahyo[1]-=forwardnum[i][j];
				}
				else{
					tozahyo[0]+=forwardnum[i][j];
					tozahyo[1]+=forwardnum[i][j];
				}
				rep(l,2){
					if(chohuku[tozahyo[l]+8000]==0){
						chohuku[tozahyo[l]+8000]=1;
						zahyonow[i].push_back(tozahyo[l]);
						//printf("tozahyo: %d\n",tozahyo[l]);
					}
				}
			}
		}
		flag=0;
		rep(j,zahyonow[i].size()){
			if(X[i]==zahyonow[i][j]){
				flag=1;
				break;
			}
		}
		if(flag==0) break;
	}
	if(flag) prin("Yes");
	else prin("No");
	return 0;
}


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

using namespace std;

using ll = long long;

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

ll dfs(ll x, string rest) {
    if (rest.size() == 0) return x;
    ll res = 0;
    for (int i = 1; i <= (int)rest.size(); ++i) {
        res += dfs(x + stol(rest.substr(0, i)), rest.substr(i));
    }
    return res;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    cout << dfs(0, s) << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr long long MOD = 1000000007;
constexpr long long INF = 1LL << 60;
const long double PI = acosl(-1.0);
constexpr long double EPS = 1e-11;
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
int main(){
ll w,h,n;
cin >> w >> h >> n;
vector<ll> x(n), y(n), a(n);
ll grid[h][w];
for (ll i = 0; i < h;i++){
    for (ll j = 0; j < w;j++){
        grid[i][j] = 0;
    }
}
for (ll i = 0; i < n; i++) cin >> x[i] >> y[i] >> a[i];
for (ll i = 0; i < n; i++) {
    if (a[i] == 1) {
        for (ll j = 0; j < h; j++) {
            for (ll k = 0; k < x[i]; k++) {
                grid[j][k] = 1;
            }
        }
    } else if (a[i] == 2) {
        for (ll j = 0; j < h; j++) {
            for (ll k = x[i]; k < w; k++) {
                grid[j][k] = 1;
            }
        }
    } else if (a[i] == 3) {
        for (ll j = 0; j < y[i]; j++) {
            for (ll k = 0; k < w; k++) {
                grid[j][k] = 1;
            }
        }
    } else {
        for (ll j = y[i]; j < h; j++) {
            for (ll k = 0; k < w; k++) {
                grid[j][k] = 1;
            }
        }
    }
}
ll cnt = 0;
for (ll i = 0; i < h; i++) {
    for (ll j = 0; j < w;j++){
        if (grid[i][j] == 0) cnt++;
    }
}
cout << cnt << endl;
}

Measured memory_bytes: 3704
#include <stdio.h>
int main(){
	int D, T, S;
	scanf("%d %d %d", &D, &T, &S);
  if(D % S == 0){
	if(D / S > T){
		printf("No");
	}
	else{
		printf("Yes");
	}
  }
  else{
    if(((double) D) / S > T){
		printf("No");
	}
	else{
		printf("Yes");
	}

  }
	return 0;
}

Measured memory_bytes: 1728
#include <stdio.h>

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



Measured memory_bytes: 2112
// Last Change: 06/27/2019 18:26:14.
#include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;
using ll = long long;

namespace NS {
void LoopUntilZeroInpput() {
  int hogegegege = 0;
  while (cin >> hogegegege && hogegegege != 0) {
  }
}
} // namespace NS

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

  if (a < b and b < c) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}



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

void _150() {
    string s;
    cin >> s;

    if ((s == "AAA") || (s == "BBB"))
        cout << "No" << endl;
    else
        cout << "Yes" << endl;
}

void _156() {
    int n, r;
    cin >> n >> r;

    if (n >= 10)
        cout << r << endl;
    else
        cout << r + 100 * (10 - n) << endl;
}


int main()
{
    // _150();
    _156();
    
    return 0;
}



Measured memory_bytes: 256
nums  = int(input())
array = list(map(int, input().split()))

for i in range( nums ):
    v = array[i]
    j = i - 1
    while j >= 0 and array[j] > v:
        array[j+1] = array[j]
        j -= 1
    array[j+1] = v
    print(*array)

Measured memory_bytes: 8000
#include <bits/stdc++.h>
using namespace std;
int main()
{
int A;
cin >> A;
vector<string> S(A);
for(int i=0; i<A; i++)
{
    cin >> S.at(i);
}
int countA=0;
int countW=0;
int countT=0;
int countR=0;
for(int i=0; i<A; i++)
{
    if(S.at(i).at(0)=='A') countA++;
    if(S.at(i).at(0)=='W') countW++;
    if(S.at(i).at(0)=='T') countT++;
    if(S.at(i).at(0)=='R') countR++;
} 
cout << "AC" << " " << "x" <<" "<< countA << endl;
cout << "WA" << " " << "x" <<" "<< countW << endl;
cout << "TLE" << " " << "x" <<" "<< countT << endl;
cout << "RE" << " " << "x" <<" "<< countR << endl;

}

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

using namespace std;

int main()
{
	int a, b, c;
	cin >> a >> b >> c;
	int m = max(max(a, b), c);
	int n = m * 3 - a - b - c;
	cout << (n & 1 ? (n + 3) / 2 : n / 2) << endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <functional>
#include <bitset>
#include <cassert>
#include <random>
using namespace std;
using ll = long long;


int main() {
	int h, a; cin >> h >> a;
	cout << (h + a - 1) / a << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#include <boost/integer/common_factor.hpp>
#include <boost/integer/common_factor_rt.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>

using std::string;
using std::vector;
using std::set;
using std::map;
using std::unordered_map;
using std::pair;
using std::cin;
using std::cout;

typedef uintmax_t    ull;
typedef intmax_t     ll;
typedef uint64_t     ul;
typedef uint32_t     ui;
typedef uint8_t      uc;

typedef boost::multiprecision::number<boost::multiprecision::cpp_dec_float<1000>> cpp_dec_float_1000;

constexpr char CRLF = '\n';
constexpr char SPACE = ' ';
constexpr char VECTOR_COUT_SEPARATOR = SPACE;
constexpr ll INF = 1000'000'007;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> std::ostream& operator<< (std::ostream& os, const std::vector<T>& vc) { for(auto it = vc.begin(); it != vc.end(); ++it) { if (std::next(it) == vc.end()) os << *it; else os << *it << VECTOR_COUT_SEPARATOR; } return os; }
template<class T1, class T2> inline std::ostream & operator<< (std::ostream & os, const std::pair<T1, T2> & p) { return os << p.first << ' ' << p.second; }

ll N{};

ull rec(ll n, ui san, ui go, ui nana)
{
  if(n > N) return 0;
  ull res = san && go && nana;
  return rec(n * 10 + 3, san + 1, go, nana) 
    + rec(n * 10 + 5, san, go + 1, nana)
    + rec(n * 10 + 7, san, go, nana + 1)
    + res;
}

void solve(void)
{
  cin >> N;  
  auto ans = rec(0, 0, 0, 0);

  cout << ans << CRLF;
  return;
}

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

  solve();

  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
    int a1, a2, a3;
    scanf("%d %d %d", &a1, &a2, &a3);

    int max=a1;
    int min=a1;
    if(max < a2){max=a2;}
    if(max < a3){max=a3;}
    if(min > a2){min=a2;}
    if(min > a3){min=a3;}
    max -= min;

    printf("%d\n", max);


    return 0;
}



Measured memory_bytes: 128
#include <bits/stdc++.h>
 
using namespace std;
 
#define ll long long int
#define mod 1000000007
 
#define REP(i, n) for(int i = 0; i < (n); i++)
#define NREP(i, n) for(int i = 0; i < (n); i++)
#define SREP(i, s) for(int i = 0; i < (s.size()); i++)
#define SORT(v, n) sort(v, v+n);
#define GSORT(v, n) sort(v, v+n, greater<int>());
#define VSORT(v) sort(v.begin(),v.end());
#define VGSORT(v) sort(v.begin(),v.end(),greater<int>());
#define REV(a) reverse(begin(a),end(a));

int main(){
	ios::sync_with_stdio(false);cin.tie(0);
	cout << fixed << setprecision(3);
////////////////////////////////////////////	
	int n;
	cin >> n;
	n=pow(n,2)+0.5;
	cout << 3*n << endl;
//////////////////////////////////////////////
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<map>
#include<iomanip>
#include<queue>
#include<stack>
#include<time.h>
#define rep(i,n)for(int i=0;i<n;i++)
#define int long long
#define ggr getchar();getchar();return 0;
#define prique priority_queue
#define mod 1000000007
#define inf 1e15
#define key 1e9
using namespace std;
typedef pair<int, int>P;
void yes() { cout << "Yay!" << endl; }
void no() { cout << ":(" << endl; }
template<class T> inline void chmax(T& a, T b) {
	a = std::max(a, b);
}
template<class T> inline void chmin(T& a, T b) {
	a = std::min(a, b);
}
bool prime(int n) {
	int cnt = 0;
	for (int i = 1; i <= sqrt(n); i++) {
		if (n % i == 0)cnt++;
	}
	if (cnt != 1)return false;
	else return n != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x / gcd(x, y) * y;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= i; res %= mod;
	}
	return res;
}
int mod_pow(int x, int y, int m) {
	int res = 1;
	while (y) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}
int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x, y)* mod_pow(kai(y, y), mod - 2, mod) % mod;
}
struct edge { int to, cost; };
int n;
signed main() {
	cin >> n;
	for (int i = n; i <= 200000; i++) {
		if (prime(i)) {
			cout << i << endl;
			ggr
		}
	}
	ggr
}


Measured memory_bytes: 256
function main(input = "") {
    const lines = input.split("\n");
    const datas = ["AC", "WA", "TLE", "RE"];
    let cnts = new Int32Array(4);

    for (let i = 1; i < lines.length; i++) {
        for (let k = 0; k < 4; k++) {
            if (lines[i] === datas[k]) {
                cnts[k]++;
                break;
            }
        }
    }

    let res = "";
    for(let i = 0; i < 4; i++){
        res += `${datas[i]} x ${cnts[i]}` + "\n"
    }
    res = res.trim();
    return res;
}

//******************************
exports.main = main;

function Main(input) {
    console.log(main(input.trim()));
}

if (process.argv[2] !== "test") {
    Main(require("fs").readFileSync("/dev/stdin", "utf8"));
}


Measured memory_bytes: 37252
package main

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

func lib_CountInt(values []int) map[int]int {
	m := map[int]int{}
	for _, value := range values {
		m[value]++
	}
	return m
}
func main() {
	scanner := bufio.NewScanner(os.Stdin)
	const initialBufSize = 4096
	const maxBufSize = 1000000
	scanner.Buffer(make([]byte, initialBufSize), maxBufSize)
	scanner.Split(bufio.ScanWords)
	var X int
	scanner.Scan()
	X, _ = strconv.Atoi(scanner.Text())
	var N int
	scanner.Scan()
	N, _ = strconv.Atoi(scanner.Text())
	p := make([]int, N)
	for i := 0; i < N; i++ {
		scanner.Scan()
		p[i], _ = strconv.Atoi(scanner.Text())
	}
	fmt.Println(solve(X, N, p))
}
func solve(X int, N int, p []int) int {
	counts := lib_CountInt(p)
	for i := 0; ; i++ {
		if _, ok := counts[X-i]; !ok {
			return X - i
		}
		if _, ok := counts[X+i]; !ok {
			return X + i
		}
	}
}


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

char A[300][300];

int main(){
	int n;
	while(cin >> n && n){
		for(int i = 0 ; i < n ; i++)
			for(int j = 0 ; j < n ; j++)
				cin >> A[i][j];
		int ans = 0;
		for(int i = 0 ; i < n ; i++){
			int p = 0;
			for(int j = 0 ; j < n ; j++){
				p += A[i][j] - '0';
				if( A[i][j] == '0' ) p = 0;
				ans = max(p,ans);
			}
		}
		for(int i = 0 ; i < n ; i++){
			int p = 0;
			for(int j = 0 ; j < n ; j++){
				p += A[j][i] - '0';
				if( A[j][i] == '0' ) p = 0;
				ans = max(p,ans);
			}
		}
		for(int i = 0 ; i <= n ; i++){
			int p = 0 , c = 0;
			for(int j = 0 ; j <= n ; j++){
				if( i+j >= n ) break;
				p += A[j][i+j] - '0';
				c++;
				if( A[j][i+j] == '0' ) p = 0;
				ans = max(p,ans);
			}
		}
		for(int i = 0 ; i <= n ; i++){
			int p = 0 , c = 0;
			for(int j = 0 ; j <= n ; j++){
				if( i+j >= n ) break;
				p += A[i+j][j] - '0';
				c++;
				if( A[i+j][j] == '0' ) p = 0;
				ans = max(p,ans);
			}
		}
		for(int i = 0 ; i <= n ; i++){
			int p = 0 , c = 0;
			for(int j = 0 ; j <= n ; j++){
				if( n-1-i-j < 0 ) break;
				p += A[j][n-1-i-j] - '0';
				c++;
				if( A[j][n-1-i-j] == '0' ) p = 0;
				ans = max(p,ans);
			}
		}
		
		for(int i = 0 ; i <= n ; i++){
			int p = 0 , c = 0;
			for(int j = 0 ; j <= n ; j++){
				if( i+j >= n ) break;
				p += A[i+j][n-1-j] - '0';
				if( A[i+j][n-1-j] == '0' ) p = 0;
				ans = max(p,ans);
				c++;
			}
		}
		cout << ans << endl;
	}
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)  
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define RVSORT(v) sort(v.rbegin(), v.rend());
#define ll long long
#define pb(a) push_back(a)
#define INF 999999999
#define MOD 1000000007
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

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

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

ll modpow(ll n,ll k){
  if(k == 1){
    return n;
  }else if(k == 0){
    return 1;
  }else if(k%2==0){
    ll memo = modpow(n,k/2)%MOD;
    return memo*memo%MOD;
  }else{
    return n * modpow(n,k-1)%MOD;
  }
}

int main(){

  string s;cin>>s;
  int count = 0;
  bool b = true;
  REP(i,4){
    count = 0;
    REP(j,4){
      if(s[i]==s[j]){
        count++;
      }
    }
    //cout<<count<<endl;
    if(count!=2)b = false;

  }

  if(b){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }

 

  return 0;
}

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

using namespace std;

long long arr[20];

int main(){

    int r,d,x;
    cin>>r>>d>>x;
    arr[0] = (x*r)-d;

    for(int i=1;i<10;i++){
        arr[i] = ((long long)(arr[i-1]*r))-d;
    }

    sort(arr,arr+10);

    for(int i=0;i<10;i++)
        printf("%lld\n",arr[i]);

    return 0;
}



Measured memory_bytes: 256
#include <cstdio>

int a, b, c;


int main(){
	scanf("%d %d %d", &a, &b, &c);
	int t = a;
	int count = 0;
	while(1){
		if(t > b){
			break;
		}else if(c % t == 0){
			++count;
		}
		++t;
	}
	printf("%d\n", count);
	
}


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

#define llong long long
#define inf 999999999
#define mp make_pair
#define pb push_back
typedef pair<int, int> P;
typedef struct data{
	int now;
	int cost;
}data;
int nh[4] = {1, 0, -1, 0};
int nw[4] = {0, 1, 0, -1};



int main(){
	string a, b;
	cin >> a >> b;
	vector<int> an;
	vector<int> bn;
	for(int i = 0; i < (int)a.size(); i++){
		an.pb((int)a[i] - 1);
	}
	for(int i = 0; i < (int)b.size(); i++){
		bn.pb((int)b[i] - 1);
	}
	sort(an.begin(), an.end());
	sort(bn.begin(), bn.end(), greater<int>());

	bool check;
	int id;
	if(an.size() < bn.size()){
		id = an.size();
		check = true;
	}else{
		id = bn.size();
		check = false;
	}

	for(int i = 0; i < id; i++){
		if(an[i] < bn[i]){
			check = true;
			break;
		}else if(an[i] > bn[i]){
			check = false;
			break;
		}
	}

	if(check == true) cout << "Yes" << endl;
	else cout << "No" << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.h"
#else
#define dump(...)
#endif
#define endl "\n"
#define ll long long
#define BUF 1e5
#define INF 1 << 30
#define vi vector<int>
#define vvi vector<vector<int>>
#define all(a) (a).begin(), (a).end()
#define bit(n) (1LL << (n))
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
constexpr ll mod = 1e9 + 7;
ll A, B, C, D, G, H, N, M, L, K, P, Q, R, W, X, Y, Z;
string S, T;
ll ans = 0;

template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
    for (T &x : vec)
        is >> x;
    return is;
}

signed main() {
    cin >> N;
    for (int i = 1; i <= N; i++) {
        S = to_string(i);
        if (S.size() & 1)
            ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <algorithm>
using namespace std;

typedef long long int ll;

const double PI=3.14159265358979323846;

int main () {
    ll n, m; cin >> n >> m;
    ll s = 0;
    for (int i = 0; i < m; i++) {
        ll tmp; cin >> tmp;
        s += tmp;
    }
    if (s > n) {
        cout << -1 << endl;
    } else {
        cout << n - s << endl;
    }
    return 0;
}

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pullull;
typedef pair<ll, int> plli;
typedef pair<int, pii> pipii;
typedef vector<vector<int> > mati;
typedef vector<vector<double> > matd;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;

#define rep(i,x,y) for(int i=(x); i<(y); ++i)

template <typename T>
void vec_print(vector<T> VEC){
  rep(i, 0, VEC.size()){
    cout << VEC[i] << " ";
  }
  cout << "\n";
};

template <typename T>
void mat_print(vector<vector<T> > MAT){
  rep(i, 0, MAT.size()){
    rep(j, 0, MAT[i].size()){
      cout << MAT[i][j] << " ";
    }
    cout << "\n";
  }
};

template <typename CLASS1, typename CLASS2>
class HOGE{
  public:
    CLASS1 key;
    CLASS2 value;
    HOGE(ll key, ll value){
      this->key = index;
      this->value = value;
    };
    ~HOGE(void){
      return;
    };

    void print(void){
      cout << "key : " << key << ", value : " << value << "\n";
      return;
    };
    
    bool operator==(const HOGE &obj){
      return (this->value == obj.value);
    };
    bool operator<(const HOGE &obj){
      return (this->value < obj.value);
    };
    bool operator>(const HOGE &obj){
      return (this->value > obj.value);
    };
};

constexpr int INF = (1<<30);
constexpr ll INFLL = 1LL<<62;
constexpr long double EPS = 1e-12;

void calc_dp(const int start, const vector<double>& p, vector<double>& dp){
  if(start==p.size()-1){
    dp[0] = 1.0-p[start];
    dp[1] = p[start];
    return;
  }
  calc_dp(start+1, p, dp);
  dp[p.size()-start] = dp[p.size()-start-1]*p[start];
  for(int i=p.size()-start-1; i>0; --i){
    dp[i] = dp[i]*(1.0-p[start]) + dp[i-1]*p[start];
  }
  dp[0] = dp[0]*(1.0-p[start]);
  return;
}

int main(){
  cin.tie(0); // cut the cin and cout (default, std::flush is performed after std::cin)
  ios::sync_with_stdio(false); // cut the iostream and stdio (DON'T endl; BUT "\n";)

  ll N;
  cin >> N;
  vector<double> p(N);
  rep(i, 0, N){
    cin >> p[i];
  }
  vector<double> dp(N+1, 0.0);

  calc_dp(0, p, dp);
  double ans=0.0;
  double debug=0.0;

  rep(i, N/2+1, N+1){
    ans += dp[i];
  }

  printf("%.10lf\n", ans);

  return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define gt(n) scanf("%d", &n)
#define gtll(n) scanf("%ld", &n)
#define out(n) printf("%d", n)
#define outll(n) printf("%ld", n)
#define loop(n) for(int i=0; i<n; i++)
#define MAXX 1001
#define mem(x, y) memset(x, y, sizeof(x))
#define loop1(n) for(int i=1; i<=n; i++)
#define ll long long
#define pb push_back
#define pi acos(-1)
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
//(only in c)char[33];itoa(n,buffer,base);printf("%s",buffer);
#define dec_to_bin(n) std::string binary = std::bitset<64>(n).to_string();
#define fast ios_base::sync_with_stdio(false),cin.tie(NULL)
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
int main()
{
fast;
int a,b,c;
cin>>a>>b>>c;
int sum=0;
for(int i=a;i<=c+.5;i+=a){
sum+=b;
}
cout<<sum<<endl;
return 0;
}


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

using namespace std;
using ll = long long;
using P = pair<int,int>;
using Graph = vector<vector<int>>;

int main(void) {
    int a, b;
    cin >> a >> b;
    int ans =  a+b;
    ans = max(a-b,ans);
    ans = max(ans, a*b);
    cout << ans << endl;
    return 0;
}


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

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; }
 
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep1(i, n) for (ll i = 1; i <= (ll)(n); i++)
#define INF 10000000000
#define MOD 1000000007
using ll = long long;
using pint = pair<int,int>;
using pll = pair<ll,ll>;
using Graph = vector<vector<int>>;

int main(){
    ll N,W; cin>>N>>W;
    vector<ll> v(N),w(N);
    rep(i,N)cin>>w[i]>>v[i];
    ll min_w = w[0];
    rep(i,N)w[i] -= min_w;
    vector<vector<vector<ll>>> dp(105,vector<vector<ll>>(105,vector<ll>(310,0)));
    // ll dp[105][105][310]; // dp[i][j][k] = iこの物からjこ選び、重さkのときの最大の価値
    rep(i,105)rep(j,105)rep(k,310)dp[i][j][k] = 0;
    rep(i,N){
        rep(j,N){
            rep(k,302){
                dp[i+1][j+1][k] = max(dp[i+1][j+1][k],dp[i][j+1][k]);
                if((j+1)*min_w+k>W) continue;
                if(k-w[i]>=0) dp[i+1][j+1][k] = max(dp[i+1][j+1][k],dp[i][j][k-w[i]]+v[i]);
            }
        }
    }
    ll res = 0;
    rep(j,N+1)rep(k,301) if(j*min_w+k<=W) res = max(res,dp[N][j][k]);
    cout<<res<<endl;
}


Measured memory_bytes: 30648
/*
        FFFFFFFFFFFFFFFFFFFFFF
        F::::::::::::::::::::F
        F::::::::::::::::::::F
        FF::::::FFFFFFFFF::::F
          F:::::F       FFFFFF
          F:::::F
          F::::::FFFFFFFFFF
          F:::::::::::::::F
          F:::::::::::::::F
          F::::::FFFFFFFFFF
          F:::::F
          F:::::F
        FF:::::::FF
        F::::::::FF
        F::::::::FF
        FFFFFFFFFFF
*/
#include <bits/stdc++.h>
using namespace std;
#define debug(...) cout<<__FUNCTION__<<":"<<__LINE__<<": ";debugger(#__VA_ARGS__, __VA_ARGS__);
template<typename arg>
void debugger(const char* varname, arg&& var) { cout<<varname<<" = "<<var<<endl; }
template<typename arg, typename... args>
void debugger(const char* varnames, arg&& var, args&&... vars) {
    const char* comma = strchr(varnames + 1, ',');
    cout.write(varnames, comma - varnames)<<" = "<<var<<" | ";
    int sz = 1; if(isspace(comma[sz])) sz++;
    debugger(comma + sz, vars...);
}
#define forr(i, s, n) for(ll i=(ll)(s); i<(ll)(n); ++i)
#define forn(i, n) forr(i, 0, n)
#define eb(n) emplace_back(n)
#define endl '\n'
#define fst first
#define snd second
using ll = long long;
using ii = pair<ll,ll>;
using vi = vector<ll>;
extern const int INF = INT_MAX - 5;
extern const ll LINF = LLONG_MAX - 5;
extern const int MOD = 1e9 + 7;
extern const int N = 2e5 + 200;

int main() {
    int n,m;
    cin>>n>>m;
    puts(n == m ? "Yes": "No");
    return 0;
}


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

//#define int long long
typedef long long ll;
//const int INF = 2e9;
//const ll INF = 9e18;


signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    double n, m, d;
    cin >> n >> m >> d;
    cout << fixed << setprecision(9);
    if (d == 0){
        cout << (m-1.0)/n << "\n";
    } else {
        cout << 2.0*(m-1)*(n-d)/n/n << "\n";
    }
}

Measured memory_bytes: 3808
import java.io.PrintWriter

fun next() = readLine()!!
fun nextInt() = next().toInt()
fun nextLong() = next().toLong()
fun nextDouble() = next().toDouble()
fun nextList() = next().split(" ")
fun nextIntList() = nextList().map(String::toInt)
fun nextLongList() = nextList().map(String::toLong)
fun nextDoubleList() = nextList().map(String::toDouble)

val pw = PrintWriter(System.out)
fun print(s: Any = "") = pw.print(s)
fun println(s: Any = "") = pw.println(s)

fun <T> Iterable<T>.join(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "") = joinToString(separator, prefix, postfix)
fun <T> Array<T>.join(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "") = joinToString(separator, prefix, postfix)

fun main(args: Array<String>) {
    main()
    pw.flush()
}

fun main() {
    val (N, K) = nextLongList()
    val NN = MInt(N)
    var ans = MInt(0)
    for (k in K..N + 1) {
        ans += NN * k - MInt(k) * (k - 1) + 1
    }
    println(ans)
}

class MInt {
    private val MOD = 1000000007L
    var v: Long

    constructor(v: Long) {
        this.v = v % MOD
    }

    constructor(v: Int) {
        this.v = v.toLong() % MOD
    }

    operator fun plus(b: MInt): MInt {
        val a = MInt(v)
        a.v += b.v
        if (a.v >= MOD) a.v -= MOD
        return a
    }

    operator fun plus(b: Int) = plus(MInt(b))
    operator fun plus(b: Long) = plus(MInt(b))

    operator fun minus(b: MInt): MInt {
        val a = MInt(v)
        a.v -= b.v
        if (a.v < 0) a.v += MOD
        return a
    }

    operator fun minus(b: Int) = minus(MInt(b))
    operator fun minus(b: Long) = minus(MInt(b))

    operator fun times(b: Int) = times(MInt(b))
    operator fun times(b: Long) = times(MInt(b))
    operator fun times(b: MInt): MInt {
        val a = MInt(v)
        a.v *= b.v
        a.v %= MOD
        return a
    }

    operator fun div(b: MInt): MInt {
        return MInt(v) * b.inv()
    }

    fun inv(): MInt {
        var a = v
        var b = MOD
        var u = 1L
        var w = 0L
        while (b != 0L) {
            val t = a / b
            a -= t * b
            u -= t * w
            var tmp = a
            a = b
            b = tmp
            tmp = u
            u = w
            w = tmp
        }
        u %= MOD
        if (u < 0) u += MOD
        return MInt(u)
    }

    override fun toString(): String {
        return v.toString()
    }
}

Measured memory_bytes: 52176
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
mod2 = 998244353
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n = inp()
aa = [0] * (n-1)
bb = [0] * (n-1)
g = [[] for i in range(n)]
res = defaultdict(lambda : defaultdict(int))
for i in range(n-1):
    a,b = inpl()
    aa[i] = a-1
    bb[i] = b-1
    g[a-1].append(b-1)
    g[b-1].append(a-1)
def dfs(i,c=-1,p=-1):
    # print('i:{}'.format(i))
    cnt = 1
    for j in g[i]:
        # print(res[j][i])
        if j == p:
            continue
        if cnt == c:
            cnt += 1
        res[i][j] = cnt
        res[j][i] = cnt
        cnt += 1
        dfs(j,res[i][j],i)
dfs(0)
m = 0
for i in g:
    m = max(m, len(i))
print(m)
for i in range(n-1):
    print(res[aa[i]][bb[i]])

Measured memory_bytes: 146200
#include <bits/stdc++.h>
#define inf 100000000
using namespace std;
#define rep(i,n) for(int i = 0; i < n; ++i)
typedef long long ll;
int main (){
    int n;
    cin >> n;

    vector<ll> a(n),b(n),c(n),r(n),l(n);

    rep(i,n){
        cin >> a[i];
    }

    rep(i,n){
        cin >> b[i];
    }
    
    rep(i,n){
        cin >> c[i];
    }

    sort(a.begin(),a.end());
    sort(b.begin(),b.end());
    sort(c.begin(),c.end());

    rep(i,n){
        ll ia = lower_bound(a.begin(),a.end(),b[i])-a.begin();
        ll ic = c.end()-upper_bound(c.begin(),c.end(),b[i]);
        l[i]=ia;
        r[i]=ic;
    }
    ll sum=0;
    rep(i,n){
        sum+=l[i]*r[i];
    }
    cout << sum <<endl;

    return 0;
}

Measured memory_bytes: 4224
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define countof(array) (sizeof(array) / sizeof(array[0]))
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,n,s) for(int i = s; i < (n); ++i)
#define rsrep(i,n,s) for(int i = (n)-1; i >= s; --i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define aall(a) (a), (a)+countof(a)//for array sorting
#define raall(a) (a), (a)+countof(a), greater<>()
#define show(x) cout<<#x<<" = "<<x<<endl;
#define vfind(v, a) find(all(v), a) != v.end()
#define yn(f) { if (f) puts("YES"); else puts("NO"); }
#define yns(f) { if (f) puts("Yes"); else puts("No"); }
#define show_ary(...) { cout<<#__VA_ARGS__<<" = "; for (const auto& x : (__VA_ARGS__)) { cout<<x<<" "; } cout<<endl; }
#define show_pair(...) cout<<#__VA_ARGS__<<" = "<<endl; for (const auto& x : (__VA_ARGS__)) { cout<<"  "<<x.fi<<" : "<<x.se<<endl; }
#define out_ary(...) { for (const auto& x : (__VA_ARGS__)) { cout<<x<<" "; } cout<<endl; }
#define argmax(v) distance((v).begin(), max_element(all(v)))
#define argmin(v) distance((v).begin(), min_element(all(v)))
#define vmax(v) *max_element(all(v))
#define vmin(v) *min_element(all(v))
typedef long long int ll;
typedef pair<int, int> P;
typedef vector<P> vpair;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<double> vdouble;
typedef vector<string> vstr;
typedef vector<bool> vbool;
typedef vector<vint> vvint;
typedef vector<vll> vvll;
typedef vector<vstr> vvstr;
typedef vector<vbool> vvbool;
const ll LINF = 2000000000000000000ll;
const int INF = 1000000100;
const ll MOD = 1e9+7;

int main() {
    int n;
    cin >> n;
    vint a(n);
    rep(i, n) cin >> a[i];
    
    ll ans = 0;
    ll sum = 0;
    rep(i, n) {
        sum += a[i];
        if (a[i] == 0 || i == n-1) {
            ans += sum/2;
            sum = 0;
        }
    }

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

Measured memory_bytes: 640
import java.util.Scanner;


	public class Main {
		

		public static void main(String[] args) {

			Scanner sc = new Scanner(System.in);
			
			double w = sc.nextDouble();
			double h = sc.nextDouble();
			double x = sc.nextDouble();
			double y = sc.nextDouble();
			int ret = 0;
			
			if(x==w/2&&y==h/2) {
				ret = 1;
			}
			
			System.out.println(w*h/2+" "+ret);
			
			
		}
		
	}


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

#define each(i, c) for (auto& i : c)
#define mkp(a, b) make_pair(a, b)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> Pll;
const ll MOD = 1e9+7;

template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << ": " << p.second << ")"; return os; }
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; each (i, v) os << i << ", "; os << ")"; return os; }
template<typename K, typename V> ostream& operator << (ostream& os, map<K, V> m) { os << "{"; each (i, m) os << i << ", "; os << "}"; return os; }

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

  string ans;
  cin >> ans;
  for (ll i = 0; i < n-1; ++i) {
    string s;
    cin >> s;

    string tmp;
    vector<bool> mark(s.size());
    each (ch, ans) {
      for (ll j = 0; j < s.size(); ++j) {
        if (mark[j]) continue;
        if (ch == s[j]) {
          tmp += ch;
          mark[j] = true;
          break;
        }
      }
    }
    ans = tmp;
  }

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

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using namespace std;
static const int MAX = 1000;
static const int VMAX = 10000;

int n, A[MAX], s;
int B[MAX], T[VMAX + 1];

//s:与えられた数列の中での最小値
//A:与えられた数列
//B:ソート済みの数列
//T:与えられた数列の中の数字がソート済みの数列のなかで来る位置（イテレータ）

int solve(){
    int ans = 0;

    bool V[MAX];  //V:各数字がどのループに属するか判明したかどうか
    for (int i = 0; i < n; i++){
        B[i] = A[i];
        V[i] = false;
    }
    sort(B, B+n);
    for (int i = 0; i < n; i++) T[B[i]] = i;
    for (int i = 0; i < n; i++){
        if (V[i]) continue;
        int cur = i; //検討する数字がソート後に来る位置
        int S = 0; //各ループの要素の数字の和
        int m = VMAX; //各ループの最小値
        int an = 0; //各ループの要素数
        while (1) {
            V[cur] = true;
            an++;
            int v = A[cur];
            m = min(m, v);
            S += v;
            cur = T[v];
            if (V[cur]) break;
        }
        ans += min(S + (an - 2) * m, m + S + (an + 1) * s);
    }

    return ans;
}

int main(){
    cin >> n;
    s = VMAX;
    for (int i = 0; i < n; i++){
        cin >> A[i];
        s = min(s, A[i]);
    }
    int ans = solve();
    cout << ans << endl;

    return 0;
}


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

int main()
{
  int x1, y1, x2, y2;
  cin >> x1 >> y1 >> x2 >> y2;

  int x3 = x2 - (y2 - y1);
  int y3 = y2 + (x2 - x1);
  int x4 = x1 - (y2 - y1);
  int y4 = y1 + (x2 - x1);

  cout << x3 << " " << y3 << " " << x4 << " " << y4 << endl;

  return 0; 
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int a[8]={1,2,4,8,16,32,64,101};
int main ()
{
	int n;cin>>n;
	for(int i=0;i<7;i++)
		if(a[i]<=n&&a[i+1]>n) {cout<<a[i]<<"\n";return 0;}	
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string>
#include <iostream>
using namespace std;
const int N=1e5+1;
char buf[N];
int main(){
  scanf("%s", buf);
  char *p = buf;
  while(*p){
    int a=0,b=0;
    while(*p=='R') ++a,++p;
    while(*p&&*p=='L') ++b,++p;
    for(int i=1;i<a;++i) printf("0 ");
    printf("%d %d ", (a+1)/2+b/2, (b+1)/2+a/2);
    for(int i=1;i<b;++i) printf("0 ");
  }	
  printf("\n");
  return 0;
}

Measured memory_bytes: 512
class fenwick_tree:
    def __init__(self, n):
        self._n = n
        self.data = [0] * n
    
    def add(self, p: int, x: int):
        assert 0 <= p and p <= self._n
        p += 1
        while p <= self._n:
            self.data[p - 1] += x
            p += p & -p
    
    def sum(self, l: int, r: int) -> int:
        assert 0 <= l and l <= r and r <= self._n
        return self.__sum(r) - self.__sum(l)
    
    def __sum(self, r: int) -> int:
        s = 0
        while r > 0:
            s += self.data[r - 1]
            r -= r & -r
        return s

# Date [ 2020-09-11 22:06:11 ]
# Problem [ fenwicktree.py ]
# Author Koki_tkg

import sys
# import math
# import bisect
# import numpy as np
# from decimal import Decimal
# from numba import njit, i8, u1, b1 #JIT compiler
# from itertools import combinations, product
# from collections import Counter, deque, defaultdict

# sys.setrecursionlimit(10 ** 6)
MOD = 10 ** 9 + 7
INF = 10 ** 9
PI = 3.14159265358979323846

def read_str():      return sys.stdin.readline().strip()
def read_int():      return int(sys.stdin.readline().strip())
def read_ints():     return map(int, sys.stdin.readline().strip().split())
def read_ints2(x):   return map(lambda num: int(num) - x, sys.stdin.readline().strip().split())
def read_str_list(): return list(sys.stdin.readline().strip().split())
def read_int_list(): return list(map(int, sys.stdin.readline().strip().split()))
def GCD(a: int, b: int) -> int: return b if a%b==0 else GCD(b, a%b)
def LCM(a: int, b: int) -> int: return (a * b) // GCD(a, b)

def Main():
    n, q = read_ints()
    a = read_int_list()
    fw = fenwick_tree(n)
    for i, x in enumerate(a):
        fw.add(i, x)
    for _ in range(q):
        query = read_int_list()
        if query[0] == 0:
            fw.add(query[1], query[2])
        else:
            print(fw.sum(query[1], query[2]))

if __name__ == '__main__':
    Main()

Measured memory_bytes: 132812
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <cmath>
#include <algorithm>
#include <utility>
#include <functional>
#include <fstream>
#define debug(x) cout << #x << " = " << x << endl
#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 > -1; i--)
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const int MOD = 1000000007;
const double EPS = 1e-9;


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

  int n,a,b;
  string s;
  cin>>n>>a>>b>>s;
  int kessyou = 0, kaigai = 0;
  rep(i,n) {
    if(s[i] == 'a') {
      if(kessyou < a + b) {
        cout << "Yes" << endl;
        kessyou++;
      } else {
        cout << "No" << endl;
      }
    } else if(s[i] == 'b') {
      if(kessyou < a + b && kaigai < b) {
        cout << "Yes" << endl;
        kessyou++;
        kaigai++;
      } else {
        cout << "No" << endl;
      }
    } else {
      cout << "No" << endl;
    }
  }

  return 0;
}


Measured memory_bytes: 848
n=int(input())
v=list(map(int,input().split()))
import collections

if len(set(v))==1:
    print(n//2)
else:
    a=[]
    b=[]
    for i in range(n):
        if i%2==0:
            a.append(v[i])
        else:
            b.append(v[i])
    a=collections.Counter(a)
    a0=a.most_common()[0]
    b=collections.Counter(b)
    b0=b.most_common()[0]
    if a0[0]!=b0[0]:
        print(n-a0[1]-b0[1])
    elif a0[0]==b0[0]:
        if a0[1]>b0[1]:
            print(n-a0[1]-b.most_common()[1][1])
        elif a0[1]<b0[1]:
            print(n-b0[1]-a.most_common()[1][1])
        elif a0==b0:
            if b.most_common()[1][1]>=a.most_common()[1][1]:
                print(n-a0[1]-b.most_common()[1][1])
            elif b.most_common()[1][1]<=a.most_common()[1][1]:
                print(n-b0[1]-a.most_common()[1][1])




Measured memory_bytes: 20728
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

using namespace std;
using ll = long long;
using vpii = vector<pair<int, int>>;
using vpll = vector<pair<ll, ll>>;
// ceil() 切り上げ, floor() 切り捨て
// next_permutation(all(x))

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

	vector<ll> A(n);
	vector<ll> D(n);
	for (ll i = 0; i < n; i++)
	{
		ll a;
		cin >> a;
		A[i] = a;
		D[i] = a - (i+1);
	}
	sort(all(D));

	ll b = D[(n-1)/2];
	ll sum = 0;
	for (ll i = 0; i < n; i++)
		sum += abs(A[i] - (b+i+1));

	cout << sum << endl;
}



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

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n; cin>>n;
  vector<int> d(n); rep(i,n) cin>>d.at(i);
  int ans=0;
  rep(i,n-1) for(int j=i+1;j<n;j++) ans+=d.at(i)*d.at(j);
  cout<<ans<<endl;      
}

Measured memory_bytes: 256
#include<cstdio>
#include<cmath>
#include<iostream>
#include<algorithm>
#define PI 3.1415926535897932384626433
using namespace std;
int main(){
    int fie[10][10]={0};
    int x,y,s;
    while(scanf("%d,%d,%d",&x,&y,&s)!=EOF){
        for(int i=-2;i<=2;i++){
            for(int j=-2;j<=2;j++){
                if(0<=x+j&&x+j<=9&&0<=y+i&&y+i<=9){
                    if((s==1&&abs(i)+abs(j)<=1)||(s==2&&abs(i)<=1&&abs(j)<=1)||(s==3&&abs(i)+abs(j)<=2))fie[y+i][x+j]++;
                }
            }
        }
    }
    int ans0=0,ans1=1;
    for(int i=0;i<10;i++){
        for(int j=0;j<10;j++){
            if(!fie[i][j])ans0++;
            ans1=max(ans1,fie[i][j]);
        }
    }
    cout<<ans0<<endl<<ans1<<endl;
    return 0;
}

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

int main(){
    int H, N, A, damage; cin>>H>>N; damage=0;
    for(int i=0; i<N; i++){
        cin>>A;
        damage += A; 
    }
    if(damage >= H) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1e18;
#define rep(i, a, b) for (int i = a; i < b; i++)
#define per(i, a, b) for (int i = b - 1; i >= a; i--)
#define int long long
using pint = pair<int, int>;
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
int dxx[8] = {1, 1, 1, 0, 0, -1, -1, -1}, dyy[8] = {-1, 0, 1, -1, 1, -1, 0, 1};

signed main() {
    int n;
    cin >> n;
    rep (i, 1, n + 1) {
        int ans = 0;
        for (int x = 1; x * x <= i; x++) {
            for (int y = x; y * y <= i; y++) {
                for (int z = y; z * z <= i; z++) {
                    int sum = x * x + y * y + z * z + x * y + y * z + z * x;
                    if (sum == i) {
                        if (x == y && y == z) ans++;
                        else if (x == y || y == z || z == x)
                            ans += 3;
                        else
                            ans += 6;
                    }
                }
            }
        }
        cout << ans << "\n";
    }
}

Measured memory_bytes: 3620
N = int(input())
ans = []
tmp_n = N
while True:
    s, r = divmod(tmp_n, 26)
    if r == 0:
        r = 26
        s -= 1
    ans.append(chr(r+96))
    tmp_n = s
    if s <= 0:
        break
print("".join(ans[::-1]))


Measured memory_bytes: 61660
#include <stdio.h>
int main(void)
{
	int n,a,r,x[9]={0},i,j;
	scanf("%d", &n);
	for(i=0; i<n; i++)
	{
		scanf("%d", &a);
		r=399;
		for(j=0; j<8; j++)
		{
			if(a<=r)
			{
				x[j]=1;
				break;
			}
			if(j==7)
			x[8]++;
			r+=400;
		}
	}
	r=0;
	for(i=0; i<8; i++)
	r+=x[i];
	if(r==0)
	printf("1 ");
	else
	printf("%d ", r);
	printf("%d\n", r+x[8]);
	
	return 0;
}

Measured memory_bytes: 128
a=[0 for i in range(10**5+5)]
for i in range(3,10**5+3,2):
    for j in range(3,int(i**0.5)+1,2):
        if i%j==0 and j!=i:
            break
    else:
        a[i]=1
a[3],a[2]=1,1
b=[0 for i in range(10**5+5)]
for i in range(3,10**5+3,2):
    b[i]=a[i] and a[(i+1)//2]
c=[0]
for i in range(len(b)):
    c.append(c[i]+b[i])
for i in range(int(input())):
    l,r=map(int,input().split())
    print(c[r+1]-c[l])

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

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n, k;
	cin >> n >> k;
	ll s;
	cin >> s;
	vector<ll> ans;
	while (k > 0) {
		ans.emplace_back(s);
		k--;
	}
	while (ans.size() < n) {
		if (s == 1000000000) {
			ans.emplace_back(1);
		}
		else {
			ans.emplace_back(s + 1);
		}
	}

	for (int i = 0; i < n; ++i) {
		if (i == n - 1) {
			cout << ans[i] << endl;
			break;
		}
		cout << ans[i] << ' ';
	}

	return 0;
}


Measured memory_bytes: 2292
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <queue>
#include <cmath>

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

ll Combination(int n, int r)
{
	std::vector<std::vector<ll> > v(n + 1, std::vector<ll>(n + 1, 0));
	for (size_t i = 0; i < v.size(); i++) {
		v[i][0] = 1;
		v[i][i] = 1;
	}
	for (size_t j = 1; j < v.size(); j++) {
		for (size_t k = 1; k < j; k++) {
			v[j][k] = (v[j - 1][k - 1] + v[j - 1][k]);
		}
	}
	return v[n][r];
}

void ABC057D()
{
	int N, A, B;
	cin >> N >> A >> B;
	vector<ll> v(N);
	for (int i = 0; i < N; ++i)
	{
		cin >> v[i];
	}
	sort(v.begin(), v.end(), greater<ll>());

	ll sum = 0;
	for (int i = 0; i < A; ++i)
	{
		sum += v[i];
	}
	double avg = static_cast<double>(sum) / A;
	cout << std::fixed << std::setprecision(30) << avg << endl;

	ll ct = 0;
	if (v[A - 1] == v[0])
	{
		int n = A;
		for (int i = A; i < N; ++i)
		{
			if (v[i] == v[0])
			{
				++n;
			}
		}
		int C = min(B, n);
		for (int i = A; i <= C; ++i)
		{
			ct += Combination(n, i);
		}
		cout << ct << endl;
		return;
	}

	int k1 = 0;
	for (int i = A; i < N; ++i)
	{
		if (v[i] == v[A - 1])
		{
			++k1;
		}
	}
	int k2 = 0;
	for (int i = A - 1; i > -1; --i)
	{
		if (v[i] == v[A - 1])
		{
			++k2;
		}
	}
	int k = k1 + k2;
	ct = Combination(k, k2);
	cout << ct << endl;

}
int main()
{
	ABC057D();
	return 0;
}

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


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

    int a,b;
    cin >> a >> b;
    string ans;
    if(a>0) ans="Positive";
    else if(a<=0 && b>=0) ans="Zero";
    else if((b-a)%2==0) ans="Negative";
    else ans="Positive";

    cout << ans << endl;
}


Measured memory_bytes: 256