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

#define int long long
#define counter(m)     for(int i=0;i<m;i++)
#define gcd            __gcd
#define endl           "\n"
#define pb             emplace_back
#define setbits(x)     __builtin_popcountll(x)
#define zrobits(x)     __builtin_ctzll(x)
#define mod            1000000007
#define mod2           998244353
#define maxe           *max_element
#define mine           *min_element
#define inf            1e18
#define deci(x, y)      fixed<<setprecision(y)<<x
#define w(t)           int t; cin>>t; while(t--)
#define nitin          ios_base::sync_with_stdio(false); cin.tie(NULL)
#define PI             3.141592653589793238
using namespace std;

int32_t main() {
    nitin;
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    cout<<max(a*c,max(a*d,max(b*c,b*d)))<<endl;
    return 0;
}

Measured memory_bytes: 3656
#!/usr/bin/env python3
import sys, math, itertools, heapq, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
sys.setrecursionlimit(10**8)
inf = float('inf')
ans = count = 0

n=int(input())
A=list(map(int,input().split()))
A.sort(reverse=True)
for i in range(n):
    if i%2==0:
        ans+=A[i]
    else:
        ans-=A[i]
print(ans)

Measured memory_bytes: 38384
function Main(input){
	input = input.split(" ");
  input = input.map((a)=>~~a);
  if(input[0]*input[1]%2 == 1)return "Yes";
  
  return "No";
}

// If you are interested in the algorithms I used, 
// there is no need to read down from this line.

((b,c,d)=>"undefined"!=typeof require?console.log(Main(require("fs").readFileSync("/dev/stdin","utf8"))):[b=b.split("\n").slice(1,-1).join("\n"),c=function(){try{return Main(b)}catch(f){return f.stack||f.message}}(),d=typeof c,"string"==d||(c=JSON.stringify(c)),$("<form>").append([[10,b],0,[1,d],0,[10,c]].map(f=>$(f?"<textarea>":"<br>",f&&{rows:f[0],cols:40,text:f[1]}))).appendTo("body")])(`
3 2
`);

Measured memory_bytes: 7496
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
int main() {
  bool end = false;
  while (end == false) {
    int n, s;
    cin >> n >> s;
    if (n == 0 && s == 0) {
      end = true;
      break;
    }
    int ans = 0; // 合致するiの数
    vector<int> number(10);
    for (int i = 0; i < 1024; i++) {
      int a = i;
      for (int j = 0; j < 10; j++) {
        number.at(j) = a % 2;
        a = a / 2;
      } 
      int b = 0; //何回１が現れるかをカウント
      for (int j = 0; j < 10; j++) {
        if (number.at(j) == 1) {
          b++;
        }
      }
      int sum = 0; //１の立った数字の合計
      if (b == n) {
        for (int j = 0; j < 10; j++) {
          sum = sum + j * number.at(j);
        }
        if (sum == s) {
          ans++;
        }
      }
    }
    cout << ans << endl;
  }
}





Measured memory_bytes: 3076
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
	"strings"
	"unsafe"
)

func main() {
	ans := make([]int, 3)
	A := sc.nextInt() - 1
	ans[A] = 1
	B := sc.nextInt() - 1
	ans[B] = 1
	for i, v := range ans {
		if v == 0 {
			fmt.Println(i + 1)
		}
	}
}

var (
	sc scanner
)

func init() {
	sc = scanner{
		buf: make([]string, 0, 0),
		cur: 0,
		r:   bufio.NewReader(os.Stdin),
	}
}

type scanner struct {
	buf []string
	cur int
	r   *bufio.Reader
}

func (s *scanner) readln() {
	rbuf := make([]byte, 0, 0)
	for {
		line, prefix, err := s.r.ReadLine()
		if err != nil {
			panic(err)
		}
		rbuf = append(rbuf, line...)
		if prefix == false {
			break
		}
	}
	s.cur = 0
	s.buf = strings.Split(*(*string)(unsafe.Pointer(&rbuf)), " ")
}
func (s *scanner) isFull() bool {
	if s.cur == len(s.buf) {
		return true
	}
	return false
}
func (s *scanner) resetCur() {
	s.cur = 0
}
func (s *scanner) next() string {
	if s.cur == 0 {
		s.readln()
	}
	res := s.buf[s.cur]
	s.cur++
	if s.isFull() {
		s.resetCur()
	}
	return res
}
func (s *scanner) nexts() []string {
	s.readln()
	s.resetCur()
	return s.buf
}
func (s *scanner) nextInt() int {
	if s.cur == 0 {
		s.readln()
	}
	res, _ := strconv.Atoi(s.buf[s.cur])
	s.cur++
	if s.isFull() {
		s.resetCur()
	}
	return res
}
func (s *scanner) nextInts() []int {
	s.readln()
	res := make([]int, len(s.buf))
	for i := range s.buf {
		res[i], _ = strconv.Atoi(s.buf[i])
	}
	s.resetCur()
	return res
}
func (s *scanner) nextFloat() float64 {
	if s.cur == 0 {
		s.readln()
	}
	res, _ := strconv.ParseFloat(s.buf[s.cur],
		64)
	s.cur++
	if s.isFull() {
		s.resetCur()
	}
	return res
}
func (s *scanner) nextFloats() []float64 {
	s.readln()
	res := make([]float64, len(s.buf))
	for i := range s.buf {
		res[i], _ = strconv.ParseFloat(s.buf[i],
			64)
	}
	s.resetCur()
	return res
}
func digits(x int) int {
	return len(strconv.Itoa(x))
}
func powInt(x, p int) (result int) {
	result = 1
	for i := 0; i < p; i++ {
		result *= x
	}
	return
}
func max(x, y int) int {
	return int(math.Max(float64(x), float64(y)))
}
func min(x, y int) int {
	return int(math.Min(float64(x), float64(y)))
}
func abs(x int) int {
	return int(math.Abs(float64(x)))
}
func varDump(value ...interface{}) {
	for _, v := range value {
		fmt.Fprintf(os.Stderr, "%#v\n", v)
	}
}
func yes() {
	fmt.Println("Yes")
}
func no() {
	fmt.Println("No")
}

// Pair a
type Pair struct {
	first  int
	second int
}

// Queue a
type Queue struct {
	v []Pair
}

// Push for queue
func (q *Queue) Push(v Pair) {
	q.v = append(q.v, v)
}

// Pop for queue
func (q *Queue) Pop() Pair {
	r := q.v[0]
	q.v = q.v[1:]
	return r
}

// Front for queue
func (q Queue) Front() Pair {
	return q.v[0]
}

// Empty return true if empty
func (q Queue) Empty() bool {
	return len(q.v) == 0
}


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


int main() {
    int input[3];
    cin >> input[0] >> input[1] >> input[2];
    sort(input, input+3);

    int ans = 0;
    if (input[0]%2 == input[1]%2 && input[0]%2 == input[2]%2) {
        ans += ((input[2]-input[1]) / 2) + ((input[2]-input[0]) / 2);
    } else if (input[0]%2 == input[1]%2) {
        int t1 = input[2] - input[0];
        int t2 = input[2] - input[1];
        ans += (t1 / 2) + (t2 / 2) + 1;
    } else {
        ans += (input[2] - input[1]) / 2;
        ans += (input[2] - input[0]) / 2;
        ans += 2;
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <stdio.h>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <utility>
#include <tuple>
#include <math.h>
#include <set>
#include <map>
using namespace std ;
using ll = long long ;
using ld = long double ;
using vll = vector<ll> ;
using vvll = vector<vll> ;
using vc = vector<char> ;
using vvc = vector<vc> ;
using vb = vector<bool> ;
using vvb = vector<vb> ;
using pll = pair<ll,ll> ;
#define all(v) v.begin(),v.end() 
const ll INF = 1e18 ;
const ll mod = 1e9+7 ;
const double pie = acos(-1); 
vll dx4 = {-1,0,1,0} ;
vll dy4 = {0,-1,0,1} ;
vll dx8 = {-1,0,1,1,1,0,-1,-1} ;
vll dy8 = {-1,-1,-1,0,1,1,1,0} ; 

void fix_cout(){cout << fixed << setprecision(20) << endl ; }
ll gcd(ll a,ll b){if(b==0) return a ; return gcd(b,a%b) ; }
ll lcm(ll a,ll b){return a/gcd(a,b)*b ; }
void chmax(ll &a,ll b){if(a<b) a = b ; }
void chmin(ll &a,ll b){if(a>b) a = b ; }


int main(){
	ld a ; ld b ;
	cin >> a >> b ;
	a /= 100 ;
	a *= b ;
	a *= 100 ;
	cout << (ll)a << endl ;
}


Measured memory_bytes: 3728
import sys
sys.setrecursionlimit(12345678)
import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop


def main():
    n = int(input())
    xl = list(map(int, input().split()))
    min_p = min(xl)
    max_p = max(xl)
    ans = 10**10
    for p in range(min_p, max_p + 1):
        cost = 0
        for x in xl:
            cost += (x - p) ** 2
        ans = min(ans, cost)

    print(ans)
    return 

if __name__ == '__main__':
    main()


Measured memory_bytes: 38512
#include<stdio.h>
#include<string.h>
#define ll long long

int main() {
	char S[11];
	scanf("%s", S);
	int p = strlen(S) - 1;
	ll ans = 0;
	for (int i = 0; i < 1 << p; i++)
	{
		ll sum = S[0] - '0';
		for (int j = 0; j < p; j++)
		{
			if (i >> j & 1)
			{
				ans += sum;
				sum = S[j + 1] - '0';
			}
			else {
				sum = sum * 10 + S[j + 1] - '0';
			}
		}
		ans += sum;
	}
	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 128
#include <stdio.h>

int main(void){
  int n, a[4];
  int flag = 1;
  scanf("%d", &n);
  for(int i = 0; i < 4; i++){
    a[i] = n % 10;
    n /= 10;
  }

  if(a[0] == a[1] && a[1] == a[2]) printf("Yes\n");
  else if(a[1] == a[2] && a[2] == a[3]) printf("Yes\n");
  else printf("No\n");
  return 0;
}

Measured memory_bytes: 128
import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        String s=sc.next();
        int k=sc.nextInt();
        String po=s.substring(k-1,k);
        for(int i=0;i<n;i++){
            if(s.substring(i,i+1).equals(po))System.out.print(s.substring(i,i+1));
            else System.out.print("*");
        }
        System.out.println();
    }
    
 
}class Po{
    int a,b;
    public Po(int a,int b){
        this.a=a;
        this.b=b;
    }
    public String toString(){
        return a+" "+b;
    }
}


Measured memory_bytes: 21844
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i=0; i<(n); i++)
template <typename T>
vector<T> bubblesort(vector<T> &a, int n){
    bool flag = true;
    int i=0;
    int count = 0;
    while(flag){
        flag = false;
        for(int j=n-1; j>i; --j){
            if(a[j] < a[j-1]){
                swap(a[j], a[j-1]);
                count++;
                flag = true;
            }
        }
    }
    for(int i=0; i<n; i++){
        cout << a[i];
        if (i == n-1) cout << endl;
        else cout << " ";
    }
    cout << count << endl;
    return a;
}
int main(){
    int n; cin >> n;
    vector<int> b(n);
    rep(i, n) cin >> b[i];
    bubblesort<int>(b, n);
    
}


Measured memory_bytes: 3160
h,w,k = map(int,input().split())
c = []
for i in range(h):
    c.append(list(input()))
ans = 0
for i in range(2**h-1):
    for j in range(2**w-1):
        num = 0
        for ii in range(h):
            for jj in range(w):
                if  i&1<<ii==0 and j&1<<jj==0:
                    if c[ii][jj]=="#":
                        num += 1
        if num==k:
            #print(i,j)
            ans += 1


print(ans)


Measured memory_bytes: 68188
#include<iostream>

using namespace std;

int main(){

  int l;
  while(1){
    cin >> l;
    if(l == 0) break;

    int hantei = 0;
    int frag = 0;

    for(int i = 1; i <= 12; i++){
      int m, n;
      cin >> m >> n;
      l -= (m-n);
      if(frag == 0){
	if(l <=0){
	  hantei = i;
	  frag = 1;
	}
      }
    }

    if(hantei == 0) cout << "NA" <<endl;
    else cout << hantei << endl;
  }

  return 0;
}

Measured memory_bytes: 0
"use strict";

function main(input) {
  input = input.trim().split("");
  let ans = 0;
  let tmp = 0;
  for (let i = 0; i < input.length; i++) {
    if (input[i] == "R") {
      ans++;
    } else {
      if (tmp <= ans) {
        tmp = ans;
      }
      ans = 0;
    }
  }
  if (tmp > ans) {
    ans = tmp;
  }
  console.log(ans);
}

function numberSort(array) {
  array.sort(f);
  return array;
}

var f = function (a, b) {
  return a - b;
};

main(require("fs").readFileSync("/dev/stdin", "utf-8"));


Measured memory_bytes: 29656
<?php
//error_reporting(0);
//$N = trim(fgets(STDIN));
list($N,$Q) =  explode(" ",trim(fgets(STDIN)));
//$v =  explode(" ",trim(fgets(STDIN)));
for($i=0;$i<$N-1;$i++) {
  list($a,$b) =  explode(" ",trim(fgets(STDIN)));
  $a-=1;
  $b-=1;
  $t[$a][]=$b;
  $t[$b][]=$a;
}
$c = array_fill(0,$N,0);
for($i=0;$i<$Q;$i++) {
  list($p,$x) =  explode(" ",trim(fgets(STDIN)));
  $p-=1;
  $c[$p] += $x;
}
dfs(0);
printf("%s\n",implode(" " ,$c));

function dfs($v,$p=-1)
{
  global $t,$c;
  if (isset($t[$v])) {
    foreach($t[$v] as $u) {
      if ($u == $p) continue;
      $c[$u] += $c[$v];
      dfs($u,$v);
    }
  }
}


Measured memory_bytes: 158200
#include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
using namespace std;
#define sz(x) ((int)(x).size())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define MEMSET(v, h) memset((v), h, sizeof(v))
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define pb push_back
#define mp make_pair
#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
const ll INF = 1LL<<60;
 
int main() {
	int h,w;
	cin >> h >> w;
  	int count = 0;
	vector<vector<char>> map(h, (vector<char>(w)));
    rep(i,h){
      rep(j, w){
        cin >> map[i][j];
      }
    }
	rep(i,h){
      rep(j, w){
        if(map[i][j] == '#') count++;
      }
    }
    if(count == h + w - 1) cout << "Possible" << endl;
	else cout << "Impossible" << endl;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
signed main() { 
  ios::sync_with_stdio(false); cin.tie(0);
  //c
  int n;
  cin >> n;
  long long ans = 0;
  map<string, int> cnt;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    sort(s.begin(), s.end());
    ans += cnt[s];
    cnt[s]++;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 11264
import java.util.Scanner;

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

	void solve() {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int q = Integer.parseInt(sc.next());
		String S = sc.next();
		int[] dp = new int[n];
		for(int i=1;i<n;i++) {
			dp[i]=dp[i-1];
			if(S.substring(i-1, i+1).equals("AC")) {
				dp[i]++;
			}
		}
		for(int i=0;i<q;i++) {
			int L = Integer.parseInt(sc.next());
			int R = Integer.parseInt(sc.next());
			System.out.println((dp[R-1]-dp[L-1]));
		}
		sc.close();
	}
}


Measured memory_bytes: 53796
//インクルード(アルファベット順)
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<iterator>//集合演算(積集合,和集合,差集合など)
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//イテレータあるけど順序保持しないmap
#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列

using namespace std;
typedef long long ll;

//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
//xにはvectorなどのコンテナ
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値を求める
#define MIN(x) *min_element(ALL(x)) //最小値を求める
//定数
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
//略記
#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素

int main(){
    int a, b;
    string ans; 
    cin >> a >> b;
    if(a*b%2==0){
        ans = "Even";
    }
    else{
        ans = "Odd";
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
n = int(input())
s = input()
c1 = 0
c2 = 0
c = 0
for i in s:
    if i == '(':
        c1 += 1
    else:
        c2 += 1
        if c1+c< c2:
            c += 1
print('('*c + s + ')'*(c+c1-c2))

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

using namespace std;

typedef long long ll;

int main()
{
    ll n,cs=0,ans=0;
    cin>>n;
    ll a[n+5];
    for(ll i=0;i<n;i++)
    {
        cin>>a[i];
        cs+=a[i];
        cs=cs%1000000007;
    }
    for(ll i=0;i<n;i++)
    {
        cs=cs-a[i];
        if(cs<0) cs+=1000000007;
        ans+=cs*a[i];
        ans=ans%1000000007;
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 5160
#include <stdio.h>

#define X 100000000

int n;
int A[20000000];

int Count();
void maxHeapify(int i);
void increaseKey(int n, int k);
void insert(int k);
int extractMax();

int main(){
  int i, c;
  char dist[20];

  for (i = 1; i <= 2000000; i++){
    scanf("%s", dist);
    if(dist[0] == 'i'){ // insert
      scanf("%d", &c);
      insert(c);
    } else if (dist[1] == 'x'){ // extract
       printf("%d\n", extractMax());
    } else if (dist[1] == 'n'){ // end
      break;
    }
  }
  return 0;
}

int Count(){
  int i;
  for(i = 1; A[i] != 0; i++){
  }
  return i;
}

void maxHeapify(int i){
  int l, r, large, tmp, k;
  l = 2*i;
  r = 2*i+1;

  if(l<= n && A[l] > A[i]){
    large = l;
  } else large = i;

  if(r<= n && A[r] > A[large]){
    large = r;
  }
 
  if(large != i){
    tmp = A[i];
    A[i] = A[large];
    A[large] = tmp;
    maxHeapify(large);
  }
}

void increaseKey(int n, int k){
  int tmp;
  A[n] = k;
  while(n>1 && A[n/2] < A[n]){
    tmp = A[n];
    A[n] = A[n/2];
    A[n/2] = tmp;
    n = n/2;
  }
}

void insert(int k){
  int i;
  n++;
  A[n] = -X;
  increaseKey(n, k);
}
 
int extractMax(){
  int i, max;
  maxHeapify(1);
  max = A[1];
  A[1] = A[n];
  n--;
  maxHeapify(1);
  return max;
}

Measured memory_bytes: 4692
#pragma GCC optimize("O2")
#include<bits/stdc++.h>
#define ll long long
using namespace std;
typedef pair<int,int> pii;
const int N = 4e6+10;
unordered_map<int,int> ma;
int val[N],fa[N];
int find(int k){
    if(fa[k]==-1)   return k;
    return fa[k] = find(fa[k]);
}
int main(){
    int n,ans =1;
    cin >> n;
    cout << n*n*n <<endl;
    return 0;
}

Measured memory_bytes: 256
import sys
n=int(input())
ans=[0]*(n+1)
MOD=998244353
a=list(map(int,input().split()))
if a[0]!=0:
  print(0)
  sys.exit()
for i in range(n):
  ans[a[i]]+=1
if ans[0]!=1:
  print(0)
  sys.exit()
fin=1
for i in range(1,max(a)+1):
  fin=(fin*pow(ans[i-1],ans[i],MOD))%MOD
print(fin)

Measured memory_bytes: 84784
#include<bits/stdc++.h>
using namespace std;
string s;
int main()
{
    cin>>s;
    stack<char>q;
    int sum=0;
    q.push(s[0]);
    for(int i=1;i<s.length();i++)
    {
        if(q.top()!=s[i])
        {
            sum++;
            q.push(s[i]);
        }
    }
    cout<<sum<<endl;
    return 0;
}


Measured memory_bytes: 512
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int s = scanner.nextInt();
			Set<Integer> set = new HashSet<>();
			int now = s, prev = -1;
			int count = 1;
			while (!set.contains(now)) {
				set.add(now);
				prev = now;
				now = f(prev);
				count++;
			}
			System.out.println(count);
		}
	}

	/**
	 * f(n)を計算する
	 * 
	 * @param n
	 * @return f(n)
	 */
	private static int f(int n) {
		return (0 == (n & 1)) ? n / 2 : 3 * n + 1;
	}
}


Measured memory_bytes: 35548
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <numeric>
#include <utility>
#include <string>
#include <queue>
#include <tuple>

using namespace std;

using TUP = tuple<int, int, int, int>;

using VD = vector<double>;
using VVD = vector<VD>;
using VVVD = vector<VVD>;

using VB = vector<bool>;
using VVB = vector<VB>;
using VVVB = vector<VVB>;

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

	vector<int> nums(4, 0);
	for (int i = 0; i < n; i++) {
		cin >> a;
		nums[a]++;
	}
	VVVD dp(n + 1, VVD(n + 1, VD(n + 1, 0))); // ijk -> 000 となる回数の期待値
	VVVB pushed(n + 2, VVB(n + 2, VB(n + 2, false)));

	double ans = -1;
	priority_queue<TUP, vector<TUP>, greater<TUP>> que; // sum, n3, n2, n1の昇順
	int x, y, z, sum;
	que.emplace(0, 0, 0, 0);
	pushed[0][0][0] = true;
	while (!que.empty()) {
		tie(sum, z, y, x) = que.top();
		que.pop();

// printf("? %2d: %2d %2d %2d: ", sum, z, y, x);
		if (
			z > nums[3] ||
			y + z > nums[3] + nums[2] ||
			sum > n)
		{
// printf("\n");
			continue;
		}

// printf(" calc ");

		double val = 0;
		if (sum > 0) {
			val += n;
			if (x > 0) { val += dp[x-1][y][z] * x; }
			if (y > 0) { val += dp[x+1][y-1][z] * y; }
			if (z > 0) { val += dp[x][y+1][z-1] * z; }
			val /= sum;
		}
		dp[x][y][z] = val;
// printf("%7.3f\n", val);

		if (x == nums[1] && y == nums[2] && z == nums[3]) {
			ans = dp[x][y][z];
			break;
		}

		if (!pushed[z][y][x+1]) {
			que.emplace(sum+1, z, y, x+1);
			pushed[z][y][x+1] = true;
		}

		if (x > 0 && !pushed[z][y+1][x-1]) {
			que.emplace(sum, z, y+1, x-1);
			pushed[z][y+1][x-1] = true;
		}
		if (y > 0 && !pushed[z+1][y-1][x]) {
			que.emplace(sum, z+1, y-1, x);
			pushed[z+1][y-1][x] = true;
		}
	}

	printf("%.12f\n", ans);
	return 0;
}

Measured memory_bytes: 226320
import java.util.*

fun main(args : Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextLong()
    val h = (0 until n).map { sc.next().toLong() }

    println(problem136c(n, h))
}

fun problem136c(n: Long, h:List<Long>): String {
    var max = 0L
    h.forEachIndexed { i, hi ->
        if (i == 0) return@forEachIndexed
        max = Math.max(h[i - 1].toDouble(), max.toDouble()).toLong()
        if (hi + 1 < max) {
            return "No"
        }
//        if (hi < h[i - 1] - 1) {
//            return "No"
//        }
//        if (i >= 2 && hi < h[i - 2] - 1) {
//            return "No"
//        }
    }
    return "Yes"
}

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

int main()
{
	int N, K;
	cin >> N >> K;
	for ( int i = 0; i < N; i++ ) {
		int A;
		cin >> A;
	}
	K--;
	cout << (N + K - 2) / K << endl;

	return ( 0 );
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		if (A + B >= 10) {
			System.out.println("error");
		} else {
			System.out.println(String.valueOf(A + B));
		}
	}
}



Measured memory_bytes: 22228
/*
 KUNAL RAUT (ZUKONIT14)  :- "DO WHAT YOU LIKE!"
 -PICT,PUNE! :)
 */
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long
#define ld long double
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define mod 1000000007
#define mod9 1000000009
#define pi 3.1415926535
#define MAXN 1000005
#define N 1000001
#define MAX2N 1*1000 + 10
#define all(v) v.begin(), v.end()
#define ms(s, n) memset(s, n, sizeof(s))
#define prec(n) fixed<<setprecision(n)
#define forci(p,n) for(ll i=p;i<(ll)n;i++)
#define forcj(p,n) for(ll j=p;j<(ll)n;j++)
#define bolt ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define bits(a) __builtin_popcount(a)
#define test ll t;cin>>t;for(ll testi=1;testi<=t;testi++)
#define djokovic  freopen("input00.txt", "r", stdin);freopen("output00.txt", "w", stdout);
ll gcd(ll a, ll b) {    if (b == 0) return a;    return gcd(b, a % b);}
ll lcm(ll a, ll b) {    return (a / gcd(a, b) * b);}
ll expo(ll x, ll y) {
    ll res = 1; x = x % mod; while (y > 0) {
        if (y & 1)res = (1ll * res * x) % mod;
        y = y >> 1; x = (1ll * x * x) % mod;
    } return res;
}
ll ncr(ll n, ll r) { ll res = 1; if (r > n - r)r = n - r; for (ll i = 0; i < r; i++) {  res *= n - i;  res /= i + 1; } return res;}
ll max(ll a, ll b) {return (a > b) ? a : b;}
bool prime(ll n) {ll i; for (i = 2; i <= sqrt(n); i++) {if (n % i == 0)return false;} return true;}
bool sortbysec(const pair<ll, ll> &a, const pair<ll, ll> &b)
{   if (a.second == b.second)
        return a.first < b.first;
    return (a.second < b.second);
}
//https://www.youtube.com/watch?v=WTJSt4wP2ME

ll rr[] = {0, 1, 1, 1, 0, -1, -1, -1,};
ll cc[] = {1, 1, 0, -1, -1, -1, 0, 1};
ll n, m, x, y, k, a[MAXN], p[MAXN];
void solve()
{
    cin >> n; ll sum = 0;
    forci(1, n + 1)
    if (i % 3 && i % 5)  sum += i;
    cout << sum;
}
signed main()
{
    bolt;
    //djokovic;
    solve();
}




Measured memory_bytes: 3700
#include <algorithm>
#include <iostream>
#include <limits>
#include <numeric>
#include <vector>

#define rep(i, x, n) for(int i = x; i < n; i++)
using namespace std;
const long long INF = 1LL << 60;
bool compare_by_b(pair<int, long long> a, pair<int, long long> b) {
    if(a.second != b.second) {
        return a.second > b.second;
    } else {
        return a.first > b.first;
    }
}

int le[2100][2100];
int ri[2100][2100];
int up[2100][2100];
int dw[2100][2100];
int main() {
    int H, W;
    cin >> H >> W;
    vector<string> S(H);
    rep(i, 0, H) { cin >> S[i]; }
    rep(i, 0, H) {
        int tmp = 0;
        rep(j, 0, W) {
            if(S[i][j] == '.') {
                tmp++;
                le[i][j] = tmp;
            } else {
                tmp = 0;
                le[i][j] = 0;
            }
            //            cout<<le[i][j];
        }
        // cout<<endl;
    }
    rep(i, 0, H) {
        int tmp = 0;
        rep(t, 0, W) {
            int j = W - 1 - t;
            if(S[i][j] == '.') {
                tmp++;
                ri[i][j] = tmp;
            } else {
                tmp = 0;
                ri[i][j] = 0;
            }
        }
    }
    rep(i, 0, W) {
        int tmp = 0;
        rep(j, 0, H) {
            if(S[j][i] == '.') {
                tmp++;
                dw[j][i] = tmp;
            } else {
                tmp = 0;
                dw[j][i] = 0;
            }
        }
    }
    rep(i, 0, W) {
        int tmp = 0;
        rep(t, 0, H) {
            int j = H - 1 - t;
            if(S[j][i] == '.') {
                tmp++;
                up[j][i] = tmp;
            } else {
                tmp = 0;
                up[j][i] = 0;
            }
        }
    }
    int max = 0;
    rep(i, 0, H) {
        rep(j, 0, W) {
            // cout << up[i][j];
            int tot = le[i][j] + ri[i][j] + up[i][j] + dw[i][j] - 3;
            if(max < tot) {
                max = tot;
            }
        }
        // cout << endl;
    }
    cout << max << endl;
}

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

// def
#define debug(x) cout << #x << ": " << x << endl
#define out(x) cout << x << endl
#define repeat(i, a, b) for (int i = (a); i < (b); i++)
#define revrepeat(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define revrep(i, n) for (int i = (n)-1; i >= 0; i--)
typedef long long ll;
typedef pair<int, int> P;
typedef vector<vector<int>> Graph;
const int M = 1e9 + 7;
const ll INF = 1e9;
const int MAX_V = 100000 + 5;
const int MAX_N = 1e5 + 5;


// Eratosthenes O(nloglog(n))
int prime[MAX_N];     // i番目の素数
bool is_prime[MAX_N]; // i が素数か否か　
// n以下の素数の数を返す
int sieve(int n) {
    int p = 0;
    for (int i = 0; i <= n; i++)
        is_prime[i] = true;
    is_prime[0] = is_prime[1] = false;
    for (int i = 2; i <= n; i++) {
        if (is_prime[i]) {
            prime[p++] = i;
            // i の倍数全消去
            for (int j = 2 * i; j <= n; j += i)
                is_prime[j] = false;
        }
    }
    return p;
}

int main() {
    int n;
    cin >> n;
    sieve(100050);
    int i = n;
    while(1) {
        if (is_prime[i]) {
            out(i);
            return 0;
        }
        i++;
    }
}


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

int main() {
  int N;
  cin >> N;
  string s;
  cin >> s;
  int ans = 0;
  int term = 0;
  vector<bool> tf(N,true);
  for (int i=1; i<N; i++) {
    for (int j=0; j<N; j++) {
      tf[j] = true;
    }
    for (int j=0; j<i; j++) {
      if (tf[j] == false) {
        cerr << "uuu" << endl;
        continue;
      }
      for (int k=j+1; k<i; k++) {
        if (s[j] == s[k]) {
          cerr << "uuu" << j << k << endl;
          tf[k] = false;
        }
      }
      for (int k=i; k<N; k++) {
        if (s[j] == s[k]) {
          term++;
          break;
        }
      }
    }
    ans = max(ans,term);
    cerr << term << endl;
    term = 0;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
n, m = map(int, input().split())
ab_list = sorted([list(map(int, input().split())) for _ in range(n)], key=lambda x: x[0])
ans = 0
for a, b in ab_list:
    if b >= m:
        print(ans + a * m)
        exit()
    else:
        ans += a * b
        m -= b

Measured memory_bytes: 29792
import java.util.*;


public class Main {
     public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
//        String t = sc.next();
        sc.close();
//        System.out.println("input: "+ s);
        if(s.equals("ABC")){
            System.out.println("ARC");
        }else{
            System.out.println("ABC");
        }
//        String[] arr1 =  s.split("");
//        String[] arr2 =  t.split("");
////        List<String> list1 = Arrays.asList(s.split(""));
//        List list1 = new LinkedList(Arrays.asList(s.split("")));
////        List<String> list2 = Arrays.asList(t.split(""));
//        List list2 = new LinkedList(Arrays.asList(t.split("")));
////        int num = Integer.parseInt(arr[arr.length - 1]);
//        list2.remove(arr2.length - 1);
////        System.out.println(list1);
////        System.out.println(list2);
//         if(list1.toString().contentEquals(list2.toString())){
//             System.out.println("Yes");
//         }else{
//             System.out.println("No");
//         }
//        switch(num){
//            case 3:
//                System.out.println("bon");
//                break;
//            case 0:
//            case 1:
//            case 6:
//            case 8:
//                System.out.println("pon");
//                break;
//            default:
//                System.out.println("hon");
//                break;
//        }
//        String[] array = str.split(" ");
//        int sum = 0;
//        for(int i=0; i<array.length; i++) {
//            int num = Integer.parseInt(array[i]);
//            sum += num;
//        }
//        System.out.println(15-sum);
    }
}

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

using namespace std;

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

    int n, x;
    cin >> n >> x;

    int pos = 0, bound = 1;
    for(int i=0; i<n; i++){
        int l;
        cin >> l;
        pos+=l;
        if(pos>x) break;
        bound++; 
    }
    cout << bound;

    return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Text;
using System.Numerics;
using System.IO;

namespace SolutionCS
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            int[] A = new int[N];
            int[] B = new int[N];
            int[] C = new int[N];

            string[] s = Console.ReadLine().Split(' ');
            for (int i = 0; i < N; i++)
            {
                A[i] = int.Parse(s[i]) - 1;
            }

            s = Console.ReadLine().Split(' ');
            for (int i = 0; i < N; i++)
            {
                B[i] = int.Parse(s[i]);
            }

            s = Console.ReadLine().Split(' ');
            for (int i = 0; i < N-1; i++)
            {
                C[i] = int.Parse(s[i]);
            }


            int ans = 0;
            int prev = int.MinValue;
            for (int i = 0; i < N; i++)
            {
                int ind = A[i];

                if(ind -1 == prev)
                {
                    ans += C[ind - 1];
                }
                ans += B[ind];

                prev = ind;
            }

            Console.WriteLine(ans);
        }
    }
}




Measured memory_bytes: 11092
#include<bits/stdc++.h>
using namespace std;
#define int long long int
int32_t main()
{
    int h,n;
    cin>>h>>n;
    int sum=0;
    for(int i=0;i<n;i++)
    {
        int x;
        cin>>x;
        sum+=x;
    }
    if(sum>=h)
    cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#pragma gcc optimize("ofast")
using namespace std;

#define ll long long //data types used often, but you don't want to type them time by time
#define ull unsigned long long
#define ui unsigned int
#define mod 998244353
#define us unsigned short
#define IOS ios_base::sync_with_stdio(0); //to synchronize the input of cin and scanf
#define INF LONG_MAX
#define PI 3.1415926535897932384626
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define rep(x,j,n)for(int x=j;x<n;x++)
#define all(x) (x).begin(), (x).end()

typedef vector<pair<ll,ll>> vpi;
typedef vector<ll> vi;
typedef vector<vi> vvi;

bool prime(ll n)
{
	if(n<=1)return false;
	if(n<=3)return true;
	if(n%2==0||n%3==0)return false;
	for(ll i=5;i*i<=n;i+=6)
	{
		if(n%i==0||n%(i+2)==0)return false;
	}
	return true;
}

ll modexp(ll a,ll b,ll m)
{
	ll r=1;
	a=a%m;
	while(b>0)
	{
		if(b&1)r=(r*a)%m;
		b = b>>1;
		a=(a*a)%m;
	}
	return r%m;
}

int main(){
    ll n; cin>>n;
    ll ans = (n*(n+1))/2;
    ll x = n/3,y = n/5,z = n/15;
    x = (x*(x+1))/2 , y = (y*(y+1))/2 , z= (z*(z+1))/2;
    ans = ans -3*x - 5*y+15*z;
    cout<<ans<<endl;
	return 0;
}
/*
1
4
4 2
10 3
3 4
9 2
*/


Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

int main() {
	ll n,p;
	cin>>n>>p;
	string s;
	cin>>s;
	reverse(s.begin(),s.end());
	if(p==2||p==5){
		ll ans=0;
		for(ll i=0;i<n;i++){
			ll now=s[i]-'0';
			if(now%p==0){
				ans+=n-i;
			}
		}
		cout <<ans;
		return 0;
	}
	ll keta=1;
	ll ch[200010];
	for(ll i=0;i<n;i++){
		ll now=s[i]-'0';
		now*=keta;
		now%=p;
		ch[i]=now;
		keta*=10;
		keta%=p;
	}
	map<ll,ll>q;
	q[0]++;
	ll ans=0;
	ll ch2[200010]={};
	for(ll i=0;i<n;i++){
		ch2[i+1]=ch2[i]+ch[i];
		ch2[i+1]%=p;
		q[ch2[i+1]]++;
		ans+=q[ch2[i+1]]-1;
	}
	cout <<ans;
	return 0;
}

Measured memory_bytes: 7276
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_set>
#include<unordered_map>
#include<bitset>
#include<iomanip>
#include<list>
#include<deque>
using namespace std;
//#define MODE 1
#ifdef MODE
#define DEB(X) cout<< #X <<": "<<X<<" ";
#define END cout<<endl;
#else
#define DEB(X) {}
#define END {}
#endif
typedef long long ll;
#define int ll
#define uset unordered_set
#define umap unordered_map
typedef std::pair<int,int> P;
struct edge{int to,cost;};
const int INF=100000000000000000;
const int INF2=9223372036854775807;
const int MOD=1000000007;
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define min(X,Y) (((int)(X)<(int)(Y))?(X):(Y))
#define max(X,Y) (((int)(X)>(int)(Y))?(X):(Y))
#define MAX(X,Y) (*max_element(X,Y))
#define MIN(X,Y) (*min_element(X,Y))
#define NP(X,Y) next_permutation(X,Y)
#define setp(X,Y) cout<<fixed<<setprecision(Y)<<X;
int ceil2(int a,int b){if(a%b==0){return a/b;}else{return a/b+1;}}
int pow2(int a,int b){int r=1;for(int i=1;i<=b;i++){r*=a;}return r;}
int Log2(int a){int t=0;while(1){if(a==0||a==1){break;}a/=2;t++;}return t;}

int X;
int A[6]={100,101,102,103,104,105};
int dp[100005];

signed main(){
	cin>>X;
	REP(i,6){
		for(int j=1;j*A[i]<=X;j++){
			dp[j*A[i]]=1;
		}
		for(int j=0;j+A[i]<=X;j++){
			dp[j+A[i]]=max(dp[j+A[i]],dp[j]);
		}
		DEB(dp[100])END
	}
	if(dp[X]>0){
		cout<<1<<endl;
	}
	else{
		cout<<0<<endl;
	}
	return 0;
}


Measured memory_bytes: 1024
import sys
from itertools import combinations

n, *lll = map(int, sys.stdin.buffer.read().split())
ans = 0
for i, j, k in combinations(lll, 3):
    if i == j or j == k or k == i:
        continue
    l = max(i, j, k)
    if (i + j + k - l) > l:
        ans += 1
print(ans)

Measured memory_bytes: 9108
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
#define m_p make_pair
#define sz(x) (int)x.size()
#define out(x) cerr<<#x<<" = "<<x<<" "
#define outln(x) cerr<<#x<<" = "<<x<<endl
#define outarr(x,l,r) cerr<<#x"["<<l<<"-"<<r<<"] = "; for (int _i=l;_i<=r;++_i) cerr<<x[_i]<<" ";cerr<<endl;
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<double,double> pdd;
#define gc() getchar()
//char buf[1<<23],*p1=buf,*p2=buf;
//#define gc() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
template <class T> void read(T &x)
{
    x=0; char c=gc(); int flag=0;
    while (c<'0'||c>'9') flag|=(c=='-'),c=gc();
    while (c>='0'&&c<='9') x=(x<<3)+(x<<1)+(c^48),c=gc();
    if (flag) x=-x;
}
template <class T> T _max(T a,T b){return a>b ? a : b;}
template <class T> T _min(T a,T b){return a<b ? a : b;}
template <class T> bool checkmax(T &a,T b){return b>a ? a=b,1 : 0;}
template <class T> bool checkmin(T &a,T b){return b<a ? a=b,1 : 0;}
const int mod=998244353;
int Add(int a,int b){a+=b; return a>=mod ? a-mod : a;}
int Sub(int a,int b){a-=b; return a>=0 ? a : a+mod;}
int Mul(int a,int b){return 1LL*a*b%mod;}
void add(int &a,int b){a=Add(a,b);}
void sub(int &a,int b){a=Sub(a,b);}
void mul(int &a,int b){a=Mul(a,b);}
int qpow(int a,int b)
{
	int ans=1;
	while (b)
	{
		if (b&1) mul(ans,a);
		a=Mul(a,a);
		b>>=1;
	}
	return ans;
}

const int N=200005,M=1000000;
int n,k,cnt[M+5],mx=0;
int prime[M+5],flag[M+5],inv[M+5],mu[M+5],f[M+5],g[M+5];
void init()
{
	read(n);
	for (int i=1,x;i<=n;++i)
	{
		read(x);
		add(cnt[x],x);
		checkmax(mx,x);
	}
	int tot=0;
	mu[1]=1;
	for (int i=2;i<=mx;++i)
	{
		if (!flag[i])
		{
			prime[++tot]=i;
			mu[i]=mod-1;
		}
		for (int j=1;j<=tot&&i*prime[j]<=mx;++j)
		{
			flag[i*prime[j]]=1;
			if (i%prime[j]==0)
			{
				mu[i*prime[j]]=0;
				break;
			}
			mu[i*prime[j]]=mod-mu[i];
		}
	}
	inv[1]=1;
	for (int i=2;i<=mx;++i)
	{
		inv[i]=Mul(inv[mod%i],mod-mod/i);
	}
	for (int i=1;i<=mx;++i)
	{
		for (int j=i;j<=mx;j+=i)
		{
			add(f[i],cnt[j]);
			add(g[j],Mul(inv[i],mu[j/i]));
		}
	}
}

void solve()
{
	int ans=0;
	for (int i=1;i<=mx;++i)
	{
		add(ans,Mul(Mul(f[i],f[i]),g[i]));
	}
	sub(ans,f[1]);
	mul(ans,inv[2]);
	printf("%d\n",ans);
}

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


Measured memory_bytes: 27444
#include <iostream>
#include<stdio.h>
using namespace std;
int main()
{
	int N;
	do {
		cin >> N;
	} while (N > 999 || N < 0);
	int n;
	n = N % 10;
	if (n == 2 || n == 4 || n == 5|| n== 7||n == 9) {
		cout << "hon";
	}
	else if (n ==3) {
		cout << "bon";
	}
	else {
		cout << "pon";
	}
}


Measured memory_bytes: 3128
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<LL,LL>
#define pi acos(-1)
#define sqr(x) ((x)*(x))
#define pdd pair<double,double>
#define MEMS(x) memset(x,-1,sizeof(x))
#define MEM(x) memset(x,0,sizeof(x))
#define MXN 100005
#define less Less
#define N (1<<20)
#define r 998244353

/*long long pow(long long a, long long b, long long m) {
    a %= m;
    long long res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a % m;
        a = a * a % m;
        b >>= 1;
    }
    return res;
}*/
/*ll dfs(ll i,ll cnt,bool vis[],vector<ll>v[]){
if(v[i].size()==1&&i!=1){vis[i]=1;return pow(4,cnt,r);}
ll j=0;ll res=0;vis[i]=1;
while(j< v[i].size()){
 if(vis[v[i][j]]==0){
    res=res%r+(dfs(v[i][j],cnt+1,vis,v))%r;

 }


 j++;
}
return res;

}*/
int main(){
ll a,b;cin>>a>>b;
if(a<b)cout<<"0"<<endl;
else cout<<"10"<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin>>s;
int counter=0;
for(int i=0;i<s.size()-1;i++){
if(s.at(i)==s.at(i+1)){
counter++;
if(s.at(i+1)=='0'){
s.at(i+1)='1';}
else 
s.at(i+1)='0';}
else
continue;}
cout<<counter<<endl;}

Measured memory_bytes: 512
#include<bits/stdc++.h>
#define rb(a,b,c) for(int a=b;a<=c;++a)
#define rl(a,b,c) for(int a=b;a>=c;--a)
#define niv vector<int>
#define LL long long
#define IT iterator
#define PB(a) push_back(a)
#define II(a,b) make_pair(a,b)
#define FIR first
#define SEC second
#define FREO freopen("check.out","w",stdout)
#define rep(a,b) for(int a=0;a<b;++a)
#define KEEP while(1)
#define SRAND mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define random(a) rng()%a
using namespace std;
const int INF=0x3f3f3f3f;
typedef pair<int,int> mp;
typedef pair<mp,mp> superpair;
int  n;
int res[505][506];
void dfs(int start,int to,int index){
	if(to-start+1<=1) return;
	for(int i=start;i<to;i++)
		for(int j=i+1;j<=to;j++) {res[i][j]=index;
		}
	int mid=(start+to)>>1;
	dfs(start,mid,index+1),dfs(mid+1,to,index+1);
}
int main(){
	cin>>n;
	dfs(1,n,1);
 
	for(int i=1;i<n;i++)
        for(int j=i+1;j<=n;j++)
	cout<<res[i][j]<<" ";
}



Measured memory_bytes: 1536
N, K = map(int, input().split())
A = list(map(int, input().split()))

def check(l):
    k = 0
    for a in A:
        k += (a-1)//l
    return k<=K

max_ng = 0
min_ok = 10**9
while min_ok-max_ng>1:
    tgt = (min_ok+max_ng)//2
    if check(tgt):
        min_ok = tgt
    else:
        max_ng = tgt

print(min_ok)
        


Measured memory_bytes: 30792
#include <algorithm>
#include <cassert>
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>
 
#define FOR(i,k,n) for (int (i)=(k); (i)<(n); ++(i))
#define rep(i,n) FOR(i,0,n)
#define all(v) begin(v), end(v)
#define debug(x) std::cerr<< #x <<": "<<x<<"\n"
#define debug2(x,y) std::cerr<< #x <<": "<< x <<", "<< #y <<": "<< y <<"\n"
 
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<ll> vll;
typedef vector<vector<ll> > vvll;
typedef deque<bool> db;
template<class T> using vv=vector<vector< T > >;

// cout vector
template<typename T> ostream& operator<<(ostream& s, const vector<T>& v) {
  int len = v.size(); s << "\n";
  for (int i = 0; i < len; ++i) {
    s << v[i]; if (i < len - 1) s << "\t";
  }
  s << "\n"; return s;
}

// cout 2-dimentional vector
template<typename T> ostream& operator<<(ostream& s, const vector< vector<T> >& vv) {
  int len = vv.size();
  for (int i = 0; i < len; ++i) { s << vv[i]; }
  return s;
}

int main() {
  int n, m, d;
  cin >> n >> m >> d;
  int cnt = 2 * (n - d);
  if (d == 0) {
    cnt = n;
  }
  double ans = cnt;
  ans /= n;
  ans /= n;
  ans *= (m-1);
  printf("%.9f\n", ans);

  return 0;
}


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

constexpr int inf = 1e9;
constexpr ll linf = 1e18;

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

    int n; cin >> n;
    vector<int> x(n);
    for (int i = 0; i < n; i++) cin >> x[i];
    
    int m = *min_element(x.begin(), x.end());
    int M = *max_element(x.begin(), x.end());

    int ans = inf;
    for (int i = m; i <= M; i++) {
        int tmp = 0;
        for (int j = 0; j < n; j++) {
            tmp += (x[j] - i) * (x[j] - i);
        }
        if (tmp < ans) {
            ans = tmp;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;
 
string S; bool p[10009];
 
int main() {
	cin >> S;
	bool OK = true;
	if (S[0] != 'A') { 
        OK = false; 
    }
    p[0] = true;
	int cnt = 0; 
    for (int i = 2; i < S.size() - 1; i++) { 
        if (S[i] == 'C') { 
            cnt++; p[i] = true; 
        } 
    }
	if (cnt != 1) OK = false;
	for (int i = 0; i < S.size(); i++) {
		if (p[i] == false && S[i] >= 'A' && S[i] <= 'Z') OK = false;
	}
	if (OK == true) cout << "AC" << endl;
	else cout << "WA" << endl;
	return 0;
}

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

#define o(output) cout << output << endl

using namespace std;

string s,t,u;
int a,b,c,d;
char A,B;
priority_queue<int,vector<int>,greater<int> >small;
int l[14]={0,13,1,2,3,4,5,6,7,8,9,10,11,12};

int main(){
  cin>>a;
  if(a<1200)o("ABC");
  else o("ARC");
}

Measured memory_bytes: 256
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <bitset>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef long long LL;

typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;

//container util
//------------------------------------------
#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())
#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())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double PI  = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
const LL MOD = 1e9+7; 
//vector <vector<int>> x(20, vector<int> (20)), y(20,vector<int> (20));
/*int counter_1 (int x) {
    if(x == 0) return 0;
    return counter_1(x >> 1) + (x & 1);
}*/

//int Counter(int x)
int main(){
   int a,b,c,x,y;
   cin >> a >> b >> c >> x >> y;
   int cnt = max(x, y);
   LL ans = c*cnt*2;
   bool oa=true, ob=true;
   for(int q = cnt*2; q > -1;){
       q-=2;
       if(q<0) break;
       int o=0, p=0;
       LL tmp = q*c;
       if(q/2+o<x) oa = false;
       if(q/2+p<y) ob = false;
       if(oa==false){
           o=x-q/2;
           tmp+=o*a;
       }
       if(ob==false){
           p=y-q/2;
           tmp+=p*b;
       }
       ans = min(tmp, ans);
   }
   cout << ans;

   


}

    



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

using namespace std;

#define FOR(i,a,b) for(int i = (a); i < (b); ++i)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()

inline int toInt(string s) {int v; istringstream sin(s);sin>>v; return v;}

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector< vector<int> > Mat;
typedef tuple<int, int, int, int> T;

const int MOD = (int)1e9+7;
const int INF = (int)1e9;
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};

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

    int n;
    while(1){
        cin >> n;
        if(n == 0) break;
        vector<int> a(n);
        double ave = 0;
        rep(i, n){
            cin >> a[i];
            ave += a[i];
        }
        ave /= n;

        int ans = 0;
        rep(i, n){
            if(a[i] <= ave) ans++;
        }

        cout << ans << endl;
    }

    return 0;
}


Measured memory_bytes: 3148