akhauriyash/Code-Regression huggingface dataset:
package main

import (
	"bufio"
	"fmt"
	"io"
	"math"
	"os"
	"strconv"
	"strings"

)

func main() {
	solve(os.Stdin, os.Stdout)
}

type ReaderEx struct {
	baseScanner *bufio.Scanner
	words       []string
	nextWordIdx func() int
	initWordIdx func()
}

func NewScannerEx(stdin io.Reader) *ReaderEx {
	var this ReaderEx
	var idx int
	this.baseScanner = bufio.NewScanner(stdin)
	this.baseScanner.Buffer(make([]byte, 0), 1E+11)
	this.nextWordIdx = func() int {
		cur := idx
		idx++
		return cur
	}
	this.initWordIdx = func() {
		idx = 0
	}
	return &this
}

func (me *ReaderEx) ScanAndSplit() (isScanned bool) {
	isScanned = me.baseScanner.Scan()

	me.words = strings.Fields(me.baseScanner.Text())
	me.initWordIdx()
	return
}

func (me *ReaderEx) Scan() (ok bool) {
	ok = me.baseScanner.Scan()
	return
}
func (me *ReaderEx) getString() string {
	return me.baseScanner.Text()
}

func (me *ReaderEx) getInt() int {
	n, err := strconv.Atoi(me.baseScanner.Text())
	defer func() {
		if err != nil {
			panic(err)
		}
	}()

	return n
}

func (me *ReaderEx) nextBytes() []byte {
	return []byte(me.words[me.nextWordIdx()])
}
func (me *ReaderEx) nextString() string {
	return me.words[me.nextWordIdx()]
}

type StringArray []string

func (me *ReaderEx) nextStringArray() StringArray {
	return me.words[me.nextWordIdx():]
}

func (me StringArray) toStrings() []string {
	return me
}

func (me StringArray) toInts() []int {
	strValues := me.toStrings()
	values := make([]int, len(strValues))
	for i, v := range strValues {
		n, err := strconv.Atoi(v)
		if err != nil {
			panic(err)
		}
		values[i] = n
	}
	return values
}
func (me *ReaderEx) nextInt() int {
	n, err := strconv.Atoi(me.words[me.nextWordIdx()])

	defer func() {
		if err != nil {
			panic(fmt.Sprintf("getInt(%d)", n))
		}
	}()
	return n
}

func pow(x, y, mod int) (ans int) {

	ans = 1
	for bit := 1 << uint(math.Floor(math.Log2(float64(y)))); ; bit >>= 1 {
		if y&bit != 0 {
			ans *= x
			if mod > 0 {
				ans %= mod
			}
		}
		if bit <= 1 {
			return
		}
		ans *= ans
		if mod > 0 {
			ans %= mod
		}
	}
}

type factType struct {
	prime int
	count int
}

func fact(n int) (facts []factType) {

	for i := 2; i*i <= n; i++ {
		if n%i == 0 {
			fa := factType{prime: i}
			for n%fa.prime == 0 {
				n /= fa.prime
				fa.count++
			}
			facts = append(facts, fa)
		}
	}
	if n > 1 {
		facts = append(facts, factType{prime: n, count: 1})
	}
	return facts
}
func dec2bin(n int) (ret []bool) {
	for bit := 1 << uint(math.Floor(math.Log2(float64(n)))); ; bit >>= 1 {
		ret = append(ret, n&bit != 0)

		if bit <= 1 {
			return
		}
	}

}

func abs(v int) int {
	if v < 0 {
		v = -v
	}
	return v
}

func solve(stdin io.Reader, stdout io.Writer) {
	r := NewScannerEx(stdin)
	r.Scan()
	r.getInt()
	r.ScanAndSplit()
	a := r.nextStringArray().toInts()

	dp := make([]int, 10E+5+1)
	for _, value := range a {
		w := value - 1
		if w < 0 {
			w = 0
		}
		dp[w]++
		dp[value+2]--
	}

	m := -1
	w := 0
	for _, v := range dp {
		w += v

		if w > m {
			m = w
		}
	}

	fmt.Fprintln(stdout, m)

}



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

using namespace std;

void solve(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int n;
    cin >> n;

    cout << 0 << endl;
    string respondse;
    cin >> respondse;

    if (respondse == "Vacant") return;

    int l = 1;
    int r = n - 1;

    while (l <= r) {
        int mid = (l + r) / 2;
        cout << mid << endl;

        string sex;
        cin >> sex;
        if (sex == "Vacant") return;

        if ((mid % 2 == 1 && sex != respondse) || (mid % 2 == 0 && sex == respondse)) l = mid + 1;
        else r = mid - 1;
    }

    cout << l << endl;
    cin >> respondse;
    return;
}

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


Measured memory_bytes: 852
import java.util.Scanner;
public class Main{
  public static void main(String[]args){

    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    int m;

    if(b>=1 && b<=a && a<=20 && 1<=c && c<=20){
      m = c-(a-b);
      if(m>=0){
        System.out.println(m);
      }else{
        System.out.println(0);
      }
    }
  }
}


Measured memory_bytes: 23636
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <cmath>
#include <vector>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include<functional>
using  namespace std;
typedef long long ll;
#define sc(x) scanf("%d",&x)
#define pd(x) printf("%d\n",x)
const int INF=1e9+10;
const int MOD=1e9+7;
const double eps=1e-5;
const double pi=acos(-1.0);
const int N=2e5+5;
ll p,a[N],sum[N],s[N];
int n;
int lowbit(int i)
{
    return i&(-i);
}
void update(int i)
{
    while(i<=n)
    {
        sum[i]+=1;
        i+=lowbit(i);
    }
}
ll get_sum(ll i)
{
    ll ans=0;
    while(i)
    {
        ans+=sum[i];
        i-=lowbit(i);
    }
    return ans;
}
int main()
{
    scanf("%d%lld",&n,&p);
    memset(sum,0,sizeof(sum));
    ll ans=0;
    a[0]=0;
    s[0]=0;
    for(int i=1; i<=n; i++)
    {
        scanf("%lld",&a[i]);
        a[i]-=p;
        a[i]+=a[i-1];
        s[i-1]=a[i];
    }
    n++;
    sort(s,s+n);
    int k=unique(s,s+n)-s;
    for(int i=n; i>=1; i--) a[i]=a[i-1];
    for(int i=1; i<=n; i++) a[i]=(lower_bound(s,s+k,a[i])-s)+1;
//        for(int i=1;i<=n;i++)
//            printf("i=%d a[i]=%lld\n",i,a[i]);
    for(int i=1; i<=n; i++)
    {
        update(a[i]);
        ll tmp=get_sum(a[i]);
//        printf("i==%d a[i]==%lld tmp==%lld  ans==%lld\n",i,a[i],tmp,i-tmp);
        ans+=tmp-1;
    }
    printf("%lld\n",ans);
    return 0;
}





Measured memory_bytes: 4992
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
using P = pair<int,int>;
const int MOD = 1000000007;

int main() {
    int r,g,ans;
    cin>>r>>g;
    ans=2*g-r;
    cout<<ans<<endl;
}


Measured memory_bytes: 256
H,W = map(int,input().split())
S = [list(input()) for i in range(H)]

for i in range(H):
  for j in range(W):
    ans  = 0
    if S[i][j] == "#":
      continue
    else:
      if j != 0 and S[i][j-1] =="#":
        ans += 1
      if j != 0 and i != 0 and S[i-1][j-1] == "#":
          ans += 1
      if j != 0 and i != H-1 and S[i+1][j-1] == "#":
          ans += 1
      if j != W-1 and S[i][j+1] =="#":
        ans += 1
      if j != W-1 and i != 0 and S[i-1][j+1] == "#":
          ans += 1
      if j != W-1 and i != H-1 and S[i+1][j+1] == "#":
          ans += 1
      if i != 0 and S[i-1][j] == "#":
        ans += 1
      if i != H-1 and S[i+1][j] == "#":
        ans += 1
      S[i][j] = str(ans)
      ans = 0 
for i in range(H):
	print("".join(S[i]))

Measured memory_bytes: 39920
#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>

using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7;

const int nmax = 8;
bool graph[nmax][nmax];

int N, M;

int dfs(int v, bool visited[nmax]) {
  bool all_visited = true;
  for (int i = 0; i < N; i++) {
    if (visited[i] == false) {
      all_visited = false;
    }
  }
  if (all_visited) {
    return 1;
  }
  
  int ret = 0;
  for (int i = 0; i < N; i++) {
    if (graph[v][i] == false) {
      continue;
    }
    if (visited[i]) {
      continue;
    }
    visited[i] = true;
    ret += dfs(i, visited);
    visited[i] = false;
  }
  return ret;
}

int main(int argc, const char * argv[]) {
  cin >> N >> M;

  for(int i = 0; i < M; i++) {
    int A, B;
    cin >> A >> B;
    graph[A - 1][B - 1] = graph[B - 1][A - 1] = true;
  }

  bool visited[nmax];
  for (int i = 0; i < N; i++) {
    visited[i] = false;
  }
  
  visited[0] = true;
  cout << dfs(0, visited) << endl;
  return 0;
}


Measured memory_bytes: 256
//#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, K, S;
	cin >> N >> K >> S;

	rep(i, 0, K)
	{
		cout << S << " ";
	}
	rep(i, K, N)
	{
		if (S == 1000000000)
		{
			cout << S - 1 << " ";
		}
		else
		{
			cout << S + 1 << " ";
		}
	}
	cout << endl;

	return 0;
}

Measured memory_bytes: 1280
#Pythonのままだときびしい？
#100*100*200*100
n=int(input())
x=[-1]*n
y=[-1]*n
h=[-1]*n
for i in range(n):
  x[i],y[i],h[i]=map(int,input().split())

mh=max(h)
for cx in range(0,101):
  for cy in range(0,101):
    for H in range(mh,mh+216):
      if all(h[j]==max(H-abs(cx-x[j])-abs(cy-y[j]),0) for j in range(n)):
        print(cx,cy,H)
        exit()


Measured memory_bytes: 76200
n = int(input())
a = list(map(int, input().split()))
count = 0
flag = False
while True:
    for x in range(n):
        if a[x] % 2 == 1:
            flag = True
        a[x] = a[x]//2
    if flag:
        break
    count += 1
print(count)

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

int main() {
	string s;
	int k;
	cin >> s >> k;

	int i = 0;
	int ans = 1;
	while (i < k) {
		if (s.at(i) - '0' == 1) {
			i++;
		} else {
			ans = s.at(i) - '0';
			break;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <cmath>
#include <cstring>
#include <ctime>
#include <unordered_map>
#include <iomanip>
#include <complex>
#include <cassert>
using namespace std;

#define fi first
#define se second
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define deb(a) cerr<< #a << "= " << (a)<<"\n";

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef long double ld;
typedef complex<double> base;
typedef vector<int> vi;
typedef pair<int,int> pii;

template<class T> ostream& operator<<(ostream& stream, const vector<T> v){ stream << "[ "; for (int i=0; i<(int)v.size(); i++) stream << v[i] << " "; stream << "]"; return stream; }
ll fpow(ll x, ll p, ll m){ll r=1; for (;p;p>>=1){ if (p&1) r=r*x%m; x=x*x%m; } return r;}
int gcd(int a, int b){ if (!b) return a; return gcd(b,a%b);}
ll gcd(ll a, ll b){ if (!b) return a; return gcd(b,a%b);}

ll N,Z,W,a[2010],dp[2010][2010][2];

ll v(int x, int p){
    if (x>0) return a[x];
    else if (p==1) return Z;
    else return W;
}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cin >> N >> Z >> W;

    int i,j,k;
    for (i=1; i<=N; i++)
        cin >> a[i];

    for (i=0; i<=N; i++)
        for (k=0; k<2; k++){
            dp[i][N][k]=abs(v(i,1)-v(N,2));
            dp[N][i][k]=abs(v(N,1)-v(i,2));
        }

    for (i=N-1; i>=0; i--)
        for (j=0; j<=i; j++){
            dp[i][j][0]=max(dp[i+1][j][0],dp[i+1][j][1]);
            dp[i][j][1]=min(dp[i][i+1][1],dp[i][i+1][0]);

            dp[j][i][0]=max(dp[i+1][i][0],dp[i+1][i][1]);
            dp[j][i][1]=min(dp[j][i+1][1],dp[j][i+1][0]);
        }

    cout << dp[0][0][0] << "\n";
	return 0;
}


Measured memory_bytes: 63104
/** 
 * Dont raise your voice, improve your argument.
 * --Desmond Tutu
 */

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

#define DEBUG
#ifndef DEBUG
#define endl "\n"
#endif

const double PI=3.1415926535897932384626433;
typedef long long ll;
#define fori(n) for(ll i=0; i<(n); i++)

#define cins(s) string s; cin>>s;
#define cini(i) int i; cin>>i;
#define cinll(l) ll l; cin>>l;
#define cind(d) double d; cin>>d;
#define cinai(a, n) vi a(n); fori(n) { cin>>a[i]; }
#define cinall(a, n) vll a(n); fori(n) { cin>>a[i]; }
#define cinas(s, n) vs s(n); fori(n) { cin>>s[i]; }

typedef pair<int, int> pii;
typedef pair<double,double> pdd;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<string> vs;
typedef vector<ll> vll;

int main() {
cin.tie(nullptr);
std::ios::sync_with_stdio(false);
    cini(a);
    cini(b);
    if(max(a,b)>9)
        cout<<-1<<endl;
    else
        cout<<a*b<<endl;

}



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

using namespace std;

int main(){
    string S;
    cin >> S;
    for(int i=0;i<S.size();i++){
        if(S[i]=='7'){
            cout << "Yes" << endl;
            return 0;
        }
    }

    cout << "No" << endl;
}

Measured memory_bytes: 3628
#include<bits/stdc++.h>
#define int long long
using namespace std;
const int INF = 1e10;
const int ZERO = 0;

signed main() {
    string S;
    cin >> S;
    int K;
    cin >> K;
  	bool s = true;
  	for(int i = 0;i < S.size() - 1;i++) {
      	if(S.at(i) != S.at(i + 1)) {
          	s = false;
        }
    }
  	if(S.size() == 1) {
      	cout << K / 2 << endl;
    }
  	else if(s == true) {
      	cout << S.size() * K / 2 << endl;
    }
  	else {
    	bool cnt = false;
    	int count = 1;
    	int A = 0;
    	int B = 0;
    	for(int i = 0;i < S.size() - 1;i++) {
    	    if(S.at(i) != S.at(i + 1) && cnt == true) {
    	        A += count / 2;
    	      	count = 1;
    	      	cnt = false;
    	    }
    	    if(S.at(i) == S.at(i + 1)) {
    	        cnt = true;
    	        count++;
    	    }
    	}
  		if(cnt == true) {
    	    A += count / 2;
    	  	cnt = false;
    	}
  		S = S + S;
  		count = 1;
  		for(int i = 0;i < S.size() - 1;i++) {
    	    if(S.at(i) != S.at(i + 1) && cnt == true) {
    	        B += count / 2;
    	      	count = 1;
    	      	cnt = false;
    	    }
    	    if(S.at(i) == S.at(i + 1)) {
    	        cnt = true;
    	        count++;
    	    }
    	}
    	if(cnt == true) {
    	    B += count / 2;
    	}
  		B = B - A;
  		cout << A + B * (K - 1) << endl;
    }
}		

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define ll long long int
#define ull unsigned long long
#define si set <ll>
#define vi vector <ll>
#define popcount(x) __builtin_popcountll(x)
#define mii map <ll,ll>
#define vpi vector <pair <ll,ll> >
#define sz(c) (ll)c.size()
#define fr first
#define fastio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define sc second
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define mem0(a) memset(a,0,sizeof(a))
#define rep(i,a,n) for(ll i=a ; i<n ; i++)
#define ld long double
#define rall(a) (a).rbegin(),(a).rend()
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")

ll power(ll b,ll e,ll m)
{
  if(b==0) return 0;
  if(e==0) return 1;
  if(e&1) return b*power(b*b%m,e/2,m)%m;
  return power(b*b%m,e/2,m);
}
ll power( ll b, ll e)
{
  if(b==0) return 0;
  if(e==0) return 1;
  if(e&1) return b*power(b*b,e/2);
  return power(b*b,e/2);
}  
bool isPowerOfTwo(ll x)
{
    // x will check if x == 0 and !(x & (x - 1)) will check if x is a power of 2 or not
    return (x && !(x & (x - 1)));
}

ll computeXOR(ll n)  
{ 
    // Modulus operator are expensive 
    // on most of the computers. 
    // n & 3 will be equivalent to n % 4 
    // n % 4 
    switch (n & 3) { 
  
    // If n is a multiple of 4 
    case 0: 
        return n; 
  
    // If n % 4 gives remainder 1 
    case 1: 
        return 1; 
  
    // If n % 4 gives remainder 2 
    case 2: 
        return n + 1; 
  
    // If n % 4 gives remainder 3 
    case 3: 
        return 0; 
    } 
} 

void solve()
{
  ll l,r;
  cin>>l>>r;
  cout<<(computeXOR(r)^computeXOR(l-1));
}

int main()
{
    ll tt=1;
    // cin>>tt;
    while(tt--)
    {
        solve();
        cout<<"\n";
    }
}

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

int main() {
    int N;
    string S;

    cin >> N;
    cin >> S;

    int lt = 0;
    int rt = 0;

    for(int i=1; i<N; i++) {
        if(S[i] == 'E')
            rt++;
    }

    int min = lt + rt;
    for(int i = 1; i < N; i++) {
        if(S[i-1] == 'W') {
            lt++;
        }
        if(S[i] == 'E') {
            rt--;
        }
        int t = lt + rt;
        if(min > t)
            min = t;
    }

    cout << min << endl;

}

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

string baseNeg2(ll n) {
		int base = -2;
		if (n == 0)
				return "0";
		string converted = "";
		while (n != 0) {
				int remainder = n % base;
				n /= base;
				if (remainder < 0) {
						remainder += (-base);
						n += 1;
				}
				converted = to_string(remainder) + converted;
		}
		return converted;
}

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

	ll x;
	cin>>x;
	cout<<baseNeg2(x)<<endl;

	return 0;
}


Measured memory_bytes: 256
# coding: utf-8
# Your code here!

W = input()
n = 0
while True :
    T = input()
    if T== "END_OF_TEXT" :
        break
    small_T = list(T.split())
    for i in range(len(small_T)) :
        if str.lower(small_T[i]) == str.lower(W) :
            n += 1
print(n)


Measured memory_bytes: 5560
using System;

namespace abc057
{
    public class Program
    {
        public static void Main(string[] args)
        {
            string str = Console.ReadLine();

            string[] arr = str.Split(' ');

            int a = Convert.ToInt32(arr[0]);
            int b = Convert.ToInt32(arr[1]);

            if ((a + b) == 24)
            {
                Console.WriteLine(0);
            }
            else if ((a + b) > 24 )
            {
                Console.WriteLine((a + b) - 24);
            }
            else
            {
                Console.WriteLine(a + b);
            }
        }
    }
}


Measured memory_bytes: 11220
/*
    B - 1 Dimensional World's Tale
    https://atcoder.jp/contests/abc110/tasks/abc110_b
*/
#include <bits/stdc++.h>
using namespace std;

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

    int n, m, x, y;
    cin >> n >> m >> x >> y;

    int x_max = -101;
    int y_min = 101;

    for (int i = 0; i < n; i++) {
        int input;
        cin >> input;
        x_max = max(x_max, input);
    }

    for (int i = 0; i < m; i++) {
        int input;
        cin >> input;
        y_min = min(input, y_min);
    }

    // x_N < Z <= y_M
    if (max(x_max, x) < min(y_min, y)) {
        cout << "No War" << endl;
    } else {
        cout << "War" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define all(v) v.begin(), v.end()
int main(){
  ll N, M; cin >> N >> M;
  ll ans;
  if(N != 1 && M != 1){
    ans = (N-2)*(M-2);
  } else if(N == 1 && M == 1){
    ans = 1;
  } else {
    ans = max(N, M)-2;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3640
#include<bits/stdc++.h>
#define mod 1000000007
using namespace std;
int dy[4]={1,0,-1,0};
int dx[4]={0,1,0,-1};
vector<vector<int>> graph;

int main(void){
   int N;
   cin>>N;
   vector<long long> X(N),L(N);
   for(int i=0;i<N;i++){
      cin>>X[i]>>L[i];
   }
   vector<pair<long long,long long>> range(N);
   for(int i=0;i<N;i++){
      range[i]=make_pair(X[i]+L[i],X[i]-L[i]);
   }
   sort(range.begin(),range.end());
   int ans=0;
   long long now=-1000000007;
   for(int i=0;i<N;i++){
      if(range[i].second>=now){
         ans++;
         now=range[i].first;
      }
   }
   cout<<ans<<endl;
   return 0;
}

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

int main() {
  int n, k;
  cin >> n >> k;
  vector<int> hs(n);
  rep(i, n) {
    cin >> hs[i];
  }
  sort(hs.begin(), hs.end());
  ll ans = 0;
  for(int i = n-1; 0 <= i; i--) {
    if(0 < k) {
      k--;
      continue;
    }
    ans += hs[i];
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 1024
import numpy as np

n,k = map(int, input().split())

ans = np.zeros(n)

for i in range(n):
    ans[i] = 1.0

for i in range(n):
    tmp = i+1
    while(tmp < k):
        ans[i]*=0.5
        tmp*=2


print(np.sum(ans)/n)

Measured memory_bytes: 13240
n,m = map(int,input().split())
d_s_list = []
for i in range(m):
  d_s = list(map(int,input().split()))
  d_s_p = d_s[1:]
  d_s_list.append(d_s_p)
check_list = list(map(int,input().split()))
s_case = []
for i in range(2**n):
  s = [0 for i in range(n)]
  for j in range(n):
     if ((i >> j) & 1):
        s[j] = 1
  s_case.append(s)
  
ok_list = []
for case in s_case:
  frug = True
  for d_s in range(m):
    checker = 0
    for i in d_s_list[d_s]:
      checker  +=  case[i - 1] 
    if checker % 2 != check_list[d_s]:
      frug = False
  if frug == True:
    ok_list.append(case)
    
print(len(ok_list))     
    

Measured memory_bytes: 3188
#include<bits/stdc++.h>
#define mod 1000000009
#define int long long
#define garou ios_base::sync_with_stdio(false); cin.tie(NULL);
using namespace std;
int pow(int p,int r){
	int ans=1;
	while(r>0){
     if(r&1){
		 ans=((ans%mod)*(p%mod))%mod;
	 }
	 r=r>>1;
     p=((p%mod)*(p%mod))%mod;
	}
}
int vis[100001];
void bfs(vector<vector<int>> g,int i,int n){
queue<int> q;
q.push(0);
memset(vis,-1,sizeof(vis));
while(!q.empty()){
	int a=q.front();
q.pop();
for(int k:g[a]){
	if(vis[k]==-1){
	q.push(k);
	vis[k]=a;
	}
}}
}
signed main() {
	garou;
	 int n,m;
	 cin>>n>>m;
	 vector<vector<int>> g(n,vector<int>());
for(int i=0;i<m;i++){
int a,b;
cin>>a>>b;
g[a-1].push_back(b-1);
g[b-1].push_back(a-1);
}
bfs(g,0,n);
for(int i=1;i<n;i++)
if(vis[i]==-1){
	cout<<"No";
	return 0;
}
cout<<"Yes"<<'\n';
for(int i=1;i<n;i++)
cout<<vis[i]+1<<'\n';
}

Measured memory_bytes: 19400
program name
    implicit none
    integer(4):: n,i,maxh, li, ans
    integer(4),allocatable:: h(:)

    read*, n
    allocate(h(n))
    read*, h(:)

    maxh = maxval(h)
    ans = 0
    do while(maxh > 0)

        do i=1,n
            if (h(i) == maxh) then
                li = i
                exit
            end if
        end do

        do i=1,n
            if (h(i) == maxh) then
                if (li+1 /= i) ans=ans+1
                li = i
                h(i) = h(i) - 1
            end if
        end do
        maxh = maxval(h)
    end do

    print*, ans
end program name

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

int main() {
  string S;
  cin >> S;
  int counter = 0;
  rep(i, S.length()) {
    string s = S.substr(i, S.length());
    int tmp_counter = 0;
    for (const auto& t : s)
      if (t == 'A' || t == 'C' || t == 'T' || t == 'G')
        ++tmp_counter;
      else
        break;
    if (tmp_counter > counter) counter = tmp_counter;
  }
  cout << counter << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const long long INF = 1000000000;

int main(){
  ll n,d,a; cin >> n >> d >> a;
  vector<ll> X,H;
  X.resize(n);H.resize(n);
  for(ll i=0; i<n; i++){
    cin >> X[i] >> H[i];
  }
  vector<ll> ids(n);
  for (ll i = 0; i < n; ++i) ids[i] = i;
  sort(ids.begin(), ids.end(), [&](ll i, ll j) {return X[i] < X[j];});
  vector<ll> nX(n), nH(n);
  for (ll i = 0; i < n; ++i) nX[i] = X[ids[i]], nH[i] = H[ids[i]];
  X = nX, H = nH;
  for(ll i=0; i<n; i++){
    H.at(i) = (H.at(i)+a-1)/a;
  } 
  ll ans = 0;
  ll S = 0;
  vector<ll> atend(n+1, 0);
  //cout << "hoge" << endl;
  for(ll i=0; i<n; i++){
    //cout << S << ' ' << H.at(i) << endl;
    S -= atend[i];
    //cout << S << endl;
    if(S<H.at(i)){
      ll At = H.at(i) - S;
      //cout << At << endl;
      ans += At;
      S += At;
      ll right = X.at(i) + 2*d;
      ll id = upper_bound(X.begin(), X.end(), right) - X.begin();
      //cout << id << endl;
      atend.at(id) += At;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 9600
import java.util.*;
public class Main {
    public static void main(String[] args) throws Exception {
        String[] lines = getStdin();
        String str = lines[0];
        String[] str1 = str.split(" ");
        long a = Long.parseLong(str1[0]);
        long b = Long.parseLong(str1[1]);
        long d;
        long r;
        double f;
        d = a / b;
        r = a % b;
        f = (double) a / (double) b;
        System.out.printf("%d %d %.9f",d,r,f);
    }
  private static String[] getStdin() {
    Scanner scanner = new Scanner(System.in);
    ArrayList<String> lines = new ArrayList<>();
    while (scanner.hasNext()) {
      lines.add(scanner.nextLine());
    }
    return lines.toArray(new String[lines.size()]);
  }
}



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

typedef struct point{
  double x;
  double y;
} P;

void kock(int, P, P);

int main(){
  int n;
  P a,b;

  scanf("%d",&n);

  a.x = 0;
  a.y = 0;
  b.x = 100;
  b.y = 0;
  
  kock(n,a,b);
  printf("%.8f %.8f\n",b.x,b.y);

  return 0;
}

void kock(int n, P c, P d){
  P s,t,u;
  double r = M_PI / 3.0;

  if(n == 0){
    printf("%.8f %.8f\n",c.x,c.y);
    return;
  }

  s.x = (2.0 * c.x + 1.0 * d.x) / 3.0;
  s.y = (2.0 * c.y + 1.0 * d.y) / 3.0;
  u.x = (1.0 * c.x + 2.0 * d.x) / 3.0;
  u.y = (1.0 * c.y + 2.0 * d.y) / 3.0;
  t.x = (u.x - s.x) * cos(r) - (u.y - s.y) * sin(r) + s.x;
  t.y = (u.x - s.x) * sin(r) + (u.y - s.y) * cos(r) + s.y;

  kock(n - 1, c, s);
  kock(n - 1, s, t);
  kock(n - 1, t, u);
  kock(n - 1, u, d);
}



Measured memory_bytes: 2108
import java.util.*;
class Main{
  public static void main(String[] args){
    Scanner sr = new Scanner(System.in);
    int N = sr.nextInt();
    int A[] = new int[N];
    int count =0;
    for(int i=0;i<N;i++)
      A[i] = sr.nextInt();
    for(int j=0;j<N;j++){
      int a = A[j];
      if(j%2==0){
        if(a%2==1)
          count++;
      }
    }
    System.out.print(count);  
  
  }

}

Measured memory_bytes: 35692
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    
    int a = sc.nextInt();
    int b = sc.nextInt();
    
    if(a < 10 && b < 10) {
      System.out.println(a*b);
    }else {
      System.out.println(-1);
    }
  }
}

Measured memory_bytes: 22608
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <map>

using namespace std;

int main() {
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	int ab = abs(a - b);
	int bc = abs(b - c);
	int ca = abs(c - a);
	if (ca <= d) cout << "Yes" << endl;
	else if (ab <= d && bc <= d) cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 3552
#include <bits/stdc++.h>
using namespace std;
int s;
int ans=0;
int num[1000010]={};
void solve(int n){
  num[n]++;
  ans++;
  if(num[n]==2){
    cout << ans << endl;
    return;
  }
  if(n%2==0) solve(n/2);
  else solve(3*n+1);
}
int main(){
  cin >> s;
  solve(s);
  return 0;
}


Measured memory_bytes: 256
/**
 *   created: 28 April 2019  23:46:46
**/
#include<bits/stdc++.h>
using namespace std;

typedef vector<int> vi;
typedef pair<int , int> pii;
typedef vector< pair<int , int> > vii;
typedef long long ll;
typedef vector<long long> vl;
typedef pair<long long , long long> pll;
typedef vector< pair<long long , long long> > vll;

#define PB push_back
#define PPB pop_back
#define all(c) (c).begin,(c).end()
#define rep(i,a,b) for(int i = (int)(a); i < (int)(b); i++)
// #define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define INFLL 2000000000000000007
#define INF 2000000007
#define MOD 1000000007


#define TRACE

#ifdef TRACE
#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;

#else

#define trace1(x)
#define trace2(x, y)
#define trace3(x, y, z)
#define trace4(a, b, c, d)
#define trace5(a, b, c, d, e)
#define trace6(a, b, c, d, e, f)

#endif


void optimizeIO()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
}

//                                        //AUTHOR: Kaushalesh Shukla

//=========================================================================================================
vector< vi > adj;
vl val;
vi vis;

ll dfs(int node,ll x){
	vis[node]=1;
	if(val[node]>=0)
		x = min(x,val[node]);
	for(int t : adj[node]){
		if(!vis[t])
			x = dfs(t,x);
	}
	return x;
}
int main()
{
	optimizeIO();
	int tt=1;
	// cin>>tt;
	while(tt--){
		int n,m;
		cin>>n>>m;
		vl a(n);
		rep(i,0,n)
			cin>>a[i];
		sort(a.begin(), a.end());
		vii v(m);
		rep(i,0,m){
			int a,b;
			cin>>a>>b;
			v[i] = {b,a};
		}
		sort(v.rbegin(), v.rend());
		vl suf(n);
		suf[n-1] = a[n-1];
		for(int i=n-2;i>=0;i--){
			suf[i] = suf[i+1]+a[i];
		}
		vl pref(n);
		vl v2(n);
		int j=0;
		rep(i,0,m){
			while(v[i].second--){
				v2[j++] = v[i].first;
				if(j==n)
					break;
			}
			if(j==n)
				break;
		}
		pref[0] = v2[0];
		rep(i,1,n)
			pref[i] = pref[i-1] + v2[i];
		ll maxi=0;
		for(int i=0;i<n-1;i++){
			maxi = max(pref[i]+suf[i+1],maxi);
		}
		maxi = max(maxi, suf[0]);
		maxi = max(maxi ,pref[n-1]);
		cout<<maxi<<endl;
		// rep(i,0,n)
		// 	cout<<pref[i]<<" ";
		// cout<<endl;
		// rep(i,0,n)
		// 	cout<<suf[i]<<" ";
		// cout<<endl;
	}
	return 0;
}





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

#define _ ios_base::sync_with_stdio(0);cin.tie(NULL);
#define deb(x,y) cerr << x << " " << y << "\n"

int main() {
    int problems,submissions;
    cin >> problems >> submissions;
    int correct = 0, penalty = 0;
    vector<bool> ac(problems,false);
    vector<int> wa(problems,0);
    while(submissions--) {
        int problem;
        string verdict;
        cin >> problem >> verdict;
        if(verdict == "AC") {
            if(!ac[problem]) {
                penalty += wa[problem];
                ac[problem] = true;
                correct ++;
            }    
        }
        else {
            wa[problem]++;
        }
    }
    cout << correct << " " << penalty;
}

Measured memory_bytes: 3776
#include <cstdio>
#include <algorithm>
#include <vector>
#include <utility>
#include <queue>
#include <stack>
#include <functional>
#include <set>
#include <map>
#include <cstring>
#include <string>
#include <iostream>
#include <ctype.h>
#include <ctime>
#include <unordered_set>
#include <ctype.h>

#define fi first
#define se second
#define SZ(x) ((int)(x.size()))
#define ALL(x) x.begin(),x.end()

using namespace std;
typedef long long lli;
typedef pair<int,int> pii;
typedef pair<lli,int> pli;
typedef pair<lli,lli> pll;

int n,k,q;
int a[2000],b[2000];
int check(int val) {
	int c=0,cnt=0,mx=0;
	priority_queue<int,vector<int>,greater<int>> que,res;
	for(int i=0;i<n;i++) {
		if(a[i]>=val) que.push(a[i]); 
		else {
			cnt += max(0,SZ(que)-k+1);
			while(que.size()>=k) {
				res.push(que.top());
				que.pop();
			}
			while(!que.empty()) que.pop();
		}
	}
	cnt += max(0,SZ(que)-k+1);
	while(SZ(que)>=k) {
		res.push(que.top());
		que.pop();
	}
	while(!que.empty()) que.pop();
	if(cnt>=q) {
		for(int i=0;i<q;i++) {
			mx=res.top();
			res.pop();
		}
		return mx;
	}
	else return -1;
}
int main() {
	scanf("%d%d%d",&n,&k,&q);
	for(int i=0;i<n;i++) scanf("%d",a+i),b[i]=a[i];
	sort(b,b+n);

	int mx=1e9;
	for(int i=0;i+q-1<n;i++) {
		int val=check(b[i]);
		if(val != -1) mx=min(mx,val-b[i]);
	}
	printf("%d\n",mx);
	
	return 0;
}


Measured memory_bytes: 256
use proconio::input;

fn main() {
    input! {
        n: usize,
        ds: [(i32, i32); n],
    };
    let mut cnt = 0;
    let mut flag = false;
    for i in 0..n {
        if ds[i].0 == ds[i].1 {
            cnt += 1;
            if cnt >= 3 {
                flag = true;
                break;
            }
        } else {
            cnt = 0;
        }
    }
    if flag {
        println!("Yes");
    } else {
        println!("No");
    }
}


Measured memory_bytes: 2108
#include<iostream>
#include<vector>
#define rep(i,n) for(int i = 0; i < n; i++)
#include<algorithm>

using namespace std;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N; cin >> N;
  vector<int> vec(N);
  rep(i,N){
    cin >> vec[i];
    vec[i] -= i+1;
  }
  sort(vec.begin(),vec.end());
  int index = N/2;
  int b = vec[index];
  long long ans = 0;
  rep(i,N){
    ans += abs(vec[i]-b);
  }

  cout << ans << endl;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REPR(i, n) for(int i = (int)(n); i >= 0; i--)
#define FOR(i, s, n) for (int i = (s); i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

ll rr = 998244353;

int main(){
    int r;
    cin >> r;
    cout << r*r<< "\n";
 }

Measured memory_bytes: 256
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String {
            bytes
                .by_ref()
                .map(|r| r.unwrap() as char)
                .skip_while(|c| c.is_whitespace())
                .take_while(|c| !c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input!{
        r: usize,
        g: usize,
        b: usize,
        n: usize
    }
    let mut ans = 0;
    for i in 0..n / r + 1 {
        for j in 0..(n - r * i) / g + 1 {
            if (n - r * i - g * j) % b == 0 {
                ans += 1;
            }
        }
    }
    println!("{}", ans);
}


Measured memory_bytes: 4352
#include<bitset>
#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;

int r, c;
const int MAX_R = 15;
const int MAX_C = 10005;
bitset<MAX_C> Input[MAX_R];

int Res;

void dfs(int RowIndex) {
	if (RowIndex == r) {
		int Max_Num = 0;
		for (int i = 0; i < c; i++) {
			int Col_Num = 0;
			for (int j = 0; j < r; j++) {
				if (Input[j][i]) {
					Col_Num++;
				}
			}
			Col_Num = max(Col_Num, r - Col_Num);
			Max_Num += Col_Num;
		}
		Res = max(Max_Num, Res);
		return;
	}
	dfs(RowIndex + 1);
	Input[RowIndex].flip();
	dfs(RowIndex + 1);
	Input[RowIndex].flip();
}

int main() {
	while (scanf("%d%d", &r, &c) != EOF && (r || c)) {
		for (int i = 0; i < r; i++) {
			for (int j = 0; j < c; j++) {
				int tmp; scanf("%d", &tmp);
				Input[i][j] = tmp;
			}
		}
		Res = 0;
		dfs(0);
		printf("%d\n", Res);
	}

	return 0;
}


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

 using namespace std;
 int dp[26][110] = {};
 int main(){
 	int n;
	string S;
	scanf("%d",&n);
	cin >> S;
	for(int i =0 ; i < n ; ++i){
		for(int j = 0 ; j < 26 ; ++j){
			dp[j][i] = (i)? dp[j][i-1] : 0 ;
		}
		dp[S[i] - 'a'][i]++;
	}
	int ans = 0 ;
	for(int i =0 ; i< n-1 ; ++i){
		int cnt = 0; 
		for(int j = 0 ; j < 26 ; ++j){
			if(dp[j][i] > 0 and  dp[j][n-1] - dp[j][i] > 0 )cnt++;
		}
		ans = max(ans, cnt);
	}
	printf("%d",ans);
 }


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

const long MOD = 1000000007;

int main () {
	string S;
	cin >> S;
	int N = S.length();
	const char *Schar = new char[N];
	Schar = S.c_str();
	long dp[2][13]{};
	int now;

	for (int j=0; j<13; j++) {
		dp[1][j] = 0;
	}
	if (S[0] != '?') {
		dp[1][Schar[0] - '0'] = 1;
	} else {
		for (int j=0; j<10; j++) {
			dp[1][j] = 1;
		}
	}

	for (int i=1; i<N; i++) {
		if (S[i] != '?') {
			now = Schar[i] - '0';
			for (int j=0; j<13; ++j) {
				dp[(i+1)%2][(j*10+now)%13] = dp[i%2][j];
				dp[i%2][j] = 0;
			}
		} else {
			for (int j=0; j<13; ++j) {
				for (int k=0; k<10; ++k) {
					// cout << "d" << (j*10+k)%13 << ": " << dp[(i+1)%2][(j*10+k)%13] << endl;
					dp[(i+1)%2][(j*10+k)%13] = (dp[(i+1)%2][(j*10+k)%13] + dp[i%2][j]) % MOD;
				}
				dp[i%2][j] = 0;
			}
		}
//		for (int j=0; j<13; j++) {
//			cout << dp[(i+1)%2][j] << " ";
//		}
//		cout << endl;
	}

	cout << dp[N%2][5] << endl;
}


Measured memory_bytes: 512
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author tatsumack
 */

#include <iostream>
#include <fstream>

#include <iostream>
#include <limits.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>

#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <queue>
#include <unordered_map>
#include <unordered_set>

#define int long long
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define REPS(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
#define CLR(a, b) memset((a), (b), sizeof(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define INF 1001001001001001001ll
#define fcout cout << fixed << setprecision(12)

using namespace std;

typedef pair<int, int> P;

class AHarmony {
public:
    static constexpr int kStressIterations = 0;

    static void generateTest(std::ostream& test) {
    }

    void solve(std::istream& cin, std::ostream& cout) {
        int A, B;
        cin >> A >> B;
        int v = abs(A - B);
        if (v % 2 == 1) {
            cout << "IMPOSSIBLE" << endl;
        } else {
            cout << v / 2 + min(A, B) << endl;
        }

    }
};


signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    std::istream& in(std::cin);
    std::ostream& out(std::cout);

    AHarmony solver;
    solver.solve(in, out);
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAX_B=60;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll A,B; cin >> A >> B;
    if (A==B){cout << 1 << '\n'; return 0;}
    int MSB;
    for (MSB=MAX_B-1;MSB>=0;--MSB){
        if (!(A&1LL<<MSB)&&(B&1LL<<MSB)) break;
    }
    A&=(1LL<<(MSB+1))-1,B&=(1LL<<(MSB+1))-1;
    int MSB2;
    for (MSB2=MSB-1;MSB2>=0;--MSB2){
        if (B&1LL<<MSB2) break;
    }
    ll C=(1LL<<MSB)+(1LL<<(MSB2+1))-1;
    ll ans=C-A+1+(1LL<<(MSB+1))-max(C+1,A+(1LL<<MSB));
    cout << ans << '\n';
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    cin >> s;
    for(int i = 0;i < s.length()-1;i++)
    {
        if(s[i] == 'A' && s[i+1] == 'C')
        {
            cout << "Yes";
            return 0;
        }
    }
    cout << "No";
}


Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include <queue>
#include <utility>
#include <map>
#include <set>
#include <deque>
#include <numeric>
using namespace std;

string YorN(bool P) { if (P)return "Yes"; else return "No"; }

int main() {

    int N;
    cin >> N;

    cout << N*800-(N/15)*200 << endl;

    return 0;

}

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

int main(){
  	int h,w;
  	cin >> h >> w;
  	char s;
  	
  	rep(i,0,h+2){
      rep(j,0,w+2){
        if(i == 0 || j == 0 || i == h+1 || j == w+1){
          cout << "#";
        }
        else{
          cin >> s;
          cout << s;
        }
      }
      cout << endl;
    }
  	return 0;
}

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

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define bit(n) (1LL << (n))
#define sz(x) ((int)(x).size())
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define en '\n'
#define pb push_back
#define P pair<int, int>

typedef long long ll;
using namespace std;

ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { ll g = gcd(a, b); return a / g * b; }
const int dx[4] = { 1, 0, -1,  0 };
const int dy[4] = { 0, 1,  0, -1 };
const int INF = (int)1e9;
const ll  inf = (ll)1e18;
const int mod = 1000000007;

const double pi = 3.1415926535;

bool is_prime[100001] = {};
bool num[100001];
int cnt[100001];

void eratos() {
	is_prime[0] = is_prime[1] = false;
	rep(i, 100001) {
		is_prime[i] = true;
		cnt[i] = 0;
	}
	
	for (int i = 2; i * i <= 100000; i++) {
		if (is_prime[i]) {
			for (int j = i * i; j <= 100000; j += i) {
				is_prime[j] = false;
			}
		}
	}
	
	return;
}

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

	eratos();
	
	for (int i = 3; i <= 100000; i += 2) {
		if (is_prime[i] && is_prime[(i + 1) / 2]) {
			cnt[i]++;
		}
	}

	for (int i = 1; i <= 100000; i++) {
		cnt[i] += cnt[i - 1];
	}

	int l, r;
	rep(i, q) {
		cin >> l >> r;
		cout << cnt[r] - cnt[l - 1] << en;
	}

	return 0;
}

Measured memory_bytes: 1152
#include <bits/stdc++.h>
#define REP(i, n) for(long long i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;



int main() {
  ll h,w,ans;
  cin >> h >> w;
  if (h == 1 || w == 1) {
    cout << 1;
    return 0;
  }
  if (h % 2 == 1 && w % 2 == 1) {
    ans = (h*w/2) + 1;
  } else {
    ans = h*w/2;
  }
  cout << ans;
}

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

int r, g, b;

int main() {
    cin >> r >> g >> b;

    int check = r*100 + g*10 + b;
    if (check % 4 == 0) cout << "YES" << endl;
    else cout << "NO" << endl;

    return 0;
}


Measured memory_bytes: 256
package main

import (
	"fmt"
	"math"
)

func main() {
	var n int
	fmt.Scan(&n)
	a := make([]int, n-1)
	for i := 0; i < n-1; i++ {
		fmt.Scan(&a[i])
	}
	res := make([]int, n)
	for x := 0; x < n-1; x++ {
		res[a[x]-1]++
	}
	for y := 0; y < n; y++ {
		fmt.Println(res[y])
	}
}

//-------------------------------------------
// util tools

// abs 絶対値を返す
func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

// sliceInt []intをスライスする
func sliceInt(k int) []int {
	s := make([]int, getDigit(k))
	count := 0
	for k > 0 {
		i := k % 10
		s[len(s)-1-count] = i
		count++
		k = k / 10
	}
	return s
}

// sliceIntSum []intの合計を出す
func sliceIntSum(v []int) int {
	sum := 0
	for _, x := range v {
		sum += x
	}
	return sum
}

// reverse []intを反転
func reverse(s []int) []int {
	for i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 {
		s[i], s[j] = s[j], s[i]
	}
	return s
}

// getDigit intの桁数を取得
func getDigit(num int) int {
	digit := 0
	for num != 0 {
		num /= 10
		digit++
	}
	return digit
}

// getSumDigit intの各位の和を返す
func getSumDigit(num int) int {
	sum := 0
	for num != 0 {
		t := num % 10
		num /= 10
		sum += t
	}
	return sum
}

// lastPrime 素数 エラトステネスの篩
func lastPrime(max int64) int64 {
	if max <= 1 {
		return 2
	}
	primes := make([]int64, 1, max)
	primesF := make([]float64, 1, max)
	primes[0] = 2
	primesF[0] = 2.0

	count := int64(1)
	for n := int64(3); ; n += 2 {
		flag := true
		f := float64(n)
		rf := math.Sqrt(f)
		for i := 1; i < len(primes); i++ {
			if primesF[i] > rf {
				break
			} else if (n % primes[i]) == 0 {
				flag = false
				break
			}
		}
		if flag {
			count++
			if count >= max {
				return n
			}
			primes = append(primes, n)
			primesF = append(primesF, f)
		}
	}
}

// gcd 最大公約数
func gcd(p, q int64) int64 {
	for q != 0 {
		r := p % q
		p = q
		q = r
	}
	return p
}


Measured memory_bytes: 8076
n,l=map(int,input().split())
import copy
apple_l=[]

pie=0
deli=[]
for i in range(1,n+1):
  pie+=l+i-1
  deli.append(l+i-1)
ans={}
ans2=[]
for j in range(1,n+1):
  deli2=copy.copy(deli)
  deli2.remove(l+j-1)
  ans[abs(sum(deli2)-pie)]=sum(deli2)
  ans2.append(abs(sum(deli2)-pie))
print(ans[min(ans2)])



Measured memory_bytes: 3444
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; --i)
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define FORR(i, a, b) for (int i = b - 1; i >= a; --i)
#define SORT(v) sort(v.begin(), v.end())
#define SORTR(v) sort(v.rbegin(), v.rend())
#define REV(v) reverse(v.begin(), v.end())
#define ITER(itr, v) for (auto itr = v.begin(); itr != v.end(); ++itr)
#define LB(v, x) (lower_bound(v.begin(), v.end(), x) - v.begin())
#define UB(v, x) (upper_bound(v.begin(), v.end(), x) - v.begin())
#define SZ(v) (int)v.size()
using namespace std;
using ll = long long;
using P = pair<int, int>;

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

	int N;
	cin >> N;
	vector<int> a(N);
	REP(i, N) { cin >> a[i]; }
	vector<int> res(N);
	int x = 0;
	REP(i, N) {
		x ^= a[i];
	}
	REP(i, 31) {
		if (x >> i & 1) {
			REP(j, N) {
				res[j] += !(a[j] >> i & 1) << i;
			}
		} else {
			REP(j, N) {
				res[j] += (a[j] >> i & 1) << i;
			}
		}
	}
	REP(i, N) {
		cout << res[i] << " ";
	}

	return 0;
}


Measured memory_bytes: 4748
// The moment you think of giving up you have already lost the battle
#include <iostream>
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
typedef long long int ll;
typedef long double dl;
#define PI  3.14159265358979323846
#define Mod 998244353
ll fast(ll n,ll a,ll m)
{
    if(n==0)
        return 1;
    else if(n==1)
        return a;
    else
    {
        ll r=fast(n/2,a,m);
        if(n%2==0)
        {
            return (((r%m)*(r%m))%m);
        }
        else
        {
            return (((((r%m)*a)%m)*r)%m);
        }
    }
}
ll lim=1000000000000000000;
int main()
{
    ll  n,i;
    cin>>n;
    ll A[n],ok=0;
    for(i=0;i<n;i++)
    {
        cin>>A[i];
        if(A[i]==0)
        {
            ok=1;
        }
    }
    if(ok==1)
        cout<<0;
    else
    {
    ll ans=1;
    for(i=0;i<n;i++)
    {
       if(A[i]>=1e9&&ans>1e9||ans>=1e9&&A[i]>1e9)
       {
           ans=-1;
           break;
       }
       else
       {
          if(ans*A[i]>lim)
          {
              ans=-1;
              break;
          }
          else
          {
              ans=ans*A[i];
          }
       }
    }
    cout<<ans;

    }
}


Measured memory_bytes: 4408