akhauriyash/Code-Regression huggingface dataset:
#include <assert.h>
#include <limits.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using ll = long long;
using P = std::pair<ll, ll>;

#define rep(i, a, b) for (ll(i) = (a); i < (b); i++)
#define all(i) i.begin(), i.end()
#define debug(i) std::cerr << "debug " << i << std::endl

// const ll MOD = 998244353;
const ll MOD = 1e9 + 7;

//dp[l][r][bool] [l,r)を(bool)が先手のときの得点
ll dp[3002][3002][2]={0};

int main() {
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);
  //問題文中の添え字が0-indexか1-indexか確認!

  ll n;
  std::cin>>n;

  std::vector<ll> a(n);
  rep(i,0,n)std::cin>>a[i];

  rep(i,0,n){
    dp[i][i+1][0]=a[i];
    dp[i][i+1][1]=-a[i];
  }

  rep(len,2,n+1){
    rep(i,0,n+1-len){
      dp[i][i+len][0]=std::max(a[i]+dp[i+1][i+len][1],a[i+len-1]+dp[i][i+len-1][1]);
      dp[i][i+len][1]=std::min(dp[i+1][i + len][0]-a[i],dp[i][i + len - 1][0]-a[i+len-1]);
    }
  }

  std::cout<<dp[0][n][0];

  return 0;
}

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

using namespace std;

int main(){
    string s;
    cin >> s;
    long int size_s = s.size();
    long int count_a = 0, ans = 0;
    for (long int i = 0; i < s.size(); i++)
    {
        if (s[i] == 'A') count_a += 1;
        else if (i != size_s -1 && s[i] == 'B' && s[i+1] == 'C')
        {
            ans += count_a;
            i++;
        }
        else{
            count_a = 0;
        }
    }
    cout << ans << endl;
    return 0;
}

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

#include <math.h>
#include <stdlib.h>


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

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

// const int INF = 1001001001;
// long long max => LLONG_MAX

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    
    int a, b; cin >> a >> b;
    if(a+b < 10) cout << a + b << endl;
    else cout << "error" << endl;

    return 0;
}


Measured memory_bytes: 256
using System;
using System.Linq;
using System.Collections;

namespace ABC091
{
    class C
    {
        static void Main(string[] args)
        {
            //input
            int N = int.Parse(Console.ReadLine());

            int[][] ab = new int[N][];
            for (int i = 0; i < N; i++)
            {
                int[] input = Console.ReadLine().Split().Select(int.Parse).ToArray();
                ab[i] = new int[] { input[0], input[1] };
            }

            int[][] cd = new int[N][];
            for (int i = 0; i < N; i++)
            {
                int[] input = Console.ReadLine().Split().Select(int.Parse).ToArray();
                cd[i] = new int[] { input[0], input[1] };
            }

            Array.Sort(cd, StructuralComparisons.StructuralComparer);

            bool[] Seleced = new bool[N];
            int res = 0;
            for (int i = 0; i < N; i++)
            {
                int index = -1;
                int max = int.MinValue;
                for (int j = 0; j < N; j++)
                {
                    if (ab[j][0] < cd[i][0] && ab[j][1] < cd[i][1] && !Seleced[j])
                    {
                        if (max < ab[j][1])
                        {
                            max = ab[j][1];
                            index = j;
                        }
                    }
                }
                if (-1 < index) { Seleced[index] = true; res++; }
            }

            //output
            Console.WriteLine(res);
        }
    }
}


Measured memory_bytes: 13396
/*
*
*Problem Link : https://atcoder.jp/contests/dp/tasks/dp_h
*Platform: atcoder
*Status: correct
*Author: Mayukh Chakrabarti
*
*/

#include<bits/stdc++.h>
#define speed ios_base::sync_with_stdio(false)
#define boost cin.tie(NULL)
#define booster cout.tie(NULL)
#define endl "\n"
typedef long long int lld;

#define F(a,n) for(int i=0;i<n;i++){cin>>a[i];}
#define F1(a,n) for(int i=1;i<=n;i++){cin>>a[i];}
#define P(a,n) for(int i=0;i<n;i++){cout<<a[i]<<' ';}cout<<endl;
#define P1(a,n) for(int i=1;i<=n;i++){cout<<a[i]<<' ';}cout<<endl;
#define NF(a,n,m) for(int i=0;i<n;i++){for(int j=0;j<m;j++){cin>>a[i][j];}}
#define NF1(a,n,m) for(int i=1;i<=n;i++){for(int j=1;j<=m;j++){cin>>a[i][j];}}
#define PNF(a,n,m) for(int i=0;i<n;i++){for(int j=0;j<m;j++){cout<<a[i][j]<<' ';}cout<<endl;}cout<<endl;
#define PNF1(a,n,m) for(int i=1;i<=n;i++){for(int j=1;j<=m;j++){cout<<a[i][j]<<' ';}cout<<endl;}cout<<endl;

using namespace std;

const lld MOD= 1e9 + 7;

int main(){
	
	speed;boost;
	
	lld row,col;
	cin>>row>>col;
	vector<vector<char>> grid(row, vector<char>(col));
	NF(grid,row,col);
	
	vector<vector<lld>> dp(row, vector<lld>(col));
	
	bool flag= true;
	for(lld i=0; i<col ; i++)
		if(grid[0][i]=='.' && flag)
			dp[0][i]=1;
		else{
			dp[0][i]=0;
			flag=false;
		}
	
	flag= true;
	for(lld i=0; i<row ; i++)
		if(grid[i][0]=='.' && flag)
			dp[i][0]=1;
		else{
			dp[i][0]=0;
			flag= false;
		}
	
	for(lld i=1; i<row ; i++){
		
		for(lld j=1; j<col ; j++){
			
			if(grid[i][j]=='#')
				dp[i][j]= 0;
			else
				dp[i][j]= ( dp[i-1][j] + dp[i][j-1] ) % MOD;
		}
	}
	
	cout<<dp[row-1][col-1];
	
	return 0;
}



Measured memory_bytes: 9088
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repf(i, j, n) for (int i = (j); i < (n); i++)
#define repr(i, n) for (int i = (n)-1; i >= 0; i--)

vector<int> a;
struct unionFind {
  int n;
  vector<int> pr,a;
  priority_queue<int,vector<int>>pq;
  unionFind(){};
  unionFind(int _n,vector<int> a_) {
    n = _n;a=a_;
    pr.resize(n, -1);
  };
  int root(int x) {
    if (pr[x] == -1)
      return x;
    else
      return pr[x] = root(pr[x]);
  }
  void unify(int c, int b) {
    c = root(c);
    b = root(b);
    if (c == b) return;
    if (a[b] > a[c]) swap(c, b);
    pr[c] = b;
	pq.push(a[c]);
  }
};

signed main() {
  int n, m;
  cin >> n >> m;
 vector<int> a(n);
  if(m==n-1)cout<<0<<endl,exit(0);
  if(n<2*(n-m-1))cout<<"Impossible"<<endl,exit(0);

  for (auto&& u : a) cin >> u;
  unionFind uf(n,a);
  rep(i, m) {
    int x, y;
    cin >> x >> y;
    uf.unify(x, y);
  }
	int ret=0;
	for(auto&& u:a)ret+=u;
//	int ret=accumulate(begin(a),end(a),0ll);
//	for(auto&& u:a)cout<<u<<" ";
	rep(i,n-2*(n-m-1)){int x=uf.pq.top();uf.pq.pop();ret-=x;}	
	cout<<ret<<endl;
}


Measured memory_bytes: 4464
//** aman**/
#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define dl          double
#define hell        1000000007
#define endl        '\n'
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define lb lower_bound
#define ub upper_bound
#define bs          binary_search
#define ios         ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
using namespace std;
ll fun(set<pair<ll,ll>> &s,ll x){
	auto it=s.ub({x,0});
	if(it!=s.begin()){
		it--;
		return (*it).S;
	}
	return 0;
}
int main(){
	ll n;cin>>n;
	ll h[n+1],b[n+1];
	for(ll i=0;i<n;i++)cin>>h[i];
	for(ll i=0;i<n;i++)cin>>b[i];
	set<pair<ll,ll>> s;
	ll dp[n+1];
	for(ll i=0;i<n;i++)dp[i]=b[i];
	for(ll i=0;i<n;i++){
		ll x=fun(s,h[i]);
		dp[i]=dp[i]+x;
		while(s.size()>0){
			auto it=s.ub({h[i],0});
			if(it!=s.end()&&(*it).S<=dp[i]){
				s.erase(it);
			}
			else break;
		}
		s.insert({h[i],dp[i]});
	}
	cout<<*max_element(dp,dp+n)<<endl;
}

Measured memory_bytes: 17408
using System;
using System.Collections.Generic;
using System.Linq;
 
namespace at
{
    class Program
    {
        static void Main(string[] args)
        {
            var x = Console.ReadLine().Split(' ');
            Console.Write(int.Parse(x[0])*int.Parse(x[1])+" ");
            Console.WriteLine((int.Parse(x[0])+int.Parse(x[1]))*2);
        }
    }
}



Measured memory_bytes: 15856
#include<stdio.h>
int main(void)
{
    int i,j,k,l,n,count=0;
    while(scanf("%d",&n) != EOF){
    for(i=0; i<10; i++){
        for(j=0; j<10; j++){
            for(k=0; k<10; k++){
                for(l=0; l<10; l++){
                if(i+j+k+l==n)
                count++;
                }
            }
        }
    }
    printf("%d\n",count);
    count=0;
    }

    return 0;
}

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

using namespace std;

#define int long long

const int mod = 1e9+7;
int n,a,b,c,d;
int f[1001][1001];
int fact[1001];
int re_fact[1001];

int p(int a,int b)
{
	if (b == 0)
		return 1;
	int tmp = p(a,b/2);
	if (b%2 == 0) return (tmp * tmp)%mod;
	return ((tmp * tmp)%mod * a)%mod;	
}

int comb(int n,int k)
{
	int tmp = ((fact[n] * re_fact[k])%mod * re_fact[n-k])%mod;
	return tmp;
}

int dp(int rem,int cur)
{
	if (rem == 0)
		return 1;
	if (cur > b)
		return 0;
	if (f[rem][cur] != -1)
		return f[rem][cur];
	int ans = dp(rem,cur + 1);
	for (int j=c;j<=d;j++)
	{
		if (rem - j*cur < 0)
			break;
		ans = (((((dp(rem - j*cur,cur + 1)*fact[j*cur])%mod*p(p(fact[cur],j),mod-2))%mod*re_fact[j])%mod*comb(rem,j*cur))%mod + ans)%mod;						
	}
	return f[rem][cur] = ans;
}

int32_t main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	                 
	fact[0] = 1;
	for (int i=1;i<=1000;i++)
		fact[i] = (fact[i-1] * i)%mod;
	re_fact[1000] = p(fact[1000],mod-2);
	for (int i=1000;i>=1;i--)
		re_fact[i-1] = (re_fact[i] * i)%mod;	
	cin >> n >> a >> b >> c >> d;
	for (int i=0;i<=1000;i++)
		for (int j=0;j<=1000;j++)
			f[i][j] = -1;
	cout << dp(n,a);
}

Measured memory_bytes: 8192
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
int N, M;
vector <int> G[200005];
bool Use[200005];
queue <int> Q;
int D[200005];
void Read()
{
    cin >> N >> M;
    for(int i = 1; i <= M; i++)
    {
        int x, y;
        cin >> x >> y;
        G[x].push_back(y);
        G[y].push_back(x);
    }
}

void BFS()
{
    Q.push(1);
    Use[1] = 1;
    while(!Q.empty())
    {
        int x = Q.front();
        Q.pop();
        for(int j = 0; j < G[x].size(); j++)
        {
            int node = G[x][j];
            if(Use[node] == 0)
            {
                Use[node] = 1;
                D[node] = D[x] + 1;
                Q.push(node);
            }
        }
    }
    if(D[N] == 2)
        cout << "POSSIBLE\n";
    else
        cout << "IMPOSSIBLE\n";
}
int main()
{
    Read();
    BFS();
    return 0;
}


Measured memory_bytes: 13424
#include<bits/stdc++.h>
using namespace std;
const int M=1e9+7,N=200005;
set<int> S;
int f[N],n,m,a[N],ans,x,b[N],num1,num2,tot,val[N];
struct Ask{
	int l,r;
	Ask(int _l=0,int _r=0){
		l=_l;
		r=_r;
	}
}A[N];
int cmp(Ask x,Ask y){
	return x.l<y.l||(x.l==y.l&&x.r>y.r);
}
int ef1(int x){
	int l=1,r=num1;
	while (l<r){
		int mid=(l+r)/2;
		if (a[mid]<x)l=mid+1;
		else r=mid;
	}
	return l;
}
int ef2(int x){
	int l=1,r=num2;
	while (l<r){
		int mid=(l+r)/2;
		if (b[mid]<x)l=mid+1;
		else r=mid;
	}
	return l;
}
int find(int x){
	int ans=0;
	for (;x;x-=x&-x)(ans+=val[x])%=M;
	return ans;
}
void insert(int x,int y){
	for (;x<=num2;x+=x&-x)(val[x]+=y)%=M;
}
int main(){
	scanf("%d%d",&n,&m);
	for (int i=1;i<=n;i++)scanf("%d",&a[i]);
	for (int i=1;i<=m;i++)scanf("%d",&x),S.insert(x);
	for (int i=1;i<=n;i++){
		set<int>::iterator iter=S.lower_bound(a[i]);
		if (iter!=S.begin()&&iter!=S.end()){
			set<int>::iterator iter2=iter;iter2--;
			A[++tot]=Ask(a[i]-*iter2,*iter-a[i]);
			a[++num1]=A[tot].l;b[++num2]=A[tot].r;
		}
	}
	if (!tot){
		puts("1");
		return 0;
	}
	sort(a+1,a+num1+1);
	sort(b+1,b+num2+1);
	int num=1;
	for (int i=2;i<=num1;i++)
		if (a[i]!=a[num])a[++num]=a[i];
	num1=num;
	num=ans=1;
	for (int i=2;i<=num2;i++)
		if (b[i]!=b[num])b[++num]=b[i];
	num2=num;
	for (int i=1;i<=tot;i++)A[i].l=ef1(A[i].l),A[i].r=ef2(A[i].r);
	sort(A+1,A+tot+1,cmp);
	num=1;
	for (int i=2;i<=tot;i++)
		if (A[i].l!=A[num].l||A[i].r!=A[num].r)A[++num]=A[i];
	tot=num;
	for (int i=1;i<=tot;i++){
		f[i]=(1+find(A[i].r-1))%M;
		insert(A[i].r,f[i]);
		(ans+=f[i])%=M;
	}
	printf("%d\n",ans);
	return 0;
}



Measured memory_bytes: 8832
import java.util.*;
public class Main{
    public static void main(String[]args){
        Scanner sc=new Scanner(System.in);
        int N=sc.nextInt();
        int []s=new int[N];
        for(int i=0;i<N;i++){
            s[i]=sc.nextInt();
        }
        int min=100;
        int sum=0;
        for(int i=0;i<N;i++){
            sum=sum+s[i];
        }
        if(sum%10!=0){
            System.out.println(sum);
        }else{
        for(int i=0;i<N;i++){
            if((min>=s[i])&&(s[i]%10!=0)){
                min=s[i];
            }
            if((i==N-1)&&(min!=100)){
                System.out.println(sum-min);
            }
            if((i==N-1)&&(min==100)){
                System.out.println(0);
            }
        }}


     
    }
}

Measured memory_bytes: 23636
#include <iostream>
#include <string>

using namespace std;

int H,W;
string a[1010];

long long dp[1010][1010];

int main(){
  cin >> H >> W;
  for(int i=0;i<H;i++)cin >> a[i];

  for(int i=0;i<=H;i++) for(int j=0;j<=W;j++) dp[i][j]=0;
  dp[H-1][W-1]=1;
  for(int i=H-1;i>=0;i--){
    for(int j=W-1;j>=0;j--){
      dp[i][j]+=(j+1>=W || a[i][j+1]=='#')?0:dp[i][j+1];
      dp[i][j]+=(i+1>=H || a[i+1][j]=='#')?0:dp[i+1][j];
      dp[i][j]%=1000000000+7;
    }
  }
  cout << dp[0][0] << endl;
  return 0;
}


Measured memory_bytes: 9216
#include <bits/stdc++.h>
using namespace std;
#define ll long long int


int main(){
  int n; cin >> n;
  string s = to_string(n);
  //vector<char> s(4);
  
  for(int i=0;i<3;i++){
    if(s[i] == s[i+1]){
      cout << "Bad" << endl;
      return 0;
    }
  }
  cout << "Good" << endl;
  
}

Measured memory_bytes: 256
//This Code was made by Chinese_zjc_.
#include <iostream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <bitset>
#include <cmath>
#include <queue>
#include <stack>
#include <string>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <map>
#include <set>
#include <ctime>
// #include<windows.h>
#define int long long
#define double long double
using namespace std;
const double PI = acos(-1);
const double eps = 0.0000000001;
const int INF = 0x3fffffffffffffff;
int n, k, dp[55][55];
signed main()
{
    ios::sync_with_stdio(false);
    cin >> n >> k;
    cout << n - k + 1 << endl;
    return 0;
}

Measured memory_bytes: 3632
/* ----------------------- reclone_rk --------------------------------------------*/ 
#include<bits/stdc++.h>
using namespace std;
#define int long long int
const int mod=1e9+7;

#define FastRead ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define prq priority_queue<int>
#define prqp priority_queue<pair<int,int>>
#define vtr vector<int>
#define INF INT_MAX
#define NINF INT_MIN
#define endl "\n"
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define pvtr vector<pair<int,int>>
#define FOR(i,a,n) for (int i=(a);i<=(n);++i)

int gcd(int a, int b){ if(a == 0) return b; return gcd(b%a, a);}
int MOD(int n){ return ((n%mod)+mod)%mod;}
int power(int a,int b){ if(b==0)return 1LL;int s=power(a,b/2LL);s*=s;s%=mod;if(b&1LL)return (s*a)%mod;return s;}
int inv(int a){return power(a,mod-2);}
int nCr(int n,int r){if(r>n)return 0LL;if(n-r<r)r=n-r;int ans=1;for(int i=0;i<r;i++){ans*=(n-i);ans=MOD(ans);ans*=inv(i+1);ans=MOD(ans);}return ans;}

const double pi = 3.14159265358979323846;
signed main()
{   
    int n, m;
    cin>>n>>m;
    cout<<nCr(n,2) + nCr(m, 2)<<endl;
	return 0;
}

Measured memory_bytes: 764
#include <stdio.h>

int main(void) {
  int i, j, k, n, w;
  scanf("%d%d", &n, &w);
  int dp[w + 1], v[n], we[n];
  for(i = 0; i <= w; ++i) dp[i] = 0;
  for(i = 0; i < n; ++i) scanf("%d%d", &v[i], &we[i]);
  for(i = 0; i < n; ++i) for(j = w; j >= 0; --j) if(j + we[i] <= w && dp[j + we[i]] < dp[j] + v[i]) dp[j + we[i]] = dp[j] + v[i];
  int ans = 0;
  for(i = 0; i <= w; ++i) if(ans < dp[i]) ans = dp[i];
  printf("%d\n", ans);
  return 0;
}


Measured memory_bytes: 2780
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class MainClass
{
	public const long Giri = 1000000007;
	public const long DpInf = 99999999999999;

	public static void Main(string[] args)
	{
		var p = Input();
		var n = p[0].ToLong();
		var k = p[1].ToLong();
		long t = n / k;
		
		long min = n;
		for(int i = -5; i< 10; i++)
		{
			min = Math.Min(min, Math.Abs(n - (t+i) * k));
		}
		Console.WriteLine(min);
	}
	

	
	static long GCD(long a, long b)
	{
		var v = new[] { a, b };
		while (v[1] != 0) { v = new[] { v[1], v[0] % v[1] }; }
		return v[0];
	}
	public static string[] Input() { return Console.ReadLine().Split(); }
}

public static class Smarter
{
	public static int ToInt(this string str) { return int.Parse(str); }
	public static long ToLong(this string str) { return long.Parse(str); }
	public static int[] ToInt(this string[] str, int offset = 0)
	{
		var r = new int[str.Length];
		for(int i = 0; i < str.Length; i++) r[i] = str[i].ToInt() + offset;
		return r;
	}
}

Measured memory_bytes: 13140
package main

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

var (
	read  = bufio.NewReader(os.Stdin)
	write = bufio.NewWriter(os.Stdout)
)

func min(a, b int) int {
	if a <= b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a >= b {
		return a
	}
	return b
}

func yesno(result bool) {
	if result {
		fmt.Fprintln(write, "Yes")
	} else {
		fmt.Fprintln(write, "No")
	}
}

func printansStr(result bool, a, b string) {
	if result {
		fmt.Fprintln(write, a)
	} else {
		fmt.Fprintln(write, b)
	}
}

func printansInt(result bool, a, b int) {
	if result {
		fmt.Fprintln(write, a)
	} else {
		fmt.Fprintln(write, b)
	}
}

func sort(s string) string {
	len := len(s)
	b := []byte(s)
	for i := 0; i < len; i++ {
		min := i
		for j := (i + 1); j < len; j++ {
			if b[j] < b[min] {
				min = j
			}
		}
		b[i], b[min] = b[min], b[i]
	}
	return string(b)
}

func main() {
	defer write.Flush()

	var n int
	fmt.Fscan(read, &n)
	mp := make(map[string]int)
	for i := 0; i < n; i++ {
		var s string
		fmt.Fscan(read, &s)
		mp[sort(s)]++
	}

	ans := 0
	for _, v := range mp {
		ans += v * (v - 1) / 2
	}
	fmt.Fprintln(write, ans)
}


Measured memory_bytes: 9728
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

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

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

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

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

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

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

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

fn adder (i: usize, j: usize) -> isize{
    let mut pow: usize = 1;
    for k in 1..i {
        pow *= 10;
    }
    (pow * j) as isize
}

fn main(){
    input!{
        l: f64
    }
    print!("{}", l*l*l/27.0);
}


Measured memory_bytes: 4352
#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;
  cin >> n;
  vector<pair<int, int>> ia(n);
  rep(i, n) {
    int a;
    cin >> a;
    ia[i].first = a;
    ia[i].second = i + 1;
  }

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

  rep(i, n) { printf("%d%c", ia[i].second, i == n - 1 ? '\n' : ' '); }

  return 0;
}


Measured memory_bytes: 1664
#include <stdio.h>
#include <string.h>
#include <vector>
#include <algorithm>
#include <assert.h>
#include <iostream>

using namespace std;

int min(int a, int b){
    return a < b ? a : b;
}

int max(int a, int b){
    return a > b ? a : b;
}

void solucion(){

}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int R;
    cin >> R;
    double res = 2*R*3.1415;
    cout << res << "\n";
    return 0;
}


Measured memory_bytes: 3208
typedef long long ll;
#include <bits/stdc++.h>
using namespace std;
int main() {
    ll A,B;
    cin >>A>>B;
    if(A<=8 && B<=8){
        std::cout << "Yay!" << std::endl;
    }else{
        std::cout << ":(" << std::endl;
    }
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef pair<P,int> T;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define all(x) (x).begin(),(x).end()
#define sq(x) ((x)*(x))
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define repn(i,a,n) for(int (i)=(a);(i)<(int)(n);(i)++)
#define EQ(a,b) (abs((a)-(b))<eps)
template<class T> void chmin(T& a,const T& b){if(a>b)a=b;}
template<class T> void chmax(T& a,const T& b){if(a<b)a=b;}
int N;
int A[100100];
int l[100100];
int r[100100];
int main(){
	cin >> N;
	for(int i=0;i<N;i++){
		cin >> A[i];
	}
	l[0]=A[0];
	r[N-1]=A[N-1];
	for(int i=1;i<N;i++){
		l[i] = __gcd(l[i-1],A[i]);
	}
	for(int i=N-2;i>=0;i--){
		r[i] = __gcd(r[i+1],A[i]);
	}
	int ans = 0;
	for(int i=0;i<N;i++){
		if(i==0){
			ans = max(ans,r[i+1]);
		}else if(i==N-1){
			ans = max(ans,l[i-1]);
		}else{
			ans = max(ans,__gcd(l[i-1],r[i+1]));
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1408
#include <iostream>
#include <utility>
#include <map>
#include <vector>
#include <algorithm>
#include <queue>
#include <math.h>
#include <stack>
#include <set>
#include <deque>
#include <cmath>
#include <cassert>

using namespace std;
typedef long long ll;
ll mod = 1e9+7;
#define rep(i,n) for(int i = 0; i < (n); ++i)

int main() {
    int n;
    cin >> n;
    deque<int> d;
    rep(i, n) {
        int a;
        cin >> a;
        int idx = lower_bound(d.begin(), d.end(), a) - d.begin() - 1;
        //cout << i << " " << idx << endl;
        if (idx < 0) {
            d.push_front(a);
        }
        else {
            d[idx] = a;
        }
    }
    cout << (int)d.size() << endl;
    return 0;
}


Measured memory_bytes: 3956
import java.util.*;

class Main {
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);

        // int N = sc.nextInt();
        String s = sc.nextLine();
        String t = sc.nextLine();

        if (s.equals(t.substring(0,s.length()))) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }

        sc.close();
    }
}

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

using namespace std;

using ll = long long;

constexpr ll MOD = 1e9 + 7;

constexpr bool FIRST = true;
constexpr bool SECOND = false;

int main() {
    int N;
    ll K;
    cin >> N >> K;

    std::vector<int> a(N);
    std::for_each(a.begin(), a.end(), [](auto &x) { cin >> x; });

    std::vector<bool> dp(K + 1, SECOND);

    dp[1] = a[0] == 1 ? FIRST : SECOND;
    for (ll num_stone = 2; num_stone <= K; ++num_stone) {
        dp[num_stone] = SECOND;
        for (const auto &choice : a) {
            if (choice > num_stone) { break; }
            if (dp[num_stone - choice] == SECOND) {
                dp[num_stone] = FIRST;
            }
        }
    }

    std::cout << (dp[K] == FIRST ? "First" : "Second") << endl;

    return 0;
}


Measured memory_bytes: 256
package main

import (
	"fmt"
	"math"
	"sort"
)

type Int64Slice []int64

func (p Int64Slice) Len() int           { return len(p) }
func (p Int64Slice) Less(i, j int) bool { return p[i] < p[j] }
func (p Int64Slice) Swap(i, j int)      { p[i], p[j] = p[j], p[i] }

func main() {
	n := SingleInt()

	vehicles := ScanNums(5)
	sort.Sort(Int64Slice(vehicles))
	t := int64(4)

	d := float64(n) / float64(vehicles[0])
	re := int64(math.Ceil(d))

	fmt.Printf("%#v\n", t+re)
}

func SingleInt() int64 {
	var n int64
	fmt.Scan(&n)
	return n
}

func ScanNums(len int) (nums []int64) {
	var num int64
	for i := 0; i < len; i++ {
		fmt.Scan(&num)
		nums = append(nums, num)
	}
	return
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return 1;
    }
    return 0;
}
typedef long long int ll;

#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
const double EPS = 1e-7;
const int INF = INT_MAX;
const ll LLINF = INT64_MAX;
const double PI = acos(-1);
const int MOD = 1000000007;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

//-------------------------------------

//AGC,GAC,ACG,A*GC,AG*Cを含まない、A,G,C,Tのみを含むn文字の文字列の総数(mod 1e9+7)
// dp[i][j][k][l] := i文字目まで見た時に、3,2,1文字前がj,k,lのときの総数
// 0:A,1:G,2:C,3:T
ll dp[110][4][4][4];

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    dp[0][3][3][3] = 1;
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < 4; j++)
        {
            for (int k = 0; k < 4; k++)
            {
                for (int l = 0; l < 4; l++)
                {
                    for (int next = 0; next < 4; next++)
                    {
                        // AGC
                        if (k == 0 && l == 1 && next == 2)
                        {
                            continue;
                        }
                        // GAC
                        if (k == 1 && l == 0 && next == 2)
                        {
                            continue;
                        }
                        // ACG
                        if (k == 0 && l == 2 && next == 1)
                        {
                            continue;
                        }
                        // A*GC
                        if (j == 0 && l == 1 && next == 2)
                        {
                            continue;
                        }
                        // AG*C
                        if (j == 0 && k == 1 && next == 2)
                        {
                            continue;
                        }
                        (dp[i + 1][k][l][next] += dp[i][j][k][l]) %= MOD;
                    }
                }
            }
        }
    }
    ll ans = 0;
    for (int i = 0; i < 4; i++)
    {
        for (int j = 0; j < 4; j++)
        {
            for (int k = 0; k < 4; k++)
            {
                (ans += dp[n][i][j][k]) %= MOD;
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
from sys import stdin
from itertools import repeat
def main():
    n = int(stdin.readline())
    a = map(int, stdin.readline().split(), repeat(10, n))
    b = map(int, stdin.readline().split(), repeat(10, n))
    la = [0] * n
    lb = [0] * n
    la[0] = a[0]
    for i in xrange(1, n):
        if a[i-1] < a[i]:
            la[i] = a[i]
        else:
            la[i] = 1
    lb[-1] = b[-1]
    for i in xrange(-2, -n-1, -1):
        if b[i+1] < b[i]:
            lb[i] = b[i]
        else:
            lb[i] = 1
    ans = 1
    for i in xrange(n):
        if a[i] < lb[i] or b[i] < la[i]:
            print 0
            return
        l = la[i] if la[i] > lb[i] else lb[i]
        r = b[i] if b[i] < a[i] else a[i]
        ans = ans * (r - l + 1) % 1000000007
    print ans
main()


Measured memory_bytes: 14536
// ------------------------------------
// Date:2018/ 2/23
// Problem:ABC 047 FightingOverCandies a.cpp
//
// ------------------------------------

#include <bits/stdc++.h>

using namespace std;

#define EACH(i,a) for (auto&& i : a)
#define FOR(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RFOR(i,a,b) for(int i=(int)b-1;i>=(int)a;--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()

using ll = long long;

#define MOD 1000000007

int main()
{
  vector<int> n(3);
  REP(i,3) cin >> n[i];
  sort(ALL(n));
  if (n[0]+n[1]==n[2]) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}



Measured memory_bytes: 384
#include<iostream>
using namespace std;
int main(){
	int n,count=0,temp;

	cin >>n;
	for(int i=0;i<n;i++){
		cin >>temp;
		while(1){
			if(temp%2!=0)break;
			temp/=2;
			count++;
		}
	}
	cout<<count<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#define fastIO ios_base::sync_with_stdio(false);cin.tie(NULL);
using namespace std;


struct UnionFind {
    vector<int> r;

    UnionFind(int N){
        r = vector<int>(N, -1);
    }
    int root(int id){
        if(r[id] < 0 ) return id;
        return r[id] = root(r[id]);
    }
    bool unite(int x, int y){
       int rootX = root(x);
       int rootY = root(y);
       if(rootX==rootY) return false;
       if(r[rootX] > r[rootY]) swap(rootX,rootY);
       r[rootX] += r[rootY];
       r[rootY] = rootX;
       return true;
    }
    int size(int x){
        return -r[root(x)];
    }
};

int main() {
    fastIO;
    int N, M;
    cin >> N;
    cin >> M;
    UnionFind UF(N);
    for (int i = 0; i<M; i++){
        int A, B;
        cin >> A;
        cin >> B;
        A-=1; B-=1;
        UF.unite(A,B);
    }
    int ans = 0;
    for (int i=0; i < N; i++){
        ans = max(ans, UF.size(i));
    }
    cout << ans << endl;
}


Measured memory_bytes: 3996
// 22
#include <bits/stdc++.h>
using namespace std;
#define coutc "\033[48;5;196m\033[38;5;15m"
#define endc "\033[0m"
#define endl '\n'
#define M(_1, _2, _3, _4, NAME, ...) NAME
#define rep(...) \
  M(__VA_ARGS__, rep4, rep3, rep2, rep1)(__VA_ARGS__)
#define rep4(_, x, n, s) \
  for (int _ = x; (s < 0) ? _ > n : _ < n; _ += s)
#define rep3(_, x, n) rep4(_, x, n, (x < n ? 1 : -1))
#define rep2(_, n) rep3(_, 0, n)
#define rep1(n) rep2(i, n)
#define fi first
#define se second
#define pb push_back
#define pairii pair<int, int>
#define all(x) x.begin(), x.end()
#define len(x) int(x.size())
#define lli __int128_t
#define li long long int
#define ld long double
// 4
template <class A, class B>
ostream &operator<<(ostream &o, const pair<A, B> &p) {
  return o << "(" << p.fi << ", " << p.se << ")";
}
// 5
template <class T>
ostream &operator<<(ostream &o, const vector<T> &v) {
  rep(i, len(v)) o << setw(7) << left << v[i];
  return o << endc << endl << coutc;
}
// 5
template <class A, class B>
ostream &operator<<(ostream &o, const map<A, B> &m) {
  for (auto &kv : m) o << kv;
  return o;
}
// 7
template <class T, class... Ts>
void debug(const T &e, const Ts &... r) {
#ifdef DEBUG
  cerr << coutc << e;
  ((cerr << " " << r), ..., (cerr << endc << endl));
#endif
}
// 3
void _main(int tc) {
  int n;
  cin >> n;
  vector<int> indegree(n);
  rep(n - 1) {
    int x;
    cin >> x;
    x--;
    indegree[x]++;
  }
  rep(n) {
    cout << indegree[i] << endl;
  }
}
// 7
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  _main(0), exit(0);
  int tc;
  cin >> tc;
  rep(i, tc) _main(i + 1);
}

Measured memory_bytes: 3936
from copy import deepcopy
from collections import deque
from itertools import product
import numpy as np
class Grid:
    def __init__(self, grid, w=0, h=0, function=lambda x: x):
        self.w = w = w if w else len(grid[0])
        self.h = h = h if h else len(grid)
        dtype = type(function(grid[0][0]))
        self.grid = np.empty((h, w), dtype=dtype)
        for i, row in zip(range(h), grid):
            for j, val in zip(range(w), row):
                self.grid[i][j] = function(val)
    
    def is_valid_x(self, x):
        return 0 <= x < self.w
    def is_valid_y(self, y):
        return 0 <= y < self.h
    def is_valid_xy(self, x, y):
        return self.is_valid_x(x) and self.is_valid_y(y) 
    
    def __iter__(self):
        return iter(self.grid)
    def __repr__(self):
        return '\n'.join([' '.join(map(str, row)) for row in self.grid]) + '\n'
    def __getitem__(self, x):
        return self.grid[x]
    def __setitem__(self, x, val):
        self.grid[x] = val

def longest_path(grid, root):
    def restore_route(prev, p):
        A = deque()
        while p:
            A.appendleft(p)
            p = prev[p]
        return list(A)
    
    x, y = root
    prev = {root:None}
    grid[y, x] = '!'
    queue = deque([root])
    while queue:
        x, y = queue.popleft()
        for dx, dy in zip([1, 0, -1, 0], [0, 1, 0, -1]):
            nx, ny = x+dx, y+dy
            if grid.is_valid_xy(nx, ny) and grid[ny, nx] in 'sg.':
                prev[nx, ny] = x, y
                queue.append((nx, ny))
                grid[ny, nx] = '!'
    return restore_route(prev, (x, y))

h, w = map(int, input().split())
grid = Grid([input() for s in range(h)])
ans = 0
for y, x in product(range(h), range(w)):
    if grid[y, x] == '.':
        path = longest_path(deepcopy(grid), (x, y))
        ans = max(ans, len(path)-1)
print(ans)

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

typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;

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

const ll INF = 1e18;
const ll MOD = 998244353;
const ll MX = 1000001;

int A, B, C, D;

void solve() {
    cin >> A >> B >> C >> D;
    while (A > 0 && C > 0) {
        C -= B;
        if (C <= 0) {
            cout << "Yes";
            return;
        }
        A -= D;
        if (A <= 0) {
            cout << "No";
            return;
        }
    }
}

int main() {
	cin.sync_with_stdio(0); cin.tie(0);
    ll T = 1; // cin >> T;
    while (T--) solve();
    return 0;
    // You should actually read the stuff at the bottom
}

/* Stuff to Look For
 * -----------------
 * Int overflow, array bounds
 * Initializing all variables, avoid weird behavior
 * Edge cases(n = 0, n = 1)
 * Just return 0 after result
 */


Measured memory_bytes: 3580
function main(input) {
  input=input.trim();
  const a = parseInt(input.split(" ")[0], 10);
  const b = parseInt(input.split(" ")[1], 10);
  const c = parseInt(input.split(" ")[2], 10);
  if(a+b>=c){
    console.log("Yes");
  }else{
    console.log("No");
  }

}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));



Measured memory_bytes: 7372
#include<iostream>
#include<algorithm>
#include<set>
#include<math.h>
#include<vector>
#include<sstream>
#include<queue>
#include<functional>
#include<bitset>
#include<cstdio>
#include<iomanip>
#include<map>
#include<unordered_map>
#include<unordered_set>
#include <string.h>

using ll = long long;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define reps(i, x) for(int i=1;i<=(int)(x);i++)
#define rrep(i, x) for(int i=((int)(x)-1);i>=0;i--)
#define rreps(i, x) for(int i=(int)(x);i>0;i--)
#define all(x) (x).begin(),(x).end()
#define m0(x) memset(x,0,sizeof(x))
#define vll vector<ll>
#define vi vector<int>
#define vpll vector<pair<ll,ll>>
#define vpi vector<pair<int,int>>
#define mod 1000000007
#define put2darr(arr, row, col) rep(i, row) { rep(j, col) { printf("%18d", arr[i][j]); } cout << endl; }

using namespace std;

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

/* 1..10
 * rep:   0 1 2 3 4 5 6 7 8 9
 * reps:  1 2 3 4 5 6 7 8 9 10
 * rrep:  9 8 7 6 5 4 3 2 1 0
 * rreps: 10 9 8 7 6 5 4 3 2 1
 */

int n, m, t;
int a[100001];
ll dp[100001];
int main(){
    cin >> n >> m;
    rep(i,m) {
        cin >> t;
        a[t] = 1;
    }
    dp[0] = 1;
    reps(i, n){
        if(a[i]) continue;
        dp[i] += dp[i-1];
        if(i > 1) dp[i] += dp[i - 2];
        dp[i] %= mod;
    }
    cout << dp[n] << endl;
}



Measured memory_bytes: 1408
#include<iostream>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<cstring>
#include<queue>
#include<stack>
#include<numeric>
using namespace std;
#define INF (1 << 30) - 1
#define LINF 1LL << 60
const int MOD = 1000000007;
using ll = long long;
using P = pair<int, int>;

int main(){
  int h, n;
  cin >> h >> n;
  int sum = 0;
  for(int i = 0; i < n; ++i){
  	int a;
  	cin >> a;
  	sum += a;
  }

  if(sum >= h)cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 256
n, k = map(int, input().split())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7

plus = []
minus = []
for i in a:
    if i >= 0: plus.append(i)
    if i < 0: minus.append(-i)
plus.sort(reverse=True)
minus.sort(reverse=True)

ans = 1
i, j = 0, 0
if n == k:
    for x in a:
        ans = (ans * x) % mod
else:
    if k % 2 == 1:
        if len(plus) != 0:
            ans = plus[0]
            i += 1
        else:
            minus.sort()
            ans = -minus[0]
            j += 1
    while i + j != k:
        x_p = plus[i] * plus[i + 1] if i < len(plus) - 1 else 0
        x_m = minus[j] * minus[j + 1] if j < len(minus) - 1 else 0
        if x_p >= x_m and i != len(plus):
            ans = (ans * x_p) % mod
            i += 2
        else:
            ans = (ans * x_m) % mod
            j += 2
print(ans)


Measured memory_bytes: 30892
// https://atcoder.jp/contests/abcXXX/tasks/abcXXX_x

#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ull = unsigned long long;
using pll = pair<ll, ll>;

static const ll INF = 1001001001;
static const ll LLINF = 1001001001001001001;
static const ll MOD = (ll)1e9 + 7;
static const double EPS = 1e-9;

#define REP(i, n) for(ll i = 0; i < static_cast<ll>(n); ++i)
#define RANGE(i, m, n) for(ll i = (m); i <= static_cast<ll>(n); ++i)
#define RRANGE(i, m, n) for(ll i = static_cast<ll>(m); i >= static_cast<ll>(n); --i)
#define POSITIVE(x) (x)=((x) < 0) ? 0 : (x)

ll power(ll x, ll y) {
    ll ret = 1;
    while(y-- > 0) ret *= x;
    return ret;
}

ll gcd(ll a, ll b) {
    assert(a >= 0);
    assert(b >= 0);
    if (b == 0) return a;
    return gcd(b, a % b);
}

ll extgcd(ll a, ll b, ll& x, ll& y) {
    x = 1; y = 0;
    assert(a >= 0);
    assert(b >= 0);
    if (b == 0) return a;
    ll X, Y;
    auto d = extgcd(b, a % b, X, Y);
    x = Y;
    y = X - (a / b) * Y;
    return d;
}

int run(istream& in, ostream& out) {
    ll N;
    in >> N;
    vector<ll> v(N);
    ll total = 0;
    REP(i, N) {
        in >> v[i];
        total += v[i];
        total %= MOD;
    }
    ll ans = 0;
    REP(i, N-1) {
        total -= v[i];
        total += MOD;
        total %= MOD;
        ans += (total * v[i] % MOD);
        ans %= MOD;
    }
    out << ans << endl;
    return 0;
}

int main() {
    return run(cin, cout);
}


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

int main() {
  int N;
  string s;
  cin >> N >> s;
  int k = 0;
  int L = 0;
  int R = 0;
  int M = 0;
  for (int i = 0; i < N; i++) {
    if (s[i] == '(') {
      k++;
      L += 1;
    }
    if (s[i] == ')') {
      k--;
      R += 1;
    }
    M = min(M,k);
  }
  string sl, sr;
  for (int i = 0; i <-M; i++) {
    sl += '(';
  }
  for (int i = 0; i < L-M-R; i++) {
    sr += ')';
  }
  
  cout << sl << s << sr << endl;
}

Measured memory_bytes: 384
#include "bits/stdc++.h"
using namespace std;
typedef long long li;

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

    li n;
    cin >> n;
    vector<li> as(n);
    for (int i = 0; i < n; ++i) {
        cin >> as[i];
    }
    li ans = 0;

    li last = as[0];
    for (int i = 1; i < n; ++i) {
        ans += max(0LL, last - as[i]);
        last = max(as[i], last);
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 4776
N = int(input())
L = [int(i) for i in input().split()]
M = max(L)
A = min(L)
Z_L = list()
for i in range(A, M + 1):
  ZZ = 0
  for j in range(N):
    Z =  pow(L[j] - i, 2)
    ZZ += Z
  Z_L.append(ZZ)
print(min(Z_L))

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

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

using namespace std;

typedef long long ll;

class CFennecVsMonster {
public:
	void solve(std::istream& cin, std::ostream& cout) {
		int n,k;cin >> n >> k;
		vector<ll> a(n);
		for (int i = 0; i < n; ++i)
		{
			cin >> a[i];
		}

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

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

		ll ans = 0;
		if(k >= n){
			cout << 0 << endl;
		}else{
			for(int i = k;i < n;i++)ans += a[i];
			cout << ans << endl;
		}

	}
};


int main() {
	CFennecVsMonster solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 2424
#-----------------------------
#https://atcoder.jp/contests/agc008/submissions/15248942
import sys
 
sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))
#-----------------------------
R,G,B = inm()
K = ini()
X = 0
while R >= G:
    X += 1
    G *= 2

while G >= B:
    X += 1
    B *= 2

if X <= K:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 9204
// includes
#include <cstdio>
#include <cstdint>
#include <iostream>
#include <iomanip>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <utility>
#include <functional>
#include <cmath>
#include <climits>
#include <bitset>

// macros
#define ll long long int
#define pb push_back
#define mk make_pair
#define pq priority_queue
#define FOR(i, a, b) for(int i=(a); i<(b);++i)
#define rep(i, n) FOR(i, 0, n)

using namespace std;

//  types
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
typedef pair<ll, ll> Pll;
 
// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double EPS = 1e-10;

// solve

int main(int argc, char const* argv[])
{
  int n;
  cin >> n;
  vector<ll> a;
  ll xork = 0;
  rep(i, n){
    ll x;
    cin >> x;
    a.pb(x);
    xork = xork ^ x;
  }
  vector<int> num = vector<int>(100, 0);
  rep(i, n){
    int tmp = 0;
    while((a[i] >> tmp) % 2 == 0)tmp++;
    num[tmp + 1]++;
  }
  vector<int> bit;
  ll tmp = xork;
  while(tmp){
    bit.pb(tmp % 2);
    tmp /= 2;
  }
  int res = 0;
  reverse(bit.begin(), bit.end());
  rep(i, bit.size()){
    if(bit[i] == 0)continue;
    if(num[bit.size() - i] > 0){
      res++;
      FOR(j, i, bit.size()){
        bit[j] = 1 - bit[j];
      }
    }else{
      cout << - 1 << endl;
      return 0;
    }
  }
  cout << res << endl;
	return 0;
}


Measured memory_bytes: 1400
using System;
using System.Collections.Generic;
using System.Linq;

namespace AtCoderPractice
{
    static class Program
    {
        static void Main()
        {
            long n = long.Parse(Console.ReadLine());
            Console.WriteLine(n.ToBase26());
        }

        static string ToBase26(this long self)
        {
            //マイナスの数値が入らないなら不要
            //if (self <= 0) return "";
            long n = self % 26;
            if (n == 0) n = 26;
            string s = ((char)(n + 96)).ToString();
            //(n + 64)で大文字を出力↑
            if (self == n) return s;
            return ((self - n) / 26).ToBase26() + s;
        }
    }
}

Measured memory_bytes: 17528
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;

int main(void){
	int n,m,i,j,k,r,b;
	char d[2][20];
	ll dp[20][20],ans=0ll;
	string s;
	cin >> n;
	cin >> s;
	m = (1<<n);
	for(i=0; i<m; ++i){
		r = 0; b = 0;
		for(j=0; j<n; ++j){
			if((i&(1<<j))){
				d[0][r] = s[j];
				++r;
			}else{
				d[1][b] = s[j];
				++b;
			}
		}
		fill(dp[0],dp[20],0ll);
		dp[r][b] = 1ll;
		for(j=r; j>=0; --j){
			for(k=b; k>=0; --k){
				if(j > 0 && s[n+j+k-1] == d[0][r-j]){
					dp[j-1][k] += dp[j][k];
				}
				if(k > 0 && s[n+j+k-1] == d[1][b-k]){
					dp[j][k-1] += dp[j][k];
				}
			}
		}
		ans += dp[0][0];
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
N=int(input())
L=[3, 5, 7]
 
def dfs(s):
    if s>N:
        return False
 
    str_s = str(s)
    return sum(dfs(s*10 + i) for i in L) + ("7" in str_s and "5" in str_s and "3" in str_s)
 
 
print(dfs(0))

Measured memory_bytes: 9116
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Map.Entry;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.StringTokenizer;
import java.util.TreeMap;

public class Main {
	
	public static void main(String[] args) throws IOException {
		final Scanner sc = new Scanner(System.in);
		
		final long x = sc.nextLong();
		final long y = sc.nextLong();
		
		final boolean same_sign = Long.signum(x) == Long.signum(y);
		
		if(x == 0){ // 目的の数に合わせて正負を変える
			System.out.println((y >= 0) ? y : Math.abs(y) + 1);
		}else{
			if(Math.abs(x) == Math.abs(y)){ // 符号違い
				System.out.println(same_sign ? 0 : 1);
			}else {
				if(Math.abs(x) < Math.abs(y)){
					if(x < 0){
						System.out.println(1 + (Math.abs(y) - Math.abs(x)) + (y < 0 ? 1 : 0));
					}else{
						System.out.println(0 + (Math.abs(y) - Math.abs(x)) + (y < 0 ? 1 : 0));
					}
				}else if(Math.abs(x) > Math.abs(y)){
					if(x > 0){
						System.out.println(1 + (Math.abs(x) - Math.abs(y)) + (y > 0 ? 1 : 0));
					}else{
						System.out.println(0 + (Math.abs(x) - Math.abs(y)) + (y > 0 ? 1 : 0));
					}
				}
			}
		}
	}
	
	public static class Scanner implements Closeable {
		private BufferedReader br;
		private StringTokenizer tok;
 
		public Scanner(InputStream is) throws IOException {
			br = new BufferedReader(new InputStreamReader(is));
		}
 
		private void getLine() throws IOException {
			while (!hasNext()) {
				tok = new StringTokenizer(br.readLine());
			}
		}
 
		private boolean hasNext() {
			return tok != null && tok.hasMoreTokens();
		}
 
		public String next() throws IOException {
			getLine();
			return tok.nextToken();
		}
 
		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}
 
		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}
 
		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}
 
		public void close() throws IOException {
			br.close();
		}
	}
}

Measured memory_bytes: 8148
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<algorithm>
using namespace std;

int n,lim;
int a[100005];
struct hh
{
	int cnt;
	int id;
}c1[100005],c2[100005];
bool cmp(hh a,hh b)
{
	return a.cnt>b.cnt;
}
int main()
{
	int i;
	cin>>n;
	for(i=1;i<=n;i++)
		cin>>a[i],lim=max(lim,a[i]);
	for(i=1;i<=lim;i++)
		c1[i].id=c2[i].id=i;
	if(n==2)
	{
		if(a[1]==a[2]) cout<<1;
		else cout<<0;
		return 0;
	}
	for(i=1;i<=n;i++)
		if(i&1) c1[a[i]].cnt++;
		else c2[a[i]].cnt++;
	sort(c1+1,c1+1+lim,cmp); 
	sort(c2+1,c2+1+lim,cmp); 
	if(c1[1].id!=c2[1].id) cout<<n-c1[1].cnt-c2[1].cnt;
	else cout<<min(n-c1[2].cnt-c2[1].cnt,n-c1[1].cnt-c2[2].cnt);
	return 0;
} 



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

int	main()
{
	int	N;
	cin >> N;
	set<string>	S_set;
	string	S;
	for (int i = 0; i < N; ++i) {
		cin >> S;
		S_set.insert(S);
	}
	cout << S_set.size() << endl;
}


Measured memory_bytes: 19224