akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<vector>
#include<algorithm>
#include<utility>
#include<string>
#include<cmath>
#include<cstring>
#include<queue>
#include<map>
#include<climits>
#include<queue>
#include<set>
#include<iomanip>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
using namespace std;
typedef pair<int, int> P;
typedef long long int ll;
typedef pair<ll,ll> LLP;
int dx[4] = {1,0,0,-1};
int dy[4] = {0,1,-1,0};
#define INF 1000000007
#define MOD 1000000007
#define ARRAY_MAX 100005



typedef struct edge{
    pair<int,int> to;//今いる位置、会社
    int cost;//移動にかかるコスト
}EDGE;

int n,m;
map<P,vector<EDGE> > G;
set<P> used;

int bfs(){

    deque<EDGE> deq;
    deq.push_back(EDGE{P(0,-1),0});
    int ans = -1;

    while(!deq.empty()){
        EDGE es = deq.front();
        deq.pop_front();
        if(used.find(es.to) != used.end()){
            //もう使ったので調べない
            continue;
        }
        used.insert(es.to);
        if(es.to == P(n-1,-1)){
            //目的地に着いた
            //つまり、駅nの改札を出たところなら
            ans = es.cost;
            break;
        }
        for(auto itr:G[es.to]){
            //次の駅の候補を調べる
            if(used.find(itr.to) != used.end()){
                //次の駅がすでに調べられているなら調べない
                continue;
            }
            if(itr.cost == 0){
                deq.push_front({itr.to,es.cost});
            }else{
                deq.push_back({itr.to,es.cost+1});
            }
        }       
    }
    return ans;
}



int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(10);

    cin >> n >> m;
    REP(i,m){
        int p,q,c;
        cin >> p >> q >> c;
        p--;
        q--;
        //同じ会社の間にコスト0の辺を張る
        G[P(p,c)].push_back((EDGE){P(q,c),0});
        G[P(q,c)].push_back((EDGE){P(p,c),0});


        //駅番号-1は駅から改札を出ることを表す,コスト0の辺を張る
        G[P(p,c)].push_back((EDGE){P(p,-1),0});
        G[P(q,c)].push_back((EDGE){P(q,-1),0});

        
        //改札を出て別の会社の駅に入る時にコスト1かかるとする,コスト1の辺を張る
        //途中で別の会社を使って再びもとの会社を使う時にもコストはかかる
        G[P(p,-1)].push_back((EDGE){P(q,c),1});
        G[P(q,-1)].push_back((EDGE){P(p,c),1});
    }

    int ans = bfs();
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 71552
import java.util.*;

public class Main {


    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        String[] strs = str.split("");
        int zeros =0;
        int ones =0;

        for(int i=0;i<strs.length;i++){
            if(strs[i].equals("0")){
                zeros++;
            } else {
                ones++;
            }
        }
        System.out.println(Math.min(zeros,ones) * 2);

    }


}


Measured memory_bytes: 32556
n = int(input())
h = list(map(int,input().split()))
ans,cnt = [0]*n,0
h.append(1)
ans.append(1)
while(h!=ans):
	for i in range(n):
		if h[i] > 0:
			h[i] -= 1
			if h[i+1] == 0:
				break
	cnt += 1
print(cnt)

Measured memory_bytes: 9160
#include <cstdio>
#include <iostream>
#include <string>

using namespace std;

const int COUNT = 6;


class Dice
{
public:
	int num[6];

public:
	Dice();
	void play_dice(string);
	void play(int, int, int, int);
	void print_(int x) {printf("%d\n", num[x]);}
	void to_top_and_front(int, int);
};

Dice::Dice()
{
	for (int i = 0; i < COUNT; ++i)
	{
		cin >> num[i];
		
	}
}


void Dice::play_dice(string s)
{
	if(s == "E") {play(0, 2, 5, 3); }
		
	if(s == "N") {play(0, 4, 5, 1); }
		
	if(s == "S") {play(0, 1, 5, 4); }
	
	if(s == "W") {play(0, 3, 5, 2); }
}

void Dice::play(int a, int b, int c, int d)
{
	int temp;
	temp = num[d]; num[d] = num[c]; num[c] = num[b]; num[b] = num[a]; num[a] = temp;
}


void Dice::to_top_and_front(int top, int front)
{
	string str[7] = {"N", "N", "N", "W", "N", "N", "N"};
	for (int i = 0; i < 7; ++i)
	{
		if(front == num[1]) break;
		play_dice(str[i]);
	}
	while(top != num[0])
	{
		play_dice("W");
	}
}


int main(int argc, char const *argv[])
{
	Dice a, b;
	a.to_top_and_front(b.num[0], b.num[1]);
	
	for (int i = 0; i < COUNT; ++i)
	{
		if (a.num[i] != b.num[i])
		{
			printf("No\n");
			return 0;
		}
	}
	printf("Yes\n");

	return 0;
}

Measured memory_bytes: 1168
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(i,n) for(int i=0;i<(n);i++)
#define MOD 1000000007
#define all(x) (x).begin(),(x).end()
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;}
template<class T> inline T GCD(T a,T b){T c;while(b!=0){c=a%b;a=b;b=c;}return a;}
template<class T> inline T LCM(T a,T b){return a/GCD(a,b)*b;}

int main(){
	string s;
	cin >> s;
	int a[1000]={0};
	FOR(i,3){
		a[s[i]-'a']++;
	}
	if(a[0]==1 && a[1]==1 && a[2]==1){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;
	}
}

Measured memory_bytes: 256
#include <iostream>
#include <utility>
#include <queue>
#include <memory>
#include <cstring>
#include <vector>
#include <algorithm>
#include <functional>

#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)

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

int main(){
    int n;
    cin >> n;
    ll ans = 0;
    vector<ll> a(n+1),b(n+1),c(n+1);
    rep(i,n) cin >> a[i];
    rep(i,n) cin >> b[i];
    rep(i,n) cin >> c[i];
    a[n] = 1e9;
    b[n] = 1e9;
    c[n] = 1e9;

    sort(a.begin(),a.end(),less<ll>());
    sort(b.begin(),b.end(),less<ll>());
    sort(c.begin(),c.end(),less<ll>());
    
    vector<ll> total(n+2,0);
    rep(i,n+1){
        ll e = lower_bound(a.begin(),a.end(),b[i]) - a.begin();
        if(i==0) total[i+1] = e;
        else total[i+1] = total[i] + e;
    }
  
    rep(i,n){
        ll cnt = lower_bound(b.begin(),b.end(),c[i]) - b.begin();
        ans += total[cnt];       
    }

    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3328
#include <iostream>
#include <string>
#include <ctype.h>

using namespace std;

int main(){
    string S;
    cin >> S;
    if(S[0] != 'A'){
        cout << "WA" <<endl;
        return 0;
    }

    int count = 0;
    for(int i = 2; i < S.size() - 1; i++){
        if(S[i] == 'C'){
            count ++;
        }
    }
    if(count != 1){
        cout << "WA" << endl;
        return 0;
    }

    count = 0;
    for(int i = 0; i < S.size(); i++){
        if(isupper(S[i])){
            count ++;
        }
    }

    if(count != 2){
        cout << "WA" << endl;
        return 0;
    }

    cout << "AC" << endl;
    return 0;
}

Measured memory_bytes: 256
package main

import "fmt"

var A, B int

func main() {
	fmt.Scan(&A, &B)
	common := 0
	remain := 0
	if A >= B {
		common = B
		remain = A - B
	} else {
		common = A
		remain = B - A
	}
	remainArea := 16 - 2*common
	if remainArea/2 >= remain {
		fmt.Println("Yay!")
	} else {
		fmt.Println(":(")
	}
}


Measured memory_bytes: 512
#include<stdio.h>
int main() {
	double x[22], y[22], ans = 0;
	int n = 0;
	while (~scanf("%lf,%lf", &x[n], &y[n])) {
		n++;
	}
	double s;
	for (int i = 1; i < n; i++) {
		s = (x[i] - x[0])*(y[(i + 1)%n] - y[0]) - (x[(i + 1)%n] - x[0])*(y[i] - y[0]);
		if (s < 0)s = -s;
		ans += s;
	}
	printf("%.8lf", ans/2.0);
}


Measured memory_bytes: 2104
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long m = sc.nextLong();

		long[] a = new long[n + 1];
		for (int i = 0; i < n; i++) {
			a[i + 1] = sc.nextLong() % m;
		}

		Map<Long, List<Integer>> h = new HashMap<>();
		h.putIfAbsent(0L, new ArrayList<>());
		h.get(0L).add(0);

		long answer = 0;
		for (int i = 1; i <= n; i++) {
			a[i] = (a[i] + a[i - 1]) % m;
			answer += h.getOrDefault(a[i], new ArrayList<>()).size();
			h.putIfAbsent(a[i], new ArrayList<>());
			h.get(a[i]).add(i);
		}

		System.out.println(answer);
	}
}


Measured memory_bytes: 69456
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
# def LIST(): return list(map(str, input().split()))
# def LIST(): return list(input())

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

X, Y, Z = MAP()
X -= Z
y = Y + Z
print(X // y)   


Measured memory_bytes: 5588
#include <iostream>
#include <climits>
#include <bitset>
#include <stack>
#include <queue>
#include <iomanip>
#include <limits>
#include <string>
#include <cmath>
#include <set>
#include <map>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string.h>
 
using namespace std;
typedef long long ll;
 
 
typedef pair<ll,ll> P;
long long int INF = 1e18;
double Pi = 3.141592653589;
const int mod = 1000000007;
// memset(a,0,sizeof(a)); →全部０にする
 
vector<int> G[100005];
std::vector<P> tree[100010];
 
int dx[8]={1,0,-1,0,1,1,-1,-1};
int dy[8]={0,1,0,-1,1,-1,-1,1};
 
#define p(x) cout<<x<<endl;
#define el cout<<endl;
#define pe(x) cout<<x<<" ";
#define re(i,a,b) for(i=a;i<=b;i++)
 
ll i,j,k,ii,jj;
ll n,m,sum,num=INF;
ll ans;
ll a,b,c,d,e;
ll x[100005],y[100005],z[100005];
ll xa[100005],ya[100005],za[100005];
char s[15];

int main(){
	cin>>s;
	n=strlen(s);
	for(i=0;i<4;i++){
		cout<<s[i];
	}
	cout<<" ";
	for(i=4;i<12;i++){
		cout<<s[i];
	}
	el;
	return 0;
    

}

Measured memory_bytes: 5504
from functools import reduce
N, M = map(int, input().split())
L = 1 << N
table = {0: 0}
for _ in range(M):
    cost, _ = map(int, input().split())
    match = reduce(lambda a, b: a | b, (1 << shamt for shamt in map(lambda n: int(n) - 1, input().split())))
    for l, now in table.copy().items():
        table[l | match] = min(now + cost, table.get(l | match, 10 ** 7))
print(table[L - 1] if table.get(L - 1, False) else -1)

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

int main()
{string s;cin>>s;int c=0;
int l=0,r=s.size()-1;
for(int i=0;i<s.size()/2;i++)
{
    if(s[l]!=s[r])
    {
        c++;
    }
    l++;
    r--;
}
cout<<c<<endl;
}

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

int main(){
	ll D, N;
	cin >> D >> N;
	if (N == 100) N++;

	ll res = 1;
	for (ll i = 0; i < D; i++) res *= 100;
	res *= N;

	cout << res << endl;
	return 0;
}


Measured memory_bytes: 256
n = int(input())
s = input()
w = [0 for i in range(n)]
b = [0 for i in range(n)]
for i in range(n):
  b[i] = (0 if i==0 else b[i-1]) + (s[i]=='#')
  w[n-1-i] = (0 if i==0 else w[n-i]) + (s[n-1-i]=='.')
ans = 10000000000
for i in range(n+1):
  ans = min(ans, (0 if i==0 else b[i-1]) + (0 if i==n else w[i]))
print(ans)

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

using namespace std;

int main() {
	ios::sync_with_stdio(false);
	int n; cin>>n;
	string s;
	cin>>s;
	int cnt = 0;
	for (int i = 0; i + 2 < s.size(); i++)
		cnt += ("ABC" == s.substr(i, 3));
	cout<<cnt;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int M = 1e5+1;
string read(char v[]) {
    scanf("%s",v);
    return v;
}
vector<int> v[M];
bool vis[M];
int m, n, dp[M], x, y;
int dfs (int u){
    vis[u] = 1;
    for (auto x:v[u]){
        if (!vis[x])
        dfs(x);
        dp [u] = max(dp[u],1+dp[x]);
    }

}
int main() {
       scanf("%d %d",&n,&m);
       for (int i=0;i<m;i++){
            scanf("%d %d",&x,&y);
            v[x].push_back(y);
       }
    for (int i=1;i<=n;i++)
        if (!vis[i])dfs(i);
    printf("%d",*max_element(dp+1,dp+n+1));
}


Measured memory_bytes: 8192
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define bit(n) (1<<(n))
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
template < typename T > string tost( const T& n ) { ostringstream stm; stm << n; return stm.str();}
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 const INF = 1001001001;


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

int a,b,c; cin >> a >> b >> c;
if(a + b >= c) cout << "Yes" << endl;
else cout << "No" << endl;

return 0;
}

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

#define int             long long int
#define ld              long double
#define ff              first
#define ss              second
#define mp              make_pair
#define pb              push_back
#define endl            "\n"

#define si              set <int>
#define vi              vector <int>
#define pii             pair <int, int>
#define vpii            vector <pii>
#define mii             map <int, int>
#define que_max         priority_queue <int>
#define que_min         priority_queue <int, vi, greater<int>>

#define loop(i,s,e)     for(int i=s;i<e;i++)
#define rloop(i,e,s)    for(int i=e;i>=s;i--)
#define mset(a,f)       memset(a,f,sizeof(a))


#define M               1000000007
#define sz(x)           ((int) x.size())
#define all(p)          p.begin(), p.end()

#define bug(...)        __f (#__VA_ARGS__, __VA_ARGS__)
#define print(a)        for (auto x : a) cout << x << " "; cout << endl
#define Print(a,x,y)    for (int i=x; i<y; i++) cout<< a[i]<< " "; cout << endl

inline int power(int a, int b)
{
	int x = 1;
	while (b)
	{
		if (b & 1) x *= a;
		a *= a;
		b >>= 1;
	}
	return x;
}

template <typename Arg1>
void __f (const char* name, Arg1&& arg1) { cout << name << " : " << arg1 << endl; }
template <typename Arg1, typename... Args>
void __f (const char* names, Arg1&& arg1, Args&&... args)
{
	const char* comma = strchr (names + 1, ',');
	cout.write (names, comma - names) << " : " << arg1 << " | "; __f (comma + 1, args...);
}

const int N = 3e5 + 7;
vector <vi > adj;
const int inf = INT_MAX;
const long long INF = LLONG_MAX;
bool vis[N];
int a[25][25];

int dp[22][1 << 22];
int n;
int go(int idx, int mask)
{
	int &ans = dp[idx][mask];
	if (idx == n and mask == ((1 << n) - 1))
	{
		//bug(mask);
		return ans = 1;
	}
	if (idx == n) return ans = 0;

	if (ans != -1) return ans;

	int res = 0;
	loop(j, 0, n)
	{
		if ( a[idx][j] == 1 and (mask & (1 << j)) == 0 )
		{
			//bug(mask);
			int nw = mask ^ (1 << j);
			res += go(idx + 1, nw);

		}
	}
	return ans = res % M;
}

void solve()
{
	//int n;
	cin >> n;
	loop(i, 0, n)
	{
		loop(j, 0, n)
		cin >> a[i][j];
	}
	mset(dp, -1);
	cout << go(0, 0) << endl;

	return;

}

int32_t main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

	cout << setprecision(9) << fixed;

	int t = 1;
	//cin >> t;
	while (t--)
	{
		solve();
	}


	return 0;
}


Measured memory_bytes: 721152
#include <iostream>
#include <vector>
#include <string>

using namespace std;

int main() {
    int n;
    cin >> n;
    vector<string> blue(n);
    for (int i = 0; i < n; i++) {
        cin >> blue[i];
    }
    int m;
    cin >> m;
    vector<string> red(m);
    for (int i = 0; i < m; i++) {
        cin >> red[i];
    }

    int ans = 0;
    auto calc = [&](string s) {
        int buf = 0;
        for (string t: blue) {
            if (t == s) buf++;
        }
        for (string t: red) {
            if (t == s) buf--;
        }
        return buf;
    };

    for (string t: blue) {
        ans = max(ans, calc(t));
    }

    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3592
use std::fmt;
use std::cmp;
use std::io::stdin;
use std::io::BufRead;
use std::str;
use std::str::FromStr;

fn main() {
	let stdin = stdin();
	let mut scan = InputScanner::new(stdin.lock(),256);

	let n:usize = scan.next();

	let a:Vec<Vec<usize>> = (0..2).map(|_| {
		(0..n).map(|_| scan.next()).collect::<Vec<usize>>()
	}).collect::<Vec<Vec<usize>>>();

	let mut dp = (0..2).map(|_| {
		(0..n).map(|_| 0).collect::<Vec<usize>>()
	}).collect::<Vec<Vec<usize>>>();

	dp[0][0] = a[0][0];
	dp[1][0] = dp[0][0] + a[1][0];

	for i in 1..n {
		dp[0][i] = dp[0][i-1] + a[0][i];
		dp[1][i] = cmp::max(dp[0][i],dp[1][i-1]) + a[1][i];
	}

	println!("{}",dp[1][n-1]);
}
struct InputScanner<R: BufRead> {
	reader: R,
	buf: Vec<u8>, // Should never be empty
	pos: usize,   // Should never be out of bounds as long as the input ends with '\n'
}
impl<R: BufRead> InputScanner<R> {
	fn new(reader: R, capacity: usize) -> Self {
		InputScanner {
			reader: reader,
			buf: Vec::with_capacity(capacity),
			pos: 0,
		}
	}

	#[inline]
	fn next<T: FromStr>(&mut self) -> T
	where
		T::Err: fmt::Debug,
	{
		if self.buf.is_empty() {
			self._read_next_line();
		}
		let mut start = None;
		loop {
			match (self.buf[self.pos], start.is_some()) {
				(b' ', true) | (b'\n', true) | (b'\r', true) => break,
				(_, true) | (b' ', false) => self.pos += 1,
				(b'\n', false) | (b'\r', false) => self._read_next_line(),
				(_, false) => start = Some(self.pos),
			}
		}
		let target = &self.buf[start.unwrap()..self.pos];
		unsafe { str::from_utf8_unchecked(target) }.parse().unwrap()
	}

	#[inline]
	fn _read_next_line(&mut self) {
		self.pos = 0;
		self.buf.clear();
		if self.reader.read_until(b'\n', &mut self.buf).unwrap() == 0 {
			panic!("Reached EOF");
		}
	}
}


Measured memory_bytes: 4352
#!/usr/bin/env python3

import bisect

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
assert len(a) == len(b) == len(c) == n

a = sorted(a)
b = sorted(b)
c = sorted(c)

def num(top, bottoms):
    nu = bisect.bisect(bottoms, top)
    return n - nu

def numb(bottom, tops):
    nu = bisect.bisect_left(tops, bottom)
    return nu

res = 0
for i in range(n):
    res += num(b[i], c) * numb(b[i], a)
print(res)


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

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef double ld;
#define int ll
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<vvc> vvvc;
typedef pair<int, int> pii;
typedef pair<pii, pii> piii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector< vi > vvi;
typedef vector< vvi > vvvi;
typedef vector<short> vs;
typedef vector<vs> vvs;
typedef vector<vvs> vvvs;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
typedef vector<ld> vld;
typedef vector<vld> vvld;
typedef vector<vvld> vvvld;
typedef vector<string> vst;
typedef vector<vst> vvst;
typedef pair<ld, ld> pld;

#define inmin(a, b) a = min(a, (b))
#define inmax(a, b) a = max(a, (b))
#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()
#define sqr(x) ((x) * (x))
#define fori(i, n) for(int i = 0; i < int(n); ++i)
#define SZ(a) ((int)((a).size()))
#define triple(T) tuple<T, T, T>
#define quad(T) tuple<T, T, T, T>
#define watch(x) cerr << (#x) << " = " << (x) << endl;

#ifdef RUS_HOME
#define cerr cout
#else
#define cerr if (false) cerr
#endif

const double PI = 2 * acos(0.0);
#define rand shittttty_shit
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
mt19937_64 rng_64(chrono::steady_clock::now().time_since_epoch().count());

const string DIGITS = "0123456789";
const string ALPH = "abcdefghijklmnopqrstuvwxyz";


template <class T0, class T1>
inline ostream & operator << (ostream &out, pair<T0, T1> &a) {
    return out << "{" << a.first << ", " << a.second << "}";
}

template <class T0, class T1>
inline istream & operator >> (istream &in, pair<T0, T1> &a) {
    return in >> a.first >> a.second;
}

template <class T0, class T1, class T2>
inline ostream & operator << (ostream &out, tuple<T0, T1, T2> &a) {
    return out << "{" << get<0>(a) << ", " << get<1>(a) << ", " << get<2>(a) << "}";
}

template <class T0, class T1, class T2, class T3>
inline ostream & operator << (ostream &out, tuple<T0, T1, T2, T3> &a) {
    return out << "{" << get<0>(a) << ", " << get<1>(a) << ", " << get<2>(a) << ", " <<  get<3>(a) << "}";
}

template<class T>
inline ostream & operator << (ostream &out, vector<T> &a) {
    out << "[";
    fori (i, a.size())
        out << a[i] << vector<string>{", ", "]  "}[i + 1 == a.size()];
    return out;
}


void smain();



signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
#ifdef RUS_HOME
    freopen("input", "r", stdin);
    clock_t start = clock();
#endif
    cout << setprecision(12) << fixed;
    smain();
#ifdef RUS_HOME
    cout << "\n\n\n\nTOTAL EXECUTION TIME: " << float( clock () - start ) /  CLOCKS_PER_SEC << endl;
#endif
    return 0;
}



void smain(){


    ld n;
    cin>>n;
    ld v=n/3;
    cout<<v*v*v;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std::literals::string_literals;
using i64 = std::int_fast64_t;
using std::cout;
using std::cerr;
using std::endl;
using std::cin;

template<typename T>
std::vector<T> make_v(size_t a){return std::vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return std::vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

int main() {
	int n; scanf("%d", &n);
	std::vector<int> x(n), y(n), a(n), b(n);
	for(int i = 0; i < n; i++) {
		scanf("%d%d", &x[i], &y[i]);

		a[i] = x[i] - y[i];
		b[i] = x[i] + y[i];
	}
	sort(begin(a), end(a));
	sort(begin(b), end(b));

	int ans = std::max(std::abs(a.back() - a.front()), std::abs(b.back() - b.front()));
	printf("%d\n", ans);
	return 0;
}


Measured memory_bytes: 6452
#pragma region head
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repp(i, a, b) for (int i = a; i <= (b); ++i)
#define repr(i, a, b) for (int i = a; i >= (b); --i)
#define bit(n) (1LL << (n))
#define len(x) ((ll)(x).size())
#define debug(var) cout << "[" << #var << "]\n" << var << endl
#define test(s) \
  if (!(s))     \
    cout << "Line " << __LINE__ << ": [" << #s << "] is false" << endl;
#define int long long
typedef long long ll;
#define double long double
typedef double ld;
const int INF = 1001001001001001001ll;
const ll LINF = 1001001001001001001ll;
const int MOD = 1000000007;
const double EPS = 1e-9;
const double PI = acos(-1.0);

template <typename T>
ostream& operator<<(ostream& s, const vector<T>& v) {
  int len = v.size();
  for (int i = 0; i < len; ++i) {
    s << v[i];
    if (i < len - 1)
      s << ' ';
  }
  return s;
}

template <typename T>
ostream& operator<<(ostream& s, const vector<vector<T>>& vv) {
  int len = vv.size();
  for (int i = 0; i < len; ++i) {
    s << vv[i];
    if (i != len - 1)
      s << '\n';
  }
  return s;
}

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;
}

__attribute__((constructor)) void initial() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
}
#pragma endregion

signed main() {
  int H, W;
  cin >> H >> W;
  vector<vector<char>> c(H, vector<char>(W));
  rep(i, H) {
    rep(j, W) {
      cin >> c[i][j];
    }
  }

  int ans = 0;
  rep(j, W - 1) {
    vector<char> a(H), b(H);
    rep(i, H) {
      a[i] = c[i][j], b[i] = c[i][j + 1];
    }

    vector<vector<int>> cost(H + 1, vector<int>(H + 1));
    rep(i, H) {
      rep(j, H) {
        cost[i + 1][j + 1] = cost[i][j] + (a[i] == b[j]);
      }
    }

    vector<vector<int>> dp(H + 1, vector<int>(H + 1, INF));
    rep(i, H + 1) {
      dp[i][0] = dp[0][i] = 0;
    }

    repp(i, 1, H) {
      repp(j, 1, H) {
        chmin(dp[i][j], dp[i - 1][j] + cost[i][j]);
        chmin(dp[i][j], dp[i][j - 1] + cost[i][j]);
      }
    }
    ans += dp[H][H];
  }
  cout << ans << endl;
}

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

#define rep(i,n) for(long long int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(long long int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(long long int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define Abs(a,b) max(a,b)-min(a,b)
#define YES(condition) if(condition){cout << "YES" << endl;}else{cout << "NO" << endl;}
#define Yes(condition) if(condition){cout << "Yes" << endl;}else{cout << "No" << endl;}
#define Cout(x) cout<<(x)<<endl
#define POSSIBLE(condition) if(condition){cout << "POSSIBLE" << endl;}else{cout << "IMPOSSIBLE" << endl;}
#define Possible(condition) if(condition){cout << "Possible" << endl;}else{cout << "Impossible" << endl;}
#define possible(condition) if(condition){cout << "possible" << endl;}else{cout << "impossible" << endl;}
#define Size(n) (n).size()

typedef long long ll;


using namespace std;

const int INF = 1e9,MOD = 1e9 + 7,ohara = 1e6;
const ll LINF = 1e18;


long long int n,cnt=0,ans=0,a,b,c,d,cmp,cmpp,m,h,w,x,y,sum=0,pos;
int dy[]={1,0,-1,0};
int dx[]={0,1,0,-1};
char board[100][100],s[100][100];
bool fl;
struct edge{int to,cost;};

//-------------------------↓↓↓↓↓↓------------------------

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

      
      cin>>n>>m;
      rep(i,n)rep(j,n)cin>>board[i][j];
      rep(i,m)rep(j,m)cin>>s[i][j];

      rep(i,n){
        rep(j,n){
          fl=true;
          rrep(y,0,m){
            rrep(x,0,m){
              if(board[i+y][j+x]!=s[y][x])fl=false;
            }
          }
          if(fl){
            Cout("Yes");
            return 0;
          }
        }
      }
      Cout("No");
     

       
return 0;
}


Measured memory_bytes: 256
import math
n=int(input())
c=[]
for i in range(n):
  x,y=[int(x) for x in input().split()]
  c.append([x,y])
d=0
for i in range(n-1):
  for j in range(i+1,n):
    d+=math.sqrt((c[i][0]-c[j][0])**2+(c[i][1]-c[j][1])**2)
print(2*d/n)

Measured memory_bytes: 9140
from heapq import heappop, heappush
X, Y, Z, K = map(int, input().split())
A = sorted(list(map(int,input().split())), reverse=True)
B = sorted(list(map(int,input().split())), reverse=True)
C = sorted(list(map(int,input().split())), reverse=True)

queue = []

for x in range(X):
  for y in range(Y):
    if x * y > K:
      break

    for z in range(Z):
      if x * y * z > K:
        break

      val = A[x] + B[y] + C[z]
      heappush(queue, -val)

for _ in range(K):
  print(-heappop(queue))

Measured memory_bytes: 127456
#include<cstdio>
#include<cstdlib>
#include<string>
#include<iostream>
using namespace std;

struct Node{
  int key;
  Node *right, *left, *parent;
};

Node *root, *NIL;

Node * treeMinimum(Node *x) {
  while( x->left != NIL ) x = x->left;
  return x;
}

Node * find(Node *u, int k) {
  while( u != NIL && k != u->key ) {
    if ( k < u->key ) u = u->left;
    else u = u->right;
  }
  return u;
}

Node * treeSuccessor(Node *x) {
  if ( x->right != NIL ) return treeMinimum(x->right);
  Node *y = x->parent;
  while( y != NIL && x == y->right ) {
    x = y;
    y = y->parent;
  }
  return y;
}

void treeDelete(Node *z) {
  Node *y; // 削除する対象
  Node *x; // yの子
  
  //削除する節点を求める
  if ( z->left == NIL || z->right == NIL ) y = z;
  else y = treeSuccessor(z);
  
  
  // yの子xを決める
  if ( y->left != NIL ) {
    x = y->left;
  } else {
    x =y->right;
  }
  
  if( x != NIL ) {
    x->parent = y->parent;
  }
  
  if( y->parent == NIL ) {
    root = x;
  } else {
    if ( y == y->parent->left) {
      y->parent->left = x;
    } else {
      y->parent->right = x;
    }
  }
  
  if ( y != z ) {
    z->key = y->key;
  }
  
  free(y);
}

void insert(int k){
  Node *y = NIL;
  Node *x = root;
  Node *z;
  
  z = (Node *)malloc(sizeof(Node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;
  
  while( x != NIL ){
    y = x;
    if( z->key < x->key ){
      x = x->left;
    } else {
      x = x->right;
    }
  }
  
  z->parent = y;
  if( y == NIL ){
    root = z;
  } else {
    if( z->key < y->key ){
      y->left = z;
    } else {
      y->right = z;
    }
  }
}

void inorder(Node *u) {
  if ( u == NIL ) return;
  inorder(u->left);
  printf(" %d",u->key);
  inorder(u->right);
}
void preorder(Node *u) {
  if ( u == NIL ) return;
  printf(" %d",u->key);
  preorder(u->left);
  preorder(u->right);
}

int main() {
  int n, i, x;
  string com;
  
  scanf("%d", &n);
  
  for( i = 0; i < n; i++ ) {
    cin >> com;
    if ( com[0] == 'f' ) {
      scanf("%d", &x);
      Node *t = find(root, x);
      if ( t != NIL ) printf("yes\n");
      else printf("no\n");
    } else if ( com == "insert" ) {
      scanf("%d", &x);
      insert(x);
    } else if ( com == "print" ) {
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    } else if ( com == "delete" ) {
      scanf("%d", &x);
      treeDelete(find(root, x));
    }
  }
  
  return 0;
}


Measured memory_bytes: 21940
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class Main {
	public static void main(String args[] ) throws Exception {
		Scanner scanner = new Scanner(System.in);
		while(scanner.hasNext()){	
			int a = scanner.nextInt();//??????????????°??????????????????
			int b = scanner.nextInt();//????????????????????????????????°??????????????????
			int ans = a+b;
			ans = String.valueOf( ans ).length();
			System.out.println(ans);
		}
    }
}

Measured memory_bytes: 26392
INTEGER N
INTEGER L
CHARACTER(150),ALLOCATABLE,DIMENSION(:)::S
CHARACTER(150) AKIBAKO
CHARACTER(100500) ANSWER
!念の為制限字数より５０文字多めにとっておきます
!AKIBAKOは文字列を交換する用の入れ物です。
READ*,N,L
ALLOCATE(S(N))
READ*,S

!字引順に並び替えます
DO I=1,N
!S(I)を決めていきます
	DO J=I+1,N
		IF ( LGT(S(I),S(J)) ) THEN!LGTは文字列を比較する関数でこの場合入れ替える必要がある時TRUEを返します
			AKIBAKO=S(I)
			S(I)=S(J)
			S(J)=AKIBAKO
		ENDIF
	END DO    
END DO
!ソートおしまい

ANSWER=""
DO I=1,N
	ANSWER=TRIM(ANSWER)//TRIM(S(I))
END DO
PRINT"(A)",TRIM(ANSWER)
END

Measured memory_bytes: 512
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_multi_set;

#define mod         1000000007
#define pi          acos(-1.0)
#define eps         1e-9

#define fast       ios::sync_with_stdio(0); cin.tie(0);cout.tie(0)
#define fs          first
#define sc          second
#define pb         push_back
#define sp          printf(" ")
#define nl          '\n'
#define all(a) a.begin(),a.end()
#define unique(c) (c).resize(unique(all(c)) - (c).begin())
#define itn int

#define set0(a)     memset(a,0,sizeof(a))
#define setneg(a)   memset(a,-1,sizeof(a))
#define setinf(a)   memset(a,126,sizeof(a))

#define REP(i,start,end) for (int i = start; i <=end; i++)
#define RREP(i,end,start) for (int i=end; i>=start ;i--)

typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;
typedef pair<int, int> pii;
typedef pair<LL, LL> pll;
typedef pair<double, double> pdd;
typedef vector<int> vi;
typedef vector<LL> vll;
typedef vector<double> vd;
typedef vector<vector<LL> > matrix;
typedef vector<vector<int> > graph;


class seq{
    public:
    int low, high, bal, id;
    seq(int a,int b, int c,int d)
    {
        low=a;
        high=b;
        bal=c;
        id=d;
    }
};

bool custom(seq a , seq b)
{
    if(a.low==b.low)
        return a.bal>b.bal;
    return a.low<b.low;
}
bool custom2(seq a , seq b)
{
    if(a.high==b.high)
        return a.bal<b.bal;
    return a.high<b.high;

}
void solve()
{
    int n;
    cin>>n;
    vector<seq> vect1,vect2;
    REP(i,1,n)
    {
        string s;
        cin>>s;
        int low=0;
        int high=0;
        int bal=0;
        REP(j,0,s.size()-1)
        {
            bal+=(s[j]=='(');
            bal-=(s[j]==')');
            low=min(low,bal);
        }
        bal=0;
        RREP(j,s.size()-1,0)
        {
            bal-=(s[j]=='(');
            bal+=(s[j]==')');
            high=min(high,bal);
        }
        seq sq(-low,-high,-bal,i);
        if(bal<0)
            vect1.pb(sq);
        else
            vect2.pb(sq);
    }
    sort(all(vect1), custom);
    sort(all(vect2), custom2);
    int bal=0;
    if(vect1.size()>=1)
    {
        REP(i,0,vect1.size()-1)
        {
            if(vect1[i].low>bal)
            {
                cout<<"No"<<nl;
                return;
            }
            bal+=vect1[i].bal;
            
        }
    }
    int bal2=0;
    if(vect2.size()>=1)
    {
        REP(i,0,vect2.size()-1)
        {
            if(vect2[i].high>bal2)
            {
               
                cout<<"No"<<nl;
                return;
            }
            bal2-=vect2[i].bal;
        }
    }
    if(bal==bal2)
    {
        cout<<"Yes"<<nl;
    }
        
    else
        cout<<"No"<<nl;
}
int main()
{
    fast;
        solve();
}


Measured memory_bytes: 18968
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iostream>
#include <iostream>
#include <fstream>
#include <numeric>
#include <cstring>
#include <cassert>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <cmath>
#include <set>
#include <map>
#include <functional>
#include <bitset>
#include <iomanip>
#include <stack>
#include <list>
using namespace std;
#define ll           long long
#define all(v)       (v).begin() , (v).end()
#define vi           vector <ll>
#define vii          vector <pair<ll,ll>>
#define ii           pair<ll,ll>
#define sz(v)	     ((int)((v).size()))
#define lp(i,a,b)    for(int i=a;i<b;i++)
#define pb           push_back
#define pf           push_front
#define F            first
#define S            second
#define endl         "\n"
#define IOS          ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
const double PI = 3.14159265358979323846;
const ll inf=2e9,MOD=998244353,MAX=1e2+2;

int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    IOS;
    int n;
    cin>>n;
    int a[n],res=1e9;
    lp(i,0,n){
        cin>>a[i];
        int cnt=0;
        while(a[i]%2==0)
            a[i]/=2,cnt++;
        res=min(res,cnt);
    }
    cout<<res;
}

Measured memory_bytes: 3584
#include<bits/stdc++.h>
using namespace std;
#define rkc ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
typedef long long ll;
#define fl(i,a,b) for(ll i=a;i<b;i++)
#define rfl(i,a,b) for(ll i=a;i>b;i--)
#define pb push_back
#define mp make_pair
#define test ll t;cin>>t;while(t--)
#define lld long double
#define vpp vector<pair<ll,ll>>
#define ff first
#define ss second
const ll M = 1e9 + 7;
const double pi  =3.141592653589793238463;
int main()
{
    rkc;
    ll a,b;
    cin>>a>>b;
    if((a+b)%2!=0)
    cout<<"IMPOSSIBLE";
    else cout<<(a+b)/2;
}

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

int main() {
    int N; cin >> N;
    int Q; cin >> Q;
    string S; cin >> S;
    int l[Q];
    int r[Q];
    for (int i = 0; i < Q; ++i) cin >> l[i] >> r[i];
    
    int dp[N] = {0}; 

    int count = 0;
    for (int j = 1; j < N; ++j) {
        if (S[j-1] == 'A' && S[j] == 'C') ++count;
        dp[j] = count;
    }
    for (int i = 0; i < Q; ++i) {
        cout <<  dp[r[i]-1] - dp[l[i]-1] << endl;
    }
}

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

#define ll long long
const int mxm = 1e9+7;

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);
	int n,k;
	cin >> n >> k;
	vector <int> h(n);
	for(int i=0;i<n;i++) {
		cin >> h[i];
	}
	vector <int> dp(n,mxm);
	dp[0] = 0;
	for(int j=0;j<n-1;j++) {
		for(int l=1;l<=k;l++) {
			int i1 = j+l;
			if(i1 < n) {
				dp[i1] = min(dp[i1],dp[j] + abs(h[j] - h[i1]));
			}
		}
	}
	cout << dp[n-1] << '\n';
	return 0;
}

Measured memory_bytes: 1024
using System;
using System.IO;

class Solve{
    static void Main(string[] args){
        var arr = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
        var A = arr[0];
        var B = arr[1];
        var M = arr[2];
        var a = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
        var b = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
        var a_min = 100000;
        var b_min = 100000;
        for (int i = 0; i < A; i++){
            if (a[i] == 1){
                a_min = 1;
                break;}
            if (a[i] < a_min) a_min = a[i];}
        for (int i = 0; i < B; i++){
            if (b[i] == 1){
                b_min = 1;
                break;}
            if (b[i] < b_min) b_min = b[i];}
        var answer = a_min + b_min;
        for (int i = 0; i < M; i++){
                if (answer == 0) break;
                var xyc = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
                var disctTgt = a[xyc[0] - 1] + b[xyc[1] - 1] - xyc[2];
                answer = disctTgt < answer ? disctTgt : answer;}
        var writer = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
        Console.SetOut(writer);
        Console.WriteLine(answer);
        Console.Out.Flush();}}

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

	public class Main {

		static long mod = 1000000007;

		public static void main(String[] args) {

			Scanner sc = new Scanner(System.in);
			String[] t = sc.nextLine().split(" ");
			int n = Integer.parseInt(t[0]);
			int m = Integer.parseInt(t[1]);

			int[][] list = new int[m][2];
			long ans    = 0;
			for(int i = 0; i < m; i ++) {
				list[i] = new int[] {sc.nextInt(), sc.nextInt()};
			}

			Arrays.sort(list, (a, b) -> a[1] - b[1]);

			int cnt = 0;
			int max = 0;
			for(int i = 0; i < m; i++) {
				int[] pair = list[i];
				if(max <= pair[0]) {
					max = pair[1];
					cnt++;
				}
			}
			System.out.println(cnt);
		}
	}


Measured memory_bytes: 64892
import java.util.Scanner;	
public class Main{	
   public static void main(String args[]){	
      Scanner sc = new Scanner(System.in);	
      double radius = sc.nextDouble();	
      double area = Math.PI * (radius * radius);	
      System.out.printf("%.6f",area);	
      double circumference= Math.PI * 2*radius;	
      System.out.printf(" %.6f",circumference) ;	
   }	
}	
	


Measured memory_bytes: 28188
using System;
using System.Collections.Generic;
using System.Collections;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.IO;
using System.Reflection;
using static System.Math;
using System.Numerics;
static class Program{
	const int mod=(int)1e9+7;
	static void Main(){
		Sc sc=new Sc();
		var s=sc.S;
		var a=0;
		if(s=="SAT"){a=1;}
		if(s=="FRI"){a=2;}
		if(s=="THU"){a=3;}
		if(s=="WED"){a=4;}
		if(s=="TUE"){a=5;}
		if(s=="MON"){a=6;}
		if(s=="SUN"){a=7;}
		Console.WriteLine("{0}",a);
	}
}

public class Sc{
	public int I{get{return int.Parse(Console.ReadLine());}}
	public long L{get{return long.Parse(Console.ReadLine());}}
	public double D{get{return double.Parse(Console.ReadLine());}}
	public string S{get{return Console.ReadLine();}}
	public int[] Ia{get{return Array.ConvertAll(Console.ReadLine().Split(),int.Parse);}}
	public long[] La{get{return Array.ConvertAll(Console.ReadLine().Split(),long.Parse);}}
	public double[] Da{get{return Array.ConvertAll(Console.ReadLine().Split(),double.Parse);}}
	public string[] Sa{get{return Console.ReadLine().Split();}}
	public object[] Oa{get{return Console.ReadLine().Split();}}
	public int[] Ia2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),int.Parse);}}
	public int[] Ia3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),int.Parse);}
	public int[] Ia3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),int.Parse);}
	public long[] La2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),long.Parse);}}
	public long[] La3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),long.Parse);}
	public long[] La3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),long.Parse);}
	public T[] Arr<T>(int n,Func<T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f();}return a;}
	public T[] Arr<T>(int n,Func<int,T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i);}return a;}
	public T[] Arr<T>(int n,Func<string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(Console.ReadLine().Split());}return a;}
	public T[] Arr<T>(int n,Func<int,string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i,Console.ReadLine().Split());}return a;}
}

Measured memory_bytes: 11220
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>

#define PI 3.14159265358979323846
using namespace std;

int main() {
    long long x, count = 0;
    cin >> x;
    long long balance = 100;
    while (balance < x) {
        balance += balance / 100;
        count++;
    }

    cout << count << endl;
}

Measured memory_bytes: 3608
#include <bits/stdc++.h>
using namespace std;
long long MOD;
vector<int> parent(vector<vector<int>> &E, int r){
	int N = E.size();
	vector<int> p(N, -1);
	queue<int> Q;
	Q.push(r);
	while (!Q.empty()){
		int v = Q.front();
		Q.pop();
		for (int w : E[v]){
			if (p[w] == -1){
				p[w] = v;
				Q.push(w);
			}
		}
	}
	return p;
}
vector<vector<int>> child(vector<int> &p, int r){
	int N = p.size();
	vector<vector<int>> c(N);
	for (int i = 0; i < N; i++){
		if (i != r){
			c[p[i]].push_back(i);
		}
	}
	return c;
}
long long add(long long A, long long B){
  return A * B % MOD;
}
long long root(long long A){
  return (A + 1) % MOD;
}
long long dfs1(vector<long long> &dp, vector<vector<int>> &c, int v){
  dp[v] = 1;
  for (int w : c[v]) dp[v] = add(dp[v], root(dfs1(dp, c, w)));
  return dp[v];
}
void dfs2(vector<long long> &dp1, vector<long long> &dp2, vector<vector<int>> &c, int v){
  int deg = c[v].size();
  vector<long long> L(deg + 1, 1), R(deg + 1, 1);
  for (int i = 0; i < deg; i++) L[i + 1] = add(L[i], root(dp1[c[v][i]]));
  for (int i = deg - 1; i >= 0; i--) R[i] = add(R[i + 1], root(dp1[c[v][i]]));
  for (int i = 0; i < deg; i++){
    dp2[c[v][i]] = root(add(dp2[v], add(L[i], R[i + 1])));
    dfs2(dp1, dp2, c, c[v][i]);
  }
}
int main(){
  int N;
  cin >> N >> MOD;
  vector<vector<int>> E(N);
  for (int i = 0; i < N - 1; i++){
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    E[x].push_back(y);
    E[y].push_back(x);
  }
  vector<int> p = parent(E, 0);
  vector<vector<int>> c = child(p, 0);
  vector<long long> dp1(N, 1), dp2(N, 1);
  dfs1(dp1, c, 0);
  dfs2(dp1, dp2, c, 0);
  for (int i = 0; i < N; i++){
    cout << add(dp1[i], dp2[i]) << endl;
  }
}

Measured memory_bytes: 24960
#include<bits/stdc++.h>
using namespace std;
typedef long long  ll ;
typedef double db;
const double pi = 3.141592654;
#define pb         push_back
#define forab(i,a,b)       for(int i=(a);i<=(b);i++)
#define CIN	ios_base::sync_with_stdio(0); cin.tie(0)
#define pcase(z,x)     printf("Case %ld: %lld\n",z,x)
#define nw				"\n"
int main(void)
{
	CIN;
	ll tc,l,k,sum=0,x=0,y,z=0,m=1,n=0,ans=0,cnt=0;
	map<char,int>mp;
	char c;
	while(cin>>c){
		mp[c]++;
		if(mp[c]==2)return cout<<"no",0;
	}
	 cout<<"yes";
}

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

vector<int> to[100005];

int main() {
    int n, m;
    cin >> n >> m;
    rep(i,m) {
        int a, b;
        cin >> a >> b;
        a--; b--;
        to[a].push_back(b);
        to[b].push_back(a);
    }

    queue<int> q;
    vector<int> pre(n, -1);
    q.push(0); 
    while (!q.empty()) {
        int v= q.front();
        q.pop();
        for (int u : to[v]) {
            if (pre[u] != -1) continue;
            pre[u] = v;
            q.push(u);
        }
    }
    
    cout << "Yes" << endl;
    rep(i,n) {
        if (i == 0) continue;
        int ans = pre[i];
        ans++;
        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 10072
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include<stdio.h>
int gcd(int, int);
int main() {
	int x, y;
	for(;~fscanf(stdin,"%d%d", &x, &y);fprintf(stdout,"%d\n", gcd(x, y)));
	return 0;
}

int gcd(int x, int y) {
	int tmp;
	if (x < y) { tmp = x; x = y; y = tmp; }
	if (x%y == 0) return y;
	gcd(x%y, y);
}

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

int main() {
	long long int a,b,k;
	cin>>a>>b>>k;
	for(int i = min(a,b);i>=1;--i){
		if(a%i == 0 && b%i == 0){
			--k;
			if(k == 0){
				cout<<i<<endl;
				return 0;
			}
		}
	}
	return 0;
}

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

int main() {
    int64_t N;
    std::cin >> N;

    std::unordered_map<int, int> mp;

    int64_t A[N];
    for (int64_t i = 0; i < N; ++i) {
        std::cin >> A[i];
        mp[i + A[i]] += 1;
    }

    int64_t ans = 0;
    for (int64_t i = 0; i < N; ++i) {
        ans += mp[i - A[i]];
    }

    std::cout << ans << std::endl;

    return 0;
}


Measured memory_bytes: 20120
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
class Program
{
    static void Main()
    {
        //入力
        //int[] input = Console.ReadLine().Split().Select(i => int.Parse(i)).ToArray();
        //string[] input = Console.ReadLine().Split().Select(i => i).ToArray();
        //string input= Console.ReadLine();
        int[] input = new int[4];
        for(int a = 0; a < input.Length; a++)
        {
            input[a] = int.Parse(Console.ReadLine());
        }
        Console.WriteLine(input[0]<input[1]?input[2]*input[0]:input[2]*input[1]+(input[0]-input[1])*input[3]);


        /*
        //処理速度計測
        var sw = new System.Diagnostics.Stopwatch();
        sw.Start();
        //解法
 
        //処理速度表示
        sw.Stop();
        TimeSpan ts = sw.Elapsed;
        Console.WriteLine((int)(Math.Floor((ts).TotalMilliseconds))+"ms");
        */
        Console.ReadLine();

    }
}

Measured memory_bytes: 11092
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <cassert>
using namespace std;
using ll = long long;
const int INF = 1<<30;
const int MOD = 1e9 + 7;
const int MAX_N = 1e6;
signed main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    vector<int> prime(MAX_N, 1);
    prime[0] = prime[1] = 0;
    for(int i = 2; i * i < MAX_N; i++)
    {
        for(int j = 2 * i; j <= MAX_N; j += i) prime[j] = 0;
    }
    int n; cin >> n;
    vector<int> ans;
    for(int i = 6; i <= MAX_N; i += 5)
    {
        if(ans.size() == n) break;
        if(prime[i]) ans.push_back(i);
    }
    for(int x : ans) cout << x << " "; cout << endl;
    return 0;
}



Measured memory_bytes: 4224
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string S;
  cin >> S;
  string r = "ARC";
  string b = "ABC";
  if (S == r)
  {
    cout << b << endl;
  }
  else
  {
    cout << r << endl;
  }
}

Measured memory_bytes: 3568
#include<bits/stdc++.h>
using namespace std;
int main(void)
{
	long long ans=0,n,m;
	cin>>n>>m;
	for(int i=m;i<=n+1;i++)
	ans+=i*(n+1-i)+1;
	ans%=1000000007;
	cout<<ans;
	return 0;
 } 

Measured memory_bytes: 3640
#include<iostream>
#define Z (2<<17)
using namespace std;
const long mod=998244353;
long power(long a,long b){return b?power(a*a%mod,b/2)*(b%2?a:1)%mod:1;}
long fac[Z],inv[Z],ans,N,M,K;
int main()
{
	fac[0]=1;
	for(int i=1;i<Z;i++)fac[i]=fac[i-1]*i%mod;
	inv[(Z)-1]=power(fac[Z-1],mod-2);
	for(int i=Z-1;i--;)inv[i]=inv[i+1]*(i+1)%mod;
	cin>>N>>M>>K;
	for(int L=0;L<=K;L++)ans+=fac[N-1]*inv[N-1-L]%mod*inv[L]%mod*M%mod*power(M-1,N-L-1)%mod;
	cout<<(ans%mod+mod)%mod<<endl;
}


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

#define ll long long int
#define uul unsigned long long int
#define ui uint64_t
#define max(a,b) (a>b)?a:b
#define min(a,b) (a<b)?a:b
#define ma 1000000007

int main()
{

    ll n,i,j=0;
    cin>>n;
    string s;
    cin>>s;
    for(i=1;i<n;i++)
    {
        if(s[i]!=s[i-1])
            j++;
    }
    cout<<j+1<<endl;

}


Measured memory_bytes: 512