akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <functional>
#include <cmath>
#include <math.h>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
using namespace std;
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define MOD (ll)998244353
const int sz = 1 << 18;
ll arr[sz * 2], lazy[sz * 2];
ll mod[sz * 2];

void construct()
{
	for (int i = sz - 1; i >= 1; i--)
		arr[i] = (arr[i * 2] + arr[i * 2 + 1]) % MOD;
}

void propagate(int node, int ns, int ne)
{
	if (lazy[node])
	{
		if (node < sz)
		{
			lazy[node * 2] = lazy[node];
			lazy[node * 2 + 1] = lazy[node];
		}
		arr[node] = (lazy[node] * ((mod[ns] - mod[ne + 1] + MOD) % MOD)) % MOD;
		lazy[node] = 0LL;
	}
}

void query(int s, int e, ll k, int node, int ns, int ne)
{
	propagate(node, ns, ne);
	if (e < ns || ne < s) return;
	if (s <= ns && ne <= e)
	{
		lazy[node] = k;
		propagate(node, ns, ne);
		return;
	}
	int mid = (ns + ne) / 2;
	query(s, e, k, node * 2, ns, mid);
	query(s, e, k, node * 2 + 1, mid + 1, ne);
	arr[node] = (arr[node * 2] + arr[node * 2 + 1]) % MOD;
}

ll sum(int s, int e, int node, int ns, int ne)
{
	propagate(node, ns, ne);
	if (e < ns || ne < s) return 0LL;
	if (s <= ns && ne <= e) return arr[node];
	int mid = (ns + ne) / 2;
	return (sum(s, e, node * 2, ns, mid) + sum(s, e, node * 2 + 1, mid + 1, ne)) % MOD;
}


int main(void)
{
	int n, q;
	scanf("%d %d", &n, &q);

	mod[n] = 1LL;
	arr[n + sz] = 1LL;
	for (int i = n - 1; i >= 1; i--)
	{
		mod[i] = (mod[i + 1] * 10LL + 1LL) % MOD;
		arr[i + sz] = (mod[i] - mod[i + 1] + MOD) % MOD;
	}

	construct();

	int l, r;
	ll d;
	while (q--)
	{
		scanf("%d %d %lld", &l, &r, &d);
		query(l, r, d, 1, 0, sz - 1);
		printf("%lld\n", sum(1, n, 1, 0, sz - 1));
	}

	return 0;
}

Measured memory_bytes: 10652
import java.util.Scanner;
import java.util.Stack;

public class Main {

  char[] c;
  int id;

  int number() {
    int ret = 0;
    while (id < c.length && c[id] != ' ') {
      ret *= 10;
      ret += c[id] - '0';
      id++;
    }
    id++;
    return ret;
  }

  int operand() {
    int ret = c[id];
    id += 2;
    return ret;
  }

  int calc(int s, int t, int op) {
    if (op == '+') {
      return s + t;
    }
    if (op == '-') {
      return s - t;
    }
    if (op == '*') {
      return s * t;
    }
    return 999;
  }

  void run() {
    Scanner sc = new Scanner(System.in);

    c = sc.nextLine().toCharArray();
    id = 0;

    Stack<Integer> stack = new Stack<Integer>();
    while (id < c.length) {
      if ('0' <= c[id] && c[id] <= '9') {
        int k = number();
        stack.push(k);
      } else {
        int op = operand();
        int s = stack.pop();
        int t = stack.pop();
        int u = calc(t, s, op);
        stack.push(u);
      }
    }
    System.out.println(stack.peek());
  }

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

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


class Main {

    public static void main(String[] args) throws IOException
    {
        PrintWriter out = new PrintWriter(System.out);
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        int n = Integer.parseInt(br.readLine());

        int arr[] = new int[n+1];
        StringTokenizer st1 = new StringTokenizer(br.readLine());
        for(int i = 0 ; i < n-1 ; i++)
        {
            int tmp = Integer.parseInt(st1.nextToken());
            arr[tmp]++;
        }
        for(int i = 1 ; i <= n ; i++)
            out.println(arr[i]);
        out.flush();
        out.close();

    }

    static class pair{
        long x1;
        long x2;

        public pair(long x1 , long x2)
        {
            this.x1 = x1;
            this.x2 = x2;
        }

    }

}


Measured memory_bytes: 55892
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <tuple>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cassert>
#include <cstdint>
#include <cctype>
#include <numeric>
#include <bitset>
#include <functional>

using namespace std;

using ll =  long long;
using Pll = pair<ll, ll>;
using Pii = pair<int, int>;

constexpr int INF = 1 << 30;
constexpr ll LINF = 1LL << 60;
constexpr ll MOD = 1000000007;
constexpr long double EPS = 1e-10;
constexpr int dyx[4][2] = {
    { 0, 1}, {-1, 0}, {0,-1}, {1, 0}
};

ll modpow(ll a, ll t) {
    ll ret = 1LL;
    while(t){
        if(t & 1LL){
            ret *= a;
            ret %= MOD;
        }
        a *= a;
        a %= MOD;
        t >>= 1;
    }
    return ret;
}

vector<ll> get_divisors(ll n) {
    vector<ll> divisors;
    for(ll i=1;i*i<=n;++i) {
        if(n % i) continue;
        divisors.push_back(i);
        if(i * i != n) divisors.push_back(n/i);
    }
    return divisors;
}


int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    ll n, k;
    cin >> n >> k;

    vector<ll> s(k+1, 0);
    ll ans = 0;
    for(ll i=k;i>=1;--i) {
        s[i] += modpow(k/i, n);
        s[i] %= MOD;
        vector<ll> ds = get_divisors(i);
        for(ll d: ds) {
            if(d == i) continue;
            s[d] += MOD - s[i];
            s[d] %= MOD;
        }
        ans += (i * s[i]) % MOD;
        ans %= MOD;
    }

    cout << ans <<endl;
}

Measured memory_bytes: 3920
#include<iostream>
#include<string>
#include<vector>
#include<iomanip>
#include<map>
using namespace std;
#define ll long long
int main(){
    int N;
    cin >> N;
    int dev=100;
    int i;
    for(i=0;i<3;i++){
      cout <<   10-N/dev;
      N=N%dev;
      dev=dev/10;
    }
}


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

for i in range(n):
    command=input().split(" ")

    if command[0]=="replace":
        com1=int(command[1])
        com2=int(command[2])
        com3=list(command[3])
        list_str=list(str)
        for i in range(com1,com2+1):
            list_str[i]=com3[i-com1]
        str="".join(list_str)

    elif command[0]=="reverse":
        com1=int(command[1])
        com2=int(command[2])
        str2=str[com1:com2+1]
        com3=str2[::-1]
        str=str.replace(str[com1:com2+1],com3)

    else:
        com1=int(command[1])
        com2=int(command[2])
        print(str[com1:com2+1])


Measured memory_bytes: 5628
import java.util.Scanner;

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

		Scanner scanner = new Scanner(System.in);

		int a = scanner.nextInt();
		int b = scanner.nextInt();
		int c = scanner.nextInt();

		if (a < b) {
			if (b < c) {
				System.out.println("Yes");
			}else{
				System.out.println("No");
			}
		}else{
			System.out.println("No");
		}

	}
}

Measured memory_bytes: 17324
# coding: utf-8

# https://atcoder.jp/contests/abc094/tasks/arc095_a
# 15:04-15:09


def main():
    N = int(input())
    X = list(map(int, input().split()))
    A = sorted(X)

    low_border = A[N//2-1]
    high_border = A[N//2]
    for i in range(N):
        if X[i] <= low_border:
            print(high_border)
        else:
            print(low_border)


main()
# print(main())


Measured memory_bytes: 25472
#include<bits/stdc++.h>
using namespace std;
 
#define ll long long
#define mtv(kit) cout<<#kit<<" - "<<kit<<"\n";
#define ff first
#define ss second
#define pb push_back
#define rep(i,a,b) for(i=a;i<b;i++)
#define pii pair<ll , ll>
#define all(x) x.begin(),x.end()
#define nl "\n"
#define ump unordered_map
 
void doit(){
	ll n, m, k, i, m1, m2;
	cin >> n >> m >> k;
	if(n == 0){
		if(m&1){
			cout << k << nl;
		}
		else cout << 0 << nl;
		return;
	}
	m1 = abs(n) % k;
	m2 = abs(n) / k;
	if(n > 0){
	if(m >= m2){
		ll m3 = k - m1;
		ll rem = m - m2;
		if(rem&1){
			cout << m3 << nl;
		}
		else {
			cout << m1 << nl;
		}
	}
	else{
		cout << abs(n - (m*k)) << nl;
	}
	}
	else {
		if(m >= m2){
		ll m3 = k - m1;
		ll rem = m - m2;
		if(rem&1){
			cout << m3 << nl;
		}
		else {
			cout << m1 << nl;
		}
	}
	else{
		cout << abs(n + (m*k)) << nl;
	}

	}
}
 
int main() {
#ifndef ONLINE_JUDGE
    freopen("input1.txt","r",stdin);
    freopen("output1.txt","w",stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t = 1;
   //  cin >> t;
    for(ll i = 1; i <= t; i++){
        doit();
    }
}

Measured memory_bytes: 3652
s = gets.chomp
q = gets.to_i
is_reverse = false
l, r = "", ""
q.times do
  t = gets.split
  if t[0].to_i == 1
    is_reverse = !is_reverse
    next
  end
  f = t[1].to_i
  c = t[2]
  is_back = (f == 1 && is_reverse) || (f == 2 && !is_reverse)
  is_back ? r << c : l << c
end
ans = l.reverse + s + r
ans.reverse! if is_reverse
puts ans


Measured memory_bytes: 3196
#include <bits/stdc++.h>
// iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <cmath>
#include <iomanip>
#include <time.h>
#define dibs reserve
#define OVER9000 1234567890
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
#define tisic 47
#define soclose 1e-8
#define chocolate win
// so much chocolate
#define patkan 9
#define ff first
#define ss second
#define abs(x) (((x) < 0)?-(x):(x))
#define uint unsigned int
#define dbl long double
#define pi 3.14159265358979323846
using namespace std;
// mylittledoge

using cat = long long;

#ifdef DONLINE_JUDGE
	// palindromic tree is better than splay tree!
	#define lld I64d
#endif

int main() {
	cin.sync_with_stdio(0);
	cin.tie(0);
	cout << fixed << setprecision(10);
	int N;
	cin >> N;
	vector<cat> A(N);
	for(int i = 0; i < N; i++) cin >> A[i];
	vector< pair<cat, cat> > P[20][20];
	for(int i = 0; i < N-1; i++) P[i][i+1] = {{0, 0}};
	for(int i = 0; i < N-2; i++) P[i][i+2] = {{A[i+1], A[i+1]}};
	cat cnt = 0;
	for(int d = 3; d < N; d++) for(int i = 0; i < N-d; i++) {
		vector< pair<cat, cat> > V;
		for(int j = i+1; j < i+d; j++) {
			for(auto & pl : P[i][j]) for(auto & pr : P[j][i+d])
				V.push_back({pl.ff+pl.ss+pr.ff+A[j], pl.ss+pr.ff+pr.ss+A[j]});
		}
		cnt += V.size();
		sort(begin(V), end(V));
		cat min_cur = V[0].ss;
		P[i][i+d] = {V[0]};
		for(int j = 1; j < (int)V.size(); j++) {
			if(V[j].ss >= min_cur) continue;
			min_cur = V[j].ss;
			P[i][i+d].push_back(V[j]);
		}
	}
	cat ans = P[0][N-1][0].ff+P[0][N-1][0].ss+A[0]+A[N-1];
	for(auto & p : P[0][N-1]) ans = min(ans, p.ff+p.ss+A[0]+A[N-1]);
	cout << ans << "\n";
	// cerr << cnt << "\n";
	return 0;
}

// look at my code
// my code is amazing


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

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define each(x, y) for (auto &x : y)
#define all(a) (a).begin(), (a).end()
#define bit(b) (1ll << (b))
#define uniq(v) (v).erase(unique(all(v)), (v).end())
#define rsort(v) sort(all(v)); reverse(all(v))

using namespace std;

using i32 = int;
using i64 = long long;
using f80 = long double;
using vi32 = vector<i32>;
using vi64 = vector<i64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

inline void yes() { cout << "Yes" << '\n'; exit(0); }
inline void no() { cout << "No" << '\n'; exit(0); }
inline i64 gcd(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); if (a % b == 0) return b; return gcd(b, a % b); }
inline i64 lcm(i64 a, i64 b) { return a / gcd(a, b) * b; }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }
template<typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template<typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template<typename T> inline void amax(T &x, T y) { if (x < y) x = y; }
template<typename T> inline void amin(T &x, T y) { if (x > y) x = y; }
template<typename T> inline T power(T x, i64 n) { T r = 1; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template<typename T> istream& operator>>(istream &is, vector<T> &v) { for (auto &x : v) is >> x; return is; }
template<typename T> ostream& operator<<(ostream &os, const vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }

void solve() {
  string s;
  cin >> s;
  int ans = 0;
  rep(i, s.size() - 1) if (s[i] != s[i + 1]) ans++;
  cout << ans << '\n';
}


Measured memory_bytes: 512
N = gets.to_i
A = gets.chomp.split(" ").map(&:to_i)
MOD = 10 ** 9 + 7

ans = (A.inject{|r, a| (r + a) % MOD} * (N - 1)) % MOD
m_max = A.max == 0 ? 1 : (Math.log(A.max) / Math.log(2)).ceil

k = 1
tmp = 0
m_max.times{
  w = 0
  A.each{|a| w += 1 if (a & k) != 0}
  tmp += (k * (w * (w - 1)) % MOD)
  k <<= 1
}

ans -= (tmp % MOD)
ans += MOD if ans < 0

puts ans


Measured memory_bytes: 42404
#include <iostream>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long ll;
const int N = 5e4+5;
int arr[N];
vector<int>vc;
bool cmp(int a,int b){
    return a>b;
}
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);
    string s ;
    cin>>s;
   if(s[0]=='R'&&s[1]=='R'&&s[2]=='R')
   {
       cout<<3<<endl;
   }
    else if((s[0]=='R'&&s[1]=='R')||(s[1]=='R'&&s[2]=='R'))
    {
        cout<<2<<endl;
    }
    else if(s[0]=='R'||s[1]=='R'||s[2]=='R')
    {
        cout<<1<<endl;
    }
    else
        cout<<0<<endl;
    
    
}


Measured memory_bytes: 3644
#include <bits/stdc++.h>
using namespace std;
#define ll long long 
#define BLOCK 750
#define mxn 5000001
using namespace std;
struct query{
	int l;
	int r;
	int i;
};
query Q[mxn];
int ar[mxn] , ans[mxn];
int fre[mxn];
int cnt = 0;
bool comp(query a , query b)
{
	if(a.l / BLOCK != b.l/BLOCK)
	return a.l/BLOCK < b.l/BLOCK;
 
	return a.r < b.r;
}
 
void add(int pos)
{
	fre[ar[pos]]++;
	if(fre[ar[pos]] == 1)
	cnt++;
}
 
void remove(int pos)
{
	fre[ar[pos]]--;
	if(fre[ar[pos]] == 0)
	cnt--;
}
 
int main()
{
	 ios_base::sync_with_stdio(false);
    cin.tie(NULL);

  
 
	int n , q; 
	cin>>n >> q;
	for(int i=0;i<n;i++)
	cin>>ar[i];
 
	
	for(int i=0;i<q;i++){
		cin>>Q[i].l>>Q[i].r;
		Q[i].i = i , Q[i].l-- , Q[i].r--;
	}
 
	sort(Q , Q+q , comp);
 
	int ML = 0 , MR = -1;
	for(int i=0;i<q;i++)
	{
		int L = Q[i].l;
		int R = Q[i].r;
 
		while(ML > L)
		ML-- , add(ML);
 
		while(MR < R)
		MR++ , add(MR);
 
		while(ML < L)
		remove(ML) , ML++;
 
		while(MR > R)
		remove(MR) , MR--;
 
		ans[Q[i].i] = cnt;
	}
 
	for(int i=0;i<q;i++)
	cout<<ans[i]<<'\n';
}



Measured memory_bytes: 15552
import sys, bisect, math, itertools, string, queue, copy
import numpy as np
import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
from fractions import gcd
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

x1,y1,x2,y2 = inpm()

a = x2 - x1
b = y1 - y2

print(x2+b,y2+a,x1+b,y1+a)

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

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    int a,b;
    char op;
    cin>>a>>op>>b;
    if (op=='+'){
        cout<<a+b<<endl;
    }else cout<<a-b<<endl;
    return 0;
}

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

#define fast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long int

const int N=1e5+5;

int n, totW;
int w[105], v[105];
int cache[105][N];

int dp(int idx, int wt)
{
	if(wt>totW)
		return -1e15;
	if(idx==n+1)
		return 0;
	int &ans=cache[idx][wt];
	if(ans!=-1)
		return ans;
	ans=max(dp(idx+1, wt), v[idx] + dp(idx+1, wt+w[idx]));
	return ans;
}

int32_t main()
{
	fast;
	memset(cache, -1, sizeof(cache));
	cin>>n>>totW;
	for(int i=1;i<=n;i++)
		cin>>w[i]>>v[i];
	int ans=dp(1, 0);
	cout<<ans;	
	return 0;
}


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

typedef long long ll;
typedef long double ld;
typedef vector<vector<int>> Graph;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
#define pi 3.14159265359
#define inf 2147483647
#define INF 9223372036854775807
#define mod 1000000007
#define mod2 998244353

int main() {
	int N, K, X, Y; cin >> N >> K >> X >> Y;
	K--;
	int ans = 0;
	for(int i = 0; i < N; i++) {
		if(i <= K) ans += X;
		else ans += Y;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3644
#include <iostream>
using namespace std;
int main(){
    int E,Y;
    cin>>E>>Y;
    if(E==0){
        if(Y>=1989)cout<<"H"<<28-(2016-Y)<<endl;
        else if(Y>=1926)cout<<"S"<<63-(1988-Y)<<endl;
        else if(Y>=1912)cout<<"T"<<14-(1925-Y)<<endl;
        else if(Y>=1868)cout<<"M"<<44-(1911-Y)<<endl;
    }
    else if (E==1)cout<<Y+1867<<endl;
    else if (E==2)cout<<Y+1911<<endl;
    else if (E==3)cout<<Y+1925<<endl;
    else if (E==4)cout<<Y+1988<<endl;
    return 0;
}

Measured memory_bytes: 3128
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const ll MOD = 1000000007;


class UnionFind{
public:
    vector<int> par;
    vector<int> rank;
    UnionFind(int n){
        init(n);
    }
    void init(int n){
        par.resize(n);
        for(int i=0;i<n;i++){
            par[i] = i;
        }
        rank.assign(n, 0);
    }
    int find(int x){
        if(par[x] == x){
            return x;
        }else{
            return par[x] = find(par[x]);
        }
    }
    void unite(int x,int y){
        x = find(x);
        y = find(y);
        if(x == y) return;

        if(rank[x] < rank[y]){
            par[x] = y;
        }else{
            par[y] = x;
            if(rank[x] == rank[y]) rank[x]++;
        }
    }
    bool same(int x,int y){
        return find(x)==find(y);
    }
};

string a[102];
int a_count[26];

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

    memset(a_count, 0, sizeof(a_count));
    for(int i=0;i<H;i++){
        cin >> a[i];
        for(int j=0;j<W;j++){
            a_count[a[i][j] - 'a']++;
        }
    }
    
    priority_queue<int> que1;
    for(int i=0;i<26;i++){
        if(a_count[i] > 0){
            que1.push(a_count[i]);
        }
    }
    
    UnionFind uf(H * W);
    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            uf.unite(i * W + j, i * W + (W - 1 - j));
        }
    }
    for(int j=0;j<W;j++){
        for(int i=0;i<H;i++){
            uf.unite(i * W + j, (H - 1 - i) * W + j);
        }
    }
    
    map<int, int> mp;
    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            mp[uf.find(i * W + j)]++;
        }
    }

    priority_queue<int> que2;
    for(auto p : mp){
        que2.push(p.second);
    }

    bool ok = true;
    while(que2.size()){
        int need = que2.top();
        que2.pop();
        int cap = que1.top();
        que1.pop();
        if(need > cap){
            ok = false;
            break;
        }
        cap -= need;
        if(cap > 0){
            que1.push(cap);
        }
    }
    assert(!ok || que1.size() == 0);

    if(ok){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 512
from collections import defaultdict
def getLeft(num):
    while num >= 10:
        num = int(num / 10)
    return num

def getRight(num):
    return num % 10

n = int(input())
a = defaultdict(int)
for number in range(1,n+1):
    left = getLeft(number)
    right = getRight(number)
    a[(left,right)] += 1


res = 0
for i in range(0,10):
    for j in range(0,10):
        res += a[(i,j)] * a[(j,i)]
print(res)




Measured memory_bytes: 3316
#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1000000000000000
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int MOD = 1000000007;
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;
}

void print(const std::vector<int> &v) {
    std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
    std::cout << std::endl;
}

int main() {
    int N;
    cin >> N;
    vector<double> t(N), v(N);
    REP(i, N) { cin >> t[i]; }
    REP(i, N) { cin >> v[i]; }
    int T = accumulate(t.begin(), t.end(), 0);
    // maxv i t=iのときの最大
    vector<double> maxv(2 * T + 1, 10000000);
    int time = 1;
    int nowT = 0;
    REP(i, N) {
        for(int ti = 0; ti < t[i]; ti++) {
            int t1 = nowT + ti * 2;
            int t2 = nowT + ti * 2 + 1;
            maxv[t1] = min(maxv[t1], v[i]);
            maxv[t2] = min(maxv[t2], v[i]);
        }
        nowT += t[i] * 2;
        maxv[nowT] = min(maxv[nowT], v[i]);
    }
    maxv[0] = 0;
    maxv[2 * T] = 0;
    // cout << "T " << T << endl;
    for(int i = 1; i <= 2 * T + 1; i++) {
        maxv[i] = min(maxv[i], maxv[i - 1] + 0.5);
    }
    for(int i = 2 * T - 1; i >= 0; i--) {
        maxv[i] = min(maxv[i], maxv[i + 1] + 0.5);
    }
    double ans = 0;
    for(int i = 0; i < 2 * T; i++) {
        // cout << i << ":::" << maxv[i] << endl;
        ans += (maxv[i] + maxv[i + 1]) / 2 / 2;
    }
    printf("%.4f\n", ans);
    return 0;
}

Measured memory_bytes: 512
N, M = map(int, raw_input().split(' '))

q = [ int(input()) for _ in range(N) ]
poll = set()

cnt = 0

for _ in reversed(q):
	if not _ in poll:
		print(_)
		
		cnt = cnt + 1
		
		if cnt == M:
			break	
		
		poll.add(_)
		

Measured memory_bytes: 12460
a,b,c,k = map(int,input().split())
count = k
ans = 0
if a < count:
    ans += a
    count -= a
else:
    ans += count
    print(ans)
    exit()
if b < count:
    count -= b
else:
    print(ans)
    exit()
if c < count:
    ans -= c
    print(ans)
    exit()
else:
    ans -= count
    print(ans)
    exit()

Measured memory_bytes: 9192
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <array>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <list>
#include <numeric>
#include <stack>
#include <iomanip>
#include <random>
#include <complex>
#include <functional>

using namespace std;

#define Rep(i,a,b) for(int i = a; i < b; ++i)
#define rep(i,b) Rep(i,0,b)
#define allof(a) (a).begin(), (a).end()

#define Yes(q) ((q) ? "Yes" : "No")
#define YES(q) ((q) ? "YES" : "NO")
#define Possible(q) ((q) ? "Possible" : "Impossible")
#define POSSIBLE(q) ((q) ? "POSSIBLE" : "IMPOSSIBLE")

using ll =  long long;

using pint = std::pair<int, int>;
using pll = std::pair<ll, ll>;


constexpr int inf = 1e9 + 7;
constexpr ll infll = 1ll << 60ll;
constexpr ll mod = 1e9 + 7;
// 0~3までは右左下上 4~7までは斜め
constexpr int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
constexpr int dy[] = { 0, -1, 0, 1, 1, -1, -1, 1 };

namespace {
	template<typename T> void chmax(T& a, T b) { a = std::max(a, b); }
	template<typename T> void chmin(T& a, T b) { a = std::min(a, b); }
	template<typename T> void chadd(T& a, T b) { a = a + b; }

	void Cout(long long x, const char* end = "\n") { std::cout << x << end; }
	template <typename T> void Cout(const T& x, const char* end = "\n") { std::cout << x << end; }
	template <typename T> void Cout(const std::vector<T>& x, const char* sep = " ", const char* end = "\n") { for (std::size_t i = 0, sz = x.size(); i < sz; i++) { std::cout << x[i] << (i == sz - 1 ? end : sep); } }


	// 標準入出力
	struct inp {
		std::size_t sz;
		inp(std::size_t _sz = 1) : sz(_sz) {}
		template <typename T> operator T () const { T a; std::cin >> a; return a; }
		template <typename T> operator std::vector<T>() const { vector<T> a(sz); for (std::size_t i = 0; i < sz; i++) std::cin >> a[i]; return a; }
		template <typename T, typename U> operator std::pair<T, U>() const { T f; U s; std::cin >> f >> s; return std::pair<T, U>(f, s); }
	};

	inp inp1; // input one

	struct Food {
		int need;
		int point;
	};
}

int main() {

	int n, t;
	cin >> n >> t;
	vector<Food> food(n);
	rep(i, n) cin >> food[i].need >> food[i].point;

	// ナップザック系のDP
	// dp[i][j] := i番目までの商品を見たときに時間がjの時のポイントの最大値
	vector<vector<int>> dp1(n + 1, vector<int>(t + 1, 0));
	vector<vector<int>> dp2(n + 1, vector<int>(t + 1, 0));

	int ans = 0;

	// 前からと後ろからで両方やる
	rep(i, n) {
		rep(j, t) {
			if (j - food[i].need >= 0)
				chmax(dp1[i + 1][j], dp1[i][j - food[i].need] + food[i].point);

			chmax(dp1[i + 1][j], dp1[i][j]);
		}
	}

	rep(i, n) {
		rep(j, t) {
			if (j - food[n - 1 - i].need >= 0)
				chmax(dp2[i + 1][j], dp2[i][j - food[n - 1 - i].need] + food[n - 1 - i].point);

			chmax(dp2[i + 1][j], dp2[i][j]);
		}
	}

	// i番目の商品を最後に持ってくる
	rep(i, n) {
		int added_point = food[i].point;
		int tmp = 0;
		// 時間を左右でどう振り当てるか
		rep(j, t) {
			chmax(tmp, dp1[i][j] + dp2[n - i - 1][t - 1 - j]);
		}
		chmax(ans, tmp + added_point);
	}

	Cout(ans);

	return 0;
}

Measured memory_bytes: 70912
A=list(map(str, input().split()))
a=['']*3
b=['']*10
tmp1=''
tmp2=''
p=0
for i in range(3):
    a[i]=list(A[i])
    if i!=0:
        tmp2=a[i][0]
    if tmp1!='':
        if tmp1!=tmp2:
            p=1
    a[i]=list(reversed(a[i]))
    b=list(a[i])
    tmp1=b[0]
if p==0:
    print('YES')
else:
    print('NO')
  
  


Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;

int main() {
	fast;
	int n,k;
	cin>>n>>k;
	vector<int> height(n),dp(n,std::numeric_limits<int>::max());
	for(int i=0;i<n;i++) cin>>height[i];
	dp[n-1]=0;
	for(int i=n-2;i>=0;i--){
		for(int j=i+1;j<=min(n-1,i+k);j++)
		    dp[i]=min(dp[i],abs(height[i]-height[j])+dp[j]);
	}
	cout<<dp[0]<<"\n";
	return 0;
}

Measured memory_bytes: 1024
package main

import (
   "fmt"
   "sort"
)

func solution(q, h, s, d, n int) int {
   n = 100 * n
   out := 0
   a := [][]int{{25, q, 8 * q}, {50, h, 4 * h}, {100, s, 2 * s}, {200, d, d}}
   sort.SliceStable(a, func(i, j int) bool {
        if a[i][2] == a[j][2] {
                return a[i][0] < a[j][0]
        }
        return a[i][2] < a[j][2]
   })

   for i := range a {
        if n >= a[i][0] {
                out += a[i][1] * (n / a[i][0])
                n %= a[i][0]
        }
   }
   return out
}

func main() {
   var q, h, s, d, n int
   fmt.Scan(&q, &h, &s, &d, &n)
   fmt.Println(solution(q, h, s, d, n))
}


Measured memory_bytes: 1836
import math

N = int(input())

x = []
y = []
for i in range(N):
    xi, yi = map(int, input().split())
    x.append(xi)
    y.append(yi)

avg = 0
for i in range(N):
    for j in range(i + 1, N):
        avg += math.sqrt((x[i] - x[j])**2 + (y[i] - y[j])**2)
avg = avg * 2 / N
print(avg)


Measured memory_bytes: 3060
#include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <functional>
#include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000

map<string, int> mp;
int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N; cin >> N;
    rep(i, N) {
        string S; cin >> S;
        mp[S]++;
    }
    int len = 0;
    for(auto itr = mp.begin(); itr != mp.end(); itr++) {
        len = max(len, itr->second);
    }
    for(auto itr = mp.begin(); itr != mp.end(); itr++) {
        if(itr->second == len)
        cout << itr->first << endl;
    }
    return 0;
}


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

#define fi first
#define se second
const int inf = 1e9 + 7;
int n, par[100010], ans = 0;
pair <pair <int, int>, int> a[100010]; bool dis[100010];
priority_queue<pair <int, pair <int, int> >, vector<pair <int, pair <int, int> > >, greater<pair <int, pair <int, int> > > > wl1, wl2;
int find(int a) {
	return (par[a] < 0 ? a : par[a] = find(par[a]));
}
void unionset(int a, int b) {
	int c = find(a), d = find(b);
	if(par[c] < par[d]) par[c] += par[d], par[d] = c;
	else par[d] += par[c], par[c] = d;
}
int main() {
	memset(par, -1, sizeof(par));
	scanf("%d", &n);
	for(int i = 0; i < n; i++) {
		scanf("%d%d", &a[i].fi.fi, &a[i].fi.se);
		a[i].se = i;
	}
	sort(a, a + n);
	for(int i = 0; i < n-1; i++) {
		wl1.push({a[i+1].fi.fi - a[i].fi.fi, {a[i].se, a[i+1].se}});
		swap(a[i].fi.fi, a[i].fi.se);
	}
	swap(a[n-1].fi.fi, a[n-1].fi.se);
	sort(a, a + n);
	for(int i = 0; i < n-1; i++) wl2.push({a[i+1].fi.fi - a[i].fi.fi, {a[i].se, a[i+1].se}});
	for(int i = 1; i < n; i++) {
		while(find(wl1.top().se.fi) == find(wl1.top().se.se)) wl1.pop();
		while(find(wl2.top().se.fi) == find(wl2.top().se.se)) wl2.pop();
		int d1 = inf, d2 = inf, u1, u2, v1, v2;
		if(not wl1.empty()) d1 = wl1.top().fi, u1 = wl1.top().se.fi, v1 = wl1.top().se.se;
		if(not wl2.empty()) d2 = wl2.top().fi, u2 = wl2.top().se.fi, v2 = wl2.top().se.se;
		if(d1 < d2) {
			unionset(u1, v1);
			ans += d1;
		}
		else {
			unionset(u2, v2);
			ans += d2;
		}
	}
	printf("%d\n", ans);
}

Measured memory_bytes: 5236
#include "bits/stdc++.h"
using namespace std;
 
long long int gcd(long long int l, long long int r) {
    assert(l > 0 && r > 0);
    if (l > r)return gcd(r, l);
    else {
        const long long int num = r%l;
        if (num) {
            return gcd(l, num);
        }
        else {
            return l;
        }
    }
}
long long int lca(long long int l, long long int r) {
    return l / gcd(l, r)*r;
}
int main() {
    long long int a, b;
    while (cin >> a >> b) {
        cout << gcd(a, b) << " " << lca(a, b) << endl;
    }
    return 0;
}


Measured memory_bytes: 3096
#include "iostream"
#include <stdio.h>
#include <algorithm>
#include <stdlib.h>
#include <cstring>
#include <math.h>
#include <cctype>
#include <stack>
#include <vector>
#include <list>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <iomanip>
using namespace std;
using ll=long long;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define MOD  1000000007
int dx[4]={0,0,-1,1},dy[4]={1,-1,0,0};


int main(int argc, char const *argv[]) {
  string s;
  std::cin >> s;
  ll n=s.size(),cnt=0,ans=0;
  for(int i=0; i<n; i++){
    if(s[i]=='B') cnt++;
    else  ans+=cnt;
  }
  std::cout << ans << '\n';

  return 0;
}


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

 
int main() {
   string s;
   cin>>s;
   
   //MMの判定
   auto hantei=[](string m){
       if(m[0]=='0'&&m[1]!='0')return 1;
       if(m[0]=='1'&&(m[1]=='0'||m[1]=='1'||m[1]=='2'))return 1;
       return 0;
   };

   string s1=s.substr(0,2);
   string s2=s.substr(2,2);

   if(hantei(s1)&&hantei(s2))cout<<"AMBIGUOUS"<<endl;
   else if(hantei(s1)==1&&hantei(s2)==0)cout<<"MMYY"<<endl;
   else if(hantei(s1)==0&&hantei(s2)==1)cout<<"YYMM"<<endl;
   else cout<<"NA"<<endl;
}

Measured memory_bytes: 256
import math
def prob_b():
    n, d = [int(a) for a in input().split()]
    spot_list = list()
    for i in range(n):
        spot_list.append([int(a) for a in input().split()])
    counter = 0
    for i in range(n-1):
        spot_1 = spot_list[i]
        for j in range(n-1-i):
            spot_2 = spot_list[i+1+j]
            dist_sq = sum([(a-b) ** 2 for a, b in zip(spot_1, spot_2)])
            dist = math.sqrt(dist_sq)
            if dist_sq == int(dist) ** 2:
                counter += 1
    print(str(counter))


prob_b()

Measured memory_bytes: 3064
#include<iostream>
#include<cmath>
#include<map>
#include<deque>
#include<string>
#include<algorithm>
typedef long long ll;

#define all(x) (x).begin(),(x).end()
#define puts(x) cout<< x << endl;
#define rep(i,m,n) for(ll i=m;i<n;i++)
#define fore(i,a) for(auto i:a)

using namespace std;
ll x,y,a,b,c;
deque<ll>p,q,d;
int main(){
    cin>>x>>y>>a>>b>>c;
    ll t;
    rep(i,0,a){
        cin>>t;
        p.push_back(t);
    }
    rep(i,0,b){
        cin>>t;
        q.push_back(t);
    }
    rep(i,0,c){
        cin>>t;
        d.push_back(t);
    }
    
    sort(all(p));
    sort(all(q));

    rep(i,0,x){
        d.push_back(p.back());
        p.pop_back();
    }
    rep(i,0,y){
        d.push_back(q.back());
        q.pop_back();
    }
    
    sort(all(d));
    ll ans=0;
    rep(i,0,x+y){
        ans+=d.back();
        d.pop_back();
    }
    puts(ans);

    
}

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

int main() {
    int a, b;
    cin >> a >> b;

    if ((a + b) % 2 == 0) {
        cout << (a + b) / 2 << endl;
    } else {
        cout << (a + b + 1) / 2 << endl;
    }
}

Measured memory_bytes: 256
def main():
  N = int(input())
  len_list = sorted(list(map(int, input().split())), reverse=True)
  max_len = len_list[0]
  sum_len = 0
  
  for i in range(1,N):
    sum_len += len_list[i]
    
  if max_len < sum_len:
    print('Yes')
  else:
    print('No')

main()

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for(int i = int(a); i < int(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define all(x) (x).begin(), (x).end()
const long long INFLL = 1LL << 60;
const int INFINT = 1 << 30;
const long long MOD = 1e9 + 7;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N;
    cin >> N;
    cout << N * (N - 1) / 2 << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include <tuple>
#include <utility>
#include<string>
#include <cmath>
#define ll long long
using namespace std;

int main(){
    ll N,K;
    ll ans = 1;
    cin >> N >> K;
    vector<ll> A(N+100,0);
    vector<ll> seen(N+100,-1);
    for(ll i = 0; i < N; i++){
        cin >> A[i+1];
    }

    // A[k]:クリークが始まる場所
    ll k = 1;
    ll cnt = 1;
    seen[1] = 0;
    while(seen[A[k]] == -1){
        seen[A[k]] = cnt;
        cnt ++;
        k = A[k];
    }
    ll cri = seen[k] - seen[A[k]] + 1;
    // cout << k << " : " << seen[k] << endl;
    // cout << A[k] << " : " << seen[A[k]] << endl;

    if(K <= seen[A[k]]){
        while(K > 0){
            ans = A[ans];
            K--;
        }
    }else{
        ll s_num = K - seen[A[k]];
        ll amari = s_num % cri;
        ans = A[k];
        while(amari > 0){
            ans = A[ans];
            amari--;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 6424
#include <stdio.h>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <iostream>
#include <math.h>
#include <bitset>
#include <iomanip>
#include <queue>
#include <cstring>
using namespace std;

long long MOD = 1000000007;
long long modpow(long long a, long long n) {
	long long res = 1;
	while (n > 0) {
		if (n & 1)res = res * a%MOD;
		a = a * a%MOD;
		n >>= 1;
	}
	return res;
}

long long COM(long long n, long long r) {
	long long x = 1;
	for (long long i = 2; i <= r; i++) {
		x = i * x%MOD;
	}
	x=modpow(x, MOD - 2);
	for (long long i = n; i > n - r; i--) {
		x = x * i%MOD;
	}
	return x;
}

int main() {
	long long n, a, b;cin >> n >> a >> b;
	cout << (modpow(2, n) - COM(n, a) - COM(n, b) - 1 + 2 * MOD)%MOD << endl;
	
}





Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <cmath>
#include <climits>

#define X first
#define Y second
#define vsort(v) sort((v).begin(), (v).end())
#define vrev(v) reverse((v).begin(), (v).end())

// stoi(s): string to int
// stod(s): string to double

// INT_MAX
// INT_MIN
// LLONG_MAX
// LLONG_MIN
// DBL_MIN
// DBL_MAX
// LDBL_MIN
// LDBL_MAX

// A-Z: 65~90
// a-z: 97~122
// |a-z| = 26

using namespace std;
using ll = long long;

int main(int argc, const char * argv[]) {
    int n;
    cin >> n;
    
    vector<string> v(3);
    for (int i = 0; i < 3; i++) {
        cin >> v[i];
    }
    
    int cnt = 0;
    set<char> st;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < 3; j++) {
            st.insert(v[j][i]);
        }
        cnt += st.size() - 1;
        st.clear();
    }
    cout << cnt << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep_range(i, s, e) for (int i = (s); i < (int)(e); i++)
#define rep_rev(i, s, e) for (int i = (s)-1; i >= (int)(e); i--)
#define sort_vec(v) sort((v).begin(),(v).end())
typedef int64_t lint;
// lint mod = 998244353;

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

  set<string> sset;
  rep(i,n){
    string s;
    cin>>s;
    sset.insert(s);
  }

  return sset.size();
}

int main(){cout<<app()<<endl;return 0;}


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

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

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

Measured memory_bytes: 3624
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <numeric>
#include <string>
#include <cstdio>
#include <cstring>
#include <queue>
#include <stack>
#include <set>
#include <cmath>
#include <bitset>
#include <iomanip> 

using ll = long long;
using ull = unsigned long long;
using namespace std;

#define FALSE printf("false\n");
#define TRUE printf("true\n");
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i = 0;(i) < ((int)(n));++(i))
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() )
#define test(a) cout<<"line:"<<__LINE__<<"["<<(#a)<<": "<<(a)<<"]"<<endl

const int INF = 1e9+7;
const ll INFL = 9*1e18;

// const int dx[4] = { 1, 0, -1, 0 };
// const int dy[4] = { 0, 1, 0, -1 };

const int dx[8] = {1, 1, 0,-1,-1,-1, 0, 1};
const int dy[8] = {0, 1, 1, 1, 0,-1,-1,-1};

ll inline digit(ll num){int tmp = 0;while(num){tmp++;num/=10;}return tmp;} // 桁数
template<typename T>inline void print(T&& x){cout<<x<<endl;}// 改行付き出力
template<typename T>inline T SUM(vector<T> vec){return accumulate(all(vec),(T)0);} // vectorの中身を全部足す
template<typename T>inline T digitSum(T num){T sum = 0;while(num){sum+=num%10;num/=10;}return sum;} // 各桁の和
template<typename T>inline T gcd(T a,T b){if(b == 0)return a;return gcd(b,a%b);} // 最大公約数
template<typename T>inline T lcm(T a, T b){T g = gcd(a,b);return a/g*b;} // 最小公倍数
template<typename T>inline T power(T a,T b){T tmp=1;rep(i,b){tmp*=a;}return tmp;} // 累乗
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
int ctoi(char c){return c-'0';}


// TODO: write
int main() {
  long double l;cin>>l;
  l /= 3;
  printf("%12Lf\n",powl(l,3));
  return 0;
}

Measured memory_bytes: 3836
#include<bits/stdc++.h>
using namespace std;
#define REP(i,st,ed) for(register int i=st,i##end=ed;i<=i##end;++i)
#define DREP(i,st,ed) for(register int i=st,i##end=ed;i>=i##end;--i)
typedef long long ll;
template<typename T>inline bool chkmin(T &x,T y){return (y<x)?(x=y,1):0;}
template<typename T>inline bool chkmax(T &x,T y){return (y>x)?(x=y,1):0;}
inline int read(){
    int x;
    char c;
    int f=1;
    while((c=getchar())!='-' && (c>'9' || c<'0'));
    if(c=='-') f=-1,c=getchar();
    x=c^'0';
    while((c=getchar())>='0' && c<='9') x=(x<<1)+(x<<3)+(c^'0');
    return x*f;
}
inline ll readll(){
    ll x;
    char c;
    int f=1;
    while((c=getchar())!='-' && (c>'9' || c<'0'));
    if(c=='-') f=-1,c=getchar();
    x=c^'0';
    while((c=getchar())>='0' && c<='9') x=(x<<1ll)+(x<<3ll)+(c^'0');
    return x*f;
}
const int maxn=1000+10;
struct point{
	ll x,y;
}a[maxn];
char mp[4]={'L','R','D','U'};
int b;
void work(int times,ll x,ll y){
	ll u=(1ll<<times);
	if(y>=u) putchar('U'),y-=u;
	else if(y<=-u) putchar('D'),y+=u;
	else if(x>=u) putchar('R'),x-=u;
	else if(x<=-u) putchar('L'),x+=u;
	else{
		if(abs(x)>abs(y)){
			if(x<0) putchar('L'),x+=u;
			else putchar('R'),x-=u;
		}
		else{
			if(y<0) putchar('D'),y+=u;
			else putchar('U'),y-=u;
		}
	}
	if(times!=0) work(times-1,x,y);
}
int main(){
	int n=read();
	REP(i,1,n) a[i].x=read(),a[i].y=read();
	b=(a[1].x+a[1].y+(ll)2e9)%2;
	bool flag=1;
	REP(i,2,n) if((a[i].x+a[i].y+(ll)2e9)%2!=b) flag=0;
	if(!flag) return printf("-1\n"),0;
	printf("%d\n",32-b);
	DREP(i,30,0) printf("%lld ",(1ll<<(ll)i));
	if(!b){
		printf("%d ",1);
		REP(i,1,n) a[i].x+=1;
	}
	putchar('\n');
	REP(i,1,n){
		work(30,a[i].x,a[i].y);
		if(!b) printf("L");
		putchar('\n');
	}
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int west = (b - a) * (b - a + 1) / 2;
        System.out.println(west - b);
        sc.close();
    }
}

Measured memory_bytes: 21844
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <math.h>
#include <queue>
#include <set>
#include <map>
#include <stack>
 
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
 
string S;
ll N,M,ans;
ll A[11][11];

 
 
 
int main(){
    cin >> N;
    M = 1;
    ll keta = 1;
    for(int i=0;i<N;i++){
        if(M>=keta*10){
            keta*=10;
        }
        A[M%10][M/keta] += 1;
        M++;
    }
    for(int i = 0;i<10;i++){
        for(int j = 0;j<10;j++){
            ans += A[i][j]*A[j][i];
        }
    }
    cout << ans << endl;
    
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
void ABC80(void);
void ABC81(void);
void ABC82(void);
void ABC83(void);
void ABC84(void);
void ABC85(void);
void ABC86(void);
void ABC87(void);
void ABC88(void);
void ABC89(void);

int main(void){
    ABC87();
}

void ABC87(){
    int a,b,c,i,j,k,x,ans=0;
    cin>>a>>b>>c>>x;
    for(i=0;i<=a;i++){
        for(j=0;j<=b;j++){
            for(k=0;k<=c;k++){
                if(x==500*i+100*j+50*k)ans++;
            }
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, m, n) for(int i = m; i < (n); i++)
#define print(x) cout << (x) << endl;
#define printv(x) for(int i = 0; i < x.size(); i++){ cout << (x[i]) << " "; } cout << endl; 
#define printa(x,n) for(int i = 0; i < n; i++){ cout << (x[i]) << " ";} cout << endl;
#define printa2(x,m,n) for(int i = 0; i < m; i++){ for(int j = 0; j < n; j++){ cout << x[i][j] << " ";} cout << endl;}
#define INF (1e9)
typedef long long ll;
typedef struct{
    int x;
    int y;
} P;

using namespace std;
int l[100010], r[100010];
int is_prime[100010] = {};
int sum[100010] = {};

bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

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

    // 素数である
    return true;
}


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N = 100000;
    int Q;
    cin >> Q;
    rep(i,0,Q){
        cin >> l[i] >> r[i];
    }
    rep(i,2,N+1){
        if(i % 2 == 1){
            is_prime[i] = (IsPrime(i) && IsPrime((i+1)/2) ? 1 : 0);
        }
    }
    rep(i,1,N+2){
        sum[i] = sum[i-1] + is_prime[i-1];
    }
    rep(i,0,Q){
        ll ans = sum[r[i] + 1] - sum[l[i]];
        print(ans);
    }

}


Measured memory_bytes: 2176
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string alphabet;
  cin >> alphabet;
  
  if (alphabet == "a" || alphabet == "e" || alphabet == "i" || alphabet == "o" || alphabet == "u"){
    cout << "vowel" << endl;
  }
  else {
    cout << "consonant" << endl;
  }
}

Measured memory_bytes: 256
#include <iostream>
#include<cmath>
#include<algorithm>
#include<vector>
#include<map>
#include<queue>
#include<string>
using namespace std;

int main() {
	int n, m;
	cin >> n >> m;
	vector<int> a(m), b(m);
	vector<int>ma(n);
	vector<int>h(n);
	int ans = 0;
	for (int i = 0; i < n; i++) {
		cin >> h[i];
		ma[i] = h[i];
	}
	for (int i = 0; i <m; i++) {
		cin >> a[i] >> b[i];
	}

	for (int i = 0; i < m; i++) {
		ma[a[i] - 1] = max(ma[a[i] - 1], h[b[i] - 1]);
		ma[b[i] - 1] = max(ma[b[i] - 1], h[a[i] - 1]);
	}
	for (int i = 0; i < m; i++) {
		if (h[a[i] - 1] == h[b[i] - 1]) {
			ma[a[i] - 1]++;
			ma[b[i] - 1]++;
		}
	}

	for (int i = 0; i < n; i++) {
		if (h[i] == ma[i]) {
			//cout << i + 1;
			ans++;
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 4812
/*
 * @Author: Luisvacson
 * @LastEditors: Luisvacson
 * @Descriptions: None
 * @Date: 2020-06-20 20:10:47
 * @LastEditTime: 2020-06-20 20:12:46
 * @FilePath: \VSC\C++\Public\AC agc046 A.cpp
 */ 
#include<bits/stdc++.h>
using namespace std;

int gcd(int x,int y){
    if(!y) return x;
    else return gcd(y,x%y);
}

signed main(){
    int x;
    scanf("%d",&x);
    printf("%d\n",360/gcd(x,360));
    return 0;
}

Measured memory_bytes: 3756
#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>

using namespace std;
typedef long long ll;

int main()
{
    ll a,b,c;
    cin >> a >> b >> c;

    
    ll d = c - a - b;

    if (d > 0 && d * d > 4 * a * b)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
    return 0;
}


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

#define CEIL(a,b) ((a) / (b) + ((a) % (b) == 0 ? 0 : 1))
#define X first
#define Y second

using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vl = vector<ll>;
using vs = vector<string>;

constexpr int MOD = int(1e9 + 7);
constexpr int INF = int(1e9 + 1);
constexpr ll LLINF = ll(4 * 1e18 + 1);
// constexpr int INF = 2147483647; // 2 * 1e9
// constexpr ll LLINF = 9223372036854775807; // 9 * 1e18

const int dx[] = {1, 0, -1, 0, 1, -1, -1, 1, 0};
const int dy[] = {0, 1, 0, -1, 1, 1, -1, -1, 0};

int main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout << fixed << setprecision(10);
	int n;
	cin >> n;
	if(n == 1) cout << "Hello World\n";
	else{
		int a, b;
		cin >> a >> b;
		cout << a + b << "\n";
	}
	return 0;
}


Measured memory_bytes: 256
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define scan(n,v) v.resize(n); rep(i,n){ cin>>v[i];}
#define lim 1000000007ll
#define Yes(flag) cout<<((flag)? "Yes":"No");
#define YES(flag) cout<<((flag)? "YES":"NO");
#include<bits/stdc++.h>
using ll = long long;
using namespace std;
template<class T>T 
chmin(T& a,T b){if(a>b){a=b;return true;}return false;}
template<class T>T 
chmax(T& a,T b){if(a<b){a=b;return true;}return false;}
template <class T> T 
gcd(T a, T b){if (a < b) {a ^= b;b ^= a;a ^= b;} return b ? gcd(b, a % b) : a;}
template <class T> T 
lcm(T a, T b){return a * b / gcd(a, b);}

// header
ll a,b,c;
void input(){
    cin>>a>>b>>c;
}
void src(){
    if(a%2==0 or b%2==0 or c%2==0){
        cout<<0;
    }else{
        cout<<min({a*b,b*c,c*a});
    }
}   
int main(int argc,char* argv[]){
    ios::sync_with_stdio(false);
 //   ifstream in( argv[1] ); cin.rdbuf(in.rdbuf());
    input();
    src();    
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int long long
using namespace std;
main()
{
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    int tok=1,i=0;
    while(i<n){
        if(a[i]==tok){
            tok++;
        }
        i++;
    }
    if(tok==1)    cout<<-1<<"\n";
    else        cout<<n-tok+1<<"\n";
        
    
}

Measured memory_bytes: 1792