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

int main() {
#ifdef LOCAL_DEFINE
  //freopen("data.in", "rt", stdin);
  //freopen("data.out", "w", stdout);
  auto _start = chrono::high_resolution_clock::now();
#endif
	
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout << fixed << setprecision(15);
	int n;
	cin >> n;
	vector<int> a(n);
	for(int i = 0; i < n; i++) {
		cin >> a[i];
	}
	map<int, int> mpx, mpy;
	for(int i = 0; i < n; i += 2) {
		mpx[a[i]]++;
	}
	int xfi = 0, xse = 0;
	int xcnt0 = 0, xcnt1 = 0;
	for(auto &p : mpx) {
		if(p.second > xcnt0) {
			xcnt0 = p.second;
			xfi = p.first;
		}
	}
	mpx[xfi] = 0;
	for(auto &p : mpx) {
		if(p.second > xcnt1) {
			xcnt1 = p.second;
			xse = p.first;
		}
	}
	for(int i = 1; i < n; i += 2) {
		mpy[a[i]]++;
	}
	int yfi = 0, yse = 0;
	int ycnt0 = 0, ycnt1 = 0;
	for(auto &p : mpy) {
		if(p.second > ycnt0) {
			ycnt0 = p.second;
			yfi = p.first;
		}
	}
	mpy[yfi] = 0;
	for(auto &p : mpy) {
		if(p.second > ycnt1) {
			ycnt1 = p.second;
			yse = p.first;
		}
	}
	int ans = n;
	if(xfi != yfi) {
		ans = min(ans, n - xcnt0 - ycnt0);
	}
	if(xfi != yse) {
		ans = min(ans, n - xcnt0 - ycnt1);
	}
	if(xse != yfi) {
		ans = min(ans, n - xcnt1 - ycnt0);
	}
	if(xse != yse) {
		ans = min(ans, n - xcnt1 - ycnt1);
	}
	cout << ans << '\n';

#ifdef LOCAL_DEFINE
  auto _end = chrono::high_resolution_clock::now();
  cerr << "elapsed time: " << chrono::duration<double, milli>(_end - _start).count() << " ms\n";
#endif
	return 0;
}

Measured memory_bytes: 5376
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String[] sa = br.readLine().split(" ");
		long[] a = new long[n];
		for (int i = 0; i < n; i++) {
			a[i] = Long.parseLong(sa[i]);
		}
		br.close();

		long sum = 0;
		for (int i = 0; i < n; i++) {
			sum += a[i];
		}

		long sum1 = 0;
		int idx = 0;
		while (sum1 < sum - sum1) {
			sum1 += a[idx];
			idx++;
		}

		long ans1 = Math.abs(sum1 - (sum - sum1));
		sum1 -= a[idx - 1];
		long ans2 = Math.abs(sum1 - (sum - sum1));
		System.out.println(Math.min(ans1, ans2));
	}
}


Measured memory_bytes: 67632
import java.io.FileNotFoundException;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws FileNotFoundException {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		int K = sc.nextInt();
		int X = sc.nextInt();

		if(K*500>=X) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

	}
}


Measured memory_bytes: 21844
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn= 1e5+10;
struct Node
{
    ll a,b;
} s[maxn];
int vis[maxn];
priority_queue<ll,vector<ll>,greater<ll> >que;
bool cmp(Node a,Node b)
{
    return a.b>b.b;
}
int main()
{
    int  n,k;
    scanf("%d%d",&n,&k);
    for(int i=0; i<n; i++)
        scanf("%lld%lld",&s[i].a,&s[i].b);
   ll  t=0,tt;
    sort(s,s+n,cmp);
    ll sum=0,num=0;
    for(int i=0; i<k; i++)
    {
        sum+=s[i].b;
        if(vis[s[i].a]==0)
        {
            vis[s[i].a]=1;
            t++;

        }
        else
            que.push(s[i].b);

    }
    num=sum,tt=t;
    int flag=0;
    for(int i=k; i<n; i++)
    {

        if(vis[s[i].a])
            continue;
        else
        {
            if(que.empty())
                break;
            else
            {
                if((num+tt*tt)>(num-que.top()+s[i].b+(tt+1)*(tt+1)))
                {
                    num-=que.top();
                    num+=s[i].b;
                    tt++;
                    flag=1;
                  
                }
                else
                {
                    if(flag==0)
                    {
                        sum-=que.top();
                        sum+=s[i].b;
                        t++;
                    }
                    else
                    {
                        num-=que.top();
                        num+=s[i].b;
                        tt++;
                    }
                }
                que.pop();
                vis[s[i].a]=1;
            }
        }
        }
        ll ans=max(sum+t*t,num+tt*tt);
        cout<<ans<<endl;
        return 0;
    }


Measured memory_bytes: 2812
use std::i64;
use std::cmp;

// reference: https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
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 main(){
    input! {
        N: usize,
        K: usize,
        h: [i64; N],
    }

    let mut dp = vec![0; N];
    dp[0] = 0;
    for i in 1..cmp::min(K, N) {
        dp[i] = (h[0]-h[i]).abs();
    }
    for i in K .. N {
        let mut m = i64::MAX/10;
        for j in 1..K+1 {
            m = cmp::min(m, dp[i-j]+(h[i]-h[i-j]).abs());
        }
        dp[i] = m;
    }

    println!("{}", dp[N-1]);
}




Measured memory_bytes: 6396
S = str(input())

n = len(S)
ans = [0 for x in range(n)]
i = 0
ToRight = True
while i < n - 1:
    start = i
    while i < n - 1 and S[i + 1] == S[i]:
        i += 1
    if ToRight:
        ans[i] += (i + 1 - start) // 2 + (i + 1 - start) % 2
        ans[i + 1] += (i + 1 - start) // 2
    else:
        ans[start] += (i + 1 - start) // 2 + (i + 1 - start) % 2
        ans[start - 1] += (i + 1 - start) // 2
    i += 1
    ToRight = not ToRight
if S[n - 2] == 'R':
    ans[n - 1] += 1

for i in range(n):
    print(ans[i], end=' ')
    if i == n - 1:
        print('\n')

Measured memory_bytes: 4864
n, m = map(int, input().split())
edges = []
for _ in range(m):
    a, b, c = map(int, input().split())
    a -= 1
    b -= 1
    edges.append((a, b, -c))

init_v = 0
INF = float('inf')
dist = [INF]*n
dist[init_v] = 0
negative_cycle = 0
for i in range(2*n):
    for v, v2, c in edges:
        if dist[v2] <= dist[v]+c:
            continue
        dist[v2] = dist[v]+c
        if i >= n-1 and v2 == n-1:
            negative_cycle = 1

if negative_cycle:
    print('inf')
else:
    print(-dist[-1])

Measured memory_bytes: 3316
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef pair<int,int> pii;
typedef long long ll;
const long long MOD=1e09+7;



#define rep(i,n) for(int i=0;i<n;i++)
#define rep2(i,m,n) for(int i=m;i<n;i++)
#define ALL(v) v.begin(), v.end()
#define pb push_back



vvi fr;

vi group;

int n,m,k;

void dfs(int node, int color){
  group.at(node)=color;
  for (int next:fr.at(node)){
    if (group.at(next)==-1){
      dfs(next,color);
    }
  }
}

void dfsall(){
  
  int tmpcolor=1;
  dfs(1,tmpcolor);
  
  for (int i=2;i<=n;i++){
    if (group.at(i)==-1){
      tmpcolor++;
      dfs(i,tmpcolor);
    }
  }
}


int main(){


  cin>>n>>m>>k;
  

  fr.resize(n+1,vi(0));
  group.resize(n+1,-1);
 
  
  rep(i,m){
    int a,b;
    cin>>a>>b;
    fr.at(a).pb(b);
    fr.at(b).pb(a);
  }
  
  set<pii> block;
  rep(i,k){
    int c,d;
    cin>>c>>d;
    auto tmp=make_pair(c,d);
    block.insert(tmp);
  }
  
  dfsall();
  
  
  
  
  map<int,int> groupcnt;
  for (int i=1;i<=n;i++){
    int groupcolor=group.at(i);
    if (groupcnt.count(groupcolor)){
      groupcnt.at(groupcolor)++;
    }
    else {
      groupcnt[groupcolor]=1;
    }
  }

  vi answer(n+1);
  
  for (int i=1;i<=n;i++){
    answer.at(i)=groupcnt.at(group.at(i))-1-int(fr.at(i).size());
  }
  
  for (auto mypair:block){
    int c=mypair.first;
    int d=mypair.second;
    if (group.at(c)==group.at(d)){
      answer.at(c)--;
      answer.at(d)--;
    }
  }
  
  for (int i=1;i<=n;i++){
    cout<<answer.at(i)<<" ";
  }
  cout<<endl;

}




















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

int main(void){
  long int n;
  long int i;
  long int min;

  scanf("%ld",&n);
  min=n-1;
  for (i=2;i<=(int)sqrtl(n);i++){
    if (n%i==0){
      min=i+n/i-2;
    }
  }
  printf("%ld\n",min);
  return 0;
}


Measured memory_bytes: 128
#include <algorithm>
#include <iterator>
#include <iostream>
#include <iomanip>
#include <utility>
#include <string>
#include <vector>
#include <limits>
#include <queue>
#include <cmath>
#include <map>
#include <set>

using namespace std;

typedef long long ll;

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

    vector<int> a(n + 2);

    for(int i = 1; i < n + 1; i++)
        cin >> a[i];

    int out = 0;
    for(int i = 1; i < n + 2; i++)
        out += abs(a[i] - a[i - 1]);

    for(int i = 1; i < n + 1; i++) {
        int prev = a[i - 1];
        int next = a[i + 1];
        int cur = out - abs(prev - a[i]) - abs(a[i] - next) + abs(prev - next);
        cout << cur << "\n";
    }

    return 0;
}


Measured memory_bytes: 1664
#include <iostream>
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;

int main()
{
	int a,b,ans=-1;
	cin>>a>>b;
	rep(i,1200){
	    if(i*8/100==a&&i/10==b){
	        ans=i;
	        break;
	    }
	}
	cout<<ans;
	return 0;
}

Measured memory_bytes: 256
package main

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

var sc = bufio.NewScanner(os.Stdin)

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

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

func main() {
	// sc.Split(bufio.ScanWords)

	var slice string
	fmt.Scan(&slice)
	res := make([]string, len(slice)/2+1)

	// for i, s := range slice {
	// 	if (i+1)%2 == 0 {
	// 		continue
	// 	}
	// 	res = append(res, string(s))
	// }
	// fmt.Println(len(slice))
	for i := 0; i < len(slice); i += 2 {
		res = append(res, string(slice[i]))
	}

	fmt.Println(strings.Join(res, ""))
}


Measured memory_bytes: 6144
#include <bits/stdc++.h>
using namespace std;
int main(){
  string S;
  cin>>S;
  bool A=false;
  for(int i=0;i<S.size();i++){
    if(A==false&&S.at(i)=='A'){
      A=true;
      continue;
    }
    if(A==true&&S.at(i)=='C'){
      cout<<"Yes"<<endl;
      break;
    }
    if(A==true&&S.at(i)!='C')A=false;
    if(i==S.size()-1)cout<<"No"<<endl;
  }
}

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

int main(){
        int A, B, C, D;
        cin >> A >> B >> C >> D;

        for(int i = 0; i < 1000; ++i){
                if(C - B <= 0){ 
                        cout << "Yes" << endl;
                        break;
                }
                if(A - D <= 0){ 
                        cout << "No" << endl;
                        break;
                }
                C -= B;
                A -= D;
        }

        return 0;
}


Measured memory_bytes: 3608
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        if ((a * b) % 2 == 0) {
            System.out.println("Even");
        } else {
            System.out.println("Odd");
        }
    }
}

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

typedef long long ll;
#define mod 1000000007

int main() 
{
    ll n,m;
    cin>>n>>m;
    map<ll,ll> mp;
    for(ll i=0;i<m;i++)
    {
        ll a,b;
        cin>>a>>b;
        if(mp.find(a)!=mp.end())
        {
            if(mp[a]!=b)
            {
                cout<<-1<<endl;
                return 0;
            }
        }
        else
        {
            if(a==1 and b==0 and n!=1)
            {
                cout<<-1<<endl;
                return 0;
            }
            mp[a]=b;
        }
    }
    vector<ll> ans(n+1,0);
    for(auto i=mp.begin();i!=mp.end();i++)
    {
        ans[i->first]=i->second;
    }
    if(ans[1]==0 and n!=1)   ans[1]=1;
    for(ll i=1;i<=n;i++)
    {
        cout<<ans[i];
    }
    cout<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string.h>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <functional>
#include <cassert>
#include <utility>
#include <stack>
#include <queue>
using namespace std;
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,n1,n2) for(int i=n1;i<n2;i++)
#define speed_up    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
typedef pair<int,int> Pi;
typedef long long int ll;
const int INF=(ll)(1<<30)-1;
const ll INFl=(ll)9223372036854775807;
const int MAX=10000;
const ll MOD=(ll)1e9+7;
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a/gcd(a, b)*b;}
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};

int n;
int c[510],s[510],f[510];

int main(){
	cin>>n;
	REP(i,n-1)
		cin>>c[i]>>s[i]>>f[i];
	
	for(int i=0;i<n;i++){
		int ans=0;
		for(int j=i;j<n-1;j++){
			if(ans<=s[j]){
				ans=s[j]+c[j];
			}else{
				int q=ans-s[j];
				q=(q+f[j]-1)/f[j];
				q=q*f[j];
				ans=s[j]+q+c[j];
			}
		}
		cout<<ans<<endl;
	}
	return 0;
}

Measured memory_bytes: 256
while True:
    try:
        a0 = float(input().strip())
        s = a0
        for i in range(1,10):
            if i % 2 == 1:
                a1 = a0*2
            else:
                a1 = a0/3
            s += a1
            a0 = a1
        print(s)

    except EOFError:
        break

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

using namespace std;

typedef long long  ll;

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

    int n, l;

    cin >> n >> l;
    vector<string> s(n);
    for (int i = 0; i < n; ++i)
        cin >> s[i];

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

    for (auto x : s)
        cout << x;
    cout << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll= long long;
using vi= vector<int>;
using vvi= vector<vi>;
using vd= vector<double>;
using vc= vector<char>;
#define REP(i,x,n) for(int i=x; i<n; i++)
#define rep(i,n) REP(i,0,n)
#define all(x) x.begin(), x.end()

int main(){
  int n,x,cnt=1,d=0;
  cin >> n >> x;
  vi l(n);
  rep(i,n){
    cin >> l[i];
    d+=l[i];
    if(d<=x)  cnt++;
    else break;
  }
  cout << cnt << endl;
}


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

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep2(i,a,b) for(int i=a;i<b;i++)
#define each(it,v) for(auto it : v)
#define mod 1000000007
#define All(v) (v).begin(),(v).end()
#define ll long long
#define vi vector<int>
#define vll vector<ll>
#define vpii vector<pair<int,int>>
#define vv vector<vector<int>>
template<class T> T gcd(T a,T b) {return b?gcd(b,a%b):a;}
template<class T> T lcm(T a,T b) {return a/gcd(a,b)*b; }
template<class T> bool isPrime(T num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false;

    double sqrtNum = sqrt(num);
    for (T i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return false;
        }
    }
    return true;
}

using namespace std;

int n;

main()
{
        cin>>n;

        vector<pair<string,int>> v(n);

        each(&it,v)cin>>it.first>>it.second;

        string x;
        cin>>x;

        int ans=0;
        bool f=false;
        each(it,v)
        {
            if(f)ans+=it.second;
            if(it.first==x)f=true;

        }
        cout<<ans<<endl;
}

Measured memory_bytes: 764
import java.math.BigInteger;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner scanner = new Scanner(System.in);

		int[] test = new int[2000];

//		for(int i = 0; i < 2000; i++) {
//			test[i] = 100;
//		}

		int N = scanner.nextInt();

		long K = scanner.nextInt();

//		long N = scanner.nextLong();
//
//		long ans =0;
//		for(long index=0; index < N; index++) {
//			ans+=index+1;
//		}
//
//		log(ans-N);

		int[] scannerArray = new int[N];

		int maxNumber = 0;
		int number = 0;

		for (int index = 0; index < N; index++) {
			number = scanner.nextInt();
			scannerArray[index] = number;
			if (maxNumber < number) {
				maxNumber = number;
			}

		}

		long tmp = countSwapBabbleSort(scannerArray, maxNumber);

		long pair = 0;

		for(int indexI = 0; indexI < N; indexI++) {
			for(int indexJ = 0; indexJ < N; indexJ++) {
				if(scannerArray[indexI] > scannerArray[indexJ]) {
					pair++;
				}
			}
		}

		BigInteger pairOfK = BigInteger.valueOf((long)pair)
				.multiply(BigInteger.valueOf((long)K))
				.multiply((BigInteger.valueOf((long)K)).subtract(BigInteger.ONE))
				.divide(BigInteger.valueOf((long)2));
		log(BigInteger.valueOf((long)tmp).multiply(BigInteger.valueOf((long)K)).add(pairOfK)
				.remainder(BigInteger.valueOf((long)1000000007)
				));

//		log((
//				(BigInteger.valueOf((long)tmp)
//				.multiply(BigInteger.valueOf((long)K)
//						))
//				.add((
//						BigInteger.valueOf((long)tmp)
//						.multiply(
//								BigInteger.valueOf((long)K)
//								.multiply(
//										BigInteger.valueOf((long)K)
//										.subtract(BigInteger.ONE)
//										)
//								.divide(BigInteger.valueOf((long)2)
//										)
//								)
//						)))
//				.remainder(
//						BigInteger.valueOf((long)1000000007)
//						)
//				);
	}


	/**
	 * バブルソートの交換数を算出
	 * ※転倒数
	 * @param array
	 * @return
	 */
	private static long countSwapBabbleSort(int[] array, int N) {
		long ans = 0;
		int[] binary = new int[N + 1];

		for (int index = 0; index < array.length; index++) {
			ans = ans + (index - sum(binary, array[index]));
			add(binary, array[index], 1);
		}
		return ans;
	}

    //add value at idx on bit O(logN)
	private static void add(int[] bit,int idx,int value) {
        for(int i=idx;i<bit.length;i=i+(i&-i)) {
        	bit[i] += value;
        }
    }

    //return sum [1,idx] O(logN)
	private static long sum(int[] bit,int idx) {
        long ret = 0;
        for(int i=idx;i>0;i-=(i&-i)) {
        	ret += bit[i];
        }
        return ret;
    }

	private static void log(String str) {
		System.out.println(str);
	}

	private static void log(int str) {
		System.out.println(str);
	}

	private static void log(long str) {
		System.out.println(str);
	}

	private static void log(double str) {
		System.out.println(str);
	}

	private static void log(BigInteger str) {
		System.out.println(str);
	}

}



Measured memory_bytes: 26048
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 520;
ll a[N][N], s1[N][N], s2[N][N];
int n;
inline void Pref(ll x[N][N]){
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			// cout << x[i][j] << " ";
			x[i][j]+=x[i-1][j]+x[i][j-1]-x[i-1][j-1];
		}
		// puts("");
	}
}
inline ll Sum(ll x[N][N], int x1,int x2,int y1,int y2){
	return x[x2][y2]+x[x1-1][y1-1]-x[x1-1][y2]-x[x2][y1-1];
}

ll f[N][N];

int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++)if(j!=i){
			scanf("%lld",&a[i][j]);
			if(i<j)s1[i][j]=a[i][j];
			else s2[i][j]=a[i][j];
		}
	}
	Pref(s1),Pref(s2);
	for(int i=0;i<=n+1;i++){
		for(int j=0;j<=n+1;j++)
			f[i][j]=1e18;
	}
	f[0][0]=0;
	for(int i=0;i<=n;i++){
		for(int j=0;j<max(i,1);j++){
			for(int k=i+1;k<=n;k++){
				ll tmp = f[i][j]+Sum(s2,k+1,n,j+1,i)+Sum(s1,i+1,k,i+1,k);
				// cout << i << j << " "<< f[i][j] << " " << k << " " << tmp << endl;
				f[k][i]=min(f[k][i],tmp);
			}
		}
	}
	ll ans=f[n][0];
	for(int i=1;i<=n;i++)ans=min(ans,f[n][i]);
	cout << ans << endl;
}

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

int main(){
    string a,t;
    cin >> a >> t;
    ll ans=0;
    for(ll i=0;i<a.length();i++){
        if(a[i]!=t[i])ans++;
    }
    cout << ans;
    return 0;
}



Measured memory_bytes: 3892
#include <algorithm>
#include <bitset>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <unordered_map>
#include <unordered_set>

using namespace std;

#define ll long long
#define pb push_back
#define debug1(x) cerr << #x << " = " << x << '\n';
#define debug2(x, y) cerr << #x << " = " << x << "   " << #y << " = " << y << "\n";
#define _ ios_base::sync_with_stdio(0);cin.tie(NULL);

const ll mod = 1000000007;
const int N = 200005;
vector<int> v[N];
bool vis[N];
int cnt[N] = {};
int component = 0;

void dfs(int root) {
    vis[root] = true;
    cnt[root] = component;
    for(auto u: v[root]) {
        if(!vis[u]) {
            cnt[u] = component;
            dfs(u);
        }
    }
}

void solve() {
    int n, e;
    cin >> n >> e;
    memset(vis, false, sizeof(vis));
    set<pair<int, int>> st;
    for(int i = 0; i<e; i++) {
        int x, y;
        cin >> x >> y;
        if(x > y) swap(x, y);
        st.insert({x, y});
    }
    int si = int(st.size());
    for(auto it: st) {
        int x = it.first;
        int y = it.second;
        v[x].pb(y);
        v[y].pb(x);
    }
    for(int i = 1; i<=n; i++) {
        if(!vis[i]) {
            component ++;
            dfs(i);
        }
    }
    map<int, int> mp;
    for(int i = 1; i<=n; i++) {
        mp[cnt[i]]++;
    }
    int ans = 0;
    for(auto it: mp) {
        ans = max(ans, it.second);
    }
    cout << ans << '\n';
}

int main() {_
    int t = 1;
//    cin >> t;
    for(int i = 1; i<=t; i++) {
        solve();
    }
    return 0;
}


Measured memory_bytes: 34248
#include <iostream>

using namespace std;

int a[105];
int n;
long res = 10000005;

long check(long value)
{
	long ret = 0;

	for (int i = 0; i < n; ++i)
		ret += (a[i] - value) * (a[i] - value);

	return ret;
}

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

	for (int i = -10000; i <= 10000; ++i)
	{
		long ret = check(i);
		if (ret < res)
			res = ret;
	}

	cout << res << endl;

	return 0;
}


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

bitset<1001001001> is_prime(0);
vector<int> prime_numbers;
void sieve_of_eratosthenes(int n=1e8) {
  for (int i = 2; i < n + 1; i++) {is_prime.set(i);}
  for (int i = 2; i < (int)sqrt(n) + 1; i++) {
    if (is_prime[i]) for (int j = i * 2; j < n + 1; j += i) is_prime.reset(j);
  }
  for (int i = 2; i < n + 1; i++) if (is_prime[i]) prime_numbers.push_back(i);
}

unordered_map<int, int> prime_factorize(int n) {
  unordered_map<int, int> res;
  int border = int(sqrt(n));
  for (int &p : prime_numbers) {
    if (p > border) break;
    if (n % p == 0) {
      res[p] = 1; n /= p;
      while (n % p == 0) {res[p]++; n /= p;}
    }
    if (n == 1) return res;
  }
  res[n] = 1; return res;
}

unordered_map<int, int> prime_factorize_factorial(int n) {
  unordered_map<int, int> res;
  for (int i = 2; i < n + 1; i++) {
    for (auto &pc : prime_factorize(i)) {
      if (res.find(pc.first) == res.end()) res[pc.first] = pc.second;
      else res[pc.first] += pc.second;
    }
  }
  return res;
}

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

  int x; cin >> x;
  int i = lower_bound(prime_numbers.begin(), prime_numbers.end(), x) - prime_numbers.begin();
  cout << prime_numbers[i] << '\n';
  return 0;
}

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

int main(int argc, const char * argv[]) {
    // insert code here...
    int A, B;
    cin >> A >> B;
    
    if (A + B < 10) cout << A + B << endl;
    else cout << "error" << endl;
    
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<functional>
using namespace std;
int main(void)
{
	int A, B, C;
	scanf("%d%d%d", &A, &B, &C);
	int on;
	on = A - B;
	if (C - on >= 0) {
		printf("%d", C - on);
	}
	else {
		printf("0");
	}
	return 0;
}


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

int main() {
  int A, B;
  cin >> A >> B;

  for (int x = 1; x <= 1000; ++x) {
    if (floor(x * 0.08) == A && floor(x * 0.10) == B) {
      cout << x << endl;
      return 0;
    }
  }

  cout << -1 << endl;
  return 0;
}


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

// 総数を1000000007（素数）で割った余り
const long long mod = 1e9 + 7;

using ll = long long;
using pii  = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pii>
#define vpll vector<pll>

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; i++)
#define rep1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; i++)
#define repr(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rep1r(i, n) for (int i = ((int)(n)); i >= 1; i--)

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RSORT(x) sort(rall(x));
#define pb push_back
#define mp make_pair

#define INF (1e9)
#define PI (acos(-1))
#define EPS (1e-7)

ull gcd(ull a, ull b) { return b ? gcd(b, a % b) : a; }
ull lcm(ull a, ull b) { return a / gcd(a, b) * b; }

string s;
vector<char> ans(3);
void dfs(int i, int sum, vector<char> c) {
    if (i == 3) {
        if (sum == 7) ans = c;
        return;
    }
    c[i] = '+';
    dfs(i+1, sum+(s[i+1]-'0'), c);
    c[i] = '-';
    dfs(i+1, sum-(s[i+1]-'0'), c);
}

int main(){
    cin >> s;
    int sum = s[0] - '0';
    vector<char> c(3);
    dfs(0, sum, c);
    cout << s[0];
    rep(i, 3) cout << ans[i] << s[i+1];
    cout << "=7" << endl;
    return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python3
import sys
import os
import numpy as np

N,C,K = map(int, str(input()).split())


v = list()

for i in range(0,N):
  t = int(input())
  v.append(t)

v.sort()

M = 1000000009
now_n = 0
now_f = M
ans = 0

for i in range(0,N):
  if now_n >= C or (now_f != M and v[i]-now_f > K):
    ans += 1
    now_n = 0
    now_f = M
  now_f = min(now_f, v[i])
  now_n += 1

if now_n != 0:
  ans += 1

# print(v)
print(ans)


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

int main() {
    string s;
    cin >> s;
    int n = s.size();
    int cnt = n-1;
    long long ans = 0;
    for (int i = n; i >= 0; --i) {
        if (s[i] == 'B') {
            ans += cnt - i;
            cnt--;
        }
    }
    cout << ans << endl;
}

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

double myabs(double x){
    if (x < 0) x *= -1;
    return x;
}

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

    vector<double> h(n);
    long tmp;

    for (int i = 0; i < n; i++){
        cin >> tmp;
        h[i] = t - tmp * 0.006;
    }
    
    int min_arg = 1;
    double min = myabs(h[0]-a);
    double tmp2;
    for (int i = 1; i < n; i++){
        tmp2 = myabs(h[i]-a);
        if (tmp2 < min){
            min = tmp2;
            min_arg = i + 1;
        }
    }
    cout << min_arg << "\n";

}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <numeric>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <cmath>
#include <bitset>
#include <cassert>
#include <queue>
#include <deque>
#include <cassert>
#define For(i, a, b) for (int i = a; i < b; ++i)
#define Out(i, a, b) for (int i = a - 1; i >= b; --i)
#define pb push_back
#define mp make_pair
#define x first
#define y second
#define files(FileName) read(FileName); write(FileName)
#define read(FileName) freopen((FileName + ".in").c_str(), "r", stdin)
#define write(FileName) freopen((FileName + ".out").c_str(), "w", stdout)
using namespace std;
template<typename T1, typename T2>inline void chkmin(T1 &x, T2 y) { if (x > y) x = y; }
template<typename T1, typename T2>inline void chkmax(T1 &x, T2 y) { if (x < y) x = y; }

using namespace std;

typedef long long base;
typedef pair <int, int> point;

const string FILENAME = "input";
const int MAXN = 1e5 + 1, RAME = 10;
const int dirx[4] = {0, 1, 0, -1}, diry[4] = {1, 0, -1, 0};


int n, m, k;
bool can[801][801], used[801][801];
point s;
queue <pair <point, int>> que;

int main() {
    //read(FILENAME);
    ios::sync_with_stdio(0);
    cin >> n >> m >> k;
    for (int i = 0; i < n; ++i) {
        char c;
        for (int j = 0; j < m; ++j) {
            cin >> c;
            if (c == '#') {
                used[i][j] = true;
            } else if (c == 'S') {
                s = {i, j};
            }
        }
    }
    que.push({s, 0});
    used[s.x][s.y] = true;
    int ans = 1e9;
    while (que.size()) {
        auto v = que.front();
        que.pop();
        chkmin(ans, (abs(0 - v.x.x) - 1) / k);
        chkmin(ans, (abs(n - v.x.x - 1) - 1) / k);
        chkmin(ans, (abs(0 - v.x.y) - 1) / k);
        chkmin(ans, (abs(m - v.x.y - 1) - 1) / k);
        if (v.x.x == 0 || v.x.x == n - 1 || v.x.y == 0 || v.x.y == m - 1) {
            cout << 1 << endl;
            return 0;
        }
        if (v.y < k) {
            for (int d = 0; d < 4; ++d) {
                point u = {v.x.x + dirx[d], v.x.y + diry[d]};
                if (!used[u.x][u.y]) {
                    used[u.x][u.y] = true;
                    que.push({u, v.y + 1});
                }
            }
        }
    }
    cout << ans + 2 << endl;
}

Measured memory_bytes: 896
#include<bits/stdc++.h>
 #include <ext/pb_ds/tree_policy.hpp>
 #include <ext/pb_ds/assoc_container.hpp>
 #include<chrono>
 using namespace std;
 using namespace std::chrono;      
 using namespace __gnu_pbds; 
 #define fastio     ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
 #define fi         first
 #define se         second
#define int         long long 
 #define pb         push_back
 #define emp        emplace_back
 #define vv(x)      vector<x>
 #define mp(x,y)    map<x,y>
 #define dq(x)      deque<x>
 #define pql(x)     priority_queue<x>
 #define pqs(x)     priority_queue<x,vv(x),greater<x> >
 #define M          1000000007
 #define forf(i,a,b) for(int i=a;i<b;i++)
 #define it(x)      x::iterator
 #define ll         long long 
 #define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
 #define time__(d)  for(long blockTime = 0; (blockTime == 0 ? (blockTime=clock()) != 0 : false); debug("%s time : %.4fs", d, (double)(clock() - blockTime) / CLOCKS_PER_SEC))
 #define vii        vector<int>
 #define big        1e18
 #define sm         -1e18
 #define mkr        make_pair
 #define vpi        vector<pair<int,int> >
 #define pii        pair<int,int>
 #define rng        500005
 #define sz(x)      (int)x.size()
 #define rv(x)      reverse(x.begin(),x.end())
 #define out(x)     cout<<x.fi<<" "<<x.se<<endl;

//#define ordered_set tree<pii, null_type,less<pii>, rb_tree_tag,tree_order_statistics_node_update> 
  
void pr_init()
{
   
    #ifndef ONLINE_JUDGE
    freopen("gin.txt", "r", stdin);
    freopen("gout.txt", "w", stdout);
   
    #endif
}


int pen[100005], points[100005];
void solve()
{
  int n,m;
  cin >> n >> m;

  forf(i,0,m)
  {
    int p;
    string s;
    cin >> p >> s;
    if(s=="WA")
    {
       if(!points[p]) pen[p]++;

    }else
    {
      points[p]=1;
    }
  }

  int a1=0,a2=0;

  forf(i,1,n+1)
  {
    if(points[i]) a1++ , a2 += pen[i];

  }

  cout<<a1<<" "<<a2<<"\n";


}


int32_t main()
{
  pr_init();
  fastio;
  
  auto start = high_resolution_clock::now(); 
 
  solve();
  auto stop = high_resolution_clock::now();
  auto duration = duration_cast<microseconds>(stop - start); 
   // cout << "Time taken by function: "
   //       << duration.count() << " microseconds" << endl; 

 }
      
      

Measured memory_bytes: 5092
#include <stdio.h>

int main (void){

	int m = 0 ;		//??????????¨?????????°
	int f = 0 ;		//??????????¨?????????°
	int r = 0 ;		//???????¨?????????°

	char evl = '0' ;		//??????

	do{
		/*???????????????????????¨????????°?????????*/
		scanf("%d", &m);
		scanf("%d", &f);
		scanf("%d", &r);

		if( m == -1 && f == -1 && r == -1 ){	//??¨???-1????????°??????????????°
			evl = 'N' ;
		}
		else if( m == -1 || f == -1){	//m???f???-1????????????F
			evl = 'F' ;
		}
		else if( m + f >= 80){		//m+f???80??\?????§A
			evl = 'A' ;
		}
		else if( m + f >= 65){		//m+f???65??\?????§B 80??????????????¶???else???????????§??????
			evl = 'B' ;
		}
		else if( m + f >= 50){		//m+f???50??\?????§C 65??????????????¶???else???????????§??????
			evl = 'C' ;
		}
		else if( m + f >= 30){		//m+f???30??\????????´??????r???50??\?????§C???50?????????D
			if( r >= 50){
				evl = 'C' ;
			}
			else{
				evl = 'D' ;
			}
		}
		else{						//???????????§??????????????????????????£?????????????????°m+f???30??????????????§F
			evl = 'F' ;
		}

		if( evl != 'N'){		//?????????????????????????????????????????°?????¨?????????????????????????????????
			printf("%c\n" , evl );
		}

	}while( evl != 'N');			//??????N?????????????????°


	return 0;
}

Measured memory_bytes: 600
n = int(input())
a, b, c = map(str, [input() for i in range(3)])
#print(n, a, b, c)
result = ""
sum = 0

def count_same(ca, cb, cc):
    ct = 0
    if ca == cb == cc:
        return 3
    if ca == cb:
        return ca
    if cb == cc:
        return cb
    if cc == ca:
        return cc
    return 0
for i in range(n):
    tmp = count_same(a[i], b[i], c[i])
    if tmp == 3:
        result += a[i]
    elif tmp == 0:
        result += a[i]
        sum += 2
    else:
        result += tmp
        sum += 1

print(sum)

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

#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORTASC(c) sort((c).begin(),(c).end())
#define SORTDESC(c,t) sort((c).begin(),(c).end(), std::greater<t>());
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define VMAX(a) *max_element(ALL(a))
#define VMIN(a) *min_element(ALL(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

const double PI  = acos(-1.0);

using ll = long long;
using namespace std;

int main() {
    ll n, m;

    cin >> n >> m;

    if (n == m){
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <utility>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
using namespace std;
#define INF 2147483647
#define LINF 9223372036854775807
#define MOD 1000000007
//#define int long long
#define rep(i, n) for (int i = 0; i < n; i++)
#define repb(i, n) for (int i = n - 1; i >= 0; i--)
#define MODE 1
#ifdef MODE
#define DEB(X) cout << #X << ": " << X << " ";
#define ARDEB(i, X) cout << #X << "[" << i << "]: " << X[i] << " ";
#define END cout << endl;
#else
#define DEB(X) \
    {          \
    }
#define ARDEB(i, X) \
    {               \
    }
#define END \
    {       \
    }
#endif
typedef pair<int, int> P;
typedef long long ll;

signed main()
{

    int h, w, n;
    int a[111111], ans[111][111];
    cin >> h >> w >> n;
    rep(i, n) cin >> a[i];
    int j = 0;
    int co = 0, k = 0;
    rep(i, h)
    {
        if (i % 2 == 0)
        {
            rep(j, w)
            {
                ans[i][j] = k + 1;
                co++;
                if (co == a[k])
                {
                    co = 0;
                    k++;
                }
            }
        }
        else
        {
            repb(j, w)
            {
                ans[i][j] = k + 1;
                co++;
                if (co == a[k])
                {
                    co = 0;
                    k++;
                }
            }
        }
    }
    rep(i, h)
    {
        rep(j, w) cout << ans[i][j] << endl;
        cout << endl;
    }
}


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

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

    vector<int> ans(1000000, 0);
   
    
    for(int i=1; i<=100; i++){
        for(int j=1; j<=100; j++){
            for(int k=1; k<=100; k++){
               int num =  i* i + j * j + k * k + i * j + j * k + k * i;
               ans.at(num) += 1;
            }
        }
    }



for(int i=1; i<=n; i++) cout << ans.at(i) << endl;

}

Measured memory_bytes: 7128
#include<bits/stdc++.h>
using namespace std;
int main()
{
  string s;
  cin>>s;
  if(s=="abc"||s=="acb"||s=="bac"||s=="bca"||s=="cab"||s=="cba")cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
  return 0;
}


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(){
  int K,N;
  cin>>K>>N;
  int A[N];
  rep(i,N)cin>>A[i];
  
  int dist=0;
  int maxdist=0;
  
  rep(i,N){
    if(i==N-1){
      dist=K+A[0]-A[i];
    }else{
      dist=A[i+1]-A[i];
    }
    if(dist>maxdist)maxdist=dist;
  }
  
  cout<<K-maxdist<<endl;

}


Measured memory_bytes: 1024
import java.io.*;
import java.util.*;

public class Main {

	final static long MOD = 1000000007;
	public static String[] Ws = null;
	public static int wsIndx = 0;
	public static BufferedReader in = null;
	public static void main(String[] args) throws Exception {
		solution(args);
		if(in!=null){
			in.close();
		}
	}

	public static void solution(String[] args) throws Exception{

		int N=nextInt();


		System.out.printf("%.6f\n",(N+1)/2/(double)N);

	}
	public static String[] toStringArray(String s) {
		String[] tmp = new String[s.length()];
		char[] c = s.toCharArray();
		for (int i = 0; i < tmp.length; i++) {
			tmp[i] = String.valueOf(c[i]);
		}
		return tmp;
	}

	public static void check() throws Exception{
		if(in == null){
			in = new BufferedReader(new InputStreamReader(System.in));
		}
		if(Ws==null || Ws.length<=wsIndx){
			Ws = in.readLine().split(" ");
			wsIndx=0;
		}
	}
	public static int nextInt()throws Exception{
		check();
		return Integer.parseInt(Ws[wsIndx++]);
	}

	public static long nextLong()throws Exception{
		check();
		return Long.parseLong(Ws[wsIndx++]);
	}

	public static String nextString()throws Exception{
		check();
		return Ws[wsIndx++];
	}

	public static int[] nextInts()throws Exception{
		check();
		int[] tmp = new int[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Integer.parseInt(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static long[] nextLongs()throws Exception{
		check();
		long[] tmp = new long[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Long.parseLong(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static String[] nextStrings()throws Exception{
		check();
		wsIndx=Ws.length;
		return Ws;
	}


}


Measured memory_bytes: 21332
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
	ll a, b, c, d;
	cin >> a >> b >> c >> d;
	ll ans = a * c;
	ans = max(ans, a * d);
	ans = max(ans, b * c);
	ans = max(ans, b * d);
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3632
#ifndef LOCAL
#pragma GCC optimize("O3")
#endif
#include "bits/stdc++.h"
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);
typedef long long ll;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> indexed_set; 
const ll INF = 1e9 + 10 ;
const ll N = 110 ; 
int main(){
    fastio
    int n ; 
    cin >> n ;
    cout << n * n * n << endl;
    return 0 ;
}









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

signed main(){
    // cout << fixed << setprecision(10) << flush;

    int N;
    cin >> N;
    vector<int> a(N);
    bool flag = false;
    for(int i=0; i<N; i++){
        cin >> a[i];
        if(a[i] % 2 == 1){
            flag = true;
        }
    }
    if(flag){
        cout << "first" << endl;
    }
    else{
        cout << "second" << endl;
    }

    return 0;
}

Measured memory_bytes: 4056
#include<algorithm>
#include<cmath>
#include<fstream>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<random>
#include<set>
#include<sstream>
#include<sys/time.h>
#include<unordered_map>
#include<unordered_set>
#include<vector>
#define REP(i, n) for(int i = 0; i < n; i++)
#define dump(x) cout << #x << " = " << (x) << endl;
using namespace std;
using ll = long long;
using P = pair<ll, ll>;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  set<string> S;
  vector<pair<int, string>> A;
  vector<pair<int, string>> B;
  REP(i, N) {
    string s;
    int p;
    cin >> s >> p;
    S.insert(s);
    A.push_back(make_pair(p, s));
    B.push_back(make_pair(p, s));
  }
  sort(A.begin(), A.end());
  for(auto x : S) {
    for(int i = N; i >= 0; i--) {
      if(A[i].second == x) {
        for(int j = 0; j < N; j++) {
          if(A[i].first == B[j].first && A[i].second == B[j].second) {
            cout << j + 1 << endl;
          }
        }
      }
    }
  }
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int mod = 1000000007;

int main() {
    ios::sync_with_stdio(false);
    int a, b, c;
    cin >> a >> b >> c;
    cout << a + b + c - max({a, b, c});
}


Measured memory_bytes: 256
n=int(input())

count=1
sum=1
sum_old=2
sum_k=0

if n==0:
  print(2)
elif n==1:
  print(1)
else:
  while count<n:
    sum_k=sum
    sum+=sum_old
    sum_old=sum_k
    count+=1
  print(sum)

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

int main(){
    int N; cin >> N;
    vector<int> V(N),C(N);
    int total = 0;
    int diff = 0;

    for(int i=0; i<N; i++)
        cin >> V[i];
    for(int i=0; i<N; i++){
        cin >> C[i];
        diff = V[i] - C[i];
        if(diff>0)
            total += diff;
    }
    cout << total << endl;
        return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <cstdio>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <cstring>
#include <functional>
#include <cmath>
#include <complex>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)
#define rep1(i,n) for(int i=1;i<=(n);++i)
#define all(c) (c).begin(),(c).end()
#define fs first
#define sc second
#define pb push_back
#define show(x) cout << #x << " " << x << endl
typedef pair<int,int> P;
vector<P> vc;
int main(){
	while(true){
		int n,w,d;
		cin>>n>>w>>d;
		if(w==0) break;
		vc.clear();
		vc.pb(P(w,d));
		rep(i,n){
			int x,s;
			cin>>x>>s;
			x--;
			P p=vc[x];
			vc.erase(vc.begin()+x);
			int a=p.fs,b=p.sc;
			s%=(a+b);
			if(s<a){
				int y=min(s,a-s),z=max(s,a-s);
				vc.pb(P(y,b));
				vc.pb(P(z,b));
			}else{
				s-=a;
				int y=min(s,b-s),z=max(s,b-s);
				vc.pb(P(a,y));
				vc.pb(P(a,z));
			}
		}
		vector<int> ans;
		rep(i,n+1){
			ans.pb(vc[i].fs*vc[i].sc);
		}
		sort(all(ans));
		rep(i,n) cout<<ans[i]<<" ";
		cout<<ans[n]<<endl;
	}
}

Measured memory_bytes: 1220
#include <stdio.h>
int find(int n,int p[]){
    if(p[n]==n)return n;
    return p[n]=find(p[n],p);
}
int main(){
    int l,r,p[10000],a[10000],top;
    bool f;
    while(scanf("%d%d",&l,&r)!=EOF){
        for(int i=0;i<10000;i++){
            p[i]=-1;
            a[i]=0;
        }
        top=-1;
        f=true;
        if(l>r)p[l]=p[r]=r;
        else p[r]=p[l]=l;
        a[l]=a[r]=1;
        while(true){
            scanf("%d%d",&l,&r);
            if(l==0&&r==0)break;
            a[l]++;
            a[r]++;
            if(p[l]==-1)p[l]=l;
            else l=find(l,p);
            if(p[r]==-1)p[r]=r;
            else r=find(r,p);
            if(l>r)p[l]=r;
            else p[r]=l;
        }
        if(!(a[1]&1))f=false;
        if(!(a[2]&1))f=false;
        for(int i=3;i<10000&&f;i++){
            if(p[i]==-1)continue;
            if(top==-1)top=find(i,p);
            else if(top!=find(i,p))f=false;
            if(a[i]&1)f=false;
        }
        if(f)printf("OK\n");
        else printf("NG\n");
    }
}

Measured memory_bytes: 2592
def main():
    n=int(input())
    a=list(map(int,input().split()))
    if 0 in a:
        print(0)
        return
    ans=1
    for i in a:
        ans=ans*i
        if ans>1000000000000000000:
            print(-1)
            return    
    print(ans)
    return
main()            

Measured memory_bytes: 21624
main=do
 n<-readLn
 s<-getLine
 let l=take n$scanl(+)0$map(\c->if c=='W' then 1 else 0)s
 let r=reverse$take n$scanl(+)0$map(\c->if c=='E' then 1 else 0)$reverse s
 print$minimum$zipWith(+)l r

Measured memory_bytes: 56700
#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

int main() {
	int n;
	long long t;
	vector<long long> a;
	cin >> n;
	
	for (int i = 0; i < n; i++) {
		cin >> t;
		a.push_back(t);
	}
	
	sort(a.begin(), a.end());
	
	cout << a[n-1]-a[0] << endl;

	return 0;
}

Measured memory_bytes: 256