akhauriyash/Code-Regression huggingface dataset:
using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using System.Text;

public class Program
{
    public void Proc()
    {
        int[] inpt = Reader.ReadLine().Split(' ').Select(a => int.Parse(a)).ToArray();

        int aCount = inpt[0];
        int bCount = inpt[1];

        int aPos = inpt[2];
        int bPos = inpt[3];


        List<int> aList = Reader.ReadLine().Split(' ').Select(a => int.Parse(a)).ToList();
        List<int> bList = Reader.ReadLine().Split(' ').Select(a => int.Parse(a)).ToList();

        aList.Add(aPos);
        bList.Add(bPos);

        aList.Sort();
        bList.Sort();

        String ans = "War";

        if(aList.Last() < bList.First()) {
            ans = "No War";
        }
        Console.WriteLine(ans);
    
    }


    public class Reader
    {
        static StringReader sr;
        public static bool IsDebug = false;
        public static string ReadLine()
        {
            if (IsDebug)
            {
                if (sr == null)
                {
                    sr = new StringReader(InputText.Trim());
                }
                return sr.ReadLine();
            }
            else
            {
                return Console.ReadLine();
            }
        }
        private static string InputText = @"



5 3 6 8
-10 3 1 5 -100
100 6 14
";
    }

    public static void Main(string[] args)
    {
#if DEBUG
        Reader.IsDebug = true;
#endif
        Program prg = new Program();
        prg.Proc();
    }
}


Measured memory_bytes: 13396
ns = map(int, raw_input().split())
ms = map(int, raw_input().split())
dic = {}
N = ns[0]
M = ms[0]

for i in xrange(N):
  h = ns[i*2+1]
  m = ns[i*2+2]
  if h not in dic:
    dic[h] = {}
  dic[h][m] = True
for i in xrange(M):
  h = ms[i*2+1]
  m = ms[i*2+2]
  if h not in dic:
    dic[h] = {}
  dic[h][m] = True

ans = ""
for k,v in sorted(dic.items()):
  for t,a in sorted(v.items()):
    h = str(k)
    m = str(t)
    if t < 10:
      m = "0" + m
    ans += h + ":" + m + " "

print ans.rstrip()

Measured memory_bytes: 6484
#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 x first
#define y second
#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 N 200005
#define rank Rank
#define index Index
int main(){
    int n;
    scanf("%d",&n);
    int a[100005];
    for(int i = 0;i<n;i++){
        scanf("%d",&a[i]);
    }
    sort(a,a+n);
    int ans=0;
    for(int i = 1;i<n-1;i++)
    ans+=abs(a[i]);
    ans+=a[n-1];
    ans-=a[0];
    printf("%d\n",ans);
    vector<int> v;
    int now=a[0];
    for(int i = 1;i<n-1;i++){
        if(a[i]>0){
            printf("%d %d\n",now,a[i]);
            now-=a[i];
        }
    }
    printf("%d %d\n",a[n-1],now);
    now=a[n-1]-now;
    for(int i = 1;i<n-1;i++){
        if(a[i]<=0){
            printf("%d %d\n",now,a[i]);
            now-=a[i];
        }
    }

    return 0;
}

Measured memory_bytes: 2304
import java.util.*;

class Main{
    final static long mod = 1000000007;
    //
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int q = sc.nextInt();
        char[] c = sc.next().toCharArray();
        int[][] range = new int[q][2];
        for(int i = 0; i < q; i++){
            range[i][0] = sc.nextInt();
            range[i][1] = sc.nextInt();
        }
        int[] frag = new int[n + 1];
        int[] rui = new int[n + 1];
        for(int i = 2; i <= n; i++){
            if(c[i - 2] == 'A' && c[i - 1] == 'C'){
                frag[i]++;
            }
            rui[i] = rui[i - 1] + frag[i];
        }
        for(int i = 0; i < q; i++){
            int left = range[i][0];
            int right = range[i][1];
            System.out.println(rui[right] - rui[left]);
        }
    }
}

Measured memory_bytes: 100356
// C++ includes used for precompiling -*- C++ -*-

// Copyright (C) 2003-2013 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library.  This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.

// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.

// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
// <http://www.gnu.org/licenses/>.

/** @file stdc++.h
 *  This is an implementation file for a precompiled header.
 */

// 17.4.1.2 Headers

// C
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
// #include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

using namespace std;
typedef long long ll;

ll a, b, c, n, k, x;
string s;

int main()
{
  cin >> a >> b;
  ll count = 0;
  for (int i = a; i <= b; i++)
  {
    if (i % 10 == i / 10000 && i / 10 % 10 == i / 1000 % 10)
    {
      count++;
    }
  }
  cout << count << endl;
}


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

const int MAXN = 1e5 + 6.66;
int arr [ MAXN ];
string player[2] = { "First","Second" };

int main ( ) {
  int n; scanf ( "%d",&n ) ;
  for ( int i = 0;i<n;i++ ) scanf ( "%d", arr + i ) ;
  int cnt[2] = { 0 , 0 };
  bool is_one = false;
  for ( int i = 0;i<n;i++ ) cnt[arr[i] % 2 ] ++,is_one |= (arr[i] == 1);
  if ( cnt[0] % 2 == 1 ) { printf ( "First\n" ); return 0; }
  bool turn = 0;
  while ( !is_one && cnt[1] == 1 )
  {
    for ( int i = 0;i<n;i++ ) if ( arr[i] % 2 ) arr[i] -- ;
    int gc = arr[0];
    for ( int i = 0;i<n;i++ ) gc = __gcd ( arr[i], gc );
    for ( int i = 0;i<n;i++ ) arr[i] /= gc;
    cnt[1] = cnt[0] = 0;
    for ( int i = 0;i<n;i++ ) cnt[arr[i] % 2 ] ++,is_one |= (arr[i] == 1);
    turn = !turn ;
  }
  if ( cnt[0] % 2 ) printf ( "%s\n", player[turn].c_str ( ) );
  else printf ( "%s\n", player[!turn].c_str ( ) );
  return 0;
}


Measured memory_bytes: 640
Imports System.Collections.Generic
Imports System.Console

Module Program
    Sub Main()
        Dim N As Integer = NextInt()
        Dim T As Integer = NextInt()
        Dim TLE As Boolean = True
        Dim cost As Integer = Integer.MaxValue

        For i As Integer = 0 To N - 1
            Dim ci As Integer = NextInt()
            Dim ti As Integer = NextInt()

            If ti <= T AndAlso ci < cost Then
                cost = ci
                TLE = False
            End If
        Next

        If TLE Then
            WriteLine("TLE")
        Else
            WriteLine(cost)
        End If
    End Sub

    Function NextInt() As Integer
        Return CInt(NextString())
    End Function

    Function NextString() As String
        Dim result As New List(Of Char)
        Do
            Dim tmp As Integer = Read()
            If tmp < 0 Then Exit Do
            Dim nextChar As Char = Chr(tmp)

            If Not Char.IsWhiteSpace(nextChar) Then
                result.Add(nextChar)
            ElseIf nextChar <> vbCr Then
                Exit Do
            End If
        Loop
        Return New String(result.ToArray())
    End Function

End Module


Measured memory_bytes: 20432
package main

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

var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Split(bufio.ScanWords)
}

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

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

func main() {
	n := nextInt()

	nn := make([]int, 10000, 10000)
	mm := map[int]int{}

	nn[0] = n
	mm[n]++

	i := 1
	for {
		var re int
		v := nn[i-1]
		if v%2 == 0 {
			nn[i] = v / 2
			re = v / 2
		} else {
			nn[i] = 3*v + 1
			re = 3*v + 1
		}

		mm[re]++
		if mm[re] > 1 {
			fmt.Println(i + 1)
			return
		}
		i++
	}
}


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

int main(){
  int x ; //x2000
  int d ;
  int r ;
  int i ;
  cin >> r >> d >> x ;
  for(i=0;i<10;i++){
    x = r*x - d ;
    cout << x  << '\n' ;
  }
  return 0 ;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
bool judge(){
    string s,t;
    cin >> s >> t;
    for(int i=0;i<s.size();i++){
        if(s[i]!=t[i])return false;
    }
    return true;
}
int main()
{   
    cout << (judge()?"Yes":"No");
    return 0;
}

Measured memory_bytes: 3596
import math
import fileinput
weight = [2**x for x in range(10)]
for line in fileinput.input():
    if line == "\n":
        break
    else:
        w = int(line)
        log = int(math.log2(w))
        w_type = []
        for i in range(log, -1, -1):
            if sum(w_type) + weight[i] <= w:
                w_type.append(weight[i])
        for i in reversed(range(len(w_type))):
            if i == 0:
                print(w_type[i])
            else:
                print(w_type[i], end=" ")

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

using namespace std;
#define rep(i, n) for (int64_t i = 0; i < n; i++)

const double PI = 3.14159265358979323846;
int main()
{
        int64_t n, m, temp;
	cin >> n >> m;
	vector<int64_t> a = vector<int64_t>(m, 0);
	rep(i, m)
	{
		cin >> a[i];
		n -= a[i];
	}
	if (n < 0)
	{
		puts("-1");
	}
	else
	{
		cout << n << endl;
	}
	return 0;
}

Measured memory_bytes: 3708
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>

using namespace std;
#define LL long long 
char d[105][105];

int main(){
    int n, m;
    int a,b,c;
    LL H, W;
    LL ans = 1e18;
    cin >> n >> m;
    vector< vector<int> > E(n);
    for(int i = 0; i < m; i++){
        cin >> a >> b;
        a--,b--;
        E[a].push_back(b);
        E[b].push_back(a);
    }
    for(int i = 0; i < n; i++){
        cout<< E[i].size() << endl;
    }  

}

Measured memory_bytes: 256
/*
*/

#pragma GCC optimize("O3")
#define _CRT_SECURE_NO_WARNINGS
#include <fstream>
#include <iostream>
#include <string>
#include <complex>
#include <math.h>
#include <set>
#include <vector>
#include <map>
#include <queue>
#include <stdio.h>
#include <stack>
#include <algorithm>
#include <list>
#include <ctime>

#include <memory.h>
#include <assert.h>

#define y0 sdkfaslhagaklsldk

#define y1 aasdfasdfasdf
#define yn askfhwqriuperikldjk
#define j1 assdgsdgasghsf
#define tm sdfjahlfasfh
#define lr asgasgash
#define norm asdfasdgasdgsd
#define have adsgagshdshfhds
#define ends asdgahhfdsfshdshfd

#define eps 1e-11
#define M_PI 3.141592653589793
#define bsize 512

#define ldouble long double
using namespace std;

#define bs 1000000007
const int N = 1300031;

int n;
int cnt_with[N];

int deg(int x)
{
	if (x%2)
		return 0;
	return deg(x/2)+1;
}

int main(){
	//freopen("tree.in","r",stdin);
	//freopen("tree.out","w",stdout);
	//freopen("input.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
	ios_base::sync_with_stdio(0);
	//cin.tie(0);

	cin>>n;
	for (int i=1;i<=n;i++)
	{
		int val;
		cin>>val;
		int x=deg(val);
		if (x>2)
			x=2;
		cnt_with[x]++;
	}

	if (cnt_with[2]+1<cnt_with[0])
	{
		cout<<"No"<<endl;
		return 0;
	}
	if (cnt_with[2]==0&&cnt_with[0]>0)
	{
		cout<<"No"<<endl;
		return 0;
	}
	if (cnt_with[2]+1==cnt_with[0]&&cnt_with[1]>0)
	{
		cout<<"No"<<endl;
		return 0;
	}

	cout<<"Yes"<<endl;

	cin.get(); cin.get();
	return 0;
}


Measured memory_bytes: 256
function Main(input) {
		input = input.split(" ");
		const num1 = parseInt(input[0], 10);
		const num2 = parseInt(input[1], 10);
		const num3 = parseInt(input[2], 10);
		console.log(num1 + num2 + num3 <= 21 ? 'win' : 'bust');
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7372
/**
*    author:  y_takano
*    created: 23.06.2020 09:53:14
**/

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

#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--)

using namespace std;

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

    int n, tmp;
    vector<int> v;
    double ave, a2;

    for (;;)
    {
        cin >> n;

        if (n == 0)
        {
            break;
        }

        ave = a2 = 0.0;
        v.clear();

        REP(i, n)
        {
            cin >> tmp;
            v.push_back(tmp);
            ave += tmp;
        }

        ave /= v.size();

        REP(i, n)
        {
            a2 += pow(v[i] - ave, 2);
        }

        printf("%.8lf\n", sqrt(a2/n));
    }

    return 0;
}


Measured memory_bytes: 3204
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author mikit
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        ANewYear solver = new ANewYear();
        solver.solve(1, in, out);
        out.close();
    }

    static class ANewYear {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            out.println(48 - in.nextInt());
        }

    }
}



Measured memory_bytes: 21588
// #pragma GCC target("avx")  // CPU 処理並列化
// #pragma GCC optimize("O3")  // CPU 処理並列化
// #pragma GCC optimize("unroll-loops")  // 条件処理の呼び出しを減らす
// #define BEGIN_STACK_EXTEND(size) void * stack_extend_memory_ = malloc(size);void * stack_extend_origin_memory_;char * stack_extend_dummy_memory_ = (char*)alloca((1+(int)(((long long)stack_extend_memory_)&127))*16);*stack_extend_dummy_memory_ = 0;asm volatile("mov %%rsp, %%rbx\nmov %%rax, %%rsp":"=b"(stack_extend_origin_memory_):"a"((char*)stack_extend_memory_+(size)-1024));
// #define END_STACK_EXTEND asm volatile("mov %%rax, %%rsp"::"a"(stack_extend_origin_memory_));free(stack_extend_memory_);

#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<stack>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
#include<numeric>
#include<unordered_set>
#include<unordered_map>
#include<complex>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const double EPS=1e-11;
const double INF=1e+10;
const double PI=acos(-1.0);
const int C_SIZE = 11100000;
const int UF_SIZE = 3100000;
namespace{
	long long fact[C_SIZE];
	long long finv[C_SIZE];
	long long inv[C_SIZE];
	inline long long Comb(int a,int b){
	 	if(a<b||b<0)return 0;
	 	return fact[a]*finv[b]%mod*finv[a-b]%mod;
	}
	void init_C(int n){
		fact[0]=finv[0]=inv[1]=1;
		for(int i=2;i<n;i++){
			inv[i]=(mod-(mod/i)*inv[mod%i]%mod)%mod;
		}
		for(int i=1;i<n;i++){
			fact[i]=fact[i-1]*i%mod;
			finv[i]=finv[i-1]*inv[i]%mod;
		}
	}
	long long pw(long long a,long long b){
		if(a<0LL)return 0;
		if(b<0LL)return 0;
		long long ret=1;
		while(b){
			if(b%2)ret=ret*a%mod;
			a=a*a%mod;
			b/=2;
		}
		return ret;
	}
	long long pw_mod(long long a,long long b,long long M){
		if(a<0LL)return 0;
		if(b<0LL)return 0;
		long long ret=1;
		while(b){
			if(b%2)ret=ret*a%M;
			a=a*a%M;
			b/=2;
		}
		return ret;
	}
	int pw_mod_int(int a,int b,int M){
		if(a<0)return 0;
		if(b<0)return 0;
		int ret=1;
		while(b){
			if(b%2)ret=(long long)ret*a%M;
			a=(long long)a*a%M;
			b/=2;
		}
		return ret;
	}
	int ABS(int a){return max(a,-a);}
	long long ABS(long long a){return max(a,-a);}
	double ABS(double a){return max(a,-a);}
	int sig(double r) { return (r < -EPS) ? -1 : (r > +EPS) ? +1 : 0; }
	int UF[UF_SIZE];
	void init_UF(int n){
		for(int i=0;i<n;i++)UF[i]=-1;
	}
	int FIND(int a){
		if(UF[a]<0)return a;
		return UF[a]=FIND(UF[a]);
	}
	void UNION(int a,int b){
		a=FIND(a);b=FIND(b);if(a==b)return;
		if(UF[a]>UF[b])swap(a,b);
		UF[a]+=UF[b];UF[b]=a;
	}
}
// ここから編集しろ
int A;
int T;
int W;
int R;
char in[20];
int main(){
	int a;scanf("%d",&a);
	while(a--){
		scanf("%s",in);
		if(in[0]=='A')A++;
		if(in[0]=='W')W++;
		if(in[0]=='T')T++;
		if(in[0]=='R')R++;
		
	}
	printf("AC x %d\n",A);
	printf("WA x %d\n",W);
	printf("TLE x %d\n",T);
	printf("RE x %d\n",R);
	
}

Measured memory_bytes: 1704
s = input().split('/')
if int(s[0]) > 2019 :
    print("TBD")
elif int(s[0]) < 2019:
    print("Heisei")
else:
    # Year Equal
    if int(s[1]) > 4:
        print("TBD")
    elif int(s[1]) < 4:
        print("Heisei")
    else:
        if int(s[2]) <= 30:
            print("Heisei")
        else:
            print("TBD")            


Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
#define fastIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long int
#define fi first
#define se second
#define pub push_back
#define pi pair<int,int>
#define all(v) (v).begin(), (v).end()
#define rep(i, l, r) for(int i=(int)(l);i<(int)(r);i++)
#define repd(i, l, r) for (int i=(int)(l);i>=(int)(r);i--)
#define clrg(i, l, r) for(int i=(int)(l);i<(int)(r);i++)vis[i]=0,v[i].clear();
int power(int x, unsigned int y){int res = 1;while (y > 0){ if (y & 1){res = res*x;} y = y>>1;x = x*x;}return res;}
int powermod(int x, unsigned int y, int p){int res = 1;x = x % p;while (y > 0){if (y & 1){res = (res*x) % p;}y = y>>1; x = (x*x) % p;}return res;}
#define print2d(mat,n,m){for(int i=0;i<(int)(n);i++){for(int j=0;j<(m);j++){cout<<mat[i][j]<<" ";}cout<< endl;}}
#define clr(a,x) memset(a,x,sizeof(a))
#define rr(v) for(auto &val:v)
#define print(v) for (const auto itr : v){cout<<itr<<' ';}cout<<"\n";
#define ln length()
#define sz size()
#define mod 1000000007
#define elif else if
vector<int> topsort,vis(100005),v[100005],v1[100005];
   int dp[100005+1];
void dfs(int node,int c){
  vis[node]=1;
    rr(v[node]){
      if(!vis[val]){
        dfs(val,c+1);
      }
    }
    topsort.push_back(node);
}
int32_t main(){
   int n; cin>>n;
   int m; cin>>m;
  topsort.pub(0);
    clr(dp,0);
  rep(i,0,m){
    int a,b; cin>>a>>b;
    v[a].pub(b);
    v1[b].pub(a);
  }
  rep(i,1,n+1)if(!vis[i])dfs(i,0);
  int ans=0;
  reverse(topsort.begin()+1,topsort.end());
  rep(i,1,topsort.sz){
      rr(v[topsort[i]]){
        dp[val]=max(dp[val],dp[topsort[i]]+1);
      }
  }
  rep(i,0,n+1)ans=max(ans,dp[i]);
  cout<<ans<<"\n";
   return 0;
}
/*
Edge cases? n=1? a[i]<=0?
long vs int? 1LL? 64bits?
Re-read problem. Is it as easy as it seems?
KEEP CORRECTING AND SUBMITTING!
*/


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

int main(){
  int n;
  cin>>n;
  if(n%2==0) cout<<n<<endl;
  else cout<<2*n<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <unordered_map>
#include <ctime>
#include <list>
#include <numeric>
#include <utility>
#include <ctime>
#define INF 1000000000
#define LINF 9000000000000000000
#define mod 1000000007
 
#define rep(i,n) for(int i=0;i<int(n);i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define REP(i,a,b) for(int i=(a);i<int(b);i++)
#define all(x) (x).begin(),x.end()
#define pb push_back
#define mp make_pair
#define MOD(x) (x%(mod))
 
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int,int> pi;

int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
bool debug=false;
 
/*---------------------------------------------------*/

int main(){
    int n, a;
    cin >> n >> a;
    n %= 500;
    if(n <= a)cout << "Yes" <<endl;
    else cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }

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

  ll n, a, b;
  cin >> n >> a >> b;
  ll ans = b * (n - 2) - a * (n - 2) + 1;
  cout << max(0LL, ans) << endl;
}


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

const int MOD = 1000000007;
const int INF = 1e9;

//long long
using ll = long long;

//出力系
#define print(x) cout << x << endl
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
 
// begin() end()
#define all(x) (x).begin(),(x).end()

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

//最大公約数 
unsigned gcd(unsigned a, unsigned b) {
  if(a < b) return gcd(b, a);
  unsigned r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
} 

int main(){
int H, W;
cin >> H >> W;

vector<string>C(H);
REP(i, H) cin >> C.at(i);

REP(i, H){
  print(C.at(i));
  print(C.at(i));
}


}

Measured memory_bytes: 256
/*
    ٭٭UWW٭٭OWO٭٭
    Auto-generated by VS Code's Code Snippet
    «I'm just a starter-coder»
    ▶zyck2002◀
    ٭٭UWW٭٭OWO٭٭
*/

// Includes
#include <bits/stdc++.h>
using namespace std;

#define fup(i,l,h) for (int i = l; i < h; i++)

// Debug tool, f = open input file, D = debug mode
// #define f
// #define debug

// Main function
int main()
{
    #ifdef f
    freopen("129a.inp","r",stdin);
    #endif
    int p, q, r;
    cin >> p >> q >> r;
    int mx = max<int>(max<int>(p, q), r);
    cout << (p + q + r - mx);
}

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

using namespace std;

bool solve(int cpy[]) {
    int c[10] = {};
    bool flag = false;

    for (int i = 1; i <= 9; i++)
        c[i] = cpy[i];

    for (int i = 0; i < 10; i++) {
        for (int j = 1; j <= 9; j++) {
            if (!c[j]) continue;
            if (c[j] == 3) {
                bool only_three = true;
                for (int k = 1; k <= 9; k++)
                    if (c[k] != 0 && c[k] != 3) only_three = false;

                if (only_three) return true;

                c[j] = 0;
                break;
            } else {
                if (j + 2 <= 9 && c[j + 1] >= 1 && c[j + 2] >= 1)
                    c[j]--, c[j + 1]--, c[j + 2]--;
                else if (c[j] == 4)
                    c[j] -= 3;
                else
                    return false;
                break;
            }
        }
    }

    for (int i = 1; i <= 9; i++)
        if (c[i]) return false;

    return true;
}

int main() {
    string s;

    while (cin >> s) {
        int cnt[10] = {};
        for (int i = 0; i < s.size(); i++)
            cnt[s[i] - '0']++;
        
        bool flag = false;
        for (int i = 1; i <= 9; i++) {
            int cpy[10];

            for (int j = 0; j < 10; j++)
                cpy[j] = cnt[j];
            cpy[i]++;
            if (cpy[i] > 4) continue;

            for (int j = 1; j <= 9; j++) {
                if (cpy[j] < 2) continue;
                
                cpy[j] -= 2;
                if (solve(cpy)) {
                    if (flag) cout << " ";
                    cout << i;
                    flag = true;
                    break;
                }
                cpy[j] += 2;
            }
        }
        if (!flag) cout << "0";
        cout << endl;
    }

    return 0;
}


Measured memory_bytes: 3172
using System;
using System.Collections.Generic;

namespace ABC091B
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            string[] b = new string[N]; 
            int[] c = new int[N]; 
            for(int i =0;i<N;i++){
                b[i] = Console.ReadLine();
                c[i] = 1;
            }
            int M = int.Parse(Console.ReadLine());
            string[] r = new string[M]; 
            for(int i =0;i<M;i++){
                r[i] = Console.ReadLine();
            }
            for(int i =0;i<N;i++){
                for(int j=i+1;j<N;j++){
                    if( b[i] == b[j] && c[i] > 0) {
                        c[i]++;
                        c[j]--;
                    }
                }
            }
            int count = 0;
            for(int i =0;i<N;i++){
                int tmp_count = c[i];
                for(int j =0;j<M;j++){
                    if(b[i] == r[j]) tmp_count--;
                }
                if(count < tmp_count  ) count = tmp_count;
            }
            Console.WriteLine(count);
        }
    }
}


Measured memory_bytes: 13140
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<numeric>
#include<stack>
#include<map>
#include<queue>
#include<unordered_map>
#include<cmath>
#include<utility>

#include<ctime>
#include<random>

using ULL = unsigned long long;
using LL = long long;
using String = std::string;
using Ints = std::vector<int>;
using Doubles = std::vector<double>;
using Bools = std::vector<bool>;
using Strings = std::vector<std::string>;
using ULLs = std::vector<ULL>;
using LLs = std::vector<LL>;

// pythonのdictionary相当
template <typename T1, typename T2>
using Dict = std::unordered_map<T1,T2>;



int culc(Ints &r, std::vector<Ints> &s, Ints &c){
    int res = 0;
    Ints last(26, 0);

    for(int i=0;i<(int)r.size();i++){
        last[r[i]-1] = i+1;
        for(int j=0;j<26;j++){
            if(r[i]-1==j) res+=s[i][j];
            else res-=c[i]*(i+1-last[j]);
        }
    }

    return res;
}

int main(void) {
    int t = std::clock();

    int D;
    std::cin >> D;
    Ints c;
    std::vector<Ints> s(D, Ints(26, 0));

    for(int i=0;i<26;i++){
        int _c;
        std::cin >> _c;
        c.push_back(_c);
    }

    for(int i=0;i<D;i++){
        for(int j=0;j<26;j++){
            int _s;
            std::cin >> _s;
            s[i][j] = _s;
        }
    }

    Ints res(D, 1);
    std::vector<Ints> ss = s;
    Ints cnt(D, 0);

    for(int i=0;i<D;i++){
        std::sort(ss[i].begin(), ss[i].end());
        auto itr = std::find(s[i].begin(), s[i].end(), ss[i].front());
        size_t index = std::distance(s[i].begin(), itr);
        res[i] = (int)index + 1;
    }

    LL nowp = culc(res, s, c);

    std::random_device rnd;
    std::mt19937 mt(rnd());
    while(static_cast<int>((double)(std::clock() - t) / CLOCKS_PER_SEC * 1000.0) < 1940){
        int max_day = 0;
        int max_day_p = 0;
        int max_day_idx = 0;
        int max_day_con = 0;
        for(int i=0;i<D;i++){
            int contest = std::min(std::max(static_cast<int>(cnt[i] + (mt() % 2 == 0 ? 1 : -1) * (mt() % 2 + 1)), 0), 25);
            auto itr = std::find(s[i].begin(), s[i].end(), ss[i][contest]);
            int index = (int)std::distance(s[i].begin(), itr);

            Ints res_tmp = res;
            res_tmp[i] = index + 1;
            LL tmpp = culc(res_tmp, s, c);
            if(max_day_p < tmpp){
                max_day_p = tmpp;
                max_day = i;
                max_day_idx = contest;
                max_day_con = index;
            }
        }

        if(nowp < max_day_p){
            cnt[max_day] = max_day_idx;
            res[max_day] = max_day_con + 1;
            nowp = max_day_p;
        }
    }

    for(auto r : res) std::cout << r << std::endl;

    return 0;
}

Measured memory_bytes: 3772
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#ifndef LIB_REPEAT_HPP
#define LIB_REPEAT_HPP
#define repeat(i,n) for (int i = 0; i < (n); ++i)
#define repeat_from(i,m,n) for (int i = (m); i < (n); ++i)
#define repeat_one(i,n) for (int i = 1; i <= (n); ++i)
#define repeat_rev(i,n) for (int i = (n)-1; 0 <= i; --i)
#define foreach(it, cont) for (decltype(cont.begin()) it = cont.begin(); it != cont.end(); ++it)
#endif
#ifndef LIB_TYPEDEF_LL_HPP
#define LIB_TYPEDEF_LL_HPP
typedef long long ll;
typedef unsigned long long ull;
#endif
using namespace std;
typedef unsigned int uint;
struct edge_t { int to, cost; };
struct state_t { int pos; uint used; double time; };
bool operator >= (const state_t & a, const state_t & b) { return a.time >= b.time; }
int main() {
    ios_base::sync_with_stdio(false);
    while (true) {
        int N, M, P, A, B; cin >> N >> M >> P >> A >> B;
        if (N == 0 and M == 0 and P == 0 and A == 0 and B == 0) break;
        --A; --B;
        vector<int> ticket(N); repeat (i,N) cin >> ticket[i];
        vector<vector<edge_t> > town(M); repeat (i,P) {
            int x, y, z; cin >> x >> y >> z; --x; --y;
            town[x].push_back((edge_t) { y, z });
            town[y].push_back((edge_t) { x, z });
        }
        priority_queue<state_t, vector<state_t>, greater_equal<state_t> > que;
        que.push((state_t) { A, 0, 0 });
        set<pair<int,uint> > visited;
        while (not que.empty()) {
            const state_t s = que.top(); que.pop();
            if (visited.count(make_pair(s.pos,s.used))) continue;
            visited.insert(make_pair(s.pos,s.used));
            if (s.pos == B) {
                cout << s.time << endl;
                goto next;
            }
            for (auto e : town[s.pos]) {
                repeat (n,N) if (not (s.used & (1<<n))) {
                    state_t t = s;
                    t.used |= (1<<n);
                    t.pos = e.to;
                    t.time += e.cost /(double) ticket[n];
                    que.push(t);
                }
            }
        }
        cout << "Impossible" << endl;
next: ;
    }
    return 0;
}

Measured memory_bytes: 16732
<?php
  $s = trim(fgets(STDIN));
  $t = trim(fgets(STDIN));
  for($i=0; $i<strlen($s); $i++){
    if($s == $t){
      echo "Yes\n";
      exit;
    }
    $back = substr($t,-1);
    $t = rtrim($t,$back);
    $t = $back.$t;
  }
  echo "No\n";

Measured memory_bytes: 4604
#include<bits/stdc++.h>
using namespace   std;
#define ff        first
#define ss        second
#define ll        long long
#define int        long long
#define inf       ((ll)1e18)
#define double    long double
#define ull       unsigned long long
#define mod       1000000007
#define vi        vector<ll>
#define ppi       pair<ll,pair<ll,ll>>
#define pb        push_back
#define mp        make_pair
#define str       string
#define pi        2*acos(0.0)
#define pr(a,x,n) for(int i=x;i<n;i++){cout<<a[i]<<" ";}
#define p(a)      cout<<a;
#define sp(x,y)   fixed<<setprecision(y)<<x
#define w(x)      ll x; cin>>x; while(x--)
#define all(v)    v.begin(), v.end()
#define test      cout<<"THIS_AND_THIS"<<endl;
void kehsihba(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	/*#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif*/
}
void solve(){
	ll n;cin>>n;
	ll arr[n];
	for(int i=0;i<n;i++){
		cin>>arr[i];
	}
	int mx=*max_element(arr,arr+n);
	ll ans[mx+1]={0};
	ll vis[mx+1]={0};
	for(int i=0;i<n;i++){
		if(vis[arr[i]]==0){
			for(int j=2*arr[i];j<=mx;j+=arr[i]){
				ans[j]+=1;
			}
			vis[arr[i]]=1;
		}
		else{
			for(int j=arr[i];j<=mx;j+=arr[i]){
				ans[j]+=1;
			}
		}
	}
	ll answer=0;
	for(int i=0;i<n;i++){
		if(ans[arr[i]]==0){
			answer+=1;
		}
	}
	cout<<answer;
}
int32_t main(){
	kehsihba();
	ll t=1;
	//cin>>t;
	while(t--){
		solve();
	}
}




Measured memory_bytes: 20828
#include<iostream>
#include<string>
#include<vector>
using namespace std;
int h,w,k;

int check(int i, int j, vector<string> c){
    int check = 0;

    for(int l=0; l<h;l++){
        for(int m=0;m<w;m++){
            if(i &(1<<l)){
                c[l][m] = '$';
            }
            if(j&(1<<m)){
                c[l][m] = '$';
            }
        }
    }
    int black=0;
    for(int l=0;l<h;l++){
        for(int m=0;m<w;m++){
            if(c[l][m] == '#'){
                black++;
            }
        }
    }
    if (black==k)check++;

    return check;
}

int main(){
    
    cin >> h >> w >> k;
    vector<string> c(h);
    for(int i=0;i<h;i++){
        cin >> c[i];
    }
    int black=0;
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            if(c[i][j] == '#'){
                black++;
            }
        }
    }
    if(black < k){cout<<0<<endl;return 0;}

    int h_ex=1, w_ex=1;
    for(int i=0;i<h;i++){
        h_ex *= 2;
    }
    for(int i=0;i<w;i++){
        w_ex *= 2;
    }

    int ans = 0;

    for(int i=0;i<h_ex; i++){
        for(int j=0;j<w_ex; j++){
            // todo;
            int tmp = check(i, j, c);
            ans += tmp;
        }
    }
    cout << ans << endl;
    return 0;
}

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

#define fi first
#define se second
#define vi vector<int>
#define vpi vector<pair<int,int>>
#define vll vector<ll>
#define vpll vector<pair<ll,ll>>
#define endl '\n'

#define si(v) int(v.size())
#define all(v) v.begin(), v.end()
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rep2(i, n, m) for (ll i = n; i <= (m); ++i)
#define rep3(i, n, m) for (ll i = n; i >= (m); --i)

template<class T, class U> void chmax(T &a, U b) { if (a < b) a = b; }
template<class T, class U> void chmin(T &a, U b) { if (b < a) a = b; }

using ll = long long;
using ld = long double;
using namespace std;

constexpr ll MOD = 1000000007;

signed main()
{
  cout << fixed << setprecision(20);
  ios::sync_with_stdio(false);
  cin.tie(0);
  
  int a, b; cin >> a >> b;

  if (a < b) swap(a, b);
  else if (a == b) {
    cout << 2 * a << endl;
    return (0);
  }

  cout << a + a - 1 << endl;
  
  return (0);
}

Measured memory_bytes: 3636
#include <cstdio>
#include <functional>
#include <algorithm>
#include <vector>
#include <limits>
#include <numeric>
#include <type_traits>
#include <iostream>
#include <queue>
#include <math.h>
#include <bits/stdc++.h>
#include <queue>
#include <map>

using namespace std;

#define INF (1ll<<60)
#define INFint (1<<30)
#define MOD 1000000007
#define BOUND 27182818284

typedef long long ll;
typedef long long int lli;
typedef pair<ll,ll> P;

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

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

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

// gcd
template<typename T>
T gcd(T a, T b){
    if(a==0)
        return b;
    return gcd(b%a,a);
}

// gcd array
int findGCD(int arr[], int n){
    int result = arr[0];
    for (int i=1; i < n; i++)
        result = gcd(arr[i], result);
    return result;
}

template<typename T>
T lcm( T m, T n ){
    // 引数に0がある場合は0を返す
    if ( ( 0 == m ) || ( 0 == n ) )
        return 0;
    return ((m/gcd(m, n)) * n); // lcm = m * n / gcd(m,n)
}

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    fill( (T*)array, (T*)(array+N), val );
}


int dx[5]={1,0,-1,0};
int dy[5]={0,1,0,-1};
// v.front() = -BOUND;
// v.back() = BOUND;
bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            // 素数ではない
            return false;
        }
    }
    // 素数である
    return true;
}

int d[2000400];
int main() {
    int N,K;
    cin >> N >> K;
    string S;
    cin >> S;

    Fill(d, 0);

    int dst=0;
    int re=0;
    if(S[0]=='1'){
        re=1;
    }else if(S[0]=='0'){
        re=2;
    }

    char pre='Z';
    rep(i,N){
       if(pre!=S[i]){
           dst++;
           d[dst]++;
           pre=S[i];
       } else{
           d[dst]++;
       }
    }

    int sum=0;
    if(re==1) {
        for (int i = 1; i <= 2 * K + 1; i++) {
            sum+=d[i];
        }
        int temp=sum;
        for(int i=2; i<=N; i+=2){
            temp = temp-d[i]-d[i-1]+d[2*K+i]+d[2*K+i+1];
            // sum=max(sum,sum-d[i]-d[i-1]+d[2*K+i]+d[2*K+i+1]);
            sum=max(sum,temp);
        }
    }else if(re==2){
        int temp=0;
        for (int i = 1; i <= 2 * K; i++) {
            sum+=d[i];
        }

        temp=sum;
        for(int i=1; i<=N; i+=2){
            temp=temp-d[i]-d[i-1]+d[2*K+i]+d[2*K+i+1];
            // sum=max(sum,sum-d[i]-d[i-1]+d[2*K+i]+d[2*K+i+1]);
            sum=max(sum,temp);
        }
    }

    cout << sum << endl;
    return 0;
}


Measured memory_bytes: 8320
def permutation_oddness(n: int, k: int)->int:
    MOD = 10**9 + 7
    MAX_K = n*n//2

    if k > MAX_K or k % 2 == 1:
        return 0

    dp = [[[0] * (MAX_K+1) for _ in range(n+1)] for _ in range(n+1)]
    dp[0][0][0] = 1
    for i in range(n):
        for j in range(n+1):
            for odd in range(0, MAX_K+1, 2):
                if odd < 2*j:
                    continue

                dp[i+1][j][odd] = (2*j+1) * dp[i][j][odd-2*j] % MOD
                if j+1 <= n:
                    dp[i+1][j][odd] += (j+1)*(j+1)*dp[i][j+1][odd-2*j] % MOD
                if j-1 >= 0:
                    dp[i+1][j][odd] += dp[i][j-1][odd-2*j] % MOD
                dp[i+1][j][odd] %= MOD

    return dp[n][0][k]


if __name__ == "__main__":
    n, k = map(int, input().split())
    ans = permutation_oddness(n, k)
    print(ans)


Measured memory_bytes: 66780
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#include <numeric>
typedef long long Int;
#define rep(i,a,b) for(Int i=a;i<b;++i)
#define rrep(i,a,b) for(Int i=a;i>=b;--i)
using namespace std;

struct UnionFind {
    vector<int> parent;

    UnionFind(int n) : parent(n, -1) {}
    void Init(int n) { parent.assign(n, -1); }

    int Root(int x) {
        if (parent[x] < 0) return x;
        else return parent[x] = Root(parent[x]);
    }

    bool IsSame(int x, int y) {
        return Root(x) == Root(y);
    }

    bool Merge(int x, int y) {
        x = Root(x); y = Root(y);
        if (x == y) return false;
        if (parent[x] > parent[y]) swap(x, y);
        parent[x] += parent[y];
        parent[y] = x;
        return true;
    }

    int Size(int x) {
        return -parent[Root(x)];
    }
};

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

    Int N; cin >> N;
    vector<Int> x(N), y(N);
    rep(i, 0, N) cin >> x[i] >> y[i];
    const Int MAX = 110000;

    UnionFind uf(MAX*2);

    rep(i, 0, N) {
        uf.Merge(x[i], y[i]+MAX);
    }

    map<Int, Int> mx, my;
    rep(i, 0, MAX) {
        mx[uf.Root(i)]++;
    }
    rep(i, MAX, 2*MAX) {
        my[uf.Root(i)]++;
    }

    Int res = 0;
    rep(i, 0, 2*MAX) {
        res += mx[i] * my[i];
    }

    cout << res - N << endl;
}

Measured memory_bytes: 30208
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
template<class T> using vc = vector<T>;
template<class T> using vvc = vector<vector<T>>;

#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repr(i, n) for (ll i = (n)-1; i >= 0; i--)
#define repe(i, l, r) for (ll i = (l); i < (r); i++)
#define reper(i, l, r) for (ll i = (r)-1; i >= (l); i--)
#define repa(i,n) for (auto& i: n)

template<class T> inline bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> inline bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
void init() {cin.tie(0);ios::sync_with_stdio(false);cout << fixed << setprecision(15);}

#ifdef DEBUG
template <class T, class N> void verr(const T& a, const N& n) { rep(i, n) cerr << a[i] << " "; cerr << "\n" << flush; }
ll dbgt = 1; void err() { cerr << "passed " << dbgt++ << "\n" << flush; }
template<class H, class... T> void err(H&& h,T&&... t){ cerr<< h << (sizeof...(t)?" ":"\n") << flush; if(sizeof...(t)>0) err(forward<T>(t)...); }
#endif

const ll INF = 5e18;
const ld EPS = 1e-11;
const ld PI = acos(-1.0L);
const ll MOD = 1e9 + 7;
// const ll MOD = 998244353;
//--------------------------------------------------------------------------------//

int main() {
    init();
    ll N, A, B;
    cin >> N >> A >> B;

    vl P(N);
    rep(i, N) cin >> P[i];
    sort(all(P));
    ll ac = 0, bc = 0;
    rep(i,N){
        if(P[i]<=A){
            ac++, bc++;
        }
        else if(P[i]<=B)
            bc++;
    }

    cout << min(min(ac, (bc - ac)), N - bc) << endl;

}

Measured memory_bytes: 256
import sys
import math
import string
import fractions
import random
from operator import itemgetter
import itertools
from collections import deque
import copy
import heapq
import bisect

MOD = 10 ** 9 + 7
INF = float('inf')
input = lambda: sys.stdin.readline().strip()

K = int(input())
s = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(s[K-1])

Measured memory_bytes: 6824
l='abcdefghijklmnopqrstuvwxyz'
L='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
s=''
t=list(input().split())
for i in range(3):
    for j in range(26):
        if t[i][0]==l[j]:s+=L[j]
        else:pass
print(s)

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

public class Main {
  Scanner sc;

  int MAX = 1000000;

  void run() {
    for ( ;; ) {
      int e = ni();
      if ( e == 0 ) {
        break;
      }

      int min = 1 << 28;
      for(int z = 0; z * z * z <= e; ++z) {
        for(int y = 0; y * y <= e - z * z * z; ++y) {
          int x = e - z*z*z - y*y;
          if ( x + y * y + z * z * z == e ) {
            min = Math.min( min, x + y + z );
          }
        }
      }

      System.out.println( min );
    }
  }

  Main() {
    sc = new Scanner( System.in );
  }

  int ni() {
    return sc.nextInt();
  }

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

  void debug(Object... os) {
    System.err.println( Arrays.deepToString( os ) );
  }

}

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

int main(){
    int N;
    bool jdg = true;
    cin >> N;
    vector<long long> A(N);
    for (int i = 0; i < N; i++) {
        cin >> A[i];
        if (i < A[i]) {
            jdg = false;
        }
    }
    
    for (int i = 1; i < N; i++) {
        if (A[i - 1] + 1 < A[i]) {
            jdg = false;
        }
    }
  
    long long cnt = 0;
    for (int i = 1; i < N; i++) {
        if (A[i] == A[i - 1] + 1) {
            cnt++;
        } else {
            cnt += A[i];
        }
    }
    
    cout << ((jdg) ? cnt : -1) << endl;
    return 0;
}

Measured memory_bytes: 1920
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define INF 1e9
#define PI 3.14159265359
#define MOD 1000000007
#define ALL(v) v.begin(),v.end()
typedef long long ll;
int pow10(int n){
  if(n<1){
    return 0;
  }
  if(n==1){
    return 10; 
  }
  return pow10(n-1)*10;
}
int main() {
  int n,m;
  cin >> n >> m;
  vector<int> s(m);
  vector<int> c(m);
  rep(i,m){
    cin >> s.at(i) >> c.at(i);
  }
  int ans=-1;
  for(int i=pow10(n-1); i<pow10(n); i++){
   bool a=true;
   string str=to_string(i);

   rep(j,m){
     a=a&&(str.at(s.at(j)-1)-'0'==c.at(j));
   }
   if(a){
     ans=i;
     break;
   }
  }

  cout << ans << endl;
}


Measured memory_bytes: 384
main = getContents >>= putStr.formatOut.map calc.formatIn

-- ??\????????´??¢??¨
formatIn :: String -> [(Int, String, Int)]
formatIn =map ((\(x:y:z:_) -> (f x, y, f z)).words).takeWhile (notElem '?').lines
  where f = read :: String -> Int

-- ????????¨??´??¢??¨
formatOut :: [Int] -> String
formatOut = unlines.map show

-- ?¨??????¨
calc :: (Int, String, Int) -> Int
calc (x,y,z) = (f y) x z
  where f "+" = (+)
        f "-" = (-)
        f "*" = (*)
        f "/" = div

Measured memory_bytes: 3944
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<string>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
ll nibu[100005]={0};
bool used[100005]={false};
ll ans[100005]={0},nans[100005]={0};
ll lb[100005]={0},rb[100005]={0};
vector<ll> node[100005];
void dfs(ll pos,ll num){
  nibu[pos]=num;
  used[pos]=true;
  num++;
  num%=2;

  for(int i=0;i<node[pos].size();i++){
    ll to=node[pos][i];
    if(!used[to]){
      used[to]=true;
      dfs(to,num);
    }
  }
}
void efs(ll pos){
  used[pos]=true;
  for(int i=0;i<node[pos].size();i++){
    ll to=node[pos][i];
    if(!used[to]){
      used[to]=true;
      efs(to);
      lb[pos]=max(lb[pos],lb[to]-1);
      rb[pos]=min(rb[pos],rb[to]+1);
    }
  }
}
void ffs(ll pos,ll val){
  nans[pos]=val;
  used[pos]=true;
  ll v1=val-1,v2=val+1;
  for(int i=0;i<node[pos].size();i++){
    ll to=node[pos][i];
    if(used[to]) continue;
    used[to]=true;
    if(ans[to]!=-1){
      ffs(to,ans[to]);
    }
    else{
      if(lb[to]<=v1&&v1<=rb[to]) ffs(to,v1);
      else ffs(to,v2);
    }
  }
}
int main(){
  ll n;
  cin>>n;
  for(int i=1;i<n;i++){
    ll s,t;
    cin>>s>>t;
    node[s].push_back(t);
    node[t].push_back(s);
  }
  for(int i=1;i<=n;i++){
    used[i]=false;
    ans[i]=-1;
  }
  ll k;
  cin>>k;
  ll v1,p1;
  cin>>v1>>p1;
  ans[v1]=p1;
  dfs(v1,p1%2);
  bool f=true;
  for(int i=2;i<=k;i++){
    ll v,p;
    cin>>v>>p;
    ans[v]=p;
    if(p%2!=nibu[v]) f=false;
  }
  if(!f){
    cout<<"No"<<endl;
    return 0;
  }
  for(int i=1;i<=n;i++){
    used[i]=false;
    if(ans[i]!=-1){
      lb[i]=ans[i];
      rb[i]=ans[i];
    }
    else{
      lb[i]=-17441744174417;
      rb[i]=17441744174417;
    }
  }
  efs(1);
  for(int i=1;i<=n;i++){
    if(lb[i]>rb[i]){
      cout<<"No"<<endl;
      return 0;
    }
  }
  cout<<"Yes"<<endl;
  nans[1]=lb[1];
  for(int i=1;i<=n;i++) used[i]=false;
  ffs(1,nans[1]);
  for(int i=1;i<=n;i++) cout<<nans[i]<<endl;
}


Measured memory_bytes: 15104