akhauriyash/Code-Regression huggingface dataset:
package main

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

const (
	initialBufSize = 10000
	maxBufSize     = 1000000
)

var (
	sc *bufio.Scanner = func() *bufio.Scanner {
		sc := bufio.NewScanner(os.Stdin)
		buf := make([]byte, initialBufSize)
		sc.Buffer(buf, maxBufSize)
		sc.Split(bufio.ScanWords)
		return sc
	}()
	mod int = 1e9 + 7
)

func main() {
	N := getInt()
	min := 1000000
	cnt := 0

	for i := 0; i < N; i++ {
		p := getInt()
		if p <= min {
			cnt++
			min = p
		}
	}

	fmt.Println(cnt)
}

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

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

func abs(a int) int {
	return int(math.Abs(float64(a)))
}

func pow(p, q int) int {
	return int(math.Pow(float64(p), float64(q)))
}

func min(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton min() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Min(float64(res), float64(nums[i])))
	}
	return res
}

func max(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton max() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Max(float64(res), float64(nums[i])))
	}
	return res
}

func strSearch(a []string, b string) bool {
	for i := 0; i < len(a); i++ {
		if a[i] == b {
			return true
		}
	}
	return false
}

func printIntArray(array []int) {
	strArray := fmt.Sprint(array)
	fmt.Println(strArray[1 : len(strArray) - 1])
}

func calcMod(x int) int {
	return x % mod
}


Measured memory_bytes: 2048
import java.io.*;
import java.math.*;
import java.util.*;

public class Main {
    private static boolean debug = false;
    private static boolean elapsed = false;

    private static PrintWriter _out = new PrintWriter(System.out);
    private static PrintWriter _err = new PrintWriter(System.err);

    private void solve(Scanner sc) {
        int X = sc.nextInt();

        int t = 0;
        int sum = 0;
        while (sum < X) {
            ++t;
            sum += t;
        }
        _out.println(t);
    }
    private static BigInteger C(long n, long r) {
        BigInteger res = BigInteger.ONE;
        for (long i = n; i > n - r; --i) {
            res = res.multiply(BigInteger.valueOf(i));
        }
        for (long i = r; i > 1; --i) {
            res = res.divide(BigInteger.valueOf(i));
        }
        return res;
    }
    private static BigInteger P(long n, long r) {
        BigInteger res = BigInteger.ONE;
        for (long i = n; i > n - r; --i) {
            res = res.multiply(BigInteger.valueOf(i));
        }
        return res;
    }
    /*
     * 10^10 > Integer.MAX_VALUE = 2147483647 > 10^9
     * 10^19 > Long.MAX_VALUE = 9223372036854775807L > 10^18
     */
    public static void main(String[] args) {
        long S = System.currentTimeMillis();

        Scanner sc = new Scanner(System.in);
        new Main().solve(sc);
        _out.flush();

        long G = System.currentTimeMillis();
        if (elapsed) {
            _err.println((G - S) + "ms");
        }
        _err.flush();
    }
}

Measured memory_bytes: 23380
import os
import sys
import math
import heapq
from decimal import *
from io import BytesIO, IOBase
from collections import defaultdict, deque

def r():
    return int(input())
def rm():
    return map(int,input().split())
def rl():
    return list(map(int,input().split()))

n,d = rm()
ans = 0
for i in range(n):
    a,b,=rm()
    if abs(a)**2+abs(b)**2 <= d**2:
        ans+=1
print(ans)

Measured memory_bytes: 74932
import sys
def I(): return int(sys.stdin.readline().rstrip())
x = I()
ans = 0
if 400<=x<600:
    ans = 8
elif x<800:
    ans = 7
elif x<1000:
    ans = 6
elif x<1200:
    ans = 5
elif x<1400:
    ans = 4
elif x<1600:
    ans = 3
elif x<1800:
    ans = 2
else:
    ans = 1
print(ans)


Measured memory_bytes: 9180
#include<iostream>
#include<cstring>
#include<algorithm>
#include<string>
#include<vector>
#include<cstdio>
#include<cmath>
#define pb(in,tmp) in.push_back(tmp)
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,b) loop(i,0,b)
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
using namespace std;
int main(){
int n;
while(cin>>n,n){
vector<int>in(n,0);
rep(i,n)rep(j,5){int tmp;cin>>tmp;in[i]+=tmp;}
sort(all(in));
cout<<in[n-1]<<" "<<in[0]<<endl;
}
}

Measured memory_bytes: 1216
#include <bits/stdc++.h>
using namespace std;
int main() {
int n,k;
cin >> n >> k;
int dp[n];
for(int i =0; i < n; i++){
       cin >> dp[i];
}
long long sum = 0;
for(int i = 0; i < n; i++){
    if(dp[i] >=k)
              sum++;
       
}

cout  << sum;
return 0;

}









  

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

int main() {
	/*freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);*/
	int n;
	cin >> n;
	vector<int> X(n);
	int mn = INT_MAX, mx = -1;
	for (int i=0; i<n; i++) {
		cin >> X[i];
		if (X[i] > mx) mx = X[i];
		if (X[i] < mn) mn = X[i];
	}

	int answer = INT_MAX;
	for (int p=mn; p<=mx; p++) {
		int t = 0;
		for (int x: X) {
			t += (x-p)*(x-p);
		}
		if (t < answer) answer = t;
	}
	cout << answer << '\n';
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
constexpr long long INFL = 1LL << 60;
constexpr int INF = 1e9;

using namespace std;

using ll = long long;
using P = pair<int, int>;

int main()
{
    int N;
    cin >> N;
    int ans = 1;
    int x = 0;
    int mcnt = 0;
    for(int i = N; i > x; --i){
        int num = i;
        int cnt = 0;
        while(num % 2 == 0){
            num /= 2;
            x = num;
            cnt++;
        }
        if(mcnt < cnt){
            ans = i;
            mcnt = max(cnt, mcnt);
        }
    }

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

Measured memory_bytes: 256
#include <iostream>
#include <vector>

using namespace std;

int main(){
    string S;
    long K;
    cin >> S;
    cin >> K;
    long N = S.size();
    int cnt = 1;
    char prev = S[0];
    vector<long> v;
    for(int i = 1; i < N; i++){
        if(S[i] != prev){
            prev = S[i];
            v.push_back(cnt);
            cnt = 1;
        }else{
            cnt++;
        }
    }
    v.push_back(cnt);
    long ans = 0;
    if(S[0] == S[N-1]){
        if(v[0] == N){
            ans = (N*K)/2;
        }else{
            ans += (v[0]/2 + v[v.size()-1]/2 + ((v[0] + v[v.size()-1])/2)*(K-1));
            for(int i = 1; i+1 < v.size(); i++){
                ans += (v[i]/2)*K;
            }
        }
    }else{
        for(int i = 0; i < v.size(); i++){
            ans += (v[i]/2)*K;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 888
#include <bits/stdc++.h>
using namespace std;
using Graph= vector<vector<int>>;
const int TBC= -1;

void DFS(const Graph &tree, int parent, int root, vector<int> *parents, vector<int> *pre_timestamp, vector<int> *post_timestamp, vector<int> *depth){
  if(parents->at(root)==TBC){
    parents->at(root)= parent;
    pre_timestamp->at(root)= depth->size();
  }
  int depth_root= (!depth->empty()) ? depth->back()+ 1
                                    : 0;
  depth->emplace_back(depth_root);
  for(auto child:tree.at(root)){
    if(child != parent){
      DFS(tree, root, child, parents, pre_timestamp, post_timestamp, depth);
      depth->emplace_back(depth_root);
    }
  }
  post_timestamp->at(root)= depth->size();
}

int main(){
  int N,v0_runner,v0_trailer;
  cin >> N >> v0_runner >> v0_trailer;
  const int M= N-1;
  v0_runner--; v0_trailer--; // 1-indexed -> 0-indexed

  Graph tree(N);

  int v1,v2;
  for(int i=0; i<M; i++){
    cin >> v1 >> v2;
    v1--; v2--; // 1-indexed -> 0-indexed
    tree.at(v1).emplace_back(v2);
    tree.at(v2).emplace_back(v1);
  }

  vector<int> parents(N, TBC);
  vector<int> pre_timestamp(N, TBC);
  vector<int> post_timestamp(N, TBC);
  vector<int> depth;

  DFS(tree, -1, v0_trailer, &parents, &pre_timestamp, &post_timestamp, &depth);

  int depth0_runner= depth.at(pre_timestamp.at(v0_runner));
  int cnt_up= (depth0_runner- 1)/ 2;
  int pos_runner= v0_runner;
  for(int i=0; i<cnt_up; i++){
    pos_runner= parents.at(pos_runner);
  }

  int depth1_runner= depth.at(pre_timestamp.at(pos_runner));
  int left = pre_timestamp.at(pos_runner);
  int right= post_timestamp.at(pos_runner);
  int depth_tree= *max_element(depth.begin()+ left, depth.begin()+ right);

  int ans= (depth0_runner/ 2)+ (depth_tree- depth1_runner);

  cout << ans << endl;
}

Measured memory_bytes: 21264
import java.util.Scanner;
class Main{
	public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		int[] Cars = new int[10];
		int current = 0;
		int input;
		
		while(scan.hasNextInt()){
			input = scan.nextInt();
			if(input == 0){
				if(current > 0){
					System.out.println(Cars[current-1]);
					current--;
				}
			}else{
				Cars[current] = input;
				current++;
			}
		}
	}
}

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

#define ms(s, n) memset(s, n, sizeof(s))
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORd(i, a, b) for (int i = (a) ; i >= (b); i--)
#define FORall(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define sz(a) int((a).size())
#define present(t, x) (t.find(x) != t.end())
#define all(a) (a).begin(), (a).end()
#define uni(a) (a).erase(unique(all(a)), (a).end())
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define sp system("pause")
#define prec(n) fixed<<setprecision(n)
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<pi> vii;
const int MOD = (int) 1e9 + 7;
const int INF = (int) 1e9;
const ll LINF = (ll) 1e18;
const ld PI = acos((ld) -1);
const ld EPS = 1e-9;
const int N = (int) 1e5 + 10;
void TimeExecution() {
    cout << "\n\n===>> Time Execution: " << clock() / (double)1000 << " sec(s).";
}
int t;
int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    /*
    #ifndef ONLINE_JUDGE
        freopen("in.txt", "r", stdin);
        freopen("out.txt", "w", stdout);
    #endif
    */
    ll n, a, b;
    cin >> n >> a >> b;
    ll x[n + 1];
    FOR(i, 1, n) cin >> x[i];
    ll res = 0;
    FOR(i, 2, n)
    {
        res += min((x[i] - x[i - 1]) * a, b);
    }
    cout << res;
    return 0;
}


Measured memory_bytes: 1024
N, K = map(int, input().split())
a = list(map(int,input().split()))

a_dict = {}

for i in range(N):
    if a[i] not in a_dict.keys():
        a_dict[a[i]] = 1
    else:
        a_dict[a[i]] += 1

ans = 0
if len(a_dict) <= K:
    print(ans)
else:
    sort_a_dict_list = sorted(a_dict.items(), key=lambda x:x[1])

    for j in range(len(a_dict) - K):
        ans += sort_a_dict_list[j][1]
    print(ans)

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

int n;
vector<int> a;

int main()
{
  cin >> n;
  for (int i = 0; i < n; i++){
    int x;
    cin >> x;
    a.push_back(x);
  }

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

  bool f = true;
  for (int i = 0; i < n; i++){
    if (n & 1){
      if ((i & 1) && i + 1 != a[i]) f = false;
      if (!(i & 1) && i != a[i]) f = false;
    }
    else {
      if ((i & 1) && i != a[i]) f = false;
      if (!(i & 1) && i + 1 != a[i]) f = false;
    }
  }

  if (f){
    long long ans = 1;
    for (int i = 0; i < n / 2; i++){
      ans *= 2;
      ans %= 1000000007;
    }

    cout << ans << endl;
  } else {
    cout << 0;
  }
}


Measured memory_bytes: 892
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	private static int n;
	private static char[] x, y;
	private static int[][] dp;
	
	public static void main(String[] args) {
		try(Scanner scan = new Scanner(System.in)) {
			n = scan.nextInt();
			scan.nextLine();
			for(int i=0; i<n; i++) {
				x = scan.nextLine().toCharArray();
				y = scan.nextLine().toCharArray();
				int xLen = x.length;
				int yLen = y.length;
				dp = new int[xLen+1][yLen+1];
				for(int[] row : dp) Arrays.fill(row, -1);
				System.out.println(lcs(xLen-1, yLen-1));
			}
		}
	}
	
	private static int lcs(int i, int j) {
		if(i < 0 || j < 0) return 0;
		if(dp[i][j] != -1) return dp[i][j];
		     if(x[i] == y[j]) dp[i][j] = lcs(i-1, j-1) + 1;
		else if(x[i] != y[j]) dp[i][j] = Math.max(lcs(i-1, j), lcs(i, j-1));
		return dp[i][j];
	}
}



Measured memory_bytes: 71672
#include <bits/stdc++.h>
using namespace std;
typedef  long long LL;
typedef  unsigned long long ULL;
typedef  double db;
typedef  long double ld;
#pragma comment(linker, "/STACK:102400000,102400000")
#define fuck(x) cout<<x<<endl
#define fuck1(x,y) cout<<x<<" "<<y<<endl
#define lson root<<1,l,mid
#define rson root<<1|1,mid+1,r
#define MP(a,b) make_pair(a,b)
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define MP make_pair
#define se second
#define fi first
#define PB push_back
#define PF push_front
#define LB lower_bound
#define UB upper_bound
const int INF = 0x3f3f3f3f3f,mod = 1e9+7;
const double eps  =1e-6,PI = acos(-1);
template<typename T> inline void read(T &x){
    x=0;T f=1;char ch;do{ch=getchar();if(ch=='-')f=-1;}while(ch<'0'||ch>'9');do x=x*10+ch-'0',ch=getchar();while(ch<='9'&&ch>='0');x*=f;
}

int main(){
    char ax[100];
    scanf("%s",ax);
    bool flag = 0;
    for(int i = 0;i<3;i++){
        if(ax[i]==ax[i+1])flag = 1;
    }
    if(flag)printf("Bad");
    else printf("Good");
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
ll N;
ll tree[400010];
void updateTreeNode(ll p,ll value)
{
    ll i;
	tree[p+N] = value;
	p = p+N;
	for (i=p; i > 1; i >>= 1)
		tree[i>>1] =max(tree[i] , tree[i^1]);
}
ll query(ll l,ll r)
{
	ll res = 0;
	for (l += N, r += N; l < r; l >>= 1, r >>= 1)
	{
		if (l&1)
			res =max(res,tree[l++]);

		if (r&1)
			res =max(res,tree[--r]);
	}
	return res;
}
int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin>>N;
	ll i,a[N],b[N],c[N],j;
	memset(tree,0,sizeof tree);
	for(i=0;i<N;i++) cin>>a[i];
	for(i=0;i<N;i++) cin>>b[i];
	for(i=0;i<N;i++)
	{
	    if(i==0) updateTreeNode(a[i]-1,b[i]);
	    else
	    {
            ll p3=query(0,a[i]-1);
	        updateTreeNode(a[i]-1,p3+b[i]);
	    }
	}
	// for(i=0;i<8;i++) cout<<tree[i]<<" ";
	ll ans=query(0,N);
	cout<<ans<<endl;
	return 0;
}



Measured memory_bytes: 6528
#include <bits/stdc++.h>
#define ALL(A) (A).begin(), (A).end()
#define ll long long
#define rep(i, n) for (int i = 0; i < (n); i++)

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; }

int dx[] = { 0, 1, -1, 0, 1, -1, 1, -1 };  // i<4:4way i<8:8way
int dy[] = { 1, 0, 0, -1, 1, -1, -1, 1 };

const ll mod = 1e9 + 7;
const ll INF = -1 * ((1LL << 63) + 1);
const int inf = -1 * ((1 << 31) + 1);

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    double x;
    cin >> x;
    double now = 100;
    double ans = 0;
    while(now < x ){
        now = (now/100) * 101;
        now = (ll)(now);
        ans ++ ;
    }
    cout << (ll)ans << endl;
}

Measured memory_bytes: 3724
import java.io.*;
import java.util.*;
//import java.util.stream.*;
//import java.math.*;

public class Main {

    public static void main(String[] args) throws IOException {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        Scanner sc = new Scanner(System.in);
        int w = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        int x = 0;
        if (b <= (a + w) && b >= a) {
        } else if (a + w < b) {
            x = b - (a + w);
        } else if (b + w < a) {
            x = (b + w) - a;
        }
        System.out.println(Math.abs(x));
        bw.flush();
    }
}


Measured memory_bytes: 21844
#include <stdio.h>
int main()
{
    char op[2];
    int a,b;
    scanf("%d%s%d",&a,op,&b);
    if(op[0]=='+')
        printf("%d\n",a+b);
    else if(op[0]=='-')
        printf("%d\n",a-b);
    return 0;
}

Measured memory_bytes: 128
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>

int64_t test(int N, int A, int X[]);
int main(void) {
    char *p;
    char str[256];

    int *X;
    int N=1,A=1;
    int i,cnt=0;

    p = fgets(str, 256, stdin);
    for(i=0;i<256;i++){
        if(str[i] == ' ') {
            str[i] = '\0';
            N = atoi(p);
            A = atoi(&str[i+1]);
            break;
        }
    }
    
    X = (int*)malloc(sizeof(int) * N);
    p = fgets(str, 256, stdin);
    for(i=0;i<256;i++){
        if(str[i] == ' '){
            str[i] = '\0';
            X[cnt++] = atoi(p);
            p = &str[i+1];
        }else if(str[i] < '0' || str[i] > '9') {
            break;
        }
    }
    X[cnt] = atoi(p);
    
    printf("%ld\n", test(N,A,X));
    free(X);

    return 0;
}

int64_t test(int N, int A, int X[]) {
    int j,t;
    int64_t **dp;
    int64_t sum = 0;
    int tmax;
    int Xm = A;


    int *Y = (int*)malloc(sizeof(int) * N);
    for(j=0;j<N;j++){
        Y[j] = X[j] - A;
        if(Xm < X[j]) Xm = X[j];
    }
    tmax = 2 * N * Xm;
    dp = (int64_t**)calloc(1,sizeof(int64_t*) * (N+1) + (sizeof(int64_t) * ((2 * (N+1)*Xm*(N+1)) + 1)));
    for(j=0;j<=N;j++){
        dp[j] = (int64_t*)(((char*)dp) + (sizeof(int64_t*)*(N+1)) + (sizeof(int64_t) * j *(N+1)* 2 * Xm));
    }

    dp[0][N * Xm] = 1;
    for(j=1;j<=N;j++){
        for(t=0;t<=tmax;t++){
            if((t-Y[j-1] < 0) || ((t-Y[j-1]) > tmax)){
                dp[j][t] = dp[j-1][t];
            } else if((0 <= (t-Y[j-1])) && ((t-Y[j-1]) <= tmax)){
                dp[j][t] = dp[j-1][t] + dp[j-1][t-Y[j-1]];
            }
        }
    }
    
    sum = dp[N][N*Xm] - 1;
    free(Y);
    free(dp);
    return sum;
}


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

int main() {
  int N;
  cin >> N;
  if (N%1110<=9)
    cout << "Yes" << endl;
  else if ((N-N/1000*1000)%111==0)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

Measured memory_bytes: 256
import java.util.*;
public class Main{
	public static void main(String arg[]){
		Scanner sc=new Scanner(System.in);
		int a[]=new int[3];
		for(int i=0;i<3;i++)
			a[i]=sc.nextInt();
		Arrays.sort(a);
		System.out.println(a[0]+a[1]);
	}
}

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

#ifdef LOCAL
#include "../debug.h"
#else
#define debug(x...) 141
#endif
#define forn(i,x,n) for(int i = x; i < n; ++i)
#define forit(it, m) for(auto it = m.begin(); it!=m.end(); ++it)
typedef long long ll;

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    int a[5];

    {
        cin>>a[0]>>a[1]>>a[2]>>a[3]>>a[4];
        forn(i,0,5)
        	if(a[i]==0){
        		cout<<i+1;
        		break;
        	}
    }
    return 0;
}

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

void print_rectangle(int w, int h)
{ 
	for (int i = 0; i < w; i++)
	{
		for (int j = 0; j < h; j++)
			cout << "#";
		cout << "\n";
	}
	cout << "\n";
}

int main()
{
	int a, b;
	vector<int> A, B;
	do 
	{
		cin >> a >> b;
		if (a == 0 && b == 0)
			break;
		A.push_back(a);
		B.push_back(b);
	} while (true);

	for (int i = 0; i < A.size(); i++)
		print_rectangle(A[i], B[i]);
	return 0;
}




Measured memory_bytes: 3064
fn main(){
	let mut s = String::new();
	std::io::stdin().read_line(&mut s).unwrap();
	let n = s.trim().parse::<i32>().unwrap();
	let mut s = String::new();
	std::io::stdin().read_line(&mut s).unwrap();
	let a = s.trim().parse::<i32>().unwrap();
	let ten = ((n / 10) % 10) * 10 + (n % 10);
	let hund = ((n / 100) % 10) * 100 + ((n / 10) % 10) * 10 + (n % 10);
	let hyaku = ((n / 100) % 10) > 5;
	if ((n / 100) % 100) % 5 == 0 {
		println!("{}", if a - ten >= 0 { "Yes" } else { "No" });
	} else if hyaku {
		println!("{}", if a - (hund - 500) >= 0 { "Yes" } else { "No" });
	} else {
		println!("{}", if a - hund >= 0 { "Yes" } else { "No" });
	}
}


Measured memory_bytes: 4352
#include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <numeric>
#include <set>
#include <unordered_set>
#include <queue>
#include <boost/math/constants/constants.hpp>
#include <boost/math/common_factor_rt.hpp>

using namespace std;
#define ll long long
#define rep(i, n) for(int i = 0;i < n;i++)
#define FOR(i, n, m) for(int i=n; i<m; ++i)

int ismove(char m[][21], int H, int W, int x,int y){
  int z;
  if(x>=0 && x<H && y>=0 && y<W && m[x][y]=='.'){
    z=1;
  }else{
    z=0;
  }
  return z;
}

int main() {
  int H, W;
  cin >> H >> W;
  char m[21][21];

  rep(i, H){
    rep(j, W){
      cin >> m[i][j];
      //cout << m[i][j] << " ";
    }
  }
  
  int ans = 0;
  
  rep(i, H){
    rep(j, W){
      if(m[i][j]=='.'){
        queue<pair<int, int>> q;
        pair<int, int> p;
        p.first=i;
        p.second=j;
        q.push(p);
        int bf[21][21]={};
        bf[i][j]=1;
        while(!q.empty()){
          p = q.front();
          if(ismove(m,H,W, p.first+1, p.second) && bf[p.first+1][p.second]==0){
            bf[p.first+1][p.second]=bf[p.first][p.second]+1;
            pair<int, int> es;
            es.first = p.first+1;
            es.second = p.second;
            q.push(es);
          }
          if(ismove(m,H,W, p.first-1, p.second) && bf[p.first-1][p.second]==0){
            bf[p.first-1][p.second]=bf[p.first][p.second]+1;
            pair<int, int> es;
            es.first = p.first-1;
            es.second = p.second;
            q.push(es);
          }
          if(ismove(m,H,W, p.first, p.second+1) && bf[p.first][p.second+1]==0){
            bf[p.first][p.second+1]=bf[p.first][p.second]+1;
            pair<int, int> es;
            es.first = p.first;
            es.second = p.second+1;
            q.push(es);
          }
          if(ismove(m,H,W, p.first, p.second-1) && bf[p.first][p.second-1]==0){
            bf[p.first][p.second-1]=bf[p.first][p.second]+1;
            pair<int, int> es;
            es.first = p.first;
            es.second = p.second-1;
            q.push(es);
          }
          q.pop();
          //cout << bf[1][0] << bf[0][1];
        }
        int mx=0;
        rep(k, H){
          rep(l, W){
            mx = max(bf[k][l], mx);
          }
        }
        //cout << mx << endl;
        ans = max(ans, mx);
      }
    }
  }
  cout << ans-1 << endl;
}

Measured memory_bytes: 256
use itertools::Itertools as _;
use proconio::*;
macro_rules! p {
    ($x:expr) => {
        println!("{}", $x);
    };
}
fn main() {
    input! {
        n:usize,
        s:[usize;n],
        t:[usize;n],
        u:[u64;n],
        v:[u64;n],
    }
    let mask = std::u64::MAX;
    let (or, and) = (1, 0);
    // 1確定
    let mut one = vec![vec![0u64; n]; n];
    // 0確定
    let mut zero = vec![vec![0u64; n]; n];

    // 自明
    for i in 0..n {
        for j in 0..n {
            if s[i] == and {
                one[i][j] |= u[i];
            } else {
                zero[i][j] |= !u[i];
            }
            if t[j] == and {
                one[i][j] |= v[j];
            } else {
                zero[i][j] |= !v[j];
            }
            if one[i][j] & zero[i][j] != 0 {
                p!(-1);
                return;
            }
        }
    }
    let mut ans = one.clone();

    // 条件を満たさない行/列のあるbitを調べる関数
    let check = |ans: &[Vec<u64>]| {
        let mut u_check = (0..n)
            .map(|i| if s[i] == or { 0 } else { mask })
            .collect_vec();
        let mut v_check = (0..n)
            .map(|j| if t[j] == or { 0 } else { mask })
            .collect_vec();

        for i in 0..n {
            for j in 0..n {
                if s[i] == and {
                    u_check[i] &= ans[i][j];
                } else {
                    u_check[i] |= ans[i][j];
                }
                if t[j] == and {
                    v_check[j] &= ans[i][j];
                } else {
                    v_check[j] |= ans[i][j];
                }
            }
        }
        let check = u
            .iter()
            .zip(&u_check)
            .chain(v.iter().zip(&v_check))
            .map(|(x, y)| x ^ y)
            .fold(0, |x, y| x | y);
        check
    };

    // 市松
    // 未確定が2*2以上なら必ず通る
    for i in 0..n {
        for j in 0..n {
            ans[i][j] |= !zero[i][j] & mask * ((i ^ j) & 1) as u64;
        }
    }

    let fail = check(&ans);
    // 全部or
    for i in 0..n {
        for j in 0..n {
            ans[i][j] &= !fail;
            ans[i][j] |= fail & (u[i] | v[j]) & !zero[i][j];
        }
    }

    let fail = check(&ans);
    // 全部and
    for i in 0..n {
        for j in 0..n {
            ans[i][j] &= !fail;
            ans[i][j] |= fail & ((u[i] & v[j]) | one[i][j]);
        }
    }

    let fail = check(&ans);
    if fail != 0 {
        p!(-1);
        return;
    }

    ans.iter().for_each(|x| p!(x.iter().join(" ")));
}


Measured memory_bytes: 11388
#include<stdio.h>

int main(void){
  int a[11];
  int v1,v2;
  int x,i;
  double t,y;

  while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",
	      a+1,a+2,a+3,a+4,a+5,
	      a+6,a+7,a+8,a+9,a+10,
	      &v1,&v2)!=EOF){
    x=0;
    for(i=1;i<11;i++)
      x+=a[i];
    v2=v1+v2;
    //    printf("%d %d %d\n",x,v2,v1);
    t=(double)x/v2;
    y=t*v1;
    //    printf("%f %f\n",t,y);
    for(i=1;i<11;i++){
      y-=a[i];
      if(y<=0)
	break;
    }
    printf("%d\n",i);
  }
  return 0;
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=32;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n,m;
	cin>>n>>m;
	for(int i=0;i<m;i++){
		int k;
		cin>>k;
		n-=k;
	}
	if(n<0)cout<<-1<<endl;
	else cout<<n<<endl;
	return 0;
}


Measured memory_bytes: 3656
using System;

namespace abc167_a
{
    class Program
    {
        static void Main(string[] args)
        {
            var firstId = Console.ReadLine();
            var secondId = Console.ReadLine();

            Console.WriteLine(CompareId(firstId, secondId));
            Console.Read();
        }

        private static string CompareId(string firstId, string secondId)
        {
            var id = secondId.Remove(secondId.Length - 1);

            if (id == firstId)
            {
                return "Yes";
            }

            return "No";
        }
    }
}


Measured memory_bytes: 25660
//#include "bits/stdc++.h"

#define _USE_MATH_DEFINES
#include<cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iterator>
#include<iomanip>
#include<unordered_set>
#include<bitset>
#include<complex>

using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

//typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pdd;
typedef vector< vector<int> > mat;

template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; }

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;

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

	int N;
	set<int> cols;
	int rand = 0;
	cin >> N;
	int A;
	rep(i, 0, N)
	{
		cin >> A;
		if (A >= 3200)
		{
			rand++;
		}
		else
		{
			cols.insert(A / 400);
		}
	}

	cout << max(1LL,SZ(cols)) << " " << SZ(cols) + rand << endl;

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <string>
#include <cmath>
#include <cctype>
#include <cstdlib>
#include <stack>
#include <queue>
#include <vector>
#include <algorithm>
#include <list>
using namespace std;

int main() {
    int a, b, c;
    cin >> a >> b >> c;
    int m = max({ a,b,c });
    int n = min({ a,b,c });
    cout << m - n << endl;
}



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

using namespace std;
#define rep(i,n) for(int i = 0;i < (int)n;i++)
#define all(x) (x).begin(),(x).end()
using ll = long long;
using P = pair<int,int>;
//int dx[4] = {1,0,0,-1};
//int dy[4] = {0,1,-1,0};
//const int INF = (1 << 29);

int main(){

  ll h,w;
  cin >> h >> w;
  ll odd = 0,even = 0;
  for(int i = 1;i <= h;i+=2)odd++;
  for(int i = 2;i <= h;i+=2)even++;
  if(h != 1 && w != 1)cout << odd*((w+1)/2) + even*(w/2);
  else cout << 1;
  return 0;
}


Measured memory_bytes: 256
import math

def koch(p1, p2, dp):

    if dp == 0:
        return
    
    sX = (p2[0] - p1[0]) / 3 + p1[0]
    sY = (p2[1] - p1[1]) / 3 + p1[1]
    s = (sX, sY)

    tX = (p2[0] - p1[0]) * 2 / 3 + p1[0]
    tY = (p2[1] - p1[1]) * 2 / 3 + p1[1]
    t = (tX, tY)

    uX = (tX - sX) * math.cos(math.radians(60)) - (tY - sY) * math.sin(math.radians(60)) + sX
    uY = (tX - sX) * math.sin(math.radians(60)) + (tY - sY) * math.cos(math.radians(60)) + sY
    u = (uX, uY)

    koch(p1, s, dp - 1)
    myPrint(s)
    koch(s, u, dp - 1)
    myPrint(u)
    koch(u, t, dp - 1)
    myPrint(t)
    koch(t, p2, dp - 1)

    
def myPrint(val):
    print("{:.8f} {:.8f}".format(val[0], val[1]))
    

n = int(input())

p1 = (0.0, 0.0)
p2 = (100.0, 0.0)

myPrint(p1)
koch(p1, p2, n)
myPrint(p2)


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

int main(){

    double a, b, c, d, e, f;
    while (cin >> a >> b >> c >> d >> e >> f){
        double x = (e*c - b*f) / (e*a - d*b);
        double y = (a*f - d*c) / (e*a - d*b);

        int x2 = x > 0 ? (x * 1000 + 0.5) : (x * 1000 - 0.5);
        int y2 = y > 0 ? (y * 1000 + 0.5) : (y * 1000 - 0.5);

        cout << fixed << setprecision(3) << x2 / 1000.0 << " " << y2 / 1000.0 << endl;
    }

    return 0;
}

Measured memory_bytes: 1280
#include<bits/stdc++.h>
#define MAX_N 200010
using namespace std;

int N, S[MAX_N], T[MAX_N];
int A, B;
pair<int, int> itv[MAX_N];

void solve() {
	for (int i = 0; i < N; ++i) {
		itv[i].first = T[i];
		itv[i].second = S[i];
	}
	sort(itv, itv + N);

	int ans = 0, t = 0;
	for (int i = 0; i < N; ++i) {
		if (t + itv[i].second <= itv[i].first) {
			ans++;
			t += itv[i].second;
		}
	}
	if (ans == N) puts("Yes");
	else puts("No");
}

int main(){
	scanf("%d", &N);
	for (int i = 0; i < N; ++i) {
		scanf("%d %d", &A, &B);
		T[i] = B;
		S[i] = A;
	}
	solve();
}


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

int main(){
    int n;
    cin >> n;
    int i, j;
    for(i = 1; i < 10; i++){
        for(j = 1; j < 10; j++){
            if(i*j == n){
                cout << "Yes" << endl;
                return 0;
            }
        }
    }
    cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
Blur = [
  [ [0, 0], [-1, 1], [0, 1], [1, 1], [-2, 2], [-1, 2], [0, 2], [1, 2], [2, 2], [-1, 3], [0, 3], [1, 3], [0, 4] ],
  [ [0, 0], [1, 0], [2, 0], [0, 1], [1, 1], [2, 1], [0, 2], [1, 2], [2, 2] ],
  [ [0, 0], [-1, 1], [0, 1], [1, 1], [0, 2] ]
]
Blur_c = [[0, 2], [1, 1], [0, 1]]

def solve(fld, x, y, m)
  if m == $n
    if fld.flatten.all?{ |v| v == 0 }
      return true
    else return false
    end
  end

  3.times do |z|
    10.times do |i|
      10.times do |j|
        if fld[i][j] > 0
          return false if i < y || i == y && j < x
          if ps = ok(j, i, z, fld)
            nfld = fld.map(&:dup)
            ps.each { |x, y| nfld[y][x] -= 1 }
            $ans[m] = [j + Blur_c[z][0], i + Blur_c[z][1], 3 - z]
            return true if solve(nfld, j, i, m + 1)
          end
        end
      end
    end
  end
  false
end

def ok(x, y, z, fld)
  ret = []
  Blur[z].each do |c, r|
    nx = x + c; ny = y + r
    return false unless 0 <= nx && nx < 10 && 0 <= ny && ny < 10 && fld[ny][nx] > 0
    ret << [nx, ny]
  end
  ret
end

$n = gets.to_i
$ans = $n.times.map { [] }
fld = 10.times.map { gets.split.map(&:to_i) }
solve(fld, 0, 0, 0)
$ans.each{ |a| puts a.join(' ') }

Measured memory_bytes: 8992
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.IOException;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] strAry = br.readLine().split(" ");
		int n = Integer.parseInt(strAry[0]);
		int m = Integer.parseInt(strAry[1]);
		int l = Integer.parseInt(strAry[2]);
		int[][] a = new int[n][m];
		int[][] b = new int[m][l];
		for (int i = 0; i < n; i++) {
			String[] matrixA = br.readLine().split(" ");
			for (int j = 0; j < m; j++) {
				a[i][j] = Integer.parseInt(matrixA[j]);
			}
		}
		for (int i = 0; i < m; i++) {
			String[] matrixB = br.readLine().split(" ");
			for (int j = 0; j < l; j++) {
				b[i][j] = Integer.parseInt(matrixB[j]);
			}
		}
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < l; j++) {
				long c = 0;
				for (int k = 0; k < m; k++) {
					c += a[i][k] * b[k][j];
				}
				if (j == l - 1) System.out.print(c);
				else System.out.print(c + " ");
			}
			System.out.println();
		}
	}
}

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

int main()
{
    int H, W;
    cin >> H >> W;
    string s[H];

    for (int i = 0; i < H; i++) {
        cin >> s[i];
    }

    for (int i = 0; i < W + 2; i++) {
        cout << "#";
    }
    cout << endl;

    for (int i = 0; i < H; i++) {
        cout << "#" << s[i] << "#" << endl;
    }

    for (int i = 0; i < W + 2; i++) {
        cout << "#";
    }
    cout << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define mod2 998244353 
#define PI 3.14159265
#define ll long long
#define ld long double
#define pi pair<ll,ll>
#define pb push_back
#define vi vector<ll>
#define sz size()
#define fi first
#define se second
#define lz length()
#define all(x) (x).begin(),(x).end()
#define scf(x) scanf("%lld",&x)
#define rep(i,n) for(ll i=0;i<n;i++)
const int INF = (int)1e9;
const ll IINF=1LL<<62;
const int maxn=10000005;
//int divr[maxn];
/**/
/*void divisor()
{for(int i=2;i<sqrt(maxn);i++)
     {
          if(!divr[i])
          {
               for(int j=i*i;j<maxn;j+=i)if(!divr[j])divr[j]=i;     
          }
     }
     for(int i=1;i<maxn;i++)if(!divr[i])divr[i]=i;
}*/
 
/*const int N=1000005;
ll n;
struct line {
    long long m, c;
    long long eval(long long x) { return m * x + c; }
    long double intersectX(line l) { return (long double) (c - l.c) / (l.m - m); }
};
vector<pair<pi,ll>> rect;
deque<line> dq;
*/
ll modexpo(ll a,ll b)
{
     ll res=1LL;
     while(b>0)
     {
          if(b&1)res=(res*a)%mod;
          a=(a*a)%mod;
          b>>=1;
     }
     return res;
}














string s;
int n;
ll ans=0;
void calc(ll x,ll y)
{
     if(x==n+1){
          ans+=y;
          return;
     }
     ll cur=0;
     for(int i=x;i<=n;i++){
          cur=cur*10+s[i]-'0';
          calc(i+1,y+cur);
     }
}
int main()
{
    int n,k;
    cin>>n>>k;
    int a[n];
    int mx=0;
    for(int i=0;i<n;i++){cin>>a[i];mx=max(mx,a[i]);}
    int g=0;
    for(int i=0;i<n;i++)g=__gcd(g,a[i]);
    if(k%g==0&&mx>=k)cout<<"POSSIBLE";
    else cout<<"IMPOSSIBLE";

}



















 
 
 
 
 

 
 
 
 
 
 
 
 
 
 
 
 
 



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

#define rep(i, n) for(int i = 0; i < n; ++i)
#define rep2(i, a, b) for(int i = a; i <= b; ++i)
#define ll long long
#define eb emplace_back
#define all(c) (c).begin(), (c).end()
#define vi vector<int>
#define N 500010
#define MOD 998244353 //1000000007
#define pll pair<ll,ll>


int main() {
	int k;
	ll n, nn;
	ll x, y, z;
	ll s, ans;
	vector<ll>r(2);
	vector<ll>m(2);
	vector<ll>a;
	cin >> n;
	n *= 2;
	nn = n;
	x = 2;
	while ((x*x) <= n) {
		if (n%x == 0) {
			y = 1;
			while (n%x == 0) {
				y *= x;
				n /= x;
			}
			a.eb(y);
		}
		x++;
	}
	if (n > 1)a.eb(n);
	int sz = a.size();
	k = 1;
	rep(i, sz)k *= 2;
	r[0] = 0;
	ans = nn - 1;
	rep(i, k) {
		x = 1;
		y = 1;
		z = i;
		rep(j, sz) {
			if (z % 2 == 1)x *= a[j];
			else y *= a[j];
            z/=2;
		}
		m[0] = x;
		m[1] = y;
		r[1] = y - 1;
		s = crt(r, m).first;
		if (s == 0)s = nn;
		ans = min(ans, s);
	}
	cout << ans << endl;

}


Measured memory_bytes: 3668
#include<iostream>
#include<queue>
using namespace std;
int M[101][101];
int n;
int d[101];

int search(int s){
    queue<int> Q;
    int u;

    Q.push(s);
    d[s]=0;

    while( !Q.empty() ){
	u=Q.front(); Q.pop();

	for(int i=1;i<=n;i++){
	    if(M[u][i]==0) continue;
	    if(d[i]>0) continue;
    
	    d[i]=d[u]+1;
	    Q.push(i);
	}

    }
}
    
int main(){
    int u,k,v;

    cin >> n;
    for(int i=0;i<n;i++){
	cin >> u >> k;
	for(int j=0;j<k;j++){
	    cin >> v;
	    M[u][v]=1;
	}
    }

    search(1);

    cout << 1 << " " << 0 << endl;
    for(int i=2;i<=n;i++){
	if(d[i]==0) cout << i << " " << -1 << endl;
	else cout << i << " " << d[i] << endl;
    }

    return 0;
}

Measured memory_bytes: 3112
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  
  vector<tuple<string,int,int>> arr;
  tuple<string,int,int>p;
  
  string x;
  int y,z;
  for(int i=0;i<N;i++){
    cin >> x;
    cin >> y;
    arr.push_back(make_tuple(x,-y,i+1));
  }

  sort(arr.begin(),arr.end());
  int num;
                  
  for(tuple<string,int,int>t:arr){
    tie(ignore,ignore,num) = t;
    cout << num << endl;
  }
}


Measured memory_bytes: 256
S = input()

compass = list(S)
vertical = []
width = []
if "N" in compass:
    vertical.append(1)
if "S" in compass:
    vertical.append(-1)
if "W" in compass:
    width.append(1)
if "E" in compass:
    width.append(-1)

if sum(vertical) == 0 and sum(width) == 0:
    print("Yes")
else:
    print("No")

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

#define pb push_back
#define mk make_pair
#define lob lower_bound
#define upb upper_bound
#define fst first
#define scd second

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

inline int read(){
	int f=1,x=0;char ch=getchar();
	while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
	while(isdigit(ch)){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
inline ll readll(){
	ll f=1,x=0;char ch=getchar();
	while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
	while(isdigit(ch)){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}

const int MAXN=2e5+5;
struct node{
	int id,val;
	bool ty;//0->A,1->B
}a[MAXN];
bool cmp(node a,node b){return a.val<b.val;}
int n,cnt[4],ty[MAXN],sum[MAXN];
ll pre[MAXN];
int main() {
	n=read();
	for(int i=1,t=0;i<=n;++i){
		a[++t].id=i,a[t].val=read(),a[t].ty=0;
		a[++t].id=i,a[t].val=read(),a[t].ty=1;
	}
	sort(a+1,a+n*2+1,cmp);
	for(int i=1;i<=n*2;++i)pre[i]=pre[i-1]+a[i].val;
	for(int i=1;i<=n;++i){
		if(!a[i].ty)ty[a[i].id]|=1;
		else ty[a[i].id]|=2;
		sum[a[i].id]+=a[i].val;
	}
	for(int i=1;i<=n;++i)cnt[ty[i]]++;
	assert(cnt[3]==cnt[0]);
	if(cnt[0]||!cnt[1]||!cnt[2]){
		ll ans=0;
		for(int i=1;i<=n;++i)ans+=a[i].val;
		cout<<ans<<endl;
		return 0;
	}
	ll ans=1e18;
	for(int i=n+1;i<=n*2;++i){
		if(!a[i].ty)ty[a[i].id]|=1;
		else ty[a[i].id]|=2;
		if(ty[a[i].id]==3){
			ll tmp=a[i].val;
			if(sum[a[i].id]){
				if(a[n].id!=a[i].id)tmp+=pre[n-1];
				else tmp+=pre[n]-a[n-1].val;
			}else{
				tmp+=pre[n-2];
			}
			ans=min(ans,tmp);
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 5632
var n,i,j,a,b,tot1,tot2,left:longint;
    v:array[0..57] of int64;
	ans:real;
	sum,anss:int64;
procedure qsort(lx,rx:longint);
var i,j:longint;
    m,t:int64;
begin
  i:=lx;j:=rx;m:=v[random(rx-lx+1)+lx];
  repeat
    while (v[i]>m) do inc(i);
	while (v[j]<m) do dec(j);
	if (i<=j) then
	begin
	  t:=v[i];v[i]:=v[j];v[j]:=t;
	  inc(i);dec(j);
	end;
  until (i>j);
  if (i<rx) then qsort(i,rx);
  if (j>lx) then qsort(lx,j);
end;
function gcd(a,b:longint):longint;
begin
  if (b=0) then exit(a);
  exit(gcd(b,a mod b));
end;
function calc(i,j:longint):int64;
var ans:int64;
  t:array[0..100] of longint;
  ii,jj,tt,g:longint;
begin
  for ii:=1 to j do
	t[ii]:=i-j+ii;
  for ii:=1 to j do
  begin
    tt:=ii;
    for jj:=1 to j do
	begin
	  g:=gcd(t[jj],tt);
	  tt:=tt div g;
	  t[jj]:=t[jj] div g;
	end;
  end;
  ans:=1;
  for ii:=1 to j do
	ans:=int64(ans*t[ii]);
  exit(ans);
end;
begin
  randomize;
  readln(n,a,b);
  for i:=1 to n do
	read(v[i]);
  qsort(1,n);
  sum:=0;
  for i:=1 to a do
	sum:=sum+v[i];
  ans:=sum/a;
  writeln(ans:0:6);
  tot1:=0;tot2:=0;
  for i:=1 to n do
	if (v[i]=v[a]) then inc(tot1);
  left:=1;
  while (left<=n) and (v[left]<>v[a]) do inc(left);
  dec(left);
  a:=a-left;b:=b-left;
  anss:=0;
if (left=0) then
begin
  for i:=a to b do
    anss:=anss+calc(tot1,i);
end else anss:=calc(tot1,a);
  writeln(anss);
end.
  

Measured memory_bytes: 128
#include<bits/stdc++.h>
#define ll long long 
using namespace std;
string s[200005];
int main()
{
	int n,num=1;
	cin>>n;
	for(int i=0;i<n;++i)
	{
	cin>>s[i];	
	}
	sort(s,s+n);
	for(int i=1;i<n;++i)
	{
		if(s[i-1]!=s[i])
		 num++;
	}cout<<num;
}

Measured memory_bytes: 9908
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <vector>
#include <climits>

typedef long long ll;

using namespace std;

int gcd(int x, int y){
    if(x < y){
        int temp = x;
        x = y;
        y = temp;
    }
    while(y > 0){
        int r = x % y;
        x = y;
        y = r;
    }
    return x;
}

void solve(){
    int x, y;
    cin >> x >> y;
    cout << gcd(x, y) << endl;
}

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

Measured memory_bytes: 3068
#include <bits/stdc++.h>
#define ll long long
#define MODV 1000000007
#define INF INT_MAX // 2147483647
#define INFLL LLONG_MAX // 9223372036854775807
#define rep(i, n) for(ll i=0, i##_len=(ll)(n); i<i##_len; i++)
#define repf(i, n) for(ll i=1, i##_len=(ll)(n+1); i<i##_len; i++)
#define per(i, n) for(ll i=((ll)(n))-1; i>=0; i--)
#define perf(i, n) for(ll i=((ll)(n)); i>0; i--)
#define all(v) v.begin(), v.end()
#define endl "\n"
#define vi vector<ll>
#define vvi vector<vector<ll>>
#define Yes() cout << "Yes" << endl
#define YES() cout << "YES" << endl
#define No() cout << "No" << endl
#define NO() cout << "NO" << endl
#define Init() std::ios::sync_with_stdio(false); std::cin.tie(0); std::cout<<fixed<<setprecision(15);
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; }
using namespace std;

int main(){
    Init();
    ll n; cin >> n;
    cout << "ABC" << setfill('0') << setw(3) << n << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
#include <functional>
#include <cctype>

using namespace std;

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

int main()
{
	int n;
	cin >> n;
	vector<int> S(n);
	REP(i, n) {
		cin >> S[i];
	}
	int q;
	cin >> q;
	vector<int> T(q);
	REP(i, q) {
		cin >> T[i];
	}
	int c = 0;
	sort(S.begin(), S.end());
	sort(T.begin(), T.end());
	REP(i, q) {
		if( binary_search(S.begin(), S.end(), T[i])) {
			++c;
		}
	}

	cout << c << endl;

	return 0;
}

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

int main() {
    const double eps = 1e-6;
    int A, B; cin >> A >> B;
    bool ok = false;
    for (int i = 0; i <= 2000; ++i) {
        if (floor(i * 0.08 + eps) == A && floor(i * 0.1 + eps) == B) {
            cout << i <<endl;
            ok = true;
            break;
        }
    }
    if (!ok) {
        cout << -1 << endl;
    }
    return 0;
}


Measured memory_bytes: 256
def is_pos_int(num):
  if num - int(num) == 0 and int(num) >= 0: return True
  else: return False

N,Y = map(int,input().split())
Y = Y/1000
for a in range(N+1):
  b = (-9*a + Y - N)/4
  c = N - a - b
  if all([is_pos_int(b),is_pos_int(c)]):
    print(int(a), int(b), int(N - b - a))
    exit()
print('-1 -1 -1')

Measured memory_bytes: 39920
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define m0(x) memset(x,-1,sizeof(x))
const int INF = 1000000001;

int main(){
  int n;
  cin >> n;
  cout << n/3 <<endl;
}

Measured memory_bytes: 256
def resolve():
    n, w = map(int, input().split())
    goods = [list(map(int, input().split())) for _ in range(n)]
    dp = [[0] * (w + 1) for _ in range(n + 1)]

    for i in range(1, n + 1):
        for j in range(w + 1):
            tmp = dp[i - 1][j - goods[i - 1][0]] + goods[i - 1][1] if j >= goods[i - 1][0] else 0
            dp[i][j] = max(dp[i - 1][j], tmp)

    print(dp[n][w])
    
resolve()

Measured memory_bytes: 119404
#include <cstdio>

int main() {
  int c[26] = {};
  char w[101] = {};
  scanf("%s", w);
  for(int i = 0; '\0' != w[i]; i++) c[w[i] - 'a']++;
  for(int i = 0; i < 26; i++) {
    if(c[i] & 1) {
      printf("No\n");
      return 0;
    }
  }
  printf("Yes\n");
}

Measured memory_bytes: 128
# include <iostream>
#include <string>
#include <math.h>
using namespace std;

int main(){
  int a,b,c,d;
  cin >> a >>b;
  
  c = stoi(to_string(a)+to_string(b));
  d = sqrt(c);
  if(d*d == c)
    cout << "Yes";
  else
    cout <<"No";
  return 0;
}

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

int a,b;
pair<int,int> func(int x){
    //xをグリッドへと写像する
    /*
    0  1  2  3  4  ...  b-1
    2*b-1 ...      b+1  b

    xをbで割った商が偶数の時、(x/b, x%b)
    奇数の時、(x/b, (b-1)-x%b)
    */
    if((x/b)%2==0) return make_pair(x/b,x%b);
    else return make_pair(x/b, (b-1)-x%b);
}

void solve(){
    int h,w;
    cin >> h >> w;
    a=h;
    b=w;
    int n;
    cin >> n;
    int a[n+10];
    rep(i,n){
        cin >> a[i];
    }
    vector<int> p;
    rep(i,n){
        rep(j,a[i]){
            p.emplace_back(i);
        }
    }
    int c[h][w];
    rep(i,p.size()){
        int x,y;
        x=func(i).first;
        y=func(i).second;
        c[x][y]=p[i];
    }
    rep(i,h){
        rep(j,w){
            cout << c[i][j]+1 << " ";
        }
        cout << endl;
    }

}

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


Measured memory_bytes: 512
#include<iostream>
#include<vector>
#include<queue>
#include<unordered_map>
#include<map>
#include<set>
#include<unordered_set>
#include<algorithm>
#include<cmath>
#include<cassert>
#include<thread>
#include<future>
using namespace std;

#define INF 1e15+7
typedef long long ll;



int main(){
    int a,b,c,x,y;
    cin>>a>>b>>c>>x>>y;
    vector<int>ans;
    ans.push_back(a*x+b*y);
    ans.push_back(2*c*x+(max(0,y-x))*b);
    ans.push_back(2*c*y+(max(0,x-y))*a);
    ans.push_back(2*c*max(x,y));
    sort(ans.begin(),ans.end());
    cout<<ans[0]<<endl;
}


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

int main(void)
{
	int i;
	double a,b,s[1000],m,n,sum=0,suma=0;

	while(1)
	{
		scanf("%lf",&n);
		if(n==0) break;
		for(i=0;i<n;i++)
		{
			scanf("%lf",&s[i]);
			sum+=s[i];
		}
		m=sum/n;
		for(i=0;i<n;i++)
		{
			b=(s[i]-m)*(s[i]-m);
			suma+=b;
		}
		a=suma/n;
		printf("%f\n",sqrt(a));
		sum=0;
		suma=0;
	}
	return 0;
}


Measured memory_bytes: 656